__device__ __forceinline__ void pack_tsdf (float tsdf, int weight, short2& value) { int fixedp = max (-DIVISOR, min (DIVISOR, __float2int_rz (tsdf * DIVISOR))); //int fixedp = __float2int_rz(tsdf * DIVISOR); value = make_short2 (fixedp, weight); }
__device__ __forceinline__ elem_type operator ()(float y, float x) const { return src(__float2int_rz(y), __float2int_rz(x)); }
__device__ __forceinline__ void pack_tsdf (float tsdf, short & value) { value = max(-DIVISOR, min(DIVISOR, __float2int_rz(tsdf * DIVISOR))); }
__device__ __forceinline__ void clear_voxel(short & value) { value = max(-DIVISOR, min(DIVISOR, __float2int_rz(0 * DIVISOR))); }