Expand description
JBIG2 Encoder in Rust
This crate provides functionality to encode binary images into the JBIG2 format. It supports both standalone JBIG2 files and PDF-embedded fragments with proper global dictionary handling.
Re-exports§
pub use crate::jbig2arith::Jbig2ArithCoder;pub use jbig2enc::encode_document;pub use jbig2structs::Jbig2Config;
Modules§
- jbig2arith
- A pure Rust port of the context-adaptive arithmetic coder from jbig2enc.
This module provides low-level bit-level encoding for JBIG2, mirroring the
functionality of
jbig2arith.ccandjbig2arith.h. It is designed to be integrated into a larger JBIG2 encoding pipeline where binarization and preprocessing are already handled. - jbig2classify
- jbig2comparator
- jbig2comparator.rs
- jbig2context
- jbig2cost
- jbig2enc
- This module contains the main JBIG2 encoder logic.
- jbig2halftone
- JBIG2 Halftone Region Encoder
- jbig2shared
- Utility functions for the JBIG2 encoder
- jbig2structs
- jbig2sym
- This module defines the core data structures for JBIG2 symbols and bitmaps, and provides utilities for their manipulation, such as sorting for optimal dictionary encoding.
- jbig2unify
Macros§
Structs§
- Jbig2
Context - Context for JBIG2 encoding operations
- Jbig2
Encode Result - Result of JBIG2 encoding with separate global and page data for PDF embedding
Enums§
- Jbig2
Error - Errors that can occur during JBIG2 encoding
Functions§
- encode_
rois - Encodes a list of text-only binary PBM ROIs into JBIG2 streams.
- encode_
single_ image - Main encoding function that handles both standalone and PDF fragment modes
- encode_
single_ image_ lossless - Encodes a single binary image into JBIG2 format using lossless configuration.
- get_
build_ info - Get the build information string
- get_
version - Get the version string for the crate
Type Aliases§
- Array2
- two-dimensional array