nx_gif_decode_t139.nx
buildroot/runtime/nx_gif_decode_t139.nx
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
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
| 7 | const GIF_DICT: i64 = 4096 |
| 8 | const GIF_WORK_BYTES: i64 = 40960 |
| 9 | const GIF_OK_FIRST_IMAGE: i64 = 1 |
| 10 | const GIF_BAD_FORMAT: i64 = 2 |
| 11 | const GIF_UNSUPPORTED: i64 = 3 |
| 12 | const GIF_BAD_LZW: i64 = 4 |
| 13 | const GIF_NO_MEMORY: i64 = 5 |
| 14 | const GIF_NEEDS_ALPHA: i64 = 6 |
| 15 | const GIF_RELEASE_FAILED: i64 = 7 |
| 16 | const GIF_DONE: i64 = 8 |
| 17 | const GIF_BAD_ARGUMENT: i64 = 9 |
| 18 | const GIF_ANIM_WORDS: i64 = 32 |
functions
| 19 | func gif_u16le(buf: *u8, off: i64) -> i64 { return (buf[off] as i64) | ((buf[off+1] as i64)<<8) } called by 1: gif_scan_from |
| 20 | func gif_own_size(n: i64) -> i64 { if n<=NXA_SMALL_MAX { return NXA_SMALL_MAX+1 } return n } |
| 21 | func 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 } |
| 24 | func gif_release(p: *u8, n: i64) -> i64 { if p==(0 as *u8) { return 0 } return sys_munmap(p,gif_own_size(n)) } |
| 27 | func gif_scan_from(raw: *u8, n: i64, info: *i64, start: i64, animation: *i64) -> i64 |
| 89 | func gif_scan(raw: *u8, n: i64, info: *i64) -> i64 { return gif_scan_from(raw,n,info,0,0 as *i64) } |
| 91 | func gif_lzw(raw: *u8, info: *i64, idx: *u8, work: *u8) -> i64 called by 1: gif_indices_from_info |
| 144 | func gif_indices_from_info(raw: *u8, info: *i64) -> *u8 |
| 155 | func gif_indices_checked(raw: *u8, n: i64, info: *i64) -> *u8 |
| 160 | func gif_decode_core(raw: *u8, n: i64, meta: *i64) -> *u8 |
| 168 | func gif_convert_checked(raw: *u8, n: i64, wh: *i64, info: *i64, channels: i64) -> *u8 called by 3: maingif_decode_rgba_checkedgif_decode_opaque_owned calls 3: gif_indices_checkedgif_releasegif_own |
| 191 | func gif_decode_rgba_checked(raw: *u8, n: i64, wh: *i64, info: *i64) -> *u8 { return gif_convert_checked(raw,n,wh,info,4) } |
| 192 | func gif_decode_opaque_owned(raw: *u8, n: i64, wh: *i64, channels: i64) -> *u8 |
| 200 | func gif_decode(raw: *u8, n: i64, wh: *i64) -> *u8 { return gif_decode_opaque(raw,n,wh,1) } |
| 201 | func gif_decode_rgb(raw: *u8, n: i64, wh: *i64) -> *u8 { return gif_decode_opaque(raw,n,wh,3) } |
| 209 | func gif_anim_close(st: *i64) -> i64 |
| 215 | func gif_anim_init(raw: *u8,n: i64,st: *i64,background_policy: i64) -> i64 |
| 235 | func gif_anim_next(st: *i64,info: *i64) -> i64 called by 2: maingif_decode_canvas_rgba calls 4: gif_scan_fromgif_indices_from_infogif_owngif_release |
| 272 | func gif_decode_canvas_rgba(raw: *u8,n: i64,wh: *i64,info: *i64) -> *u8 called by 1: nx_img_bytes_decode_result calls 5: gif_owngif_anim_initgif_anim_nextgif_anim_closegif_release |
| 290 | func gif_to_legacy(owned: *u8,bytes: i64) -> *u8 |
| 295 | func gif_decode_opaque(raw: *u8,n: i64,wh: *i64,channels: i64) -> *u8 |