#[non_exhaustive]pub enum EncodeOptions {
PngZune(ZunePngEncodeConfig),
JpegJpegEnc(JpegEncEncodeConfig),
WebpLibwebp(LibwebpEncodeConfig),
AvifRavif(RavifEncodeConfig),
JxlZune(ZuneJxlEncodeConfig),
Dng(DngExportConfig),
}Expand description
Selects the encoder implementation and carries its configuration.
Obtain one with EncodeOptions::default_for for a format’s default
backend, or with a constructor such as EncodeOptions::jpeg, or by naming
a variant directly to pin a specific backend.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
PngZune(ZunePngEncodeConfig)
PNG via zune-png (requires png-encode).
JpegJpegEnc(JpegEncEncodeConfig)
JPEG via the pure-Rust jpeg-encoder (requires jpeg-encode).
WebpLibwebp(LibwebpEncodeConfig)
WebP via libwebp (requires webp-encode).
AvifRavif(RavifEncodeConfig)
AVIF via ravif / rav1e (requires avif-encode).
JxlZune(ZuneJxlEncodeConfig)
JPEG XL via zune-jpegxl (requires jxl-encode).
Dng(DngExportConfig)
DNG via the in-repo encoder (requires dng-encode).
Implementations§
Source§impl EncodeOptions
impl EncodeOptions
Sourcepub fn webp_lossy() -> Self
pub fn webp_lossy() -> Self
Lossy WebP with default configuration.
Sourcepub fn webp_lossless() -> Self
pub fn webp_lossless() -> Self
Lossless WebP with default configuration.
Sourcepub fn format(&self) -> OutputFormat
pub fn format(&self) -> OutputFormat
The output format this encoder produces.
Sourcepub fn codec_id(&self) -> CodecId
pub fn codec_id(&self) -> CodecId
The stable identifier of the selected encoder implementation.
Sourcepub fn common(&self) -> CommonEncodeOptions
pub fn common(&self) -> CommonEncodeOptions
The encoder-agnostic options (metadata embedding, bit depth) in effect.
For DNG — which has its own configuration shape — a CommonEncodeOptions
is synthesised from DngExportConfig.
Sourcepub fn default_for(format: StandardFormat) -> Option<EncodeOptions>
pub fn default_for(format: StandardFormat) -> Option<EncodeOptions>
The default encoder backend for format, with default configuration.
Returns None when no encoder for format is compiled in, or when the
format has no encoder. DNG is absent — it is not a StandardFormat;
use EncodeOptions::dng.
Trait Implementations§
Source§impl Clone for EncodeOptions
impl Clone for EncodeOptions
Source§fn clone(&self) -> EncodeOptions
fn clone(&self) -> EncodeOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EncodeOptions
impl Debug for EncodeOptions
Source§impl Default for EncodeOptions
Available on crate feature png-encode only.
impl Default for EncodeOptions
png-encode only.Source§impl<'de> Deserialize<'de> for EncodeOptions
impl<'de> Deserialize<'de> for EncodeOptions
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for EncodeOptions
impl PartialEq for EncodeOptions
Source§fn eq(&self, other: &EncodeOptions) -> bool
fn eq(&self, other: &EncodeOptions) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for EncodeOptions
impl Serialize for EncodeOptions
impl StructuralPartialEq for EncodeOptions
Auto Trait Implementations§
impl Freeze for EncodeOptions
impl RefUnwindSafe for EncodeOptions
impl Send for EncodeOptions
impl Sync for EncodeOptions
impl Unpin for EncodeOptions
impl UnsafeUnpin for EncodeOptions
impl UnwindSafe for EncodeOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T, Ctx> BundleDefault<Ctx> for Twhere
T: Default,
impl<T, Ctx> BundleDefault<Ctx> for Twhere
T: Default,
Source§fn default_with_context(_: Ctx) -> T
fn default_with_context(_: Ctx) -> T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more