Enum sdl2::pixels::PixelFormatEnum

source ·
#[repr(i32)]
pub enum PixelFormatEnum {
Show 36 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,
}

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

Implementations§

source§

impl PixelFormatEnum

source

pub const RGBA32: PixelFormatEnum = PixelFormatEnum::ABGR8888

source

pub const ARGB32: PixelFormatEnum = PixelFormatEnum::BGRA8888

source

pub const BGRA32: PixelFormatEnum = PixelFormatEnum::ARGB8888

source

pub const ABGR32: PixelFormatEnum = PixelFormatEnum::RGBA8888

source§

impl PixelFormatEnum

source

pub fn from_masks(masks: PixelMasks) -> PixelFormatEnum

source

pub fn into_masks(self) -> Result<PixelMasks, String>

source

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.

source

pub fn byte_size_of_pixels(&self, num_of_pixels: usize) -> usize

source

pub fn byte_size_per_pixel(&self) -> usize

source

pub fn supports_alpha(&self) -> bool

Trait Implementations§

source§

impl Clone for PixelFormatEnum

source§

fn clone(&self) -> PixelFormatEnum

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PixelFormatEnum

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<PixelFormat> for PixelFormatEnum

source§

fn from(pf: PixelFormat) -> PixelFormatEnum

Converts to this type from the input type.
source§

impl FromPrimitive for PixelFormatEnum

source§

fn from_i64(n: i64) -> Option<PixelFormatEnum>

Converts an i64 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
source§

fn from_u64(n: u64) -> Option<PixelFormatEnum>

Converts an u64 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
source§

fn from_isize(n: isize) -> Option<Self>

Converts an isize to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
source§

fn from_i8(n: i8) -> Option<Self>

Converts an i8 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
source§

fn from_i16(n: i16) -> Option<Self>

Converts an i16 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
source§

fn from_i32(n: i32) -> Option<Self>

Converts an i32 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
source§

fn from_i128(n: i128) -> Option<Self>

Converts an i128 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more
source§

fn from_usize(n: usize) -> Option<Self>

Converts a usize to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
source§

fn from_u8(n: u8) -> Option<Self>

Converts an u8 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
source§

fn from_u16(n: u16) -> Option<Self>

Converts an u16 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
source§

fn from_u32(n: u32) -> Option<Self>

Converts an u32 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
source§

fn from_u128(n: u128) -> Option<Self>

Converts an u128 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more
source§

fn from_f32(n: f32) -> Option<Self>

Converts a f32 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
source§

fn from_f64(n: f64) -> Option<Self>

Converts a f64 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more
source§

impl Hash for PixelFormatEnum

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Into<u32> for PixelFormatEnum

source§

fn into(self) -> uint32_t

Converts this type into the (usually inferred) input type.
source§

impl PartialEq for PixelFormatEnum

source§

fn eq(&self, other: &PixelFormatEnum) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for PixelFormatEnum

source§

impl Eq for PixelFormatEnum

source§

impl StructuralPartialEq for PixelFormatEnum

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.