Enum ColorType

#[repr(u8)]
pub enum ColorType

Describes how a pixel is encoded.

Variants

Grayscale = 0

1 grayscale sample.

Rgb = 2

1 red sample, 1 green sample, 1 blue sample.

Indexed = 3

1 sample for the palette index.

GrayscaleAlpha = 4

1 grayscale sample, then 1 alpha sample.

Rgba = 6

1 red sample, 1 green sample, 1 blue sample, and finally, 1 alpha sample.

Implementations

impl ColorType

fn samples(self) -> usize

Returns the number of samples used per pixel encoded in this way.

fn from_u8(n: u8) -> Option<ColorType>

u8 -> Self. Temporary solution until Rust provides a canonical one.

Trait Implementations

impl Clone for ColorType

fn clone(&self) -> Self

impl Copy for ColorType

impl Debug for ColorType

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl Eq for ColorType

impl PartialEq for ColorType

fn eq(&self, other: &Self) -> 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<T> Any for ColorType where T: 'static + ?Sized,

impl<T> Borrow<T> for ColorType where T: ?Sized,

impl<T> BorrowMut<T> for ColorType where T: ?Sized,

impl<T> CloneToUninit for ColorType where T: Clone,

impl<T> From<T> for ColorType

impl<T> ToOwned for ColorType where T: Clone,

impl<T, U> Into<U> for ColorType where U: From<T>,

impl<T, U> TryFrom<U> for ColorType where U: Into<T>,

impl<T, U> TryInto<U> for ColorType where U: TryFrom<T>,