Expand description
JPEG XL encoder in pure Rust.
This crate provides a complete JPEG XL encoder implementation, supporting both lossless (modular) and lossy (VarDCT) encoding modes.
Re-exports§
pub use api::AnimationFrame;pub use api::AnimationParams;pub use api::EncodeError;pub use api::EncodeMode;pub use api::EncodeRequest;pub use api::EncodeResult;pub use api::EncodeStats;pub use api::EncoderMode;pub use api::ImageMetadata;pub use api::Limits;pub use api::LosslessConfig;pub use api::LosslessEncoder;pub use api::LossyConfig;pub use api::LossyEncoder;pub use api::Lz77Method;pub use api::PixelLayout;pub use api::ProgressiveMode;pub use api::Quality;pub use api::calibrated_jxl_quality;pub use api::quality_to_distance;pub use effort::EffortProfile;pub use headers::color_encoding::CIExy;pub use headers::color_encoding::ColorEncoding;pub use headers::color_encoding::ColorSpace;pub use headers::color_encoding::CustomPrimaries;pub use headers::color_encoding::Primaries;pub use headers::color_encoding::RenderingIntent;pub use headers::color_encoding::TransferFunction;pub use headers::color_encoding::WhitePoint;
Modules§
- api
- Three-layer public API: Config → Request → Encoder.
- bit_
writer - BitWriter for encoding JPEG XL bitstreams.
- color
- Color space transforms for JPEG XL encoding.
- container
- JXL container format (ISOBMFF boxes) for metadata embedding.
- debug_
rect - Spatial decision logging for encoder debugging.
- effort
- Centralized effort-derived encoder decisions.
- entropy_
coding - Entropy coding for JPEG XL encoder.
- error
- Error types for the JPEG XL encoder.
- headers
- Header structures and serialization for JPEG XL.
- image
- Image buffer types for the JPEG XL encoder.
- modular
- Modular encoding for JPEG XL.
- trace
- Zero-cost bitstream tracing for debugging encoder output.
- vardct
- VarDCT (lossy) encoder for JPEG XL.
Macros§
- at
- Start tracing an error with crate metadata for repository links.
- debug_
eprintln - debug_
log - Debug log macro - writes to
<temp_dir>/jxl_enc_debug.logwhen debug-tokens feature is enabled. - debug_
log_ flush - Debug log macro that also flushes (use sparingly, for important checkpoints).
- debug_
rect - No-op version when feature is disabled — still evaluates arguments to suppress unused variable warnings, but the optimizer eliminates everything.
- skip_
without_ binary - Skip the current test if the given external binary is not available.
- skip_
without_ corpus - Skip the current test if the codec corpus is not available.
- trace_
bytes - trace_
note - trace_
section - trace_
write
Structs§
- At
- An error with location tracking - wraps any error type.
- Spline
- A spline with control points, color DCT coefficients, and sigma DCT.
- Spline
Point - A control point on a spline curve.
- Unstoppable
- A
Stopimplementation that never stops (no cooperative cancellation).
Constants§
- BLOCK_
DIM - DCT block dimension (8x8 blocks).
- BLOCK_
SIZE - Size of a single DCT block (64 coefficients).
- GROUP_
DIM - Group dimension in pixels (256x256 groups).
- JXL_
SIGNATURE - JXL signature bytes.
Traits§
- Result
AtExt - Extension trait for adding location tracking to
Result<T, At<E>>. - Stop
- Cooperative cancellation check.
Functions§
- at
- Wrap any value in
At<E>and capture the caller’s location.