pub enum Output<'a> {
Rows {
data: &'a mut [u8],
stride: usize,
},
Planes(YuvaPlanes<'a>),
}Expand description
Caller memory that a decoding writes into.
§Examples
use webp::api::decode::{decode_into, ColorMode, Config, Output};
// 4 by 3 BGR pixels in rows of 16 bytes (12 used).
let mut rows = vec![0_u8; 16 * 2 + 12];
let size = decode_into(&file, &Config::new(ColorMode::Bgr), Output::Rows { data: &mut rows, stride: 16 })?;
assert_eq!(size, (4, 3));
assert_eq!(&rows[..3], &[9, 8, 7]);Variants§
Rows
Packed rows for the RGB modes: at least
(height - 1) * stride + width * bytes_per_pixel bytes.
Fields
Planes(YuvaPlanes<'a>)
Planes for ColorMode::Yuv and ColorMode::Yuva.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !UnwindSafe for Output<'a>
impl<'a> Forget for Output<'a>
impl<'a> Freeze for Output<'a>
impl<'a> Move for Output<'a>
impl<'a> RefUnwindSafe for Output<'a>
impl<'a> Send for Output<'a>
impl<'a> Sync for Output<'a>
impl<'a> Unpin for Output<'a>
impl<'a> UnsafeUnpin for Output<'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