Skip to main content

Crate webp_rust

Crate webp_rust 

Source
Expand description

Pure Rust WebP decode and still-image encode helpers.

The top-level API is intentionally small:

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§

AnimationControl
Global animation parameters stored in the ANIM chunk.
AnimationFrame
One animation frame entry parsed from an ANMF chunk.
ImageBuffer
RGBA pixel buffer for a decoded or to-be-encoded still image.
WebpHeader
Container-level metadata returned by read_header.

Enums§

WebpEncoding
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.