Struct webp::Encoder[][src]

pub struct Encoder<'a> { /* fields omitted */ }

An encoder for WebP images. It uses the default configuration of libwebp.

Implementations

impl<'a> Encoder<'a>[src]

pub fn new(
    image: &'a [u8],
    layout: PixelLayout,
    width: u32,
    height: u32
) -> Self
[src]

Creates a new encoder from the given image data. The image data must be in the pixel layout of the color parameter.

pub fn from_image(image: &'a DynamicImage) -> Self[src]

Creates a new encoder from the given image.

pub fn from_rgb(image: &'a [u8], width: u32, height: u32) -> Self[src]

Creates a new encoder from the given image data in the RGB pixel layout.

pub fn from_rgba(image: &'a [u8], width: u32, height: u32) -> Self[src]

Creates a new encoder from the given image data in the RGBA pixel layout.

pub fn encode(&self, quality: f32) -> WebPMemory[src]

Emcode the image with the given quality. The image quality must be between 0.0 and 100.0 inclusive for minimal and maximal quality respectively.

pub fn encode_lossless(&self) -> WebPMemory[src]

Emcode the image losslessly.

Auto Trait Implementations

impl<'a> RefUnwindSafe for Encoder<'a>

impl<'a> Send for Encoder<'a>

impl<'a> Sync for Encoder<'a>

impl<'a> Unpin for Encoder<'a>

impl<'a> UnwindSafe for Encoder<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.