[−][src]Struct prisma::Luv
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
impl<T, W> Luv<T, W> where
T: FreeChannelScalar,
W: UnitWhitePoint<T>,
[src]
T: FreeChannelScalar,
W: UnitWhitePoint<T>,
pub fn new(L: T, u: T, v: T) -> Self
[src]
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
.
impl<T, W> Luv<T, W> where
T: FreeChannelScalar,
W: WhitePoint<T>,
[src]
T: FreeChannelScalar,
W: WhitePoint<T>,
pub fn new_with_whitepoint(L: T, u: T, v: T, white_point: W) -> Self
[src]
Construct a new Luv
value with a given white point and channels
pub fn color_cast<TOut>(&self) -> Luv<TOut, W> where
T: ChannelFormatCast<TOut>,
TOut: FreeChannelScalar,
[src]
T: ChannelFormatCast<TOut>,
TOut: FreeChannelScalar,
Convert the internal channel scalar format
pub fn L(&self) -> T
[src]
Returns the L
lightness channel scalar
pub fn u(&self) -> T
[src]
Returns the u
green-red channel scalar
pub fn v(&self) -> T
[src]
Returns the v
blue-yellow channel scalar
pub fn L_mut(&mut self) -> &mut T
[src]
Returns a mutable reference to the L
lightness channel scalar
pub fn u_mut(&mut self) -> &mut T
[src]
Returns a mutable reference to the u
green-red channel scalar
pub fn v_mut(&mut self) -> &mut T
[src]
Returns a mutable reference to the v
blue-yellow channel scalar
pub fn set_L(&mut self, val: T)
[src]
Set the L
channel scalar
pub fn set_u(&mut self, val: T)
[src]
Set the u
channel scalar
pub fn set_v(&mut self, val: T)
[src]
Set the v
channel scalar
pub fn white_point(&self) -> &W
[src]
Returns a reference to the white point for the Lab
color space
impl<T, W> Luv<T, W> where
T: FreeChannelScalar + Display,
W: WhitePoint<T>,
[src]
T: FreeChannelScalar + Display,
W: WhitePoint<T>,
pub fn from_xyz(from: &Xyz<T>, wp: W) -> Self
[src]
Construct a Luv
value from an Xyz
value and white point
pub fn to_xyz(&self) -> Xyz<T>
[src]
Construct an Xyz
value from a Luv
value
pub fn epsilon() -> T
[src]
Return the $\epsilon
$ constant used in the Lab conversion
For a description of the value, visit BruceLindbloom.com
.
pub fn kappa() -> T
[src]
Return the $\kappa
$ constant used in the Lab conversion
For a description of the value, visit BruceLindbloom.com
.
Trait Implementations
impl<T, W> AbsDiffEq<Luv<T, W>> for Luv<T, W> where
T: FreeChannelScalar + AbsDiffEq,
T::Epsilon: Clone,
W: WhitePoint<T>,
[src]
T: FreeChannelScalar + AbsDiffEq,
T::Epsilon: Clone,
W: WhitePoint<T>,
type Epsilon = T::Epsilon
Used for specifying relative comparisons.
fn default_epsilon() -> Self::Epsilon
[src]
fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool
[src]
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
[src]
impl<T, W> Bounded for Luv<T, W> where
T: FreeChannelScalar,
W: WhitePoint<T>,
[src]
T: FreeChannelScalar,
W: WhitePoint<T>,
fn normalize(self) -> Self
[src]
fn is_normalized(&self) -> bool
[src]
impl<T, W> Broadcast for Luv<T, W> where
T: FreeChannelScalar,
W: UnitWhitePoint<T>,
[src]
T: FreeChannelScalar,
W: UnitWhitePoint<T>,
impl<T: Clone, W: Clone> Clone for Luv<T, W>
[src]
impl<T, W> Color for Luv<T, W> where
T: FreeChannelScalar,
W: WhitePoint<T>,
[src]
T: FreeChannelScalar,
W: WhitePoint<T>,
type Tag = LuvTag
The unique tag unit struct identifying the color type
type ChannelsTuple = (T, T, T)
A tuple of types for each channel in the color
fn num_channels() -> u32
[src]
fn to_tuple(self) -> Self::ChannelsTuple
[src]
impl<T: Copy, W: Copy> Copy for Luv<T, W>
[src]
impl<T: Debug, W: Debug> Debug for Luv<T, W>
[src]
impl<T, W> Default for Luv<T, W> where
T: FreeChannelScalar,
W: UnitWhitePoint<T>,
[src]
T: FreeChannelScalar,
W: UnitWhitePoint<T>,
impl<T, W> Display for Luv<T, W> where
T: FreeChannelScalar + Display,
W: WhitePoint<T>,
[src]
T: FreeChannelScalar + Display,
W: WhitePoint<T>,
impl<T, W, A> FromColor<Lchuv<T, W, A>> for Luv<T, W> where
T: FreeChannelScalar,
A: AngularChannelScalar + Angle<Scalar = T>,
W: WhitePoint<T>,
[src]
T: FreeChannelScalar,
A: AngularChannelScalar + Angle<Scalar = T>,
W: WhitePoint<T>,
fn from_color(from: &Lchuv<T, W, A>) -> Self
[src]
Construct a Lab
value from an Lchuv
value
impl<T, W, A> FromColor<Luv<T, W>> for Lchuv<T, W, A> where
T: FreeChannelScalar,
A: AngularChannelScalar + FromAngle<Rad<T>> + Angle,
W: WhitePoint<T>,
[src]
T: FreeChannelScalar,
A: AngularChannelScalar + FromAngle<Rad<T>> + Angle,
W: WhitePoint<T>,
fn from_color(from: &Luv<T, W>) -> Self
[src]
Construct an Lchuv
value from a Lab
value
impl<T, W> FromTuple for Luv<T, W> where
T: FreeChannelScalar,
W: UnitWhitePoint<T>,
[src]
T: FreeChannelScalar,
W: UnitWhitePoint<T>,
fn from_tuple(values: (T, T, T)) -> Self
[src]
impl<T, W> HomogeneousColor for Luv<T, W> where
T: FreeChannelScalar,
W: WhitePoint<T>,
[src]
T: FreeChannelScalar,
W: WhitePoint<T>,
impl<T, W> Lerp for Luv<T, W> where
T: FreeChannelScalar + Lerp,
W: WhitePoint<T>,
[src]
T: FreeChannelScalar + Lerp,
W: WhitePoint<T>,
type Position = <FreeChannel<T> as Lerp>::Position
The type of the pos
argument
fn lerp(&self, right: &Self, pos: Self::Position) -> Self
[src]
impl<T: PartialEq, W: PartialEq> PartialEq<Luv<T, W>> for Luv<T, W>
[src]
impl<T: PartialOrd, W: PartialOrd> PartialOrd<Luv<T, W>> for Luv<T, W>
[src]
fn partial_cmp(&self, other: &Luv<T, W>) -> Option<Ordering>
[src]
fn lt(&self, other: &Luv<T, W>) -> bool
[src]
fn le(&self, other: &Luv<T, W>) -> bool
[src]
fn gt(&self, other: &Luv<T, W>) -> bool
[src]
fn ge(&self, other: &Luv<T, W>) -> bool
[src]
impl<T, W> RelativeEq<Luv<T, W>> for Luv<T, W> where
T: FreeChannelScalar + RelativeEq,
T::Epsilon: Clone,
W: WhitePoint<T>,
[src]
T: FreeChannelScalar + RelativeEq,
T::Epsilon: Clone,
W: WhitePoint<T>,
fn default_max_relative() -> Self::Epsilon
[src]
fn relative_eq(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
[src]
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
fn relative_ne(
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
[src]
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
impl<T, W> StructuralPartialEq for Luv<T, W>
[src]
impl<T, W> UlpsEq<Luv<T, W>> for Luv<T, W> where
T: FreeChannelScalar + UlpsEq,
T::Epsilon: Clone,
W: WhitePoint<T>,
[src]
T: FreeChannelScalar + UlpsEq,
T::Epsilon: Clone,
W: WhitePoint<T>,
Auto Trait Implementations
impl<T, W> RefUnwindSafe for Luv<T, W> where
T: RefUnwindSafe,
W: RefUnwindSafe,
T: RefUnwindSafe,
W: RefUnwindSafe,
impl<T, W> Send for Luv<T, W> where
T: Send,
W: Send,
T: Send,
W: Send,
impl<T, W> Sync for Luv<T, W> where
T: Sync,
W: Sync,
T: Sync,
W: Sync,
impl<T, W> Unpin for Luv<T, W> where
T: Unpin,
W: Unpin,
T: Unpin,
W: Unpin,
impl<T, W> UnwindSafe for Luv<T, W> where
T: UnwindSafe,
W: UnwindSafe,
T: UnwindSafe,
W: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,