Skip to main content

Module hdr

Module hdr 

Source
Expand description

HDR sources brought into the SDR working space.

The working space is display-referred linear BT.709 with 1.0 at SDR white. HDR is linearized to nits (PQ by its EOTF; HLG by inverse OETF plus the BT.2100 OOTF at its nominal peak), converted to BT.709, and tone-mapped to SDR white by the BT.2390 EETF applied to the largest component, preserving hue. Out-of-gamut components clip at zero.

The YUV conversion shader implements these; GPU tests compare the two.

Structs§

HdrToneMap
How an HDR source is tone-mapped: from source_peak_nits to SDR white.

Constants§

DEFAULT_HDR_PEAK_NITS
Assumed HDR source peak when a project does not specify one.
SDR_WHITE_NITS
Luminance of SDR white (working-space 1.0), in nits.

Functions§

bt2390_eetf
ITU-R BT.2390 EETF mapping nits from source_peak to target_peak, black at zero.
gamut_matrix
Linear RGB matrix (rows) from from to to primaries, D65 white. BT.601 is treated as BT.709, as the SDR path does.
hdr_to_working
Working-space linear RGB of an HDR pixel’s nonlinear components in its own primaries.
hlg_inverse_oetf
Scene light in 0..=1 of an HLG code value (the inverse OETF).
hlg_ootf
Display light in nits of HLG scene light shown at peak_nits: the BT.2100 OOTF, with the system gamma for that peak.
pq_eotf
Display luminance, in nits, of a PQ code value in 0..=1.
pq_inverse_eotf
The PQ code value of a display luminance in nits.