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 exif::Exif;pub use exif::ExifPolicy;pub use exif::Retention;pub use exif::TextEncoding;pub use gainmap::GainMapChannel;pub use gainmap::GainMapDirection;pub use gainmap::GainMapInfo;pub use gainmap::GainMapParams;pub use gainmap::GainMapPresence;pub use gainmap::GainMapRender;pub use gainmap::ISO_21496_1_PRIMARY_APP2_BODY;pub use gainmap::ISO_21496_1_URN;pub use gainmap::Iso21496Format;pub use icc::icc_extract_cicp;Deprecated pub use enough;
Modules§
- decode
- Decode traits, types, and configuration.
- encode
- Encode traits, types, and configuration.
- exif
- Structured EXIF/TIFF parsing, pruning, and serialization. Structured, borrowing EXIF/TIFF model: parse → inspect/prune → serialize.
- 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.
- icc
- Lightweight ICC profile inspection (tag extraction, no full parse). Lightweight ICC profile inspection.
Structs§
- Animation
Frame - A composited full-canvas animation frame, borrowing the decoder’s canvas.
- Cicp
- CICP color description (ITU-T H.273).
- Color
Emit Fields - Mechanism fields behind
ColorEmitPolicy::Custom. - Color
Emit Plan - A resolved plan for emitting an image’s color description on encode.
- 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.
- Metadata
Fields - Per-field metadata retention for
MetadataPolicy::Custom. - 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§
- Cicp
Emission - Whether CICP is emitted, behind
ColorEmitPolicy::Custom. - Color
Authority - Which color metadata a CMS should prefer when building transforms.
- Color
Emit Policy - How an image’s color description (ICC profile vs CICP code points) is emitted when encoding or transcoding — the obvious, intent-named knob.
- IccDisposition
- What to do with the ICC profile channel for one encode.
- IccRetention
- How to treat the ICC profile when filtering
Metadata. - Image
Format - Supported image formats.
- Image
Sequence - What kind of image sequence the file contains.
- Limit
Exceeded - A resource limit was exceeded.
- Metadata
Policy - Field-level metadata retention policy applied by
Metadata::filtered. - 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. - resolve_
color_ emit - Reconcile a source’s color description against a target’s capabilities under
a
ColorEmitPolicy, returning what to emit.