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
66
67
//! # AnyDCode
//!
//! A from-scratch Rust library for **decoding and encoding 1D and 2D barcodes**,
//! aiming for the widest possible symbology coverage while preserving every
//! variation of a code.
//!
//! ## Design goals
//!
//! - **Lossless round-trip.** A decoded [`Symbol`] carries not just its payload but
//! the exact encoding decisions (segmentation, version/size, error-correction
//! level, mask, ...). Feeding a decoded symbol straight back into the encoder
//! reproduces the original symbol byte-for-byte. See [`codes::qr`].
//! - **Live-video ready.** The [`pipeline`] splits a cheap per-frame *detection*
//! pass from a heavier *analysis/decode* pass, and carries [`pipeline::Hints`]
//! forward so codes already decoded in earlier frames are not re-analyzed.
//! - **Portable input.** The video boundary is a borrowed luminance buffer
//! ([`GrayFrame`]); callers own capture and color conversion.
//!
//! ## Status
//!
//! The full [`Symbology`] catalog is modeled, but only [`Symbology::QrCode`] is
//! implemented so far. Query [`Symbology::is_implemented`] at runtime.
//!
//! ## Example: QR round-trip
//!
//! ```
//! use anyd::codes::qr::{EcLevel, QrDecoder, QrEncoder};
//! use anyd::traits::{Decode, Encode};
//!
//! let encoder = QrEncoder::new();
//! let symbol = encoder.build_text("HELLO WORLD", EcLevel::Q).unwrap();
//! let encoding = encoder.encode(&symbol).unwrap();
//!
//! let decoded = QrDecoder::new().decode(&encoding).unwrap();
//! assert_eq!(decoded.text().as_deref(), Some("HELLO WORLD"));
//! // Re-encoding the decoded symbol yields the identical matrix.
//! assert_eq!(encoder.encode(&decoded).unwrap(), encoding);
//! ```
// Unsafe is forbidden everywhere except the raw-wasm FFI shim (the `wasm` feature),
// which needs it to hand buffers across the JS boundary. Library consumers never
// enable `wasm`, so the guarantee holds for them.
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;