pub fn from_image<P, Container>(image: &'a ImageBuffer<P, Container>) -> Result<Self, &str>
    where P: Pixel<Subpixel = u8> + 'static,
    Container: Deref<Target = [P::Subpixel]> {
        match P::CHANNEL_COUNT {
            3 => Ok(Self::from_rgb(image.as_ref(), image.width(), image.height())),
            4 => Ok(Self::from_rgba(image.as_ref(), image.width(), image.height())),
            _ => 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<P, Container>(image: &'a ImageBuffer<P, Container>) -> Result<Self, &str>
    where P: Pixel<Subpixel = u8> + 'static,
    Container: Deref<Target = [P::Subpixel]> {
        match P::CHANNEL_COUNT {
            3 => Ok(Self::from_rgb(image.as_ref(), image.width(), image.height())),
            4 => Ok(Self::from_rgba(image.as_ref(), image.width(), image.height())),
            _ => Err("Unimplemented")
        }
    }
pub fn from_image < P , Container > ( image : & ' a ImageBuffer < P , Container > ) -> Result < Self , & str > where P : Pixel < Subpixel = u8 > + ' static , Container : Deref < Target = [ P :: Subpixel ] > { match P :: CHANNEL_COUNT { 3 => Ok ( Self :: from_rgb ( image . as_ref ( ) , image . width ( ) , image . height ( ) ) ) , 4 => Ok ( Self :: from_rgba ( image . as_ref ( ) , image . width ( ) , image . height ( ) ) ) , _ => Err ( " " ) } }
Creates a new encoder from the given image.
Creates a new encoder from the given image .
image
&'a ImageBuffer<P, Container>
image
&'a ImageBuffer<P, Container>