Enum ColorType
#[non_exhaustive]
pub enum ColorType
An enumeration over supported color types and their bit depths
Variants
-
Gray(u8) Pixel is grayscale
-
RGB(u8) Pixel contains R, G and B channels
-
Palette(u8) Pixel is an index into a color palette
-
GrayA(u8) Pixel is grayscale with an alpha channel
-
RGBA(u8) Pixel is RGB with an alpha channel
-
CMYK(u8) Pixel is CMYK
-
CMYKA(u8) Pixel is CMYK with an alpha channel
-
YCbCr(u8) Pixel is YCbCr
-
Lab(u8) Pixel is CIE Lab* (ICC LAb)
-
Multiband { bit_depth: u8, num_samples: u16 } Pixel has multiple bands/channels
Implementations
impl ColorType
fn bit_depth(&self) -> u8The number of bits used to store each sample.
fn num_samples(&self) -> u16The number of samples in each representation of a single color.
Trait Implementations
impl Clone for ColorType
fn clone(&self) -> ColorType
impl Copy for ColorType
impl Debug for ColorType
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Eq for ColorType
impl Hash for ColorType
fn hash<__H: Hasher>(&self, state: &mut __H)
impl PartialEq for ColorType
fn eq(&self, other: &ColorType) -> bool
impl StructuralPartialEq for ColorType
Auto Trait Implementations
impl Freeze for ColorType
impl RefUnwindSafe for ColorType
impl Send for ColorType
impl Sync for ColorType
impl Unpin for ColorType
impl UnsafeUnpin for ColorType
impl UnwindSafe for ColorType
Blanket Implementations
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for ColorType
where
ST: ?Sized,
DT: ?Sized,
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for ColorType
where
ST: ?Sized,
DT: ?Sized,
impl<T> Any for ColorType
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for ColorType
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for ColorType
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for ColorType
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for ColorType
fn from(t: T) -> TReturns the argument unchanged.
impl<T> Read<Exclusive, BecauseExclusive> for ColorType
where
T: ?Sized,
impl<T> ToOwned for ColorType
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T, U> Into<U> for ColorType
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for ColorType
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for ColorType
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>