[][src]Struct libavif::Encoder

pub struct Encoder { /* fields omitted */ }

AVIF image encoder

Implementations

impl Encoder[src]

pub fn new() -> Self[src]

Create a new encoder with default settings

Defaults

  • max_threads -> 1
  • quantizer -> 0
  • quantizer_alpha -> 0
  • speed -> 10

pub fn max_threads(&self) -> usize[src]

Get the maximum allowed number of threads this Encoder can use

pub fn set_max_threads(&mut self, max_threads: usize) -> &mut Self[src]

Set the maximum allowed number of threads this Encoder can use

pub fn quantizer(&self) -> u8[src]

Get quantizer value for the YUV channels

pub fn set_quantizer(&mut self, quantizer: u8) -> &mut Self[src]

Set the quantizer value for the YUV channels

Must be between 0 and 63.

  • 0 - lossless
  • 63 - lowest quality

pub fn quantizer_alpha(&self) -> u8[src]

Get quantizer value for the alpha channel

pub fn set_quantizer_alpha(&mut self, quantizer_alpha: u8) -> &mut Self[src]

Set the quantizer value for the alpha channel

Must be between 0 and 63.

  • 0 - lossless
  • 63 - lowest quality

pub fn speed(&self) -> u8[src]

Get the speed of this Encoder

pub fn set_speed(&mut self, speed: u8) -> &mut Self[src]

Set the speed of this Encoder

Must be between 0 and 10.

  • 10 - fastest
  • 0 - slowest

pub fn encode(&self, image: &AvifImage) -> Result<AvifData<'static>, Error>[src]

Encode an AvifImage using the settings from this Encoder

Trait Implementations

impl Default for Encoder[src]

impl Drop for Encoder[src]

Auto Trait Implementations

impl RefUnwindSafe for Encoder

impl !Send for Encoder

impl !Sync for Encoder

impl Unpin for Encoder

impl UnwindSafe for Encoder

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.