#[non_exhaustive]pub enum DecodeOptions {
JpegZune(ZuneJpegDecodeConfig),
PngZune(ZunePngDecodeConfig),
WebpLibwebp(LibwebpDecodeConfig),
JxlOxide(JxlOxideDecodeConfig),
Gif(GifDecodeConfig),
Tiff(TiffDecodeConfig),
AvifImage(ImageAvifDecodeConfig),
HeicLibheif(LibheifDecodeConfig),
SvgResvg(ResvgDecodeConfig),
PpmZune(ZunePpmDecodeConfig),
}Expand description
Selects which decoder implementation handles a standard image, and carries that implementation’s configuration.
Each variant pairs a compressed format with one backend library. rawshift
can be built with multiple implementations of the same format enabled (see
the implementation feature flags in the crate documentation); this enum is
how a caller pins exactly which one decode_standard_image_with uses.
Use DecodeOptions::default_for to obtain the default backend for a
format. RAW formats are intentionally absent — they have a single in-repo
implementation and are decoded through RawFile.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
JpegZune(ZuneJpegDecodeConfig)
JPEG via zune-jpeg.
PngZune(ZunePngDecodeConfig)
PNG via zune-png.
WebpLibwebp(LibwebpDecodeConfig)
WebP via libwebp.
JxlOxide(JxlOxideDecodeConfig)
JPEG XL via jxl-oxide.
Gif(GifDecodeConfig)
GIF via the gif crate.
Tiff(TiffDecodeConfig)
TIFF via the tiff crate.
AvifImage(ImageAvifDecodeConfig)
AVIF via image (avif-native).
HeicLibheif(LibheifDecodeConfig)
HEIC/HEIF via libheif.
SvgResvg(ResvgDecodeConfig)
SVG via resvg.
PpmZune(ZunePpmDecodeConfig)
PPM / Netpbm via zune-ppm.
Implementations§
Source§impl DecodeOptions
impl DecodeOptions
Sourcepub fn format(&self) -> StandardFormat
pub fn format(&self) -> StandardFormat
The standard format this backend decodes.
Sourcepub fn codec_id(&self) -> CodecId
pub fn codec_id(&self) -> CodecId
The stable identifier of the selected decoder implementation.
Sourcepub fn default_for(format: StandardFormat) -> Option<DecodeOptions>
pub fn default_for(format: StandardFormat) -> Option<DecodeOptions>
The default decoder backend for format, with default configuration.
Returns None when no decoder for format is compiled in (the relevant
feature flag is disabled, or the format has no decoder — e.g. APV).
Trait Implementations§
Source§impl Clone for DecodeOptions
impl Clone for DecodeOptions
Source§fn clone(&self) -> DecodeOptions
fn clone(&self) -> DecodeOptions
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 DecodeOptions
impl Debug for DecodeOptions
Source§impl<'de> Deserialize<'de> for DecodeOptions
impl<'de> Deserialize<'de> for DecodeOptions
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 DecodeOptions
impl PartialEq for DecodeOptions
Source§fn eq(&self, other: &DecodeOptions) -> bool
fn eq(&self, other: &DecodeOptions) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for DecodeOptions
impl Serialize for DecodeOptions
impl StructuralPartialEq for DecodeOptions
Auto Trait Implementations§
impl Freeze for DecodeOptions
impl RefUnwindSafe for DecodeOptions
impl Send for DecodeOptions
impl Sync for DecodeOptions
impl Unpin for DecodeOptions
impl UnsafeUnpin for DecodeOptions
impl UnwindSafe for DecodeOptions
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> 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