Details
-
Epic
-
Resolution: Unresolved
-
P2: Important
-
None
-
None
-
None
-
Color Management and HDR
-
-
a3a691c5a (dev), 938df7908 (dev), 85ec8df82 (6.8)
Description
This epic tracks the items needed to support wide gamut and high dynamic range in Qt, from the bottom of the stack all the way though to Qt Quick and Qt Multimedia. The topics of color management and HDR are tracked as one, due to their overlapping requirements and tight coupling.
Color Management
Qt Gui
On a cross platform level we have QColorSpace, QColorTransform, and helpers on e.g. QImage for color transformations.
On the QPA level the building blocks are QWindow and its associated QSurfaceFormat, and the properties of the QScreen.
A client that presents assets (colors, images, etc) from different sources with different input color spaces needs to target a single color space in its color management pipeline (for example sRGB). The client has two options here:
- Set the target color space on the window's surface format
- And verify that the requested format was picked up after creation
- If the compositor is not able to do color matching on the compositor side between multiple windows (all targeting a single screen color space), or can't support the given requested color space, then the request may fail and the window may report an effective color space that matches the screen.
- And verify that the requested format was picked up after creation
- Leave the color space of the window to the default surface format
- Read the resulting color space from the window after creation and use that as the target color space.
Approach #1 may use approach #2 as a fallback in case the compositor is unable to satisfy the requested color space, or may report a warning/error that color accurate rendering can not be supported.
The following manual test shows the difference between the two approaches: https://codereview.qt-project.org/c/qt/qtbase/+/595168
An alternative for color matching content within a window (via QColorTransform or similar) is to break the window up into child QWindows, and use approach #1 to let the compositor do the color matching. This approach can be selectively used as a workaround, but does not scale well if entire UI hierarchies need to be backed by individual QWindows.
Qt Widgets
Qt Widgets does not do any automatic color management today, and doing so is not in scope for this epic at this point. Widget based apps can still color match manually via QColorTransform and friends, or use the child window approach for select widgets as a workaround.
Qt Quick
Qt Multimedia
HDR
Attachments
1.
|
Expose QScreen::colorSpace() | Reported | Tor Arne Vestbø | |
2.
|
Investigate QPA enablers for color space and HDR | Reported | Tor Arne Vestbø |
Gerrit Reviews
For Gerrit Dashboard: QTBUG-129499 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
595168,6 | Add manual test for QtGui color management | dev | qt/qtbase | Status: MERGED | +2 | 0 |
595175,4 | macOS: Reflect QWindow's color space after creation | dev | qt/qtbase | Status: MERGED | +2 | 0 |
597660,2 | macOS: Reflect QWindow's color space after creation | 6.8 | qt/qtbase | Status: MERGED | +2 | 0 |