[][src]Trait ndarray_vision::format::Decoder

pub trait Decoder<T, C> where
    T: Copy + Clone + FromPrimitive + Num + NumAssignOps + NumCast + PartialOrd + Display + PixelBound,
    C: ColourModel
{ fn decode(&self, bytes: &[u8]) -> Result<Image<T, C>>; fn decode_file<P: AsRef<Path>>(&self, filename: P) -> Result<Image<T, C>> { ... } }

Trait for an image decoder, use this to get an image from a byte stream

Required methods

fn decode(&self, bytes: &[u8]) -> Result<Image<T, C>>

From the bytes decode an image, will perform any scaling or conversions required to represent elements with type T.

Loading content...

Provided methods

fn decode_file<P: AsRef<Path>>(&self, filename: P) -> Result<Image<T, C>>

Given a filename decode an image performing any necessary conversions.

Loading content...

Implementors

impl<T> Decoder<T, RGB> for PpmDecoder where
    T: Copy + Clone + Num + NumAssignOps + NumCast + PartialOrd + Display + PixelBound + FromPrimitive
[src]

Implements the decoder trait for the PpmDecoder.

The ColourModel type argument is locked to RGB - this prevents calling RGB::into::() unnecessarily which is unavoidable until trait specialisation is stabilised.

fn decode_file<P: AsRef<Path>>(&self, filename: P) -> Result<Image<T, C>>[src]

Loading content...