pub struct Decoder<R: Read> { /* private fields */ }Expand description
GIF file decoder
Can be converted to one of three Iterators:
- into_iter / into_steps for high-level Steps
- into_frames for mid-level Frames
- into_blocks for low-level Blocks
§Example: Get a Raster from a GIF
use gift::Decoder;
// ... open a `File` as "gif"
if let Some(step) = Decoder::new(gif).into_steps().next() {
// was there a decoding error?
let step = step?;
let raster = step.raster();
// ... work with raster
}Implementations§
Source§impl<R: Read> Decoder<R>
impl<R: Read> Decoder<R>
Sourcepub fn max_image_sz(self, max_image_sz: Option<usize>) -> Self
pub fn max_image_sz(self, max_image_sz: Option<usize>) -> Self
Set the maximum image size (in bytes) to allow for decoding.
Sourcepub fn into_blocks(self) -> Blocks<R> ⓘ
pub fn into_blocks(self) -> Blocks<R> ⓘ
Convert into a block Iterator.
Sourcepub fn into_frames(self) -> Frames<R> ⓘ
pub fn into_frames(self) -> Frames<R> ⓘ
Convert into a frame Iterator.
Sourcepub fn into_steps(self) -> Steps<R> ⓘ
pub fn into_steps(self) -> Steps<R> ⓘ
Convert into a step Iterator without looping.
Trait Implementations§
Auto Trait Implementations§
impl<R> Freeze for Decoder<R>where
R: Freeze,
impl<R> RefUnwindSafe for Decoder<R>where
R: RefUnwindSafe,
impl<R> Send for Decoder<R>where
R: Send,
impl<R> Sync for Decoder<R>where
R: Sync,
impl<R> Unpin for Decoder<R>where
R: Unpin,
impl<R> UnwindSafe for Decoder<R>where
R: UnwindSafe,
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