8 #ifndef MI_NEURAYLIB_TYPE_TRAITS_H
9 #define MI_NEURAYLIB_TYPE_TRAITS_H
105 template<
typename I>
struct Type_traits {};
107 template<>
struct Type_traits<mi::IBoolean>
108 {
static const char* get_type_name() {
return "Boolean"; } };
110 template<>
struct Type_traits<mi::ISint8>
111 {
static const char* get_type_name() {
return "Sint8"; } };
113 template<>
struct Type_traits<mi::ISint16>
114 {
static const char* get_type_name() {
return "Sint16"; } };
116 template<>
struct Type_traits<mi::ISint32>
117 {
static const char* get_type_name() {
return "Sint32"; } };
119 template<>
struct Type_traits<mi::ISint64>
120 {
static const char* get_type_name() {
return "Sint64"; } };
122 template<>
struct Type_traits<mi::IUint8>
123 {
static const char* get_type_name() {
return "Uint8"; } };
125 template<>
struct Type_traits<mi::IUint16>
126 {
static const char* get_type_name() {
return "Uint16"; } };
128 template<>
struct Type_traits<mi::IUint32>
129 {
static const char* get_type_name() {
return "Uint32"; } };
131 template<>
struct Type_traits<mi::IUint64>
132 {
static const char* get_type_name() {
return "Uint64"; } };
134 template<>
struct Type_traits<mi::IFloat32>
135 {
static const char* get_type_name() {
return "Float32"; } };
137 template<>
struct Type_traits<mi::IFloat64>
138 {
static const char* get_type_name() {
return "Float64"; } };
140 template<>
struct Type_traits<mi::ISize>
141 {
static const char* get_type_name() {
return "Size"; } };
143 template<>
struct Type_traits<mi::IDifference>
144 {
static const char* get_type_name() {
return "Difference"; } };
146 template<>
struct Type_traits<mi::IString>
147 {
static const char* get_type_name() {
return "String"; } };
149 template<>
struct Type_traits<mi::IUuid>
150 {
static const char* get_type_name() {
return "Uuid"; } };
152 template<>
struct Type_traits<mi::IVoid>
153 {
static const char* get_type_name() {
return "Void"; } };
155 template<>
struct Type_traits<mi::IRef>
156 {
static const char* get_type_name() {
return "Ref"; } };
158 template<>
struct Type_traits<mi::IParameter>
159 {
static const char* get_type_name() {
return "Parameter"; } };
161 template<>
struct Type_traits<mi::ITemporary>
162 {
static const char* get_type_name() {
return "Temporary"; } };
164 template<>
struct Type_traits<mi::IBoolean_2>
165 {
static const char* get_type_name() {
return "Boolean<2>"; } };
167 template<>
struct Type_traits<mi::IBoolean_3>
168 {
static const char* get_type_name() {
return "Boolean<3>"; } };
170 template<>
struct Type_traits<mi::IBoolean_4>
171 {
static const char* get_type_name() {
return "Boolean<4>"; } };
173 template<>
struct Type_traits<mi::ISint32_2>
174 {
static const char* get_type_name() {
return "Sint32<2>"; } };
176 template<>
struct Type_traits<mi::ISint32_3>
177 {
static const char* get_type_name() {
return "Sint32<3>"; } };
179 template<>
struct Type_traits<mi::ISint32_4>
180 {
static const char* get_type_name() {
return "Sint32<4>"; } };
182 template<>
struct Type_traits<mi::IUint32_2>
183 {
static const char* get_type_name() {
return "Uint32<2>"; } };
185 template<>
struct Type_traits<mi::IUint32_3>
186 {
static const char* get_type_name() {
return "Uint32<3>"; } };
188 template<>
struct Type_traits<mi::IUint32_4>
189 {
static const char* get_type_name() {
return "Uint32<4>"; } };
191 template<>
struct Type_traits<mi::IFloat32_2>
192 {
static const char* get_type_name() {
return "Float32<2>"; } };
194 template<>
struct Type_traits<mi::IFloat32_3>
195 {
static const char* get_type_name() {
return "Float32<3>"; } };
197 template<>
struct Type_traits<mi::IFloat32_4>
198 {
static const char* get_type_name() {
return "Float32<4>"; } };
200 template<>
struct Type_traits<mi::IFloat64_2>
201 {
static const char* get_type_name() {
return "Float64<2>"; } };
203 template<>
struct Type_traits<mi::IFloat64_3>
204 {
static const char* get_type_name() {
return "Float64<3>"; } };
206 template<>
struct Type_traits<mi::IFloat64_4>
207 {
static const char* get_type_name() {
return "Float64<4>"; } };
209 template<>
struct Type_traits<mi::IBoolean_2_2>
210 {
static const char* get_type_name() {
return "Boolean<2,2>"; } };
212 template<>
struct Type_traits<mi::IBoolean_2_3>
213 {
static const char* get_type_name() {
return "Boolean<2,3>"; } };
215 template<>
struct Type_traits<mi::IBoolean_2_4>
216 {
static const char* get_type_name() {
return "Boolean<2,4>"; } };
218 template<>
struct Type_traits<mi::IBoolean_3_2>
219 {
static const char* get_type_name() {
return "Boolean<3,2>"; } };
221 template<>
struct Type_traits<mi::IBoolean_3_3>
222 {
static const char* get_type_name() {
return "Boolean<3,3>"; } };
224 template<>
struct Type_traits<mi::IBoolean_3_4>
225 {
static const char* get_type_name() {
return "Boolean<3,4>"; } };
227 template<>
struct Type_traits<mi::IBoolean_4_2>
228 {
static const char* get_type_name() {
return "Boolean<4,2>"; } };
230 template<>
struct Type_traits<mi::IBoolean_4_3>
231 {
static const char* get_type_name() {
return "Boolean<4,3>"; } };
233 template<>
struct Type_traits<mi::IBoolean_4_4>
234 {
static const char* get_type_name() {
return "Boolean<4,4>"; } };
236 template<>
struct Type_traits<mi::ISint32_2_2>
237 {
static const char* get_type_name() {
return "Sint32<2,2>"; } };
239 template<>
struct Type_traits<mi::ISint32_2_3>
240 {
static const char* get_type_name() {
return "Sint32<2,3>"; } };
242 template<>
struct Type_traits<mi::ISint32_2_4>
243 {
static const char* get_type_name() {
return "Sint32<2,4>"; } };
245 template<>
struct Type_traits<mi::ISint32_3_2>
246 {
static const char* get_type_name() {
return "Sint32<3,2>"; } };
248 template<>
struct Type_traits<mi::ISint32_3_3>
249 {
static const char* get_type_name() {
return "Sint32<3,3>"; } };
251 template<>
struct Type_traits<mi::ISint32_3_4>
252 {
static const char* get_type_name() {
return "Sint32<3,4>"; } };
254 template<>
struct Type_traits<mi::ISint32_4_2>
255 {
static const char* get_type_name() {
return "Sint32<4,2>"; } };
257 template<>
struct Type_traits<mi::ISint32_4_3>
258 {
static const char* get_type_name() {
return "Sint32<4,3>"; } };
260 template<>
struct Type_traits<mi::ISint32_4_4>
261 {
static const char* get_type_name() {
return "Sint32<4,4>"; } };
263 template<>
struct Type_traits<mi::IUint32_2_2>
264 {
static const char* get_type_name() {
return "Uint32<2,2>"; } };
266 template<>
struct Type_traits<mi::IUint32_2_3>
267 {
static const char* get_type_name() {
return "Uint32<2,3>"; } };
269 template<>
struct Type_traits<mi::IUint32_2_4>
270 {
static const char* get_type_name() {
return "Uint32<2,4>"; } };
272 template<>
struct Type_traits<mi::IUint32_3_2>
273 {
static const char* get_type_name() {
return "Uint32<3,2>"; } };
275 template<>
struct Type_traits<mi::IUint32_3_3>
276 {
static const char* get_type_name() {
return "Uint32<3,3>"; } };
278 template<>
struct Type_traits<mi::IUint32_3_4>
279 {
static const char* get_type_name() {
return "Uint32<3,4>"; } };
281 template<>
struct Type_traits<mi::IUint32_4_2>
282 {
static const char* get_type_name() {
return "Uint32<4,2>"; } };
284 template<>
struct Type_traits<mi::IUint32_4_3>
285 {
static const char* get_type_name() {
return "Uint32<4,3>"; } };
287 template<>
struct Type_traits<mi::IUint32_4_4>
288 {
static const char* get_type_name() {
return "Uint32<4,4>"; } };
290 template<>
struct Type_traits<mi::IFloat32_2_2>
291 {
static const char* get_type_name() {
return "Float32<2,2>"; } };
293 template<>
struct Type_traits<mi::IFloat32_2_3>
294 {
static const char* get_type_name() {
return "Float32<2,3>"; } };
296 template<>
struct Type_traits<mi::IFloat32_2_4>
297 {
static const char* get_type_name() {
return "Float32<2,4>"; } };
299 template<>
struct Type_traits<mi::IFloat32_3_2>
300 {
static const char* get_type_name() {
return "Float32<3,2>"; } };
302 template<>
struct Type_traits<mi::IFloat32_3_3>
303 {
static const char* get_type_name() {
return "Float32<3,3>"; } };
305 template<>
struct Type_traits<mi::IFloat32_3_4>
306 {
static const char* get_type_name() {
return "Float32<3,4>"; } };
308 template<>
struct Type_traits<mi::IFloat32_4_2>
309 {
static const char* get_type_name() {
return "Float32<4,2>"; } };
311 template<>
struct Type_traits<mi::IFloat32_4_3>
312 {
static const char* get_type_name() {
return "Float32<4,3>"; } };
314 template<>
struct Type_traits<mi::IFloat32_4_4>
315 {
static const char* get_type_name() {
return "Float32<4,4>"; } };
317 template<>
struct Type_traits<mi::IFloat64_2_2>
318 {
static const char* get_type_name() {
return "Float64<2,2>"; } };
320 template<>
struct Type_traits<mi::IFloat64_2_3>
321 {
static const char* get_type_name() {
return "Float64<2,3>"; } };
323 template<>
struct Type_traits<mi::IFloat64_2_4>
324 {
static const char* get_type_name() {
return "Float64<2,4>"; } };
326 template<>
struct Type_traits<mi::IFloat64_3_2>
327 {
static const char* get_type_name() {
return "Float64<3,2>"; } };
329 template<>
struct Type_traits<mi::IFloat64_3_3>
330 {
static const char* get_type_name() {
return "Float64<3,3>"; } };
332 template<>
struct Type_traits<mi::IFloat64_3_4>
333 {
static const char* get_type_name() {
return "Float64<3,4>"; } };
335 template<>
struct Type_traits<mi::IFloat64_4_2>
336 {
static const char* get_type_name() {
return "Float64<4,2>"; } };
338 template<>
struct Type_traits<mi::IFloat64_4_3>
339 {
static const char* get_type_name() {
return "Float64<4,3>"; } };
341 template<>
struct Type_traits<mi::IFloat64_4_4>
342 {
static const char* get_type_name() {
return "Float64<4,4>"; } };
344 template<>
struct Type_traits<mi::IColor>
345 {
static const char* get_type_name() {
return "Color"; } };
347 template<>
struct Type_traits<mi::IColor3>
348 {
static const char* get_type_name() {
return "Color3"; } };
350 template<>
struct Type_traits<mi::ISpectrum>
351 {
static const char* get_type_name() {
return "Spectrum"; } };
353 template<>
struct Type_traits<mi::IBbox3>
354 {
static const char* get_type_name() {
return "Bbox3"; } };
356 template<
typename I, Size DIM>
struct Vector_type_traits {};
358 template<>
struct Vector_type_traits<bool, 2>
361 template<>
struct Vector_type_traits<bool, 3>
364 template<>
struct Vector_type_traits<bool, 4>
367 template<>
struct Vector_type_traits<mi::
Sint32, 2>
370 template<>
struct Vector_type_traits<mi::
Sint32, 3>
373 template<>
struct Vector_type_traits<mi::
Sint32, 4>
376 template<>
struct Vector_type_traits<mi::
Float32, 2>
379 template<>
struct Vector_type_traits<mi::
Float32, 3>
382 template<>
struct Vector_type_traits<mi::
Float32, 4>
385 template<>
struct Vector_type_traits<mi::
Float64, 2>
388 template<>
struct Vector_type_traits<mi::
Float64, 3>
391 template<>
struct Vector_type_traits<mi::
Float64, 4>
394 template<
typename I, Size ROW, Size COL>
struct Matrix_type_traits {};
396 template<>
struct Matrix_type_traits<bool, 2, 2>
399 template<>
struct Matrix_type_traits<bool, 2, 3>
402 template<>
struct Matrix_type_traits<bool, 2, 4>
405 template<>
struct Matrix_type_traits<bool, 3, 2>
408 template<>
struct Matrix_type_traits<bool, 3, 3>
411 template<>
struct Matrix_type_traits<bool, 3, 4>
414 template<>
struct Matrix_type_traits<bool, 4, 2>
417 template<>
struct Matrix_type_traits<bool, 4, 3>
420 template<>
struct Matrix_type_traits<bool, 4, 4>
423 template<>
struct Matrix_type_traits<mi::
Sint32, 2, 2>
426 template<>
struct Matrix_type_traits<mi::
Sint32, 2, 3>
429 template<>
struct Matrix_type_traits<mi::
Sint32, 2, 4>
432 template<>
struct Matrix_type_traits<mi::
Sint32, 3, 2>
435 template<>
struct Matrix_type_traits<mi::
Sint32, 3, 3>
438 template<>
struct Matrix_type_traits<mi::
Sint32, 3, 4>
441 template<>
struct Matrix_type_traits<mi::
Sint32, 4, 2>
444 template<>
struct Matrix_type_traits<mi::
Sint32, 4, 3>
447 template<>
struct Matrix_type_traits<mi::
Sint32, 4, 4>
450 template<>
struct Matrix_type_traits<mi::
Float32, 2, 2>
453 template<>
struct Matrix_type_traits<mi::
Float32, 2, 3>
456 template<>
struct Matrix_type_traits<mi::
Float32, 2, 4>
459 template<>
struct Matrix_type_traits<mi::
Float32, 3, 2>
462 template<>
struct Matrix_type_traits<mi::
Float32, 3, 3>
465 template<>
struct Matrix_type_traits<mi::
Float32, 3, 4>
468 template<>
struct Matrix_type_traits<mi::
Float32, 4, 2>
471 template<>
struct Matrix_type_traits<mi::
Float32, 4, 3>
474 template<>
struct Matrix_type_traits<mi::
Float32, 4, 4>
477 template<>
struct Matrix_type_traits<mi::
Float64, 2, 2>
480 template<>
struct Matrix_type_traits<mi::
Float64, 2, 3>
483 template<>
struct Matrix_type_traits<mi::
Float64, 2, 4>
486 template<>
struct Matrix_type_traits<mi::
Float64, 3, 2>
489 template<>
struct Matrix_type_traits<mi::
Float64, 3, 3>
492 template<>
struct Matrix_type_traits<mi::
Float64, 3, 4>
495 template<>
struct Matrix_type_traits<mi::
Float64, 4, 2>
498 template<>
struct Matrix_type_traits<mi::
Float64, 4, 3>
501 template<>
struct Matrix_type_traits<mi::
Float64, 4, 4>
508 #endif // MI_NEURAYLIB_TYPE_TRAITS_H