#[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
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.
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
impl AsStopReason for ConvertError
Source§fn as_stop_reason(&self) -> Option<StopReason>
fn as_stop_reason(&self) -> Option<StopReason>
StopReason this error represents, or None for any other
failure.Source§impl Clone for ConvertError
impl Clone for ConvertError
Source§fn clone(&self) -> ConvertError
fn clone(&self) -> ConvertError
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 ConvertError
Source§impl Debug for ConvertError
impl Debug for ConvertError
Source§impl Display for ConvertError
impl Display for ConvertError
impl Eq for ConvertError
Source§impl Error for ConvertError
impl Error for ConvertError
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()