[][src]Struct gift::Decoder

pub struct Decoder<R: Read> { /* fields omitted */ }

GIF file decoder

Can be converted to one of three Iterators:

Example: Get a Raster from a GIF

// ... open a `File` as "gif"
if let Some(raster) = gift::Decoder::new(gif).into_iter().next() {
    // was there a decoding error?
    let raster = raster?;
    // ... work with raster
}

Implementations

impl<R: Read> Decoder<BufReader<R>>[src]

pub fn new(reader: R) -> Self[src]

Create a new GIF decoder.

impl<R: Read> Decoder<R>[src]

pub fn new_unbuffered(reader: R) -> Self[src]

Create a new unbuffered GIF decoder.

pub fn max_image_sz(self, max_image_sz: Option<usize>) -> Self[src]

Set the maximum image size (in bytes) to allow for decoding.

pub fn into_blocks(self) -> Blocks<R>[src]

Convert into a block Iterator.

pub fn into_frames(self) -> Frames<R>[src]

Convert into a frame Iterator.

pub fn into_rasters(self) -> Rasters<R>[src]

Convert into a raster Iterator.

Trait Implementations

impl<R: Read> IntoIterator for Decoder<R>[src]

type Item = Result<Raster<SRgba8>, Error>

The type of the elements being iterated over.

type IntoIter = Rasters<R>

Which kind of iterator are we turning this into?

fn into_iter(self) -> Self::IntoIter[src]

Convert into a raster Iterator

Auto Trait Implementations

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.