![]() |
Qt 6.x
The Qt SDK
|
\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... | |
Public Attributes | ||
bool | isHardCodedDefaults | |
LimitsType | limitsType | |
union { | ||
struct { | ||
float minLuminance | ||
float maxLuminance | ||
} luminanceInNits | ||
struct { | ||
float maxColorComponentValue | ||
float maxPotentialColorComponentValue | ||
} colorComponentValue | ||
} | limits | |
\inmodule QtGui
Describes the high dynamic range related information of the swapchain's associated output.
To perform tonemapping, 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, 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).
The struct returned from QRhiSwapChain::hdrInfo() contains either some hard-coded defaults, indicated by the isHardCodedDefaults
field, or real values received from an API such as DXGI (IDXGIOutput6) or Cocoa (NSScreen). The default is 1000 nits for maximum luminance.
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 and isHardCodedDefaults
is always true.
struct { ... } QRhiSwapChainHdrInfo::colorComponentValue |
Referenced by QMetalSwapChain::isFormatSupported().
union { ... } QRhiSwapChainHdrInfo::limits |
Referenced by QMetalSwapChain::isFormatSupported().
LimitsType QRhiSwapChainHdrInfo::limitsType |
struct { ... } QRhiSwapChainHdrInfo::luminanceInNits |
float QRhiSwapChainHdrInfo::maxPotentialColorComponentValue |
Definition at line 1496 of file qrhi.h.
Referenced by QMetalSwapChain::isFormatSupported().