pub struct YUVSlices<'a> { /* private fields */ }Expand description
Convenience wrapper if you already have YUV-sliced data from some other place.
Implementations§
Source§impl<'a> YUVSlices<'a>
impl<'a> YUVSlices<'a>
Sourcepub fn new(
yuv: (&'a [u8], &'a [u8], &'a [u8]),
dimensions: (usize, usize),
strides: (usize, usize, usize),
) -> Self
pub fn new( yuv: (&'a [u8], &'a [u8], &'a [u8]), dimensions: (usize, usize), strides: (usize, usize, usize), ) -> Self
Creates a new YUV slice in 4:2:0 format.
Assume you have some dimension (w, h) that is your actual image size. In addition,
you will have strides (sy, su, sv) that specify how many pixels / bytes per row
are actually used be used. Strides must be larger or equal than w (y) or w / 2 (uv)
respectively.
§Panics
This will panic if the given slices, strides or dimensions don’t match.
Trait Implementations§
Source§impl YUVSource for YUVSlices<'_>
impl YUVSource for YUVSlices<'_>
impl<'a> Copy for YUVSlices<'a>
Auto Trait Implementations§
impl<'a> Freeze for YUVSlices<'a>
impl<'a> RefUnwindSafe for YUVSlices<'a>
impl<'a> Send for YUVSlices<'a>
impl<'a> Sync for YUVSlices<'a>
impl<'a> Unpin for YUVSlices<'a>
impl<'a> UnsafeUnpin for YUVSlices<'a>
impl<'a> UnwindSafe for YUVSlices<'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