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(&self) -> Pending<Frame> ⓘ
pub fn next_frame(&self) -> Pending<Frame> ⓘ
next_frame decodes the next frame, wrapping to the first after the last.
The returned future owns what it needs and does not borrow the codec, so it can be held across an await. Requests on one codec complete in the order they were made.
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