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

Iterators of frame’s pixels (YUV planes)

It’s an enum, because frames may have different pixel formats, and you get format-specific iterator in the enum

Variants

YuvPlanes8

Fields

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

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

Consult matrix_coefficients() for meaning of these channels

Mono8(RowsIter<'a, u8>)

8-bit grayscale

YuvPlanes16

Fields

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

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.

Mono16(RowsIter<'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

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.