#[non_exhaustive]pub enum ImageFormat {
JPEG,
PNG,
PPM,
PSD,
Farbfeld,
QOI,
JPEG_XL,
HDR,
BMP,
WEBP,
Unknown,
}Expand description
All supported image formats
This enum contains supported image formats, either encoders or decoders for a particular image
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
JPEG
Joint Photographic Experts Group
PNG
Portable Network Graphics
PPM
Portable Pixel Map image
PSD
Photoshop PSD component
Farbfeld
Farbfeld format
QOI
Quite Okay Image
JPEG_XL
JPEG XL, new format
HDR
Radiance HDR decoder
BMP
Windows Bitmap Files
WEBP
Unknown
Any unknown format
Implementations§
Source§impl ImageFormat
impl ImageFormat
pub fn has_decoder(self) -> bool
pub fn decoder<'a, T>( &self, data: T, ) -> Result<Box<dyn DecoderTrait + 'a>, ImageErrors>
pub fn decoder_with_options<'a, T>( &self, data: T, options: DecoderOptions, ) -> Result<Box<dyn DecoderTrait + 'a>, ImageErrors>
Sourcepub fn has_encoder(&self) -> bool
pub fn has_encoder(&self) -> bool
Return true if an image format has an encoder that can convert the image into that format
pub fn encode<T: ZByteWriterTrait>( &self, image: &Image, encoder_options: EncoderOptions, sink: T, ) -> Result<usize, ImageErrors>
pub fn guess_format<T>(bytes: T) -> Option<(ImageFormat, T)>where
T: ZByteReaderTrait,
pub fn encoder_for_extension<P: AsRef<str>>(extension: P) -> Option<ImageFormat>
Trait Implementations§
Source§impl Clone for ImageFormat
impl Clone for ImageFormat
Source§fn clone(&self) -> ImageFormat
fn clone(&self) -> ImageFormat
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ImageFormat
Source§impl Debug for ImageFormat
impl Debug for ImageFormat
impl Eq for ImageFormat
Source§impl PartialEq for ImageFormat
impl PartialEq for ImageFormat
Source§fn eq(&self, other: &ImageFormat) -> bool
fn eq(&self, other: &ImageFormat) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ImageFormat
impl Serialize for ImageFormat
impl StructuralPartialEq for ImageFormat
Auto Trait Implementations§
impl Freeze for ImageFormat
impl RefUnwindSafe for ImageFormat
impl Send for ImageFormat
impl Sync for ImageFormat
impl Unpin for ImageFormat
impl UnsafeUnpin for ImageFormat
impl UnwindSafe for ImageFormat
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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