|
Open3D (C++ API)
0.17.0
|
Go to the documentation of this file.
30 #define DISPATCH_DTYPE_TO_TEMPLATE(DTYPE, ...) \
32 if (DTYPE == open3d::core::Float32) { \
33 using scalar_t = float; \
34 return __VA_ARGS__(); \
35 } else if (DTYPE == open3d::core::Float64) { \
36 using scalar_t = double; \
37 return __VA_ARGS__(); \
38 } else if (DTYPE == open3d::core::Int8) { \
39 using scalar_t = int8_t; \
40 return __VA_ARGS__(); \
41 } else if (DTYPE == open3d::core::Int16) { \
42 using scalar_t = int16_t; \
43 return __VA_ARGS__(); \
44 } else if (DTYPE == open3d::core::Int32) { \
45 using scalar_t = int32_t; \
46 return __VA_ARGS__(); \
47 } else if (DTYPE == open3d::core::Int64) { \
48 using scalar_t = int64_t; \
49 return __VA_ARGS__(); \
50 } else if (DTYPE == open3d::core::UInt8) { \
51 using scalar_t = uint8_t; \
52 return __VA_ARGS__(); \
53 } else if (DTYPE == open3d::core::UInt16) { \
54 using scalar_t = uint16_t; \
55 return __VA_ARGS__(); \
56 } else if (DTYPE == open3d::core::UInt32) { \
57 using scalar_t = uint32_t; \
58 return __VA_ARGS__(); \
59 } else if (DTYPE == open3d::core::UInt64) { \
60 using scalar_t = uint64_t; \
61 return __VA_ARGS__(); \
63 open3d::utility::LogError("Unsupported data type."); \
67 #define DISPATCH_DTYPE_TO_TEMPLATE_WITH_BOOL(DTYPE, ...) \
69 if (DTYPE == open3d::core::Bool) { \
70 using scalar_t = bool; \
71 return __VA_ARGS__(); \
73 DISPATCH_DTYPE_TO_TEMPLATE(DTYPE, __VA_ARGS__); \
77 #define DISPATCH_FLOAT_DTYPE_TO_TEMPLATE(DTYPE, ...) \
79 if (DTYPE == open3d::core::Float32) { \
80 using scalar_t = float; \
81 return __VA_ARGS__(); \
82 } else if (DTYPE == open3d::core::Float64) { \
83 using scalar_t = double; \
84 return __VA_ARGS__(); \
86 open3d::utility::LogError("Unsupported data type."); \
90 #define DISPATCH_FLOAT_INT_DTYPE_TO_TEMPLATE(FDTYPE, IDTYPE, ...) \
92 if (FDTYPE == open3d::core::Float32 && \
93 IDTYPE == open3d::core::Int32) { \
94 using scalar_t = float; \
95 using int_t = int32_t; \
96 return __VA_ARGS__(); \
97 } else if (FDTYPE == open3d::core::Float32 && \
98 IDTYPE == open3d::core::Int64) { \
99 using scalar_t = float; \
100 using int_t = int64_t; \
101 return __VA_ARGS__(); \
102 } else if (FDTYPE == open3d::core::Float64 && \
103 IDTYPE == open3d::core::Int32) { \
104 using scalar_t = double; \
105 using int_t = int32_t; \
106 return __VA_ARGS__(); \
107 } else if (FDTYPE == open3d::core::Float64 && \
108 IDTYPE == open3d::core::Int64) { \
109 using scalar_t = double; \
110 using int_t = int64_t; \
111 return __VA_ARGS__(); \
113 open3d::utility::LogError("Unsupported data type."); \