Expand description
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
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);
// 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\ncontainer signatureHEADchunk carrying width / height / depth / mipmap count / a 16-byte texture UUID and two pixel-format discriminator wordsFILLpadding chunks (skipped)- An
astcpayload 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.
Structs§
- AtxChunk
- A non-owning view of one chunk inside an AAPL container.
- AtxContainer
- A zero-copy view over a
.atxfile’s bytes. - AtxDecoder
- Lower-level decoder. Useful when you already hold a parsed header and payload, or want to tweak options between parsing and decoding.
- AtxHeader
- Parsed metadata from the
HEADchunk. - Chunk
Iter - Iterator over the chunks following the AAPL magic.
- Decode
Options - Options controlling the decode.
- Decoded
Image - An RGBA8 image produced by
decode/decode_with.
Enums§
- Astc
Footprint - All ASTC 2D block footprints, mirroring
astc-decode::Footprint. - AtxError
- Errors produced while parsing or decoding a
.atxfile. - Payload
Layout - How the raw ASTC blocks are laid out inside the
astcpayload. - Texture
Payload - Texture payload variants exposed by
AtxContainer::texture_payload.
Constants§
- AAPL_
MAGIC - 8-byte container signature:
b"AAPL\r\n\x1a\n". - ASTC_
TAG astcchunk tag — raw ASTC payload, optionally swizzled.- FILL_
TAG FILLchunk tag — zero-padding for GPU alignment.- HEAD_
TAG HEADchunk tag — texture metadata block.- LZFS_
TAG LZFSchunk tag — LZFSE-compressed ASTC payload (bvx2stream).
Functions§
- decode
- Convenience: parse + decode in one call, using default options
(ASTC 4×4, Apple macro-tiled Morton with
macro_blocks = 32). - decode_
to_ image - Decode an
.atxto animage::RgbaImage. - decode_
with - Convenience: parse + decode using custom options. Auto-detects the
payload variant (
astcchunk vs LZFSE-compressedLZFSchunk) and the appropriate default layout when the user did not specify one.