[][src]Enum image::flat::Error

pub enum Error {
    TooLarge,
    NormalFormRequired(NormalForm),
    WrongColor(ColorType),
}

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

WrongColor(ColorType)

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 Rgba image but have only 3 bytes per pixel and for some reason don't care about the value of the alpha channel even though you need Rgba.

Trait Implementations

impl Clone for Error[src]

impl Copy for Error[src]

impl Debug for Error[src]

impl Eq for Error[src]

impl From<Error> for ImageError[src]

impl Hash for Error[src]

impl PartialEq<Error> for Error[src]

impl StructuralEq for Error[src]

impl StructuralPartialEq for Error[src]

Auto Trait Implementations

impl RefUnwindSafe for Error

impl Send for Error

impl Sync for Error

impl Unpin for Error

impl UnwindSafe for Error

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SetParameter for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.