#[non_exhaustive]pub enum ConvertError {
Show 13 variants
NoMatch {
source: PixelDescriptor,
},
NoPath {
from: PixelDescriptor,
to: PixelDescriptor,
},
BufferSize {
expected: usize,
actual: usize,
},
InvalidWidth(u32),
EmptyFormatList,
UnsupportedTransfer {
from: TransferFunction,
to: TransferFunction,
},
AlphaNotOpaque,
DepthReductionForbidden,
AlphaRemovalForbidden,
RgbToGray,
AllocationFailed,
Buffer(BufferError),
CmsError(String),
}Expand description
Errors that can occur during pixel format negotiation or conversion.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NoMatch
No supported format could be found for the source descriptor.
Fields
source: PixelDescriptorNoPath
No conversion path exists between the two formats.
BufferSize
Source and destination buffer sizes don’t match the expected dimensions.
InvalidWidth(u32)
Width is zero or would overflow stride calculations.
EmptyFormatList
The supported format list was empty.
UnsupportedTransfer
Conversion between these transfer functions is not yet supported.
AlphaNotOpaque
Alpha channel is not fully opaque and AlphaPolicy::DiscardIfOpaque was set.
DepthReductionForbidden
Depth reduction was requested but DepthPolicy::Forbid was set.
AlphaRemovalForbidden
Alpha removal was requested but AlphaPolicy::Forbid was set.
RgbToGray
RGB-to-grayscale conversion requires explicit luma coefficients.
AllocationFailed
Buffer allocation failed.
Buffer(BufferError)
A pixel buffer or slice could not be constructed: carries the real
zenpixels::BufferError cause (StrideTooSmall, InvalidDimensions,
…) instead of collapsing it into AllocationFailed.
CmsError(String)
CMS transform could not be built (invalid ICC profile, unsupported color space, etc.).
Trait Implementations§
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 moreSource§impl Debug for ConvertError
impl Debug for ConvertError
Source§impl Display for ConvertError
impl Display for ConvertError
Source§impl Error for ConvertError
Available on crate feature std only.
impl Error for ConvertError
std only.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()
Source§impl From<BufferError> for ConvertError
impl From<BufferError> for ConvertError
Source§fn from(err: BufferError) -> Self
fn from(err: BufferError) -> Self
Wrap a buffer-construction failure’s real cause into
ConvertError::Buffer. Pair with map_err_at at the call sites so the
At location trace is preserved alongside the classified cause.
Source§impl PartialEq for ConvertError
impl PartialEq for ConvertError
Source§fn eq(&self, other: &ConvertError) -> bool
fn eq(&self, other: &ConvertError) -> bool
self and other values to be equal, and is used by ==.