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//!   balanced|maximum profiles) — [`mnf8::encode_mnf8`]/[`mnf8::decode_mnf8`].
21//! - [`refdecode`]: independent MNF5 decoder used by the differential tests.
22//! - [`error`]: the shared error/`Result` type for every fallible op.
23//!
24//! Decoding is deterministic integer arithmetic (no float, no allocation
25//! beyond the pixel buffer). Formats are frozen at v1.x; malformed input
26//! returns [`error::Error::Format`], never a panic.
27#![warn(missing_docs)]
28/// MNF5 (v0.5 format): atlas codec, zlib container.
29pub mod codec;
30/// Shared error and `Result` types for the whole library.
31pub mod error;
32/// Image-I/O shims (JPEG/PNG load, PNG save) — `image-io` feature.
33#[cfg(feature = "image-io")]
34pub mod img;
35/// MNF6/7: zstd container, planar packing, YCoCg + modular color modes. `decode_mnf7` accepts both magics.
36pub mod mnf6;
37/// MNF8: versioned backend-byte container (zlib/zstd-19), profiles, `FLAG_PRED_MED`.
38pub mod mnf8;
39/// Independent MNF5 decoder (differential-testing instrument).
40pub mod refdecode;
41/// LZ77-2D token engine (MNF8 `FLAG_TOKENS`; the retained ladder arm).
42pub mod tokens;