pub enum PixelFormat {
I420,
Nv12,
I420P10,
P010,
}Expand description
How a frame’s bytes are laid out. Every format is 4:2:0 with chroma planes of ceil(w/2) × ceil(h/2) samples.
10-bit formats store each sample in a little-endian u16.
Variants§
I420
8-bit Y, U and V planes.
Nv12
8-bit Y plane and one interleaved UV plane.
I420P10
10-bit Y, U and V planes, value in the low ten bits (ffmpeg’s yuv420p10le).
P010
10-bit Y plane and one interleaved UV plane, value in the high ten bits (P010, x420).
Implementations§
Source§impl PixelFormat
impl PixelFormat
pub fn bit_depth(self) -> u8
pub fn semi_planar(self) -> bool
Sourcepub fn sample_bytes(self) -> usize
pub fn sample_bytes(self) -> usize
Bytes per sample.
Sourcepub fn planes(self, width: usize, height: usize) -> Vec<(usize, usize)>
pub fn planes(self, width: usize, height: usize) -> Vec<(usize, usize)>
Per plane, tightly packed: (bytes per row, rows).
Sourcepub fn frame_bytes(self, width: usize, height: usize) -> usize
pub fn frame_bytes(self, width: usize, height: usize) -> usize
Bytes of a tightly packed frame.
Trait Implementations§
Source§impl Clone for PixelFormat
impl Clone for PixelFormat
impl Copy for PixelFormat
Source§impl Debug for PixelFormat
impl Debug for PixelFormat
impl Eq for PixelFormat
Source§impl PartialEq for PixelFormat
impl PartialEq for PixelFormat
impl StructuralPartialEq for PixelFormat
Auto Trait Implementations§
impl Freeze for PixelFormat
impl RefUnwindSafe for PixelFormat
impl Send for PixelFormat
impl Sync for PixelFormat
impl Unpin for PixelFormat
impl UnsafeUnpin for PixelFormat
impl UnwindSafe for PixelFormat
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more