pub struct ToneMapper { /* private fields */ }Expand description
A configured tone-mapping transform.
Immutable: the tables are built once from the parameters, so changing a parameter means building another mapper.
Implementations§
Source§impl ToneMapper
impl ToneMapper
Sourcepub fn bt709_to_bt2020_pq(sdr_white_nits: f32) -> Self
pub fn bt709_to_bt2020_pq(sdr_white_nits: f32) -> Self
SDR into an HDR composition.
sdr_white_nits is where SDR’s 1.0 lands on the PQ curve. 100 is the
conventional default and matches how most HDR displays render an SDR
signal; 203 is the common “diffuse white” reference and makes the SDR
part brighter within the composition.
Sourcepub fn bt2020_pq_to_bt709(target_max_nits: f32, curve: ToneMapCurve) -> Self
pub fn bt2020_pq_to_bt709(target_max_nits: f32, curve: ToneMapCurve) -> Self
HDR down to an SDR display.
target_max_nits is what SDR’s 1.0 means in absolute terms; anything
above it goes through curve so highlights compress instead of
clipping.
Sourcepub fn hlg_to_bt709(target_max_nits: f32) -> Self
pub fn hlg_to_bt709(target_max_nits: f32) -> Self
HLG down to an SDR display.
Always Reinhard, which only rolls off what lands above the target’s white. The curve is not selectable for HLG: its OOTF has already shaped the highlights.
Sourcepub const fn curve(&self) -> ToneMapCurve
pub const fn curve(&self) -> ToneMapCurve
The curve it applies.
Sourcepub const fn sdr_white_nits(&self) -> f32
pub const fn sdr_white_nits(&self) -> f32
Where SDR white lands, in nits.
Sourcepub const fn target_max_nits(&self) -> f32
pub const fn target_max_nits(&self) -> f32
What SDR 1.0 represents, in nits.