Enum ColorType
#[non_exhaustive]
pub enum ColorType
An enumeration over supported color types and bit depths
Variants
-
L8 Pixel is 8-bit luminance
-
La8 Pixel is 8-bit luminance with an alpha channel
-
Rgb8 Pixel contains 8-bit R, G and B channels
-
Rgba8 Pixel is 8-bit RGB with an alpha channel
-
L16 Pixel is 16-bit luminance
-
La16 Pixel is 16-bit luminance with an alpha channel
-
Rgb16 Pixel is 16-bit RGB
-
Rgba16 Pixel is 16-bit RGBA
-
Rgb32F Pixel is 32-bit float RGB
-
Rgba32F Pixel is 32-bit float RGBA
Implementations
impl ColorType
fn bytes_per_pixel(self) -> u8Returns the number of bytes contained in a pixel of
ColorTypecfn has_alpha(self) -> boolReturns if there is an alpha channel.
fn has_color(self) -> boolReturns false if the color scheme is grayscale, true otherwise.
fn bits_per_pixel(self) -> u16Returns the number of bits contained in a pixel of
ColorTypec(which will always be a multiple of 8).fn channel_count(self) -> u8Returns the number of color channels that make up this pixel
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 Hash for ColorType
fn hash<__H: Hasher>(&self, state: &mut __H)
impl PartialEq for ColorType
fn eq(&self, other: &Self) -> bool
impl StructuralPartialEq for ColorType
impl TryFrom<ExtendedColorType> for ColorType
type Error = TryFromExtendedColorError;fn try_from(value: ExtendedColorType) -> Result<ColorType, Self::Error>