#[non_exhaustive]pub enum PixelFormat {
Rgb8,
Rgba8,
Gray8,
Rgb16,
Rgba16,
Gray16,
}Expand description
Concrete interleaved pixel format.
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
Interleaved 8-bit RGB.
Rgba8
Interleaved 8-bit RGBA.
Gray8
8-bit grayscale.
Rgb16
Interleaved 16-bit RGB.
Rgba16
Interleaved 16-bit RGBA.
Gray16
16-bit grayscale.
Implementations§
Source§impl PixelFormat
impl PixelFormat
Sourcepub const fn layout(self) -> PixelLayout
pub const fn layout(self) -> PixelLayout
Return the channel layout for this pixel format.
Sourcepub const fn sample(self) -> SampleType
pub const fn sample(self) -> SampleType
Return the integer sample type for this pixel format.
Sourcepub const fn bytes_per_sample(self) -> usize
pub const fn bytes_per_sample(self) -> usize
Return the number of bytes in one channel sample.
Sourcepub const fn bytes_per_pixel(self) -> usize
pub const fn bytes_per_pixel(self) -> usize
Return the number of bytes in one interleaved pixel.
Trait Implementations§
Source§impl Clone for PixelFormat
impl Clone for PixelFormat
Source§fn clone(&self) -> PixelFormat
fn clone(&self) -> PixelFormat
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for PixelFormat
Source§impl Debug for PixelFormat
impl Debug for PixelFormat
impl Eq for PixelFormat
Source§impl Hash for PixelFormat
impl Hash for PixelFormat
Source§impl PartialEq for PixelFormat
impl PartialEq for PixelFormat
Source§fn eq(&self, other: &PixelFormat) -> bool
fn eq(&self, other: &PixelFormat) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for PixelFormat
Auto Trait Implementations§
impl Freeze for PixelFormat
impl RefUnwindSafe for PixelFormat
impl Send for PixelFormat
impl Sync for PixelFormat
impl Unpin for PixelFormat
impl UnsafeUnpin for PixelFormat
impl UnwindSafe for PixelFormat
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