pub type Xyza<Wp = D65, T = f32> = Alpha<Xyz<Wp, T>, T>;
Expand description
CIE 1931 XYZ with an alpha component. See the Xyza
implementation in
Alpha
.
Aliased Type§
struct Xyza<Wp = D65, T = f32> {
pub color: Xyz<Wp, T>,
pub alpha: T,
}
Fields§
§color: Xyz<Wp, T>
The color.
alpha: T
The transparency component. 0.0 is fully transparent and 1.0 is fully opaque.
Implementations
source§impl<Wp, T, A> Alpha<Xyz<Wp, T>, A>
impl<Wp, T, A> Alpha<Xyz<Wp, T>, A>
Xyza
implementations.
sourcepub fn into_components(self) -> (T, T, T, A)
pub fn into_components(self) -> (T, T, T, A)
Convert to a (X, Y, Z, alpha)
tuple.
sourcepub fn from_components((x, y, z, alpha): (T, T, T, A)) -> Self
pub fn from_components((x, y, z, alpha): (T, T, T, A)) -> Self
Convert from a (X, Y, Z, alpha)
tuple.
Trait Implementations
source§impl<C, T> AbsDiffEq for Alpha<C, T>
impl<C, T> AbsDiffEq for Alpha<C, T>
source§fn default_epsilon() -> Self::Epsilon
fn default_epsilon() -> Self::Epsilon
The default tolerance to use when testing values that are close together. Read more
source§impl<Wp, T, _S> From<Alpha<Luma<_S, T>, T>> for Alpha<Xyz<Wp, T>, T>where
T: Component + Float + Component + _FloatTrait,
Wp: WhitePoint,
_S: LumaStandard<WhitePoint = Wp>,
impl<Wp, T, _S> From<Alpha<Luma<_S, T>, T>> for Alpha<Xyz<Wp, T>, T>where
T: Component + Float + Component + _FloatTrait,
Wp: WhitePoint,
_S: LumaStandard<WhitePoint = Wp>,
source§impl<Wp, T, _S> From<Alpha<Hsl<_S, T>, T>> for Alpha<Xyz<Wp, T>, T>where
T: Component + Float + Component + _FloatTrait,
Wp: WhitePoint,
_S: RgbSpace<WhitePoint = Wp>,
impl<Wp, T, _S> From<Alpha<Hsl<_S, T>, T>> for Alpha<Xyz<Wp, T>, T>where
T: Component + Float + Component + _FloatTrait,
Wp: WhitePoint,
_S: RgbSpace<WhitePoint = Wp>,
source§impl<Wp, T, _S> From<Hsv<_S, T>> for Alpha<Xyz<Wp, T>, T>where
T: Component + Float + Component + _FloatTrait,
Wp: WhitePoint,
_S: RgbSpace<WhitePoint = Wp>,
impl<Wp, T, _S> From<Hsv<_S, T>> for Alpha<Xyz<Wp, T>, T>where
T: Component + Float + Component + _FloatTrait,
Wp: WhitePoint,
_S: RgbSpace<WhitePoint = Wp>,
impl<C, T> StructuralPartialEq for Alpha<C, T>
source§impl<T: MulAssign + Copy, C: MulAssign<T>> MulAssign<T> for Alpha<C, T>
impl<T: MulAssign + Copy, C: MulAssign<T>> MulAssign<T> for Alpha<C, T>
source§fn mul_assign(&mut self, c: T)
fn mul_assign(&mut self, c: T)
Performs the
*=
operation. Read moresource§impl<Wp, T, _S> From<Alpha<Hsv<_S, T>, T>> for Alpha<Xyz<Wp, T>, T>where
T: Component + Float + Component + _FloatTrait,
Wp: WhitePoint,
_S: RgbSpace<WhitePoint = Wp>,
impl<Wp, T, _S> From<Alpha<Hsv<_S, T>, T>> for Alpha<Xyz<Wp, T>, T>where
T: Component + Float + Component + _FloatTrait,
Wp: WhitePoint,
_S: RgbSpace<WhitePoint = Wp>,
source§impl<T, C: Pixel<T>> Pixel<T> for Alpha<C, T>
impl<T, C: Pixel<T>> Pixel<T> for Alpha<C, 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
Cast as a mutable reference to raw color components.
source§fn into_raw<P: RawPixelSized<T>>(self) -> P
fn into_raw<P: RawPixelSized<T>>(self) -> P
Convert from raw color components.
source§fn from_raw<P: RawPixel<T> + ?Sized>(pixel: &P) -> &Self
fn from_raw<P: RawPixel<T> + ?Sized>(pixel: &P) -> &Self
Cast from a reference to raw color components.
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
Cast from a mutable reference to raw color components.
source§fn from_raw_slice(slice: &[T]) -> &[Self]
fn from_raw_slice(slice: &[T]) -> &[Self]
Cast a slice of raw color components to a slice of colors. Read more
source§fn from_raw_slice_mut(slice: &mut [T]) -> &mut [Self]
fn from_raw_slice_mut(slice: &mut [T]) -> &mut [Self]
Cast a mutable slice of raw color components to a mutable slice of colors. Read more
source§impl<Wp, T, _S> From<Rgb<_S, T>> for Alpha<Xyz<Wp, T>, 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 Alpha<Xyz<Wp, T>, T>where
T: Component + Float + Component + _FloatTrait,
Wp: WhitePoint,
_S: RgbStandard,
_S::Space: RgbSpace<WhitePoint = Wp>,
source§impl<C: Limited, T: Component> Limited for Alpha<C, T>
impl<C: Limited, T: Component> Limited for Alpha<C, T>
source§impl<Wp, T, _S> From<Hwb<_S, T>> for Alpha<Xyz<Wp, T>, T>where
T: Component + Float + Component + _FloatTrait,
Wp: WhitePoint,
_S: RgbSpace<WhitePoint = Wp>,
impl<Wp, T, _S> From<Hwb<_S, T>> for Alpha<Xyz<Wp, T>, T>where
T: Component + Float + Component + _FloatTrait,
Wp: WhitePoint,
_S: RgbSpace<WhitePoint = Wp>,
source§impl<C: SubAssign, T: Float + SubAssign> SubAssign for Alpha<C, T>
impl<C: SubAssign, T: Float + SubAssign> SubAssign for Alpha<C, T>
source§fn sub_assign(&mut self, other: Alpha<C, T>)
fn sub_assign(&mut self, other: Alpha<C, T>)
Performs the
-=
operation. Read moresource§impl<Wp, T, _S> From<Luma<_S, T>> for Alpha<Xyz<Wp, T>, T>where
T: Component + Float + Component + _FloatTrait,
Wp: WhitePoint,
_S: LumaStandard<WhitePoint = Wp>,
impl<Wp, T, _S> From<Luma<_S, T>> for Alpha<Xyz<Wp, T>, T>where
T: Component + Float + Component + _FloatTrait,
Wp: WhitePoint,
_S: LumaStandard<WhitePoint = Wp>,
source§impl<Wp, T, _S> From<Hsl<_S, T>> for Alpha<Xyz<Wp, T>, T>where
T: Component + Float + Component + _FloatTrait,
Wp: WhitePoint,
_S: RgbSpace<WhitePoint = Wp>,
impl<Wp, T, _S> From<Hsl<_S, T>> for Alpha<Xyz<Wp, T>, T>where
T: Component + Float + Component + _FloatTrait,
Wp: WhitePoint,
_S: RgbSpace<WhitePoint = Wp>,
source§impl<T: AddAssign + Copy, C: AddAssign<T>> AddAssign<T> for Alpha<C, T>
impl<T: AddAssign + Copy, C: AddAssign<T>> AddAssign<T> for Alpha<C, T>
source§fn add_assign(&mut self, c: T)
fn add_assign(&mut self, c: T)
Performs the
+=
operation. Read moresource§impl<C: DivAssign, T: Float + DivAssign> DivAssign for Alpha<C, T>
impl<C: DivAssign, T: Float + DivAssign> DivAssign for Alpha<C, T>
source§fn div_assign(&mut self, other: Alpha<C, T>)
fn div_assign(&mut self, other: Alpha<C, T>)
Performs the
/=
operation. Read moresource§impl<C: Blend, T: Float> Blend for Alpha<C, T>
impl<C: Blend, T: Float> Blend for Alpha<C, T>
source§fn into_premultiplied(self) -> PreAlpha<C::Color, T>
fn into_premultiplied(self) -> PreAlpha<C::Color, T>
Convert the color to premultiplied alpha.
source§fn from_premultiplied(color: PreAlpha<C::Color, T>) -> Alpha<C, T>
fn from_premultiplied(color: PreAlpha<C::Color, T>) -> Alpha<C, T>
Convert the color from premultiplied alpha.
source§fn blend<F>(self, destination: Self, blend_function: F) -> Selfwhere
F: BlendFunction<Self::Color>,
fn blend<F>(self, destination: Self, blend_function: F) -> Selfwhere
F: BlendFunction<Self::Color>,
Blend self, as the source color, with
destination
, using
blend_function
. Anything that implements BlendFunction
is
acceptable, including functions and closures. Read moresource§fn over(self, other: Self) -> Self
fn over(self, other: Self) -> Self
Place
self
over other
. This is the good old common alpha
composition equation.source§fn inside(self, other: Self) -> Self
fn inside(self, other: Self) -> Self
Results in the parts of
self
that overlaps the visible parts of
other
.source§fn outside(self, other: Self) -> Self
fn outside(self, other: Self) -> Self
Results in the parts of
self
that lies outside the visible parts of
other
.source§fn plus(self, other: Self) -> Self
fn plus(self, other: Self) -> Self
Add
self
and other
. This uses the alpha component to regulate the
effect, so it’s not just plain component wise addition.source§fn multiply(self, other: Self) -> Self
fn multiply(self, other: Self) -> Self
Multiply
self
with other
. This uses the alpha component to regulate
the effect, so it’s not just plain component wise multiplication.source§fn screen(self, other: Self) -> Self
fn screen(self, other: Self) -> Self
Make a color which is at least as light as
self
or other
.source§fn overlay(self, other: Self) -> Self
fn overlay(self, other: Self) -> Self
Multiply
self
or other
if other is dark, or screen them if other
is light. This results in an S curve.source§fn dodge(self, other: Self) -> Self
fn dodge(self, other: Self) -> Self
Lighten
other
to reflect self
. Results in other
if self
is
black.source§fn burn(self, other: Self) -> Self
fn burn(self, other: Self) -> Self
Darken
other
to reflect self
. Results in other
if self
is
white.source§fn hard_light(self, other: Self) -> Self
fn hard_light(self, other: Self) -> Self
Multiply
self
or other
if other is dark, or screen them if self
is light. This is similar to overlay
, but depends on self
instead
of other
.source§fn soft_light(self, other: Self) -> Self
fn soft_light(self, other: Self) -> Self
Lighten
other
if self
is light, or darken other
as if it’s burned
if self
is dark. The effect is increased if the components of self
is further from 0.5.source§fn difference(self, other: Self) -> Self
fn difference(self, other: Self) -> Self
Return the absolute difference between
self
and other
. It’s
basically abs(self - other)
, but regulated by the alpha component.source§impl<C: MulAssign, T: Float + MulAssign> MulAssign for Alpha<C, T>
impl<C: MulAssign, T: Float + MulAssign> MulAssign for Alpha<C, T>
source§fn mul_assign(&mut self, other: Alpha<C, T>)
fn mul_assign(&mut self, other: Alpha<C, T>)
Performs the
*=
operation. Read moresource§impl<C, T> RelativeEq for Alpha<C, T>
impl<C, T> RelativeEq for Alpha<C, T>
source§fn default_max_relative() -> Self::Epsilon
fn default_max_relative() -> Self::Epsilon
The default relative tolerance for testing values that are far-apart. Read more
source§impl<C: AddAssign, T: Float + AddAssign> AddAssign for Alpha<C, T>
impl<C: AddAssign, T: Float + AddAssign> AddAssign for Alpha<C, T>
source§fn add_assign(&mut self, other: Alpha<C, T>)
fn add_assign(&mut self, other: Alpha<C, T>)
Performs the
+=
operation. Read moresource§impl<Wp: WhitePoint, T: Component + Float, A: Component> Into<(T, T, T, A)> for Alpha<Xyz<Wp, T>, A>
impl<Wp: WhitePoint, T: Component + Float, A: Component> Into<(T, T, T, A)> for Alpha<Xyz<Wp, T>, A>
source§fn into(self) -> (T, T, T, A)
fn into(self) -> (T, T, T, A)
Converts this type into the (usually inferred) input type.
source§impl<C, T> UlpsEq for Alpha<C, T>
impl<C, T> UlpsEq for Alpha<C, T>
source§impl<Wp, T, _S> From<Alpha<Hwb<_S, T>, T>> for Alpha<Xyz<Wp, T>, T>where
T: Component + Float + Component + _FloatTrait,
Wp: WhitePoint,
_S: RgbSpace<WhitePoint = Wp>,
impl<Wp, T, _S> From<Alpha<Hwb<_S, T>, T>> for Alpha<Xyz<Wp, T>, T>where
T: Component + Float + Component + _FloatTrait,
Wp: WhitePoint,
_S: RgbSpace<WhitePoint = Wp>,
source§impl<C: PartialEq, T: PartialEq> PartialEq for Alpha<C, T>
impl<C: PartialEq, T: PartialEq> PartialEq for Alpha<C, T>
source§impl<T: SubAssign + Copy, C: SubAssign<T>> SubAssign<T> for Alpha<C, T>
impl<T: SubAssign + Copy, C: SubAssign<T>> SubAssign<T> for Alpha<C, T>
source§fn sub_assign(&mut self, c: T)
fn sub_assign(&mut self, c: T)
Performs the
-=
operation. Read moresource§impl<Wp: WhitePoint, T: Component + Float, A: Component> From<(T, T, T, A)> for Alpha<Xyz<Wp, T>, A>
impl<Wp: WhitePoint, T: Component + Float, A: Component> From<(T, T, T, A)> for Alpha<Xyz<Wp, T>, A>
source§fn from(components: (T, T, T, A)) -> Self
fn from(components: (T, T, T, A)) -> Self
Converts to this type from the input type.
impl<C: Copy, T: Copy> Copy for Alpha<C, T>
source§impl<'de, C, T> Deserialize<'de> for Alpha<C, T>where
C: Deserialize<'de>,
T: Deserialize<'de>,
impl<'de, C, T> Deserialize<'de> for Alpha<C, T>where
C: Deserialize<'de>,
T: Deserialize<'de>,
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>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<T: DivAssign + Copy, C: DivAssign<T>> DivAssign<T> for Alpha<C, T>
impl<T: DivAssign + Copy, C: DivAssign<T>> DivAssign<T> for Alpha<C, T>
source§fn div_assign(&mut self, c: T)
fn div_assign(&mut self, c: T)
Performs the
/=
operation. Read more