Enum sdl2::pixels::PixelFormatEnum
source · #[repr(i32)]
pub enum PixelFormatEnum {
Show 36 variants
Unknown,
Index1LSB,
Index1MSB,
Index4LSB,
Index4MSB,
Index8,
RGB332,
RGB444,
RGB555,
BGR555,
ARGB4444,
RGBA4444,
ABGR4444,
BGRA4444,
ARGB1555,
RGBA5551,
ABGR1555,
BGRA5551,
RGB565,
BGR565,
RGB24,
BGR24,
RGB888,
RGBX8888,
BGR888,
BGRX8888,
ARGB8888,
RGBA8888,
ABGR8888,
BGRA8888,
ARGB2101010,
YV12,
IYUV,
YUY2,
UYVY,
YVYU,
}
Variants
Unknown
Index1LSB
Index1MSB
Index4LSB
Index4MSB
Index8
RGB332
RGB444
RGB555
BGR555
ARGB4444
RGBA4444
ABGR4444
BGRA4444
ARGB1555
RGBA5551
ABGR1555
BGRA5551
RGB565
BGR565
RGB24
BGR24
RGB888
RGBX8888
BGR888
BGRX8888
ARGB8888
RGBA8888
ABGR8888
BGRA8888
ARGB2101010
YV12
IYUV
YUY2
UYVY
YVYU
Implementations
sourceimpl 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
sourceimpl Clone for PixelFormatEnum
impl Clone for PixelFormatEnum
sourcefn clone(&self) -> PixelFormatEnum
fn clone(&self) -> PixelFormatEnum
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for PixelFormatEnum
impl Debug for PixelFormatEnum
sourceimpl From<PixelFormat> for PixelFormatEnum
impl From<PixelFormat> for PixelFormatEnum
sourcefn from(pf: PixelFormat) -> PixelFormatEnum
fn from(pf: PixelFormat) -> PixelFormatEnum
Converts to this type from the input type.
sourceimpl FromPrimitive for PixelFormatEnum
impl FromPrimitive for PixelFormatEnum
sourcefn from_i64(n: i64) -> Option<PixelFormatEnum>
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. Read moresourcefn from_u64(n: u64) -> Option<PixelFormatEnum>
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. Read moresourcefn from_isize(n: isize) -> Option<Self>
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. Read moresourcefn from_i8(n: i8) -> Option<Self>
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. Read moresourcefn from_i16(n: i16) -> Option<Self>
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. Read moresourcefn from_i32(n: i32) -> Option<Self>
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. Read moresourcefn from_i128(n: i128) -> Option<Self>
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 moresourcefn from_usize(n: usize) -> Option<Self>
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. Read moresourcefn from_u8(n: u8) -> Option<Self>
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. Read moresourcefn from_u16(n: u16) -> Option<Self>
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. Read moresourcefn from_u32(n: u32) -> Option<Self>
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. Read moresourcefn from_u128(n: u128) -> Option<Self>
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 moresourceimpl Hash for PixelFormatEnum
impl Hash for PixelFormatEnum
sourceimpl Into<u32> for PixelFormatEnum
impl Into<u32> for PixelFormatEnum
sourceimpl PartialEq<PixelFormatEnum> for PixelFormatEnum
impl PartialEq<PixelFormatEnum> for PixelFormatEnum
sourcefn eq(&self, other: &PixelFormatEnum) -> bool
fn eq(&self, other: &PixelFormatEnum) -> bool
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more