Skip to main content

HdrMetadata

Struct HdrMetadata 

Source
pub struct HdrMetadata {
    pub red: [f32; 2],
    pub green: [f32; 2],
    pub blue: [f32; 2],
    pub white: [f32; 2],
    pub max_luminance: f32,
    pub min_luminance: f32,
    pub max_cll: f32,
    pub max_fall: f32,
}
Expand description

Static HDR metadata (SMPTE ST 2086 mastering display + CTA-861.3 content light levels), as 12 little-endian f32s in this order.

Fields§

§red: [f32; 2]

CIE 1931 xy chromaticities of the red, green and blue primaries and the white point.

§green: [f32; 2]§blue: [f32; 2]§white: [f32; 2]§max_luminance: f32

Mastering display luminance in nits: 0 < max ≤ 10000, 0 ≤ min < max.

§min_luminance: f32§max_cll: f32

Maximum content / frame-average light level in nits (0 = unknown), ≤ 10000, FALL ≤ CLL.

§max_fall: f32

Implementations§

Source§

impl HdrMetadata

Source

pub fn bt2020( max_luminance: f32, min_luminance: f32, max_cll: f32, max_fall: f32, ) -> HdrMetadata

BT.2020 primaries, D65 white: the usual HDR10 mastering container.

Source

pub fn to_bytes(&self) -> [u8; 48]

Source

pub fn from_bytes(b: &[u8]) -> Option<HdrMetadata>

Source

pub fn check(&self) -> Option<&'static str>

Why the metadata is invalid, or None if it is valid.

Trait Implementations§

Source§

impl Clone for HdrMetadata

Source§

fn clone(&self) -> HdrMetadata

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for HdrMetadata

Source§

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

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

impl Default for HdrMetadata

Source§

fn default() -> HdrMetadata

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

impl PartialEq for HdrMetadata

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · 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 Copy for HdrMetadata

Source§

impl StructuralPartialEq for HdrMetadata

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
§

impl<T> AsAny for T
where T: 'static,

§

fn as_any(&self) -> &(dyn Any + 'static)

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, 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.
§

impl<T> CommonTraits for T
where T: AsAny + Any + Debug + WasmNotSendSync,

§

impl<T> WasmNotSend for T

§

impl<T> WasmNotSendSync for T
where T: WasmNotSend + WasmNotSync,

§

impl<T> WasmNotSync for T