Epic: #113 · Milestone: MC4 — Display & 2D
Why
Posters, backdrops, album art and the Photos library are images. No decoder exists in the OS tree; packages/image/ in the compiler repo has png/jpeg/webp/avif/heic decoders in Zig with Home bindings (ADR #45). A 4K poster wall must not decode 30 full-size JPEGs per screen.
Tasks
- Freestanding build of
image(png, jpeg baseline+progressive, webp lossy/lossless; avif/heic later) — part of #82. - JPEG DCT-domain downscale (1/2, 1/4, 1/8) and PNG/WebP row-streaming into a target size; EXIF orientation.
- Thumbnail cache on disk keyed by (path, mtime, size) under
/var/cache/thumbs; background decode thread with priority for on-screen tiles; memory cap (32 MB) with LRU. - Photos: slideshow with crossfade using the compositor's alpha layer; Ken-Burns off by default (budget).
Acceptance
Decoding a 2000×3000 poster to a 300×450 tile ≤ 15 ms on the Pi; scrolling a 200-poster grid stays within the frame budget with cache warm; conformance images (PngSuite, libjpeg test set) decode bit-exact on x86 CI.