Enum Error
pub enum Error
Denotes invalid flat sample buffers when trying to convert to stricter types.
The biggest use case being ImageBuffer which expects closely packed
samples in a row major matrix representation. But this error type may be
reused for other import functions. A more versatile user may also try to
correct the underlying representation depending on the error variant.
Variants
-
TooLarge The represented image was too large.
The optional value denotes a possibly accepted maximal bound.
-
NormalFormRequired(NormalForm) The represented image can not use this representation.
Has an additional value of the normalized form that would be accepted.
-
ChannelCountMismatch(u8, u8) The color format did not match the channel count.
In some cases you might be able to fix this by lowering the reported pixel count of the buffer without touching the strides.
In very special circumstances you may do the opposite. This is VERY dangerous but not directly memory unsafe although that will likely alias pixels. One scenario is when you want to construct an
Rgbaimage but have only 3 bytes per pixel and for some reason don't care about the value of the alpha channel even though you needRgba.-
WrongColor(ColorType) Deprecated -
ChannelCountMismatchis used instead
Trait Implementations
impl Clone for Error
fn clone(&self) -> Self
impl Copy for Error
impl Debug for Error
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Display for Error
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Eq for Error
impl Error for Error
impl Hash for Error
fn hash<__H: Hasher>(&self, state: &mut __H)
impl PartialEq for Error
fn eq(&self, other: &Self) -> bool