#[repr(i32)]pub enum PixelFormat {
Show 20 variants
Rgb555 = 1,
Rgb565 = 2,
Rgb888 = 3,
Bgr555 = 4,
Bgr565 = 5,
Bgr888 = 6,
Argb8888 = 16,
Rgba8888 = 17,
Abgr8888 = 18,
Bgra8888 = 19,
G1 = 64,
G2 = 65,
G4 = 66,
G8 = 67,
Ag88 = 83,
Ga88 = 99,
Pal1 = 128,
Pal2 = 129,
Pal4 = 130,
Pal8 = 131,
}
Expand description
Represents pixel format modes (bpp = bits per pixel).
Variants§
Rgb555 = 1
15bpp
Rgb565 = 2
16bpp
Rgb888 = 3
24bpp
Bgr555 = 4
15bpp
Bgr565 = 5
16bpp
Bgr888 = 6
24bpp
Argb8888 = 16
32bpp
Rgba8888 = 17
32bpp
Abgr8888 = 18
32bpp
Bgra8888 = 19
32bpp
G1 = 64
1bpp grayscale
G2 = 65
2bpp grayscale
G4 = 66
4bpp grayscale
G8 = 67
8bpp grayscale
Ag88 = 83
16bpp grayscale + alpha
Ga88 = 99
16bpp grayscale + alpha
Pal1 = 128
1bpp palette
Pal2 = 129
2bpp palette
Pal4 = 130
4bpp palette
Pal8 = 131
8bpp palette
Implementations§
Source§impl PixelFormat
impl PixelFormat
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Creates a new PixelFormat.
Sourcepub fn compute_depth(&self) -> usize
pub fn compute_depth(&self) -> usize
Compute the pixel depth for the PixelFormat.
Sourcepub fn rgb(&self, data: &[u8], depth: usize) -> Result<Rgb>
pub fn rgb(&self, data: &[u8], depth: usize) -> Result<Rgb>
Gets the Rgb values at the given depth from the provide data.
Sourcepub fn expand_rgb(
&self,
dst: &mut [u8],
src: &[u8],
width: usize,
height: usize,
depth: usize,
) -> Result<()>
pub fn expand_rgb( &self, dst: &mut [u8], src: &[u8], width: usize, height: usize, depth: usize, ) -> Result<()>
Expands the PixelFormat RGB data.
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 Default for PixelFormat
impl Default for PixelFormat
Source§fn default() -> PixelFormat
fn default() -> PixelFormat
Returns the “default value” for a type. Read more
Source§impl Display for PixelFormat
impl Display for PixelFormat
Source§impl From<&PixelFormat> for &'static str
impl From<&PixelFormat> for &'static str
Source§fn from(val: &PixelFormat) -> Self
fn from(val: &PixelFormat) -> Self
Converts to this type from the input type.
Source§impl From<PixelFormat> for &'static str
impl From<PixelFormat> for &'static str
Source§fn from(val: PixelFormat) -> Self
fn from(val: PixelFormat) -> Self
Converts to this type from the input type.
Source§impl From<PixelFormat> for i32
impl From<PixelFormat> for i32
Source§fn from(val: PixelFormat) -> Self
fn from(val: PixelFormat) -> Self
Converts to this type from the input type.
Source§impl From<i32> for PixelFormat
impl From<i32> for PixelFormat
Source§impl PartialEq for PixelFormat
impl PartialEq for PixelFormat
impl Copy 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