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

Function transform

src/backend/oneapi/transform.cpp:20–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

evalNodesFunction · 0.70

Calls 2

copyArrayFunction · 0.70
isLinearMethod · 0.45

Tested by

no test coverage detected