Struct kolor_64::ColorSpace [−][src]
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]
primaries: RGBPrimaries,
white_point: WhitePoint,
transform_fn: TransformFn
) -> Self
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]
fn clone(&self) -> ColorSpace
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for ColorSpace
[src]
impl Debug for ColorSpace
[src]
impl Eq for ColorSpace
[src]
impl Hash for ColorSpace
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<ColorSpace> for ColorSpace
[src]
fn eq(&self, other: &ColorSpace) -> bool
[src]
fn ne(&self, other: &ColorSpace) -> bool
[src]
impl StructuralEq for ColorSpace
[src]
impl StructuralPartialEq for ColorSpace
[src]
Auto Trait Implementations
impl RefUnwindSafe for ColorSpace
impl Send for ColorSpace
impl Sync for ColorSpace
impl Unpin for ColorSpace
impl UnwindSafe for ColorSpace
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,