pub struct AnimationDecoder { /* private fields */ }Expand description
Stateful decoder for exactly one stored animation sequence.
Implementations§
Source§impl AnimationDecoder
impl AnimationDecoder
Sourcepub fn new(input: &[u8], limits: DecodeLimits) -> Result<Self, DecodeError>
pub fn new(input: &[u8], limits: DecodeLimits) -> Result<Self, DecodeError>
Creates a decoder for one stored animated WebP sequence.
The input bytes are copied so the returned decoder owns the data needed by libwebp. Frames are returned as composited, full-canvas RGBA buffers. The decoder does not replay the sequence according to its loop count.
Sourcepub fn info(&self) -> &AnimationInfo
pub fn info(&self) -> &AnimationInfo
Returns metadata for the stored animation sequence.
Sourcepub fn has_more_frames(&self) -> bool
pub fn has_more_frames(&self) -> bool
Returns whether unread frames remain in the stored sequence.
Sourcepub fn next_frame(&mut self) -> Result<Option<AnimationFrame>, DecodeError>
pub fn next_frame(&mut self) -> Result<Option<AnimationFrame>, DecodeError>
Returns None only after every frame in the stored sequence was read.
Trait Implementations§
Source§impl Drop for AnimationDecoder
impl Drop for AnimationDecoder
Auto Trait Implementations§
impl !Send for AnimationDecoder
impl !Sync for AnimationDecoder
impl Freeze for AnimationDecoder
impl RefUnwindSafe for AnimationDecoder
impl Unpin for AnimationDecoder
impl UnsafeUnpin for AnimationDecoder
impl UnwindSafe for AnimationDecoder
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