| 82 | } |
| 83 | |
| 84 | af_err af_transform_coordinates(af_array *out, const af_array tf, |
| 85 | const float d0_, const float d1_) { |
| 86 | try { |
| 87 | const ArrayInfo &tfInfo = getInfo(tf); |
| 88 | dim4 tfDims = tfInfo.dims(); |
| 89 | ARG_ASSERT(1, |
| 90 | (tfDims[0] == 3 && tfDims[1] == 3 && tfDims.ndims() == 2)); |
| 91 | |
| 92 | af_array output; |
| 93 | af_dtype type = tfInfo.getType(); |
| 94 | switch (type) { |
| 95 | case f32: |
| 96 | output = transform_coordinates<float>(tf, d0_, d1_); |
| 97 | break; |
| 98 | case f64: |
| 99 | output = transform_coordinates<double>(tf, d0_, d1_); |
| 100 | break; |
| 101 | default: TYPE_ERROR(1, type); |
| 102 | } |
| 103 | std::swap(*out, output); |
| 104 | } |
| 105 | CATCHALL; |
| 106 | |
| 107 | return AF_SUCCESS; |
| 108 | } |
no test coverage detected