Struct gif::Reader [] [src]

pub struct Reader<R: Read> {
    // some fields omitted
}

GIF decoder

Methods

impl<R> Reader<R> where R: Read
[src]

fn next_frame_info(&mut self) -> Result<Option<&Frame<'static>>, DecodingError>

Returns the next frame info

fn read_next_frame(&mut self) -> Result<Option<&Frame<'static>>, DecodingError>

Reads the next frame from the image.

Do not call Self::next_frame_info beforehand.

fn fill_buffer(&mut self, buf: &mut [u8]) -> Result<boolDecodingError>

Reads data of the current frame into a pre-allocated buffer.

Self::next_frame_info needs to be called beforehand. The returned boolean indicates whether more data is available in the current frame. Should not be called after a false had been returned.

fn buffer_size(&self) -> usize

Output buffer size

fn line_length(&self) -> usize

Line length of the current frame

fn palette(&self) -> Result<&[u8]DecodingError>

Returns the color palette relevant for the current (next) frame

fn global_palette(&self) -> Option<&[u8]>

The global color palette

fn width(&self) -> u16

Width of the image

fn height(&self) -> u16

Height of the image

fn bg_color(&self) -> Option<usize>

Index of the background color in the global palette