code wiki / (root) / nx_manga_page.nx

nx_manga_page.nx

buildroot/runtime/nx_manga_page.nx

12088 B264 linesdepth 11pulls 49 transitivereach 0 importersview sourcekind tooltopic manga
docsdependenciesstructsconstsfunctions

about

nx_manga_page.nx -- R1 KEYSTONE of the mangagen lane (comparewatch- contracts mangagen_mp_page_emit + mangagen_mp_layout_rows): compose N input images onto ONE manga page PNG from a DATA-DRIVEN layout row. Layouts are rows, never code (house law): layouts.conf line: name|pageW|pageH|border|order|x,y,w,h;x,y,w,h;... panel rects are PER-MILLE of the page; order rtl reverses the input->panel mapping (manga read order); border = black frame thickness px drawn inside each panel rect. FAIL-CLOSED: input count != panel count REFUSES (a page with empty or silently-dropped panels is a wrong artifact wearing a clean filename); unknown layout REFUSES naming the conf and the ask. Partition is PRINTED per the R1 accept rule: every input placed exactly once, panel<-input mapping. usage: nx_manga_page <layouts.conf> <layout> <out.png> <img1> ... <imgN> license_tier: ORIGINAL expect_exit: 0

dependencies 4 imports · 0 importers

nx_str.nx nx_syscalls.nx nx_img_to_rgb.nx nx_png_write.nx nx_manga_page.nx

imports: nx_str.nxnx_syscalls.nxnx_img_to_rgb.nxnx_png_write.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main mp_puts sys_write nx_str_len sys_exit sys_mmap nxa_die sys_write ↻ sys_exit ↻ nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ mp_layout_rows sys_mmap ↻ mp_read sys_openat_rd sys_read sys_close mp_int mp_pi sys_mmap ↻ sys_write ↻ mp_page_emit sys_mmap ↻ nx_img_to_rgb sys_mmap ↻ sys_read_file sys_openat_rd ↻ sys_lseek sys_mmap ↻ sys_read ↻ sys_munmap

structs

none

consts

16const MP_MAXP: i64 = 24
17const MP_CONFCAP: i64 = 65536

functions

18func mp_puts(s: *u8) -> i64 { sys_write(1, s, nx_str_len(s)); return 0 }
19func mp_pi(v: i64) -> i64
called by 2: mp_page_emitmain calls 2: sys_mmapsys_write
32func mp_read(path: *u8, buf: *u8, cap: i64) -> i64
39func mp_int(buf: *u8, a: i64, b: i64) -> i64
called by 1: mp_layout_rows
55func mp_layout_rows(confpath: *u8, name: *u8, meta: *i64, rects: *i64) -> i64
called by 1: main calls 3: sys_mmapmp_readmp_int
122func mp_draw(page: *u8, PW: i64, ox: i64, oy: i64, fw: i64, fh: i64, src: *u8, sw: i64, sh: i64) -> i64
called by 1: mp_page_emit
164func mp_hline(page: *u8, PW: i64, x0: i64, x1: i64, y: i64) -> i64
called by 1: mp_page_emit
169func mp_vline(page: *u8, PW: i64, x: i64, y0: i64, y1: i64) -> i64
called by 1: mp_page_emit
177func mp_page_emit(meta: *i64, rects: *i64, paths: *i64, n: i64, outp: *u8) -> i64
234func main(argc: i64, argv: *i64) -> i64