pub struct GifDecoder { /* private fields */ }Available on crate feature
gif only.Expand description
Indexed GIF reader with lazy or eager frame decoding.
Call Self::open to parse the container, then Self::decode_frame /
Self::decode_all. Random access to frame i decodes 0..=i in order so
disposal state stays correct.
Implementations§
Source§impl GifDecoder
impl GifDecoder
Sourcepub fn open(bytes: &[u8]) -> Result<Self, GifError>
pub fn open(bytes: &[u8]) -> Result<Self, GifError>
Parses the header and indexes image data. A missing final trailer is accepted when all preceding blocks are complete.
Sourcepub fn frame_count(&self) -> usize
pub fn frame_count(&self) -> usize
Frames in the file.
Sourcepub fn frame_meta(&self, i: usize) -> Result<&GifFrameMeta, GifError>
pub fn frame_meta(&self, i: usize) -> Result<&GifFrameMeta, GifError>
Frame i’s descriptor, without decoding it.
Auto Trait Implementations§
impl Forget for GifDecoder
impl Freeze for GifDecoder
impl Move for GifDecoder
impl RefUnwindSafe for GifDecoder
impl Send for GifDecoder
impl Sync for GifDecoder
impl Unpin for GifDecoder
impl UnsafeUnpin for GifDecoder
impl UnwindSafe for GifDecoder
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more