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

Function transform

src/backend/opencl/transform.cpp:19–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17
18template<typename T>
19void transform(Array<T> &out, const Array<T> &in, const Array<float> &tf,
20 const af_interp_type method, const bool inverse,
21 const bool perspective) {
22 // TODO: Temporary Fix, must fix handling subarrays upstream
23 // tf has to be linear, although offset is allowed.
24 const Array<float> tf_Lin = tf.isLinear() ? tf : copyArray(tf);
25
26 switch (method) {
27 case AF_INTERP_NEAREST:
28 case AF_INTERP_LOWER:
29 kernel::transform<T>(out, in, tf_Lin, inverse, perspective, method,
30 1);
31 break;
32 case AF_INTERP_BILINEAR:
33 case AF_INTERP_BILINEAR_COSINE:
34 kernel::transform<T>(out, in, tf_Lin, inverse, perspective, method,
35 2);
36 break;
37 case AF_INTERP_BICUBIC:
38 case AF_INTERP_BICUBIC_SPLINE:
39 kernel::transform<T>(out, in, tf_Lin, inverse, perspective, method,
40 3);
41 break;
42 default: AF_ERROR("Unsupported interpolation type", AF_ERR_ARG);
43 }
44}
45
46#define INSTANTIATE(T) \
47 template void transform(Array<T> &out, const Array<T> &in, \

Callers 2

getOpenCLCDeviceVersionFunction · 0.70
getKernelCacheFilenameFunction · 0.70

Calls 2

copyArrayFunction · 0.70
isLinearMethod · 0.45

Tested by

no test coverage detected