[][src]Enum beryllium::PixelFormatEnum

#[repr(i32)]
pub enum PixelFormatEnum {
    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,
    NV12,
    NV21,
    ExternalOES,
}

The various named pixel formats that SDL2 supports.

There's various checks you can perform on each pixel format.

Note that the "fourcc" formats, anything that gives true from the is_fourcc method, are industry specified special values, and do not follow SDL2's bit packing scheme. In other words, the output they produce for any of the other check methods is not to really be trusted.

Variants

UnknownIndex1lsbIndex1msbIndex4lsbIndex4msbIndex8RGB332RGB444RGB555BGR555ARGB4444RGBA4444ABGR4444BGRA4444ARGB1555RGBA5551ABGR1555BGRA5551RGB565BGR565RGB24BGR24RGB888RGBX8888BGR888BGRX8888ARGB8888RGBA8888ABGR8888BGRA8888ARGB2101010YV12

Planar mode: Y + V + U (3 planes)

IYUV

Planar mode: Y + U + V (3 planes)

YUY2

Packed mode: Y0+U0+Y1+V0 (1 plane)

UYVY

Packed mode: U0+Y0+V0+Y1 (1 plane)

YVYU

Packed mode: Y0+V0+Y1+U0 (1 plane)

NV12

Planar mode: Y + U/V interleaved (2 planes)

NV21

Planar mode: Y + V/U interleaved (2 planes)

ExternalOES

Android video texture format

Methods

impl PixelFormatEnum[src]

pub const RGBA32: Self[src]

Platform specific alias for RGBA

pub const ARGB32: Self[src]

Platform specific alias for ARGB

pub const BGRA32: Self[src]

Platform specific alias for BGRA

pub const ABGR32: Self[src]

Platform specific alias for ABGR

impl PixelFormatEnum[src]

pub fn pixel_type(self) -> PixelType[src]

The type of the pixel format.

All unknown types convert to PixelType::Unknown, of course.

pub fn pixel_order(self) -> PixelOrder[src]

Ordering of channel or bits in the pixel format.

Unknown values convert to one of the None variants.

pub fn pixel_layout(self) -> PixelLayout[src]

Channel bits pattern of the pixel format.

Converts any possible unknown layout to PixelLayout::None.

pub fn bits_per_pixel(self) -> u32[src]

Bits of color information per pixel.

pub fn bytes_per_pixel(self) -> u32[src]

Bytes used per pixel.

Note: Formats with less than 8 bits per pixel give a result of 0 bytes per pixel. Weird and all, but that's how it is.

pub fn is_indexed(self) -> bool[src]

Is this format an indexed format?

pub fn is_packed(self) -> bool[src]

Is this format a packed format?

pub fn is_array(self) -> bool[src]

Is this format a packed format?

pub fn is_alpha(self) -> bool[src]

Is this format a format with an alpha channel?

pub fn is_fourcc(self) -> bool[src]

Is this a four-character code format?

True for pixel formats representing unique formats, for example YUV formats.

Trait Implementations

impl From<i32> for PixelFormatEnum[src]

impl PartialEq<PixelFormatEnum> for PixelFormatEnum[src]

#[must_use] fn ne(&self, other: &Rhs) -> bool1.0.0[src]

This method tests for !=.

impl Clone for PixelFormatEnum[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Eq for PixelFormatEnum[src]

impl Copy for PixelFormatEnum[src]

impl Debug for PixelFormatEnum[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]