PixelFormat

Enum PixelFormat 

Source
#[repr(u8)]
pub enum PixelFormat {
Show 48 variants ARGB32 = 0, BGRA32 = 1, ABGR32 = 2, RGBA32 = 3, RGB24 = 4, BGR24 = 5, I420 = 6, I422 = 7, I444 = 8, NV12 = 9, NV21 = 10, NV16 = 11, NV61 = 12, NV24 = 13, NV42 = 14, YV12 = 15, YV16 = 16, YV24 = 17, YUYV = 18, YVYU = 19, UYVY = 20, VYUY = 21, AYUV = 22, Y8 = 23, YA8 = 24, RGB30 = 25, BGR30 = 26, ARGB64 = 27, ABGR64 = 28, I010 = 29, I210 = 30, I410 = 31, P010 = 32, P210 = 33, P410 = 34, I012 = 35, I212 = 36, I412 = 37, P012 = 38, P212 = 39, P412 = 40, I016 = 41, I216 = 42, I416 = 43, P016 = 44, P216 = 45, P416 = 46, MAX = 47,
}

Variants§

§

ARGB32 = 0

§

BGRA32 = 1

§

ABGR32 = 2

§

RGBA32 = 3

§

RGB24 = 4

§

BGR24 = 5

§

I420 = 6

§

I422 = 7

§

I444 = 8

§

NV12 = 9

§

NV21 = 10

§

NV16 = 11

§

NV61 = 12

§

NV24 = 13

§

NV42 = 14

§

YV12 = 15

§

YV16 = 16

§

YV24 = 17

§

YUYV = 18

§

YVYU = 19

§

UYVY = 20

§

VYUY = 21

§

AYUV = 22

§

Y8 = 23

§

YA8 = 24

§

RGB30 = 25

§

BGR30 = 26

§

ARGB64 = 27

§

ABGR64 = 28

§

I010 = 29

§

I210 = 30

§

I410 = 31

§

P010 = 32

§

P210 = 33

§

P410 = 34

§

I012 = 35

§

I212 = 36

§

I412 = 37

§

P012 = 38

§

P212 = 39

§

P412 = 40

§

I016 = 41

§

I216 = 42

§

I416 = 43

§

P016 = 44

§

P216 = 45

§

P416 = 46

§

MAX = 47

Implementations§

Source§

impl PixelFormat

Source

pub fn components(&self) -> u8

Source

pub fn component_bytes(&self, component: u8) -> u8

Source

pub fn chroma_subsampling(&self) -> Option<ChromaSubsampling>

Source

pub fn calc_data( &self, width: u32, height: u32, alignment: u32, ) -> (u32, SmallVec<[PlaneInformation; 8]>)

Source

pub fn calc_data_with_stride( &self, height: u32, stride: u32, ) -> (u32, SmallVec<[PlaneInformation; 8]>)

Source

pub fn depth(&self) -> u8

Source

pub fn is_rgb(&self) -> bool

Source

pub fn is_yuv(&self) -> bool

Source

pub fn is_planar(&self) -> bool

Source

pub fn is_packed(&self) -> bool

Source

pub fn is_biplanar(&self) -> bool

Trait Implementations§

Source§

impl Clone for PixelFormat

Source§

fn clone(&self) -> PixelFormat

Returns a duplicate 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 PixelFormat

Source§

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

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

impl Default for PixelFormat

Source§

fn default() -> PixelFormat

Returns the “default value” for a type. Read more
Source§

impl PartialEq for PixelFormat

Source§

fn eq(&self, other: &PixelFormat) -> 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 TryFrom<u8> for PixelFormat

Source§

type Error = TryFromPrimitiveError<PixelFormat>

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

fn try_from(number: u8) -> Result<Self, TryFromPrimitiveError<Self>>

Performs the conversion.
Source§

impl TryFrom<usize> for PixelFormat

Source§

type Error = ()

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

fn try_from(value: usize) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFromPrimitive for PixelFormat

Source§

impl Copy for PixelFormat

Source§

impl StructuralPartialEq for PixelFormat

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§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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,

Source§

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>,

Source§

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>,

Source§

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.