#[repr(C)]pub struct EncodedSrgb<ComponentTy = u8> {
pub r: ComponentTy,
pub g: ComponentTy,
pub b: ComponentTy,
}Expand description
A color in the encoded sRGB color space.
This color space uses the sRGB/Rec.709 primaries, D65 white point, and sRGB transfer functions. The encoded version is nonlinear, with the sRGB OETF, aka “gamma compensation”, applied.
Fields§
§r: ComponentTyThe red component.
g: ComponentTyThe green component.
b: ComponentTyThe blue component.
Trait Implementations§
Source§impl<ComponentTy> AsMut<[ComponentTy; 3]> for EncodedSrgb<ComponentTy>
impl<ComponentTy> AsMut<[ComponentTy; 3]> for EncodedSrgb<ComponentTy>
Source§fn as_mut(&mut self) -> &mut [ComponentTy; 3]
fn as_mut(&mut self) -> &mut [ComponentTy; 3]
Converts this type into a mutable reference of the (usually inferred) input type.
Source§impl<ComponentTy> AsRef<[ComponentTy; 3]> for EncodedSrgb<ComponentTy>
impl<ComponentTy> AsRef<[ComponentTy; 3]> for EncodedSrgb<ComponentTy>
Source§fn as_ref(&self) -> &[ComponentTy; 3]
fn as_ref(&self) -> &[ComponentTy; 3]
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl<ComponentTy: Clone> Clone for EncodedSrgb<ComponentTy>
impl<ComponentTy: Clone> Clone for EncodedSrgb<ComponentTy>
Source§fn clone(&self) -> EncodedSrgb<ComponentTy>
fn clone(&self) -> EncodedSrgb<ComponentTy>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<ComponentTy: Debug> Debug for EncodedSrgb<ComponentTy>
impl<ComponentTy: Debug> Debug for EncodedSrgb<ComponentTy>
Source§impl<ComponentTy> From<[ComponentTy; 3]> for EncodedSrgb<ComponentTy>
impl<ComponentTy> From<[ComponentTy; 3]> for EncodedSrgb<ComponentTy>
Source§fn from([r, g, b]: [ComponentTy; 3]) -> EncodedSrgb<ComponentTy>
fn from([r, g, b]: [ComponentTy; 3]) -> EncodedSrgb<ComponentTy>
Converts to this type from the input type.
Source§impl<ComponentTy: Copy> From<Alpha<EncodedSrgb<ComponentTy>>> for EncodedSrgb<ComponentTy>
impl<ComponentTy: Copy> From<Alpha<EncodedSrgb<ComponentTy>>> for EncodedSrgb<ComponentTy>
Source§fn from(col_alpha: Alpha<EncodedSrgb<ComponentTy>>) -> EncodedSrgb<ComponentTy>
fn from(col_alpha: Alpha<EncodedSrgb<ComponentTy>>) -> EncodedSrgb<ComponentTy>
Converts to this type from the input type.
Source§impl<ComponentTy: Copy> From<PremultipliedAlpha<EncodedSrgb<ComponentTy>>> for EncodedSrgb<ComponentTy>
impl<ComponentTy: Copy> From<PremultipliedAlpha<EncodedSrgb<ComponentTy>>> for EncodedSrgb<ComponentTy>
Source§fn from(
col_alpha: PremultipliedAlpha<EncodedSrgb<ComponentTy>>,
) -> EncodedSrgb<ComponentTy>
fn from( col_alpha: PremultipliedAlpha<EncodedSrgb<ComponentTy>>, ) -> EncodedSrgb<ComponentTy>
Converts to this type from the input type.
Source§impl<ComponentTy: Hash> Hash for EncodedSrgb<ComponentTy>
impl<ComponentTy: Hash> Hash for EncodedSrgb<ComponentTy>
Source§impl<ComponentTy> Into<[ComponentTy; 3]> for EncodedSrgb<ComponentTy>
impl<ComponentTy> Into<[ComponentTy; 3]> for EncodedSrgb<ComponentTy>
Source§fn into(self) -> [ComponentTy; 3]
fn into(self) -> [ComponentTy; 3]
Converts this type into the (usually inferred) input type.
Source§impl<ComponentTy: Ord> Ord for EncodedSrgb<ComponentTy>
impl<ComponentTy: Ord> Ord for EncodedSrgb<ComponentTy>
Source§fn cmp(&self, other: &EncodedSrgb<ComponentTy>) -> Ordering
fn cmp(&self, other: &EncodedSrgb<ComponentTy>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<ComponentTy: PartialEq> PartialEq for EncodedSrgb<ComponentTy>
impl<ComponentTy: PartialEq> PartialEq for EncodedSrgb<ComponentTy>
Source§impl<ComponentTy: PartialOrd> PartialOrd for EncodedSrgb<ComponentTy>
impl<ComponentTy: PartialOrd> PartialOrd for EncodedSrgb<ComponentTy>
Source§impl<ComponentTy: Zeroable> Zeroable for EncodedSrgb<ComponentTy>
impl<ComponentTy: Zeroable> Zeroable for EncodedSrgb<ComponentTy>
impl<ComponentTy: Copy> Copy for EncodedSrgb<ComponentTy>
impl<ComponentTy: Eq> Eq for EncodedSrgb<ComponentTy>
impl<ComponentTy: Pod> Pod for EncodedSrgb<ComponentTy>
impl<ComponentTy> StructuralPartialEq for EncodedSrgb<ComponentTy>
Auto Trait Implementations§
impl<ComponentTy> Freeze for EncodedSrgb<ComponentTy>where
ComponentTy: Freeze,
impl<ComponentTy> RefUnwindSafe for EncodedSrgb<ComponentTy>where
ComponentTy: RefUnwindSafe,
impl<ComponentTy> Send for EncodedSrgb<ComponentTy>where
ComponentTy: Send,
impl<ComponentTy> Sync for EncodedSrgb<ComponentTy>where
ComponentTy: Sync,
impl<ComponentTy> Unpin for EncodedSrgb<ComponentTy>where
ComponentTy: Unpin,
impl<ComponentTy> UnwindSafe for EncodedSrgb<ComponentTy>where
ComponentTy: UnwindSafe,
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
Source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self.