1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//! Pure-Rust JPEG 2000 codec, built GRIB2-decode-first toward OpenJPEG-level
//! coverage. No C dependency, so it cross-compiles cleanly to every target.
//!
//! JPEG 2000 (ISO/IEC 15444-1 and later parts) is a large standard. The first
//! deliverable decodes the slice GRIB2 §5.40 (`grid_jpeg`) needs, which keeps
//! the initial surface tractable while exercising the whole pipeline:
//!
//! - the **raw codestream** (Annex A), not yet the JP2 file format (no boxes);
//! - a **single component** (one scalar grid), so no multi-component or color
//! transform (MCT) yet;
//! - **integer** samples, signed or unsigned, up to 32 bits;
//! - **both** the reversible 5/3 (lossless) and irreversible 9/7 (lossy)
//! wavelet paths (the 9/7 path is graded by re-encoding a real grid with
//! OpenJPEG, since no operational GRIB2 producer ships lossy 9/7).
//!
//! Multi-component/color, JP2 boxes, HTJ2K, and an encoder are later-phase
//! work, not permanent non-goals. See `docs/roadmap.md` and `docs/scope.md`.
//!
//! # Pipeline
//!
//! ```text
//! bytes ─▶ codestream ─▶ tier-2 ─▶ tier-1 ─▶ dequant ─▶ inverse DWT ─▶ Image
//! (markers) (packets) (MQ+EBCOT) (quant) (5/3 | 9/7)
//! ```
//!
//! Each stage is a module below. [`decode`] wires them together.
//!
//! # Status
//!
//! Phase 1 complete: the GRIB2 §5.40 decode path is implemented end to end and
//! passes the conformance gate (bit-exact 5/3, within tolerance 9/7). See each
//! module's docs for the ISO §reference and what it owns. Correctness is defined
//! by the conformance harness in `tests/` (cross-check against OpenJPEG /
//! eccodes), not by self-consistency. Later phases widen this same engine toward
//! general Part 1; see `docs/roadmap.md` and `docs/scope.md`.
pub use ;
pub use Image;
/// Decode a JPEG 2000 **codestream** (Annex A, no JP2 wrapper) into a single
/// integer-component [`Image`].
///
/// This is the whole public surface for the GRIB2 use case: the §7 data
/// section of a `grid_jpeg` message is exactly such a codestream.