AVIF

Optional, headless Ziran image package. Handwritten decoder policy, transforms, API and CLI are .zi. The initial AV1/container decoding engine is a pinned external libavif bridge; this is not an authored AV1 decoder or a speed claim. No Kryon, window system, browser, or GUI library is required.

#import "avif/api"
options := DefaultOptions()
result := Decode(BorrowBytes(bytes), options)
// Check result.is_ok before using result.image, an owned std/image.Image.

From a consumer, add https://github.com/ziranlang/avif.git with ziran add. The manifest pins libavif, dav1d (the default engine) and libaom (the oracle) source packages, plus the av1 package with the authored AV1 decoder. Local canonical checkout overrides belong in ignored ziran.local.toml. Production lockfiles resolve committed package and toolchain revisions.

Run the package suite in this checkout:

build-queue -- sh tests/avif.sh
build-queue -- sh tests/bmff.sh

The test harness uses the canonical sibling Ziran checkout when available; otherwise set ZIRAN_ROOT to a built current toolchain. It builds a real consumer of this package, resolves its exports and requests its native artifact through ziran pkg artifact avif:native --platform linux-x86_64-gnu. Standalone module-path tests additionally verify source and saved .zir.

The stable headless command produced by the suite is:

build/bin/avif tests/fixtures/rgba8.avif build/output.rgba

It writes tight straight-alpha RGBA8 and prints dimensions, source depth, source frame count and alpha presence. Errors have stable shared error codes. See implementation and verification status, API, native recipe and fixture provenance.

S
Description
AVIF image decoder and command-line tools.
Readme BSD-3-Clause
536 KiB
0 Stars 1 Watchers 0 Forks
Languages
Ziran 63.7%
Python 19.4%
Shell 9.3%
CMake 4.5%
C 2.8%
Other 0.3%