33 #ifndef __INCLUDE_CONVERTER__
34 #define __INCLUDE_CONVERTER__
37 #ifndef __INCLUDE_MIST_H__
41 #ifndef __INCLUDE_MIST_COLOR_H__
45 #ifndef __INCLUDE_BITMAP_H__
54 namespace __converter__
56 template <
class T1,
class T2,
class Allocator1,
class Allocator2 >
62 template <
class T1,
class T2,
class Allocator1,
class Allocator2 >
69 template <
class T1,
class T2,
class Allocator1,
class Allocator2 >
77 template <
size_t T1,
class T2,
class Allocator1,
class Allocator2 >
85 template <
class T1,
size_t T2,
class Allocator1,
class Allocator2 >
91 template <
size_t T1,
size_t T2,
class Allocator1,
class Allocator2 >
97 template <
class T1,
class T2,
class Allocator1,
class Allocator2 >
106 template <
bool b1,
bool b2 >
109 template <
class T1,
class T2 >
110 static void convert(
const T1 &in, T2 &out )
112 out =
static_cast< T2
>( in );
117 struct _converter_< true, false >
119 template <
class T1,
class T2 >
120 static void convert(
const T1 &in, T2 &out )
122 out =
static_cast< T2
>( in.get_value( ) );
127 struct _converter_< false, true >
129 template <
class T1,
class T2 >
130 static void convert(
const T1 &in, T2 &out )
137 struct _converter_< true, true >
139 template <
class T1,
class T2 >
140 static void convert(
const T1 &in, T2 &out )
146 template <
class T1,
class T2 >
147 inline void converter(
const T1 &in, T2 &out )
149 _converter_< is_color< T1 >::value, is_color< T2 >::value >
::convert( in, out );
170 template <
class Array1,
class Array2 >
171 inline void convert(
const Array1 &in, Array2 &out )
173 typedef typename Array1::size_type size_type;
174 typedef typename Array1::value_type value_type;
175 typedef typename Array2::value_type out_value_type;
176 typedef unsigned short hist_value;
178 __converter__::resize( in, out );
180 for( size_type i = 0 ; i < in.size( ) ; i++ )
182 __converter__::converter( in[ i ], out[ i ] );
195 #endif // __INCLUDE_CONVERTER__