[−][src]Struct prisma::encoding::EncodedColor
A color decorated with its encoding. This is the primary way to use encodings.
As most encodings are zero-sized structs except for GammaEncoding
, there will be no size
penalty for using EncodedColor
.
Implementations
impl<C, E> EncodedColor<C, E> where
C: Color + EncodableColor,
E: ColorEncoding,
[src]
C: Color + EncodableColor,
E: ColorEncoding,
pub fn new(color: C, encoding: E) -> Self
[src]
Construct a new EncodedColor
from a color and an encoding.
impl<C, E> EncodedColor<C, E> where
C: Color,
E: ColorEncoding,
[src]
C: Color,
E: ColorEncoding,
pub fn decompose(self) -> (C, E)
[src]
Decompose a EncodedColor
into it's color and encoding objects
pub fn color(&self) -> &C
[src]
Returns a reference to the color object
pub fn color_mut(&mut self) -> &mut C
[src]
Returns a mutable reference to the color object
pub fn strip_encoding(self) -> C
[src]
Discard the encoding, returning the bare color object
pub fn encoding(&self) -> &E
[src]
Returns a reference to the encoding object
impl<C, E> EncodedColor<C, E> where
E: ColorEncoding,
C: TranscodableColor,
[src]
E: ColorEncoding,
C: TranscodableColor,
pub fn decode(self) -> EncodedColor<C, LinearEncoding>
[src]
Decode the color, making it linearly encoded
Note: This only is implemented for Rgb. All other encoded colors must convert to Rgb first.
pub fn transcode<Encoder>(
self,
new_encoding: Encoder
) -> EncodedColor<C, Encoder> where
Encoder: ColorEncoding,
[src]
self,
new_encoding: Encoder
) -> EncodedColor<C, Encoder> where
Encoder: ColorEncoding,
Change the encoding of the color
Note: This only is implemented for Rgb. All other encoded colors must convert to Rgb first.
impl<C> EncodedColor<C, LinearEncoding> where
C: TranscodableColor,
[src]
C: TranscodableColor,
pub fn encode<Encoder>(self, encoding: Encoder) -> EncodedColor<C, Encoder> where
Encoder: ColorEncoding,
[src]
Encoder: ColorEncoding,
Encode a linear RGB color with encoding
impl<C, E> EncodedColor<C, E> where
C: Color + Broadcast + EncodableColor,
E: ColorEncoding + PartialEq,
[src]
C: Color + Broadcast + EncodableColor,
E: ColorEncoding + PartialEq,
pub fn broadcast(value: C::ChannelFormat, encoding: E) -> Self
[src]
Construct a new EncodedColor
with all channels set to value
and with encoding
impl<C, E> EncodedColor<C, E> where
C: Color + FromTuple + EncodableColor,
E: ColorEncoding + PartialEq,
[src]
C: Color + FromTuple + EncodableColor,
E: ColorEncoding + PartialEq,
pub fn from_tuple(values: C::ChannelsTuple, encoding: E) -> Self
[src]
Construct a new EncodedColor
from a tuple of channels and an encoding
Trait Implementations
impl<C, E> AbsDiffEq<EncodedColor<C, E>> for EncodedColor<C, E> where
C: Color + EncodableColor + AbsDiffEq,
E: ColorEncoding + PartialEq,
[src]
C: Color + EncodableColor + AbsDiffEq,
E: ColorEncoding + PartialEq,
type Epsilon = C::Epsilon
Used for specifying relative comparisons.
fn default_epsilon() -> Self::Epsilon
[src]
fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool
[src]
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
[src]
impl<C, E> Bounded for EncodedColor<C, E> where
C: Color + Bounded + EncodableColor,
E: ColorEncoding + PartialEq,
[src]
C: Color + Bounded + EncodableColor,
E: ColorEncoding + PartialEq,
fn normalize(self) -> Self
[src]
fn is_normalized(&self) -> bool
[src]
impl<C: Clone, E: Clone> Clone for EncodedColor<C, E>
[src]
fn clone(&self) -> EncodedColor<C, E>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<C, E> Color for EncodedColor<C, E> where
C: Color + EncodableColor,
E: ColorEncoding + PartialEq,
[src]
C: Color + EncodableColor,
E: ColorEncoding + PartialEq,
type Tag = C::Tag
The unique tag unit struct identifying the color type
type ChannelsTuple = C::ChannelsTuple
A tuple of types for each channel in the color
fn num_channels() -> u32
[src]
fn to_tuple(self) -> Self::ChannelsTuple
[src]
impl<C, E> Color3 for EncodedColor<C, E> where
C: Color3 + EncodableColor,
E: ColorEncoding + PartialEq,
[src]
C: Color3 + EncodableColor,
E: ColorEncoding + PartialEq,
impl<C, E> Color4 for EncodedColor<C, E> where
C: Color4 + EncodableColor,
E: ColorEncoding + PartialEq,
[src]
C: Color4 + EncodableColor,
E: ColorEncoding + PartialEq,
impl<C: Copy, E: Copy> Copy for EncodedColor<C, E>
[src]
impl<C: Debug, E: Debug> Debug for EncodedColor<C, E>
[src]
impl<C, E> Deref for EncodedColor<C, E> where
C: EncodableColor,
E: ColorEncoding,
[src]
C: EncodableColor,
E: ColorEncoding,
impl<C, E> DerefMut for EncodedColor<C, E> where
C: EncodableColor,
E: ColorEncoding,
[src]
C: EncodableColor,
E: ColorEncoding,
impl<C, E> Display for EncodedColor<C, E> where
C: Color + EncodableColor + Display,
E: ColorEncoding + Display,
[src]
C: Color + EncodableColor + Display,
E: ColorEncoding + Display,
impl<C, E> EncodableColor for EncodedColor<C, E> where
C: EncodableColor,
E: ColorEncoding + PartialEq,
[src]
C: EncodableColor,
E: ColorEncoding + PartialEq,
fn encoded_as<E>(self, encoding: E) -> EncodedColor<Self, E> where
E: ColorEncoding,
[src]
E: ColorEncoding,
fn linear(self) -> EncodedColor<Self, LinearEncoding>
[src]
fn srgb_encoded(self) -> EncodedColor<Self, SrgbEncoding>
[src]
fn gamma_encoded<T: Float>(
self,
gamma: T
) -> EncodedColor<Self, GammaEncoding<T>>
[src]
self,
gamma: T
) -> EncodedColor<Self, GammaEncoding<T>>
impl<C: Eq, E: Eq> Eq for EncodedColor<C, E>
[src]
impl<C, E, C2> FromColor<EncodedColor<C2, E>> for EncodedColor<C, E> where
C: Color + FromColor<C2> + EncodableColor,
E: ColorEncoding,
C2: EncodableColor,
[src]
C: Color + FromColor<C2> + EncodableColor,
E: ColorEncoding,
C2: EncodableColor,
fn from_color(from: &EncodedColor<C2, E>) -> Self
[src]
impl<C, E, T, A> FromHsi<EncodedColor<Hsi<T, A>, E>> for EncodedColor<C, E> where
C: Color + EncodableColor + FromHsi<Hsi<T, A>>,
E: ColorEncoding,
T: PosNormalChannelScalar + Float,
A: AngularChannelScalar + Angle<Scalar = T>,
[src]
C: Color + EncodableColor + FromHsi<Hsi<T, A>>,
E: ColorEncoding,
T: PosNormalChannelScalar + Float,
A: AngularChannelScalar + Angle<Scalar = T>,
fn from_hsi(
from: &EncodedColor<Hsi<T, A>, E>,
out_of_gamut_mode: HsiOutOfGamutMode
) -> Self
[src]
from: &EncodedColor<Hsi<T, A>, E>,
out_of_gamut_mode: HsiOutOfGamutMode
) -> Self
impl<C, E, T, M> FromYCbCr<EncodedColor<YCbCr<T, M>, E>> for EncodedColor<C, E> where
C: Color + EncodableColor + FromYCbCr<YCbCr<T, M>>,
E: ColorEncoding,
T: PosNormalChannelScalar + Float,
M: YCbCrModel<T>,
[src]
C: Color + EncodableColor + FromYCbCr<YCbCr<T, M>>,
E: ColorEncoding,
T: PosNormalChannelScalar + Float,
M: YCbCrModel<T>,
fn from_ycbcr(
from: &EncodedColor<YCbCr<T, M>, E>,
out_of_gamut_mode: YCbCrOutOfGamutMode
) -> Self
[src]
from: &EncodedColor<YCbCr<T, M>, E>,
out_of_gamut_mode: YCbCrOutOfGamutMode
) -> Self
impl<C, E> Invert for EncodedColor<C, E> where
C: Color + Invert + EncodableColor,
E: ColorEncoding + PartialEq,
[src]
C: Color + Invert + EncodableColor,
E: ColorEncoding + PartialEq,
impl<C, E> Lerp for EncodedColor<C, E> where
C: Color + Lerp + EncodableColor,
E: ColorEncoding + PartialEq,
[src]
C: Color + Lerp + EncodableColor,
E: ColorEncoding + PartialEq,
type Position = C::Position
The type of the pos
argument
fn lerp(&self, right: &Self, pos: Self::Position) -> Self
[src]
impl<C: PartialEq, E: PartialEq> PartialEq<EncodedColor<C, E>> for EncodedColor<C, E>
[src]
fn eq(&self, other: &EncodedColor<C, E>) -> bool
[src]
fn ne(&self, other: &EncodedColor<C, E>) -> bool
[src]
impl<C, E> PolarColor for EncodedColor<C, E> where
C: Color + EncodableColor + PolarColor,
E: ColorEncoding + PartialEq,
[src]
C: Color + EncodableColor + PolarColor,
E: ColorEncoding + PartialEq,
type Angular = C::Angular
The angular channel's scalar type
type Cartesian = C::Cartesian
The remaining channels' scalar types
impl<C, E> RelativeEq<EncodedColor<C, E>> for EncodedColor<C, E> where
C: Color + EncodableColor + RelativeEq,
E: ColorEncoding + PartialEq,
[src]
C: Color + EncodableColor + RelativeEq,
E: ColorEncoding + PartialEq,
fn default_max_relative() -> Self::Epsilon
[src]
fn relative_eq(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
[src]
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
fn relative_ne(
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
[src]
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
impl<C, E> StructuralEq for EncodedColor<C, E>
[src]
impl<C, E> StructuralPartialEq for EncodedColor<C, E>
[src]
impl<C, E> UlpsEq<EncodedColor<C, E>> for EncodedColor<C, E> where
C: Color + EncodableColor + UlpsEq,
E: ColorEncoding + PartialEq,
[src]
C: Color + EncodableColor + UlpsEq,
E: ColorEncoding + PartialEq,
fn default_max_ulps() -> u32
[src]
fn ulps_eq(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool
[src]
fn ulps_ne(&self, other: &Rhs, epsilon: Self::Epsilon, max_ulps: u32) -> bool
[src]
impl<T, C, E, S> WithColorSpace<T, C, E, S> for EncodedColor<C, E> where
C: EncodableColor,
S: ColorSpace<T>,
E: ColorEncoding,
T: Float,
[src]
C: EncodableColor,
S: ColorSpace<T>,
E: ColorEncoding,
T: Float,
fn with_color_space(self, space: S) -> SpacedColor<T, C, E, S>
[src]
Auto Trait Implementations
impl<C, E> RefUnwindSafe for EncodedColor<C, E> where
C: RefUnwindSafe,
E: RefUnwindSafe,
C: RefUnwindSafe,
E: RefUnwindSafe,
impl<C, E> Send for EncodedColor<C, E> where
C: Send,
E: Send,
C: Send,
E: Send,
impl<C, E> Sync for EncodedColor<C, E> where
C: Sync,
E: Sync,
C: Sync,
E: Sync,
impl<C, E> Unpin for EncodedColor<C, E> where
C: Unpin,
E: Unpin,
C: Unpin,
E: Unpin,
impl<C, E> UnwindSafe for EncodedColor<C, E> where
C: UnwindSafe,
E: UnwindSafe,
C: UnwindSafe,
E: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,