Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
|
\inmodule QtGui More...
#include <qrhi.h>
Public Types | |
enum | LimitsType { LuminanceInNits , ColorComponentValue } |
\value LuminanceInNits Indicates that the \l limits union has its luminanceInNits struct set More... | |
enum | LuminanceBehavior { SceneReferred , DisplayReferred } |
\value SceneReferred Indicates that the color value of 1.0 is interpreted as 80 nits. More... | |
Public Attributes | ||
LimitsType | limitsType | |
union { | ||
struct { | ||
float minLuminance | ||
float maxLuminance | ||
} luminanceInNits | ||
struct { | ||
float maxColorComponentValue | ||
float maxPotentialColorComponentValue | ||
} colorComponentValue | ||
} | limits | |
LuminanceBehavior | luminanceBehavior | |
float | sdrWhiteLevel | |
\inmodule QtGui
Describes the high dynamic range related information of the swapchain's associated output.
To perform HDR-compatible tonemapping, where the target range is not [0,1], one often needs to know the maximum luminance of the display the swapchain's window is associated with. While this is often made user-configurable (think brightness, gamma and similar settings in games), it can be highly useful to set defaults based on the values reported by the display itself, thus providing a decent starting point.
There are some problems however: the information is exposed in different forms on different platforms, whereas with cross-platform graphics APIs there is often no associated solution at all, because managing such information is not in the scope of the API (and may rather be retrievable via other platform-specific means, if any).
With Metal on macOS/iOS, there is no luminance values exposed in the platform APIs. Instead, the maximum color component value, that would be 1.0 in a non-HDR setup, is provided. The limitsType
field indicates what kind of information is available. It is then up to the clients of QRhi to access the correct data from the limits
union and use it as they see fit.
With an API like Vulkan, where there is no way to get such information, the values are always the built-in defaults.
Therefore, the struct returned from QRhiSwapChain::hdrInfo() contains either some hard-coded defaults or real values received from an API such as DXGI (IDXGIOutput6) or Cocoa (NSScreen). When no platform queries are available (or needs using platform facilities out of scope for QRhi), the hard-coded defaults are a maximum luminance of 1000 nits and an SDR white level of 200.
The struct also exposes the presumed luminance behavior of the platform and its compositor, to indicate what a color component value of 1.0 is treated as in a HDR color buffer. In some cases it will be necessary to perform color correction of non-HDR content composited with HDR content. To enable this, the SDR white level is queried from the system on some platforms (Windows) and exposed here.
\value SceneReferred Indicates that the color value of 1.0 is interpreted as 80 nits.
This is the behavior of HDR-enabled windows with the Windows compositor. See \l{https://learn.microsoft.com/en-us/windows/win32/direct3darticles/high-dynamic-range}{this page} for more information on HDR on Windows.
\value DisplayReferred Indicates that the color value of 1.0 is interpreted as the value of the SDR white. (which can be e.g. 200 nits, but will vary depending on screen brightness) This is the behavior of HDR-enabled windows on Apple platforms. See \l{https://developer.apple.com/documentation/metal/hdr_content/displaying_hdr_content_in_a_metal_layer}{this page} for more information on Apple's EDR system.
Enumerator | |
---|---|
SceneReferred | |
DisplayReferred |
struct { ... } QRhiSwapChainHdrInfo::colorComponentValue |
union { ... } QRhiSwapChainHdrInfo::limits |
Referenced by QSGVideoMaterialRhiShader::updateUniformData().
LimitsType QRhiSwapChainHdrInfo::limitsType |
Definition at line 1522 of file qrhi.h.
Referenced by QSGVideoMaterialRhiShader::updateUniformData().
LuminanceBehavior QRhiSwapChainHdrInfo::luminanceBehavior |
struct { ... } QRhiSwapChainHdrInfo::luminanceInNits |