Skip to main content

Planes

Enum Planes 

Source
pub enum Planes<'a> {
    YuvPlanes8 {
        y: ImgRef<'a, u8>,
        u: ImgRef<'a, u8>,
        v: ImgRef<'a, u8>,
        chroma_sampling: ChromaSampling,
    },
    Mono8(ImgRef<'a, u8>),
    YuvPlanes16 {
        y: ImgRef<'a, [u8; 2]>,
        u: ImgRef<'a, [u8; 2]>,
        v: ImgRef<'a, [u8; 2]>,
        chroma_sampling: ChromaSampling,
        depth: Depth,
    },
    Mono16(ImgRef<'a, [u8; 2]>, Depth),
}
Expand description

It’s an enum, because frames may have different pixel formats

Variants§

§

YuvPlanes8

8-bit YUV (YCbCr, YCgCo, etc.). This is a collection of 3 planes. Each may have a different size depending on chroma_sampling.

Consult matrix_coefficients() for meaning of these channels

Fields

§y: ImgRef<'a, u8>
§u: ImgRef<'a, u8>
§v: ImgRef<'a, u8>
§chroma_sampling: ChromaSampling
§

Mono8(ImgRef<'a, u8>)

8-bit grayscale

§

YuvPlanes16

10/12/16-bit color. Not subsampled. See depth field for actual range of pixels used.

It’s not u16, because it’s not guaranteed to be aligned. Use u16::from_ne_bytes() or ptr::read_unaligned.

Fields

§y: ImgRef<'a, [u8; 2]>
§u: ImgRef<'a, [u8; 2]>
§v: ImgRef<'a, [u8; 2]>
§chroma_sampling: ChromaSampling
§depth: Depth
§

Mono16(ImgRef<'a, [u8; 2]>, Depth)

10/12/16-bit grayscale. It’s not u16, because it’s not guaranteed to be aligned. Use u16::from_ne_bytes() or ptr::read_unaligned.

Auto Trait Implementations§

§

impl<'a> Freeze for Planes<'a>

§

impl<'a> RefUnwindSafe for Planes<'a>

§

impl<'a> Send for Planes<'a>

§

impl<'a> Sync for Planes<'a>

§

impl<'a> Unpin for Planes<'a>

§

impl<'a> UnsafeUnpin for Planes<'a>

§

impl<'a> UnwindSafe for Planes<'a>

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.