code wiki / (root) / nx_img_resample.nx

nx_img_resample.nx

buildroot/runtime/nx_img_resample.nx

5246 B123 linesdepth 3pulls 3 transitivereach 4 importersview sourcekind librarytopic img
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_img_scale.nx nx_img_resample.nx nx_img_adapt_gate.nx nx_img_resample_gate.nx nx_media_convert.nx nx_media_convert_jpeg_gate.nx

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

16const NX_MAGIC_32768: i64 = 32768
17const NX_MAGIC_65536: i64 = 65536
18const NX_MAGIC_131072: i64 = 131072
19const NX_MAGIC_8589934592: i64 = 8589934592
20const NX_MAGIC_17179869184: i64 = 17179869184
22const NX_RS_NEAREST: i64 = 0
23const NX_RS_BILINEAR: i64 = 1
24const NX_RS_BICUBIC: i64 = 2
25const NX_RS_N: i64 = 3

functions

28func nx_img_scale_nearest(src: *u8, sw: i64, sh: i64, nc: i64,
59func _bicubic_w(t: i64, b: *i64) -> i64
69func nx_img_scale_bicubic(src: *u8, sw: i64, sh: i64, nc: i64,
117func nx_img_resample(model: i64, src: *u8, sw: i64, sh: i64, nc: i64,