pub struct Nv12Frame<'a> {
pub luma: &'a [u8],
pub luma_stride: usize,
pub chroma: &'a [u8],
pub chroma_stride: usize,
pub width: u32,
pub height: u32,
}Expand description
One NV12 frame, as a camera or decoder hands it over.
Strides rather than packed rows because a capture buffer is padded to whatever the hardware wanted, and copying it tight first would be a second pass over every byte for nothing.
Fields§
§luma: &'a [u8]height rows of luma_stride.
luma_stride: usizeBytes between luma rows.
chroma: &'a [u8]height.div_ceil(2) rows of interleaved Cb/Cr, each at least
width.div_ceil(2) * 2 bytes, at chroma_stride.
chroma_stride: usizeBytes between chroma rows.
width: u32Width in pixels.
height: u32Height in pixels.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Nv12Frame<'a>
impl<'a> RefUnwindSafe for Nv12Frame<'a>
impl<'a> Send for Nv12Frame<'a>
impl<'a> Sync for Nv12Frame<'a>
impl<'a> Unpin for Nv12Frame<'a>
impl<'a> UnsafeUnpin for Nv12Frame<'a>
impl<'a> UnwindSafe for Nv12Frame<'a>
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