enum DecoderError {
Show 15 variants
CorruptRleData,
BitfieldMaskNonContiguous,
BitfieldMaskInvalid,
BitfieldMaskMissing(u32),
BitfieldMasksMissing(u32),
BmpSignatureInvalid,
MoreThanOnePlane,
InvalidChannelWidth(ChannelWidthError, u16),
NegativeWidth(i32),
ImageTooLarge(i32, i32),
InvalidHeight,
ImageTypeInvalidForTopDown(u32),
ImageTypeUnknown(u32),
HeaderTooSmall(u32),
PaletteSizeExceeded {
colors_used: u32,
bit_count: u16,
},
}
Expand description
All errors that can occur when attempting to parse a BMP
Variants§
CorruptRleData
BitfieldMaskNonContiguous
The bitfield mask interleaves set and unset bits
BitfieldMaskInvalid
Bitfield mask invalid (e.g. too long for specified type)
BitfieldMaskMissing(u32)
Bitfield (of the specified width – 16- or 32-bit) mask not present
BitfieldMasksMissing(u32)
Bitfield (of the specified width – 16- or 32-bit) masks not present
BmpSignatureInvalid
BMP’s “BM” signature wrong or missing
MoreThanOnePlane
More than the exactly one allowed plane specified by the format
InvalidChannelWidth(ChannelWidthError, u16)
Invalid amount of bits per channel for the specified image type
NegativeWidth(i32)
The width is negative
ImageTooLarge(i32, i32)
One of the dimensions is larger than a soft limit
InvalidHeight
The height is i32::min_value()
General negative heights specify top-down DIBs
ImageTypeInvalidForTopDown(u32)
Specified image type is invalid for top-down BMPs (i.e. is compressed)
ImageTypeUnknown(u32)
Image type not currently recognized by the decoder
HeaderTooSmall(u32)
Bitmap header smaller than the core header
PaletteSizeExceeded
The palette is bigger than allowed by the bit count of the BMP
Trait Implementations§
source§impl Clone for DecoderError
impl Clone for DecoderError
source§fn clone(&self) -> DecoderError
fn clone(&self) -> DecoderError
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for DecoderError
impl Debug for DecoderError
source§impl Display for DecoderError
impl Display for DecoderError
source§impl Error for DecoderError
impl Error for DecoderError
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
source§impl From<DecoderError> for ImageError
impl From<DecoderError> for ImageError
source§fn from(e: DecoderError) -> ImageError
fn from(e: DecoderError) -> ImageError
source§impl Hash for DecoderError
impl Hash for DecoderError
source§impl Ord for DecoderError
impl Ord for DecoderError
source§fn cmp(&self, other: &DecoderError) -> Ordering
fn cmp(&self, other: &DecoderError) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for DecoderError
impl PartialEq for DecoderError
source§impl PartialOrd for DecoderError
impl PartialOrd for DecoderError
impl Copy for DecoderError
impl Eq for DecoderError
impl StructuralPartialEq for DecoderError
Auto Trait Implementations§
impl Freeze for DecoderError
impl RefUnwindSafe for DecoderError
impl Send for DecoderError
impl Sync for DecoderError
impl Unpin for DecoderError
impl UnwindSafe for DecoderError
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more