pub struct LightLevelHistogram { /* private fields */ }Expand description
1024-bin log2 histogram of per-pixel luminance in cd/m² over [0.005, 10_000] nits,
tracking exact zero / non-positive counts separately from positive sub-bin samples.
Implementations§
Source§impl LightLevelHistogram
impl LightLevelHistogram
Sourcepub const BIN_MIN_NITS: f32 = 0.005
pub const BIN_MIN_NITS: f32 = 0.005
Lower bin edge (0.005 cd/m²).
Sourcepub const BIN_MAX_NITS: f32 = 10_000.0
pub const BIN_MAX_NITS: f32 = 10_000.0
Upper bin edge (10_000.0 cd/m², ST 2084 PQ peak).
Sourcepub fn new(method: LightLevelMethod) -> Result<Self, At<ConvertError>>
pub fn new(method: LightLevelMethod) -> Result<Self, At<ConvertError>>
Fallibly construct an empty histogram (returns Err(ConvertError::AllocationFailed) on OOM).
Sourcepub fn merge(&mut self, other: &Self) -> Result<(), At<ConvertError>>
pub fn merge(&mut self, other: &Self) -> Result<(), At<ConvertError>>
Merge another LightLevelHistogram accumulated with the same LightLevelMethod
into self (useful for parallel tile/strip reduction).
Returns ConvertError::UnsupportedRoute if self.method() != other.method().
Sourcepub const fn method(&self) -> LightLevelMethod
pub const fn method(&self) -> LightLevelMethod
Reduction method used to build this histogram.
Sourcepub const fn total_pixels(&self) -> u64
pub const fn total_pixels(&self) -> u64
Total pixels recorded.
Sourcepub const fn zero_pixels(&self) -> u64
pub const fn zero_pixels(&self) -> u64
Number of recorded zero / non-positive / non-finite samples.
Sourcepub fn quantile_nits(&self, quantile: f32) -> f32
pub fn quantile_nits(&self, quantile: f32) -> f32
Nearest-rank order-statistic quantile readout (quantile in 0.0..=1.0, e.g. 0.9999).
Uses rank k = ceil(quantile * total).max(1) over the sorted sample set (so
quantile = 0.0 returns 0.0 when any black pixel was recorded, and quantile = 0.5 on
[0, 1, 100] selects the 2nd sample ≈ 1.0).
Sourcepub fn to_content_light_level(&self) -> ContentLightLevel
pub fn to_content_light_level(&self) -> ContentLightLevel
Convert literal max + mean into ITU-T H.274 / CTA-861.3 upper-bound ContentLightLevel.
Sourcepub fn to_robust_content_light_level(&self, quantile: f32) -> ContentLightLevel
pub fn to_robust_content_light_level(&self, quantile: f32) -> ContentLightLevel
Convert quantile peak (quantile in 0.0..=1.0, e.g. 0.9999) + mean into
ContentLightLevel.
Trait Implementations§
Source§impl Clone for LightLevelHistogram
impl Clone for LightLevelHistogram
Source§fn clone(&self) -> LightLevelHistogram
fn clone(&self) -> LightLevelHistogram
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more