Struct gif::Decoder [−][src]
pub struct Decoder<R: Read> { /* fields omitted */ }
GIF decoder
Implementations
impl<R> Decoder<R> where
R: Read,
[src]
impl<R> Decoder<R> where
R: Read,
[src]pub fn new(reader: R) -> Result<Self, DecodingError>
[src]
Create a new decoder with default options.
pub fn build() -> DecodeOptions
[src]
Return a builder that allows configuring limits etc.
pub fn next_frame_info(
&mut self
) -> Result<Option<&Frame<'static>>, DecodingError>
[src]
&mut self
) -> Result<Option<&Frame<'static>>, DecodingError>
Returns the next frame info
pub fn read_next_frame(
&mut self
) -> Result<Option<&Frame<'static>>, DecodingError>
[src]
&mut self
) -> Result<Option<&Frame<'static>>, DecodingError>
Reads the next frame from the image.
Do not call Self::next_frame_info
beforehand.
Deinterlaces the result.
pub fn read_into_buffer(&mut self, buf: &mut [u8]) -> Result<(), DecodingError>
[src]
Reads the data of the current frame into a pre-allocated buffer.
Self::next_frame_info
needs to be called beforehand.
The length of buf
must be at least Self::buffer_size
.
Deinterlaces the result.
pub fn fill_buffer(&mut self, buf: &mut [u8]) -> Result<bool, DecodingError>
[src]
Reads data of the current frame into a pre-allocated buffer until the buffer has been filled completely.
Self::next_frame_info
needs to be called beforehand. Returns true
if the supplied
buffer could be filled completely. Should not be called after false
had been returned.
pub fn buffer_size(&self) -> usize
[src]
Output buffer size
pub fn line_length(&self) -> usize
[src]
Line length of the current frame
pub fn palette(&self) -> Result<&[u8], DecodingError>
[src]
Returns the color palette relevant for the current (next) frame
pub fn global_palette(&self) -> Option<&[u8]>
[src]
The global color palette
pub fn width(&self) -> u16
[src]
Width of the image
pub fn height(&self) -> u16
[src]
Height of the image
pub fn bg_color(&self) -> Option<usize>
[src]
Index of the background color in the global palette
Auto Trait Implementations
impl<R> !RefUnwindSafe for Decoder<R>
impl<R> Send for Decoder<R> where
R: Send,
R: Send,
impl<R> !Sync for Decoder<R>
impl<R> Unpin for Decoder<R> where
R: Unpin,
R: Unpin,