Skip to content

Add support for converting SRGB to BT2020.#5

Merged
hgaiser merged 1 commit intomainfrom
hdr-support-2
Mar 10, 2026
Merged

Add support for converting SRGB to BT2020.#5
hgaiser merged 1 commit intomainfrom
hdr-support-2

Conversation

@hgaiser
Copy link
Owner

@hgaiser hgaiser commented Mar 10, 2026

No description provided.

@hgaiser hgaiser requested a review from Copilot March 10, 2026 19:19
@hgaiser hgaiser changed the title Add support for converting SRRGB to BT2020. Add support for converting SRGB to BT2020. Mar 10, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds an explicit “sRGB → BT.2020 + PQ” conversion mode to the GPU color converter so SDR (sRGB-encoded) content can be encoded into an HDR (BT.2020/PQ) stream.

Changes:

  • Adds a new ColorSpace::SrgbToBt2020Pq variant and a set_color_space() setter on ColorConverter.
  • Extends the compute shader with sRGB inverse EOTF, BT.709→BT.2020 gamut mapping, and PQ OETF for the new mode.
  • Adjusts BT.2020 coefficient selection to also cover the new mode.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/converter/shader.rs Adds sRGB→linear, BT.709→BT.2020 matrix, and PQ encoding path in read_rgb(); updates BT.2020 selection logic.
src/converter/mod.rs Adds new ColorSpace variant and a runtime set_color_space() API.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@hgaiser hgaiser merged commit f6aed7c into main Mar 10, 2026
6 checks passed
@hgaiser hgaiser deleted the hdr-support-2 branch March 10, 2026 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants