EstervQrCode 2.0.0
Library for qr code manipulation
Loading...
Searching...
No Matches
type_traits_detail.hpp
1/*M///////////////////////////////////////////////////////////////////////////////////////
2//
3// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
4//
5// By downloading, copying, installing or using the software you agree to this license.
6// If you do not agree to this license, do not download, install,
7// copy or use the software.
8//
9//
10// License Agreement
11// For Open Source Computer Vision Library
12//
13// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
14// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
15// Third party copyrights are property of their respective owners.
16//
17// Redistribution and use in source and binary forms, with or without modification,
18// are permitted provided that the following conditions are met:
19//
20// * Redistribution's of source code must retain the above copyright notice,
21// this list of conditions and the following disclaimer.
22//
23// * Redistribution's in binary form must reproduce the above copyright notice,
24// this list of conditions and the following disclaimer in the documentation
25// and/or other materials provided with the distribution.
26//
27// * The name of the copyright holders may not be used to endorse or promote products
28// derived from this software without specific prior written permission.
29//
30// This software is provided by the copyright holders and contributors "as is" and
31// any express or implied warranties, including, but not limited to, the implied
32// warranties of merchantability and fitness for a particular purpose are disclaimed.
33// In no event shall the Intel Corporation or contributors be liable for any direct,
34// indirect, incidental, special, exemplary, or consequential damages
35// (including, but not limited to, procurement of substitute goods or services;
36// loss of use, data, or profits; or business interruption) however caused
37// and on any theory of liability, whether in contract, strict liability,
38// or tort (including negligence or otherwise) arising in any way out of
39// the use of this software, even if advised of the possibility of such damage.
40//
41//M*/
42
43#ifndef OPENCV_CUDA_TYPE_TRAITS_DETAIL_HPP
44#define OPENCV_CUDA_TYPE_TRAITS_DETAIL_HPP
45
46#include "../common.hpp"
47#include "../vec_traits.hpp"
48
50
51namespace cv { namespace cuda { namespace device
52{
53 namespace type_traits_detail
54 {
55 template <bool, typename T1, typename T2> struct Select { typedef T1 type; };
56 template <typename T1, typename T2> struct Select<false, T1, T2> { typedef T2 type; };
57
58 template <typename T> struct IsSignedIntergral { enum {value = 0}; };
59 template <> struct IsSignedIntergral<schar> { enum {value = 1}; };
60 template <> struct IsSignedIntergral<char1> { enum {value = 1}; };
61 template <> struct IsSignedIntergral<short> { enum {value = 1}; };
62 template <> struct IsSignedIntergral<short1> { enum {value = 1}; };
63 template <> struct IsSignedIntergral<int> { enum {value = 1}; };
64 template <> struct IsSignedIntergral<int1> { enum {value = 1}; };
65
66 template <typename T> struct IsUnsignedIntegral { enum {value = 0}; };
67 template <> struct IsUnsignedIntegral<uchar> { enum {value = 1}; };
68 template <> struct IsUnsignedIntegral<uchar1> { enum {value = 1}; };
69 template <> struct IsUnsignedIntegral<ushort> { enum {value = 1}; };
70 template <> struct IsUnsignedIntegral<ushort1> { enum {value = 1}; };
71 template <> struct IsUnsignedIntegral<uint> { enum {value = 1}; };
72 template <> struct IsUnsignedIntegral<uint1> { enum {value = 1}; };
73
74 template <typename T> struct IsIntegral { enum {value = IsSignedIntergral<T>::value || IsUnsignedIntegral<T>::value}; };
75 template <> struct IsIntegral<char> { enum {value = 1}; };
76 template <> struct IsIntegral<bool> { enum {value = 1}; };
77
78 template <typename T> struct IsFloat { enum {value = 0}; };
79 template <> struct IsFloat<float> { enum {value = 1}; };
80 template <> struct IsFloat<double> { enum {value = 1}; };
81
82 template <typename T> struct IsVec { enum {value = 0}; };
83 template <> struct IsVec<uchar1> { enum {value = 1}; };
84 template <> struct IsVec<uchar2> { enum {value = 1}; };
85 template <> struct IsVec<uchar3> { enum {value = 1}; };
86 template <> struct IsVec<uchar4> { enum {value = 1}; };
87 template <> struct IsVec<uchar8> { enum {value = 1}; };
88 template <> struct IsVec<char1> { enum {value = 1}; };
89 template <> struct IsVec<char2> { enum {value = 1}; };
90 template <> struct IsVec<char3> { enum {value = 1}; };
91 template <> struct IsVec<char4> { enum {value = 1}; };
92 template <> struct IsVec<char8> { enum {value = 1}; };
93 template <> struct IsVec<ushort1> { enum {value = 1}; };
94 template <> struct IsVec<ushort2> { enum {value = 1}; };
95 template <> struct IsVec<ushort3> { enum {value = 1}; };
96 template <> struct IsVec<ushort4> { enum {value = 1}; };
97 template <> struct IsVec<ushort8> { enum {value = 1}; };
98 template <> struct IsVec<short1> { enum {value = 1}; };
99 template <> struct IsVec<short2> { enum {value = 1}; };
100 template <> struct IsVec<short3> { enum {value = 1}; };
101 template <> struct IsVec<short4> { enum {value = 1}; };
102 template <> struct IsVec<short8> { enum {value = 1}; };
103 template <> struct IsVec<uint1> { enum {value = 1}; };
104 template <> struct IsVec<uint2> { enum {value = 1}; };
105 template <> struct IsVec<uint3> { enum {value = 1}; };
106 template <> struct IsVec<uint4> { enum {value = 1}; };
107 template <> struct IsVec<uint8> { enum {value = 1}; };
108 template <> struct IsVec<int1> { enum {value = 1}; };
109 template <> struct IsVec<int2> { enum {value = 1}; };
110 template <> struct IsVec<int3> { enum {value = 1}; };
111 template <> struct IsVec<int4> { enum {value = 1}; };
112 template <> struct IsVec<int8> { enum {value = 1}; };
113 template <> struct IsVec<float1> { enum {value = 1}; };
114 template <> struct IsVec<float2> { enum {value = 1}; };
115 template <> struct IsVec<float3> { enum {value = 1}; };
116 template <> struct IsVec<float4> { enum {value = 1}; };
117 template <> struct IsVec<float8> { enum {value = 1}; };
118 template <> struct IsVec<double1> { enum {value = 1}; };
119 template <> struct IsVec<double2> { enum {value = 1}; };
120 template <> struct IsVec<double3> { enum {value = 1}; };
121 template <> struct IsVec<double4> { enum {value = 1}; };
122 template <> struct IsVec<double8> { enum {value = 1}; };
123
124 template <class U> struct AddParameterType { typedef const U& type; };
125 template <class U> struct AddParameterType<U&> { typedef U& type; };
126 template <> struct AddParameterType<void> { typedef void type; };
127
128 template <class U> struct ReferenceTraits
129 {
130 enum { value = false };
131 typedef U type;
132 };
133 template <class U> struct ReferenceTraits<U&>
134 {
135 enum { value = true };
136 typedef U type;
137 };
138
139 template <class U> struct PointerTraits
140 {
141 enum { value = false };
142 typedef void type;
143 };
144 template <class U> struct PointerTraits<U*>
145 {
146 enum { value = true };
147 typedef U type;
148 };
149 template <class U> struct PointerTraits<U*&>
150 {
151 enum { value = true };
152 typedef U type;
153 };
154
155 template <class U> struct UnConst
156 {
157 typedef U type;
158 enum { value = 0 };
159 };
160 template <class U> struct UnConst<const U>
161 {
162 typedef U type;
163 enum { value = 1 };
164 };
165 template <class U> struct UnConst<const U&>
166 {
167 typedef U& type;
168 enum { value = 1 };
169 };
170
171 template <class U> struct UnVolatile
172 {
173 typedef U type;
174 enum { value = 0 };
175 };
176 template <class U> struct UnVolatile<volatile U>
177 {
178 typedef U type;
179 enum { value = 1 };
180 };
181 template <class U> struct UnVolatile<volatile U&>
182 {
183 typedef U& type;
184 enum { value = 1 };
185 };
186 } // namespace type_traits_detail
187}}} // namespace cv { namespace cuda { namespace cudev
188
190
191#endif // OPENCV_CUDA_TYPE_TRAITS_DETAIL_HPP
int CvScalar value
Definition core_c.h:720
int int type
Definition core_c.h:221
const CvArr * U
Definition core_c.h:1340
signed char schar
Definition interface.h:48
uint32_t uint
Definition interface.h:42
unsigned char uchar
Definition interface.h:51
unsigned short ushort
Definition interface.h:52
"black box" representation of the file storage associated with a file on disk.
Definition calib3d.hpp:441