#[non_exhaustive]pub enum PixelLayout {
Show 14 variants
Rgb8,
Rgba8,
Bgr8,
Bgra8,
Gray8,
GrayAlpha8,
Rgb16,
Rgba16,
Gray16,
GrayAlpha16,
RgbLinearF32,
RgbaLinearF32,
GrayLinearF32,
GrayAlphaLinearF32,
}Expand description
Describes the pixel format of input data.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
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.
GrayAlpha16
16-bit grayscale + alpha, 4 bytes per pixel — native-endian u16.
RgbLinearF32
Linear f32 RGB, 12 bytes per pixel. Skips sRGB→linear conversion.
RgbaLinearF32
Linear f32 RGBA, 16 bytes per pixel. Skips sRGB→linear conversion.
GrayLinearF32
Linear f32 grayscale, 4 bytes per pixel.
GrayAlphaLinearF32
Linear f32 grayscale + alpha, 8 bytes per pixel.
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
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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 UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more