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
//! Data Matrix (ISO/IEC 16022) ECC 200 encoder and structural decoder.
//!
//! Layout:
//! - [`gf`] — GF(256) arithmetic (primitive `0x12D`) and Reed–Solomon.
//! - `tables` — the spec's per-size data/EC codeword and region geometry.
//! - `placement` — Annex F module placement and finder/timing borders.
//! - `encode` — [`Symbol`] → [`BitMatrix`].
//! - `decode` — [`BitMatrix`] → [`Symbol`].
//!
//! # Scope
//!
//! Square symbol sizes 10×10 … 144×144 are implemented, including the multi-region
//! larger sizes and interleaved Reed–Solomon blocks. Data encodation covers **ASCII**
//! (with digit-pair packing and upper shift) and **Base256** for arbitrary bytes.
//! C40 / Text / X12 / EDIFACT encodation and the rectangular symbol sizes are not
//! implemented.
//!
//! # Losslessness
//!
//! [`DataMatrixEncoder::build`] splits the payload into a *canonical* alternating
//! sequence of ASCII runs (bytes `< 128`) and Base256 runs (bytes `>= 128`). This is
//! exactly the segmentation the decoder reconstructs from the codeword stream, so
//! `encode(decode(encoding)) == encoding` holds. Segments always use [`Mode::Byte`];
//! [`DataMatrixMeta`] records the square size and the per-segment encodation.
//!
//! [`Symbol`]: crate::Symbol
//! [`BitMatrix`]: crate::output::BitMatrix
//! [`Mode::Byte`]: crate::segment::Mode::Byte
pub use DataMatrixDecoder;
pub use DataMatrixEncoder;
pub use ;
/// The data-encodation scheme used for one segment.
/// Data Matrix parameters needed to re-encode a symbol identically.