#[repr(C)]pub struct Luv<T, W> { /* private fields */ }Expand description
The CIELUV perceptually uniform device-independent color space
Luv is a perceptually uniform color space introduced by CIE at the same time as Lab.
Luv is especially well suited for dealing with colored lighting computations, with the additive
mixture of two lights falling along a line in its the chromaticity space. It is an extension to
the previous CIE UVW space.
Like Lab, Luv has a polar representation: Lchuv.
Implementations§
Source§impl<T, W> Luv<T, W>where
T: FreeChannelScalar,
W: UnitWhitePoint<T>,
impl<T, W> Luv<T, W>where
T: FreeChannelScalar,
W: UnitWhitePoint<T>,
Sourcepub fn new(L: T, u: T, v: T) -> Self
pub fn new(L: T, u: T, v: T) -> Self
Construct a new Luv value with a named white point and channels.
Unlike new_with_whitepoint, new constructs a default instance of a UnitWhitePoint.
It is only valid when W is a UnitWhitePoint.
Source§impl<T, W> Luv<T, W>where
T: FreeChannelScalar,
W: WhitePoint<T>,
impl<T, W> Luv<T, W>where
T: FreeChannelScalar,
W: WhitePoint<T>,
Sourcepub fn new_with_whitepoint(L: T, u: T, v: T, white_point: W) -> Self
pub fn new_with_whitepoint(L: T, u: T, v: T, white_point: W) -> Self
Construct a new Luv value with a given white point and channels
Sourcepub fn color_cast<TOut>(&self) -> Luv<TOut, W>where
T: ChannelFormatCast<TOut>,
TOut: FreeChannelScalar,
pub fn color_cast<TOut>(&self) -> Luv<TOut, W>where
T: ChannelFormatCast<TOut>,
TOut: FreeChannelScalar,
Convert the internal channel scalar format
Sourcepub fn L_mut(&mut self) -> &mut T
pub fn L_mut(&mut self) -> &mut T
Returns a mutable reference to the L lightness channel scalar
Sourcepub fn u_mut(&mut self) -> &mut T
pub fn u_mut(&mut self) -> &mut T
Returns a mutable reference to the u green-red channel scalar
Sourcepub fn v_mut(&mut self) -> &mut T
pub fn v_mut(&mut self) -> &mut T
Returns a mutable reference to the v blue-yellow channel scalar
Sourcepub fn white_point(&self) -> &W
pub fn white_point(&self) -> &W
Returns a reference to the white point for the Lab color space
Source§impl<T, W> Luv<T, W>
impl<T, W> Luv<T, W>
Sourcepub fn from_xyz(from: &Xyz<T>, wp: W) -> Self
pub fn from_xyz(from: &Xyz<T>, wp: W) -> Self
Construct a Luv value from an Xyz value and white point
Sourcepub fn epsilon() -> T
pub fn epsilon() -> T
Return the $\epsilon$ constant used in the Lab conversion
For a description of the value, visit BruceLindbloom.com.
Sourcepub fn kappa() -> T
pub fn kappa() -> T
Return the $\kappa$ constant used in the Lab conversion
For a description of the value, visit BruceLindbloom.com.
Trait Implementations§
Source§impl<T, W> AbsDiffEq for Luv<T, W>
impl<T, W> AbsDiffEq for Luv<T, W>
Source§fn default_epsilon() -> Self::Epsilon
fn default_epsilon() -> Self::Epsilon
Source§fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool
fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool
Source§impl<T, W> Bounded for Luv<T, W>where
T: FreeChannelScalar,
W: WhitePoint<T>,
impl<T, W> Bounded for Luv<T, W>where
T: FreeChannelScalar,
W: WhitePoint<T>,
Source§impl<T, W> Broadcast for Luv<T, W>where
T: FreeChannelScalar,
W: UnitWhitePoint<T>,
impl<T, W> Broadcast for Luv<T, W>where
T: FreeChannelScalar,
W: UnitWhitePoint<T>,
Source§impl<T, W> Color for Luv<T, W>where
T: FreeChannelScalar,
W: WhitePoint<T>,
impl<T, W> Color for Luv<T, W>where
T: FreeChannelScalar,
W: WhitePoint<T>,
Source§type ChannelsTuple = (T, T, T)
type ChannelsTuple = (T, T, T)
Source§fn num_channels() -> u32
fn num_channels() -> u32
Source§fn to_tuple(self) -> Self::ChannelsTuple
fn to_tuple(self) -> Self::ChannelsTuple
Source§impl<T, W> Default for Luv<T, W>where
T: FreeChannelScalar,
W: UnitWhitePoint<T>,
impl<T, W> Default for Luv<T, W>where
T: FreeChannelScalar,
W: UnitWhitePoint<T>,
Source§impl<T, W, A> FromColor<Lchuv<T, W, A>> for Luv<T, W>
impl<T, W, A> FromColor<Lchuv<T, W, A>> for Luv<T, W>
Source§fn from_color(from: &Lchuv<T, W, A>) -> Self
fn from_color(from: &Lchuv<T, W, A>) -> Self
Construct a Lab value from an Lchuv value
Source§impl<T, W, A> FromColor<Luv<T, W>> for Lchuv<T, W, A>
impl<T, W, A> FromColor<Luv<T, W>> for Lchuv<T, W, A>
Source§fn from_color(from: &Luv<T, W>) -> Self
fn from_color(from: &Luv<T, W>) -> Self
Construct an Lchuv value from a Lab value
Source§impl<T, W> FromTuple for Luv<T, W>where
T: FreeChannelScalar,
W: UnitWhitePoint<T>,
impl<T, W> FromTuple for Luv<T, W>where
T: FreeChannelScalar,
W: UnitWhitePoint<T>,
Source§fn from_tuple(values: (T, T, T)) -> Self
fn from_tuple(values: (T, T, T)) -> Self
Self from a tuple of channel values