pub struct GifDecoder { /* private fields */ }Expand description
GIF decoder for reading GIF89a files.
Supports:
- Single images and animations
- Transparency
- Interlaced images
- Global and local color tables
Implementations§
Source§impl GifDecoder
impl GifDecoder
Sourcepub fn new(data: &[u8]) -> CodecResult<Self>
pub fn new(data: &[u8]) -> CodecResult<Self>
Sourcepub fn frame_count(&self) -> usize
pub fn frame_count(&self) -> usize
Get number of frames.
Sourcepub fn loop_count(&self) -> u16
pub fn loop_count(&self) -> u16
Get loop count (0 = infinite).
Sourcepub fn screen_descriptor(&self) -> &LogicalScreenDescriptor
pub fn screen_descriptor(&self) -> &LogicalScreenDescriptor
Get the logical screen descriptor.
Sourcepub fn global_color_table(&self) -> &[u8] ⓘ
pub fn global_color_table(&self) -> &[u8] ⓘ
Get the global color table.
Sourcepub fn frame_info(&self, index: usize) -> CodecResult<&GifFrame>
pub fn frame_info(&self, index: usize) -> CodecResult<&GifFrame>
Sourcepub fn decode_frame(&self, index: usize) -> CodecResult<VideoFrame>
pub fn decode_frame(&self, index: usize) -> CodecResult<VideoFrame>
Sourcepub fn decode_all_frames(&self) -> CodecResult<Vec<VideoFrame>>
pub fn decode_all_frames(&self) -> CodecResult<Vec<VideoFrame>>
Sourcepub fn frame_delay_ms(&self, index: usize) -> CodecResult<u32>
pub fn frame_delay_ms(&self, index: usize) -> CodecResult<u32>
Sourcepub fn frame_has_transparency(&self, index: usize) -> CodecResult<bool>
pub fn frame_has_transparency(&self, index: usize) -> CodecResult<bool>
Sourcepub fn frame_disposal_method(&self, index: usize) -> CodecResult<DisposalMethod>
pub fn frame_disposal_method(&self, index: usize) -> CodecResult<DisposalMethod>
Sourcepub fn is_animated(&self) -> bool
pub fn is_animated(&self) -> bool
Check if this is an animated GIF.
Sourcepub fn total_duration_ms(&self) -> u32
pub fn total_duration_ms(&self) -> u32
Get total animation duration in milliseconds.
Auto Trait Implementations§
impl Freeze 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