Enum sdl2::pixels::PixelFormatEnum
source · #[repr(i32)]pub enum PixelFormatEnum {
Show 38 variants
Unknown = 0,
Index1LSB = 286_261_504,
Index1MSB = 287_310_080,
Index4LSB = 303_039_488,
Index4MSB = 304_088_064,
Index8 = 318_769_153,
RGB332 = 336_660_481,
RGB444 = 353_504_258,
RGB555 = 353_570_562,
BGR555 = 357_764_866,
ARGB4444 = 355_602_434,
RGBA4444 = 356_651_010,
ABGR4444 = 359_796_738,
BGRA4444 = 360_845_314,
ARGB1555 = 355_667_970,
RGBA5551 = 356_782_082,
ABGR1555 = 359_862_274,
BGRA5551 = 360_976_386,
RGB565 = 353_701_890,
BGR565 = 357_896_194,
RGB24 = 386_930_691,
BGR24 = 390_076_419,
RGB888 = 370_546_692,
RGBX8888 = 371_595_268,
BGR888 = 374_740_996,
BGRX8888 = 375_789_572,
ARGB8888 = 372_645_892,
RGBA8888 = 373_694_468,
ABGR8888 = 376_840_196,
BGRA8888 = 377_888_772,
ARGB2101010 = 372_711_428,
YV12 = 842_094_169,
IYUV = 1_448_433_993,
YUY2 = 844_715_353,
UYVY = 1_498_831_189,
YVYU = 1_431_918_169,
NV12 = 842_094_158,
NV21 = 825_382_478,
}
Variants§
Unknown = 0
Index1LSB = 286_261_504
Index1MSB = 287_310_080
Index4LSB = 303_039_488
Index4MSB = 304_088_064
Index8 = 318_769_153
RGB332 = 336_660_481
RGB444 = 353_504_258
RGB555 = 353_570_562
BGR555 = 357_764_866
ARGB4444 = 355_602_434
RGBA4444 = 356_651_010
ABGR4444 = 359_796_738
BGRA4444 = 360_845_314
ARGB1555 = 355_667_970
RGBA5551 = 356_782_082
ABGR1555 = 359_862_274
BGRA5551 = 360_976_386
RGB565 = 353_701_890
BGR565 = 357_896_194
RGB24 = 386_930_691
BGR24 = 390_076_419
RGB888 = 370_546_692
RGBX8888 = 371_595_268
BGR888 = 374_740_996
BGRX8888 = 375_789_572
ARGB8888 = 372_645_892
RGBA8888 = 373_694_468
ABGR8888 = 376_840_196
BGRA8888 = 377_888_772
ARGB2101010 = 372_711_428
YV12 = 842_094_169
IYUV = 1_448_433_993
YUY2 = 844_715_353
UYVY = 1_498_831_189
YVYU = 1_431_918_169
NV12 = 842_094_158
NV21 = 825_382_478
Implementations§
source§impl PixelFormatEnum
impl PixelFormatEnum
pub const RGBA32: PixelFormatEnum = PixelFormatEnum::ABGR8888
pub const ARGB32: PixelFormatEnum = PixelFormatEnum::BGRA8888
pub const BGRA32: PixelFormatEnum = PixelFormatEnum::ARGB8888
pub const ABGR32: PixelFormatEnum = PixelFormatEnum::RGBA8888
source§impl PixelFormatEnum
impl PixelFormatEnum
pub fn from_masks(masks: PixelMasks) -> PixelFormatEnum
pub fn into_masks(self) -> Result<PixelMasks, String>
sourcepub fn byte_size_from_pitch_and_height(
self,
pitch: usize,
height: usize
) -> usize
pub fn byte_size_from_pitch_and_height( self, pitch: usize, height: usize ) -> usize
Calculates the total byte size of an image buffer, given its pitch and height.
pub fn byte_size_of_pixels(self, num_of_pixels: usize) -> usize
pub fn byte_size_per_pixel(self) -> usize
pub fn supports_alpha(self) -> bool
Trait Implementations§
source§impl Clone for PixelFormatEnum
impl Clone for PixelFormatEnum
source§fn clone(&self) -> PixelFormatEnum
fn clone(&self) -> PixelFormatEnum
Returns a copy 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 PixelFormatEnum
impl Debug for PixelFormatEnum
source§impl From<PixelFormat> for PixelFormatEnum
impl From<PixelFormat> for PixelFormatEnum
source§fn from(pf: PixelFormat) -> PixelFormatEnum
fn from(pf: PixelFormat) -> PixelFormatEnum
Converts to this type from the input type.
source§impl Hash for PixelFormatEnum
impl Hash for PixelFormatEnum
source§impl PartialEq for PixelFormatEnum
impl PartialEq for PixelFormatEnum
source§fn eq(&self, other: &PixelFormatEnum) -> bool
fn eq(&self, other: &PixelFormatEnum) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl TryFrom<PixelFormatEnum> for PixelFormat
impl TryFrom<PixelFormatEnum> for PixelFormat
source§impl TryFrom<u32> for PixelFormatEnum
impl TryFrom<u32> for PixelFormatEnum
impl Copy for PixelFormatEnum
impl Eq for PixelFormatEnum
impl StructuralEq for PixelFormatEnum
impl StructuralPartialEq for PixelFormatEnum
Auto Trait Implementations§
impl RefUnwindSafe for PixelFormatEnum
impl Send for PixelFormatEnum
impl Sync for PixelFormatEnum
impl Unpin for PixelFormatEnum
impl UnwindSafe for PixelFormatEnum
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