#[non_exhaustive]pub enum BufferError {
Show 13 variants
InvalidFormat(ColorError),
InvalidLayout(LayoutError),
AlignmentViolation,
InsufficientData,
StrideTooSmall,
StrideNotPixelAligned,
InvalidDimensions,
OutOfBounds,
IncompatibleLayout,
InteropUnsupported,
AllocationFailed,
InvalidGainMapMetadata,
UnverifiedOpaqueAlpha,
}Expand description
Errors returned by pixel buffer, view, band, and plane operations.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidFormat(ColorError)
Image specification failed validation.
InvalidLayout(LayoutError)
Layout or stride calculation error.
AlignmentViolation
Base pointer or row stride does not satisfy the sample or pixel alignment.
InsufficientData
Provided byte or pixel slice is shorter than required for (width, height, stride).
StrideTooSmall
Row stride is smaller than width * bytes_per_pixel.
StrideNotPixelAligned
Stride is not a whole multiple of size_of::<P>() for a pixel-strided API (e.g. imgref).
InvalidDimensions
Zero dimension or arithmetic overflow.
OutOfBounds
Requested crop, band, or plane index is out of bounds.
IncompatibleLayout
Typed element size does not divide the active row or buffer extent cleanly.
InteropUnsupported
Spec does not satisfy the requested InteropTarget’s zero-copy contract.
AllocationFailed
Heap allocation failed (OOM or allocation layout overflow).
InvalidGainMapMetadata
ISO 21496-1 gain-map metadata failed invariant validation (gamma == 0, min > max,
equal headrooms, or contradictory backward_direction).
UnverifiedOpaqueAlpha
Buffer declares or requested AlphaMode::Opaque without verified channel-maximum alpha
(for example PixelBuf::new_raw_zeroed with AlphaMode::Opaque, or into_opaque_verified
encountering a non-maximum alpha sample).
Trait Implementations§
Source§impl Clone for BufferError
impl Clone for BufferError
Source§fn clone(&self) -> BufferError
fn clone(&self) -> BufferError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for BufferError
Source§impl Debug for BufferError
impl Debug for BufferError
Source§impl Display for BufferError
impl Display for BufferError
impl Eq for BufferError
Source§impl Error for BufferError
impl Error for BufferError
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()