pub struct MasteringDisplay { /* private fields */ }Expand description
HDR10 mastering display metadata.
Implementations§
Source§impl MasteringDisplay
impl MasteringDisplay
Sourcepub const fn new(
display_primaries: [(u32, u32); 3],
white_point: (u32, u32),
max_luminance: (u32, u32),
min_luminance: (u32, u32),
) -> Self
pub const fn new( display_primaries: [(u32, u32); 3], white_point: (u32, u32), max_luminance: (u32, u32), min_luminance: (u32, u32), ) -> Self
Constructs a MasteringDisplay.
Sourcepub const fn display_primaries(&self) -> [(u32, u32); 3]
pub const fn display_primaries(&self) -> [(u32, u32); 3]
Display primary chromaticities (x, y) for R, G, B in CIE 1931,
each coordinate normalized to SMPTE ST 2086 fixed-point units —
0.00002 increments, so a floating value is raw / 50000.0. The
same units mediaframe::color::ChromaCoord uses, so a (x, y)
pair here constructs one directly.
A tuple has room for one denominator, not two, so it cannot hold
x and y each as an independent AVRational the way the
source AVMasteringDisplayMetadata does — parse_mastering_ display (mediadecode-ffmpeg’s convert module) is the one
place that resolves each coordinate’s own rational to this
shared fixed-point unit, exactly rather than by rounding, for
every producer this crate has observed (which all emit a
denominator of 50000 already).
Sourcepub const fn white_point(&self) -> (u32, u32)
pub const fn white_point(&self) -> (u32, u32)
White-point chromaticity (x, y), in the same SMPTE ST 2086
fixed-point units as Self::display_primaries.
Sourcepub const fn max_luminance(&self) -> (u32, u32)
pub const fn max_luminance(&self) -> (u32, u32)
Maximum luminance in 0.0001 cd/m² units (rational (num, den)).
Sourcepub const fn min_luminance(&self) -> (u32, u32)
pub const fn min_luminance(&self) -> (u32, u32)
Minimum luminance in 0.0001 cd/m² units.
Sourcepub const fn with_display_primaries(self, value: [(u32, u32); 3]) -> Self
pub const fn with_display_primaries(self, value: [(u32, u32); 3]) -> Self
Sets the display primaries (consuming builder).
Sourcepub const fn with_white_point(self, value: (u32, u32)) -> Self
pub const fn with_white_point(self, value: (u32, u32)) -> Self
Sets the white point (consuming builder).
Sourcepub const fn with_max_luminance(self, value: (u32, u32)) -> Self
pub const fn with_max_luminance(self, value: (u32, u32)) -> Self
Sets the max luminance (consuming builder).
Sourcepub const fn with_min_luminance(self, value: (u32, u32)) -> Self
pub const fn with_min_luminance(self, value: (u32, u32)) -> Self
Sets the min luminance (consuming builder).
Sourcepub const fn set_display_primaries(
&mut self,
value: [(u32, u32); 3],
) -> &mut Self
pub const fn set_display_primaries( &mut self, value: [(u32, u32); 3], ) -> &mut Self
Sets the display primaries in place.
Sourcepub const fn set_white_point(&mut self, value: (u32, u32)) -> &mut Self
pub const fn set_white_point(&mut self, value: (u32, u32)) -> &mut Self
Sets the white point in place.
Sourcepub const fn set_max_luminance(&mut self, value: (u32, u32)) -> &mut Self
pub const fn set_max_luminance(&mut self, value: (u32, u32)) -> &mut Self
Sets the max luminance in place.
Sourcepub const fn set_min_luminance(&mut self, value: (u32, u32)) -> &mut Self
pub const fn set_min_luminance(&mut self, value: (u32, u32)) -> &mut Self
Sets the min luminance in place.
Trait Implementations§
Source§impl Clone for MasteringDisplay
impl Clone for MasteringDisplay
Source§fn clone(&self) -> MasteringDisplay
fn clone(&self) -> MasteringDisplay
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more