Struct kolor_64::ColorSpace[][src]

pub struct ColorSpace { /* fields omitted */ }

See spaces for defined color spaces.

ColorSpace assumes that a color space is one of

  • the CIE XYZ color space
  • an RGB color space
  • an invertible mapping from one the above (TransformFn)

An example of a TransformFn is the sRGB “opto-eletronic transfer function”, or “gamma compensation”.

kolor makes the distinction between “linear” and “non-linear” color spaces, where a linear color space can be defined as a linear transformation from the CIE XYZ color space.

ColorSpace contains a reference WhitePoint to represent a color space’s reference illuminant.

A linear RGB ColorSpace can be thought of as defining a relative coordinate system in the CIE XYZ color coordinate space, where three RGB primaries each define an axis pointing from the black point (0,0,0) in CIE XYZ. Non-linear ColorSpaces - such as sRGB with gamma compensation applied - are defined as a mapping from a linear ColorSpace’s coordinate system.

Implementations

impl ColorSpace[src]

pub const fn new(
    primaries: RGBPrimaries,
    white_point: WhitePoint,
    transform_fn: TransformFn
) -> Self
[src]

pub fn is_linear(&self) -> bool[src]

Whether the color space has a non-linear transform applied

pub fn as_linear(&self) -> Self[src]

pub fn primaries(&self) -> RGBPrimaries[src]

pub fn white_point(&self) -> WhitePoint[src]

pub fn transform_function(&self) -> TransformFn[src]

pub fn with_transform(&self, new_transform: TransformFn) -> Self[src]

Creates a new color space with the primaries and white point from this, but with the provided TransformFn.

pub fn with_whitepoint(&self, new_wp: WhitePoint) -> Self[src]

Creates a new color space with the transform function and white point from this, but with the provided WhitePoint.

pub fn with_primaries(&self, primaries: RGBPrimaries) -> Self[src]

Creates a new color space with the primaries and transform function from this, but with the provided RGBPrimaries.

pub fn to_cielab(&self) -> Self[src]

Creates a CIE LAB color space using this space’s white point.

pub fn to_cie_xyY(&self) -> Self[src]

Creates a CIE uvV color space using this space’s white point.

pub fn to_cielch(&self) -> Self[src]

Creates a CIE LCh color space using this space’s white point.

Trait Implementations

impl Clone for ColorSpace[src]

impl Copy for ColorSpace[src]

impl Debug for ColorSpace[src]

impl Eq for ColorSpace[src]

impl Hash for ColorSpace[src]

impl PartialEq<ColorSpace> for ColorSpace[src]

impl StructuralEq for ColorSpace[src]

impl StructuralPartialEq for ColorSpace[src]

Auto Trait Implementations

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, 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.