nx_apng.nx
buildroot/runtime/nx_apng.nx
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
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
| 9 | const K_MAGIC_65521: i64 = 65521 |
| 10 | const K_MAGIC_65536: i64 = 65536 |
functions
| 12 | func ap_crc32(buf: *u8, off: i64, len: i64) -> i64 called by 1: ap_chunk |
| 23 | func ap_adler32(buf: *u8, off: i64, len: i64) -> i64 called by 1: ap_fb_to_zlib |
| 28 | func 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 } |
| 29 | func 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 |
| 30 | func ap_paeth(a: i64, b: i64, c: i64) -> i64 called by 1: ap_fb_to_zlib |
| 39 | func 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 |
| 40 | func 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 |
| 45 | func ap_fb_to_zlib(fb: *i64, w: i64, h: i64, z: *u8) -> i64 |
| 114 | func ap_chunk(p: *u8, o: i64, a: i64, b: i64, c: i64, d: i64, data: *u8, dlen: i64) -> i64 |
| 126 | func apng_open(p: *u8, w: i64, h: i64, nframes: i64) -> i64 |
| 138 | func apng_frame(p: *u8, o: i64, seqp: *i64, fb: *i64, w: i64, h: i64, delay_cs: i64, first: i64) -> i64 |
| 159 | func apng_close(p: *u8, o: i64) -> i64 |