#[non_exhaustive]pub enum J2kError {
Show 23 variants
Buffer(BufferError),
Input(InputError),
NotImplemented(NotImplemented),
Unsupported(Unsupported),
Backend(BackendError),
NativeDecode {
context: &'static str,
source: NativeBackendError,
},
NativeValidation {
context: &'static str,
source: NativeBackendError,
},
NativeEncode {
context: &'static str,
source: NativeBackendError,
},
NativeResidentEncode {
context: &'static str,
source: NativeBackendError,
},
CodestreamHeader {
context: &'static str,
source: NativeBackendError,
},
BackendComponentPlaneTooShort {
component: usize,
samples: usize,
expected: usize,
},
InvalidIccProfile,
InternalInvariant {
what: &'static str,
},
InvalidSamples {
what: String,
},
RateTargetUnreachable {
target: String,
best: String,
},
InvalidRegion {
x: u32,
y: u32,
w: u32,
h: u32,
image_w: u32,
image_h: u32,
},
InvalidBox {
offset: usize,
what: &'static str,
},
MissingRequiredBox {
box_type: &'static str,
},
InvalidMarker {
offset: usize,
marker: u8,
},
MissingRequiredMarker {
marker: &'static str,
},
InvalidSiz {
what: &'static str,
},
InvalidCod {
what: &'static str,
},
DimensionOverflow {
width: u32,
height: u32,
},
}Expand description
Error returned by JPEG 2000 inspect, decode, encode, and recode APIs.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Buffer(BufferError)
Caller-owned buffers were too small or malformed.
Input(InputError)
Input was too short or truncated while parsing.
NotImplemented(NotImplemented)
Requested feature is planned but not implemented.
Unsupported(Unsupported)
Requested input feature or option is unsupported.
Backend(BackendError)
Native backend, accelerator adapter, or backend-output validation failed.
NativeDecode
Heap-free native decoder failure with stable operation context.
Fields
source: NativeBackendErrorStructured native decoder failure.
NativeValidation
Native decoder failure while validating generated encoder output.
The structured source is retained for diagnostics, but this phase is deliberately not classified as truncated caller input or an unsupported caller request.
Fields
source: NativeBackendErrorStructured native decoder failure.
NativeEncode
Typed native encoder failure with stable operation context.
Fields
source: NativeBackendErrorStructured native encoder failure.
NativeResidentEncode
Native resident-encode failure not represented by the shared encoder taxonomy.
Current native variants map to the narrower facade categories above. This source-preserving fallback keeps future variants of the non-exhaustive resident boundary from being reduced to display text.
Fields
source: NativeBackendErrorStructured resident-boundary failure.
CodestreamHeader
Heap-free codestream-header inspection failure.
Fields
source: NativeBackendErrorStructured header parser failure.
BackendComponentPlaneTooShort
A native component plane was shorter than its declared image geometry.
Fields
InvalidIccProfile
The primary JP2 restricted ICC profile is malformed.
InternalInvariant
A facade/cache invariant failed with a static diagnostic.
InvalidSamples
Caller-provided encode samples were malformed.
RateTargetUnreachable
Lossy rate-control search could not satisfy the requested target.
Fields
InvalidRegion
Requested region lies outside image bounds.
Fields
InvalidBox
JP2 box structure was invalid.
Fields
MissingRequiredBox
Required JP2 box was absent.
InvalidMarker
Codestream marker was invalid.
Fields
MissingRequiredMarker
Required codestream marker was absent.
InvalidSiz
SIZ segment was invalid.
InvalidCod
COD segment was invalid.
DimensionOverflow
Image dimensions overflowed a size computation.
Trait Implementations§
impl Eq for J2kError
Source§impl Error for J2kError
impl Error for J2kError
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<BackendError> for J2kError
impl From<BackendError> for J2kError
Source§fn from(source: BackendError) -> Self
fn from(source: BackendError) -> Self
Source§impl From<BufferError> for J2kError
impl From<BufferError> for J2kError
Source§fn from(source: BufferError) -> Self
fn from(source: BufferError) -> Self
Source§impl From<InputError> for J2kError
impl From<InputError> for J2kError
Source§fn from(source: InputError) -> Self
fn from(source: InputError) -> Self
Source§impl From<NotImplemented> for J2kError
impl From<NotImplemented> for J2kError
Source§fn from(source: NotImplemented) -> Self
fn from(source: NotImplemented) -> Self
Source§impl From<Unsupported> for J2kError
impl From<Unsupported> for J2kError
Source§fn from(source: Unsupported) -> Self
fn from(source: Unsupported) -> Self
impl StructuralPartialEq for J2kError
Auto Trait Implementations§
impl !RefUnwindSafe for J2kError
impl !UnwindSafe for J2kError
impl Freeze for J2kError
impl Send for J2kError
impl Sync for J2kError
impl Unpin for J2kError
impl UnsafeUnpin for J2kError
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> 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