code wiki / (root) / nx_manga_bubble.nx

nx_manga_bubble.nx

buildroot/runtime/nx_manga_bubble.nx

15909 B350 linesdepth 11pulls 51 transitivereach 0 importersview sourcekind tooltopic manga
docsdependenciesstructsconstsfunctions

about

nx_manga_bubble.nx -- R2 of the mangagen lane (comparewatch- contract mangagen_mb_bubble_draw): SPEECH BUBBLES onto a manga page. Composes the incumbents rather than re-implementing any of them: nx_aa_raster aa_render -- the anti-aliased polygon fill (nonzero winding, CW fills) nx_nishi_font_core nf_draw_text_mem / nf_adv_px -- OUR OWN stroke letterforms and their metrics nx_img_to_rgb / nx_png_write -- the page in, the page out THE DONE-RULE, pre-declared on /compare/mangagen before a line of this was written: "Bubble geometry + tails + sovereign TTF raster; overflow REFUSES, never silently clips." So text that cannot fit the bubble's inner box is a REFUSAL naming the measured overflow -- never a silent crop, never a shrink-to-fit that quietly rewrites the author's lettering. usage: nx_manga_bubble <in.png|blank:WxH> <out.png> <cx> <cy> <rx> <ry> <tipx> <tipy> <tdir 0-23> <ch> <text...> license_tier: ORIGINAL expect_exit: 0

dependencies 6 imports · 0 importers

nx_str.nx nx_syscalls.nx nx_aa_raster.nx nx_png_write.nx nx_img_to_rgb.nx nx_nishi_font_core.nx nx_manga_bubble.nx

imports: nx_str.nxnx_syscalls.nxnx_aa_raster.nxnx_png_write.nxnx_img_to_rgb.nxnx_nishi_font_core.nx

imported by: nobody (leaf or entry point)

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

main mb_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 ↻ mb_atoi nx_img_to_rgb sys_mmap ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close nx_img_bytes_to_rgb sys_mmap ↻ nx_jpeg_decode_rgb sys_mmap ↻ nx_jpeg_dec_ctx_init sys_mmap ↻ nx_jpeg_ctx_tables_reset nx_jpeg_ctx_htable_at nx_jpeg_ctx_htable_bind nx_jpeg_ctx_qtable_at

structs

none

consts

18const MB_MAGIC_8192: i64 = 8192
26const MB_N: i64 = 24
27const MB_SS: i64 = 4
29const MB_INSCRIBED_PERMIL: i64 = 707
31const MB_STROKE_DEFAULT: i64 = 3
32const MB_LEAD_DIV: i64 = 4
33const MB_MARGIN_PX: i64 = 8
34const MB_INK_R: i64 = 16
35const MB_INK_G: i64 = 16
36const MB_INK_B: i64 = 20
37const MB_PAPER: i64 = 255
38const MB_TEXT_INK: i64 = 0
39const MB_MASK: i64 = 1048576
40const MB_PTS: i64 = 512
41const MB_LINES: i64 = 24

functions

42func mb_puts(s: *u8) -> i64 { sys_write(1, s, nx_str_len(s)); return 0 }
43func mb_pi(v: i64) -> i64
58func mb_atoi(s: *u8) -> i64
called by 1: main
74func mb_tables(cs: *i64, sn: *i64) -> i64
called by 1: mb_bubble_draw
86func mb_ring(xs: *i64, ys: *i64, cst: *i64, cln: *i64, gb: *i64, cs: *i64, sn: *i64, cx: i64, cy: i64, rx: i64, ry: i64) -> i64
called by 1: mb_bubble_draw
102func mb_tail(xs: *i64, ys: *i64, cst: *i64, cln: *i64, gb: *i64, cs: *i64, sn: *i64, spec: *i64, grow: i64) -> i64
called by 1: mb_bubble_draw
127func mb_cov(fb: *i64, W: i64, H: i64, cov: *u8, ir: i64, ig: i64, ib: i64) -> i64
called by 1: mb_bubble_draw
149func mb_wrap(txt: *u8, tlen: i64, adv: i64, boxw: i64, ls: *i64, le: *i64) -> i64
called by 1: mb_bubble_draw
188func mb_bubble_draw(fb: *i64, W: i64, H: i64, spec: *i64, txt: *u8, tlen: i64, mask: *u8) -> i64
258func main(argc: i64, argv: *i64) -> i64