pub fn from_image(image: &'a DynamicImage) -> Result<Self, &str> {
        match image {
            DynamicImage::ImageLuma8(_) => { Err("Unimplemented") }
            DynamicImage::ImageLumaA8(_) => { Err("Unimplemented") }
            DynamicImage::ImageRgb8(image) => {
                Ok(Self::from_rgb(image.as_ref(), image.width(), image.height()))
            }
            DynamicImage::ImageRgba8(image) => {
                Ok(Self::from_rgba(image.as_ref(), image.width(), image.height()))
            }
            DynamicImage::ImageBgr8(_) => { Err("Unimplemented") }
            DynamicImage::ImageBgra8(_) => { Err("Unimplemented") }
            _ => { Err("Unimplemented") }
        }
    }
/// Creates a new encoder from the given image.
Creates a new encoder from the given image.
Creates a new encoder from the given image .
pub fn from_image(image: &'a DynamicImage) -> Result<Self, &str> {
        match image {
            DynamicImage::ImageLuma8(_) => { Err("Unimplemented") }
            DynamicImage::ImageLumaA8(_) => { Err("Unimplemented") }
            DynamicImage::ImageRgb8(image) => {
                Ok(Self::from_rgb(image.as_ref(), image.width(), image.height()))
            }
            DynamicImage::ImageRgba8(image) => {
                Ok(Self::from_rgba(image.as_ref(), image.width(), image.height()))
            }
            DynamicImage::ImageBgr8(_) => { Err("Unimplemented") }
            DynamicImage::ImageBgra8(_) => { Err("Unimplemented") }
            _ => { Err("Unimplemented") }
        }
    }
pub fn from_image ( image : & ' a DynamicImage ) -> Result < Self , & str > { match image { DynamicImage :: ImageLuma8 ( _ ) => { Err ( " " ) } DynamicImage :: ImageLumaA8 ( _ ) => { Err ( " " ) } DynamicImage :: ImageRgb8 ( image ) => { Ok ( Self :: from_rgb ( image . as_ref ( ) , image . width ( ) , image . height ( ) ) ) } DynamicImage :: ImageRgba8 ( image ) => { Ok ( Self :: from_rgba ( image . as_ref ( ) , image . width ( ) , image . height ( ) ) ) } DynamicImage :: ImageBgr8 ( _ ) => { Err ( " " ) } DynamicImage :: ImageBgra8 ( _ ) => { Err ( " " ) } _ => { Err ( " " ) } } }
Creates a new encoder from the given image.
Creates a new encoder from the given image .
image
&'a DynamicImage
image
&'a DynamicImage