Struct colstodian::spaces::DynamicColorSpace [−][src]
pub struct DynamicColorSpace { /* fields omitted */ }
Expand description
A color space defined in data by its Primaries, white point, and an optional invertible transform function.
See spaces for defined color spaces.
ColorSpace assumes that a color space is one of
- the CIE XYZ color space
- an RGB color space
- a color space which may be defined as 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 non-linear mapping from a linear ColorSpace’s coordinate system.
Implementations
pub const fn new(
primaries: RGBPrimaries,
white_point: WhitePoint,
transform_fn: TransformFn
) -> ColorSpace
Creates a new color space with the primaries and white point from this
,
but with the provided TransformFn.
Creates a new color space with the transform function and white point from this
,
but with the provided WhitePoint.
Creates a new color space with the primaries and transform function from this
,
but with the provided RGBPrimaries.
Creates a CIE LAB color space using this space’s white point.
Creates a CIE uvV color space using this space’s white point.
Creates a CIE LCh color space using this space’s white point.
Trait Implementations
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<ColorSpace, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<ColorSpace, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
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
Mutably borrows from an owned value. Read more
impl<SrcAlpha, DstAlpha> ConvertToAlphaRaw<DstAlpha> for SrcAlpha where
DstAlpha: ConvertFromAlphaRaw<SrcAlpha>,
impl<SrcAlpha, DstAlpha> ConvertToAlphaRaw<DstAlpha> for SrcAlpha where
DstAlpha: ConvertFromAlphaRaw<SrcAlpha>,