[][src]Struct prisma::lms::Lms

#[repr(C)]pub struct Lms<T, Model> { /* fields omitted */ }

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]

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]

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]

type Epsilon = T::Epsilon

Used for specifying relative comparisons.

impl<T, Model> Bounded for Lms<T, Model> where
    T: FreeChannelScalar,
    Model: LmsModel<T>, 
[src]

impl<T, Model> Broadcast for Lms<T, Model> where
    T: FreeChannelScalar,
    Model: LmsModel<T>, 
[src]

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]

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

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]

impl<T, Model> Display for Lms<T, Model> where
    T: FreeChannelScalar + Display,
    Model: LmsModel<T>, 
[src]

impl<T, Model> Flatten for Lms<T, Model> where
    T: FreeChannelScalar,
    Model: LmsModel<T>, 
[src]

impl<T, Model> FromColor<Lms<T, Model>> for Xyz<T> where
    T: FreeChannelScalar,
    Model: LmsModel<T>, 
[src]

impl<T, Model> FromColor<Xyz<T>> for Lms<T, Model> where
    T: FreeChannelScalar,
    Model: LmsModel<T>, 
[src]

impl<T, Model> FromTuple for Lms<T, Model> where
    T: FreeChannelScalar,
    Model: LmsModel<T>, 
[src]

impl<T, Model> HomogeneousColor for Lms<T, Model> where
    T: FreeChannelScalar,
    Model: LmsModel<T>, 
[src]

type ChannelFormat = T

The scalar type of each channel

impl<T, Model> Lerp for Lms<T, Model> where
    T: FreeChannelScalar,
    Model: LmsModel<T>,
    FreeChannel<T>: Lerp
[src]

type Position = <FreeChannel<T> as Lerp>::Position

The type of the pos argument

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]

impl<T, Model> RelativeEq<Lms<T, Model>> for Lms<T, Model> where
    T: FreeChannelScalar + RelativeEq,
    T::Epsilon: Clone,
    Model: LmsModel<T>, 
[src]

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]

Auto Trait Implementations

impl<T, Model> RefUnwindSafe for Lms<T, Model> where
    Model: RefUnwindSafe,
    T: RefUnwindSafe

impl<T, Model> Send for Lms<T, Model> where
    Model: Send,
    T: Send

impl<T, Model> Sync for Lms<T, Model> where
    Model: Sync,
    T: Sync

impl<T, Model> Unpin for Lms<T, Model> where
    Model: Unpin,
    T: Unpin

impl<T, Model> UnwindSafe for Lms<T, Model> where
    Model: UnwindSafe,
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.