Skip to main content

Crate jbig2enc_rust

Crate jbig2enc_rust 

Source
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.cc and jbig2arith.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§

debug
trace

Structs§

Jbig2Context
Context for JBIG2 encoding operations
Jbig2EncodeResult
Result of JBIG2 encoding with separate global and page data for PDF embedding

Enums§

Jbig2Error
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