Skip to main content

AvifEncoderOptions

Struct AvifEncoderOptions 

Source
#[non_exhaustive]
pub struct AvifEncoderOptions { pub quality: Option<u8>, pub q: Option<u8>, pub alpha_q: Option<u8>, pub chroma: StillChroma, pub premultiplied: bool, pub speed: EncodeSpeed, pub threads: Option<usize>, }
Expand description

The registry encoder’s option schema (see the module docs): the typed form of the quality / q / alpha_q / chroma / premultiplied codec options, parsed strictly at construction through oxideav_core::parse_options (an unknown key or a malformed value is InvalidData).

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§quality: Option<u8>

quality 0..=100 (100 = lossless); None when not given.

§q: Option<u8>

Explicit colour base_q_idx (q); wins over quality.

§alpha_q: Option<u8>

Explicit alpha base_q_idx (alpha_q); wins over quality.

§chroma: StillChroma

Chroma layout for a lossy packed-RGB encode (chroma).

§premultiplied: bool

Emit the prem iref (premultiplied).

§speed: EncodeSpeed

AV1 search effort (speed).

§threads: Option<usize>

Explicit worker threads (threads); None = the execution context’s budget.

Implementations§

Source§

impl AvifEncoderOptions

Source

pub fn new() -> Self

The defaults (lossless, 4:2:0 for lossy RGB, straight alpha).

Source

pub fn with_quality(self, quality: Option<u8>) -> Self

Setter: replace quality.

Source

pub fn with_q(self, q: Option<u8>) -> Self

Setter: replace q.

Source

pub fn with_alpha_q(self, alpha_q: Option<u8>) -> Self

Setter: replace alpha_q.

Source

pub fn with_chroma(self, chroma: StillChroma) -> Self

Setter: replace chroma.

Source

pub fn with_premultiplied(self, premultiplied: bool) -> Self

Setter: replace premultiplied.

Source

pub fn with_speed(self, speed: EncodeSpeed) -> Self

Setter: replace speed.

Source

pub fn with_threads(self, threads: Option<usize>) -> Self

Setter: replace threads (None = the execution context’s budget).

Source

pub fn from_params(params: &CodecParameters) -> Result<Self>

Strict parse of a parameter set’s option bag.

Source

pub fn resolve(&self) -> EncodeOptions

The still-encoder tuning these options resolve to: q else the quality mapping else lossless for the colour planes, the same for alpha with alpha_q; chroma / premultiplied / speed as given; threads as given, else 1 (the encoder fills the execution context’s budget in per frame).

Trait Implementations§

Source§

impl Clone for AvifEncoderOptions

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl CodecOptionsStruct for AvifEncoderOptions

Source§

const SCHEMA: &'static [OptionField]

Static schema listing every option key this struct consumes, with its declared kind, default, and help text.
Source§

fn apply(&mut self, key: &str, value: &OptionValue) -> Result<()>

Write one coerced value into the struct. key is guaranteed to be present in SCHEMA and value to match the declared OptionKind when called via parse_options.
Source§

impl Copy for AvifEncoderOptions

Source§

impl Debug for AvifEncoderOptions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for AvifEncoderOptions

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for AvifEncoderOptions

Source§

impl PartialEq for AvifEncoderOptions

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for AvifEncoderOptions

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.