Skip to main content

Crate zencodec

Crate zencodec 

Source
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 types
  • decode — decoder traits, streaming/animation decode, dyn dispatch, output types
  • Root — shared types used by both encode and decode paths

§Shared types (root)

§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§

AnimationFrame
A composited full-canvas animation frame, borrowing the decoder’s canvas.
Cicp
CICP color description (ITU-T H.273).
ColorEmitFields
Mechanism fields behind ColorEmitPolicy::Custom.
ColorEmitPlan
A resolved plan for emitting an image’s color description on encode.
ContentLightLevel
HDR content light level metadata (CEA-861.3 / CTA-861-H).
Extensions
A type-map storing multiple independently-typed extension values.
ImageFormatDefinition
Describes an image format’s metadata, capabilities, and detection logic.
ImageFormatRegistry
A collection of ImageFormatDefinitions with lookup methods.
ImageInfo
Image metadata obtained from probing or decoding.
MasteringDisplay
Mastering display color volume metadata (SMPTE ST 2086).
Metadata
Owned image metadata for encode/decode roundtrip.
MetadataFields
Per-field metadata retention for MetadataPolicy::Custom.
OwnedAnimationFrame
A composited full-canvas animation frame with owned pixel data.
Resolution
Physical pixel resolution (DPI or pixels-per-unit).
ResourceLimits
Resource limits for encode/decode operations.
SourceColor
Source color description from the image file.
StopToken
Owned, clonable, type-erased stop token.
Supplements
Supplemental content that accompanies the primary image(s).
Unstoppable
A Stop implementation that never stops (no cooperative cancellation).
Unsupported
Stub type for codecs that don’t support an operation.

Enums§

CicpEmission
Whether CICP is emitted, behind ColorEmitPolicy::Custom.
ColorAuthority
Which color metadata a CMS should prefer when building transforms.
ColorEmitPolicy
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.
ImageFormat
Supported image formats.
ImageSequence
What kind of image sequence the file contains.
LimitExceeded
A resource limit was exceeded.
MetadataPolicy
Field-level metadata retention policy applied by Metadata::filtered.
Orientation
Image orientation — the 8-element D4 dihedral group.
OrientationHint
How the decoder should handle orientation during decode.
ResolutionUnit
Unit for Resolution values.
ThreadingPolicy
Threading policy for codec operations.
UnsupportedOperation
Identifies an operation that a codec does not support.

Traits§

CodecErrorExt
Extension trait for inspecting codec errors.
SourceEncodingDetails
Codec-agnostic interface for source encoding properties.

Functions§

find_cause
Walk an error’s source() chain to find a cause of type T.
resolve_color_emit
Reconcile a source’s color description against a target’s capabilities under a ColorEmitPolicy, returning what to emit.