#[non_exhaustive]pub enum Pixels {
Stencil(BitImage),
Gray8(Box<[u8]>),
Rgb8(Box<[u8]>),
Cmyk8(Box<[u8]>),
Indexed {
indices: Box<[u8]>,
palette: Box<[Rgb]>,
},
}Expand description
Decoded pixels, in whichever shape the source produced.
Keeping the shape rather than always widening to RGB matters: an indexed image’s palette is what a renderer needs to resample correctly, and a one-bit stencil is a mask, not a picture.
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.
Stencil(BitImage)
One bit per pixel, packed MSB-first with byte-aligned rows. A set bit paints; this is what a stencil mask produces.
Gray8(Box<[u8]>)
Eight-bit grey.
Rgb8(Box<[u8]>)
Eight-bit red, green, blue.
Cmyk8(Box<[u8]>)
Eight-bit cyan, magenta, yellow, black.
Indexed
Palette indices with the palette to resolve them.
Implementations§
Trait Implementations§
impl StructuralPartialEq for Pixels
Auto Trait Implementations§
impl Freeze for Pixels
impl RefUnwindSafe for Pixels
impl Send for Pixels
impl Sync for Pixels
impl Unpin for Pixels
impl UnsafeUnpin for Pixels
impl UnwindSafe for Pixels
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