Skip to main content

manifold/
lib.rs

1//! Manifold: lossless RGB8 shared-patch-atlas image codecs (MNF5/6/7/8).
2//!
3//! NOTE on names: the published *package* is `manifold-codec`, but the lib
4//! target is `manifold` (the original crate name, kept for path stability).
5//! Depend on `manifold-codec` in Cargo.toml and import as `manifold`:
6//!
7//! ```toml
8//! [dependencies]
9//! manifold-codec = "1.3"
10//! ```
11//! ```no_run
12//! use manifold::codec::Dims;
13//! ```
14//! Entry points:
15//! - [`codec`]: MNF5 (v0.5 format) encode/decode; [`codec::DecodeLimits`].
16//! - [`mnf6`]: MNF6/7 (zstd container, planar, YCoCg, color modes) —
17//!   [`mnf6::encode_mnf7`]/[`mnf6::decode_mnf7`] + configurable ceilings
18//!   ([`mnf6::decode_mnf7_with_limits`]).
19//! - [`mnf8`]: MNF8 (backend byte: zlib/zstd-19, planar, FLAG_PRED_MED,
20//!   FLAG_TOKENS, branch predictors, balanced|maximum profiles) —
21//!   [`mnf8::encode_mnf8`]/[`mnf8::decode_mnf8`].
22//! - [`mnf9`]: MNF9 exact-generative whole-frame format (ADR-007) —
23//!   [`mnf9::encode_exact`] (None when no rule fits; the CLI pick emits an
24//!   MNF9-magic file only when it wins) / [`mnf9::decode_mnf9`].
25//! - [`refdecode`]: independent MNF5 decoder used by the differential tests.
26//! - [`error`]: the shared error/`Result` type for every fallible op.
27//!
28//! Decoding is deterministic integer arithmetic (no float, no allocation
29//! beyond the pixel buffer). Formats are frozen at v1.x; malformed input
30//! returns [`error::Error::Format`], never a panic.
31#![warn(missing_docs)]
32/// MNF5 (v0.5 format): atlas codec, zlib container.
33pub mod codec;
34/// Shared error and `Result` types for the whole library.
35pub mod error;
36/// Image-I/O shims (JPEG/PNG load, PNG save) — `image-io` feature.
37#[cfg(feature = "image-io")]
38pub mod img;
39/// MNF13-R5: the dual-timescale adaptive mix coder — MNF8 backend id 4
40/// (fixed-point dual-EWA estimators, zero model transport; docs/mnf13-r5.md).
41pub mod mix_coder;
42/// MNF6/7: zstd container, planar packing, YCoCg + modular color modes. `decode_mnf7` accepts both magics.
43pub mod mnf6;
44/// MNF8: versioned backend-byte container (zlib/zstd-19/mix), profiles, `FLAG_PRED_MED`.
45pub mod mnf8;
46/// Independent MNF5 decoder (differential-testing instrument).
47pub mod refdecode;
48/// LZ77-2D token engine (MNF8 `FLAG_TOKENS`; the retained ladder arm).
49pub mod tokens;
50
51/// MNF9 exact generative whole-frame records (ADR-007; Track A).
52pub mod mnf9;