Skip to main content

ColorMetadata

Struct ColorMetadata 

Source
pub struct ColorMetadata {
    pub transfer: TransferFn,
    pub matrix_coefficients: u8,
    pub colour_primaries: u8,
    pub full_range: bool,
    pub mastering_display: Option<MasteringDisplay>,
    pub content_light_level: Option<ContentLightLevel>,
}
Expand description

HDR / wide-gamut metadata carried from SPS VUI through the pipeline to the MP4 mux colr nclx box. All values default to an SDR BT.709 baseline so un-annotated StreamInfo constructions stay backward-compatible.

Fields§

§transfer: TransferFn

Transfer function per ITU-T H.273. Defaults to Bt709 for SDR. HDR10 streams populate this with St2084 (PQ); HLG broadcasts with AribStdB67.

§matrix_coefficients: u8

Raw H.273 matrix_coefficients (0–255). Preserves the ncl/cl distinction the ColorSpace enum collapses: 9 = BT.2020 NCL, 10 = BT.2020 CL. Mux writes this verbatim into colr nclx.

§colour_primaries: u8

Raw H.273 colour_primaries (0–255). Written verbatim into colr nclx.

§full_range: bool

full_range_flag (H.273): false = studio/limited-range (16..235), true = full-range (0..255). HEVC SPS VUI exposes this directly.

§mastering_display: Option<MasteringDisplay>

HDR10 mastering display color volume (SMPTE ST 2086, HEVC SEI 137, AV1 metadata OBU type 2 HDR_MDCV, MP4 mdcv box, MKV MasteringMetadata). None for SDR sources or when the upstream did not signal it. Carried to the MP4 mux’s mdcv box per ISO/IEC 14496-12 §12.1.6 / AV1-ISOBMFF v1.3.0 (Squad-20). Populated by Squad-21 from HEVC SEI 137 / AV1 metadata OBU METADATA_TYPE_HDR_MDCV / MP4 mdcv / MKV MasteringMetadata. Without it, Apple devices fall back to BT.709 limited even when colr nclx signals BT.2020.

§content_light_level: Option<ContentLightLevel>

HDR10 content light level info (CTA-861.3, HEVC SEI 144, AV1 metadata OBU type 1 HDR_CLL, MP4 clli, MKV MaxCLL + MaxFALL). None for SDR or unsignalled HDR. Carried to the MP4 mux’s clli box per ISO/IEC 14496-12 §12.1.6 / AV1-ISOBMFF v1.3.0 (Squad-20). Populated by Squad-21 from HEVC SEI 144 / AV1 metadata OBU METADATA_TYPE_HDR_CLL / MP4 clli / MKV.

Trait Implementations§

Source§

impl Clone for ColorMetadata

Source§

fn clone(&self) -> ColorMetadata

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ColorMetadata

Source§

impl Debug for ColorMetadata

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ColorMetadata

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for ColorMetadata

Source§

impl PartialEq for ColorMetadata

Source§

fn eq(&self, other: &ColorMetadata) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for ColorMetadata

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more