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
68
//! A reference implementation of the LUMEN print file format, version 1.0.
//!
//! LUMEN is the Open Resin Alliance's resin (MSLA) print format; the normative
//! specification lives beside this crate, in `spec/`. This crate is a consumer
//! of that text, not a substitute for it: where the specification and this code
//! disagree, the specification wins, and the conformance corpus under
//! `test-vectors/` is what settles the argument.
//!
//! # Shape
//!
//! - [`container`] - the file header, chunk directory and trailer.
//! - [`chunks`] - one codec per chunk type.
//! - [`json`] - the typed `META`, `PROF` and `LROV` models.
//! - [`ree`] - run-end encoded layer masks: binary, grayscale and split.
//! - [`timing`] - the per-layer settings pipeline of section 8.
//! - [`crypto`] - `AUTH`, the AEAD units, Argon2id and X25519 key wrapping.
//! - [`validate`] - the checks of section 11, named as the corpus names them.
//! - [`reader`] - [`reader::LumenFile`], including random access to one layer.
//! - [`writer`] - [`writer::Encoder`], which produces a conforming file.
//!
//! # Reading
//!
//! ```no_run
//! use lumen::{reader::LumenFile, validate::Level};
//!
//! let bytes = std::fs::read("print.lumen").unwrap();
//! let file = LumenFile::open(&bytes, Level::Loose).unwrap();
//! println!("{} layers", file.layer_count());
//! let layer = file.layer(0).unwrap();
//! println!("{:?}", layer.tag);
//! ```
//!
//! # Two tiers
//!
//! [`reader::LumenFile`] decodes what a caller asks for and nothing else: a
//! layer is fetched by index, which decompresses only the `LAYR` chunk that
//! holds it. A firmware reader can open the file, read `META` and the layer
//! table, and stream layers through a fixed-size buffer without ever
//! materializing the whole file. A slicer can instead use [`writer::Encoder`],
//! which trains the zstd dictionary, frames the chunks and assembles the
//! directory.
pub use Check;
pub use ;
pub use ;
pub use ;
pub use LumenFile;
pub use ;
pub use ;
pub use Encoder;