[−][src]Struct prisma::Lchab
The $\textrm{Lch}_{(\textrm{ab})}
$ device-independent polar color space
Lchab
is a simple polar transformation from Lab
defined as:
\begin{aligned}
L &= L \\
C &= \sqrt{a^2 + b^2} \\
H &= atan2(b, a)
\end{aligned}
It is a useful space for computing smooth gradients in a polar space, but like Lab
is out of gamut
for many values which are not bounded by a simple geometric object.
Implementations
impl<T, W, A> Lchab<T, W, A> where
T: FreeChannelScalar,
A: AngularChannelScalar,
W: UnitWhitePoint<T>,
[src]
T: FreeChannelScalar,
A: AngularChannelScalar,
W: UnitWhitePoint<T>,
pub fn new(L: T, chroma: T, hue: A) -> Self
[src]
Construct a new Lchab
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, A> Lchab<T, W, A> where
T: FreeChannelScalar,
A: AngularChannelScalar,
W: WhitePoint<T>,
[src]
T: FreeChannelScalar,
A: AngularChannelScalar,
W: WhitePoint<T>,
pub fn new_with_whitepoint(L: T, chroma: T, hue: A, white_point: W) -> Self
[src]
Construct a new Lchab
value with a given white point and channels
pub fn color_cast<TOut, AOut>(&self) -> Lchab<TOut, W, AOut> where
T: ChannelFormatCast<TOut>,
TOut: FreeChannelScalar,
A: ChannelFormatCast<AOut>,
AOut: AngularChannelScalar,
[src]
T: ChannelFormatCast<TOut>,
TOut: FreeChannelScalar,
A: ChannelFormatCast<AOut>,
AOut: AngularChannelScalar,
Convert the internal channel scalar format
pub fn L(&self) -> T
[src]
Returns the L
lightness channel scalar
pub fn chroma(&self) -> T
[src]
Returns the C
chroma channel scalar
pub fn hue(&self) -> A
[src]
Returns the H
hue channel scalar
pub fn L_mut(&mut self) -> &mut T
[src]
Returns a mutable reference to the the L
lightness channel scalar
pub fn chroma_mut(&mut self) -> &mut T
[src]
Returns a mutable reference to the the C
chroma channel scalar
pub fn hue_mut(&mut self) -> &mut A
[src]
Returns a mutable reference to the the L
hue channel scalar
pub fn set_L(&mut self, val: T)
[src]
Sets the L
channel scalar
pub fn set_chroma(&mut self, val: T)
[src]
Sets the chroma
channel scalar
pub fn set_hue(&mut self, val: A)
[src]
Sets the hue
channel scalar
pub fn white_point(&self) -> &W
[src]
Returns a reference to the white point for the Lchab
color space
Trait Implementations
impl<T, W, A> AbsDiffEq<Lchab<T, W, A>> for Lchab<T, W, A> where
T: FreeChannelScalar + AbsDiffEq<Epsilon = A::Epsilon>,
A: AngularChannelScalar + AbsDiffEq,
A::Epsilon: Clone + Float,
W: WhitePoint<T>,
[src]
T: FreeChannelScalar + AbsDiffEq<Epsilon = A::Epsilon>,
A: AngularChannelScalar + AbsDiffEq,
A::Epsilon: Clone + Float,
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, A> Bounded for Lchab<T, W, A> where
T: FreeChannelScalar,
A: AngularChannelScalar,
W: WhitePoint<T>,
[src]
T: FreeChannelScalar,
A: AngularChannelScalar,
W: WhitePoint<T>,
fn normalize(self) -> Self
[src]
fn is_normalized(&self) -> bool
[src]
impl<T: Clone, W: Clone, A: Clone> Clone for Lchab<T, W, A>
[src]
impl<T, W, A> Color for Lchab<T, W, A> where
T: FreeChannelScalar,
A: AngularChannelScalar,
W: WhitePoint<T>,
[src]
T: FreeChannelScalar,
A: AngularChannelScalar,
W: WhitePoint<T>,
type Tag = LchabTag
The unique tag unit struct identifying the color type
type ChannelsTuple = (T, T, A)
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, A: Copy> Copy for Lchab<T, W, A>
[src]
impl<T: Debug, W: Debug, A: Debug> Debug for Lchab<T, W, A>
[src]
impl<T, W, A> Default for Lchab<T, W, A> where
T: FreeChannelScalar + Zero,
A: AngularChannelScalar + Zero,
W: UnitWhitePoint<T>,
[src]
T: FreeChannelScalar + Zero,
A: AngularChannelScalar + Zero,
W: UnitWhitePoint<T>,
impl<T, W, A> Display for Lchab<T, W, A> where
T: FreeChannelScalar + Display,
A: AngularChannelScalar + Display,
W: WhitePoint<T>,
[src]
T: FreeChannelScalar + Display,
A: AngularChannelScalar + Display,
W: WhitePoint<T>,
impl<T, W, A> FromColor<Lab<T, W>> for Lchab<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: &Lab<T, W>) -> Self
[src]
Construct an Lchab
value from a Lab
value
impl<T, W, A> FromColor<Lchab<T, W, A>> for Lab<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: &Lchab<T, W, A>) -> Self
[src]
Construct a Lab
value from an Lchab
value
impl<T, W, A> FromTuple for Lchab<T, W, A> where
T: FreeChannelScalar,
A: AngularChannelScalar,
W: UnitWhitePoint<T>,
[src]
T: FreeChannelScalar,
A: AngularChannelScalar,
W: UnitWhitePoint<T>,
fn from_tuple(values: Self::ChannelsTuple) -> Self
[src]
impl<T, W, A> Lerp for Lchab<T, W, A> where
T: FreeChannelScalar + Lerp,
A: AngularChannelScalar + Lerp,
W: WhitePoint<T>,
[src]
T: FreeChannelScalar + Lerp,
A: AngularChannelScalar + Lerp,
W: WhitePoint<T>,
type Position = A::Position
The type of the pos
argument
fn lerp(&self, right: &Self, pos: Self::Position) -> Self
[src]
impl<T: PartialEq, W: PartialEq, A: PartialEq> PartialEq<Lchab<T, W, A>> for Lchab<T, W, A>
[src]
impl<T: PartialOrd, W: PartialOrd, A: PartialOrd> PartialOrd<Lchab<T, W, A>> for Lchab<T, W, A>
[src]
fn partial_cmp(&self, other: &Lchab<T, W, A>) -> Option<Ordering>
[src]
fn lt(&self, other: &Lchab<T, W, A>) -> bool
[src]
fn le(&self, other: &Lchab<T, W, A>) -> bool
[src]
fn gt(&self, other: &Lchab<T, W, A>) -> bool
[src]
fn ge(&self, other: &Lchab<T, W, A>) -> bool
[src]
impl<T, W, A> PolarColor for Lchab<T, W, A> where
T: FreeChannelScalar,
A: AngularChannelScalar,
W: WhitePoint<T>,
[src]
T: FreeChannelScalar,
A: AngularChannelScalar,
W: WhitePoint<T>,
type Angular = A
The angular channel's scalar type
type Cartesian = T
The remaining channels' scalar types
impl<T, W, A> RelativeEq<Lchab<T, W, A>> for Lchab<T, W, A> where
T: FreeChannelScalar + RelativeEq<Epsilon = A::Epsilon>,
A: AngularChannelScalar + RelativeEq,
A::Epsilon: Clone + Float,
W: WhitePoint<T>,
[src]
T: FreeChannelScalar + RelativeEq<Epsilon = A::Epsilon>,
A: AngularChannelScalar + RelativeEq,
A::Epsilon: Clone + Float,
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, A> StructuralPartialEq for Lchab<T, W, A>
[src]
impl<T, W, A> UlpsEq<Lchab<T, W, A>> for Lchab<T, W, A> where
T: FreeChannelScalar + UlpsEq<Epsilon = A::Epsilon>,
A: AngularChannelScalar + UlpsEq,
A::Epsilon: Clone + Float,
W: WhitePoint<T>,
[src]
T: FreeChannelScalar + UlpsEq<Epsilon = A::Epsilon>,
A: AngularChannelScalar + UlpsEq,
A::Epsilon: Clone + Float,
W: WhitePoint<T>,
Auto Trait Implementations
impl<T, W, A> RefUnwindSafe for Lchab<T, W, A> where
A: RefUnwindSafe,
T: RefUnwindSafe,
W: RefUnwindSafe,
A: RefUnwindSafe,
T: RefUnwindSafe,
W: RefUnwindSafe,
impl<T, W, A> Send for Lchab<T, W, A> where
A: Send,
T: Send,
W: Send,
A: Send,
T: Send,
W: Send,
impl<T, W, A> Sync for Lchab<T, W, A> where
A: Sync,
T: Sync,
W: Sync,
A: Sync,
T: Sync,
W: Sync,
impl<T, W, A> Unpin for Lchab<T, W, A> where
A: Unpin,
T: Unpin,
W: Unpin,
A: Unpin,
T: Unpin,
W: Unpin,
impl<T, W, A> UnwindSafe for Lchab<T, W, A> where
A: UnwindSafe,
T: UnwindSafe,
W: UnwindSafe,
A: 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>,