21 #ifndef CVD_PIXEL_TRAITS_H_
22 #define CVD_PIXEL_TRAITS_H_
45 template<
int LIFT>
struct traits<unsigned char, LIFT>
50 static const bool is_signed =
false;
51 static const int bits_used = 8;
52 static const unsigned char max_intensity=(1 << bits_used) - 1;
55 template<
int LIFT>
struct traits<char, LIFT>
60 static const bool is_signed = std::numeric_limits<char>::is_signed;
61 static const int bits_used = std::numeric_limits<char>::digits;
62 static const char max_intensity=(1 << bits_used) - 1;
65 template<
int LIFT>
struct traits<signed char, LIFT>
70 static const bool is_signed =
false;
71 static const int bits_used = 7;
72 static const signed char max_intensity=(1 << bits_used) - 1;
75 template<
int LIFT>
struct traits<short, LIFT>
80 static const bool is_signed =
true;
81 static const int bits_used = 15;
82 static const short max_intensity=(1 << bits_used) - 1;
85 template<
int LIFT>
struct traits<unsigned short, LIFT>
90 static const bool is_signed =
false;
91 static const int bits_used = 16;
92 static const unsigned short max_intensity=(1 << bits_used) - 1;
95 template<
int LIFT>
struct traits<int, LIFT>
100 static const bool is_signed =
true;
101 static const int bits_used = 16;
102 static const int max_intensity=(1 << bits_used) - 1;
105 template<
int LIFT>
struct traits<unsigned int, LIFT>
110 static const bool is_signed =
false;
111 static const int bits_used = 16;
112 static const unsigned int max_intensity=(1 << bits_used) - 1;
115 template<
int LIFT>
struct traits<long, LIFT>
120 static const bool is_signed =
true;
121 static const int bits_used = 16;
122 static const long max_intensity=(1 << bits_used) - 1;
125 template<
int LIFT>
struct traits<long long, LIFT>
130 static const bool is_signed =
true;
131 static const int bits_used = 31;
132 static const long long max_intensity=(1ll << bits_used) - 1ll;
135 template<
int LIFT>
struct traits<unsigned long long, LIFT>
140 static const bool is_signed =
false;
141 static const int bits_used = 31;
142 static const unsigned long long max_intensity=(1ull << bits_used) - 1ull;
145 template<
int LIFT>
struct traits<unsigned long, LIFT>
150 static const bool is_signed =
false;
151 static const int bits_used = 16;
152 static const long max_intensity=(1 << bits_used) - 1;
155 template<
int LIFT>
struct traits<float, LIFT>
160 static const bool is_signed =
true;
166 template<
int LIFT>
struct traits<double, LIFT>
171 static const bool is_signed =
true;
177 template<
int LIFT>
struct traits<long double, LIFT>
182 static const bool is_signed =
true;
186 template<
int LIFT>
struct traits<bool, LIFT>
191 static const bool is_signed =
false;
192 static const int bits_used = 1;
193 static const bool max_intensity=
true;
197 #if defined (CVD_HAVE_TOON)
198 template<
int N>
struct traits<
TooN::Vector<N> >
203 static const bool is_signed =
true;
208 template<
int N,
int M>
struct traits<
TooN::Matrix<N,M> >
213 static const bool is_signed =
true;
226 template<
class C,
int N,
int LIFT>
struct traits<C[N], LIFT>
static const long double max_intensity
unsigned long long wider_type
Everything lives inside this namespace.
indirect_type< typename traits< C >::float_type[N]>::type float_type
static const double max_intensity
static const float max_intensity
static const bool integral
indirect_type< typename traits< C >::wider_type[N]>::type wider_type