QRhiSwapChainHdrInfo Struct

Describes the high dynamic range related information of the swapchain's associated output. 更多...

头: #include <QRhiSwapChainHdrInfo>
CMake: find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
qmake: QT += gui
Since: Qt 6.6

公共类型

enum LimitsType { LuminanceInNits, ColorComponentValue }

公共变量

bool isHardCodedDefaults
union (anonymous union at /data/snapshot-qt6-6.6-rel/qt5/qtbase/src/gui/rhi/qrhi.h:1481:5) limits
QRhiSwapChainHdrInfo::LimitsType limitsType

详细描述

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.

注意: This is a RHI API with limited compatibility guarantees, see QRhi 了解细节。

另请参阅 QRhiSwapChain::hdrInfo ().

成员类型文档编制

enum QRhiSwapChainHdrInfo:: LimitsType

常量 描述
QRhiSwapChainHdrInfo::LuminanceInNits 0 Indicates that the limits union has its luminanceInNits struct set
QRhiSwapChainHdrInfo::ColorComponentValue 1 Indicates that the limits union has its colorComponentValue struct set

成员变量文档编制

bool QRhiSwapChainHdrInfo:: isHardCodedDefaults

Set to true when the data in the QRhiSwapChainHdrInfo consists entirely of the hard-coded default values, for example because there is no way to query the relevant information with a given graphics API or platform. (or because querying it can be achieved only by means, e.g. platform APIs in some other area, that are out of scope for the QRhi layer of the Qt graphics stack to handle)

另请参阅 QRhiSwapChain::hdrInfo ().

union ( anonymous union at / data / snapshot - qt6 - 6 . 6 - rel / qt5 / qtbase / src / gui / rhi / qrhi . h:1481:5 ) QRhiSwapChainHdrInfo:: limits

Contains the actual values queried from the graphics API or the platform. The type of data is indicated by limitsType . This is therefore a union. There are currently two options:

Luminance values in nits:

struct {
    float minLuminance;
    float maxLuminance;
} luminanceInNits;
					

Whereas for macOS/iOS, the current maximum and potential maximum color component values are provided:

struct {
    float maxColorComponentValue;
    float maxPotentialColorComponentValue;
} colorComponentValue;
					

另请参阅 QRhiSwapChain::hdrInfo ().

QRhiSwapChainHdrInfo::LimitsType QRhiSwapChainHdrInfo:: limitsType

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. This value indicates what kind of information is available in limits .

另请参阅 QRhiSwapChain::hdrInfo ().