code wiki / (root) / nx_f32_image_to_bmp.nx

nx_f32_image_to_bmp.nx

buildroot/runtime/nx_f32_image_to_bmp.nx

5311 B128 linesdepth 4pulls 7 transitivereach 0 importersview sourcekind tooltopic f32
docsdependenciesstructsconstsfunctions

about

nx_f32_image_to_bmp.nx -- sovereign 24-bit BMP writer: f32 CHW RGB [0,1] -> a Windows-viewable .bmp file. The pipeline's missing last mile: every media path (image/video-frame/try-on/decode) ends in an f32 RGB buffer that nothing turned into a viewable file. This writes a standard 24-bit BMP (BM header + BGR, bottom-up, rows padded to 4B). f32->byte is done sovereignly (no f32->int intrinsic exists): clamp[0,1], *255, +0.5, then 128..1 binary decomposition via nx_f32_lt. Gated by re-reading the written file. license_tier: ORIGINAL

dependencies 5 imports · 0 importers

nx_syscalls.nx nx_le.nx nx_f32.nx nx_f32_div.nx nx_f32_cvt.nx nx_f32_image_to_bmp.nx

imports: nx_syscalls.nxnx_le.nxnx_f32.nxnx_f32_div.nxnx_f32_cvt.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap nx_i32_to_f32 nx_f32_chw_to_bmp sys_mmap ↻ nx_le_write_u32 nx_le_write_u16 img_f32_to_byte nx_f32_add nx_f32_classify nx_f32_exp_field nx_f32_mant_field nx_f32_sign nx_f32_mant_field ↻ nx_f32_exp_field ↻ nx_f32_mul nx_f32_classify ↻ nx_f32_sign ↻ nx_f32_mant_field ↻ nx_f32_exp_field ↻ nx_i32_to_f32 ↻ nx_f32_lt nx_f32_is_nan nx_f32_classify ↻ nx_f32_is_zero nx_f32_classify ↻ nx_f32_sub nx_f32_add ↻ nx_f32_neg sys_openat_wr sys_write sys_close sys_openat_rd sys_read sys_close ↻ nx_le_read_u32 nx_f32_div nx_f32_classify ↻ nx_f32_sign ↻ nx_f32_mant_field ↻

structs

none

consts

13const K_MAGIC_2835: i64 = 2835

functions

16func img_f32_to_byte(v: i64) -> i64
34func nx_f32_chw_to_bmp(rgb: *i64, H: i64, W: i64, path: *u8) -> i64
86func main() -> i64