pub fn encode_image(encoder: Encoder, image: &[u8]) -> Result<EncodedImage>Expand description
Encodes a formatted image with the AV1 format.
If you are looking to encode a crate::cam::Webcam::get_frame’s returned frame encode_raw_image is the one to use.
§Behavior
The formatted image is re-encoded with the settings the user passes in with the Encoder argument.
The encoded image (ravif::EncodedImage) is returned from the image.
§Error
Will return an error if the image format could not be guessed correctly or if the image had incorrect proerties (Eg.: Invalid size).