pub struct YUVBuffer { /* private fields */ }Expand description
Converts RGB to YUV data.
Implementations§
source§impl YUVBuffer
impl YUVBuffer
sourcepub fn new(width: usize, height: usize) -> Self
pub fn new(width: usize, height: usize) -> Self
Allocates a new YUV buffer with the given width and height.
sourcepub fn with_rgb(width: usize, height: usize, rgb: &[u8]) -> Self
pub fn with_rgb(width: usize, height: usize, rgb: &[u8]) -> Self
Allocates a new YUV buffer with the given width and height and data.
Data rgb is assumed to be [rgb rgb rgb ...], starting at y = 0, continuing downwards, in other words
how you’d naively store an RGB image buffer.
§Panics
Will panic if rgb does not match the formats given.
sourcepub fn read_rgb(&mut self, rgb: &[u8])
pub fn read_rgb(&mut self, rgb: &[u8])
Reads an RGB buffer, converts it to YUV and stores it.
Data rgb is assumed to be [rgb rgb rgb ...], starting at y = 0, continuing downwards, in other words
how you’d naively store an RGB image buffer.
§Panics
Will panic if rgb does not match the formats given.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for YUVBuffer
impl RefUnwindSafe for YUVBuffer
impl Send for YUVBuffer
impl Sync for YUVBuffer
impl Unpin for YUVBuffer
impl UnwindSafe for YUVBuffer
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