Skip to main content

zenpixels_convert/tonemap/
mod.rs

1//! HDR → SDR tone mapping and OKLch soft gamut compression.
2//!
3//! Distinct namespace from [`zenpixels::hdr`] (which holds pure HDR metadata
4//! carriers `DiffuseWhite`, `Nits`, `PeakSource`, `ContentLightLevel`,
5//! `MasteringDisplay`, `HlgRendering`), eliminating the 0.4 module collision.
6
7#[cfg(feature = "bt2446a")]
8pub mod bt2446a;
9#[cfg(feature = "oklab")]
10pub mod gamut_compress;
11pub mod tone_mapper;
12
13/// ITU-R BT.2020 NCL luminance weights (used by BT.2446A and measurement).
14pub const BT2020_LR: f32 = 0.2627;
15/// ITU-R BT.2020 NCL green luminance weight.
16pub const BT2020_LG: f32 = 0.6780;
17/// ITU-R BT.2020 NCL blue luminance weight.
18pub const BT2020_LB: f32 = 0.0593;
19
20#[cfg(feature = "bt2446a")]
21pub use bt2446a::{Bt2446A, Bt2446APipelineManaged};
22#[cfg(feature = "oklab")]
23pub use gamut_compress::SoftCompress;
24pub use tone_mapper::{PreparedMapper, Requirements, StripMapper, ToneMapContext, ToneMapper};