pub trait ImgFormat: Clone {
type WriterType<'a, Vfs>: From<&'a DynamicImage>
where Vfs: 'a;
const FORMAT: ImageFormat;
// Required methods
fn from_image(img: DynamicImage) -> Self;
fn as_image(&self) -> &DynamicImage;
fn into_image(self) -> DynamicImage;
}Available on crate feature
image only.Expand description
Required Associated Constants§
Sourceconst FORMAT: ImageFormat
const FORMAT: ImageFormat
The image format.
Required Associated Types§
Sourcetype WriterType<'a, Vfs>: From<&'a DynamicImage>
where
Vfs: 'a
type WriterType<'a, Vfs>: From<&'a DynamicImage> where Vfs: 'a
The writer type for this image format.
Required Methods§
Sourcefn from_image(img: DynamicImage) -> Self
fn from_image(img: DynamicImage) -> Self
Create an instance of this type from a image::DynamicImage.
Sourcefn as_image(&self) -> &DynamicImage
fn as_image(&self) -> &DynamicImage
Get a reference to the inner image::DynamicImage.
Sourcefn into_image(self) -> DynamicImage
fn into_image(self) -> DynamicImage
Consumes this instance and returns the inner image::DynamicImage.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
Source§impl ImgFormat for Avif
Available on crate feature image-format-avif only.
impl ImgFormat for Avif
Available on crate feature
image-format-avif only.const FORMAT: ImageFormat = image::ImageFormat::Avif
type WriterType<'a, Vfs> = AvifWriter<'a, Vfs> where Vfs: 'a
Source§impl ImgFormat for Bmp
Available on crate feature image-format-bmp only.
impl ImgFormat for Bmp
Available on crate feature
image-format-bmp only.const FORMAT: ImageFormat = image::ImageFormat::Bmp
type WriterType<'a, Vfs> = BmpWriter<'a, Vfs> where Vfs: 'a
Source§impl ImgFormat for Farbfeld
Available on crate feature image-format-ff only.
impl ImgFormat for Farbfeld
Available on crate feature
image-format-ff only.const FORMAT: ImageFormat = image::ImageFormat::Farbfeld
type WriterType<'a, Vfs> = FarbfeldWriter<'a, Vfs> where Vfs: 'a
Source§impl ImgFormat for Gif
Available on crate feature image-format-gif only.
impl ImgFormat for Gif
Available on crate feature
image-format-gif only.const FORMAT: ImageFormat = image::ImageFormat::Gif
type WriterType<'a, Vfs> = GifWriter<'a, Vfs> where Vfs: 'a
Source§impl ImgFormat for Hdr
Available on crate feature image-format-hdr only.
impl ImgFormat for Hdr
Available on crate feature
image-format-hdr only.const FORMAT: ImageFormat = image::ImageFormat::Hdr
type WriterType<'a, Vfs> = HdrWriter<'a, Vfs> where Vfs: 'a
Source§impl ImgFormat for Ico
Available on crate feature image-format-ico only.
impl ImgFormat for Ico
Available on crate feature
image-format-ico only.const FORMAT: ImageFormat = image::ImageFormat::Ico
type WriterType<'a, Vfs> = IcoWriter<'a, Vfs> where Vfs: 'a
Source§impl ImgFormat for Jpeg
Available on crate feature image-format-jpeg only.
impl ImgFormat for Jpeg
Available on crate feature
image-format-jpeg only.const FORMAT: ImageFormat = image::ImageFormat::Jpeg
type WriterType<'a, Vfs> = JpegWriter<'a, Vfs> where Vfs: 'a
Source§impl ImgFormat for OpenExr
Available on crate feature image-format-exr only.
impl ImgFormat for OpenExr
Available on crate feature
image-format-exr only.const FORMAT: ImageFormat = image::ImageFormat::OpenExr
type WriterType<'a, Vfs> = OpenExrWriter<'a, Vfs> where Vfs: 'a
Source§impl ImgFormat for Png
Available on crate feature image-format-png only.
impl ImgFormat for Png
Available on crate feature
image-format-png only.const FORMAT: ImageFormat = image::ImageFormat::Png
type WriterType<'a, Vfs> = PngWriter<'a, Vfs> where Vfs: 'a
Source§impl ImgFormat for Pnm
Available on crate feature image-format-pnm only.
impl ImgFormat for Pnm
Available on crate feature
image-format-pnm only.const FORMAT: ImageFormat = image::ImageFormat::Pnm
type WriterType<'a, Vfs> = PnmWriter<'a, Vfs> where Vfs: 'a
Source§impl ImgFormat for Qoi
impl ImgFormat for Qoi
const FORMAT: ImageFormat = image::ImageFormat::Qoi
type WriterType<'a, Vfs> = QoiWriter<'a, Vfs> where Vfs: 'a
Source§impl ImgFormat for Tga
Available on crate feature image-format-tga only.
impl ImgFormat for Tga
Available on crate feature
image-format-tga only.const FORMAT: ImageFormat = image::ImageFormat::Tga
type WriterType<'a, Vfs> = TgaWriter<'a, Vfs> where Vfs: 'a
Source§impl ImgFormat for Tiff
Available on crate feature image-format-tiff only.
impl ImgFormat for Tiff
Available on crate feature
image-format-tiff only.const FORMAT: ImageFormat = image::ImageFormat::Tiff
type WriterType<'a, Vfs> = TiffWriter<'a, Vfs> where Vfs: 'a
Source§impl ImgFormat for WebP
Available on crate feature image-format-webp only.
impl ImgFormat for WebP
Available on crate feature
image-format-webp only.