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
//! Parser and decoder for Apple `.atx` texture archives.
//!
//! The `.atx` format is an AAPL-container (RIFF-style chunked file) that
//! wraps ASTC-compressed image data. It is produced by Apple tooling and
//! surfaces in third-party forensic exports such as Cellebrite UFED.
//!
//! # Quick start
//!
//! ```no_run
//! use std::fs;
//!
//! let bytes = fs::read("snapshot.atx").unwrap();
//!
//! // High-level API — returns RGBA8 pixels at the original (width, height).
//! let img = atx_reader::decode(&bytes).unwrap();
//! assert_eq!(img.pixels.len(), (img.width * img.height * 4) as usize);
//!
//! # #[cfg(feature = "image")]
//! # {
//! // With the `image` feature, you can save directly:
//! let rgba = atx_reader::decode_to_image(&bytes).unwrap();
//! rgba.save("snapshot.png").unwrap();
//! # }
//! ```
//!
//! # What this crate decodes
//!
//! The format was reverse-engineered from real `.atx` samples. The current
//! implementation handles the layout used by iOS lock-screen / thumbnail
//! exports:
//!
//! - `AAPL\r\n\x1a\n` container signature
//! - `HEAD` chunk carrying width / height / depth / mipmap count / a 16-byte
//! texture UUID and two pixel-format discriminator words
//! - `FILL` padding chunks (skipped)
//! - An `astc` payload chunk holding raw ASTC blocks laid out in Apple's
//! macro-tiled Morton ordering
//!
//! Single-mip, single-layer, 2D, ASTC 4×4 is the default decoding path. The
//! lower-level [`AtxContainer`] / [`AtxDecoder`] API exposes everything else
//! (chunk iteration, format codes, custom footprint, custom payload layout)
//! for callers that need to support new samples.
pub use ;
pub use AstcFootprint;
pub use ;
pub use ;
pub use decode_to_image;