Struct webp::Encoder [−][src]
pub struct Encoder<'a> { /* fields omitted */ }
Expand description
An encoder for WebP images. It uses the default configuration of libwebp.
Implementations
impl<'a> Encoder<'a>
[src]
impl<'a> Encoder<'a>
[src]pub fn new(
image: &'a [u8],
layout: PixelLayout,
width: u32,
height: u32
) -> Self
[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]
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]
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]
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]
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]
pub fn encode_lossless(&self) -> WebPMemory
[src]Emcode the image losslessly.