openjph_core/params/mod.rs
1//! JPEG 2000 codestream parameter marker segments (SIZ, COD, QCD, etc.)
2//!
3//! Port of `ojph_params.h`, `ojph_params_local.h`, and `ojph_params.cpp`.
4//!
5//! These types represent the marker segments that form the main header of a
6//! JPEG 2000 Part 15 (HTJ2K) codestream:
7//!
8//! | Type | Marker | Description |
9//! |------|--------|-------------|
10//! | [`ParamSiz`] | SIZ | Image and tile size, component info |
11//! | [`ParamCod`] | COD/COC | Coding style defaults / per-component |
12//! | [`ParamQcd`] | QCD/QCC | Quantization defaults / per-component |
13//! | [`ParamCap`] | CAP | Extended capabilities |
14//! | [`ParamSot`] | SOT | Start of tile-part header |
15//! | [`ParamTlm`] | TLM | Tile-part length marker |
16//! | [`ParamNlt`] | NLT | Non-linearity point transformation |
17//! | [`ParamDfs`] | DFS | Downsampling factor styles |
18//! | [`CommentExchange`] | COM | Comment marker data |
19//!
20//! # Configuration example
21//!
22//! ```rust
23//! use openjph_core::params::{ParamSiz, ParamCod};
24//! use openjph_core::codestream::Codestream;
25//! use openjph_core::types::{Point, Size};
26//!
27//! let mut cs = Codestream::new();
28//!
29//! // Configure image geometry
30//! cs.access_siz_mut().set_image_extent(Point::new(1920, 1080));
31//! cs.access_siz_mut().set_num_components(3);
32//! for c in 0..3 {
33//! cs.access_siz_mut().set_comp_info(c, Point::new(1, 1), 8, false);
34//! }
35//! cs.access_siz_mut().set_tile_size(Size::new(1920, 1080));
36//!
37//! // Configure coding style
38//! cs.access_cod_mut().set_num_decomposition(5);
39//! cs.access_cod_mut().set_reversible(true);
40//! cs.access_cod_mut().set_color_transform(true);
41//! ```
42
43pub(crate) mod local;
44
45// Re-export public types
46pub use local::{
47 CommentExchange, ParamCap, ParamCod, ParamDfs, ParamNlt, ParamQcd, ParamSiz, ParamSot,
48 ParamTlm, ProfileNum, ProgressionOrder, TtlmPtlmPair,
49};