nx_f32_image_to_bmp.nx
buildroot/runtime/nx_f32_image_to_bmp.nx
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
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
structs
| none |
consts
| 13 | const K_MAGIC_2835: i64 = 2835 |
functions
| 16 | func img_f32_to_byte(v: i64) -> i64 |
| 34 | func nx_f32_chw_to_bmp(rgb: *i64, H: i64, W: i64, path: *u8) -> i64 called by 1: main calls 7: sys_mmapnx_le_write_u32nx_le_write_u16img_f32_to_bytesys_openat_wrsys_write+1 |
| 86 | func main() -> i64 |