#[repr(C)]pub struct PreAlpha<C>where
C: Premultiply,{
pub color: C,
pub alpha: <C as Premultiply>::Scalar,
}
Expand description
Premultiplied alpha wrapper.
Premultiplied, or alpha masked, or associated alpha colors have had their component values multiplied with their alpha value. They are commonly used in composition algorithms and as output from computer generated graphics. It may also be preferred when interpolating between colors and in other image manipulation operations, such as blurring or resizing images.
use palette::{LinSrgb, LinSrgba};
use palette::blend::{Blend, PreAlpha};
let a = PreAlpha::from(LinSrgba::new(0.4, 0.5, 0.5, 0.3));
let b = PreAlpha::from(LinSrgba::new(0.3, 0.8, 0.4, 0.4));
let c = PreAlpha::from(LinSrgba::new(0.7, 0.1, 0.8, 0.8));
let res: LinSrgba = a.screen(b).overlay(c).into();
Note that converting to and from premultiplied alpha will cause the alpha component to be clamped to [0.0, 1.0], and fully transparent colors will become black.
Fields§
§color: C
The premultiplied color components (original.color * original.alpha
).
alpha: <C as Premultiply>::Scalar
The transparency component. 0.0 is fully transparent and 1.0 is fully opaque.
Implementations§
source§impl<C> PreAlpha<C>where
C: Premultiply,
impl<C> PreAlpha<C>where
C: Premultiply,
sourcepub fn new(color: C, alpha: <C as Premultiply>::Scalar) -> PreAlpha<C>
pub fn new(color: C, alpha: <C as Premultiply>::Scalar) -> PreAlpha<C>
Alpha mask color
with alpha
.
sourcepub fn new_opaque(color: C) -> PreAlpha<C>
pub fn new_opaque(color: C) -> PreAlpha<C>
Create an opaque alpha masked color.
sourcepub fn unpremultiply(self) -> Alpha<C, <C as Premultiply>::Scalar>
pub fn unpremultiply(self) -> Alpha<C, <C as Premultiply>::Scalar>
Alpha unmask the color.
Trait Implementations§
source§impl<C, T> AbsDiffEq for PreAlpha<C>
impl<C, T> AbsDiffEq for PreAlpha<C>
source§fn default_epsilon() -> <PreAlpha<C> as AbsDiffEq>::Epsilon
fn default_epsilon() -> <PreAlpha<C> as AbsDiffEq>::Epsilon
source§fn abs_diff_eq(
&self,
other: &PreAlpha<C>,
epsilon: <PreAlpha<C> as AbsDiffEq>::Epsilon,
) -> bool
fn abs_diff_eq( &self, other: &PreAlpha<C>, epsilon: <PreAlpha<C> as AbsDiffEq>::Epsilon, ) -> bool
source§fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
AbsDiffEq::abs_diff_eq
.source§impl<C> Add for PreAlpha<C>where
C: Premultiply + Add<Output = C>,
<C as Premultiply>::Scalar: Add<Output = <C as Premultiply>::Scalar>,
impl<C> Add for PreAlpha<C>where
C: Premultiply + Add<Output = C>,
<C as Premultiply>::Scalar: Add<Output = <C as Premultiply>::Scalar>,
source§impl<C> AddAssign<f32> for PreAlpha<C>
impl<C> AddAssign<f32> for PreAlpha<C>
source§fn add_assign(&mut self, c: f32)
fn add_assign(&mut self, c: f32)
+=
operation. Read moresource§impl<C> AddAssign<f64> for PreAlpha<C>
impl<C> AddAssign<f64> for PreAlpha<C>
source§fn add_assign(&mut self, c: f64)
fn add_assign(&mut self, c: f64)
+=
operation. Read moresource§impl<C> AddAssign for PreAlpha<C>
impl<C> AddAssign for PreAlpha<C>
source§fn add_assign(&mut self, other: PreAlpha<C>)
fn add_assign(&mut self, other: PreAlpha<C>)
+=
operation. Read moresource§impl<C, const N: usize> AsMut<[<C as Premultiply>::Scalar]> for PreAlpha<C>
impl<C, const N: usize> AsMut<[<C as Premultiply>::Scalar]> for PreAlpha<C>
source§fn as_mut(&mut self) -> &mut [<C as Premultiply>::Scalar]
fn as_mut(&mut self) -> &mut [<C as Premultiply>::Scalar]
source§impl<C, const N: usize> AsRef<[<C as Premultiply>::Scalar]> for PreAlpha<C>
impl<C, const N: usize> AsRef<[<C as Premultiply>::Scalar]> for PreAlpha<C>
source§fn as_ref(&self) -> &[<C as Premultiply>::Scalar]
fn as_ref(&self) -> &[<C as Premultiply>::Scalar]
source§impl<C, T, const N: usize> Blend for PreAlpha<C>where
C: Premultiply<Scalar = T> + StimulusColor + ArrayCast<Array = [T; N]> + Clone,
T: Real + Zero + One + MinMax + Clamp + Sqrt + Abs + Arithmetics + PartialCmp + Clone,
<T as HasBoolMask>::Mask: LazySelect<T>,
impl<C, T, const N: usize> Blend for PreAlpha<C>where
C: Premultiply<Scalar = T> + StimulusColor + ArrayCast<Array = [T; N]> + Clone,
T: Real + Zero + One + MinMax + Clamp + Sqrt + Abs + Arithmetics + PartialCmp + Clone,
<T as HasBoolMask>::Mask: LazySelect<T>,
source§fn multiply(self, other: PreAlpha<C>) -> PreAlpha<C>
fn multiply(self, other: PreAlpha<C>) -> PreAlpha<C>
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: PreAlpha<C>) -> PreAlpha<C>
fn screen(self, other: PreAlpha<C>) -> PreAlpha<C>
self
or other
.source§fn overlay(self, other: PreAlpha<C>) -> PreAlpha<C>
fn overlay(self, other: PreAlpha<C>) -> PreAlpha<C>
self
or other
if other is dark, or screen them if other
is light. This results in an S curve.source§fn darken(self, other: PreAlpha<C>) -> PreAlpha<C>
fn darken(self, other: PreAlpha<C>) -> PreAlpha<C>
self
and other
.source§fn lighten(self, other: PreAlpha<C>) -> PreAlpha<C>
fn lighten(self, other: PreAlpha<C>) -> PreAlpha<C>
self
and other
.source§fn dodge(self, other: PreAlpha<C>) -> PreAlpha<C>
fn dodge(self, other: PreAlpha<C>) -> PreAlpha<C>
other
to reflect self
. Results in other
if self
is
black.source§fn burn(self, other: PreAlpha<C>) -> PreAlpha<C>
fn burn(self, other: PreAlpha<C>) -> PreAlpha<C>
other
to reflect self
. Results in other
if self
is
white.source§fn hard_light(self, other: PreAlpha<C>) -> PreAlpha<C>
fn hard_light(self, other: PreAlpha<C>) -> PreAlpha<C>
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: PreAlpha<C>) -> PreAlpha<C>
fn soft_light(self, other: PreAlpha<C>) -> PreAlpha<C>
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: PreAlpha<C>) -> PreAlpha<C>
fn difference(self, other: PreAlpha<C>) -> PreAlpha<C>
self
and other
. It’s
basically abs(self - other)
, but regulated by the alpha component.source§impl<C> BlendWith for PreAlpha<C>where
C: Premultiply,
impl<C> BlendWith for PreAlpha<C>where
C: Premultiply,
source§fn blend_with<F>(self, other: PreAlpha<C>, blend_function: F) -> PreAlpha<C>
fn blend_with<F>(self, other: PreAlpha<C>, blend_function: F) -> PreAlpha<C>
destination
, using
blend_function
. Anything that implements BlendFunction
is
acceptable, including functions and closures. Read moresource§impl<C, T, const N: usize> Compose for PreAlpha<C>where
C: ArrayCast<Array = [T; N]> + Premultiply<Scalar = T>,
T: Real + Zero + One + Arithmetics + Clamp + Clone,
impl<C, T, const N: usize> Compose for PreAlpha<C>where
C: ArrayCast<Array = [T; N]> + Premultiply<Scalar = T>,
T: Real + Zero + One + Arithmetics + Clamp + Clone,
source§fn over(self, other: PreAlpha<C>) -> PreAlpha<C>
fn over(self, other: PreAlpha<C>) -> PreAlpha<C>
self
over other
. This is the good old common alpha composition
equation.source§fn inside(self, other: PreAlpha<C>) -> PreAlpha<C>
fn inside(self, other: PreAlpha<C>) -> PreAlpha<C>
self
that overlaps the visible parts of
other
.source§fn outside(self, other: PreAlpha<C>) -> PreAlpha<C>
fn outside(self, other: PreAlpha<C>) -> PreAlpha<C>
self
that lies outside the visible parts of
other
.source§fn atop(self, other: PreAlpha<C>) -> PreAlpha<C>
fn atop(self, other: PreAlpha<C>) -> PreAlpha<C>
self
over only the visible parts of other
.source§impl<C> DerefMut for PreAlpha<C>where
C: Premultiply,
impl<C> DerefMut for PreAlpha<C>where
C: Premultiply,
source§impl<'de, C> Deserialize<'de> for PreAlpha<C>
impl<'de, C> Deserialize<'de> for PreAlpha<C>
source§fn deserialize<D>(
deserializer: D,
) -> Result<PreAlpha<C>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<PreAlpha<C>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
source§impl<C> Div for PreAlpha<C>where
C: Premultiply + Div<Output = C>,
<C as Premultiply>::Scalar: Div<Output = <C as Premultiply>::Scalar>,
impl<C> Div for PreAlpha<C>where
C: Premultiply + Div<Output = C>,
<C as Premultiply>::Scalar: Div<Output = <C as Premultiply>::Scalar>,
source§impl<C> DivAssign<f32> for PreAlpha<C>
impl<C> DivAssign<f32> for PreAlpha<C>
source§fn div_assign(&mut self, c: f32)
fn div_assign(&mut self, c: f32)
/=
operation. Read moresource§impl<C> DivAssign<f64> for PreAlpha<C>
impl<C> DivAssign<f64> for PreAlpha<C>
source§fn div_assign(&mut self, c: f64)
fn div_assign(&mut self, c: f64)
/=
operation. Read moresource§impl<C> DivAssign for PreAlpha<C>
impl<C> DivAssign for PreAlpha<C>
source§fn div_assign(&mut self, other: PreAlpha<C>)
fn div_assign(&mut self, other: PreAlpha<C>)
/=
operation. Read moresource§impl<'a, C, const N: usize> From<&'a mut [<C as Premultiply>::Scalar; N]> for &'a mut PreAlpha<C>
impl<'a, C, const N: usize> From<&'a mut [<C as Premultiply>::Scalar; N]> for &'a mut PreAlpha<C>
source§impl<'a, C, const N: usize> From<&'a mut PreAlpha<C>> for &'a mut [<C as Premultiply>::Scalar]
impl<'a, C, const N: usize> From<&'a mut PreAlpha<C>> for &'a mut [<C as Premultiply>::Scalar]
source§impl<T, V, const N: usize> From<[PreAlpha<Cam16UcsJab<T>>; N]> for PreAlpha<Cam16UcsJab<V>>where
[T; N]: Default,
V: FromScalarArray<N, Scalar = T>,
Cam16UcsJab<T>: Premultiply<Scalar = T>,
Cam16UcsJab<V>: Premultiply<Scalar = V>,
impl<T, V, const N: usize> From<[PreAlpha<Cam16UcsJab<T>>; N]> for PreAlpha<Cam16UcsJab<V>>where
[T; N]: Default,
V: FromScalarArray<N, Scalar = T>,
Cam16UcsJab<T>: Premultiply<Scalar = T>,
Cam16UcsJab<V>: Premultiply<Scalar = V>,
source§fn from(colors: [PreAlpha<Cam16UcsJab<T>>; N]) -> PreAlpha<Cam16UcsJab<V>>
fn from(colors: [PreAlpha<Cam16UcsJab<T>>; N]) -> PreAlpha<Cam16UcsJab<V>>
source§impl<Wp, T, V, const N: usize> From<[PreAlpha<Lab<Wp, T>>; N]> for PreAlpha<Lab<Wp, V>>where
[T; N]: Default,
V: FromScalarArray<N, Scalar = T>,
Lab<Wp, T>: Premultiply<Scalar = T>,
Lab<Wp, V>: Premultiply<Scalar = V>,
impl<Wp, T, V, const N: usize> From<[PreAlpha<Lab<Wp, T>>; N]> for PreAlpha<Lab<Wp, V>>where
[T; N]: Default,
V: FromScalarArray<N, Scalar = T>,
Lab<Wp, T>: Premultiply<Scalar = T>,
Lab<Wp, V>: Premultiply<Scalar = V>,
source§impl<S, T, V, const N: usize> From<[PreAlpha<Luma<S, T>>; N]> for PreAlpha<Luma<S, V>>where
[T; N]: Default,
V: FromScalarArray<N, Scalar = T>,
Luma<S, T>: Premultiply<Scalar = T>,
Luma<S, V>: Premultiply<Scalar = V>,
impl<S, T, V, const N: usize> From<[PreAlpha<Luma<S, T>>; N]> for PreAlpha<Luma<S, V>>where
[T; N]: Default,
V: FromScalarArray<N, Scalar = T>,
Luma<S, T>: Premultiply<Scalar = T>,
Luma<S, V>: Premultiply<Scalar = V>,
source§impl<Wp, T, V, const N: usize> From<[PreAlpha<Luv<Wp, T>>; N]> for PreAlpha<Luv<Wp, V>>where
[T; N]: Default,
V: FromScalarArray<N, Scalar = T>,
Luv<Wp, T>: Premultiply<Scalar = T>,
Luv<Wp, V>: Premultiply<Scalar = V>,
impl<Wp, T, V, const N: usize> From<[PreAlpha<Luv<Wp, T>>; N]> for PreAlpha<Luv<Wp, V>>where
[T; N]: Default,
V: FromScalarArray<N, Scalar = T>,
Luv<Wp, T>: Premultiply<Scalar = T>,
Luv<Wp, V>: Premultiply<Scalar = V>,
source§impl<T, V, const N: usize> From<[PreAlpha<Oklab<T>>; N]> for PreAlpha<Oklab<V>>where
[T; N]: Default,
V: FromScalarArray<N, Scalar = T>,
Oklab<T>: Premultiply<Scalar = T>,
Oklab<V>: Premultiply<Scalar = V>,
impl<T, V, const N: usize> From<[PreAlpha<Oklab<T>>; N]> for PreAlpha<Oklab<V>>where
[T; N]: Default,
V: FromScalarArray<N, Scalar = T>,
Oklab<T>: Premultiply<Scalar = T>,
Oklab<V>: Premultiply<Scalar = V>,
source§impl<S, T, V, const N: usize> From<[PreAlpha<Rgb<S, T>>; N]> for PreAlpha<Rgb<S, V>>where
[T; N]: Default,
V: FromScalarArray<N, Scalar = T>,
Rgb<S, T>: Premultiply<Scalar = T>,
Rgb<S, V>: Premultiply<Scalar = V>,
impl<S, T, V, const N: usize> From<[PreAlpha<Rgb<S, T>>; N]> for PreAlpha<Rgb<S, V>>where
[T; N]: Default,
V: FromScalarArray<N, Scalar = T>,
Rgb<S, T>: Premultiply<Scalar = T>,
Rgb<S, V>: Premultiply<Scalar = V>,
source§impl<Wp, T, V, const N: usize> From<[PreAlpha<Xyz<Wp, T>>; N]> for PreAlpha<Xyz<Wp, V>>where
[T; N]: Default,
V: FromScalarArray<N, Scalar = T>,
Xyz<Wp, T>: Premultiply<Scalar = T>,
Xyz<Wp, V>: Premultiply<Scalar = V>,
impl<Wp, T, V, const N: usize> From<[PreAlpha<Xyz<Wp, T>>; N]> for PreAlpha<Xyz<Wp, V>>where
[T; N]: Default,
V: FromScalarArray<N, Scalar = T>,
Xyz<Wp, T>: Premultiply<Scalar = T>,
Xyz<Wp, V>: Premultiply<Scalar = V>,
source§impl<Wp, T, V, const N: usize> From<[PreAlpha<Yxy<Wp, T>>; N]> for PreAlpha<Yxy<Wp, V>>where
[T; N]: Default,
V: FromScalarArray<N, Scalar = T>,
Yxy<Wp, T>: Premultiply<Scalar = T>,
Yxy<Wp, V>: Premultiply<Scalar = V>,
impl<Wp, T, V, const N: usize> From<[PreAlpha<Yxy<Wp, T>>; N]> for PreAlpha<Yxy<Wp, V>>where
[T; N]: Default,
V: FromScalarArray<N, Scalar = T>,
Yxy<Wp, T>: Premultiply<Scalar = T>,
Yxy<Wp, V>: Premultiply<Scalar = V>,
source§impl<C> From<Alpha<C, <C as Premultiply>::Scalar>> for PreAlpha<C>where
C: Premultiply,
impl<C> From<Alpha<C, <C as Premultiply>::Scalar>> for PreAlpha<C>where
C: Premultiply,
source§impl<C> From<PreAlpha<C>> for Alpha<C, <C as Premultiply>::Scalar>where
C: Premultiply,
impl<C> From<PreAlpha<C>> for Alpha<C, <C as Premultiply>::Scalar>where
C: Premultiply,
source§impl<T> From<PreAlpha<Cam16UcsJab<T>>> for Cam16UcsJab<T>where
Cam16UcsJab<T>: Premultiply<Scalar = T>,
impl<T> From<PreAlpha<Cam16UcsJab<T>>> for Cam16UcsJab<T>where
Cam16UcsJab<T>: Premultiply<Scalar = T>,
source§fn from(premultiplied: PreAlpha<Cam16UcsJab<T>>) -> Cam16UcsJab<T>
fn from(premultiplied: PreAlpha<Cam16UcsJab<T>>) -> Cam16UcsJab<T>
source§impl<Wp, T> From<PreAlpha<Lab<Wp, T>>> for Lab<Wp, T>where
Lab<Wp, T>: Premultiply<Scalar = T>,
impl<Wp, T> From<PreAlpha<Lab<Wp, T>>> for Lab<Wp, T>where
Lab<Wp, T>: Premultiply<Scalar = T>,
source§impl<S, T> From<PreAlpha<Luma<S, T>>> for Luma<S, T>where
Luma<S, T>: Premultiply<Scalar = T>,
impl<S, T> From<PreAlpha<Luma<S, T>>> for Luma<S, T>where
Luma<S, T>: Premultiply<Scalar = T>,
source§impl<Wp, T> From<PreAlpha<Luv<Wp, T>>> for Luv<Wp, T>where
Luv<Wp, T>: Premultiply<Scalar = T>,
impl<Wp, T> From<PreAlpha<Luv<Wp, T>>> for Luv<Wp, T>where
Luv<Wp, T>: Premultiply<Scalar = T>,
source§impl<Wp, T> From<PreAlpha<Xyz<Wp, T>>> for Xyz<Wp, T>where
Xyz<Wp, T>: Premultiply<Scalar = T>,
impl<Wp, T> From<PreAlpha<Xyz<Wp, T>>> for Xyz<Wp, T>where
Xyz<Wp, T>: Premultiply<Scalar = T>,
source§impl<Wp, T> From<PreAlpha<Yxy<Wp, T>>> for Yxy<Wp, T>where
Yxy<Wp, T>: Premultiply<Scalar = T>,
impl<Wp, T> From<PreAlpha<Yxy<Wp, T>>> for Yxy<Wp, T>where
Yxy<Wp, T>: Premultiply<Scalar = T>,
source§impl<C, T> Mix for PreAlpha<C>where
C: Mix<Scalar = T> + Premultiply<Scalar = T>,
T: Real + Zero + One + Clamp + Arithmetics + Clone,
impl<C, T> Mix for PreAlpha<C>where
C: Mix<Scalar = T> + Premultiply<Scalar = T>,
T: Real + Zero + One + Clamp + Arithmetics + Clone,
source§impl<C, T> MixAssign for PreAlpha<C>where
C: MixAssign<Scalar = T> + Premultiply<Scalar = T>,
T: Real + Zero + One + Clamp + Arithmetics + AddAssign + Clone,
impl<C, T> MixAssign for PreAlpha<C>where
C: MixAssign<Scalar = T> + Premultiply<Scalar = T>,
T: Real + Zero + One + Clamp + Arithmetics + AddAssign + Clone,
source§impl<C> Mul for PreAlpha<C>where
C: Premultiply + Mul<Output = C>,
<C as Premultiply>::Scalar: Mul<Output = <C as Premultiply>::Scalar>,
impl<C> Mul for PreAlpha<C>where
C: Premultiply + Mul<Output = C>,
<C as Premultiply>::Scalar: Mul<Output = <C as Premultiply>::Scalar>,
source§impl<C> MulAssign<f32> for PreAlpha<C>
impl<C> MulAssign<f32> for PreAlpha<C>
source§fn mul_assign(&mut self, c: f32)
fn mul_assign(&mut self, c: f32)
*=
operation. Read moresource§impl<C> MulAssign<f64> for PreAlpha<C>
impl<C> MulAssign<f64> for PreAlpha<C>
source§fn mul_assign(&mut self, c: f64)
fn mul_assign(&mut self, c: f64)
*=
operation. Read moresource§impl<C> MulAssign for PreAlpha<C>
impl<C> MulAssign for PreAlpha<C>
source§fn mul_assign(&mut self, other: PreAlpha<C>)
fn mul_assign(&mut self, other: PreAlpha<C>)
*=
operation. Read moresource§impl<C, T> RelativeEq for PreAlpha<C>where
C: RelativeEq<Epsilon = <T as AbsDiffEq>::Epsilon> + Premultiply<Scalar = T>,
T: RelativeEq,
<T as AbsDiffEq>::Epsilon: Clone,
impl<C, T> RelativeEq for PreAlpha<C>where
C: RelativeEq<Epsilon = <T as AbsDiffEq>::Epsilon> + Premultiply<Scalar = T>,
T: RelativeEq,
<T as AbsDiffEq>::Epsilon: Clone,
source§fn default_max_relative() -> <PreAlpha<C> as AbsDiffEq>::Epsilon
fn default_max_relative() -> <PreAlpha<C> as AbsDiffEq>::Epsilon
source§fn relative_eq(
&self,
other: &PreAlpha<C>,
epsilon: <PreAlpha<C> as AbsDiffEq>::Epsilon,
max_relative: <PreAlpha<C> as AbsDiffEq>::Epsilon,
) -> bool
fn relative_eq( &self, other: &PreAlpha<C>, epsilon: <PreAlpha<C> as AbsDiffEq>::Epsilon, max_relative: <PreAlpha<C> as AbsDiffEq>::Epsilon, ) -> bool
source§fn relative_ne(
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon,
) -> bool
fn relative_ne( &self, other: &Rhs, epsilon: Self::Epsilon, max_relative: Self::Epsilon, ) -> bool
RelativeEq::relative_eq
.source§impl<C> Serialize for PreAlpha<C>
impl<C> Serialize for PreAlpha<C>
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<C> Sub for PreAlpha<C>where
C: Premultiply + Sub<Output = C>,
<C as Premultiply>::Scalar: Sub<Output = <C as Premultiply>::Scalar>,
impl<C> Sub for PreAlpha<C>where
C: Premultiply + Sub<Output = C>,
<C as Premultiply>::Scalar: Sub<Output = <C as Premultiply>::Scalar>,
source§impl<C> SubAssign<f32> for PreAlpha<C>
impl<C> SubAssign<f32> for PreAlpha<C>
source§fn sub_assign(&mut self, c: f32)
fn sub_assign(&mut self, c: f32)
-=
operation. Read moresource§impl<C> SubAssign<f64> for PreAlpha<C>
impl<C> SubAssign<f64> for PreAlpha<C>
source§fn sub_assign(&mut self, c: f64)
fn sub_assign(&mut self, c: f64)
-=
operation. Read moresource§impl<C> SubAssign for PreAlpha<C>
impl<C> SubAssign for PreAlpha<C>
source§fn sub_assign(&mut self, other: PreAlpha<C>)
fn sub_assign(&mut self, other: PreAlpha<C>)
-=
operation. Read moresource§impl<'a, C, const N: usize> TryFrom<&'a [<C as Premultiply>::Scalar]> for &'a PreAlpha<C>
impl<'a, C, const N: usize> TryFrom<&'a [<C as Premultiply>::Scalar]> for &'a PreAlpha<C>
source§type Error = <&'a [<C as Premultiply>::Scalar; N] as TryFrom<&'a [<C as Premultiply>::Scalar]>>::Error
type Error = <&'a [<C as Premultiply>::Scalar; N] as TryFrom<&'a [<C as Premultiply>::Scalar]>>::Error
source§impl<'a, C, const N: usize> TryFrom<&'a mut [<C as Premultiply>::Scalar]> for &'a mut PreAlpha<C>
impl<'a, C, const N: usize> TryFrom<&'a mut [<C as Premultiply>::Scalar]> for &'a mut PreAlpha<C>
source§type Error = <&'a mut [<C as Premultiply>::Scalar; N] as TryFrom<&'a mut [<C as Premultiply>::Scalar]>>::Error
type Error = <&'a mut [<C as Premultiply>::Scalar; N] as TryFrom<&'a mut [<C as Premultiply>::Scalar]>>::Error
source§impl<C, T> UlpsEq for PreAlpha<C>
impl<C, T> UlpsEq for PreAlpha<C>
source§fn default_max_ulps() -> u32
fn default_max_ulps() -> u32
source§impl<C> Deref for PreAlpha<C>where
C: Premultiply,
impl<C> Deref for PreAlpha<C>where
C: Premultiply,
impl<C> Copy for PreAlpha<C>
impl<C> Eq for PreAlpha<C>
Auto Trait Implementations§
impl<C> Freeze for PreAlpha<C>
impl<C> RefUnwindSafe for PreAlpha<C>
impl<C> Send for PreAlpha<C>
impl<C> Sync for PreAlpha<C>
impl<C> Unpin for PreAlpha<C>
impl<C> UnwindSafe for PreAlpha<C>
Blanket Implementations§
source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
source§impl<T, Res> Apply<Res> for Twhere
T: ?Sized,
impl<T, Res> Apply<Res> for Twhere
T: ?Sized,
source§impl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
impl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
source§fn arrays_from(colors: C) -> T
fn arrays_from(colors: C) -> T
source§impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
source§fn arrays_into(self) -> C
fn arrays_into(self) -> C
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<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
impl<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
source§type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
parameters
when converting.source§fn cam16_into_unclamped(
self,
parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>,
) -> T
fn cam16_into_unclamped( self, parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>, ) -> T
self
into C
, using the provided parameters.source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
impl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
source§fn components_from(colors: C) -> T
fn components_from(colors: C) -> T
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<T> FromAngle<T> for T
impl<T> FromAngle<T> for T
source§fn from_angle(angle: T) -> T
fn from_angle(angle: T) -> T
angle
.source§impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
source§fn from_stimulus(other: U) -> T
fn from_stimulus(other: U) -> T
other
into Self
, while performing the appropriate scaling,
rounding and clamping.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
source§impl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
impl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
source§fn into_angle(self) -> U
fn into_angle(self) -> U
T
.source§impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
source§type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
parameters
when converting.source§fn into_cam16_unclamped(
self,
parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>,
) -> T
fn into_cam16_unclamped( self, parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>, ) -> T
self
into C
, using the provided parameters.source§impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
source§fn into_color(self) -> U
fn into_color(self) -> U
source§impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
source§fn into_color_unclamped(self) -> U
fn into_color_unclamped(self) -> U
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§impl<T> IntoStimulus<T> for T
impl<T> IntoStimulus<T> for T
source§fn into_stimulus(self) -> T
fn into_stimulus(self) -> T
self
into T
, while performing the appropriate scaling,
rounding and clamping.source§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian()
.source§impl<T> ToHex for T
impl<T> ToHex for T
source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
self
into the result. Lower case
letters are used (e.g. f9b4ca
)source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
self
into the result. Upper case
letters are used (e.g. F9B4CA
)source§impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
source§type Error = <C as TryFromComponents<T>>::Error
type Error = <C as TryFromComponents<T>>::Error
try_into_colors
fails to cast.source§fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
source§impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
source§fn try_into_color(self) -> Result<U, OutOfBounds<U>>
fn try_into_color(self) -> Result<U, OutOfBounds<U>>
OutOfBounds
error is returned which contains
the unclamped color. Read more