21 #ifndef __mia_internal_convert_hh
22 #define __mia_internal_convert_hh
39 template <
class Image>
61 template <
template <
typename>
class Data,
typename T>
62 typename TConvert<Image>::result_type operator () (
const Data<T>& data)
const;
65 template <
template <
typename>
class Data,
typename S,
typename T>
66 typename TConvert<Image>::result_type convert(
const Data<S>& src)
const;
67 typename TConvert::result_type do_filter(
const Image& image)
const;
79 template <
class Image>
83 TConvertFilterPlugin();
86 virtual const std::string do_get_descr()
const;
102 template <
typename T,
bool is_
float>
110 template <
typename T>
111 struct __mia_round<T, false> {
112 static T apply(
long double x)
114 return static_cast<T>(floor(x + 0.5));
118 template <
typename T,
bool is_
float>
119 struct __dispatch_minmax {
120 static std::pair<T, T> apply()
122 return std::pair<T, T>(std::numeric_limits<T>::min(), std::numeric_limits<T>::max());
126 template <
typename T>
127 struct __dispatch_minmax<T, true> {
128 static std::pair<T, T> apply()
130 return std::pair<T, T>(-1.0f, 1.0f);
134 template <
typename T>
136 static std::pair<T, T> apply()
138 return __dispatch_minmax<T, std::is_floating_point<T>::value >::apply();