Trait ndarray_vision::format::Encoder
source · 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§
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::