Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QRhiSwapChainHdrInfo Struct Reference

\inmodule QtGui More...

#include <qrhi.h>

+ Collaboration diagram for QRhiSwapChainHdrInfo:

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 
 

Detailed Description

\inmodule QtGui

Since
6.6

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.

Note
This is a RHI API with limited compatibility guarantees, see \l QRhi for details.
See also
QRhiSwapChain::hdrInfo()

Definition at line 1481 of file qrhi.h.

Member Enumeration Documentation

◆ LimitsType

\value LuminanceInNits Indicates that the \l limits union has its luminanceInNits struct set

\value ColorComponentValue Indicates that the \l limits union has its colorComponentValue struct set

Enumerator
LuminanceInNits 
ColorComponentValue 

Definition at line 1484 of file qrhi.h.

Member Data Documentation

◆ [struct]

struct { ... } QRhiSwapChainHdrInfo::colorComponentValue

◆ isHardCodedDefaults

bool QRhiSwapChainHdrInfo::isHardCodedDefaults

Definition at line 1483 of file qrhi.h.

◆ [union]

union { ... } QRhiSwapChainHdrInfo::limits

◆ limitsType

LimitsType QRhiSwapChainHdrInfo::limitsType

Definition at line 1488 of file qrhi.h.

◆ [struct]

struct { ... } QRhiSwapChainHdrInfo::luminanceInNits

◆ maxColorComponentValue

float QRhiSwapChainHdrInfo::maxColorComponentValue

Definition at line 1495 of file qrhi.h.

◆ maxLuminance

float QRhiSwapChainHdrInfo::maxLuminance

Definition at line 1492 of file qrhi.h.

◆ maxPotentialColorComponentValue

float QRhiSwapChainHdrInfo::maxPotentialColorComponentValue

Definition at line 1496 of file qrhi.h.

Referenced by QMetalSwapChain::isFormatSupported().

◆ minLuminance

float QRhiSwapChainHdrInfo::minLuminance

Definition at line 1491 of file qrhi.h.


The documentation for this struct was generated from the following file: