pub enum PixelFormat {
RGBA8,
BGRA8,
RGB8,
BGR8,
Gray8,
GrayA8,
}Expand description
Pixel format for raw image data
Variants§
RGBA8
Red, Green, Blue, Alpha (8 bits per channel)
BGRA8
Blue, Green, Red, Alpha (8 bits per channel)
RGB8
Red, Green, Blue (8 bits per channel)
BGR8
Blue, Green, Red (8 bits per channel)
Gray8
Grayscale (8 bits)
GrayA8
Grayscale with alpha (8 bits per channel)
Implementations§
Source§impl PixelFormat
impl PixelFormat
Sourcepub fn bytes_per_pixel(&self) -> usize
pub fn bytes_per_pixel(&self) -> usize
Get the number of bytes per pixel
Sourcepub fn channel_count(&self) -> usize
pub fn channel_count(&self) -> usize
Get the number of color channels
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 · 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 PixelFormat
impl Debug for PixelFormat
Source§impl Display for PixelFormat
impl Display for PixelFormat
Source§impl PartialEq for PixelFormat
impl PartialEq for PixelFormat
impl Copy for PixelFormat
impl Eq for PixelFormat
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 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