code wiki / (root) / nx_gif_decode_t139.nx

nx_gif_decode_t139.nx

buildroot/runtime/nx_gif_decode_t139.nx

16476 B299 linesdepth 3pulls 3 transitivereach 6 importersview sourcekind librarytopic gif
docsdependenciesstructsconstsfunctions

about

nx_gif_decode.nx -- bounded GIF87a/89a image and sequential animation decoder. Checked rectangle RGBA, composed first-canvas RGBA, and sequential disposal-aware RGBA share one parser/LZW core. Iterator retains timing/loop metadata; it is NOT a GUI playback scheduler. Legacy opaque RGB/gray return their historical sys_mmap(logical_bytes+16) allocation; checked owned buffers use gif_release.

dependencies 1 imports · 4 importers

syscalls.nx nx_gif_decode_t139.nx nx_gif_animation_gate_t139.nx nx_gif_boundary_gate_t139.nx nx_gif_legacy_gate_t139.nx nx_img_bytes_to_rgb_gif_t139.nx

imports: syscalls.nx

imported by: nx_gif_animation_gate_t139.nxnx_gif_boundary_gate_t139.nxnx_gif_legacy_gate_t139.nxnx_img_bytes_to_rgb_gif_t139.nx

structs

none

consts

7const GIF_DICT: i64 = 4096
8const GIF_WORK_BYTES: i64 = 40960
9const GIF_OK_FIRST_IMAGE: i64 = 1
10const GIF_BAD_FORMAT: i64 = 2
11const GIF_UNSUPPORTED: i64 = 3
12const GIF_BAD_LZW: i64 = 4
13const GIF_NO_MEMORY: i64 = 5
14const GIF_NEEDS_ALPHA: i64 = 6
15const GIF_RELEASE_FAILED: i64 = 7
16const GIF_DONE: i64 = 8
17const GIF_BAD_ARGUMENT: i64 = 9
18const GIF_ANIM_WORDS: i64 = 32

functions

19func gif_u16le(buf: *u8, off: i64) -> i64 { return (buf[off] as i64) | ((buf[off+1] as i64)<<8) }
called by 1: gif_scan_from
20func gif_own_size(n: i64) -> i64 { if n<=NXA_SMALL_MAX { return NXA_SMALL_MAX+1 } return n }
21func gif_own(n: i64) -> *u8 { if n<=0 { return 0 as *u8 } let p: *u8=sys_mmap_shared(gif_own_size(n)); if (p as i64)<=0 { return 0 as *u8 } return p }
24func gif_release(p: *u8, n: i64) -> i64 { if p==(0 as *u8) { return 0 } return sys_munmap(p,gif_own_size(n)) }
27func gif_scan_from(raw: *u8, n: i64, info: *i64, start: i64, animation: *i64) -> i64
called by 2: gif_scangif_anim_next calls 1: gif_u16le
89func gif_scan(raw: *u8, n: i64, info: *i64) -> i64 { return gif_scan_from(raw,n,info,0,0 as *i64) }
91func gif_lzw(raw: *u8, info: *i64, idx: *u8, work: *u8) -> i64
144func gif_indices_from_info(raw: *u8, info: *i64) -> *u8
155func gif_indices_checked(raw: *u8, n: i64, info: *i64) -> *u8
160func gif_decode_core(raw: *u8, n: i64, meta: *i64) -> *u8
168func gif_convert_checked(raw: *u8, n: i64, wh: *i64, info: *i64, channels: i64) -> *u8
191func gif_decode_rgba_checked(raw: *u8, n: i64, wh: *i64, info: *i64) -> *u8 { return gif_convert_checked(raw,n,wh,info,4) }
called by 1: main calls 1: gif_convert_checked
192func gif_decode_opaque_owned(raw: *u8, n: i64, wh: *i64, channels: i64) -> *u8
200func gif_decode(raw: *u8, n: i64, wh: *i64) -> *u8 { return gif_decode_opaque(raw,n,wh,1) }
called by 2: mainmain calls 1: gif_decode_opaque
201func gif_decode_rgb(raw: *u8, n: i64, wh: *i64) -> *u8 { return gif_decode_opaque(raw,n,wh,3) }
209func gif_anim_close(st: *i64) -> i64
215func gif_anim_init(raw: *u8,n: i64,st: *i64,background_policy: i64) -> i64
235func gif_anim_next(st: *i64,info: *i64) -> i64
272func gif_decode_canvas_rgba(raw: *u8,n: i64,wh: *i64,info: *i64) -> *u8
290func gif_to_legacy(owned: *u8,bytes: i64) -> *u8
295func gif_decode_opaque(raw: *u8,n: i64,wh: *i64,channels: i64) -> *u8