#[repr(C)]pub struct Yxy<Wp = D65, T = f32>{
pub x: T,
pub y: T,
pub luma: T,
pub white_point: PhantomData<Wp>,
}
Expand description
The CIE 1931 Yxy (xyY) color space.
Yxy is a luminance-chromaticity color space derived from the CIE XYZ color space. It is widely used to define colors. The chromacity diagrams for the color spaces are a plot of this color space’s x and y coordiantes.
Conversions and operations on this color space depend on the white point.
Fields§
§x: T
x chromacity co-ordinate derived from XYZ color space as X/(X+Y+Z). Typical range is between 0 and 1
y: T
y chromacity co-ordinate derived from XYZ color space as Y/(X+Y+Z). Typical range is between 0 and 1
luma: T
luma (Y) was a measure of the brightness or luminance of a color. It is the same as the Y from the XYZ color space. Its range is from 0 to 1, where 0 is black and 1 is white.
white_point: PhantomData<Wp>
The white point associated with the color’s illuminant and observer. D65 for 2 degree observer is used by default.
Implementations§
source§impl<Wp, T> Yxy<Wp, T>
impl<Wp, T> Yxy<Wp, T>
sourcepub fn into_components(self) -> (T, T, T)
pub fn into_components(self) -> (T, T, T)
Convert to a (x, y, luma)
, a.k.a. (x, y, Y)
tuple.
sourcepub fn from_components((x, y, luma): (T, T, T)) -> Self
pub fn from_components((x, y, luma): (T, T, T)) -> Self
Convert from a (x, y, luma)
, a.k.a. (x, y, Y)
tuple.
Trait Implementations§
source§impl<Wp, T> AbsDiffEq for Yxy<Wp, T>
impl<Wp, T> AbsDiffEq for Yxy<Wp, T>
source§fn default_epsilon() -> Self::Epsilon
fn default_epsilon() -> Self::Epsilon
source§impl<Wp, T> AddAssign<T> for Yxy<Wp, T>
impl<Wp, T> AddAssign<T> for Yxy<Wp, T>
source§fn add_assign(&mut self, c: T)
fn add_assign(&mut self, c: T)
+=
operation. Read moresource§impl<Wp, T> AddAssign for Yxy<Wp, T>
impl<Wp, T> AddAssign for Yxy<Wp, T>
source§fn add_assign(&mut self, other: Yxy<Wp, T>)
fn add_assign(&mut self, other: Yxy<Wp, T>)
+=
operation. Read moresource§impl<Wp, T> ComponentWise for Yxy<Wp, T>
impl<Wp, T> ComponentWise for Yxy<Wp, T>
source§impl<'de, Wp, T> Deserialize<'de> for Yxy<Wp, T>
impl<'de, Wp, T> Deserialize<'de> for Yxy<Wp, T>
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl<Wp, T> DivAssign<T> for Yxy<Wp, T>
impl<Wp, T> DivAssign<T> for Yxy<Wp, T>
source§fn div_assign(&mut self, c: T)
fn div_assign(&mut self, c: T)
/=
operation. Read moresource§impl<Wp, T> DivAssign for Yxy<Wp, T>
impl<Wp, T> DivAssign for Yxy<Wp, T>
source§fn div_assign(&mut self, other: Yxy<Wp, T>)
fn div_assign(&mut self, other: Yxy<Wp, T>)
/=
operation. Read moresource§impl<Wp, T, _S> From<Alpha<Hsl<_S, T>, T>> for Yxy<Wp, T>where
T: Component + Float + Component + _FloatTrait,
Wp: WhitePoint,
_S: RgbSpace<WhitePoint = Wp>,
impl<Wp, T, _S> From<Alpha<Hsl<_S, T>, T>> for Yxy<Wp, T>where
T: Component + Float + Component + _FloatTrait,
Wp: WhitePoint,
_S: RgbSpace<WhitePoint = Wp>,
source§impl<Wp, T, _S> From<Alpha<Hsv<_S, T>, T>> for Yxy<Wp, T>where
T: Component + Float + Component + _FloatTrait,
Wp: WhitePoint,
_S: RgbSpace<WhitePoint = Wp>,
impl<Wp, T, _S> From<Alpha<Hsv<_S, T>, T>> for Yxy<Wp, T>where
T: Component + Float + Component + _FloatTrait,
Wp: WhitePoint,
_S: RgbSpace<WhitePoint = Wp>,
source§impl<Wp, T, _S> From<Alpha<Hwb<_S, T>, T>> for Yxy<Wp, T>where
T: Component + Float + Component + _FloatTrait,
Wp: WhitePoint,
_S: RgbSpace<WhitePoint = Wp>,
impl<Wp, T, _S> From<Alpha<Hwb<_S, T>, T>> for Yxy<Wp, T>where
T: Component + Float + Component + _FloatTrait,
Wp: WhitePoint,
_S: RgbSpace<WhitePoint = Wp>,
source§impl<Wp, T, _S> From<Alpha<Luma<_S, T>, T>> for Yxy<Wp, T>where
T: Component + Float + Component + _FloatTrait,
Wp: WhitePoint,
_S: LumaStandard<WhitePoint = Wp>,
impl<Wp, T, _S> From<Alpha<Luma<_S, T>, T>> for Yxy<Wp, T>where
T: Component + Float + Component + _FloatTrait,
Wp: WhitePoint,
_S: LumaStandard<WhitePoint = Wp>,
source§impl<Wp, T, _S> From<Alpha<Rgb<_S, T>, T>> for Yxy<Wp, T>where
T: Component + Float + Component + _FloatTrait,
Wp: WhitePoint,
_S: RgbStandard,
_S::Space: RgbSpace<WhitePoint = Wp>,
impl<Wp, T, _S> From<Alpha<Rgb<_S, T>, T>> for Yxy<Wp, T>where
T: Component + Float + Component + _FloatTrait,
Wp: WhitePoint,
_S: RgbStandard,
_S::Space: RgbSpace<WhitePoint = Wp>,
source§impl<Wp, T, _S> From<Hsl<_S, T>> for Yxy<Wp, T>where
T: Component + Float + Component + _FloatTrait,
Wp: WhitePoint,
_S: RgbSpace<WhitePoint = Wp>,
impl<Wp, T, _S> From<Hsl<_S, T>> for Yxy<Wp, T>where
T: Component + Float + Component + _FloatTrait,
Wp: WhitePoint,
_S: RgbSpace<WhitePoint = Wp>,
source§impl<Wp, T, _S> From<Hsv<_S, T>> for Yxy<Wp, T>where
T: Component + Float + Component + _FloatTrait,
Wp: WhitePoint,
_S: RgbSpace<WhitePoint = Wp>,
impl<Wp, T, _S> From<Hsv<_S, T>> for Yxy<Wp, T>where
T: Component + Float + Component + _FloatTrait,
Wp: WhitePoint,
_S: RgbSpace<WhitePoint = Wp>,
source§impl<Wp, T, _S> From<Hwb<_S, T>> for Yxy<Wp, T>where
T: Component + Float + Component + _FloatTrait,
Wp: WhitePoint,
_S: RgbSpace<WhitePoint = Wp>,
impl<Wp, T, _S> From<Hwb<_S, T>> for Yxy<Wp, T>where
T: Component + Float + Component + _FloatTrait,
Wp: WhitePoint,
_S: RgbSpace<WhitePoint = Wp>,
source§impl<Wp, T, _S> From<Rgb<_S, T>> for Yxy<Wp, T>where
T: Component + Float + Component + _FloatTrait,
Wp: WhitePoint,
_S: RgbStandard,
_S::Space: RgbSpace<WhitePoint = Wp>,
impl<Wp, T, _S> From<Rgb<_S, T>> for Yxy<Wp, T>where
T: Component + Float + Component + _FloatTrait,
Wp: WhitePoint,
_S: RgbStandard,
_S::Space: RgbSpace<WhitePoint = Wp>,
source§impl<S: RgbStandard, T> From<Yxy<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>> for Alpha<Rgb<S, T>, T>
impl<S: RgbStandard, T> From<Yxy<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>> for Alpha<Rgb<S, T>, T>
source§impl<S: RgbStandard, T> From<Yxy<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>> for Rgb<S, T>
impl<S: RgbStandard, T> From<Yxy<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>> for Rgb<S, T>
source§impl<S, T> From<Yxy<<S as LumaStandard>::WhitePoint, T>> for Alpha<Luma<S, T>, T>
impl<S, T> From<Yxy<<S as LumaStandard>::WhitePoint, T>> for Alpha<Luma<S, T>, T>
source§fn from(color: Yxy<S::WhitePoint, T>) -> Self
fn from(color: Yxy<S::WhitePoint, T>) -> Self
source§impl<S, T> From<Yxy<<S as LumaStandard>::WhitePoint, T>> for Luma<S, T>
impl<S, T> From<Yxy<<S as LumaStandard>::WhitePoint, T>> for Luma<S, T>
source§fn from(color: Yxy<S::WhitePoint, T>) -> Self
fn from(color: Yxy<S::WhitePoint, T>) -> Self
source§impl<S, T> From<Yxy<<S as RgbSpace>::WhitePoint, T>> for Alpha<Hsl<S, T>, T>
impl<S, T> From<Yxy<<S as RgbSpace>::WhitePoint, T>> for Alpha<Hsl<S, T>, T>
source§fn from(color: Yxy<S::WhitePoint, T>) -> Self
fn from(color: Yxy<S::WhitePoint, T>) -> Self
source§impl<S, T> From<Yxy<<S as RgbSpace>::WhitePoint, T>> for Alpha<Hsv<S, T>, T>
impl<S, T> From<Yxy<<S as RgbSpace>::WhitePoint, T>> for Alpha<Hsv<S, T>, T>
source§fn from(color: Yxy<S::WhitePoint, T>) -> Self
fn from(color: Yxy<S::WhitePoint, T>) -> Self
source§impl<S, T> From<Yxy<<S as RgbSpace>::WhitePoint, T>> for Alpha<Hwb<S, T>, T>
impl<S, T> From<Yxy<<S as RgbSpace>::WhitePoint, T>> for Alpha<Hwb<S, T>, T>
source§fn from(color: Yxy<S::WhitePoint, T>) -> Self
fn from(color: Yxy<S::WhitePoint, T>) -> Self
source§impl<S, T> From<Yxy<<S as RgbSpace>::WhitePoint, T>> for Hsl<S, T>
impl<S, T> From<Yxy<<S as RgbSpace>::WhitePoint, T>> for Hsl<S, T>
source§fn from(color: Yxy<S::WhitePoint, T>) -> Self
fn from(color: Yxy<S::WhitePoint, T>) -> Self
source§impl<S, T> From<Yxy<<S as RgbSpace>::WhitePoint, T>> for Hsv<S, T>
impl<S, T> From<Yxy<<S as RgbSpace>::WhitePoint, T>> for Hsv<S, T>
source§fn from(color: Yxy<S::WhitePoint, T>) -> Self
fn from(color: Yxy<S::WhitePoint, T>) -> Self
source§impl<S, T> From<Yxy<<S as RgbSpace>::WhitePoint, T>> for Hwb<S, T>
impl<S, T> From<Yxy<<S as RgbSpace>::WhitePoint, T>> for Hwb<S, T>
source§fn from(color: Yxy<S::WhitePoint, T>) -> Self
fn from(color: Yxy<S::WhitePoint, T>) -> Self
source§impl<Wp, T> FromColor<Wp, T> for Yxy<Wp, T>
impl<Wp, T> FromColor<Wp, T> for Yxy<Wp, T>
source§fn from_rgb<S: RgbSpace<WhitePoint = Wp>>(inp: Rgb<Linear<S>, T>) -> Self
fn from_rgb<S: RgbSpace<WhitePoint = Wp>>(inp: Rgb<Linear<S>, T>) -> Self
source§fn from_hsl<S: RgbSpace<WhitePoint = Wp>>(inp: Hsl<S, T>) -> Self
fn from_hsl<S: RgbSpace<WhitePoint = Wp>>(inp: Hsl<S, T>) -> Self
source§impl<Wp, T> IntoColor<Wp, T> for Yxy<Wp, T>
impl<Wp, T> IntoColor<Wp, T> for Yxy<Wp, T>
source§impl<Wp, T> Limited for Yxy<Wp, T>
impl<Wp, T> Limited for Yxy<Wp, T>
source§impl<Wp, T> MulAssign<T> for Yxy<Wp, T>
impl<Wp, T> MulAssign<T> for Yxy<Wp, T>
source§fn mul_assign(&mut self, c: T)
fn mul_assign(&mut self, c: T)
*=
operation. Read moresource§impl<Wp, T> MulAssign for Yxy<Wp, T>
impl<Wp, T> MulAssign for Yxy<Wp, T>
source§fn mul_assign(&mut self, other: Yxy<Wp, T>)
fn mul_assign(&mut self, other: Yxy<Wp, T>)
*=
operation. Read moresource§impl<Wp, T> PartialEq for Yxy<Wp, T>
impl<Wp, T> PartialEq for Yxy<Wp, T>
source§impl<Wp, T> Pixel<T> for Yxy<Wp, T>
impl<Wp, T> Pixel<T> for Yxy<Wp, T>
source§fn as_raw_mut<P: RawPixel<T> + ?Sized>(&mut self) -> &mut P
fn as_raw_mut<P: RawPixel<T> + ?Sized>(&mut self) -> &mut P
source§fn into_raw<P: RawPixelSized<T>>(self) -> P
fn into_raw<P: RawPixelSized<T>>(self) -> P
source§fn from_raw<P: RawPixel<T> + ?Sized>(pixel: &P) -> &Self
fn from_raw<P: RawPixel<T> + ?Sized>(pixel: &P) -> &Self
source§fn from_raw_mut<P: RawPixel<T> + ?Sized>(pixel: &mut P) -> &mut Self
fn from_raw_mut<P: RawPixel<T> + ?Sized>(pixel: &mut P) -> &mut Self
source§fn from_raw_slice(slice: &[T]) -> &[Self]
fn from_raw_slice(slice: &[T]) -> &[Self]
source§fn from_raw_slice_mut(slice: &mut [T]) -> &mut [Self]
fn from_raw_slice_mut(slice: &mut [T]) -> &mut [Self]
source§impl<Wp, T> RelativeEq for Yxy<Wp, T>
impl<Wp, T> RelativeEq for Yxy<Wp, T>
source§fn default_max_relative() -> T::Epsilon
fn default_max_relative() -> T::Epsilon
source§impl<Wp, T> SubAssign<T> for Yxy<Wp, T>
impl<Wp, T> SubAssign<T> for Yxy<Wp, T>
source§fn sub_assign(&mut self, c: T)
fn sub_assign(&mut self, c: T)
-=
operation. Read moresource§impl<Wp, T> SubAssign for Yxy<Wp, T>
impl<Wp, T> SubAssign for Yxy<Wp, T>
source§fn sub_assign(&mut self, other: Yxy<Wp, T>)
fn sub_assign(&mut self, other: Yxy<Wp, T>)
-=
operation. Read moresource§impl<Wp, T> UlpsEq for Yxy<Wp, T>
impl<Wp, T> UlpsEq for Yxy<Wp, T>
impl<Wp, T> Copy for Yxy<Wp, T>
impl<Wp, T> StructuralPartialEq for Yxy<Wp, T>
Auto Trait Implementations§
impl<Wp, T> RefUnwindSafe for Yxy<Wp, T>where
T: RefUnwindSafe,
Wp: RefUnwindSafe,
impl<Wp, T> Send for Yxy<Wp, T>
impl<Wp, T> Sync for Yxy<Wp, T>
impl<Wp, T> Unpin for Yxy<Wp, T>
impl<Wp, T> UnwindSafe for Yxy<Wp, T>where
T: UnwindSafe,
Wp: UnwindSafe,
Blanket Implementations§
source§impl<S, D, Swp, Dwp, T> AdaptFrom<S, Swp, Dwp, T> for Dwhere
T: Component + Float,
Swp: WhitePoint,
Dwp: WhitePoint,
S: IntoColor<Swp, T>,
D: FromColor<Dwp, T>,
impl<S, D, Swp, Dwp, T> AdaptFrom<S, Swp, Dwp, T> for Dwhere
T: Component + Float,
Swp: WhitePoint,
Dwp: WhitePoint,
S: IntoColor<Swp, T>,
D: FromColor<Dwp, T>,
source§fn adapt_from_using<M>(color: S, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_from_using<M>(color: S, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
source§fn adapt_from(color: S) -> Self
fn adapt_from(color: S) -> Self
source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T, U> ConvertFrom<T> for U
impl<T, U> ConvertFrom<T> for U
source§fn convert_from(t: T) -> U
fn convert_from(t: T) -> U
source§fn try_convert_from(t: T) -> Result<U, OutOfBounds<U>>
fn try_convert_from(t: T) -> Result<U, OutOfBounds<U>>
OutOfBounds
error is returned which contains the unclamped color. Read moresource§fn convert_unclamped_from(val: T) -> Self
fn convert_unclamped_from(val: T) -> Self
source§impl<T, U> ConvertInto<U> for Twhere
U: ConvertFrom<T>,
impl<T, U> ConvertInto<U> for Twhere
U: ConvertFrom<T>,
source§fn convert_into(self) -> U
fn convert_into(self) -> U
source§fn convert_unclamped_into(self) -> U
fn convert_unclamped_into(self) -> U
source§fn try_convert_into(self) -> Result<U, OutOfBounds<U>>
fn try_convert_into(self) -> Result<U, OutOfBounds<U>>
OutOfBounds
error is returned which contains the unclamped color. Read more