#[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
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: StillChromaChroma layout for a lossy packed-RGB encode (chroma).
premultiplied: boolEmit the prem iref (premultiplied).
speed: EncodeSpeedAV1 search effort (speed).
threads: Option<usize>Explicit worker threads (threads); None = the execution
context’s budget.
Implementations§
Source§impl AvifEncoderOptions
impl AvifEncoderOptions
Sourcepub fn with_quality(self, quality: Option<u8>) -> Self
pub fn with_quality(self, quality: Option<u8>) -> Self
Setter: replace quality.
Sourcepub fn with_alpha_q(self, alpha_q: Option<u8>) -> Self
pub fn with_alpha_q(self, alpha_q: Option<u8>) -> Self
Setter: replace alpha_q.
Sourcepub fn with_chroma(self, chroma: StillChroma) -> Self
pub fn with_chroma(self, chroma: StillChroma) -> Self
Setter: replace chroma.
Sourcepub fn with_premultiplied(self, premultiplied: bool) -> Self
pub fn with_premultiplied(self, premultiplied: bool) -> Self
Setter: replace premultiplied.
Sourcepub fn with_speed(self, speed: EncodeSpeed) -> Self
pub fn with_speed(self, speed: EncodeSpeed) -> Self
Setter: replace speed.
Sourcepub fn with_threads(self, threads: Option<usize>) -> Self
pub fn with_threads(self, threads: Option<usize>) -> Self
Setter: replace threads (None = the execution context’s budget).
Sourcepub fn from_params(params: &CodecParameters) -> Result<Self>
pub fn from_params(params: &CodecParameters) -> Result<Self>
Strict parse of a parameter set’s option bag.
Sourcepub fn resolve(&self) -> EncodeOptions
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
impl Clone for AvifEncoderOptions
Source§impl CodecOptionsStruct for AvifEncoderOptions
impl CodecOptionsStruct for AvifEncoderOptions
Source§const SCHEMA: &'static [OptionField]
const SCHEMA: &'static [OptionField]
Source§fn apply(&mut self, key: &str, value: &OptionValue) -> Result<()>
fn apply(&mut self, key: &str, value: &OptionValue) -> Result<()>
key is guaranteed to
be present in SCHEMA and value to match the
declared OptionKind when called via parse_options.