Expand description
Pure Rust WebP decode and still-image encode helpers.
The top-level API is intentionally small:
decodedecodes a still WebP image intoImageBufferencodeencodes anImageBufferas lossy or lossless WebPencode_lossyencodes anImageBufferas lossy WebPencode_losslessencodes anImageBufferas lossless WebP
Lower-level codec and container entry points remain available under
decoder and encoder.
Re-exports§
pub use compat::CallbackResponse;pub use compat::DataMap;pub use compat::DecodeOptions;pub use compat::DrawCallback;pub use compat::DrawOptions;pub use compat::ImageRect;pub use compat::InitOptions;pub use compat::Metadata;pub use compat::NextBlend;pub use compat::NextDispose;pub use compat::NextOption;pub use compat::NextOptions;pub use compat::ResponseCommand;pub use compat::RGBA;pub use decoder::DecoderError;pub use encoder::EncoderError;pub use encoder::LosslessEncodingOptions;pub use encoder::LossyEncodingOptions;
Modules§
- compat
- Compatibility wrapper for callback-based decode flows used by
wml2. - decoder
- Lower-level WebP parsing and decoding APIs.
- encoder
- Pure Rust WebP encoder helpers.
Structs§
- Animation
Control - Global animation parameters stored in the
ANIMchunk. - Animation
Frame - One animation frame entry parsed from an
ANMFchunk. - Image
Buffer - RGBA pixel buffer for a decoded or to-be-encoded still image.
- Webp
Header - Container-level metadata returned by
read_header.
Enums§
- Webp
Encoding - Top-level still-image WebP compression mode.
Functions§
- decode
- Decodes a still WebP image from memory into an RGBA buffer.
- decode_
file - Reads a still WebP image from disk and decodes it to RGBA.
- encode
- Encodes an image as a still WebP container.
- encode_
lossless - Encodes an image as a still lossless WebP container.
- encode_
lossy - Encodes an image as a still lossy WebP container.
- image_
from_ bytes - Compatibility alias for
decode. - image_
from_ file - Compatibility alias for
decode_file. - read_
header - Parses the RIFF container and returns raw chunk-oriented metadata.
- read_
u24 - Reads a 24-bit little-endian integer from a
BinaryReader.