Skip to main content

ConvertError

Enum ConvertError 

Source
#[non_exhaustive]
pub enum ConvertError {
Show 22 variants InvalidFormat(ColorError), InvalidLayout(LayoutError), Buffer(BufferError), MissingHdrAnchor, HlgRenderingRequired, MissingDeclaredPeak, HdrFeatureRequired, FeatureRequired(&'static str), CmsRequired, DepthReductionForbidden, AlphaLossForbidden, RangeConversionForbidden, GamutLossForbidden, UnsupportedRoute, DimensionMismatch, FullImageMapperNotSupported, ToneMapperFailed, CmsBackendFailed, OutputSignalingUnavailable, OutputSignalingMismatch, AllocationFailed, Cancelled(StopReason),
}
Expand description

Error returned when planning or executing a pixel conversion.

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.
§

InvalidFormat(ColorError)

Underlying PixelFormat validation error.

§

InvalidLayout(LayoutError)

Underlying SampleLayout validation error.

§

Buffer(BufferError)

Underlying pixel buffer geometry, alignment, or allocation error.

§

MissingHdrAnchor

Conversion crosses absolute PQ luminance ↔ relative linear light without a DiffuseWhite anchor.

§

HlgRenderingRequired

Conversion renders HLG into linear/SDR/PQ without explicit HlgRendering conditions.

§

MissingDeclaredPeak

HDR tone mapping requested PeakSource::Declared but no MaxCLL or ST 2086 mastering peak was present.

§

HdrFeatureRequired

HDR transfer (Pq / Hlg) requires enabling the hdr-transfers Cargo feature.

§

FeatureRequired(&'static str)

Requested color space or operator requires an optional Cargo feature (oklab, perceptual, bt2446a, etc.).

§

CmsRequired

Conversion involves an arbitrary ICC profile or CMYK ink space and requires a CmsBackend.

§

DepthReductionForbidden

Destination has lower precision than source while DepthPolicy::Forbid is active.

§

AlphaLossForbidden

Conversion drops non-opaque alpha while AlphaPolicy::Forbid or DiscardIfOpaque (unproven) is active.

§

RangeConversionForbidden

Conversion changes Full ↔ Narrow signal range while RangePolicy::Forbid is active.

§

GamutLossForbidden

Conversion narrows gamut or clips extended values while GamutPolicy::Forbid is active.

§

UnsupportedRoute

Conversion route is not supported (e.g., unknown primaries across a gamut change, or non-standard sample type).

§

DimensionMismatch

Source and destination dimensions or row byte lengths disagree.

§

FullImageMapperNotSupported

Custom ToneMapper declared full_image = true, which is not supported in streaming plans.

§

ToneMapperFailed

Custom ToneMapper failed to prepare for this image context.

§

CmsBackendFailed

CMS backend rejected or failed to execute the transform.

§

OutputSignalingUnavailable

Requested container color signaling (CicpOnly / EmbedIcc) is not available for the destination color space.

§

OutputSignalingMismatch

Requested container color signaling (SameAsOrigin / CustomIcc) contradicts the destination pixels.

§

AllocationFailed

Heap allocation failed.

§

Cancelled(StopReason)

Cooperative cancellation was triggered via enough::Stop or how_far::Pulse.

Trait Implementations§

Source§

impl AsStopReason for ConvertError

Source§

fn as_stop_reason(&self) -> Option<StopReason>

The StopReason this error represents, or None for any other failure.
Source§

impl Clone for ConvertError

Source§

fn clone(&self) -> ConvertError

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ConvertError

Source§

impl Debug for ConvertError

Source§

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

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

impl Display for ConvertError

Source§

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

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

impl Eq for ConvertError

Source§

impl Error for ConvertError

1.30.0 · 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<BufferError> for ConvertError

Source§

fn from(e: BufferError) -> Self

Converts to this type from the input type.
Source§

impl From<ColorError> for ConvertError

Source§

fn from(e: ColorError) -> Self

Converts to this type from the input type.
Source§

impl From<LayoutError> for ConvertError

Source§

fn from(e: LayoutError) -> Self

Converts to this type from the input type.
Source§

impl From<StopReason> for ConvertError

Source§

fn from(r: StopReason) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for ConvertError

Source§

fn eq(&self, other: &ConvertError) -> 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 ConvertError

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<E> ErrorAtExt for E
where E: Error,

§

fn start_at(self) -> At<E>

Wrap this value in At<E> and add the caller’s location. If allocation fails, the error is still wrapped but trace may be empty. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.