Expand description
Shared traits and types for zen* image codecs.
This crate defines the common API surface that all zen* codecs implement.
§Module organization
encode— encoder traits, dyn dispatch, output typesdecode— decoder traits, streaming/animation decode, dyn dispatch, output types- Root — shared types used by both encode and decode paths
§Shared types (root)
ImageFormat— format detection from magic bytesImageInfo/Metadata/Orientation/OrientationHint— image metadataResourceLimits/ThreadingPolicy— resource limit and threading configurationUnsupportedOperation/CodecErrorExt— standard unsupported operation reporting and error chain inspection
§Re-exported crates
The enough crate is re-exported for cooperative cancellation
(enough::Stop).
ⓘ
use enough::Stop;Individual codecs (zenjpeg, zenwebp, zengif, zenavif) implement the
encode and decode traits on their own config types.
Format-specific methods live on the concrete types, not on the traits.
zencodecs provides multi-format dispatch and convenience entry points.
Re-exports§
pub use gainmap::GainMapChannel;pub use gainmap::GainMapDirection;pub use gainmap::GainMapInfo;pub use gainmap::GainMapParams;pub use gainmap::GainMapPresence;pub use enough;
Modules§
- decode
- Decode traits, types, and configuration.
- encode
- Encode traits, types, and configuration.
- gainmap
- Cross-codec gain map types (ISO 21496-1). Cross-codec gain map types (ISO 21496-1).
- helpers
- Codec implementation helpers (not consumer API). Codec implementation helpers.
Structs§
- Animation
Frame - A composited full-canvas animation frame, borrowing the decoder’s canvas.
- Cicp
- CICP color description (ITU-T H.273).
- Content
Light Level - HDR content light level metadata (CEA-861.3 / CTA-861-H).
- Extensions
- A type-map storing multiple independently-typed extension values.
- Image
Format Definition - Describes an image format’s metadata, capabilities, and detection logic.
- Image
Format Registry - A collection of
ImageFormatDefinitions with lookup methods. - Image
Info - Image metadata obtained from probing or decoding.
- Mastering
Display - Mastering display color volume metadata (SMPTE ST 2086).
- Metadata
- Owned image metadata for encode/decode roundtrip.
- Owned
Animation Frame - A composited full-canvas animation frame with owned pixel data.
- Resolution
- Physical pixel resolution (DPI or pixels-per-unit).
- Resource
Limits - Resource limits for encode/decode operations.
- Source
Color - Source color description from the image file.
- Stop
Token - Owned, clonable, type-erased stop token.
- Supplements
- Supplemental content that accompanies the primary image(s).
- Unstoppable
- A
Stopimplementation that never stops (no cooperative cancellation). - Unsupported
- Stub type for codecs that don’t support an operation.
Enums§
- Image
Format - Supported image formats.
- Image
Sequence - What kind of image sequence the file contains.
- Limit
Exceeded - A resource limit was exceeded.
- Orientation
- Image orientation — the 8-element D4 dihedral group.
- Orientation
Hint - How the decoder should handle orientation during decode.
- Resolution
Unit - Unit for
Resolutionvalues. - Threading
Policy - Threading policy for codec operations.
- Unsupported
Operation - Identifies an operation that a codec does not support.
Traits§
- Codec
Error Ext - Extension trait for inspecting codec errors.
- Source
Encoding Details - Codec-agnostic interface for source encoding properties.
Functions§
- find_
cause - Walk an error’s
source()chain to find a cause of typeT.