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

Function af_translate

src/api/c/transform.cpp:194–213  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

192}
193
194af_err af_translate(af_array *out, const af_array in, const float trans0,
195 const float trans1, const dim_t odim0, const dim_t odim1,
196 const af_interp_type method) {
197 try {
198 float trans_mat[6] = {1, 0, 0, 0, 1, 0};
199 trans_mat[2] = trans0;
200 trans_mat[5] = trans1;
201
202 const dim4 tdims(3, 2, 1, 1);
203 af_array t = 0;
204
205 AF_CHECK(
206 af_create_array(&t, trans_mat, tdims.ndims(), tdims.get(), f32));
207 AF_CHECK(af_transform(out, in, t, odim0, odim1, method, true));
208 AF_CHECK(af_release_array(t));
209 }
210 CATCHALL;
211
212 return AF_SUCCESS;
213}
214
215af_err af_scale(af_array *out, const af_array in, const float scale0,
216 const float scale1, const dim_t odim0, const dim_t odim1,

Callers 2

translateTestFunction · 0.50
translateFunction · 0.50

Calls 5

af_create_arrayFunction · 0.70
af_transformFunction · 0.70
af_release_arrayFunction · 0.70
ndimsMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected