pub struct AvifEncoder { /* private fields */ }Expand description
Encodes images to AVIF still images.
8-bit RGB in, mapped to AV1 identity-matrix 4:4:4. By default the encode is lossless;
AvifEncoder::with_qindex selects a lossy quantizer (base_q_idx, 1..=255). Use
Encode via the EncodeImage<Rgb8> trait, taking a typed
ImageRef. AvifEncoder::with_rotation_ccw /
AvifEncoder::with_mirror add irot/imir display-orientation transforms.
Implementations§
Source§impl AvifEncoder
impl AvifEncoder
Sourcepub fn with_qindex(self, qindex: u8) -> Self
pub fn with_qindex(self, qindex: u8) -> Self
Sets the AV1 quantizer (base_q_idx): 0 is lossless, 1..=255 is lossy intra (higher
quantizes more aggressively for smaller files). Returns the updated encoder for chaining.
Sourcepub fn with_rotation_ccw(self, quarter_turns: u8) -> Self
pub fn with_rotation_ccw(self, quarter_turns: u8) -> Self
Adds an irot display rotation of quarter_turns × 90° applied anti-clockwise (the value is
taken modulo 4, so 0 clears it). The stored pixels are unchanged — a reader rotates at
display time — so this records e.g. a camera’s EXIF orientation without re-encoding. Returns
the updated encoder for chaining.
Sourcepub fn with_mirror(self, axis: u8) -> Self
pub fn with_mirror(self, axis: u8) -> Self
Adds an imir display mirror: axis = 0 mirrors about a vertical axis (left↔right), 1
about a horizontal axis (top↔bottom). The stored pixels are unchanged. Returns the updated
encoder for chaining.
Trait Implementations§
Source§impl Clone for AvifEncoder
impl Clone for AvifEncoder
Source§fn clone(&self) -> AvifEncoder
fn clone(&self) -> AvifEncoder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more