pub enum ConvertError {
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,
CmsError(String),
}Expand description
Errors that can occur during pixel format negotiation or conversion.
Variants§
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.
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 · 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()