pub enum ImageRegionError {
InvalidDimensions,
OutOfBounds,
InvalidStride,
LayoutOverflow,
SourceTooShort {
required: usize,
actual: usize,
},
}Expand description
Invalid input to a checked framebuffer color-region operation.
Errors leave the destination’s colors and depths unchanged.
use ferravex_graphics::Framebuffer;
let mut atlas = Framebuffer::new(4, 4).unwrap();
let error = atlas.blit_rgba(0, 0, 2, 2, &[[255; 4]; 3], 2).unwrap_err();
assert_eq!(error.to_string(), "image region needs 4 source pixels, but only 3 are available");
let _: &dyn std::error::Error = &error;Variants§
InvalidDimensions
Width or height is zero or exceeds framebuffer allocation limits.
OutOfBounds
The entire region must fit within the framebuffer; clipping is not performed.
InvalidStride
The source row stride, measured in RGBA pixels, is smaller than the region width.
LayoutOverflow
The source layout’s last-row end cannot be represented by usize.
SourceTooShort
The source slice does not reach the end of the final copied row.
Trait Implementations§
Source§impl Clone for ImageRegionError
impl Clone for ImageRegionError
Source§fn clone(&self) -> ImageRegionError
fn clone(&self) -> ImageRegionError
Returns a duplicate of the value. Read more
1.0.0 · 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 ImageRegionError
impl Debug for ImageRegionError
Source§impl Display for ImageRegionError
impl Display for ImageRegionError
Source§impl Error for ImageRegionError
impl Error for ImageRegionError
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 ImageRegionError
impl PartialEq for ImageRegionError
impl Copy for ImageRegionError
impl Eq for ImageRegionError
impl StructuralPartialEq for ImageRegionError
Auto Trait Implementations§
impl Freeze for ImageRegionError
impl RefUnwindSafe for ImageRegionError
impl Send for ImageRegionError
impl Sync for ImageRegionError
impl Unpin for ImageRegionError
impl UnwindSafe for ImageRegionError
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