Skip to main content

Crate jxl_encoder

Crate jxl_encoder 

Source
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.log when 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.
SplinePoint
A control point on a spline curve.
Unstoppable
A Stop implementation 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§

ResultAtExt
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.