Skip to main content

J2kError

Enum J2kError 

Source
#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

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

§context: &'static str

Decode operation that failed.

§source: NativeBackendError

Structured 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

§context: &'static str

Validation operation that failed.

§source: NativeBackendError

Structured native decoder failure.

§

NativeEncode

Typed native encoder failure with stable operation context.

Fields

§context: &'static str

Encode operation that failed.

§source: NativeBackendError

Structured 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

§context: &'static str

Resident encode operation that failed.

§source: NativeBackendError

Structured resident-boundary failure.

§

CodestreamHeader

Heap-free codestream-header inspection failure.

Fields

§context: &'static str

Header operation that failed.

§source: NativeBackendError

Structured header parser failure.

§

BackendComponentPlaneTooShort

A native component plane was shorter than its declared image geometry.

Fields

§component: usize

Zero-based component index.

§samples: usize

Samples actually returned by the backend.

§expected: usize

Minimum samples required by the output geometry.

§

InvalidIccProfile

The primary JP2 restricted ICC profile is malformed.

§

InternalInvariant

A facade/cache invariant failed with a static diagnostic.

Fields

§what: &'static str

Stable description of the violated invariant.

§

InvalidSamples

Caller-provided encode samples were malformed.

Fields

§what: String

Description of the invalid sample condition.

§

RateTargetUnreachable

Lossy rate-control search could not satisfy the requested target.

Fields

§target: String

Requested rate target.

§best: String

Best achievable result observed by the search.

§

InvalidRegion

Requested region lies outside image bounds.

Fields

§x: u32

Region left coordinate.

§y: u32

Region top coordinate.

§w: u32

Region width.

§h: u32

Region height.

§image_w: u32

Image width.

§image_h: u32

Image height.

§

InvalidBox

JP2 box structure was invalid.

Fields

§offset: usize

Byte offset of the invalid box.

§what: &'static str

Description of the invalid box condition.

§

MissingRequiredBox

Required JP2 box was absent.

Fields

§box_type: &'static str

Missing box type.

§

InvalidMarker

Codestream marker was invalid.

Fields

§offset: usize

Byte offset of the invalid marker.

§marker: u8

Marker byte following the 0xFF prefix.

§

MissingRequiredMarker

Required codestream marker was absent.

Fields

§marker: &'static str

Missing marker name.

§

InvalidSiz

SIZ segment was invalid.

Fields

§what: &'static str

Description of the invalid SIZ condition.

§

InvalidCod

COD segment was invalid.

Fields

§what: &'static str

Description of the invalid COD condition.

§

DimensionOverflow

Image dimensions overflowed a size computation.

Fields

§width: u32

Image width.

§height: u32

Image height.

Trait Implementations§

Source§

impl Debug for J2kError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for J2kError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for J2kError

Source§

impl Error for J2kError

Source§

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

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<BackendError> for J2kError

Source§

fn from(source: BackendError) -> Self

Converts to this type from the input type.
Source§

impl From<BufferError> for J2kError

Source§

fn from(source: BufferError) -> Self

Converts to this type from the input type.
Source§

impl From<InputError> for J2kError

Source§

fn from(source: InputError) -> Self

Converts to this type from the input type.
Source§

impl From<NotImplemented> for J2kError

Source§

fn from(source: NotImplemented) -> Self

Converts to this type from the input type.
Source§

impl From<Unsupported> for J2kError

Source§

fn from(source: Unsupported) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for J2kError

Source§

fn eq(&self, other: &J2kError) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for J2kError

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(_simd: S, value: T) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.