Struct nannou_core::color::Xyz
source · #[repr(C)]pub struct Xyz<Wp = D65, T = f32>{
pub x: T,
pub y: T,
pub z: T,
pub white_point: PhantomData<Wp>,
}
Expand description
The CIE 1931 XYZ color space.
XYZ links the perceived colors to their wavelengths and simply makes it possible to describe the way we see colors as numbers. It’s often used when converting from one color space to an other, and requires a standard illuminant and a standard observer to be defined.
Conversions and operations on this color space depend on the defined white point
Fields§
§x: T
X is the scale of what can be seen as a response curve for the cone cells in the human eye. Its range depends on the white point and goes from 0.0 to 0.95047 for the default D65.
y: T
Y is the luminance of the color, where 0.0 is black and 1.0 is white.
z: T
Z is the scale of what can be seen as the blue stimulation. Its range depends on the white point and goes from 0.0 to 1.08883 for the defautl D65.
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§
Trait Implementations§
source§impl<Wp, T> AbsDiffEq for Xyz<Wp, T>
impl<Wp, T> AbsDiffEq for Xyz<Wp, T>
source§fn default_epsilon() -> <Xyz<Wp, T> as AbsDiffEq>::Epsilon
fn default_epsilon() -> <Xyz<Wp, T> as AbsDiffEq>::Epsilon
source§impl<Wp, T> AddAssign<T> for Xyz<Wp, T>
impl<Wp, T> AddAssign<T> for Xyz<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 Xyz<Wp, T>
impl<Wp, T> AddAssign for Xyz<Wp, T>
source§fn add_assign(&mut self, other: Xyz<Wp, T>)
fn add_assign(&mut self, other: Xyz<Wp, T>)
+=
operation. Read moresource§impl<Wp, T> ComponentWise for Xyz<Wp, T>
impl<Wp, T> ComponentWise for Xyz<Wp, T>
source§impl<'de, Wp, T> Deserialize<'de> for Xyz<Wp, T>
impl<'de, Wp, T> Deserialize<'de> for Xyz<Wp, T>
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<Xyz<Wp, T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Xyz<Wp, T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
source§impl<Wp, T> DivAssign<T> for Xyz<Wp, T>
impl<Wp, T> DivAssign<T> for Xyz<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 Xyz<Wp, T>
impl<Wp, T> DivAssign for Xyz<Wp, T>
source§fn div_assign(&mut self, other: Xyz<Wp, T>)
fn div_assign(&mut self, other: Xyz<Wp, T>)
/=
operation. Read moresource§impl<Wp, T, _S> From<Alpha<Rgb<_S, T>, T>> for Xyz<Wp, T>where
T: Component + Float,
Wp: WhitePoint,
_S: RgbStandard,
<_S as RgbStandard>::Space: RgbSpace<WhitePoint = Wp>,
impl<Wp, T, _S> From<Alpha<Rgb<_S, T>, T>> for Xyz<Wp, T>where
T: Component + Float,
Wp: WhitePoint,
_S: RgbStandard,
<_S as RgbStandard>::Space: RgbSpace<WhitePoint = Wp>,
source§impl<Wp, T, S> From<Rgb<S, T>> for Xyz<Wp, T>where
T: Component + Float,
Wp: WhitePoint,
S: RgbStandard,
<S as RgbStandard>::Space: RgbSpace<WhitePoint = Wp>,
impl<Wp, T, S> From<Rgb<S, T>> for Xyz<Wp, T>where
T: Component + Float,
Wp: WhitePoint,
S: RgbStandard,
<S as RgbStandard>::Space: RgbSpace<WhitePoint = Wp>,
source§impl<S, T> From<Xyz<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>> for Alpha<Rgb<S, T>, T>
impl<S, T> From<Xyz<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>> for Alpha<Rgb<S, T>, T>
source§fn from(
color: Xyz<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>
) -> Alpha<Rgb<S, T>, T>
fn from( color: Xyz<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T> ) -> Alpha<Rgb<S, T>, T>
source§impl<S, T> From<Xyz<<S as LumaStandard>::WhitePoint, T>> for Alpha<Luma<S, T>, T>
impl<S, T> From<Xyz<<S as LumaStandard>::WhitePoint, T>> for Alpha<Luma<S, T>, T>
source§fn from(color: Xyz<<S as LumaStandard>::WhitePoint, T>) -> Alpha<Luma<S, T>, T>
fn from(color: Xyz<<S as LumaStandard>::WhitePoint, T>) -> Alpha<Luma<S, T>, T>
source§impl<S, T> From<Xyz<<S as LumaStandard>::WhitePoint, T>> for Luma<S, T>
impl<S, T> From<Xyz<<S as LumaStandard>::WhitePoint, T>> for Luma<S, T>
source§fn from(color: Xyz<<S as LumaStandard>::WhitePoint, T>) -> Luma<S, T>
fn from(color: Xyz<<S as LumaStandard>::WhitePoint, T>) -> Luma<S, T>
source§impl<S, Wp, T> From<Xyz<Wp, T>> for Rgb<S, T>where
S: RgbStandard,
T: Component + Float,
Wp: WhitePoint,
<S as RgbStandard>::Space: RgbSpace<WhitePoint = Wp>,
impl<S, Wp, T> From<Xyz<Wp, T>> for Rgb<S, T>where
S: RgbStandard,
T: Component + Float,
Wp: WhitePoint,
<S as RgbStandard>::Space: RgbSpace<WhitePoint = Wp>,
source§impl<Wp, T> FromColor<Wp, T> for Xyz<Wp, T>
impl<Wp, T> FromColor<Wp, T> for Xyz<Wp, T>
source§fn from_rgb<_S>(color: Rgb<Linear<_S>, T>) -> Xyz<Wp, T>where
_S: RgbSpace<WhitePoint = Wp>,
fn from_rgb<_S>(color: Rgb<Linear<_S>, T>) -> Xyz<Wp, T>where
_S: RgbSpace<WhitePoint = Wp>,
source§fn from_hsl<S>(inp: Hsl<S, T>) -> Selfwhere
S: RgbSpace<WhitePoint = Wp>,
fn from_hsl<S>(inp: Hsl<S, T>) -> Selfwhere
S: RgbSpace<WhitePoint = Wp>,
source§impl<Wp, T> IntoColor<Wp, T> for Xyz<Wp, T>
impl<Wp, T> IntoColor<Wp, T> for Xyz<Wp, T>
source§fn into_rgb<S>(self) -> Rgb<Linear<S>, T>where
S: RgbSpace<WhitePoint = Wp>,
fn into_rgb<S>(self) -> Rgb<Linear<S>, T>where
S: RgbSpace<WhitePoint = Wp>,
source§fn into_hsl<S>(self) -> Hsl<S, T>where
S: RgbSpace<WhitePoint = Wp>,
fn into_hsl<S>(self) -> Hsl<S, T>where
S: RgbSpace<WhitePoint = Wp>,
source§impl<S> IntoLinSrgba<S> for Xyz<D65, S>
impl<S> IntoLinSrgba<S> for Xyz<D65, S>
source§fn into_lin_srgba(self) -> LinSrgba<S>
fn into_lin_srgba(self) -> LinSrgba<S>
source§impl<Wp, T> Limited for Xyz<Wp, T>
impl<Wp, T> Limited for Xyz<Wp, T>
source§impl<Wp, T> MulAssign<T> for Xyz<Wp, T>
impl<Wp, T> MulAssign<T> for Xyz<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 Xyz<Wp, T>
impl<Wp, T> MulAssign for Xyz<Wp, T>
source§fn mul_assign(&mut self, other: Xyz<Wp, T>)
fn mul_assign(&mut self, other: Xyz<Wp, T>)
*=
operation. Read moresource§impl<Wp, T> PartialEq for Xyz<Wp, T>
impl<Wp, T> PartialEq for Xyz<Wp, T>
source§impl<Wp, T> Pixel<T> for Xyz<Wp, T>
impl<Wp, T> Pixel<T> for Xyz<Wp, T>
source§fn as_raw_mut<P>(&mut self) -> &mut P
fn as_raw_mut<P>(&mut self) -> &mut P
source§fn into_raw<P>(self) -> Pwhere
P: RawPixelSized<T>,
fn into_raw<P>(self) -> Pwhere
P: RawPixelSized<T>,
source§fn from_raw_mut<P>(pixel: &mut P) -> &mut Self
fn from_raw_mut<P>(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 Xyz<Wp, T>where
T: Component + Float + RelativeEq,
<T as AbsDiffEq>::Epsilon: Copy + Float,
Wp: WhitePoint + PartialEq,
impl<Wp, T> RelativeEq for Xyz<Wp, T>where
T: Component + Float + RelativeEq,
<T as AbsDiffEq>::Epsilon: Copy + Float,
Wp: WhitePoint + PartialEq,
source§fn default_max_relative() -> <T as AbsDiffEq>::Epsilon
fn default_max_relative() -> <T as AbsDiffEq>::Epsilon
source§impl<Wp, T> Serialize for Xyz<Wp, T>
impl<Wp, T> Serialize for Xyz<Wp, T>
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
source§impl<Wp, T> SubAssign<T> for Xyz<Wp, T>
impl<Wp, T> SubAssign<T> for Xyz<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 Xyz<Wp, T>
impl<Wp, T> SubAssign for Xyz<Wp, T>
source§fn sub_assign(&mut self, other: Xyz<Wp, T>)
fn sub_assign(&mut self, other: Xyz<Wp, T>)
-=
operation. Read moresource§impl<Wp, T> UlpsEq for Xyz<Wp, T>
impl<Wp, T> UlpsEq for Xyz<Wp, T>
source§fn default_max_ulps() -> u32
fn default_max_ulps() -> u32
impl<Wp, T> Copy for Xyz<Wp, T>
impl<Wp, T> StructuralPartialEq for Xyz<Wp, T>
Auto Trait Implementations§
impl<Wp, T> RefUnwindSafe for Xyz<Wp, T>where
T: RefUnwindSafe,
Wp: RefUnwindSafe,
impl<Wp, T> Send for Xyz<Wp, T>
impl<Wp, T> Sync for Xyz<Wp, T>
impl<Wp, T> Unpin for Xyz<Wp, T>
impl<Wp, T> UnwindSafe for Xyz<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