nx_img_resample.nx
buildroot/runtime/nx_img_resample.nx
about
nx_img_resample.nx -- selectable-model image resampler (the "easily
selectable models" ask). One entry point picks the model by id:
nx_img_resample(model, src, sw, sh, nc, dst, dw, dh)
NEAREST -> nx_img_scale_nearest (this file)
BILINEAR -> nx_img_scale_bilinear (nx_img_scale.nx, reused)
BICUBIC -> nx_img_scale_bicubic (this file, Catmull-Rom 16-tap)
All sovereign, hardware-rung-up (pure i64 fixed-point). New models (Lanczos,
and later a neural upscaler once the accel lock breaks) slot in as new ids.
Reuses _img_clamp / _img_srccoord / NX_IMG_Q from nx_img_scale (DRY #15).
license_tier: ORIGINAL
dependencies 2 imports · 4 importers
imports: nx_syscalls.nxnx_img_scale.nx
imported by: nx_img_adapt_gate.nxnx_img_resample_gate.nxnx_media_convert.nxnx_media_convert_jpeg_gate.nx
structs
| none |
consts
| 16 | const NX_MAGIC_32768: i64 = 32768 |
| 17 | const NX_MAGIC_65536: i64 = 65536 |
| 18 | const NX_MAGIC_131072: i64 = 131072 |
| 19 | const NX_MAGIC_8589934592: i64 = 8589934592 |
| 20 | const NX_MAGIC_17179869184: i64 = 17179869184 |
| 22 | const NX_RS_NEAREST: i64 = 0 |
| 23 | const NX_RS_BILINEAR: i64 = 1 |
| 24 | const NX_RS_BICUBIC: i64 = 2 |
| 25 | const NX_RS_N: i64 = 3 |
functions
| 28 | func nx_img_scale_nearest(src: *u8, sw: i64, sh: i64, nc: i64, |
| 59 | func _bicubic_w(t: i64, b: *i64) -> i64 called by 1: nx_img_scale_bicubic |
| 69 | func nx_img_scale_bicubic(src: *u8, sw: i64, sh: i64, nc: i64, |
| 117 | func nx_img_resample(model: i64, src: *u8, sw: i64, sh: i64, nc: i64, |