| 17 | |
| 18 | template<typename T> |
| 19 | void 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, \ |
no test coverage detected