pub struct Chunky<T, V = Vec<u8>> { /* private fields */ }Expand description
A chunky frame.
In this format, each pixel is stored contiguously, and the entire image is stored in row-major order. For example, this means that an RGBA image would store the RGBA values of the top-left pixel, then each of the RGBA values of the pixel immediately to the right, and so on, moving down through each row.
Implementations§
Source§impl<T, V> Chunky<T, V>
impl<T, V> Chunky<T, V>
Sourcepub fn from_bytes(width: usize, height: usize, bytes: V) -> Self
pub fn from_bytes(width: usize, height: usize, bytes: V) -> Self
Creates a new frame backed by the provided byte source.
§Panics
Panics if the length of the buffer is not
width * height * bytes_per_pixel.
Sourcepub fn into_bytes(self) -> V
pub fn into_bytes(self) -> V
Recovers the byte source.
Trait Implementations§
Auto Trait Implementations§
impl<T, V> Freeze for Chunky<T, V>where
V: Freeze,
impl<T, V> RefUnwindSafe for Chunky<T, V>where
V: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, V> Send for Chunky<T, V>
impl<T, V> Sync for Chunky<T, V>
impl<T, V> Unpin for Chunky<T, V>
impl<T, V> UnwindSafe for Chunky<T, V>where
V: UnwindSafe,
T: UnwindSafe,
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