Struct gif::DecodeOptions
source · [−]pub struct DecodeOptions { /* private fields */ }
Expand description
Options for opening a GIF decoder.
Implementations
sourceimpl DecodeOptions
impl DecodeOptions
sourcepub fn new() -> DecodeOptions
pub fn new() -> DecodeOptions
Creates a new decoder builder
sourcepub fn set_color_output(&mut self, color: ColorOutput)
pub fn set_color_output(&mut self, color: ColorOutput)
Configure how color data is decoded.
sourcepub fn set_memory_limit(&mut self, limit: MemoryLimit)
pub fn set_memory_limit(&mut self, limit: MemoryLimit)
Configure a memory limit for decoding.
sourcepub fn check_frame_consistency(&mut self, check: bool)
pub fn check_frame_consistency(&mut self, check: bool)
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.
sourcepub fn check_lzw_end_code(&mut self, check: bool)
pub fn check_lzw_end_code(&mut self, check: bool)
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.
sourcepub fn allow_unknown_blocks(&mut self, check: bool)
pub fn allow_unknown_blocks(&mut self, check: bool)
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.
Trait Implementations
sourceimpl Clone for DecodeOptions
impl Clone for DecodeOptions
sourcefn clone(&self) -> DecodeOptions
fn clone(&self) -> DecodeOptions
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl RefUnwindSafe for DecodeOptions
impl Send for DecodeOptions
impl Sync for DecodeOptions
impl Unpin for DecodeOptions
impl UnwindSafe for DecodeOptions
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more