[][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 From<Error> for ImageError[src]

impl PartialEq<Error> for Error[src]

impl Clone for Error[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Eq for Error[src]

impl Copy for Error[src]

impl Debug for Error[src]

impl Hash for Error[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given [Hasher]. Read more

Auto Trait Implementations

impl Send for Error

impl Unpin for Error

impl Sync for Error

impl UnwindSafe for Error

impl RefUnwindSafe for Error

Blanket Implementations

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

impl<T, U> Into<U> for T where
    U: From<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.

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

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

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

impl<T> SetParameter for T[src]

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 
[src]

Sets value as a parameter of self.