code wiki / (root) / nx_apng.nx

nx_apng.nx

buildroot/runtime/nx_apng.nx

7301 B162 linesdepth 3pulls 3 transitivereach 15 importersview sourcekind librarytopic apng
docsdependenciesstructsconstsfunctions

about

nx_apng.nx -- SOVEREIGN ANIMATED PNG (APNG) encoder: our PNG codec extended with the animation-control chunks (acTL / fcTL / fdAT) so a sequence of framebuffers becomes ONE browser-native looping "video" file -- no 3rd-party video encoder. Each frame is filtered + DEFLATE-compressed exactly like a PNG IDAT (reuses the nx_deflate_enc + the standard PNG scanline filters). This is the swap+motion S3 "show it in a VIDEO" surface; the real inter-frame vcodec (nx_video_codec_wasm) is the production rung. Incremental API: apng_open -> apng_frame x N -> apng_close. All integer, deterministic. license_tier: ORIGINAL

dependencies 2 imports · 13 importers

nx_syscalls.nx nx_deflate_enc.nx nx_apng.nx nx_apng_decode_gate.nx nx_creature_motion_gate.nx nx_explode3d_gate.nx nx_lipsync_gate.nx nx_mechparts_gate.nx nx_motion_neural_gate.nx nx_motion_photo_gate.nx nx_motion_video_gate.nx nx_newmoves_gate.nx nx_quad_gaits_gate.nx

diagram shows first 10 each side; +0 more imports, +3 more importers in the complete lists below.

imports: nx_syscalls.nxnx_deflate_enc.nx

imported by: nx_apng_decode_gate.nxnx_creature_motion_gate.nxnx_explode3d_gate.nxnx_lipsync_gate.nxnx_mechparts_gate.nxnx_motion_neural_gate.nxnx_motion_photo_gate.nxnx_motion_video_gate.nxnx_newmoves_gate.nxnx_quad_gaits_gate.nxnx_synth_serve.nxnx_text2motion_gate.nxnx_wolf_walk_gate.nx

structs

none

consts

9const K_MAGIC_65521: i64 = 65521
10const K_MAGIC_65536: i64 = 65536

functions

12func ap_crc32(buf: *u8, off: i64, len: i64) -> i64
called by 1: ap_chunk
23func ap_adler32(buf: *u8, off: i64, len: i64) -> i64
called by 1: ap_fb_to_zlib
28func ap_be32(b: *u8, o: i64, v: i64) -> i64 { b[o]=((v>>24)&0xff) as u8; b[o+1]=((v>>16)&0xff) as u8; b[o+2]=((v>>8)&0xff) as u8; b[o+3]=(v&0xff) as u8; return 0 }
29func ap_be16(b: *u8, o: i64, v: i64) -> i64 { b[o]=((v>>8)&0xff) as u8; b[o+1]=(v&0xff) as u8; return 0 }
called by 1: apng_frame
30func ap_paeth(a: i64, b: i64, c: i64) -> i64
called by 1: ap_fb_to_zlib
39func ap_sabs(v: i64) -> i64 { var x: i64 = v & 0xff; if x > 127 { x = 256 - x } return x }
called by 1: ap_fb_to_zlib
40func ap_g(img: *u8, w3: i64, r: i64, j: i64) -> i64 { if r < 0 { return 0 } if j < 0 { return 0 } return img[r * w3 + j] as i64 }
called by 1: ap_fb_to_zlib
45func ap_fb_to_zlib(fb: *i64, w: i64, h: i64, z: *u8) -> i64
114func ap_chunk(p: *u8, o: i64, a: i64, b: i64, c: i64, d: i64, data: *u8, dlen: i64) -> i64
126func apng_open(p: *u8, w: i64, h: i64, nframes: i64) -> i64
138func apng_frame(p: *u8, o: i64, seqp: *i64, fb: *i64, w: i64, h: i64, delay_cs: i64, first: i64) -> i64
159func apng_close(p: *u8, o: i64) -> i64