#[non_exhaustive]pub enum ColorModel {
Gray,
GrayAlpha,
Rgb,
Rgba,
Cmyk,
Bilevel,
Indexed,
}Expand description
The colour interpretation of a pixel’s channels.
Distinguishes layouts that share a channel count: ColorModel::Rgba and ColorModel::Cmyk
are both four channels but must never be interchanged, and ColorModel::Gray,
ColorModel::Bilevel, and ColorModel::Indexed are all one channel with different meanings.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Gray
Single luminance channel.
GrayAlpha
Luminance plus an alpha channel.
Rgb
Red, green, blue.
Rgba
Red, green, blue, alpha (unassociated).
Cmyk
Cyan, magenta, yellow, black ink separations.
Bilevel
One channel, 0 = black and any non-zero value = white (a 1-bit image carried as one byte
per pixel).
Indexed
One channel of indices into a separate colour palette.
Trait Implementations§
Source§impl Clone for ColorModel
impl Clone for ColorModel
Source§fn clone(&self) -> ColorModel
fn clone(&self) -> ColorModel
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ColorModel
Source§impl Debug for ColorModel
impl Debug for ColorModel
impl Eq for ColorModel
Source§impl Hash for ColorModel
impl Hash for ColorModel
Source§impl PartialEq for ColorModel
impl PartialEq for ColorModel
Source§fn eq(&self, other: &ColorModel) -> bool
fn eq(&self, other: &ColorModel) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ColorModel
Auto Trait Implementations§
impl Freeze for ColorModel
impl RefUnwindSafe for ColorModel
impl Send for ColorModel
impl Sync for ColorModel
impl Unpin for ColorModel
impl UnsafeUnpin for ColorModel
impl UnwindSafe for ColorModel
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