MeVisLab Toolbox Reference
mlModuleMacros.h
Go to the documentation of this file.
1/*************************************************************************************
2**
3** Copyright 2007, MeVis Medical Solutions AG
4**
5** The user may use this file in accordance with the license agreement provided with
6** the Software or, alternatively, in accordance with the terms contained in a
7** written agreement between the user and MeVis Medical Solutions AG.
8**
9** For further information use the contact form at https://www.mevislab.de/contact
10**
11**************************************************************************************/
12
13#ifndef ML_MODULE_MACROS_H
14#define ML_MODULE_MACROS_H
15
16#include <mlMacros.h>
17
20
21//-------------------------------------------------------------------------
22// MACROS to simplify module programming
23//-------------------------------------------------------------------------
24
25//------------------------------------------------------------------------------------
27//------------------------------------------------------------------------------------
28#define ML_EMPTY_PARAM
29
30//------------------------------------------------------------------------------------
32//------------------------------------------------------------------------------------
33#define ML_INSTANTIATE_STANDARD_SIGNED_INT_TYPES(PASSED_CODE) \
34 PASSED_CODE(MLint8); \
35 PASSED_CODE(MLint16); \
36 PASSED_CODE(MLint32); \
37 PASSED_CODE(MLint64);
38
39//------------------------------------------------------------------------------------
41//------------------------------------------------------------------------------------
42#define ML_INSTANTIATE_STANDARD_UNSIGNED_INT_TYPES(PASSED_CODE) \
43 PASSED_CODE(MLuint8); \
44 PASSED_CODE(MLuint16); \
45 PASSED_CODE(MLuint32); \
46 PASSED_CODE(MLuint64);
47
48//------------------------------------------------------------------------------------
50//------------------------------------------------------------------------------------
51#define ML_INSTANTIATE_STANDARD_INT_TYPES(PASSED_CODE) \
52 ML_INSTANTIATE_STANDARD_SIGNED_INT_TYPES(PASSED_CODE) \
53 ML_INSTANTIATE_STANDARD_UNSIGNED_INT_TYPES(PASSED_CODE)
54
55//------------------------------------------------------------------------------------
57//------------------------------------------------------------------------------------
58#define ML_INSTANTIATE_STANDARD_FLOAT_TYPES(PASSED_CODE) \
59 PASSED_CODE(MLfloat); \
60 PASSED_CODE(MLdouble);
61
62//------------------------------------------------------------------------------------
81//------------------------------------------------------------------------------------
82#define ML_INSTANTIATE_STANDARD_TYPES(PASSED_CODE) \
83 ML_INSTANTIATE_STANDARD_INT_TYPES(PASSED_CODE) \
84 ML_INSTANTIATE_STANDARD_FLOAT_TYPES(PASSED_CODE)
85
86//------------------------------------------------------------------------------------
88//------------------------------------------------------------------------------------
89#define ML_INSTANTIATE_DEFAULT_EXTENDED_TYPES(PASSED_CODE) \
90 PASSED_CODE(std::complex<MLfloat>); \
91 PASSED_CODE(std::complex<MLdouble>); \
92 PASSED_CODE(Vector2f); \
93 PASSED_CODE(Vector2d); \
94 PASSED_CODE(Vector3f); \
95 PASSED_CODE(Vector3d); \
96 PASSED_CODE(Vector6f); \
97 PASSED_CODE(Vector6d); \
98 PASSED_CODE(Matrix2f); \
99 PASSED_CODE(Matrix2d); \
100 PASSED_CODE(Matrix3f); \
101 PASSED_CODE(Matrix3d);
102
103//------------------------------------------------------------------------------------
106//------------------------------------------------------------------------------------
107#define ML_INSTANTIATE_ALL_TYPES(PASSED_CODE) \
108 ML_INSTANTIATE_STANDARD_TYPES(PASSED_CODE) \
109 ML_INSTANTIATE_DEFAULT_EXTENDED_TYPES(PASSED_CODE)
110
111
112//------------------------------------------------------------------------------------
145//------------------------------------------------------------------------------------
146#define ML_IMPLEMENT_ALL_CASES(CLASS_NAME, SWITCH_CODE, O_SWITCH_TYPE, INFO_STRING, DUMMY_OUT_TYPE) \
147 switch(O_SWITCH_TYPE){ \
148 case MLint8Type: SWITCH_CODE(MLint8 , MLint8 , CLASS_NAME); break; \
149 case MLuint8Type: SWITCH_CODE(MLuint8 , MLuint8 , CLASS_NAME); break; \
150 case MLint16Type: SWITCH_CODE(MLint16 , MLint16 , CLASS_NAME); break; \
151 case MLuint16Type: SWITCH_CODE(MLuint16 , MLuint16 , CLASS_NAME); break; \
152 case MLint32Type: SWITCH_CODE(MLint32 , MLint32 , CLASS_NAME); break; \
153 case MLuint32Type: SWITCH_CODE(MLuint32 , MLuint32 , CLASS_NAME); break; \
154 case MLint64Type: SWITCH_CODE(MLint64 , MLint64 , CLASS_NAME); break; \
155 case MLuint64Type: SWITCH_CODE(MLuint64 , MLuint64 , CLASS_NAME); break; \
156 case MLfloatType: SWITCH_CODE(MLfloat , MLfloat , CLASS_NAME); break; \
157 case MLdoubleType: SWITCH_CODE(MLdouble , MLdouble , CLASS_NAME); break; \
158 case MLComplexfType: SWITCH_CODE(std::complex<MLfloat> , std::complex<MLfloat> , CLASS_NAME); break; \
159 case MLComplexdType: SWITCH_CODE(std::complex<MLdouble>, std::complex<MLdouble>, CLASS_NAME); break; \
160 case MLVector2fType: SWITCH_CODE(Vector2f , Vector2f , CLASS_NAME); break; \
161 case MLVector2dType: SWITCH_CODE(Vector2d , Vector2d , CLASS_NAME); break; \
162 case MLVector3fType: SWITCH_CODE(Vector3f , Vector3f , CLASS_NAME); break; \
163 case MLVector3dType: SWITCH_CODE(Vector3d , Vector3d , CLASS_NAME); break; \
164 case MLVector6fType: SWITCH_CODE(Vector6f , Vector6f , CLASS_NAME); break; \
165 case MLVector6dType: SWITCH_CODE(Vector6d , Vector6d , CLASS_NAME); break; \
166 case MLMatrix2fType: SWITCH_CODE(Matrix2f , Matrix2f , CLASS_NAME); break; \
167 case MLMatrix2dType: SWITCH_CODE(Matrix2d , Matrix2d , CLASS_NAME); break; \
168 case MLMatrix3fType: SWITCH_CODE(Matrix3f , Matrix3f , CLASS_NAME); break; \
169 case MLMatrix3dType: SWITCH_CODE(Matrix3d , Matrix3d , CLASS_NAME); break; \
170 default: { ML_PRINT_FATAL_ERROR(INFO_STRING, ML_BAD_DATA_TYPE, "Unsupported type case."); break; \
171 } \
172 }
173
174//------------------------------------------------------------------------------------
176//------------------------------------------------------------------------------------
177#define ML_IMPLEMENT_SCALAR_TYPE_CASES(CLASS_NAME, SWITCH_CODE, O_SWITCH_TYPE, INFO_STRING, DUMMY_OUT_TYPE) \
178 switch(O_SWITCH_TYPE){ \
179 case MLint8Type: SWITCH_CODE(MLint8 , MLint8 , CLASS_NAME); break; \
180 case MLuint8Type: SWITCH_CODE(MLuint8 , MLuint8 , CLASS_NAME); break; \
181 case MLint16Type: SWITCH_CODE(MLint16 , MLint16 , CLASS_NAME); break; \
182 case MLuint16Type: SWITCH_CODE(MLuint16 , MLuint16 , CLASS_NAME); break; \
183 case MLint32Type: SWITCH_CODE(MLint32 , MLint32 , CLASS_NAME); break; \
184 case MLuint32Type: SWITCH_CODE(MLuint32 , MLuint32 , CLASS_NAME); break; \
185 case MLint64Type: SWITCH_CODE(MLint64 , MLint64 , CLASS_NAME); break; \
186 case MLuint64Type: SWITCH_CODE(MLuint64 , MLuint64 , CLASS_NAME); break; \
187 case MLfloatType: SWITCH_CODE(MLfloat , MLfloat , CLASS_NAME); break; \
188 case MLdoubleType: SWITCH_CODE(MLdouble , MLdouble , CLASS_NAME); break; \
189 default: { ML_PRINT_FATAL_ERROR(INFO_STRING, ML_BAD_DATA_TYPE, "Unsupported type case."); break; \
190 } \
191 }
192
193//------------------------------------------------------------------------------------
223//------------------------------------------------------------------------------------
224#define ML_IMPLEMENT_DIFFERENT_INOUT_DATATYPES_CASES(CLASS_NAME, SWITCH_CODE, IN_SWITCH_TYPE, INFO_STRING, OUTPUT_TYPE) \
225 switch (static_cast<int>(IN_SWITCH_TYPE)){ \
226 case MLint8Type: SWITCH_CODE(OUTPUT_TYPE, MLint8 , CLASS_NAME); break; \
227 case MLuint8Type: SWITCH_CODE(OUTPUT_TYPE, MLuint8 , CLASS_NAME); break; \
228 case MLint16Type: SWITCH_CODE(OUTPUT_TYPE, MLint16 , CLASS_NAME); break; \
229 case MLuint16Type: SWITCH_CODE(OUTPUT_TYPE, MLuint16 , CLASS_NAME); break; \
230 case MLint32Type: SWITCH_CODE(OUTPUT_TYPE, MLint32 , CLASS_NAME); break; \
231 case MLuint32Type: SWITCH_CODE(OUTPUT_TYPE, MLuint32 , CLASS_NAME); break; \
232 case MLint64Type: SWITCH_CODE(OUTPUT_TYPE, MLint64 , CLASS_NAME); break; \
233 case MLuint64Type: SWITCH_CODE(OUTPUT_TYPE, MLuint64 , CLASS_NAME); break; \
234 case MLfloatType: SWITCH_CODE(OUTPUT_TYPE, MLfloat , CLASS_NAME); break; \
235 case MLdoubleType: SWITCH_CODE(OUTPUT_TYPE, MLdouble , CLASS_NAME); break; \
236 case MLComplexfType: SWITCH_CODE(OUTPUT_TYPE, std::complex<MLfloat> , CLASS_NAME); break; \
237 case MLComplexdType: SWITCH_CODE(OUTPUT_TYPE, std::complex<MLdouble>, CLASS_NAME); break; \
238 case MLVector2fType: SWITCH_CODE(OUTPUT_TYPE, Vector2f , CLASS_NAME); break; \
239 case MLVector2dType: SWITCH_CODE(OUTPUT_TYPE, Vector2d , CLASS_NAME); break; \
240 case MLVector3fType: SWITCH_CODE(OUTPUT_TYPE, Vector3f , CLASS_NAME); break; \
241 case MLVector3dType: SWITCH_CODE(OUTPUT_TYPE, Vector3d , CLASS_NAME); break; \
242 case MLVector6fType: SWITCH_CODE(OUTPUT_TYPE, Vector6f , CLASS_NAME); break; \
243 case MLVector6dType: SWITCH_CODE(OUTPUT_TYPE, Vector6d , CLASS_NAME); break; \
244 case MLMatrix2fType: SWITCH_CODE(OUTPUT_TYPE, Matrix2f , CLASS_NAME); break; \
245 case MLMatrix2dType: SWITCH_CODE(OUTPUT_TYPE, Matrix2d , CLASS_NAME); break; \
246 case MLMatrix3fType: SWITCH_CODE(OUTPUT_TYPE, Matrix3f , CLASS_NAME); break; \
247 case MLMatrix3dType: SWITCH_CODE(OUTPUT_TYPE, Matrix3d , CLASS_NAME); break; \
248 default:{ \
249 char buf[512]=""; \
250 sprintf(buf, "Type not supported, case type %d does not exist.", IN_SWITCH_TYPE); \
251 ML_PRINT_FATAL_ERROR(INFO_STRING, ML_BAD_DATA_TYPE, buf); } \
252 }
253
254//------------------------------------------------------------------------------------
256//------------------------------------------------------------------------------------
257#define ML_IMPLEMENT_DIFFERENT_SCALAR_INOUT_DATATYPES_CASES(CLASS_NAME, SWITCH_CODE, IN_SWITCH_TYPE, INFO_STRING, OUTPUT_TYPE) \
258 switch (static_cast<int>(IN_SWITCH_TYPE)){ \
259 case MLint8Type: SWITCH_CODE(OUTPUT_TYPE, MLint8 , CLASS_NAME); break; \
260 case MLuint8Type: SWITCH_CODE(OUTPUT_TYPE, MLuint8 , CLASS_NAME); break; \
261 case MLint16Type: SWITCH_CODE(OUTPUT_TYPE, MLint16 , CLASS_NAME); break; \
262 case MLuint16Type: SWITCH_CODE(OUTPUT_TYPE, MLuint16 , CLASS_NAME); break; \
263 case MLint32Type: SWITCH_CODE(OUTPUT_TYPE, MLint32 , CLASS_NAME); break; \
264 case MLuint32Type: SWITCH_CODE(OUTPUT_TYPE, MLuint32 , CLASS_NAME); break; \
265 case MLint64Type: SWITCH_CODE(OUTPUT_TYPE, MLint64 , CLASS_NAME); break; \
266 case MLuint64Type: SWITCH_CODE(OUTPUT_TYPE, MLuint64 , CLASS_NAME); break; \
267 case MLfloatType: SWITCH_CODE(OUTPUT_TYPE, MLfloat , CLASS_NAME); break; \
268 case MLdoubleType: SWITCH_CODE(OUTPUT_TYPE, MLdouble , CLASS_NAME); break; \
269 default:{ \
270 char buf[512]=""; \
271 sprintf(buf, "Type not supported, case type %d does not exist.", IN_SWITCH_TYPE); \
272 ML_PRINT_FATAL_ERROR(INFO_STRING, ML_BAD_DATA_TYPE, buf); } \
273 }
274
275
276#define ML_IMPLEMENT_SCALAR_CASES_WITH_DEFAULT(CLASS_NAME, SWITCH_CODE, O_SWITCH_TYPE, DEFAULT_CODE, DUMMY_OUT_TYPE) \
277 switch (static_cast<int>(O_SWITCH_TYPE)){ \
278 case MLint8Type: { SWITCH_CODE(MLint8 , MLint8 , CLASS_NAME); } break; \
279 case MLuint8Type: { SWITCH_CODE(MLuint8 , MLuint8 , CLASS_NAME); } break; \
280 case MLint16Type: { SWITCH_CODE(MLint16 , MLint16 , CLASS_NAME); } break; \
281 case MLuint16Type: { SWITCH_CODE(MLuint16, MLuint16, CLASS_NAME); } break; \
282 case MLint32Type: { SWITCH_CODE(MLint32 , MLint32 , CLASS_NAME); } break; \
283 case MLuint32Type: { SWITCH_CODE(MLuint32, MLuint32, CLASS_NAME); } break; \
284 case MLint64Type: { SWITCH_CODE(MLint64 , MLint64 , CLASS_NAME); } break; \
285 case MLuint64Type: { SWITCH_CODE(MLuint64, MLuint64, CLASS_NAME); } break; \
286 case MLfloatType: { SWITCH_CODE(MLfloat , MLfloat , CLASS_NAME); } break; \
287 case MLdoubleType: { SWITCH_CODE(MLdouble, MLdouble, CLASS_NAME); } break; \
288 default: { DEFAULT_CODE(DUMMY_OUT_TYPE, CLASS_NAME); } \
289 }
290
291#define ML_IMPLEMENT_DIFFERENT_INOUT_SCALAR_CASES_WITH_DEFAULT(CLASS_NAME, SWITCH_CODE, IN_SWITCH_TYPE, DEFAULT_CODE, OUTPUT_TYPE) \
292 switch (static_cast<int>(IN_SWITCH_TYPE)){ \
293 case MLint8Type: { SWITCH_CODE(OUTPUT_TYPE, MLint8 , CLASS_NAME); } break; \
294 case MLuint8Type: { SWITCH_CODE(OUTPUT_TYPE, MLuint8 , CLASS_NAME); } break; \
295 case MLint16Type: { SWITCH_CODE(OUTPUT_TYPE, MLint16 , CLASS_NAME); } break; \
296 case MLuint16Type: { SWITCH_CODE(OUTPUT_TYPE, MLuint16, CLASS_NAME); } break; \
297 case MLint32Type: { SWITCH_CODE(OUTPUT_TYPE, MLint32 , CLASS_NAME); } break; \
298 case MLuint32Type: { SWITCH_CODE(OUTPUT_TYPE, MLuint32, CLASS_NAME); } break; \
299 case MLint64Type: { SWITCH_CODE(OUTPUT_TYPE, MLint64 , CLASS_NAME); } break; \
300 case MLuint64Type: { SWITCH_CODE(OUTPUT_TYPE, MLuint64, CLASS_NAME); } break; \
301 case MLfloatType: { SWITCH_CODE(OUTPUT_TYPE, MLfloat , CLASS_NAME); } break; \
302 case MLdoubleType: { SWITCH_CODE(OUTPUT_TYPE, MLdouble, CLASS_NAME); } break; \
303 default:{ DEFAULT_CODE(OUTPUT_TYPE, CLASS_NAME); } \
304 }
305
306
307//------------------------------------------------------------------------------------
310//------------------------------------------------------------------------------------
311#define ML_IMPLEMENT_INT8_CASE( CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY) case MLint8Type: SWITCH_CODE(MLint8 , MLint8 , CLASS_NAME); break;
312#define ML_IMPLEMENT_UINT8_CASE( CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY) case MLuint8Type: SWITCH_CODE(MLuint8 , MLuint8 , CLASS_NAME); break;
313#define ML_IMPLEMENT_INT16_CASE( CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY) case MLint16Type: SWITCH_CODE(MLint16 , MLint16 , CLASS_NAME); break;
314#define ML_IMPLEMENT_UINT16_CASE( CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY) case MLuint16Type: SWITCH_CODE(MLuint16 , MLuint16 , CLASS_NAME); break;
315#define ML_IMPLEMENT_INT32_CASE( CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY) case MLint32Type: SWITCH_CODE(MLint32 , MLint32 , CLASS_NAME); break;
316#define ML_IMPLEMENT_UINT32_CASE( CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY) case MLuint32Type: SWITCH_CODE(MLuint32 , MLuint32 , CLASS_NAME); break;
317#define ML_IMPLEMENT_INT64_CASE( CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY) case MLint64Type: SWITCH_CODE(MLint64 , MLint64 , CLASS_NAME); break;
318#define ML_IMPLEMENT_UINT64_CASE( CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY) case MLuint64Type: SWITCH_CODE(MLuint64 , MLuint64 , CLASS_NAME); break;
319#define ML_IMPLEMENT_FLOAT_CASE( CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY) case MLfloatType: SWITCH_CODE(MLfloat , MLfloat , CLASS_NAME); break;
320#define ML_IMPLEMENT_DOUBLE_CASE( CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY) case MLdoubleType: SWITCH_CODE(MLdouble , MLdouble , CLASS_NAME); break;
321#define ML_IMPLEMENT_COMPLEXF_CASE( CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY) case MLComplexfType: SWITCH_CODE(std::complex<MLfloat> , std::complex<MLfloat> , CLASS_NAME); break;
322#define ML_IMPLEMENT_COMPLEXD_CASE( CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY) case MLComplexdType: SWITCH_CODE(std::complex<MLdouble>, std::complex<MLdouble>, CLASS_NAME); break;
323#define ML_IMPLEMENT_VECTOR2F_CASE( CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY) case MLVector2fType: SWITCH_CODE(Vector2f , Vector2f , CLASS_NAME); break;
324#define ML_IMPLEMENT_VECTOR2D_CASE( CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY) case MLVector2dType: SWITCH_CODE(Vector2d , Vector2d , CLASS_NAME); break;
325#define ML_IMPLEMENT_VECTOR3F_CASE( CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY) case MLVector3fType: SWITCH_CODE(Vector3f , Vector3f , CLASS_NAME); break;
326#define ML_IMPLEMENT_VECTOR3D_CASE( CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY) case MLVector3dType: SWITCH_CODE(Vector3d , Vector3d , CLASS_NAME); break;
327#define ML_IMPLEMENT_VECTOR6F_CASE( CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY) case MLVector6fType: SWITCH_CODE(Vector6f , Vector6f , CLASS_NAME); break;
328#define ML_IMPLEMENT_VECTOR6D_CASE( CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY) case MLVector6dType: SWITCH_CODE(Vector6d , Vector6d , CLASS_NAME); break;
329#define ML_IMPLEMENT_MATRIX2F_CASE( CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY) case MLMatrix2fType: SWITCH_CODE(Matrix2f , Matrix2f , CLASS_NAME); break;
330#define ML_IMPLEMENT_MATRIX2D_CASE( CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY) case MLMatrix2dType: SWITCH_CODE(Matrix2d , Matrix2d , CLASS_NAME); break;
331#define ML_IMPLEMENT_MATRIX3F_CASE( CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY) case MLMatrix3fType: SWITCH_CODE(Matrix3f , Matrix3f , CLASS_NAME); break;
332#define ML_IMPLEMENT_MATRIX3D_CASE( CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY) case MLMatrix3dType: SWITCH_CODE(Matrix3d , Matrix3d , CLASS_NAME); break;
334
335//------------------------------------------------------------------------------------
338//------------------------------------------------------------------------------------
340#define ML_IMPLEMENT_INT_CASES_WO_INT64(CLASS_NAME, SWITCH_CODE, OST_DUMMY1, OST_DUMMY2, OST_DUMMY3)\
341 ML_IMPLEMENT_INT8_CASE( CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY) \
342 ML_IMPLEMENT_UINT8_CASE( CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY) \
343 ML_IMPLEMENT_INT16_CASE( CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY) \
344 ML_IMPLEMENT_UINT16_CASE( CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY) \
345 ML_IMPLEMENT_INT32_CASE( CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY) \
346 ML_IMPLEMENT_UINT32_CASE( CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY)
347
349#define ML_IMPLEMENT_INT_CASES(CLASS_NAME, SWITCH_CODE, OST_DUMMY1, OST_DUMMY2, OST_DUMMY3) \
350 ML_IMPLEMENT_INT8_CASE( CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY) \
351 ML_IMPLEMENT_UINT8_CASE( CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY) \
352 ML_IMPLEMENT_INT16_CASE( CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY) \
353 ML_IMPLEMENT_UINT16_CASE(CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY) \
354 ML_IMPLEMENT_INT32_CASE( CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY) \
355 ML_IMPLEMENT_UINT32_CASE(CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY) \
356 ML_IMPLEMENT_INT64_CASE( CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY) \
357 ML_IMPLEMENT_UINT64_CASE(CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY)
358
360#define ML_IMPLEMENT_FLOAT_CASES(CLASS_NAME, SWITCH_CODE, OST_DUMMY1, OST_DUMMY2, OST_DUMMY3)\
361 ML_IMPLEMENT_FLOAT_CASE( CLASS_NAME, SWITCH_CODE, OST_DUMMY1, OST_DUMMY2, OST_DUMMY3) \
362 ML_IMPLEMENT_DOUBLE_CASE( CLASS_NAME, SWITCH_CODE, OST_DUMMY1, OST_DUMMY2, OST_DUMMY3) \
363
365#define ML_IMPLEMENT_COMPLEX_CASES(CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY)\
366 ML_IMPLEMENT_COMPLEXF_CASE( CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY) \
367 ML_IMPLEMENT_COMPLEXD_CASE( CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY)
368
369#define ML_IMPLEMENT_VECTOR_CASES(CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY) \
370 ML_IMPLEMENT_VECTOR2F_CASE( CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY) \
371 ML_IMPLEMENT_VECTOR2D_CASE( CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY) \
372 ML_IMPLEMENT_VECTOR3F_CASE( CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY) \
373 ML_IMPLEMENT_VECTOR3D_CASE( CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY) \
374 ML_IMPLEMENT_VECTOR6F_CASE( CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY) \
375 ML_IMPLEMENT_VECTOR6D_CASE( CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY)
376
377#define ML_IMPLEMENT_MATRIX_CASES(CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY) \
378 ML_IMPLEMENT_MATRIX2F_CASE( CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY) \
379 ML_IMPLEMENT_MATRIX2D_CASE( CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY) \
380 ML_IMPLEMENT_MATRIX3F_CASE( CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY) \
381 ML_IMPLEMENT_MATRIX3D_CASE( CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY)
382
384#define ML_IMPLEMENT_INT_FLOAT_CASES(CLASS_NAME, SWITCH_CODE, OST_DUMMY1, OST_DUMMY2, OST_DUMMY3)\
385 ML_IMPLEMENT_INT_CASES( CLASS_NAME, SWITCH_CODE, OST_DUMMY1, OST_DUMMY2, OST_DUMMY3) \
386 ML_IMPLEMENT_FLOAT_CASES( CLASS_NAME, SWITCH_CODE, OST_DUMMY1, OST_DUMMY2, OST_DUMMY3)
387
389#define ML_IMPLEMENT_INT_FLOAT_CASES_WO_INT64(CLASS_NAME, SWITCH_CODE, OST_DUMMY1, OST_DUMMY2, OST_DUMMY3)\
390 ML_IMPLEMENT_INT8_CASE( CLASS_NAME, SWITCH_CODE, OST_DUMMY1, OST_DUMMY2, OST_DUMMY3) \
391 ML_IMPLEMENT_UINT8_CASE( CLASS_NAME, SWITCH_CODE, OST_DUMMY1, OST_DUMMY2, OST_DUMMY3) \
392 ML_IMPLEMENT_INT16_CASE( CLASS_NAME, SWITCH_CODE, OST_DUMMY1, OST_DUMMY2, OST_DUMMY3) \
393 ML_IMPLEMENT_UINT16_CASE( CLASS_NAME, SWITCH_CODE, OST_DUMMY1, OST_DUMMY2, OST_DUMMY3) \
394 ML_IMPLEMENT_INT32_CASE( CLASS_NAME, SWITCH_CODE, OST_DUMMY1, OST_DUMMY2, OST_DUMMY3) \
395 ML_IMPLEMENT_UINT32_CASE( CLASS_NAME, SWITCH_CODE, OST_DUMMY1, OST_DUMMY2, OST_DUMMY3) \
396 ML_IMPLEMENT_FLOAT_CASES( CLASS_NAME, SWITCH_CODE, OST_DUMMY1, OST_DUMMY2, OST_DUMMY3)
397
399#define ML_IMPLEMENT_DEFAULT_CASES(CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY) \
400 ML_IMPLEMENT_INT_CASES( CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY) \
401 ML_IMPLEMENT_FLOAT_CASES( CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY) \
402 ML_IMPLEMENT_COMPLEX_CASES(CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY) \
403 ML_IMPLEMENT_VECTOR_CASES( CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY) \
404 ML_IMPLEMENT_MATRIX_CASES( CLASS_NAME, SWITCH_CODE, OST_DUMMY, INFO_DUMMY, INTYPE_DUMMY) \
405
407#define ML_IMPLEMENT_SCALAR_CASES(CLASS_NAME, SWITCH_CODE, OST_DUMMY1, OST_DUMMY2, OST_DUMMY3)\
408 ML_IMPLEMENT_INT_CASES( CLASS_NAME, SWITCH_CODE, OST_DUMMY1, OST_DUMMY2, OST_DUMMY3) \
409 ML_IMPLEMENT_FLOAT_CASES( CLASS_NAME, SWITCH_CODE, OST_DUMMY1, OST_DUMMY2, OST_DUMMY3)
410
414#define ML_IMPLEMENT_DEFAULT_HANDLING(CALLING_POSITION_STRING) \
415 default: { \
416 ML_PRINT_FATAL_ERROR(CALLING_POSITION_STRING, \
417 ML_BAD_DATA_TYPE, \
418 "Type case not executed."); \
419 break; \
420 } \
421
423
424//------------------------------------------------------------------------------------
425
426//------------------------------------------------------------------------------------
436//------------------------------------------------------------------------------------
437#define _ML_TYPE_SWITCH_INTERN(DTSWITCHES, METHOD_PREFIX, METHOD_SUFFIX, DOUBLE_COLON, SWITCH_CODE, OUT_SWITCH_TYPE, CALLING_POSITION_STRING, INPTR, CLASS_NAME) \
438 \
439 void METHOD_PREFIX DOUBLE_COLON calculateOutputSubImage(SubImage *outSubImg, int outIndex, INPTR) METHOD_SUFFIX \
440 { \
441 switch(OUT_SWITCH_TYPE){ \
442 DTSWITCHES(CLASS_NAME, SWITCH_CODE, OUT_SWITCH_TYPE, CALLING_POSITION_STRING, INTYPE_DUMMY) \
443 ML_IMPLEMENT_DEFAULT_HANDLING(CALLING_POSITION_STRING) \
444 } \
445 }
446
447//------------------------------------------------------------------------------------
450//------------------------------------------------------------------------------------
451#define _ML_TYPE_SWITCH_C(DTSWITCHES, SWITCH_CODE, CALLING_POSITION_STRING, INPTR, CLASS_NAME) \
452 _ML_TYPE_SWITCH_INTERN(DTSWITCHES, CLASS_NAME, ML_EMPTY_PARAM, ::, SWITCH_CODE, outSubImg->getDataType(), CALLING_POSITION_STRING, INPTR, CLASS_NAME)
453
454//------------------------------------------------------------------------------------
457//------------------------------------------------------------------------------------
458#define _ML_TYPE_SWITCH_H(DTSWITCHES, SWITCH_CODE, CALLING_POSITION_STRING, INPTR) \
459 _ML_TYPE_SWITCH_INTERN(DTSWITCHES, ML_EMPTY_PARAM, override, ML_EMPTY_PARAM, SWITCH_CODE, outSubImg->getDataType(), CALLING_POSITION_STRING, INPTR, CLASS_NAME)
460
461
462
463
464//---------------------------------------------------------------------------------------------------
465//
466//
467//
468// Macros to support calculateOutputSubImage implementations with identical
469// input and output data types.
470//
471//
472//
473//---------------------------------------------------------------------------------------------------
474
475// The call to calculateOutputSubImage is non-const by default.
476// Enabling the ML_CALCULATEOUTPUTSUBIMAGE_IS_CONST macro allows to
477// make the call to calculateOutputSubImage const. This facilitates
478// ensuring that a module's calculateOutputSubImage method is thread-safe.
479#ifdef ML_CALCULATEOUTPUTSUBIMAGE_IS_CONST
480 #define _ML_CALCULATEOUTPUTCALL_HELPER(CLASS_NAME) \
481 static_cast<const CLASS_NAME*>(this)->calculateOutputSubImage
482#else
483 #define _ML_CALCULATEOUTPUTCALL_HELPER(CLASS_NAME) calculateOutputSubImage
484#endif
485
486//---------------------------------------------------------------------------------------------------
487// Support for 0 inputs.
488//---------------------------------------------------------------------------------------------------
490#define _ML_SWITCH_CODE_0(OUTDTYPE, INDTYPE, CLASS_NAME) \
491 {\
492 TSubImage<OUTDTYPE> tOutSubImg(*outSubImg);\
493 _ML_CALCULATEOUTPUTCALL_HELPER(CLASS_NAME)(&tOutSubImg,outIndex);\
494 }
495
501#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_0_DEFAULT_TYPES_CPP(CLASS_NAME) _ML_TYPE_SWITCH_C(ML_IMPLEMENT_DEFAULT_CASES, _ML_SWITCH_CODE_0, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_0_DEFAULT_TYPES_CPP", SubImage *, CLASS_NAME);
502
504#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_0_SCALAR_TYPES_CPP(CLASS_NAME) _ML_TYPE_SWITCH_C(ML_IMPLEMENT_SCALAR_CASES, _ML_SWITCH_CODE_0, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_0_SCALAR_TYPES_CPP", SubImage *, CLASS_NAME);
505
508#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_0_WITH_CUSTOM_SWITCH_CPP(CLASS_NAME, DTSWITCHES) _ML_TYPE_SWITCH_C(DTSWITCHES, _ML_SWITCH_CODE_0, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_0_WITH_CUSTOM_SWITCH_CPP", SubImage *, CLASS_NAME);
509
511#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_0_DEFAULT_TYPES(CLASS_NAME) _ML_TYPE_SWITCH_H(ML_IMPLEMENT_DEFAULT_CASES, _ML_SWITCH_CODE_0, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_0_DEFAULT_TYPES", SubImage *);
512
514#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_0_SCALAR_TYPES(CLASS_NAME) _ML_TYPE_SWITCH_H(ML_IMPLEMENT_SCALAR_CASES, _ML_SWITCH_CODE_0, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_0_SCALAR_TYPES", SubImage *);
515
517#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_0_WITH_CUSTOM_SWITCH(CLASS_NAME, DTSWITCHES) _ML_TYPE_SWITCH_H(DTSWITCHES, _ML_SWITCH_CODE_0, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_0_WITH_CUSTOM_SWITCH", SubImage *);
518
519
520//---------------------------------------------------------------------------------------------------
521// Support for 1 input.
522//---------------------------------------------------------------------------------------------------
524#define _ML_SWITCH_CODE_1(OUTDTYPE, INDTYPE, CLASS_NAME) \
525 { \
526 TSubImage<OUTDTYPE> typedOutSubImg(*outSubImg); \
527 TSubImage<INDTYPE> typedInSubImg1(inSubImgs[0]);\
528 _ML_CALCULATEOUTPUTCALL_HELPER(CLASS_NAME)(&typedOutSubImg,outIndex,\
529 &typedInSubImg1);\
530 }
531
534#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_1_DEFAULT_TYPES_CPP(CLASS_NAME) _ML_TYPE_SWITCH_C(ML_IMPLEMENT_DEFAULT_CASES, _ML_SWITCH_CODE_1, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_1_DEFAULT_TYPES_CPP", SubImage *inSubImgs, CLASS_NAME);
535#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_1_SCALAR_TYPES_CPP(CLASS_NAME) _ML_TYPE_SWITCH_C(ML_IMPLEMENT_SCALAR_CASES, _ML_SWITCH_CODE_1, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_1_SCALAR_TYPES_CPP", SubImage *inSubImgs, CLASS_NAME);
536#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_1_WITH_CUSTOM_SWITCH_CPP(CLASS_NAME, DTSWITCHES) _ML_TYPE_SWITCH_C(DTSWITCHES, _ML_SWITCH_CODE_1, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_1_WITH_CUSTOM_SWITCH_CPP", SubImage *inSubImgs, CLASS_NAME);
538
541#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_1_DEFAULT_TYPES(CLASS_NAME) _ML_TYPE_SWITCH_H(ML_IMPLEMENT_DEFAULT_CASES, _ML_SWITCH_CODE_1, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_1_DEFAULT_TYPES", SubImage *inSubImgs);
542#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_1_SCALAR_TYPES(CLASS_NAME) _ML_TYPE_SWITCH_H(ML_IMPLEMENT_SCALAR_CASES, _ML_SWITCH_CODE_1, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_1_SCALAR_TYPES", SubImage *inSubImgs);
543#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_1_WITH_CUSTOM_SWITCH(CLASS_NAME, DTSWITCHES) _ML_TYPE_SWITCH_H(DTSWITCHES, _ML_SWITCH_CODE_1, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_1_WITH_CUSTOM_SWITCH", SubImage *inSubImgs);
545
546
547//---------------------------------------------------------------------------------------------------
548// Support for 2 inputs.
549//---------------------------------------------------------------------------------------------------
551#define _ML_SWITCH_CODE_2(OUTDTYPE, INDTYPE, CLASS_NAME) \
552 { \
553 TSubImage<OUTDTYPE> typedOutSubImg(*outSubImg);\
554 TSubImage<INDTYPE> typedInSubImg0(inSubImgs[0]);\
555 TSubImage<INDTYPE> typedInSubImg1(inSubImgs[1]);\
556 _ML_CALCULATEOUTPUTCALL_HELPER(CLASS_NAME)(&typedOutSubImg,outIndex,&typedInSubImg0,&typedInSubImg1);\
557 }
558
561#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_2_DEFAULT_TYPES_CPP(CLASS_NAME) _ML_TYPE_SWITCH_C(ML_IMPLEMENT_DEFAULT_CASES, _ML_SWITCH_CODE_2, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_2_DEFAULT_TYPES_CPP", SubImage *inSubImgs, CLASS_NAME);
562#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_2_SCALAR_TYPES_CPP(CLASS_NAME) _ML_TYPE_SWITCH_C(ML_IMPLEMENT_SCALAR_CASES, _ML_SWITCH_CODE_2, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_2_SCALAR_TYPES_CPP", SubImage *inSubImgs, CLASS_NAME);
563#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_2_WITH_CUSTOM_SWITCH_CPP(CLASS_NAME, DTSWITCHES) _ML_TYPE_SWITCH_C(DTSWITCHES, _ML_SWITCH_CODE_2, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_2_WITH_CUSTOM_SWITCH_CPP", SubImage *inSubImgs, CLASS_NAME);
565
568#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_2_DEFAULT_TYPES(CLASS_NAME) _ML_TYPE_SWITCH_H(ML_IMPLEMENT_DEFAULT_CASES, _ML_SWITCH_CODE_2, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_2_DEFAULT_TYPES", SubImage *inSubImgs);
569#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_2_SCALAR_TYPES(CLASS_NAME) _ML_TYPE_SWITCH_H(ML_IMPLEMENT_SCALAR_CASES, _ML_SWITCH_CODE_2, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_2_SCALAR_TYPES", SubImage *inSubImgs);
570#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_2_WITH_CUSTOM_SWITCH(CLASS_NAME, DTSWITCHES) _ML_TYPE_SWITCH_H(DTSWITCHES, _ML_SWITCH_CODE_2, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_2_WITH_CUSTOM_SWITCH", SubImage *inSubImgs);
572
573
574//---------------------------------------------------------------------------------------------------
575// Support for 3 inputs.
576//---------------------------------------------------------------------------------------------------
578#define _ML_SWITCH_CODE_3(OUTDTYPE, INDTYPE, CLASS_NAME) \
579 { \
580 TSubImage<OUTDTYPE> typedOutSubImg(*outSubImg);\
581 TSubImage<INDTYPE> typedInSubImg0(inSubImgs[0]);\
582 TSubImage<INDTYPE> typedInSubImg1(inSubImgs[1]);\
583 TSubImage<INDTYPE> typedInSubImg2(inSubImgs[2]);\
584 _ML_CALCULATEOUTPUTCALL_HELPER(CLASS_NAME)(&typedOutSubImg,outIndex,\
585 &typedInSubImg0, &typedInSubImg1,\
586 &typedInSubImg2);\
587 }
588
591#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_3_DEFAULT_TYPES_CPP(CLASS_NAME) _ML_TYPE_SWITCH_C(ML_IMPLEMENT_DEFAULT_CASES, _ML_SWITCH_CODE_3, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_3_DEFAULT_TYPES_CPP", SubImage *inSubImgs, CLASS_NAME);
592#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_3_SCALAR_TYPES_CPP(CLASS_NAME) _ML_TYPE_SWITCH_C(ML_IMPLEMENT_SCALAR_CASES, _ML_SWITCH_CODE_3, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_3_SCALAR_TYPES_CPP", SubImage *inSubImgs, CLASS_NAME);
593#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_3_WITH_CUSTOM_SWITCH_CPP(CLASS_NAME, DTSWITCHES) _ML_TYPE_SWITCH_C(DTSWITCHES, _ML_SWITCH_CODE_3, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_3_WITH_CUSTOM_SWITCH_CPP", SubImage *inSubImgs, CLASS_NAME);
595
598#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_3_DEFAULT_TYPES(CLASS_NAME) _ML_TYPE_SWITCH_H(ML_IMPLEMENT_DEFAULT_CASES, _ML_SWITCH_CODE_3, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_3_DEFAULT_TYPES", SubImage *inSubImgs);
599#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_3_SCALAR_TYPES(CLASS_NAME) _ML_TYPE_SWITCH_H(ML_IMPLEMENT_SCALAR_CASES, _ML_SWITCH_CODE_3, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_3_SCALAR_TYPES", SubImage *inSubImgs);
600#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_3_WITH_CUSTOM_SWITCH(CLASS_NAME, DTSWITCHES) _ML_TYPE_SWITCH_H(DTSWITCHES, _ML_SWITCH_CODE_3, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_3_WITH_CUSTOM_SWITCH", SubImage *inSubImgs);
602
603
604//---------------------------------------------------------------------------------------------------
605// Support for 4 inputs.
606//---------------------------------------------------------------------------------------------------
608#define _ML_SWITCH_CODE_4(OUTDTYPE, INDTYPE, CLASS_NAME) \
609 { \
610 TSubImage<OUTDTYPE> typedOutSubImg(*outSubImg);\
611 TSubImage<INDTYPE> typedInSubImg0(inSubImgs[0]);\
612 TSubImage<INDTYPE> typedInSubImg1(inSubImgs[1]);\
613 TSubImage<INDTYPE> typedInSubImg2(inSubImgs[2]);\
614 TSubImage<INDTYPE> typedInSubImg3(inSubImgs[3]);\
615 _ML_CALCULATEOUTPUTCALL_HELPER(CLASS_NAME)(&typedOutSubImg,outIndex,\
616 &typedInSubImg0, &typedInSubImg1,\
617 &typedInSubImg2, &typedInSubImg3);\
618 }
619
622#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_4_DEFAULT_TYPES_CPP(CLASS_NAME) _ML_TYPE_SWITCH_C(ML_IMPLEMENT_DEFAULT_CASES, _ML_SWITCH_CODE_4, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_4_DEFAULT_TYPES_CPP", SubImage *inSubImgs, CLASS_NAME);
623#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_4_SCALAR_TYPES_CPP(CLASS_NAME) _ML_TYPE_SWITCH_C(ML_IMPLEMENT_SCALAR_CASES, _ML_SWITCH_CODE_4, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_4_SCALAR_TYPES_CPP", SubImage *inSubImgs, CLASS_NAME);
624#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_4_WITH_CUSTOM_SWITCH_CPP(CLASS_NAME, DTSWITCHES) _ML_TYPE_SWITCH_C(DTSWITCHES, _ML_SWITCH_CODE_4, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_4_WITH_CUSTOM_SWITCH_CPP", SubImage *inSubImgs, CLASS_NAME);
626
629#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_4_DEFAULT_TYPES(CLASS_NAME) _ML_TYPE_SWITCH_H(ML_IMPLEMENT_DEFAULT_CASES, _ML_SWITCH_CODE_4, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_4_DEFAULT_TYPES", SubImage *inSubImgs);
630#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_4_SCALAR_TYPES(CLASS_NAME) _ML_TYPE_SWITCH_H(ML_IMPLEMENT_SCALAR_CASES, _ML_SWITCH_CODE_4, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_4_SCALAR_TYPES", SubImage *inSubImgs);
631#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_4_WITH_CUSTOM_SWITCH(CLASS_NAME, DTSWITCHES) _ML_TYPE_SWITCH_H(DTSWITCHES, _ML_SWITCH_CODE_4, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_4_WITH_CUSTOM_SWITCH", SubImage *inSubImgs);
633
634
635//---------------------------------------------------------------------------------------------------
636// Support for 5 inputs.
637//---------------------------------------------------------------------------------------------------
639#define _ML_SWITCH_CODE_5(OUTDTYPE, INDTYPE, CLASS_NAME) \
640 { \
641 TSubImage<OUTDTYPE> typedOutSubImg(*outSubImg);\
642 TSubImage<INDTYPE> typedInSubImg0(inSubImgs[0]);\
643 TSubImage<INDTYPE> typedInSubImg1(inSubImgs[1]);\
644 TSubImage<INDTYPE> typedInSubImg2(inSubImgs[2]);\
645 TSubImage<INDTYPE> typedInSubImg3(inSubImgs[3]);\
646 TSubImage<INDTYPE> typedInSubImg4(inSubImgs[4]);\
647 _ML_CALCULATEOUTPUTCALL_HELPER(CLASS_NAME)(&typedOutSubImg,outIndex,\
648 &typedInSubImg0, &typedInSubImg1,\
649 &typedInSubImg2, &typedInSubImg3,\
650 &typedInSubImg4);\
651 }
652
655#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_5_DEFAULT_TYPES_CPP(CLASS_NAME) _ML_TYPE_SWITCH_C(ML_IMPLEMENT_DEFAULT_CASES, _ML_SWITCH_CODE_5, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_5_DEFAULT_TYPES_CPP", SubImage *inSubImgs, CLASS_NAME);
656#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_5_SCALAR_TYPES_CPP(CLASS_NAME) _ML_TYPE_SWITCH_C(ML_IMPLEMENT_SCALAR_CASES, _ML_SWITCH_CODE_5, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_5_SCALAR_TYPES_CPP", SubImage *inSubImgs, CLASS_NAME);
657#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_5_WITH_CUSTOM_SWITCH_CPP(CLASS_NAME, DTSWITCHES) _ML_TYPE_SWITCH_C(DTSWITCHES, _ML_SWITCH_CODE_5, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_5_WITH_CUSTOM_SWITCH_CPP", SubImage *inSubImgs, CLASS_NAME);
659
662#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_5_DEFAULT_TYPES(CLASS_NAME) _ML_TYPE_SWITCH_H(ML_IMPLEMENT_DEFAULT_CASES, _ML_SWITCH_CODE_5, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_5_DEFAULT_TYPES", SubImage *inSubImgs);
663#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_5_SCALAR_TYPES(CLASS_NAME) _ML_TYPE_SWITCH_H(ML_IMPLEMENT_SCALAR_CASES, _ML_SWITCH_CODE_5, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_5_SCALAR_TYPES", SubImage *inSubImgs);
664#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_5_WITH_CUSTOM_SWITCH(CLASS_NAME, DTSWITCHES) _ML_TYPE_SWITCH_H(DTSWITCHES, _ML_SWITCH_CODE_5, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_5_WITH_CUSTOM_SWITCH", SubImage *inSubImgs);
666
667
668//---------------------------------------------------------------------------------------------------
669// Support for 10 inputs.
670//---------------------------------------------------------------------------------------------------
672#define _ML_SWITCH_CODE_10(OUTDTYPE, INDTYPE, CLASS_NAME) \
673 { \
674 TSubImage<OUTDTYPE> typedOutSubImg(*outSubImg);\
675 TSubImage<INDTYPE> typedInSubImg0(inSubImgs[0]);\
676 TSubImage<INDTYPE> typedInSubImg1(inSubImgs[1]);\
677 TSubImage<INDTYPE> typedInSubImg2(inSubImgs[2]);\
678 TSubImage<INDTYPE> typedInSubImg3(inSubImgs[3]);\
679 TSubImage<INDTYPE> typedInSubImg4(inSubImgs[4]);\
680 TSubImage<INDTYPE> typedInSubImg5(inSubImgs[5]);\
681 TSubImage<INDTYPE> typedInSubImg6(inSubImgs[6]);\
682 TSubImage<INDTYPE> typedInSubImg7(inSubImgs[7]);\
683 TSubImage<INDTYPE> typedInSubImg8(inSubImgs[8]);\
684 TSubImage<INDTYPE> typedInSubImg9(inSubImgs[9]);\
685 _ML_CALCULATEOUTPUTCALL_HELPER(CLASS_NAME)(&typedOutSubImg,outIndex,\
686 &typedInSubImg0, &typedInSubImg1, \
687 &typedInSubImg2, &typedInSubImg3, \
688 &typedInSubImg4, &typedInSubImg5, \
689 &typedInSubImg6, &typedInSubImg7, \
690 &typedInSubImg8, &typedInSubImg9);\
691 }
692
695#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_10_DEFAULT_TYPES_CPP(CLASS_NAME) _ML_TYPE_SWITCH_C(ML_IMPLEMENT_DEFAULT_CASES, _ML_SWITCH_CODE_10, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_10_DEFAULT_TYPES_CPP", SubImage *inSubImgs, CLASS_NAME);
696#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_10_SCALAR_TYPES_CPP(CLASS_NAME) _ML_TYPE_SWITCH_C(ML_IMPLEMENT_SCALAR_CASES, _ML_SWITCH_CODE_10, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_10_SCALAR_TYPES_CPP", SubImage *inSubImgs, CLASS_NAME);
697#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_10_WITH_CUSTOM_SWITCH_CPP(CLASS_NAME, DTSWITCHES) _ML_TYPE_SWITCH_C(DTSWITCHES, _ML_SWITCH_CODE_10, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_10_WITH_CUSTOM_SWITCH_CPP", SubImage *inSubImgs, CLASS_NAME);
699
702#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_10_DEFAULT_TYPES(CLASS_NAME) _ML_TYPE_SWITCH_H(ML_IMPLEMENT_DEFAULT_CASES, _ML_SWITCH_CODE_10, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_10_DEFAULT_TYPES", SubImage *inSubImgs);
703#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_10_SCALAR_TYPES(CLASS_NAME) _ML_TYPE_SWITCH_H(ML_IMPLEMENT_SCALAR_CASES, _ML_SWITCH_CODE_10, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_10_SCALAR_TYPES", SubImage *inSubImgs);
704#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_10_WITH_CUSTOM_SWITCH(CLASS_NAME, DTSWITCHES) _ML_TYPE_SWITCH_H(DTSWITCHES, _ML_SWITCH_CODE_10, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_10_WITH_CUSTOM_SWITCH", SubImage *inSubImgs);
706
707
708//---------------------------------------------------------------------------------------------------
711
726#define _ML_SWITCH_CODE_N(OUTDTYPE, INDTYPE, CLASS_NAME) \
727 { \
728 /* Get number of inputs. */ \
729 const MLssize_t numIns = static_cast<MLssize_t>(this->getNumInputImages()); \
730 \
731 /* Create typed version of output buffer. */ \
732 TSubImage<OUTDTYPE> outSubImgT(*outSubImg); \
733 \
734 /* Implement special cases with automatic object creation, */ \
735 /* because it is much faster. */ \
736 if (numIns < 3){ \
737 switch(numIns){ \
738 /***** Optimization for 1 input. *****/ \
739 case 0:{ \
740 /* Calculate output subimage. */ \
741 _ML_CALCULATEOUTPUTCALL_HELPER(CLASS_NAME)(&outSubImgT, outIndex, \
742 (TSubImage<INDTYPE>**)NULL); \
743 } \
744 return; \
745 \
746 /***** Optimization for 1 input. *****/ \
747 case 1:{ \
748 /* Create typed version of input buffer. */ \
749 /* and create a pointer array with one element. */ \
750 TSubImage<INDTYPE> inSubImgT(inSubImgs[0]); \
751 TSubImage<INDTYPE> *inArr = &inSubImgT; \
752 \
753 /* Calculate output subimage. */ \
754 _ML_CALCULATEOUTPUTCALL_HELPER(CLASS_NAME)(&outSubImgT, outIndex, &inArr); \
755 } \
756 return; \
757 \
758 /***** Optimization for 2 inputs. *****/ \
759 case 2:{ \
760 TSubImage<INDTYPE> inSubImg0T(inSubImgs[0]); \
761 TSubImage<INDTYPE> inSubImg1T(inSubImgs[1]); \
762 TSubImage<INDTYPE> *inArr[2]; \
763 inArr[0] = &inSubImg0T; \
764 inArr[1] = &inSubImg1T; \
765 _ML_CALCULATEOUTPUTCALL_HELPER(CLASS_NAME)(&outSubImgT, outIndex, inArr); \
766 } \
767 return; \
768 \
769 /***** Should be impossible to reach here *****/ \
770 default:{ \
771 ML_PRINT_FATAL_ERROR("_ML_SWITCH_CODE_N", \
772 ML_PROGRAMMING_ERROR, \
773 "Invalid case switch detected, " \
774 "ignoring case and not processing page"); \
775 } \
776 } \
777 } /* if (numIns < 3) */ \
778 else{ \
779 /***** Any other number of inputs. *****/ \
780 /* Create an array for all pointers to input subimages. */ \
781 TSubImage<INDTYPE> **inArr = NULL; \
782 inArr = new TSubImage<INDTYPE>*[numIns]; \
783 bool okay = inArr != NULL; \
784 \
785 /* Count number of created subimages. */ \
786 MLssize_t createdTSubs=0; \
787 \
788 /* For each untyped input subimage create a typed one and */ \
789 /* store its pointer into the array. */ \
790 for (MLssize_t c=0; okay && (c < numIns); c++){ \
791 inArr[c] = new TSubImage<INDTYPE>(inSubImgs[c]); \
792 if (inArr[c]){ createdTSubs++; } else { okay = false; } \
793 } \
794 \
795 /* Call the correct template version of calculateOutputSubImage. */ \
796 if (okay){ \
797 _ML_CALCULATEOUTPUTCALL_HELPER(CLASS_NAME)(&outSubImgT, outIndex, inArr); \
798 } \
799 else{ \
800 ML_PRINT_FATAL_ERROR(#CLASS_NAME, ML_NO_MEMORY, \
801 "Not calculating page."); \
802 } \
803 \
804 /* Clean up created subimages and array of subimage pointers. */ \
805 if (inArr){ \
806 for (MLssize_t d=0; d < createdTSubs; d++){ \
807 delete inArr[d]; \
808 } \
809 delete [] inArr; \
810 } \
811 } /* else (numIns < 3) */ \
812 }
814
822#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_N_DEFAULT_TYPES_CPP(CLASS_NAME) _ML_TYPE_SWITCH_C(ML_IMPLEMENT_DEFAULT_CASES, _ML_SWITCH_CODE_N, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_N_DEFAULT_TYPES_CPP", SubImage *inSubImgs, CLASS_NAME);
823
825#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_N_SCALAR_TYPES_CPP(CLASS_NAME) _ML_TYPE_SWITCH_C(ML_IMPLEMENT_SCALAR_CASES, _ML_SWITCH_CODE_N, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_N_SCALAR_TYPES_CPP", SubImage *inSubImgs, CLASS_NAME);
826
829#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_N_WITH_CUSTOM_SWITCH_CPP(CLASS_NAME, DTSWITCHES) _ML_TYPE_SWITCH_C(DTSWITCHES, _ML_SWITCH_CODE_N, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_N_WITH_CUSTOM_SWITCH_CPP", SubImage *inSubImgs, CLASS_NAME);
831
834#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_N_DEFAULT_TYPES(CLASS_NAME) _ML_TYPE_SWITCH_H(ML_IMPLEMENT_DEFAULT_CASES, _ML_SWITCH_CODE_N, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_N_DEFAULT_TYPES", SubImage *inSubImgs);
835#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_N_SCALAR_TYPES(CLASS_NAME) _ML_TYPE_SWITCH_H(ML_IMPLEMENT_SCALAR_CASES, _ML_SWITCH_CODE_N, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_N_SCALAR_TYPES", SubImage *inSubImgs);
836#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_N_WITH_CUSTOM_SWITCH(CLASS_NAME, DTSWITCHES) _ML_TYPE_SWITCH_H(DTSWITCHES, _ML_SWITCH_CODE_N, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_N_WITH_CUSTOM_SWITCH", SubImage *inSubImgs);
838
839
840//---------------------------------------------------------------------------------------------------
841//
842//
843//
844// Macros to support different input and output data types.
845// Note that these macros produce significantly more code.
846//
847//
848//
849//---------------------------------------------------------------------------------------------------
850
851//---------------------------------------------------------------------------------------------------
858
860#define _ML_SWITCH_CODE1_DD_L2(OUTDTYPE, INDTYPE, CLASS_NAME) \
861 { TSubImage<INDTYPE> inSIT(inSubImgs[0]); _ML_CALCULATEOUTPUTCALL_HELPER(CLASS_NAME)(&outSI, outIndex, &inSIT); }
862
864#define _ML_SWITCH_CODE1_DD(OUTDTYPE, INDTYPE, CLASS_NAME) \
865 { \
866 TSubImage<OUTDTYPE> outSI(*outSubImg); \
867 ML_IMPLEMENT_DIFFERENT_INOUT_DATATYPES_CASES(CLASS_NAME, \
868 _ML_SWITCH_CODE1_DD_L2, \
869 inSubImgs[0].getDataType(), \
870 "_ML_SWITCH_CODE1_DD", \
871 INDTYPE); \
872 }
873
875#define _ML_SWITCH_CODE1S_DD(OUTDTYPE, INDTYPE, CLASS_NAME) \
876 { \
877 TSubImage<OUTDTYPE> outSI(*outSubImg); \
878 ML_IMPLEMENT_DIFFERENT_SCALAR_INOUT_DATATYPES_CASES(CLASS_NAME, \
879 _ML_SWITCH_CODE1_DD_L2, \
880 inSubImgs[0].getDataType(), \
881 "_ML_SWITCH_CODE1_DD", \
882 INDTYPE); \
883 }
884
887#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_1_DIFFERENT_DEFAULT_INOUT_DATATYPES_CPP(CLASS_NAME) \
888 _ML_TYPE_SWITCH_C(ML_IMPLEMENT_DEFAULT_CASES, _ML_SWITCH_CODE1_DD, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_1_DIFFERENT_DEFAULT_INOUT_DATATYPES_CPP", SubImage *inSubImgs, CLASS_NAME);
889#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_1_DIFFERENT_SCALAR_INOUT_DATATYPES_CPP(CLASS_NAME) \
890 _ML_TYPE_SWITCH_C(ML_IMPLEMENT_SCALAR_CASES, _ML_SWITCH_CODE1S_DD, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_1_DIFFERENT_SCALAR_INOUT_DATATYPES_CPP", SubImage *inSubImgs, CLASS_NAME);
891#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_1_DIFFERENT_INOUT_DATATYPES_WITH_CUSTOM_SWITCH_CPP(CLASS_NAME, DTSWITCHES) \
892 _ML_TYPE_SWITCH_C(DTSWITCHES, _ML_SWITCH_CODE1_DD, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_1_DIFFERENT_INOUT_DATATYPES_WITH_CUSTOM_SWITCH_CPP", SubImage *inSubImgs, CLASS_NAME);
893#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_1_DIFFERENT_DEFAULT_INOUT_DATATYPES(CLASS_NAME) \
894 _ML_TYPE_SWITCH_H(ML_IMPLEMENT_DEFAULT_CASES, _ML_SWITCH_CODE1_DD, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_1_DIFFERENT_DEFAULT_INOUT_DATATYPES", SubImage *inSubImgs);
895#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_1_DIFFERENT_SCALAR_INOUT_DATATYPES(CLASS_NAME) \
896 _ML_TYPE_SWITCH_H(ML_IMPLEMENT_SCALAR_CASES, _ML_SWITCH_CODE1S_DD, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_1_DIFFERENT_SCALAR_INOUT_DATATYPES", SubImage *inSubImgs);
897#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_1_DIFFERENT_INOUT_DATATYPES_WITH_CUSTOM_SWITCH(CLASS_NAME, DTSWITCHES) \
898 _ML_TYPE_SWITCH_H(DTSWITCHES, _ML_SWITCH_CODE1_DD, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_1_DIFFERENT_INOUT_DATATYPES_WITH_CUSTOM_SWITCH", SubImage *inSubImgs);
900
901
902//---------------------------------------------------------------------------------------------------
909
911#define _ML_SWITCH_CODE2_DD_L2(OUTDTYPE, INDTYPE, CLASS_NAME) \
912 { TSubImage<INDTYPE> it0(inSubImgs[0]), it1(inSubImgs[1]); _ML_CALCULATEOUTPUTCALL_HELPER(CLASS_NAME)(&outSI, outIndex, &it0, &it1); }
913
915#define _ML_SWITCH_CODE2_DD(OUTDTYPE, INDTYPE, CLASS_NAME) \
916 { \
917 TSubImage<OUTDTYPE> outSI(*outSubImg); \
918 ML_IMPLEMENT_DIFFERENT_INOUT_DATATYPES_CASES(CLASS_NAME, \
919 _ML_SWITCH_CODE2_DD_L2, \
920 inSubImgs[0].getDataType(), \
921 "_ML_SWITCH_CODE2_DD", \
922 INDTYPE); \
923 }
924
926#define _ML_SWITCH_CODE2S_DD(OUTDTYPE, INDTYPE, CLASS_NAME) \
927 { \
928 TSubImage<OUTDTYPE> outSI(*outSubImg); \
929 ML_IMPLEMENT_DIFFERENT_SCALAR_INOUT_DATATYPES_CASES(CLASS_NAME, \
930 _ML_SWITCH_CODE2_DD_L2, \
931 inSubImgs[0].getDataType(), \
932 "_ML_SWITCH_CODE2_DD", \
933 INDTYPE); \
934 }
935
938#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_2_DIFFERENT_DEFAULT_INOUT_DATATYPES_CPP(CLASS_NAME) \
939 _ML_TYPE_SWITCH_C(ML_IMPLEMENT_DEFAULT_CASES, _ML_SWITCH_CODE2_DD, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_2_DIFFERENT_DEFAULT_INOUT_DATATYPES_CPP", SubImage *inSubImgs, CLASS_NAME);
940#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_2_DIFFERENT_SCALAR_INOUT_DATATYPES_CPP(CLASS_NAME) \
941 _ML_TYPE_SWITCH_C(ML_IMPLEMENT_SCALAR_CASES, _ML_SWITCH_CODE2S_DD, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_2_DIFFERENT_SCALAR_INOUT_DATATYPES_CPP", SubImage *inSubImgs, CLASS_NAME);
942#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_2_DIFFERENT_INOUT_DATATYPES_WITH_CUSTOM_SWITCH_CPP(CLASS_NAME, DTSWITCHES) \
943 _ML_TYPE_SWITCH_C(DTSWITCHES, _ML_SWITCH_CODE2_DD, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_2_DIFFERENT_INOUT_DATATYPES_WITH_CUSTOM_SWITCH_CPP", SubImage *inSubImgs, CLASS_NAME);
944#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_2_DIFFERENT_DEFAULT_INOUT_DATATYPES(CLASS_NAME) \
945 _ML_TYPE_SWITCH_H(ML_IMPLEMENT_DEFAULT_CASES, _ML_SWITCH_CODE2_DD, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_2_DIFFERENT_DEFAULT_INOUT_DATATYPES", SubImage *inSubImgs);
946#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_2_DIFFERENT_SCALAR_INOUT_DATATYPES(CLASS_NAME) \
947 _ML_TYPE_SWITCH_H(ML_IMPLEMENT_SCALAR_CASES, _ML_SWITCH_CODE2S_DD, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_2_DIFFERENT_SCALAR_INOUT_DATATYPES", SubImage *inSubImgs);
948#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_2_DIFFERENT_INOUT_DATATYPES_WITH_CUSTOM_SWITCH(CLASS_NAME, DTSWITCHES) \
949 _ML_TYPE_SWITCH_H(DTSWITCHES, _ML_SWITCH_CODE2_DD, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_2_DIFFERENT_INOUT_DATATYPES_WITH_CUSTOM_SWITCH", SubImage *inSubImgs);
951
952
953//---------------------------------------------------------------------------------------------------
962
964#define _ML_SWITCH_CODE3_DD_L2(OUTDTYPE, INDTYPE, CLASS_NAME) \
965 { TSubImage<INDTYPE> it0(inSubImgs[0]), it1(inSubImgs[1]), it2(inSubImgs[2]); \
966 _ML_CALCULATEOUTPUTCALL_HELPER(CLASS_NAME)(&outSI, outIndex, &it0, &it1, &it2); }
967
969#define _ML_SWITCH_CODE3_DD(OUTDTYPE, INDTYPE, CLASS_NAME) \
970 { \
971 TSubImage<OUTDTYPE> outSI(*outSubImg); \
972 ML_IMPLEMENT_DIFFERENT_INOUT_DATATYPES_CASES(CLASS_NAME, \
973 _ML_SWITCH_CODE3_DD_L2, \
974 inSubImgs[0].getDataType(), \
975 "_ML_SWITCH_CODE3_DD", \
976 INDTYPE); \
977 }
978
980#define _ML_SWITCH_CODE3S_DD(OUTDTYPE, INDTYPE, CLASS_NAME) \
981 { \
982 TSubImage<OUTDTYPE> outSI(*outSubImg); \
983 ML_IMPLEMENT_DIFFERENT_SCALAR_INOUT_DATATYPES_CASES(CLASS_NAME, \
984 _ML_SWITCH_CODE3_DD_L2, \
985 inSubImgs[0].getDataType(), \
986 "_ML_SWITCH_CODE3_DD", \
987 INDTYPE); \
988 }
989
992#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_3_DIFFERENT_DEFAULT_INOUT_DATATYPES_CPP(CLASS_NAME) \
993 _ML_TYPE_SWITCH_C(ML_IMPLEMENT_DEFAULT_CASES, _ML_SWITCH_CODE3_DD, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_3_DIFFERENT_DEFAULT_INOUT_DATATYPES_CPP", SubImage *inSubImgs, CLASS_NAME);
994#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_3_DIFFERENT_SCALAR_INOUT_DATATYPES_CPP(CLASS_NAME) \
995 _ML_TYPE_SWITCH_C(ML_IMPLEMENT_SCALAR_CASES, _ML_SWITCH_CODE3S_DD, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_3_DIFFERENT_SCALAR_INOUT_DATATYPES_CPP", SubImage *inSubImgs, CLASS_NAME);
996#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_3_DIFFERENT_INOUT_DATATYPES_WITH_CUSTOM_SWITCH_CPP(CLASS_NAME, DTSWITCHES) \
997 _ML_TYPE_SWITCH_C(DTSWITCHES, _ML_SWITCH_CODE3_DD, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_3_DIFFERENT_INOUT_DATATYPES_WITH_CUSTOM_SWITCH_CPP", SubImage *inSubImgs, CLASS_NAME);
998#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_3_DIFFERENT_DEFAULT_INOUT_DATATYPES(CLASS_NAME) \
999 _ML_TYPE_SWITCH_H(ML_IMPLEMENT_DEFAULT_CASES, _ML_SWITCH_CODE3_DD, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_3_DIFFERENT_DEFAULT_INOUT_DATATYPES", SubImage *inSubImgs);
1000#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_3_DIFFERENT_SCALAR_INOUT_DATATYPES(CLASS_NAME) \
1001 _ML_TYPE_SWITCH_H(ML_IMPLEMENT_SCALAR_CASES, _ML_SWITCH_CODE3S_DD, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_3_DIFFERENT_SCALAR_INOUT_DATATYPES", SubImage *inSubImgs);
1002#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_3_DIFFERENT_INOUT_DATATYPES_WITH_CUSTOM_SWITCH(CLASS_NAME, DTSWITCHES) \
1003 _ML_TYPE_SWITCH_H(DTSWITCHES, _ML_SWITCH_CODE3_DD, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_3_DIFFERENT_INOUT_DATATYPES_WITH_CUSTOM_SWITCH", SubImage *inSubImgs);
1005
1006
1007//---------------------------------------------------------------------------------------------------
1016
1018#define _ML_SWITCH_CODE4_DD_L2(OUTDTYPE, INDTYPE, CLASS_NAME) \
1019 { TSubImage<INDTYPE> it0(inSubImgs[0]), it1(inSubImgs[1]), it2(inSubImgs[2]), it3(inSubImgs[3]); \
1020 _ML_CALCULATEOUTPUTCALL_HELPER(CLASS_NAME)(&outSI, outIndex, &it0, &it1, &it2, &it3); }
1021
1023#define _ML_SWITCH_CODE4_DD(OUTDTYPE, INDTYPE, CLASS_NAME) \
1024 { \
1025 TSubImage<OUTDTYPE> outSI(*outSubImg); \
1026 ML_IMPLEMENT_DIFFERENT_INOUT_DATATYPES_CASES(CLASS_NAME, \
1027 _ML_SWITCH_CODE4_DD_L2, \
1028 inSubImgs[0].getDataType(), \
1029 "_ML_SWITCH_CODE4_DD", \
1030 INDTYPE); \
1031 }
1032
1034#define _ML_SWITCH_CODE4S_DD(OUTDTYPE, INDTYPE, CLASS_NAME) \
1035 { \
1036 TSubImage<OUTDTYPE> outSI(*outSubImg); \
1037 ML_IMPLEMENT_DIFFERENT_SCALAR_INOUT_DATATYPES_CASES(CLASS_NAME, \
1038 _ML_SWITCH_CODE4_DD_L2, \
1039 inSubImgs[0].getDataType(), \
1040 "_ML_SWITCH_CODE4_DD", \
1041 INDTYPE); \
1042 }
1043
1046#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_4_DIFFERENT_DEFAULT_INOUT_DATATYPES_CPP(CLASS_NAME) \
1047 _ML_TYPE_SWITCH_C(ML_IMPLEMENT_DEFAULT_CASES, _ML_SWITCH_CODE4_DD, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_4_DIFFERENT_DEFAULT_INOUT_DATATYPES_CPP", SubImage *inSubImgs, CLASS_NAME);
1048#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_4_DIFFERENT_SCALAR_INOUT_DATATYPES_CPP(CLASS_NAME) \
1049 _ML_TYPE_SWITCH_C(ML_IMPLEMENT_SCALAR_CASES, _ML_SWITCH_CODE4S_DD, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_4_DIFFERENT_SCALAR_INOUT_DATATYPES_CPP", SubImage *inSubImgs, CLASS_NAME);
1050#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_4_DIFFERENT_INOUT_DATATYPES_WITH_CUSTOM_SWITCH_CPP(CLASS_NAME, DTSWITCHES) \
1051 _ML_TYPE_SWITCH_C(DTSWITCHES, _ML_SWITCH_CODE4_DD, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_4_DIFFERENT_INOUT_DATATYPES_WITH_CUSTOM_SWITCH_CPP", SubImage *inSubImgs, CLASS_NAME);
1052#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_4_DIFFERENT_DEFAULT_INOUT_DATATYPES(CLASS_NAME) \
1053 _ML_TYPE_SWITCH_H(ML_IMPLEMENT_DEFAULT_CASES, _ML_SWITCH_CODE4_DD, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_4_DIFFERENT_DEFAULT_INOUT_DATATYPES", SubImage *inSubImgs);
1054#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_4_DIFFERENT_SCALAR_INOUT_DATATYPES(CLASS_NAME) \
1055 _ML_TYPE_SWITCH_H(ML_IMPLEMENT_SCALAR_CASES, _ML_SWITCH_CODE4S_DD, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_4_DIFFERENT_SCALAR_INOUT_DATATYPES", SubImage *inSubImgs);
1056#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_4_DIFFERENT_INOUT_DATATYPES_WITH_CUSTOM_SWITCH(CLASS_NAME, DTSWITCHES) \
1057 _ML_TYPE_SWITCH_H(DTSWITCHES, _ML_SWITCH_CODE4_DD, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_4_DIFFERENT_INOUT_DATATYPES_WITH_CUSTOM_SWITCH", SubImage *inSubImgs);
1059
1060
1061//---------------------------------------------------------------------------------------------------
1071
1073#define _ML_SWITCH_CODE5_DD_L2(OUTDTYPE, INDTYPE, CLASS_NAME) \
1074 { TSubImage<INDTYPE> it0(inSubImgs[0]), it1(inSubImgs[1]), it2(inSubImgs[2]), it3(inSubImgs[3]), it4(inSubImgs[4]); \
1075 _ML_CALCULATEOUTPUTCALL_HELPER(CLASS_NAME)(&outSI, outIndex, &it0, &it1, &it2, &it3, &it4); }
1076
1078#define _ML_SWITCH_CODE5_DD(OUTDTYPE, INDTYPE, CLASS_NAME) \
1079 { \
1080 TSubImage<OUTDTYPE> outSI(*outSubImg); \
1081 ML_IMPLEMENT_DIFFERENT_INOUT_DATATYPES_CASES(CLASS_NAME, \
1082 _ML_SWITCH_CODE5_DD_L2, \
1083 inSubImgs[0].getDataType(), \
1084 "_ML_SWITCH_CODE5_DD", \
1085 INDTYPE); \
1086 }
1087
1089#define _ML_SWITCH_CODE5S_DD(OUTDTYPE, INDTYPE, CLASS_NAME) \
1090 { \
1091 TSubImage<OUTDTYPE> outSI(*outSubImg); \
1092 ML_IMPLEMENT_DIFFERENT_SCALAR_INOUT_DATATYPES_CASES(CLASS_NAME, \
1093 _ML_SWITCH_CODE5_DD_L2, \
1094 inSubImgs[0].getDataType(), \
1095 "_ML_SWITCH_CODE5_DD", \
1096 INDTYPE); \
1097 }
1098
1101#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_5_DIFFERENT_DEFAULT_INOUT_DATATYPES_CPP(CLASS_NAME) \
1102 _ML_TYPE_SWITCH_C(ML_IMPLEMENT_DEFAULT_CASES, _ML_SWITCH_CODE5_DD, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_5_DIFFERENT_DEFAULT_INOUT_DATATYPES_CPP", SubImage *inSubImgs, CLASS_NAME);
1103#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_5_DIFFERENT_SCALAR_INOUT_DATATYPES_CPP(CLASS_NAME) \
1104 _ML_TYPE_SWITCH_C(ML_IMPLEMENT_SCALAR_CASES, _ML_SWITCH_CODE5S_DD, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_5_DIFFERENT_SCALAR_INOUT_DATATYPES_CPP", SubImage *inSubImgs, CLASS_NAME);
1105#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_5_DIFFERENT_INOUT_DATATYPES_WITH_CUSTOM_SWITCH_CPP(CLASS_NAME, DTSWITCHES) \
1106 _ML_TYPE_SWITCH_C(DTSWITCHES, _ML_SWITCH_CODE5_DD, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_5_DIFFERENT_INOUT_DATATYPES_WITH_CUSTOM_SWITCH_CPP", SubImage *inSubImgs, CLASS_NAME);
1107#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_5_DIFFERENT_DEFAULT_INOUT_DATATYPES(CLASS_NAME) \
1108 _ML_TYPE_SWITCH_H(ML_IMPLEMENT_DEFAULT_CASES, _ML_SWITCH_CODE5_DD, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_5_DIFFERENT_DEFAULT_INOUT_DATATYPES", SubImage *inSubImgs);
1109#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_5_DIFFERENT_SCALAR_INOUT_DATATYPES(CLASS_NAME) \
1110 _ML_TYPE_SWITCH_H(ML_IMPLEMENT_SCALAR_CASES, _ML_SWITCH_CODE5S_DD, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_5_DIFFERENT_SCALAR_INOUT_DATATYPES", SubImage *inSubImgs);
1111#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_5_DIFFERENT_INOUT_DATATYPES_WITH_CUSTOM_SWITCH(CLASS_NAME, DTSWITCHES) \
1112 _ML_TYPE_SWITCH_H(DTSWITCHES, _ML_SWITCH_CODE5_DD, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_5_DIFFERENT_INOUT_DATATYPES_WITH_CUSTOM_SWITCH", SubImage *inSubImgs);
1114
1115
1116//---------------------------------------------------------------------------------------------------
1128
1130#define _ML_SWITCH_CODE10_DD_L2(OUTDTYPE, INDTYPE, CLASS_NAME) \
1131 { TSubImage<INDTYPE> it0(inSubImgs[0]), it1(inSubImgs[1]), it2(inSubImgs[2]), it3(inSubImgs[3]), it4(inSubImgs[4]); \
1132 TSubImage<INDTYPE> it5(inSubImgs[5]), it6(inSubImgs[6]), it7(inSubImgs[7]), it8(inSubImgs[8]), it9(inSubImgs[9]); \
1133 _ML_CALCULATEOUTPUTCALL_HELPER(CLASS_NAME)(&outSI, outIndex, &it0, &it1, &it2, &it3, &it4, &it5, &it6, &it7, &it8, &it9); }
1134
1136#define _ML_SWITCH_CODE10_DD(OUTDTYPE, INDTYPE, CLASS_NAME) \
1137 { \
1138 TSubImage<OUTDTYPE> outSI(*outSubImg); \
1139 ML_IMPLEMENT_DIFFERENT_INOUT_DATATYPES_CASES(CLASS_NAME, \
1140 _ML_SWITCH_CODE10_DD_L2, \
1141 inSubImgs[0].getDataType(), \
1142 "_ML_SWITCH_CODE10_DD", \
1143 INDTYPE); \
1144 }
1145
1147#define _ML_SWITCH_CODE10S_DD(OUTDTYPE, INDTYPE, CLASS_NAME) \
1148 { \
1149 TSubImage<OUTDTYPE> outSI(*outSubImg); \
1150 ML_IMPLEMENT_DIFFERENT_SCALAR_INOUT_DATATYPES_CASES(CLASS_NAME, \
1151 _ML_SWITCH_CODE10_DD_L2, \
1152 inSubImgs[0].getDataType(), \
1153 "_ML_SWITCH_CODE10_DD", \
1154 INDTYPE); \
1155 }
1156
1159#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_10_DIFFERENT_DEFAULT_INOUT_DATATYPES_CPP(CLASS_NAME) \
1160 _ML_TYPE_SWITCH_C(ML_IMPLEMENT_DEFAULT_CASES, _ML_SWITCH_CODE10_DD, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_10_DIFFERENT_DEFAULT_INOUT_DATATYPES_CPP", SubImage *inSubImgs, CLASS_NAME);
1161#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_10_DIFFERENT_SCALAR_INOUT_DATATYPES_CPP(CLASS_NAME) \
1162 _ML_TYPE_SWITCH_C(ML_IMPLEMENT_SCALAR_CASES, _ML_SWITCH_CODE10S_DD, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_10_DIFFERENT_SCALAR_INOUT_DATATYPES_CPP", SubImage *inSubImgs, CLASS_NAME);
1163#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_10_DIFFERENT_INOUT_DATATYPES_WITH_CUSTOM_SWITCH_CPP(CLASS_NAME, DTSWITCHES) \
1164 _ML_TYPE_SWITCH_C(DTSWITCHES, _ML_SWITCH_CODE10_DD, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_10_DIFFERENT_INOUT_DATATYPES_WITH_CUSTOM_SWITCH_CPP", SubImage *inSubImgs, CLASS_NAME);
1165#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_10_DIFFERENT_DEFAULT_INOUT_DATATYPES(CLASS_NAME) \
1166 _ML_TYPE_SWITCH_H(ML_IMPLEMENT_DEFAULT_CASES, _ML_SWITCH_CODE10_DD, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_10_DIFFERENT_DEFAULT_INOUT_DATATYPES", SubImage *inSubImgs);
1167#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_10_DIFFERENT_SCALAR_INOUT_DATATYPES(CLASS_NAME) \
1168 _ML_TYPE_SWITCH_H(ML_IMPLEMENT_SCALAR_CASES, _ML_SWITCH_CODE10S_DD, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_10_DIFFERENT_SCALAR_INOUT_DATATYPES", SubImage *inSubImgs);
1169#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_10_DIFFERENT_INOUT_DATATYPES_WITH_CUSTOM_SWITCH(CLASS_NAME, DTSWITCHES) \
1170 _ML_TYPE_SWITCH_H(DTSWITCHES, _ML_SWITCH_CODE10_DD, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_10_DIFFERENT_INOUT_DATATYPES_WITH_CUSTOM_SWITCH", SubImage *inSubImgs);
1172
1173
1174//---------------------------------------------------------------------------------------------------
1186
1188#define _ML_SWITCH_CODEN_DD(OUTDTYPE, INDTYPE, CLASS_NAME) \
1189 { \
1190 TSubImage<OUTDTYPE> outSI(*outSubImg); \
1191 ML_IMPLEMENT_DIFFERENT_INOUT_DATATYPES_CASES(CLASS_NAME, \
1192 _ML_SWITCH_CODE_N, \
1193 inSubImgs[0].getDataType(), \
1194 "_ML_SWITCH_CODEN_DD", \
1195 INDTYPE); \
1196 }
1197
1199#define _ML_SWITCH_CODENS_DD(OUTDTYPE, INDTYPE, CLASS_NAME) \
1200 { \
1201 TSubImage<OUTDTYPE> outSI(*outSubImg); \
1202 ML_IMPLEMENT_DIFFERENT_SCALAR_INOUT_DATATYPES_CASES(CLASS_NAME, \
1203 _ML_SWITCH_CODE_N, \
1204 inSubImgs[0].getDataType(), \
1205 "_ML_SWITCH_CODEN_DD", \
1206 INDTYPE); \
1207 }
1208
1211#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_N_DIFFERENT_DEFAULT_INOUT_DATATYPES_CPP(CLASS_NAME) \
1212 _ML_TYPE_SWITCH_C(ML_IMPLEMENT_DEFAULT_CASES, _ML_SWITCH_CODEN_DD, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_N_DIFFERENT_DEFAULT_INOUT_DATATYPES_CPP", SubImage *inSubImgs, CLASS_NAME);
1213#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_N_DIFFERENT_SCALAR_INOUT_DATATYPES_CPP(CLASS_NAME) \
1214 _ML_TYPE_SWITCH_C(ML_IMPLEMENT_SCALAR_CASES, _ML_SWITCH_CODENS_DD, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_N_DIFFERENT_SCALAR_INOUT_DATATYPES_CPP", SubImage *inSubImgs, CLASS_NAME);
1215#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_N_DIFFERENT_INOUT_DATATYPES_WITH_CUSTOM_SWITCH_CPP(CLASS_NAME, DTSWITCHES) \
1216 _ML_TYPE_SWITCH_C(DTSWITCHES, _ML_SWITCH_CODEN_DD, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_N_DIFFERENT_INOUT_DATATYPES_WITH_CUSTOM_SWITCH_CPP", SubImage *inSubImgs, CLASS_NAME);
1217#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_N_DIFFERENT_DEFAULT_INOUT_DATATYPES(CLASS_NAME) \
1218 _ML_TYPE_SWITCH_H(ML_IMPLEMENT_DEFAULT_CASES, _ML_SWITCH_CODEN_DD, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_N_DIFFERENT_DEFAULT_INOUT_DATATYPES", SubImage *inSubImgs);
1219#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_N_DIFFERENT_SCALAR_INOUT_DATATYPES(CLASS_NAME) \
1220 _ML_TYPE_SWITCH_H(ML_IMPLEMENT_SCALAR_CASES, _ML_SWITCH_CODENS_DD, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_N_DIFFERENT_SCALAR_INOUT_DATATYPES", SubImage *inSubImgs);
1221#define ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_N_DIFFERENT_INOUT_DATATYPES_WITH_CUSTOM_SWITCH(CLASS_NAME, DTSWITCHES) \
1222 _ML_TYPE_SWITCH_H(DTSWITCHES, _ML_SWITCH_CODEN_DD, "ML_CALCULATEOUTPUTSUBIMAGE_NUM_INPUTS_N_DIFFERENT_INOUT_DATATYPES_WITH_CUSTOM_SWITCH", SubImage *inSubImgs);
1224
1225
1226#endif //of __mlModuleMacros_H
1227
1228