Struct kolor_64::ColorSpace[][src]

pub struct ColorSpace { /* fields omitted */ }

ColorSpace is a coordinate space for colors. See spaces for defined color spaces.

A ColorSpace’s coordinate system is defined by its RGBPrimaries, a WhitePoint and optionally a non-linear TransformFn. An example of a non-linear transform is the sRGB “opto-eletronic transfer function”, or “gamma compensation”.

A linear ColorSpace can be thought of as defining a coordinate system in the CIE XYZ color coordinate space, where the three primaries each define an axis pointing from (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 coordinate 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.