1 #ifndef CVD_PIXEL_TRAITS_H_ 2 #define CVD_PIXEL_TRAITS_H_ 6 #if defined(CVD_HAVE_TOON) 15 template <
class T,
int LIFT = 0>
18 static_assert(std::numeric_limits<T>::is_specialized ==
true,
"Traits not defined for this type");
19 using element_type = T;
20 using wider_type = decltype(T {} * T {});
21 typedef float float_type;
22 static const bool integral =
true;
23 static const bool is_signed = std::numeric_limits<T>::is_signed;
24 static_assert(std::numeric_limits<T>::is_integer ==
true,
"Library bug, we shouldn't be here");
25 static const int bits_used = std::numeric_limits<T>::digits;
26 static const T max_intensity = std::numeric_limits<T>::max();
32 using element_type = float;
33 typedef float wider_type;
34 typedef float float_type;
35 static const bool integral =
false;
36 static const bool is_signed =
true;
37 static const float max_intensity;
46 using element_type = double;
47 typedef double wider_type;
48 typedef double float_type;
49 static const bool integral =
false;
50 static const bool is_signed =
true;
51 static const double max_intensity;
60 using element_type =
long double;
61 typedef long double wider_type;
62 typedef long double float_type;
63 static const bool integral =
false;
64 static const bool is_signed =
true;
65 static const long double max_intensity;
68 #if defined(CVD_HAVE_TOON) 70 struct traits<TooN::Vector<N>>
72 typedef TooN::Vector<N> wider_type;
73 typedef TooN::Vector<N> float_type;
74 static const bool integral =
false;
75 static const bool is_signed =
true;
76 static const TooN::Vector<N> max_intensity;
81 template <
int N,
int M>
82 struct traits<TooN::Matrix<N, M>>
84 typedef TooN::Matrix<N, M> wider_type;
85 typedef TooN::Matrix<N, M> float_type;
86 static const bool integral =
false;
87 static const bool is_signed =
true;
101 template <
class C,
int N,
int LIFT>
All classes and functions are within the CVD namespace.
Definition: argb.h:6
Definition: pixel_traits.h:96
Definition: pixel_traits.h:16