Enum y4m::Colorspace

source ·
#[non_exhaustive]
pub enum Colorspace {
Show 14 variants Cmono, Cmono12, C420, C420p10, C420p12, C420jpeg, C420paldv, C420mpeg2, C422, C422p10, C422p12, C444, C444p10, C444p12,
}
Expand description

Colorspace (color model/pixel format). Only subset of them is supported.

From libavformat/yuv4mpegenc.c:

yuv4mpeg can only handle yuv444p, yuv422p, yuv420p, yuv411p and gray8 pixel formats. And using ‘strict -1’ also yuv444p9, yuv422p9, yuv420p9, yuv444p10, yuv422p10, yuv420p10, yuv444p12, yuv422p12, yuv420p12, yuv444p14, yuv422p14, yuv420p14, yuv444p16, yuv422p16, yuv420p16, gray9, gray10, gray12 and gray16 pixel formats.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Cmono

Grayscale only, 8-bit.

§

Cmono12

Grayscale only, 12-bit.

§

C420

4:2:0 with coincident chroma planes, 8-bit.

§

C420p10

4:2:0 with coincident chroma planes, 10-bit.

§

C420p12

4:2:0 with coincident chroma planes, 12-bit.

§

C420jpeg

4:2:0 with biaxially-displaced chroma planes, 8-bit.

§

C420paldv

4:2:0 with vertically-displaced chroma planes, 8-bit.

§

C420mpeg2

Found in some files. Same as C420.

§

C422

4:2:2, 8-bit.

§

C422p10

4:2:2, 10-bit.

§

C422p12

4:2:2, 12-bit.

§

C444

4:4:4, 8-bit.

§

C444p10

4:4:4, 10-bit.

§

C444p12

4:4:4, 12-bit.

Implementations§

source§

impl Colorspace

source

pub fn get_bit_depth(self) -> usize

Return the bit depth per sample

source

pub fn get_bytes_per_sample(self) -> usize

Return the number of bytes in a sample

Trait Implementations§

source§

impl Clone for Colorspace

source§

fn clone(&self) -> Colorspace

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 Colorspace

source§

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

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

impl Copy for Colorspace

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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 Twhere 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 Twhere 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 Twhere 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.