OpenJPH-RS — Pure Rust HTJ2K (JPEG 2000 Part 15) codec.
This crate is a faithful port of the OpenJPH C++ library (v0.26.3) providing encoding and decoding of HTJ2K codestreams as defined in ISO/IEC 15444-15.
Overview
The main entry point is [codestream::Codestream], which provides both the
encoder (write) and decoder (read) pipeline. Image parameters are configured
through marker segment types in the [params] module.
Quick Start — Encoding
use Codestream;
use MemOutfile;
use ;
let = ;
let pixels: = vec!;
let mut cs = new;
cs.access_siz_mut.set_image_extent;
cs.access_siz_mut.set_num_components;
cs.access_siz_mut.set_comp_info;
cs.access_siz_mut.set_tile_size;
cs.access_cod_mut.set_num_decomposition;
cs.access_cod_mut.set_reversible;
cs.access_cod_mut.set_color_transform;
cs.set_planar;
let mut outfile = new;
cs.write_headers.unwrap;
for y in 0..height as usize
cs.flush.unwrap;
let encoded = outfile.get_data;
assert!;
Quick Start — Decoding
# use Codestream;
# use ;
# use ;
# let = ;
# let pixels: = vec!;
# let mut cs = new;
# cs.access_siz_mut.set_image_extent;
# cs.access_siz_mut.set_num_components;
# cs.access_siz_mut.set_comp_info;
# cs.access_siz_mut.set_tile_size;
# cs.access_cod_mut.set_num_decomposition;
# cs.access_cod_mut.set_reversible;
# cs.access_cod_mut.set_color_transform;
# cs.set_planar;
# let mut outfile = new;
# cs.write_headers.unwrap;
# for y in 0..height as usize
# cs.flush.unwrap;
# let encoded = outfile.get_data.to_vec;
let mut infile = new;
let mut decoder = new;
decoder.read_headers.unwrap;
decoder.create.unwrap;
for _y in 0..height
Modules
| Module | Description |
|---|---|
[types] |
Numeric aliases, geometric primitives (Size, Point, Rect) |
[error] |
Error types ([OjphError]) and [Result] alias |
[message] |
Diagnostic message dispatch (info/warn/error) |
[arch] |
CPU feature detection and alignment constants |
[mem] |
Aligned allocators and line buffers |
file |
I/O traits and file/memory stream implementations |
[params] |
JPEG 2000 marker segment types (SIZ, COD, QCD, NLT, …) |
[codestream] |
Main codec interface (Codestream) |
[arg] |
Minimal CLI argument interpreter |
[coding] |
HTJ2K block entropy coding (internal) |
[transform] |
Wavelet and color transforms (internal) |