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]
image: &'a [u8],
layout: PixelLayout,
width: u32,
height: u32
) -> Self
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,