pub struct DecodeOptions { /* private fields */ }
Expand description

Options for opening a GIF decoder.

Implementations

Creates a new decoder builder

Configure how color data is decoded.

Configure a memory limit for decoding.

Configure if frames must be within the screen descriptor.

The default is false.

When turned on, all frame descriptors being read must fit within the screen descriptor or otherwise an error is returned and the stream left in an unspecified state.

When turned off, frames may be arbitrarily larger or offset in relation to the screen. Many other decoder libraries handle this in highly divergent ways. This moves all checks to the caller, for example to emulate a specific style.

Configure if LZW encoded blocks must end with a marker end code.

The default is false.

When turned on, all image data blocks—which are LZW encoded—must contain a special bit sequence signalling the end of the data. LZW processing terminates when this code is encountered. The specification states that it must be the last code output by the encoder for an image.

When turned off then image data blocks can simply end. Note that this might silently ignore some bits of the last or second to last byte.

Configure if unknown blocks are allowed to be decoded.

The default is false.

When turned on, the decoder will allow unknown blocks to be in the BlockStart position.

When turned off, decoded block starts must mark an Image, Extension, or Trailer block. Otherwise, the decoded image will return an error. If an unknown block error is returned from decoding, enabling this setting may allow for a further state of decoding on the next attempt.

Reads the logical screen descriptor including the global color palette

Returns a Decoder. All decoder configuration has to be done beforehand.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.