Skip to main content

Output

Enum Output 

Source
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

§data: &'a mut [u8]

The rows, top to bottom.

§stride: usize

The distance from the start of a row to the next, in bytes: at least width * bytes_per_pixel and at most i32::MAX.

§

Planes(YuvaPlanes<'a>)

Trait Implementations§

Source§

impl Debug for Output<'_>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.