Skip to main content

LinearLightness

Type Alias LinearLightness 

Source
pub type LinearLightness<T> = Lum<T, true, true>;
Available on crate feature color only.
Expand description

๐ŸŽจ Linearized perceptual lightness (L* in linear space).


๐Ÿ“ media/visual/color


Use cases include:

  • Combining linear luminance (for precise computations) and perceptual lightness (for display scaling).
  • Tone mapping in HDR imaging, where linear data is scaled to a perceptual range.
  • Representing raw radiometric data (e.g., watts/sr/mยฒ) prior to photometric weighting (CIE Y).

Aliased Typeยง

#[repr(C)]
pub struct LinearLightness<T> { pub c: [T; 1], }

Fieldsยง

ยงc: [T; 1]

The luminance-like channel value.

Implementationsยง

Sourceยง

impl LinearLightness<u8>

Source

pub const fn linear_lightness(self) -> u8

Returns the linear-light perceptual value (experimental).

Used for hybrid workflows like HDR tonemapping.

Source

pub const fn linear_lightness_mut(&mut self) -> &mut u8

Returns a mutable reference to the linear-light perceptual value.

Sourceยง

impl LinearLightness<u16>

Source

pub const fn linear_lightness(self) -> u16

Returns the linear-light perceptual value (experimental).

Used for hybrid workflows like HDR tonemapping.

Source

pub const fn linear_lightness_mut(&mut self) -> &mut u16

Returns a mutable reference to the linear-light perceptual value.

Sourceยง

impl LinearLightness<f32>

Source

pub const fn linear_lightness(self) -> f32

Returns the linear-light perceptual value (experimental).

Used for hybrid workflows like HDR tonemapping.

Source

pub const fn linear_lightness_mut(&mut self) -> &mut f32

Returns a mutable reference to the linear-light perceptual value.

Sourceยง

impl LinearLightness<f64>

Source

pub const fn linear_lightness(self) -> f64

Returns the linear-light perceptual value (experimental).

Used for hybrid workflows like HDR tonemapping.

Source

pub const fn linear_lightness_mut(&mut self) -> &mut f64

Returns a mutable reference to the linear-light perceptual value.