44 #ifndef OPENCV_CORE_TRAITS_HPP
45 #define OPENCV_CORE_TRAITS_HPP
47 #include "opencv2/core/cvdef.h"
115 #ifdef OPENCV_TRAITS_ENABLE_DEPRECATED
116 typedef _Tp value_type;
117 typedef value_type work_type;
118 typedef value_type channel_type;
119 typedef value_type vec_type;
120 enum { generic_type = 1,
136 enum { generic_type = 0,
151 enum { generic_type = 0,
166 enum { generic_type = 0,
181 enum { generic_type = 0,
196 enum { generic_type = 0,
211 enum { generic_type = 0,
226 enum { generic_type = 0,
241 enum { generic_type = 0,
256 enum { generic_type = 0,
271 enum { generic_type = 0,
295 #ifdef OPENCV_TRAITS_ENABLE_DEPRECATED
297 template<
int _depth>
class TypeDepth
299 #ifdef OPENCV_TRAITS_ENABLE_LEGACY_DEFAULTS
301 typedef void value_type;
305 template<>
class TypeDepth<
CV_8U>
308 typedef uchar value_type;
311 template<>
class TypeDepth<
CV_8S>
314 typedef schar value_type;
317 template<>
class TypeDepth<
CV_16U>
320 typedef ushort value_type;
323 template<>
class TypeDepth<
CV_16S>
326 typedef short value_type;
329 template<>
class TypeDepth<
CV_32S>
332 typedef int value_type;
335 template<>
class TypeDepth<
CV_32F>
338 typedef float value_type;
341 template<>
class TypeDepth<
CV_64F>
344 typedef double value_type;
347 template<>
class TypeDepth<
CV_16F>
350 typedef hfloat value_type;
360 #define CV_CREATE_MEMBER_CHECK(X) \
361 template<typename T> class CheckMember_##X { \
362 struct Fallback { int X; }; \
363 struct Derived : T, Fallback { }; \
364 template<typename U, U> struct Check; \
365 typedef char CV_NO[1]; \
366 typedef char CV_YES[2]; \
367 template<typename U> static CV_NO & func(Check<int Fallback::*, &U::X> *); \
368 template<typename U> static CV_YES & func(...); \
370 typedef CheckMember_##X type; \
371 enum { value = sizeof(func<Derived>(0)) == sizeof(CV_YES) }; \
374 CV_CREATE_MEMBER_CHECK(fmt)
375 CV_CREATE_MEMBER_CHECK(
type)
389 template<
typename T,
bool available =
internal::CheckMember_type< DataType<T> >::value >
401 template<
typename T,
bool available =
internal::CheckMember_fmt< DataType<T> >::value >
406 {
enum { fmt = 0 }; };
A helper class for cv::DataType.
Definition: traits.hpp:285
@ value
Definition: traits.hpp:289
@ fmt
Definition: traits.hpp:290
int work_type
Definition: traits.hpp:133
value_type vec_type
Definition: traits.hpp:135
value_type channel_type
Definition: traits.hpp:134
bool value_type
Definition: traits.hpp:132
value_type channel_type
Definition: traits.hpp:179
int work_type
Definition: traits.hpp:178
schar value_type
Definition: traits.hpp:177
value_type vec_type
Definition: traits.hpp:180
value_type channel_type
Definition: traits.hpp:254
value_type vec_type
Definition: traits.hpp:255
value_type work_type
Definition: traits.hpp:253
double value_type
Definition: traits.hpp:252
value_type channel_type
Definition: traits.hpp:239
value_type work_type
Definition: traits.hpp:238
float value_type
Definition: traits.hpp:237
value_type vec_type
Definition: traits.hpp:240
float work_type
Definition: traits.hpp:268
value_type channel_type
Definition: traits.hpp:269
hfloat value_type
Definition: traits.hpp:267
value_type vec_type
Definition: traits.hpp:270
value_type vec_type
Definition: traits.hpp:225
value_type channel_type
Definition: traits.hpp:224
int value_type
Definition: traits.hpp:222
value_type work_type
Definition: traits.hpp:223
value_type channel_type
Definition: traits.hpp:164
int work_type
Definition: traits.hpp:163
value_type vec_type
Definition: traits.hpp:165
schar value_type
Definition: traits.hpp:162
short value_type
Definition: traits.hpp:207
value_type vec_type
Definition: traits.hpp:210
value_type channel_type
Definition: traits.hpp:209
int work_type
Definition: traits.hpp:208
value_type channel_type
Definition: traits.hpp:149
int work_type
Definition: traits.hpp:148
value_type vec_type
Definition: traits.hpp:150
uchar value_type
Definition: traits.hpp:147
int work_type
Definition: traits.hpp:193
value_type vec_type
Definition: traits.hpp:195
ushort value_type
Definition: traits.hpp:192
value_type channel_type
Definition: traits.hpp:194
Template "trait" class for OpenCV primitive data types.
Definition: traits.hpp:113
InputArrayOfArrays InputArrayOfArrays InputOutputArray InputOutputArray InputOutputArray InputOutputArray Size InputOutputArray InputOutputArray T
Definition: calib3d.hpp:1867
int CvScalar value
Definition: core_c.h:720
int int channels
Definition: core_c.h:100
int int type
Definition: core_c.h:221
int depth
Definition: core_c.h:100
signed char schar
Definition: interface.h:48
#define CV_8S
Definition: interface.h:74
#define CV_16F
Definition: interface.h:80
#define CV_64F
Definition: interface.h:79
#define CV_8U
Definition: interface.h:73
#define CV_32S
Definition: interface.h:77
#define CV_32F
Definition: interface.h:78
unsigned char uchar
Definition: interface.h:51
#define CV_16S
Definition: interface.h:76
#define CV_MAKETYPE(depth, cn)
Definition: interface.h:85
unsigned short ushort
Definition: interface.h:52
#define CV_USRTYPE1
Definition: interface.h:67
#define CV_16U
Definition: interface.h:75
"black box" representation of the file storage associated with a file on disk.
Definition: calib3d.hpp:441
Definition: traits.hpp:382
@ value
Definition: traits.hpp:382
Definition: traits.hpp:402
Definition: traits.hpp:390
Definition: traits.hpp:386
@ value
Definition: traits.hpp:386