pub enum DecodeError {
Eof(BitReaderEof),
Prefix(PrefixError),
GreenSymbolOutOfRange {
symbol: usize,
alphabet_size: usize,
},
ColorCacheIndexOutOfRange {
index: usize,
cache_size: usize,
},
BackwardReferenceUnderflow {
position: usize,
distance: usize,
},
BackwardReferenceOverflow {
position: usize,
length: usize,
total_pixels: usize,
},
MetaPrefix(MetaPrefixError),
EmptyEntropyImage {
prefix_image_width: u32,
prefix_image_height: u32,
},
MetaPrefixIndexOutOfRange {
meta_prefix_code: usize,
num_prefix_groups: usize,
},
DuplicateTransform,
}Expand description
Errors raised while decoding the §5.2 per-pixel ARGB stream.
Variants§
Eof(BitReaderEof)
The bit reader hit EOF mid-symbol or mid-extra-bits.
Prefix(PrefixError)
A prefix-code symbol read failed.
GreenSymbolOutOfRange
§6.2.3: the GREEN symbol S was at or beyond the alphabet size
256 + 24 + color_cache_size.
ColorCacheIndexOutOfRange
§5.2.3: a color-cache code resolved to an index outside the cache, or a color-cache code was read for a stream with no color cache.
Fields
BackwardReferenceUnderflow
§5.2.2: a backward-reference copy reached back beyond the start of the already-decoded pixels.
Fields
BackwardReferenceOverflow
§5.2.2: a backward-reference run would write past the end of the image (more pixels than remain).
Fields
MetaPrefix(MetaPrefixError)
§5.2.3 / §6.2.2: reading the color-cache info, meta-prefix bit, the entropy-image header, or one of the per-group prefix-code groups failed.
EmptyEntropyImage
§6.2.2: the entropy image’s prefix_image_width /
prefix_image_height were zero (a degenerate header that yields
no blocks to select groups for).
Fields
MetaPrefixIndexOutOfRange
§6.2.2: a pixel’s block selected a meta-prefix code at or beyond
num_prefix_groups — i.e. an index larger than the maximum the
entropy image was supposed to contain. This can only arise from a
logic error in the caller, but is checked rather than panicking.
Fields
DuplicateTransform
§4 / §7.2: a transform type appeared more than once in the
optional-transform list. The spec mandates each transform is
used at most once.
Trait Implementations§
Source§impl Clone for DecodeError
impl Clone for DecodeError
Source§fn clone(&self) -> DecodeError
fn clone(&self) -> DecodeError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DecodeError
impl Debug for DecodeError
Source§impl Display for DecodeError
impl Display for DecodeError
impl Eq for DecodeError
Source§impl Error for DecodeError
impl Error for DecodeError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<BitReaderEof> for DecodeError
impl From<BitReaderEof> for DecodeError
Source§fn from(e: BitReaderEof) -> Self
fn from(e: BitReaderEof) -> Self
Source§impl From<DecodeError> for AlphError
impl From<DecodeError> for AlphError
Source§fn from(e: DecodeError) -> Self
fn from(e: DecodeError) -> Self
Source§impl From<DecodeError> for Error
impl From<DecodeError> for Error
Source§fn from(e: DecodeError) -> Self
fn from(e: DecodeError) -> Self
Source§impl From<MetaPrefixError> for DecodeError
impl From<MetaPrefixError> for DecodeError
Source§fn from(e: MetaPrefixError) -> Self
fn from(e: MetaPrefixError) -> Self
Source§impl From<PrefixError> for DecodeError
impl From<PrefixError> for DecodeError
Source§fn from(e: PrefixError) -> Self
fn from(e: PrefixError) -> Self
Source§impl PartialEq for DecodeError
impl PartialEq for DecodeError
Source§fn eq(&self, other: &DecodeError) -> bool
fn eq(&self, other: &DecodeError) -> bool
self and other values to be equal, and is used by ==.