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 light with BT.709 primaries, where 1.0 is SDR white. An HDR source is linearized to display light in nits (PQ by its EOTF, HLG by its inverse OETF and the BT.2100 OOTF at its nominal peak), converted to BT.709 primaries, and tone-mapped from its peak to SDR white by the ITU-R BT.2390 EETF applied to the largest component, which keeps each pixel’s hue. Components the narrower gamut cannot hold are clipped at zero.

These functions are the reference the YUV conversion shader implements; 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
The peak an HDR source is assumed to reach when a project does not say.
SDR_WHITE_NITS
The luminance of SDR white, and so of the working space’s 1.0, in nits.

Functions§

bt2390_eetf
The ITU-R BT.2390 EETF: nits from a source reaching source_peak mapped onto a display reaching target_peak, both with black at zero. Below the knee the curve is the identity; above it a Hermite spline rolls highlights off to exactly target_peak. A source no brighter than the target passes unchanged.
gamut_matrix
The linear-light matrix from from’s primaries to to’s, both with a D65 white point, as rows. BT.601 is taken as BT.709, as the SDR decode path takes it.
hdr_to_working
Linear working-space RGB, 1.0 at SDR white, 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.