code wiki / (root) / nx_lensdist.nx

nx_lensdist.nx

buildroot/runtime/nx_lensdist.nx

8827 B196 linesdepth 4pulls 6 transitivereach 1 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_lensdist.nx -- Models and corrects radial lens distortion in images using fixed-point arithmetic.

dependencies 2 imports · 1 importers

nx_planesweep.nx nx_vecmath.nx nx_lensdist.nx nx_distcal.nx

imports: nx_planesweep.nxnx_vecmath.nx

imported by: nx_distcal.nx

structs

none

consts

20const LD_Q: i64 = 16384 // Q14, matching R3_Q so the two mix without rescaling
21const LD_ITERS: i64 = 12 // fixed-point iterations for the inverse
22const LD_SUB: i64 = 256 // sub-pixel resolution carried THROUGH the inverse iteration

functions

25func ld_factor(rn: i64, k1: i64, k2: i64) -> i64
31func ld_isqrt(v: i64) -> i64 { return vm_isqrt(v) }
33func ld_distort(u: i64, v: i64, k1: i64, k2: i64, rref: i64, out2: *i64) -> i64
50func ld_undistort(ud: i64, vd: i64, k1: i64, k2: i64, rref: i64, out2: *i64) -> i64
called by 1: ld_render calls 3: ld_isqrtld_factorld_round
71func ld_round(fx: i64) -> i64
called by 1: ld_undistort
77func ld_render(cx: i64, cy: i64, cz: i64, basis: *i64, f: i64, zp: i64, w: i64, h: i64, k1: i64, k2: i64, rref: i64, img: *i64) -> i64
108func ld_distort_fx(u: i64, v: i64, k1: i64, k2: i64, rref: i64, out2: *i64) -> i64
called by 1: ld_correct_bl calls 2: ld_isqrtld_factor
119func ld_floordiv(a: i64, b: i64) -> i64
called by 1: ld_bilinear
127func ld_bilinear(src: *i64, w: i64, h: i64, xfx: i64, yfx: i64) -> i64
called by 1: ld_correct_bl calls 2: ld_floordivps_at
146func ld_correct_bl(src: *i64, dst: *i64, w: i64, h: i64, k1: i64, k2: i64, rref: i64) -> i64
173func ld_correct(src: *i64, dst: *i64, w: i64, h: i64, k1: i64, k2: i64, rref: i64) -> i64
calls 2: ld_distortps_at