code wiki / (root) / nx_imgfacts.nx

nx_imgfacts.nx

buildroot/runtime/nx_imgfacts.nx

6743 B175 linesdepth 11pulls 50 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_imgfacts.nx -- per-asset DIMENSIONS + bytes for a gathered corpus, and a real GALLERY page. The operator's question is a product question, not a plumbing one: "are we getting too small of images?" A contact sheet cannot answer it -- every tile is normalised to the same box, so a 120px thumbnail and a 3000px original look identical. This decodes each asset for its TRUE pixel size, reports the distribution, and emits a gallery that shows every image at its own scale with its dimensions stated. usage: nx_imgfacts <dir> <out.html> <url-prefix> [title]

dependencies 4 imports · 0 importers

nx_str.nx nx_syscalls.nx nx_dir.nx nx_img_to_rgb.nx nx_imgfacts.nx

imports: nx_str.nxnx_syscalls.nxnx_dir.nxnx_img_to_rgb.nx

imported by: nobody (leaf or entry point)

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

main if_puts sys_write nx_str_len sys_exit sys_mmap nx_dir_list nx_openat nx_dirent_read nx_dirent_iter nx_dir_is_dotlike nx_dir_name_strlen nx_dir_arena_copy_name if_cat nx_dir_row_at nx_dir_row_is_regular_file if_fsize sys_mmap ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close nx_img_to_rgb sys_mmap ↻ sys_read_file ↻ nx_img_bytes_to_rgb sys_mmap ↻ nx_jpeg_decode_rgb sys_mmap ↻ nx_jpeg_dec_ctx_init sys_mmap ↻ _jpeg_ascii_probe_sof sys_mmap ↻ nx_jpeg_seg_init nx_jpeg_seg_next nx_jpeg_classify_marker nx_jpeg_marker_is_lengthle nx_jpeg_sof_parse

structs

none

consts

14const IF_MAGIC_1024: i64 = 1024
16const IF_MAXROWS: i64 = 4096
17const IF_ARENA: i64 = 1048576
18const IF_PATH: i64 = 4096
19const IF_HTML: i64 = 4194304

functions

21func if_puts(s: *u8) -> i64 { sys_write(1, s, nx_str_len(s)); return 0 }
called by 1: main calls 2: sys_writenx_str_len
23func if_num(v: i64, o: *u8) -> i64
called by 2: if_piif_catn calls 1: sys_mmap
36func if_pi(v: i64) -> i64 { let o: *u8 = sys_mmap(32); let n: i64 = if_num(v, o); sys_write(1, o, n); return 0 }
called by 1: main calls 3: sys_mmapif_numsys_write
38func if_cat(dst: *u8, off: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { dst[off+i] = s[i]; i = i + 1 } return off + i }
called by 1: main
39func if_catb(dst: *u8, off: i64, s: *u8, n: i64) -> i64 { var i: i64 = 0; while i < n { dst[off+i] = s[i]; i = i + 1 } return off + n }
called by 2: if_catnmain
40func if_catn(dst: *u8, off: i64, v: i64) -> i64 { let o: *u8 = sys_mmap(32); let n: i64 = if_num(v, o); return if_catb(dst, off, o, n) }
called by 1: main calls 3: sys_mmapif_numif_catb
42func if_fsize(path: *u8) -> i64
called by 1: main calls 2: sys_mmapsys_read_file
49func main(argc: i64, argv: *i64) -> i64