Skip to main content

webp_anim/
lib.rs

1#![warn(missing_docs)]
2
3//! Inspect, decode, resize, and encode animated WebP images.
4//!
5//! The crate exposes lightweight frame-duration metadata inspection, sequential
6//! full-canvas RGBA decoding, reusable animation-frame resizing, and sequential
7//! animated-WebP encoding. [`AnimationDecoder::frame_durations`] reads stored
8//! durations without decoding pixels or advancing the decoder, while
9//! [`AnimationDecoder::reset`] reuses a decoder from the start of its sequence.
10//! Frame durations are passed through without playback-time normalization.
11//!
12//! The high-level [`transcode_animated_webp`] function composes those stages for
13//! one stored animation sequence. Applications that need different resource,
14//! compression, or output-selection policies can use the lower-level types
15//! directly.
16
17/// Lower-level WebP animation decoder and encoder primitives.
18pub mod codec;
19/// WebP container classification and metadata inspection.
20pub mod inspect;
21/// Shared data types describing canvases, frames, and animation metadata.
22pub mod model;
23/// Reusable aspect-ratio-preserving RGBA resize plans and workspaces.
24pub mod resize;
25/// The sequential decode-resize-encode convenience pipeline.
26pub mod transcode;
27
28pub use codec::decode::{AnimationDecoder, DecodeError, DecodeLimits};
29pub use codec::encode::{
30    AnimationEncoder, AnimationEncoderOptions, AnimationMuxOverrides, EncodeError,
31    EncoderConfigOverrides,
32};
33pub use inspect::{InspectError, InspectLimits, WebpKind, inspect, is_animated_webp_fast};
34pub use model::{
35    AnimationFrame, AnimationInfo, BackgroundColor, CanvasSize, LoopCount, StaticWebpInfo,
36};
37pub use resize::{ResizeError, ResizeFilter, ResizeOptions, ResizePlan, ResizeWorkspace};
38pub use transcode::{
39    AnimationTranscodeOptions, TranscodeError, TranscodedAnimation, transcode_animated_webp,
40};