#[non_exhaustive]pub enum PixelLayout {
Rgb8,
Rgba8,
Bgr8,
Bgra8,
Gray8,
GrayAlpha8,
Rgb16,
Rgba16,
Gray16,
RgbLinearF32,
}Expand description
Describes the pixel format of input data.
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.
Rgb8
8-bit sRGB, 3 bytes per pixel (R, G, B).
Rgba8
8-bit sRGB + alpha, 4 bytes per pixel (R, G, B, A).
Bgr8
8-bit sRGB in BGR order, 3 bytes per pixel (B, G, R).
Bgra8
8-bit sRGB in BGRA order, 4 bytes per pixel (B, G, R, A).
Gray8
8-bit grayscale, 1 byte per pixel.
GrayAlpha8
8-bit grayscale + alpha, 2 bytes per pixel.
Rgb16
16-bit sRGB, 6 bytes per pixel (R, G, B) — native-endian u16.
Rgba16
16-bit sRGB + alpha, 8 bytes per pixel (R, G, B, A) — native-endian u16.
Gray16
16-bit grayscale, 2 bytes per pixel — native-endian u16.
RgbLinearF32
Linear f32 RGB, 12 bytes per pixel. Skips sRGB→linear conversion.
Implementations§
Source§impl PixelLayout
impl PixelLayout
Sourcepub const fn bytes_per_pixel(self) -> usize
pub const fn bytes_per_pixel(self) -> usize
Bytes per pixel for this layout.
Sourcepub const fn is_linear(self) -> bool
pub const fn is_linear(self) -> bool
Whether this layout uses linear (not gamma-encoded) values.
Sourcepub const fn is_grayscale(self) -> bool
pub const fn is_grayscale(self) -> bool
Whether this layout is grayscale.
Trait Implementations§
Source§impl Clone for PixelLayout
impl Clone for PixelLayout
Source§fn clone(&self) -> PixelLayout
fn clone(&self) -> PixelLayout
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PixelLayout
impl Debug for PixelLayout
Source§impl PartialEq for PixelLayout
impl PartialEq for PixelLayout
impl Copy for PixelLayout
impl Eq for PixelLayout
impl StructuralPartialEq for PixelLayout
Auto Trait Implementations§
impl Freeze for PixelLayout
impl RefUnwindSafe for PixelLayout
impl Send for PixelLayout
impl Sync for PixelLayout
impl Unpin for PixelLayout
impl UnwindSafe for PixelLayout
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