pub trait Encoder<T, U, C>where
U: Data<Elem = T>,
T: Copy + Clone + Num + NumAssignOps + NumCast + PartialOrd + Display + PixelBound,
C: ColourModel,{
// Required method
fn encode(&self, image: &ImageBase<U, C>) -> Vec<u8> ⓘ;
// Provided method
fn encode_file<P: AsRef<Path>>(
&self,
image: &ImageBase<U, C>,
filename: P,
) -> Result<()> { ... }
}
Expand description
Trait for an image encoder
Required Methods§
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
impl<T, U> Encoder<T, U, RGB> for PpmEncoderwhere
U: Data<Elem = T>,
T: Copy + Clone + Num + NumAssignOps + NumCast + PartialOrd + Display + PixelBound + FromPrimitive,
Implements the encoder trait for the PpmEncoder.
The ColourModel type argument is locked to RGB - this prevents calling
RGB::into::