#[repr(u8)]pub enum ColorFormat {
Gray = 0,
RGB = 2,
Palette = 3,
GrayA = 4,
RGBA = 6,
}Expand description
A color format, which specifies how the bytes represent the pixels.
Variants§
Gray = 0
A format encoding only the luminosity of each pixel.
Valid bit depths are 1, 2, 4, 8 and 16 bits.
RGB = 2
A format encoding the red, green, then blue components of each pixel.
Valid bit depths are 8 and 16 bits.
Palette = 3
A single-channel format encoding the index of each pixel in a palette.
If you use this format, you probably want to also use meta::palette
or meta::palette_alpha before writing any image data, because
otherwise, the decoder probably won’t know what each index represents.
Valid bit depths are 1, 2, 4 and 8 bits.
GrayA = 4
The same as Gray, but with an alpha channel added to the end.
Valid bit depths are 8 and 16 bits.
RGBA = 6
The same as RGB, but with an alpha channel added to the end.
Valid bit depths are 8 and 16 bits.
Implementations§
Trait Implementations§
Source§impl Clone for ColorFormat
impl Clone for ColorFormat
Source§fn clone(&self) -> ColorFormat
fn clone(&self) -> ColorFormat
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more