ImgFormat

Trait ImgFormat 

Source
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

An image format. This is used to implement ReadFrom and WriteTo for specific image formats.

Required Associated Constants§

Source

const FORMAT: ImageFormat

The image format.

Required Associated Types§

Source

type WriterType<'a, Vfs>: From<&'a DynamicImage> where Vfs: 'a

The writer type for this image format.

Required Methods§

Source

fn from_image(img: DynamicImage) -> Self

Create an instance of this type from a image::DynamicImage.

Source

fn as_image(&self) -> &DynamicImage

Get a reference to the inner image::DynamicImage.

Source

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.
Source§

const FORMAT: ImageFormat = image::ImageFormat::Avif

Source§

type WriterType<'a, Vfs> = AvifWriter<'a, Vfs> where Vfs: 'a

Source§

impl ImgFormat for Bmp

Available on crate feature image-format-bmp only.
Source§

const FORMAT: ImageFormat = image::ImageFormat::Bmp

Source§

type WriterType<'a, Vfs> = BmpWriter<'a, Vfs> where Vfs: 'a

Source§

impl ImgFormat for Farbfeld

Available on crate feature image-format-ff only.
Source§

const FORMAT: ImageFormat = image::ImageFormat::Farbfeld

Source§

type WriterType<'a, Vfs> = FarbfeldWriter<'a, Vfs> where Vfs: 'a

Source§

impl ImgFormat for Gif

Available on crate feature image-format-gif only.
Source§

const FORMAT: ImageFormat = image::ImageFormat::Gif

Source§

type WriterType<'a, Vfs> = GifWriter<'a, Vfs> where Vfs: 'a

Source§

impl ImgFormat for Hdr

Available on crate feature image-format-hdr only.
Source§

const FORMAT: ImageFormat = image::ImageFormat::Hdr

Source§

type WriterType<'a, Vfs> = HdrWriter<'a, Vfs> where Vfs: 'a

Source§

impl ImgFormat for Ico

Available on crate feature image-format-ico only.
Source§

const FORMAT: ImageFormat = image::ImageFormat::Ico

Source§

type WriterType<'a, Vfs> = IcoWriter<'a, Vfs> where Vfs: 'a

Source§

impl ImgFormat for Jpeg

Available on crate feature image-format-jpeg only.
Source§

const FORMAT: ImageFormat = image::ImageFormat::Jpeg

Source§

type WriterType<'a, Vfs> = JpegWriter<'a, Vfs> where Vfs: 'a

Source§

impl ImgFormat for OpenExr

Available on crate feature image-format-exr only.
Source§

const FORMAT: ImageFormat = image::ImageFormat::OpenExr

Source§

type WriterType<'a, Vfs> = OpenExrWriter<'a, Vfs> where Vfs: 'a

Source§

impl ImgFormat for Png

Available on crate feature image-format-png only.
Source§

const FORMAT: ImageFormat = image::ImageFormat::Png

Source§

type WriterType<'a, Vfs> = PngWriter<'a, Vfs> where Vfs: 'a

Source§

impl ImgFormat for Pnm

Available on crate feature image-format-pnm only.
Source§

const FORMAT: ImageFormat = image::ImageFormat::Pnm

Source§

type WriterType<'a, Vfs> = PnmWriter<'a, Vfs> where Vfs: 'a

Source§

impl ImgFormat for Qoi

Source§

const FORMAT: ImageFormat = image::ImageFormat::Qoi

Source§

type WriterType<'a, Vfs> = QoiWriter<'a, Vfs> where Vfs: 'a

Source§

impl ImgFormat for Tga

Available on crate feature image-format-tga only.
Source§

const FORMAT: ImageFormat = image::ImageFormat::Tga

Source§

type WriterType<'a, Vfs> = TgaWriter<'a, Vfs> where Vfs: 'a

Source§

impl ImgFormat for Tiff

Available on crate feature image-format-tiff only.
Source§

const FORMAT: ImageFormat = image::ImageFormat::Tiff

Source§

type WriterType<'a, Vfs> = TiffWriter<'a, Vfs> where Vfs: 'a

Source§

impl ImgFormat for WebP

Available on crate feature image-format-webp only.
Source§

const FORMAT: ImageFormat = image::ImageFormat::WebP

Source§

type WriterType<'a, Vfs> = WebPWriter<'a, Vfs> where Vfs: 'a