[][src]Trait prisma::color_space::ColorSpace

pub trait ColorSpace<T>: Clone {
    type Encoding: ColorEncoding;
    fn red_primary(&self) -> RgbPrimary<T>;
fn green_primary(&self) -> RgbPrimary<T>;
fn blue_primary(&self) -> RgbPrimary<T>;
fn white_point(&self) -> Xyz<T>;
fn encoding(&self) -> Self::Encoding;
fn get_xyz_transform(&self) -> Matrix3<T>;
fn get_inverse_xyz_transform(&self) -> Matrix3<T>;
fn apply_transform(&self, vec: (T, T, T)) -> (T, T, T); }

A color space that allows moving from device-dependent to device-independent spaces and back

A color space is defined by red, green and blue primaries in xy chromaticity space, and a white point in XYZ space. These values are used to compute a 3x3 transformation matrix on computation which is cached and used for all conversion operations.

Associated Types

type Encoding: ColorEncoding

The standard encoding used by this color space

Loading content...

Required methods

fn red_primary(&self) -> RgbPrimary<T>

Returns the red primary of the color space

fn green_primary(&self) -> RgbPrimary<T>

Returns the green primary of the color space

fn blue_primary(&self) -> RgbPrimary<T>

Returns the blue primary of the color space

fn white_point(&self) -> Xyz<T>

Returns the white point of the color space

fn encoding(&self) -> Self::Encoding

Returns standard the encoding used by the color space

fn get_xyz_transform(&self) -> Matrix3<T>

Returns the computed RGB -> XYZ matrix

fn get_inverse_xyz_transform(&self) -> Matrix3<T>

Returns the computed XYZ -> RGB matrix

fn apply_transform(&self, vec: (T, T, T)) -> (T, T, T)

Apply the forward transform to a 3-vector

Loading content...

Implementations on Foreign Types

impl<T, E> ColorSpace<T> for Rc<EncodedColorSpace<T, E>> where
    T: Float + FreeChannelScalar + PosNormalChannelScalar,
    E: ColorEncoding
[src]

type Encoding = E

impl<T, E> ColorSpace<T> for Arc<EncodedColorSpace<T, E>> where
    T: Float + FreeChannelScalar + PosNormalChannelScalar,
    E: ColorEncoding
[src]

type Encoding = E

Loading content...

Implementors

impl<'a, T, E> ColorSpace<T> for &'a EncodedColorSpace<T, E> where
    T: Float + FreeChannelScalar + PosNormalChannelScalar,
    E: ColorEncoding
[src]

type Encoding = E

impl<T> ColorSpace<T> for SRgb<T> where
    T: Float + FreeChannelScalar + PosNormalChannelScalar
[src]

type Encoding = SrgbEncoding

impl<T, E> ColorSpace<T> for EncodedColorSpace<T, E> where
    T: Float + FreeChannelScalar + PosNormalChannelScalar,
    E: ColorEncoding
[src]

type Encoding = E

Loading content...