pub enum ImageError {
ZeroChannels,
DimensionOverflow,
StorageTooShort {
required: usize,
found: usize,
},
InvalidStride {
stride: usize,
minimum: usize,
},
InvalidPlaneStride {
stride: usize,
minimum: usize,
},
MetadataChannelMismatch {
color_space: ColorSpace,
expected: usize,
found: usize,
},
InvalidRegion {
x: usize,
y: usize,
region_width: usize,
region_height: usize,
image_width: usize,
image_height: usize,
},
OutOfBounds {
x: usize,
y: usize,
width: usize,
height: usize,
},
}Expand description
Errors raised while constructing or indexing images.
Variants§
ZeroChannels
A zero channel image type was requested.
DimensionOverflow
Image dimensions overflowed usize arithmetic.
StorageTooShort
The provided storage does not match the image layout.
InvalidStride
A row stride cannot hold one row of pixels.
Fields
InvalidPlaneStride
A planar channel stride overlaps the preceding channel plane.
Fields
MetadataChannelMismatch
Color metadata is incompatible with the compile-time channel count.
Fields
§
color_space: ColorSpaceDeclared color space.
InvalidRegion
A requested image region lies outside its parent image.
Fields
OutOfBounds
Pixel coordinates were outside the image.
Trait Implementations§
Source§impl Clone for ImageError
impl Clone for ImageError
Source§fn clone(&self) -> ImageError
fn clone(&self) -> ImageError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ImageError
impl Debug for ImageError
Source§impl Display for ImageError
impl Display for ImageError
Source§impl Error for ImageError
impl Error for ImageError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl PartialEq for ImageError
impl PartialEq for ImageError
Source§fn eq(&self, other: &ImageError) -> bool
fn eq(&self, other: &ImageError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for ImageError
impl StructuralPartialEq for ImageError
Auto Trait Implementations§
impl Freeze for ImageError
impl RefUnwindSafe for ImageError
impl Send for ImageError
impl Sync for ImageError
impl Unpin for ImageError
impl UnsafeUnpin for ImageError
impl UnwindSafe for ImageError
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
Mutably borrows from an owned value. Read more