Struct StreamingDecoder

pub struct StreamingDecoder { /* private fields */ }

GIF decoder which emits low-level events for items in the GIF file

To just get GIF frames, use crate::Decoder instead.

Implementations

impl StreamingDecoder

fn new() -> Self

Creates a new streaming decoder

fn update(&mut self, buf: &[u8], write_into: &mut OutputBuffer<'_>) -> Result<(usize, Decoded), DecodingError>

Updates the internal state of the decoder.

Returns the number of bytes consumed from the input buffer and the last decoding result.

fn last_ext_sub_block(&mut self) -> &[u8]

Data of the last extension sub block that has been decoded. You need to concatenate all subblocks together to get the overall block content.

fn current_frame_mut(&mut self) -> &mut Frame<'static>

Current frame info as a mutable ref.

fn current_frame(&self) -> &Frame<'static>

Current frame info as a ref.

fn width(&self) -> u16

Width of the image

fn height(&self) -> u16

Height of the image

fn version(&self) -> Version

The version number of the GIF standard used in this image.

We suppose a minimum of V87a compatibility. This value will be reported until we have read the version information in the magic header bytes.

Auto Trait Implementations

impl !RefUnwindSafe for StreamingDecoder

impl !Sync for StreamingDecoder

impl !UnwindSafe for StreamingDecoder

impl Freeze for StreamingDecoder

impl Send for StreamingDecoder

impl Unpin for StreamingDecoder

impl UnsafeUnpin for StreamingDecoder

Blanket Implementations

impl<T> Any for StreamingDecoder where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for StreamingDecoder where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for StreamingDecoder where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> From<T> for StreamingDecoder

fn from(t: T) -> T

Returns the argument unchanged.

impl<T, U> Into<U> for StreamingDecoder where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for StreamingDecoder where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for StreamingDecoder where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>