Skip to main content

DiffuseWhite

Struct DiffuseWhite 

Source
pub struct DiffuseWhite(/* private fields */);
Expand description

The absolute luminance, in cd/m² (nits), that a relative-linear sample value of 1.0 represents — the “diffuse white” (a.k.a. nominal diffuse white / SDR reference white) anchor that bridges relative-linear pixel data to absolute display light.

This is the single scalar the rest of the industry uses for that bridge: OpenEXR’s whiteLuminance (“nits of RGB (1,1,1)”), JPEG XL’s intensity_target, libheif’s ndwt (nominal diffuse white), and libplacebo’s SDR-white constant. The cross-vendor default is BT2408 = 203 cd/m².

It is a typed anchor on purpose: HDR code mixes nits, PQ-encoded [0,1], log2 gain, and headroom ratios — passing a bare f32 invites unit confusion. Use DiffuseWhite::new / DiffuseWhite::nits.

Implementations§

Source§

impl DiffuseWhite

Source

pub const BT2408: DiffuseWhite

ITU-R BT.2408 HDR reference white: 203 cd/m². The cross-industry default anchor for relative-linear HDR (matches Chrome SDRWhiteLevel, Skia skcms, CSS rec2100-linear, and libplacebo).

Source

pub const fn new(nits: f32) -> DiffuseWhite

An anchor of nits cd/m² (the luminance that relative-linear 1.0 represents).

Source

pub const fn nits(self) -> f32

The anchor in cd/m² (nits).

Trait Implementations§

Source§

impl Clone for DiffuseWhite

Source§

fn clone(&self) -> DiffuseWhite

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 DiffuseWhite

Source§

impl Debug for DiffuseWhite

Source§

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

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

impl Default for DiffuseWhite

Source§

fn default() -> DiffuseWhite

BT2408 — 203 cd/m².

Source§

impl Eq for DiffuseWhite

Source§

impl PartialEq for DiffuseWhite

Source§

fn eq(&self, other: &DiffuseWhite) -> 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.

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