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
//! PNG codec for `otf-pixels`, implemented from scratch.
//!
//! Includes its own DEFLATE implementation per ADR-0010: PNG *is* mostly
//! DEFLATE, so depending on a compression crate would reduce "PNG from
//! scratch" to "PNG container parsing from scratch".
//!
//! Every parser here reads attacker-controlled bytes and returns errors rather
//! than panicking. `unsafe_code = "forbid"` means the classic decompressor
//! failure — an out-of-bounds write through a back-reference — is
//! unrepresentable rather than merely avoided.
pub use ;
pub use PngEncoder;
pub use ;
// Re-exported rather than defined here: ADR-0012 moved the compression
// primitives to `otf-pixels-compress` once TIFF and GIF became consumers of
// them. They stay in this crate's public surface so nothing downstream breaks.
pub use ;
/// Translate a compression failure into this crate's error type.
///
/// `otf-pixels-compress` deliberately does not depend on `otf-pixels-core`
/// (ADR-0012), so the mapping to a stable [`ErrorCode`] lives here, where the
/// format context is known.
///
/// [`ErrorCode`]: otf_pixels_core::ErrorCode
pub