pub struct ChromaticAdaptationTransform { /* private fields */ }Expand description
A 3x3 matrix transform for adapting colors between different illuminant white points.
Chromatic adaptation transforms (CATs) model how the human visual system adjusts to changes in illumination. Each transform defines a matrix that converts XYZ tristimulus values into a cone-response-like space where adaptation scaling is applied.
Implementations§
Source§impl ChromaticAdaptationTransform
impl ChromaticAdaptationTransform
Source§impl ChromaticAdaptationTransform
impl ChromaticAdaptationTransform
Sourcepub const CMC_CAT2000: Self
Available on crate feature cat-cmc-cat2000 only.
pub const CMC_CAT2000: Self
cat-cmc-cat2000 only.The CMC CAT2000 chromatic adaptation transform.
Source§impl ChromaticAdaptationTransform
impl ChromaticAdaptationTransform
Sourcepub const HPE: Self = Self::HUNT_POINTER_ESTEVEZ
Available on crate feature cat-hunt-pointer-estevez only.
pub const HPE: Self = Self::HUNT_POINTER_ESTEVEZ
cat-hunt-pointer-estevez only.Shorthand alias for Self::HUNT_POINTER_ESTEVEZ.
Sourcepub const HUNT_POINTER_ESTEVEZ: Self
Available on crate feature cat-hunt-pointer-estevez only.
pub const HUNT_POINTER_ESTEVEZ: Self
cat-hunt-pointer-estevez only.The Hunt-Pointer-Estevez chromatic adaptation transform.
Source§impl ChromaticAdaptationTransform
impl ChromaticAdaptationTransform
Sourcepub const XYZ_SCALING: Self
pub const XYZ_SCALING: Self
XYZ scaling (identity matrix) chromatic adaptation.
The simplest possible adaptation — scales each XYZ channel independently. Always available regardless of feature flags.
Source§impl ChromaticAdaptationTransform
impl ChromaticAdaptationTransform
Sourcepub const fn new(name: &'static str, matrix: [[f64; 3]; 3]) -> Self
pub const fn new(name: &'static str, matrix: [[f64; 3]; 3]) -> Self
Creates a new chromatic adaptation transform from a name and 3x3 matrix.
Sourcepub fn adapt(
&self,
color: impl Into<Xyz>,
reference_white: impl Into<Xyz>,
target_white: impl Into<Xyz>,
) -> Xyz
pub fn adapt( &self, color: impl Into<Xyz>, reference_white: impl Into<Xyz>, target_white: impl Into<Xyz>, ) -> Xyz
Adapts a color from one white point to another.
Converts the color to a cone-response space using this transform’s matrix, scales each cone channel by the ratio of target to reference white, then converts back to XYZ.
Trait Implementations§
Source§impl Clone for ChromaticAdaptationTransform
impl Clone for ChromaticAdaptationTransform
Source§fn clone(&self) -> ChromaticAdaptationTransform
fn clone(&self) -> ChromaticAdaptationTransform
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more