[][src]Struct prisma::Luv

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

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]

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]

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]

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]

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]

type Epsilon = T::Epsilon

Used for specifying relative comparisons.

impl<T, W> Bounded for Luv<T, W> where
    T: FreeChannelScalar,
    W: WhitePoint<T>, 
[src]

impl<T, W> Broadcast for Luv<T, W> where
    T: FreeChannelScalar,
    W: UnitWhitePoint<T>, 
[src]

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]

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

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]

impl<T, W> Display for Luv<T, W> where
    T: FreeChannelScalar + Display,
    W: WhitePoint<T>, 
[src]

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]

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]

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]

impl<T, W> HomogeneousColor for Luv<T, W> where
    T: FreeChannelScalar,
    W: WhitePoint<T>, 
[src]

type ChannelFormat = T

The scalar type of each channel

impl<T, W> Lerp for Luv<T, W> where
    T: FreeChannelScalar + Lerp,
    W: WhitePoint<T>, 
[src]

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

The type of the pos argument

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]

impl<T, W> RelativeEq<Luv<T, W>> for Luv<T, W> where
    T: FreeChannelScalar + RelativeEq,
    T::Epsilon: Clone,
    W: WhitePoint<T>, 
[src]

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]

Auto Trait Implementations

impl<T, W> RefUnwindSafe for Luv<T, W> where
    T: RefUnwindSafe,
    W: RefUnwindSafe

impl<T, W> Send for Luv<T, W> where
    T: Send,
    W: Send

impl<T, W> Sync for Luv<T, W> where
    T: Sync,
    W: Sync

impl<T, W> Unpin for Luv<T, W> where
    T: Unpin,
    W: Unpin

impl<T, W> UnwindSafe for Luv<T, W> where
    T: UnwindSafe,
    W: 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.