MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / get_pixel

Function get_pixel

src/backend/cuda/kernel/orb.hpp:200–213  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

198
199template<typename T>
200inline __device__ T get_pixel(unsigned x, unsigned y, const float ori,
201 const unsigned size, const int dist_x,
202 const int dist_y, CParam<T> image,
203 const unsigned patch_size) {
204 float ori_sin = sin(ori);
205 float ori_cos = cos(ori);
206 float patch_scl = (float)size / (float)patch_size;
207
208 // Calculate point coordinates based on orientation and size
209 x += round(dist_x * patch_scl * ori_cos - dist_y * patch_scl * ori_sin);
210 y += round(dist_x * patch_scl * ori_sin + dist_y * patch_scl * ori_cos);
211
212 return image.ptr[x * image.dims[0] + y];
213}
214
215inline __device__ int lookup(const int n, cudaTextureObject_t tex) {
216 return tex1Dfetch<int>(tex, n);

Callers 1

extract_orbFunction · 0.70

Calls 3

sinFunction · 0.85
cosFunction · 0.85
roundFunction · 0.85

Tested by

no test coverage detected