pub struct Frame<'s> {
pub canvas: &'s [u8],
pub stride: usize,
pub timestamp_ms: i32,
}Expand description
A decoded frame: the whole canvas after the frame was blended and the previous one disposed, and the frame’s end time.
§Examples
use webp::api::decode::{AnimationDecoder, AnimationOptions, Frame};
let mut decoder = AnimationDecoder::new(&file, AnimationOptions::default())?;
let frame: Frame<'_> = decoder.next_frame()?.expect("one frame");
assert_eq!((frame.canvas, frame.stride, frame.timestamp_ms), (&[1_u8, 2, 3, 4, 1, 2, 3, 4][..], 8, 0));Fields§
§canvas: &'s [u8]The canvas: canvas_height rows of canvas_width pixels of 4 bytes.
stride: usizeThe distance between canvas rows, in bytes: 4 * canvas_width.
timestamp_ms: i32The time at which the frame ends, in milliseconds: the sum of the durations so far (0 for a still image).
Trait Implementations§
Auto Trait Implementations§
impl<'s> Forget for Frame<'s>
impl<'s> Freeze for Frame<'s>
impl<'s> Move for Frame<'s>
impl<'s> RefUnwindSafe for Frame<'s>
impl<'s> Send for Frame<'s>
impl<'s> Sync for Frame<'s>
impl<'s> Unpin for Frame<'s>
impl<'s> UnsafeUnpin for Frame<'s>
impl<'s> UnwindSafe for Frame<'s>
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