pub trait Decoder<T, C>where
T: Copy + Clone + FromPrimitive + Num + NumAssignOps + NumCast + PartialOrd + Display + PixelBound,
C: ColourModel,{
// Required method
fn decode(&self, bytes: &[u8]) -> Result<Image<T, C>>;
// Provided method
fn decode_file<P: AsRef<Path>>(&self, filename: P) -> Result<Image<T, C>> { ... }
}Expand description
Trait for an image decoder, use this to get an image from a byte stream
Required Methods§
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl<T> Decoder<T, RGB> for PpmDecoderwhere
T: Copy + Clone + Num + NumAssignOps + NumCast + PartialOrd + Display + PixelBound + FromPrimitive,
Implements the decoder trait for the PpmDecoder.
The ColourModel type argument is locked to RGB - this prevents calling
RGB::into::