code wiki / (root) / nx_gif_decode.nx

nx_gif_decode.nx

buildroot/runtime/nx_gif_decode.nx

7685 B181 linesdepth 3pulls 3 transitivereach 41 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_gif_decode.nx -- sovereign GIF87a/89a decoder (LZW). Core decodes to palette INDICES with de-interlace row permutation (GIF interlace = 4 passes: rows 0,8,.. / 4,12,.. / 2,6,.. / 1,3,..), then two consumers: gif_decode (w*h Rec.709 grayscale -- the historic perceptual-hash contract) and gif_decode_rgb (w*h*3 palette COLOR -- the chokepoint/browser path; before this, every GIF lost its palette to an R=G=B expand and interlaced GIFs rendered visually scrambled). First image descriptor only (animated GIF = first frame). Returns 0 on non-GIF/failure. All bindings `var` where reassigned (let is immutable in nx_cc). license_tier: ORIGINAL

dependencies 1 imports · 7 importers

syscalls.nx nx_gif_decode.nx nx_archive_media_recovery.nx nx_gif_color_gate.nx nx_gif_decode_gate.nx nx_image_gray.nx nx_img_bytes_to_rgb.nx nx_media_exclusion_enforce_gate.nx nx_recovery_guard.nx

imports: syscalls.nx

imported by: nx_archive_media_recovery.nxnx_gif_color_gate.nxnx_gif_decode_gate.nxnx_image_gray.nxnx_img_bytes_to_rgb.nxnx_media_exclusion_enforce_gate.nxnx_recovery_guard.nx

structs

none

consts

9const K_MAGIC_4096: i64 = 4096

functions

11func gif_u16le(buf: *u8, off: i64) -> i64 { return (buf[off] as i64) | ((buf[off+1] as i64)<<8) }
called by 1: gif_decode_core
15func gif_decode_core(raw: *u8, n: i64, meta: *i64) -> *u8
called by 2: gif_decodegif_decode_rgb calls 1: gif_u16le
133func gif_decode(raw: *u8, n: i64, out_wh: *i64) -> *u8
157func gif_decode_rgb(raw: *u8, n: i64, out_wh: *i64) -> *u8