pub struct Codec { /* private fields */ }Expand description
Codec is an opened image whose frames are decoded one at a time, on request.
It is the shape of Flutter’s ui.Codec: a still image is a codec with one frame, so a caller
need not know in advance which it holds. Dropping the codec releases the decoder’s state.
Implementations§
Source§impl Codec
impl Codec
Sourcepub fn info(&self) -> ImageInfo
pub fn info(&self) -> ImageInfo
info is the frame size, frame count and repetition fixed when the image was opened.
Sourcepub fn next_frame(&mut self) -> Pending<'_, Frame> ⓘ
pub fn next_frame(&mut self) -> Pending<'_, Frame> ⓘ
next_frame decodes the next frame, wrapping to the first after the last.
The frame borrows the codec until it arrives, so one codec decodes one frame at a time and a second request cannot be made while the first is in flight.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Codec
impl !Send for Codec
impl !Sync for Codec
impl !UnwindSafe for Codec
impl Freeze for Codec
impl Unpin for Codec
impl UnsafeUnpin for Codec
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