[−][src]Struct prisma::lms::Lms
The LMS
cone response device-independent color space
LMS
is a device-independent color space created to map to the average response of the three
cones in the human eye. There is no single LMS
space, but rather several different models defining
a transformation from XYZ
to LMS
. LMS
is well suited for use in chromatic adaptation as well
as for simulating the effects of color blindness in humans. LMS
is also widely used in "color
adaptation models" such as CIECAM2002.
LMS
is a linear transformation from XYZ
, and each model is defined by a matrix M
that
multiplies a XYZ
value to produce an LMS
value.
Note that presently, the Model
type parameter to LMS
must be data-less. This may be changed
in the future if a use case arises.
Implementations
impl<T, Model> Lms<T, Model> where
T: FreeChannelScalar,
Model: LmsModel<T>,
[src]
T: FreeChannelScalar,
Model: LmsModel<T>,
pub fn new(l: T, m: T, s: T) -> Self
[src]
Construct an LMS
instance from l
, m
and s
pub fn color_cast<TOut>(&self) -> Lms<TOut, Model> where
T: ChannelFormatCast<TOut>,
TOut: FreeChannelScalar,
[src]
T: ChannelFormatCast<TOut>,
TOut: FreeChannelScalar,
Cast the channel representation type
pub fn l(&self) -> T
[src]
Returns the L
value
pub fn m(&self) -> T
[src]
Returns the M
value
pub fn s(&self) -> T
[src]
Returns the S
value
pub fn l_mut(&mut self) -> &mut T
[src]
Returns a mutable reference to the L
value
pub fn m_mut(&mut self) -> &mut T
[src]
Returns a mutable reference to the M
value
pub fn s_mut(&mut self) -> &mut T
[src]
Returns a mutable reference to the S
value
pub fn set_l(&mut self, val: T)
[src]
Set the L
value
pub fn set_m(&mut self, val: T)
[src]
Set the M
value
pub fn set_s(&mut self, val: T)
[src]
Set the S
value
Trait Implementations
impl<T, Model> AbsDiffEq<Lms<T, Model>> for Lms<T, Model> where
T: FreeChannelScalar + AbsDiffEq,
T::Epsilon: Clone,
Model: LmsModel<T>,
[src]
T: FreeChannelScalar + AbsDiffEq,
T::Epsilon: Clone,
Model: LmsModel<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, Model> Bounded for Lms<T, Model> where
T: FreeChannelScalar,
Model: LmsModel<T>,
[src]
T: FreeChannelScalar,
Model: LmsModel<T>,
fn normalize(self) -> Self
[src]
fn is_normalized(&self) -> bool
[src]
impl<T, Model> Broadcast for Lms<T, Model> where
T: FreeChannelScalar,
Model: LmsModel<T>,
[src]
T: FreeChannelScalar,
Model: LmsModel<T>,
impl<T: Clone, Model: Clone> Clone for Lms<T, Model>
[src]
impl<T, Model> Color for Lms<T, Model> where
T: FreeChannelScalar,
Model: LmsModel<T>,
[src]
T: FreeChannelScalar,
Model: LmsModel<T>,
type Tag = LmsTag
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, Model: Copy> Copy for Lms<T, Model>
[src]
impl<T: Debug, Model: Debug> Debug for Lms<T, Model>
[src]
impl<T, Model> Default for Lms<T, Model> where
T: FreeChannelScalar,
Model: LmsModel<T>,
[src]
T: FreeChannelScalar,
Model: LmsModel<T>,
impl<T, Model> Display for Lms<T, Model> where
T: FreeChannelScalar + Display,
Model: LmsModel<T>,
[src]
T: FreeChannelScalar + Display,
Model: LmsModel<T>,
impl<T, Model> Flatten for Lms<T, Model> where
T: FreeChannelScalar,
Model: LmsModel<T>,
[src]
T: FreeChannelScalar,
Model: LmsModel<T>,
fn as_slice(&self) -> &[Self::ChannelFormat]
[src]
fn from_slice(vals: &[T]) -> Self
[src]
impl<T, Model> FromColor<Lms<T, Model>> for Xyz<T> where
T: FreeChannelScalar,
Model: LmsModel<T>,
[src]
T: FreeChannelScalar,
Model: LmsModel<T>,
fn from_color(from: &Lms<T, Model>) -> Self
[src]
impl<T, Model> FromColor<Xyz<T>> for Lms<T, Model> where
T: FreeChannelScalar,
Model: LmsModel<T>,
[src]
T: FreeChannelScalar,
Model: LmsModel<T>,
fn from_color(from: &Xyz<T>) -> Self
[src]
impl<T, Model> FromTuple for Lms<T, Model> where
T: FreeChannelScalar,
Model: LmsModel<T>,
[src]
T: FreeChannelScalar,
Model: LmsModel<T>,
fn from_tuple(values: (T, T, T)) -> Self
[src]
impl<T, Model> HomogeneousColor for Lms<T, Model> where
T: FreeChannelScalar,
Model: LmsModel<T>,
[src]
T: FreeChannelScalar,
Model: LmsModel<T>,
impl<T, Model> Lerp for Lms<T, Model> where
T: FreeChannelScalar,
Model: LmsModel<T>,
FreeChannel<T>: Lerp,
[src]
T: FreeChannelScalar,
Model: LmsModel<T>,
FreeChannel<T>: Lerp,
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, Model: PartialEq> PartialEq<Lms<T, Model>> for Lms<T, Model>
[src]
impl<T: PartialOrd, Model: PartialOrd> PartialOrd<Lms<T, Model>> for Lms<T, Model>
[src]
fn partial_cmp(&self, other: &Lms<T, Model>) -> Option<Ordering>
[src]
fn lt(&self, other: &Lms<T, Model>) -> bool
[src]
fn le(&self, other: &Lms<T, Model>) -> bool
[src]
fn gt(&self, other: &Lms<T, Model>) -> bool
[src]
fn ge(&self, other: &Lms<T, Model>) -> bool
[src]
impl<T, Model> RelativeEq<Lms<T, Model>> for Lms<T, Model> where
T: FreeChannelScalar + RelativeEq,
T::Epsilon: Clone,
Model: LmsModel<T>,
[src]
T: FreeChannelScalar + RelativeEq,
T::Epsilon: Clone,
Model: LmsModel<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, Model> StructuralPartialEq for Lms<T, Model>
[src]
impl<T, Model> UlpsEq<Lms<T, Model>> for Lms<T, Model> where
T: FreeChannelScalar + UlpsEq,
T::Epsilon: Clone,
Model: LmsModel<T>,
[src]
T: FreeChannelScalar + UlpsEq,
T::Epsilon: Clone,
Model: LmsModel<T>,
Auto Trait Implementations
impl<T, Model> RefUnwindSafe for Lms<T, Model> where
Model: RefUnwindSafe,
T: RefUnwindSafe,
Model: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, Model> Send for Lms<T, Model> where
Model: Send,
T: Send,
Model: Send,
T: Send,
impl<T, Model> Sync for Lms<T, Model> where
Model: Sync,
T: Sync,
Model: Sync,
T: Sync,
impl<T, Model> Unpin for Lms<T, Model> where
Model: Unpin,
T: Unpin,
Model: Unpin,
T: Unpin,
impl<T, Model> UnwindSafe for Lms<T, Model> where
Model: UnwindSafe,
T: UnwindSafe,
Model: UnwindSafe,
T: 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>,