27 #ifndef MLN_CONVERT_FROM_TO_HXX
28 # define MLN_CONVERT_FROM_TO_HXX
35 # include <mln/core/def/all.hh>
36 # include <mln/core/grids.hh>
37 # include <mln/util/couple.hh>
50 template <
typename E>
struct Accumulator;
51 template <
typename E>
struct Gdpoint;
52 template <
typename E>
struct Gpoint;
53 template <
typename E>
struct Image;
54 template <
typename E>
struct Object;
55 template <
typename E>
struct Proxy;
56 template <
typename E>
struct Site_Set;
57 template <
typename E>
struct Value;
58 template <
typename E>
struct Weighted_Window;
59 template <
typename E>
struct Window;
61 template <
typename G,
typename C>
struct dpoint;
62 template <
typename G,
typename C>
struct point;
64 template <
typename D>
class neighb;
65 template <
typename D>
class window;
66 template <
typename D,
typename W>
struct w_window;
68 template <
typename T>
struct image1d;
71 template <
unsigned n,
typename T>
class vec;
72 template <
unsigned d,
typename C>
class h_vec;
77 template <
typename T>
class array;
82 template <
typename T>
struct array;
86 template <
typename T>
class array;
87 template <
typename Tag,
typename V>
class object_id;
91 namespace qt {
struct rgb32; }
92 template <
unsigned n>
struct rgb;
93 template <
typename H,
typename S,
typename L>
class hsl_;
94 template <
unsigned n>
struct int_u;
95 template <
unsigned n>
struct label;
107 template <
typename T,
typename O>
122 template <
typename F,
typename T>
124 from_to(
const F& from, T&
to);
131 template <
typename F,
typename T>
133 from_to_(
const Object<F>&, Object<T>&);
137 template <
typename T>
139 from_to_(
const Object<T>& from, Object<T>&
to);
142 template <
typename T>
144 from_to_(
const T& from, T&
to);
147 template <
typename G,
typename C1,
typename C2>
150 from_to_(
const point<G,C1>& from, point<G,C2>&
to);
153 template <
unsigned n,
typename C1,
typename G,
typename C2>
155 from_to_(
const algebra::vec<n,C1>& from, point<G,C2>&
to);
158 template <
unsigned n,
typename C1,
typename G>
160 from_to_(
const algebra::vec<n,C1>& from, point<G,C1>&
to);
163 template <
unsigned n,
typename T,
typename P>
165 from_to_(
const algebra::vec<n,T>& from, Gpoint<P>& to_);
168 template <
typename T,
unsigned m>
170 from_to_(
const algebra::vec<3,T>& from, value::rgb<m>&
to);
174 template <
unsigned m>
176 from_to_(
bool from, value::rgb<m>&
to);
180 from_to_(
const value::qt::rgb32& from,
bool&
to);
184 from_to_(
const bool& from, value::qt::rgb32&
to);
187 template <
unsigned m>
188 void from_to_(
const value::int_u<m>& from, value::rgb<m>&
to);
191 template <
unsigned m>
192 void from_to_(
const value::int_u<m>& from, value::qt::rgb32&
to);
195 template <
unsigned n>
196 void from_to_(
const value::int_u<n>& from, value::label<n>& to_);
199 template <
unsigned n>
200 void from_to_(
const value::int_u<n>& from,
unsigned& to_);
203 template <
unsigned n>
205 from_to_(
const value::int_u<n>& from,
bool& to_);
208 template <
unsigned n>
209 void from_to_(
const value::int_u<n>& from,
float& to_);
212 template <
unsigned n>
213 void from_to_(
const value::int_u<n>& from,
double& to_);
216 template <
unsigned n>
218 from_to_(
const value::label<n>& from, value::int_u<n>& to_);
221 template <
unsigned n>
222 void from_to_(
const value::label<n>& from,
bool& to_);
225 template <
unsigned n,
unsigned m>
227 from_to_(
const value::int_u<n>& from, value::label<m>& to_);
230 template <
typename H,
typename S,
typename L>
231 void from_to_(
const value::hsl_<H,S,L>&, value::rgb<8>&
to);
234 template <
typename H,
typename S,
typename L>
235 void from_to_(
const value::hsl_<H,S,L>&, value::rgb<16>&
to);
238 template <
typename H,
typename S,
typename L>
239 void from_to_(
const value::hsl_<H,S,L>&, value::qt::rgb32&
to);
243 from_to_(
const value::rgb<16>& from, value::hsl_<float,float,float>&
to);
247 from_to_(
const value::rgb<8>& from, value::hsl_<float,float,float>&
to);
250 template <
unsigned m>
251 void from_to_(
const value::rgb<m>& from,
bool&
to);
255 template <
typename V,
unsigned S,
typename I>
257 from_to_(
const V (&values)[S], Image<I>&
to);
260 template <
typename V,
unsigned S,
typename D,
typename W>
262 from_to_(
const V (&weight)[S], w_window<D,W>&
to);
266 template <
unsigned S>
268 from_to_(
const bool (&values)[S],
269 window< dpoint<grid::square, def::coord> >& win);
271 template <
unsigned R,
unsigned C>
273 from_to_(
const bool (&values)[R][C],
274 window< dpoint<grid::square, def::coord> >& win);
278 template <
unsigned S>
280 from_to_(
const bool (&values)[S],
281 window< dpoint<grid::cube, def::coord> >& win);
285 template <
unsigned S>
287 from_to_(
const bool (&values)[S],
288 neighb< window< dpoint<grid::square, def::coord> > >& nbh);
290 template <
unsigned R,
unsigned C>
292 from_to_(
bool const (&values)[R][C],
293 neighb< window< dpoint<grid::square, def::coord> > >& nbh);
297 template <
unsigned S>
299 from_to_(
const bool (&values)[S],
300 neighb< window< dpoint<grid::cube, def::coord> > >& nbh);
305 template <
typename D>
307 from_to_(
const Gdpoint<D>& from, mln_site(D)&
to);
311 template <
typename F,
typename T>
313 from_to_(
const Value<F>& from, Value<T>&
to);
316 template <
typename V>
318 from_to_(
const double& from, Value<V>&
to);
322 from_to_(
const double& from,
unsigned&
to);
326 from_to_(
const double& from,
int&
to);
329 template <
typename V>
331 from_to_(
const float& from, Value<V>&
to);
335 from_to_(
const float& from,
unsigned&
to);
339 from_to_(
const float& from,
int&
to);
342 template <
typename T>
344 from_to_(
const int& from, Value<T>&
to);
347 template <
typename P,
typename T>
349 from_to_(
const Proxy<P>& from, T&
to);
353 template <
typename P,
unsigned n,
typename T>
355 from_to_(
const Gpoint<P>& from, algebra::vec<n,T>&
to);
358 template <
typename P>
360 from_to_(
const Gpoint<P>& from, mln_delta(P)&
to);
364 template <
typename I,
typename S>
366 from_to_(
const Image<I>& from, Site_Set<S>&
to);
369 template <
typename I,
typename D,
typename W>
371 from_to_(
const Image<I>& from, w_window<D,W>&
to);
375 template <
typename W>
380 template <
typename W>
386 template <
typename W,
typename I>
388 from_to_(
const Window<W>& from, Image<I>&
to);
392 template <
typename D,
typename W,
typename I>
394 from_to_(
const w_window<D,W>& from, Image<I>&
to);
399 template <
typename T>
401 from_to_(
const util::array<T>& from, fun::i2v::array<T>&
to);
404 template <
typename T,
typename U>
406 from_to_(
const util::array<T>& from, fun::i2v::array<U>&
to);
409 template <
typename T>
411 from_to_(
const std::vector<T>& from, fun::i2v::array<T>&
to);
414 template <
typename T,
typename U>
416 from_to_(
const std::vector<T>& from, fun::i2v::array<U>&
to);
419 template <
typename T1,
typename T2>
421 from_to_(
const util::array<T1>& from, util::array<T2>&
to);
426 template <
typename T1,
typename T2>
428 from_to_(
const util::array<T1>& from, util::array<T2>&
to);
431 template <
typename T1,
typename T2>
433 from_to_(
const fun::i2v::array<T1>& from, util::array<T2>&
to);
437 template <
typename A>
439 from_to_(
const Accumulator<A>& from, mln_result(A)&
to);
444 template <
typename S,
typename I>
446 from_to_(
const Site_Set<S>& from, Image<I>&
to);
449 template <
typename S,
typename P,
typename C_>
451 from_to_(
const Site_Set<S>& from, std::set<P,C_>&
to);
454 template <
typename P,
typename C_,
typename S>
456 from_to_(
const std::set<P,C_>& from, Site_Set<S>&
to);
459 template <
typename V,
typename T>
461 from_to_(
const histo::array<V>& from, image1d<T>&
to);
464 template <
typename V,
typename T>
466 from_to_(
const util::array<V>& from, image1d<T>&
to);
469 template <
typename T,
typename U,
typename V,
typename W>
471 from_to_(
const util::couple<T, U>& from, util::couple<V, W>&
to)
473 from_to(from.first(), to.first());
474 from_to(from.second(), to.second());
478 template <
typename Tag,
typename V>
479 void from_to_(
const util::object_id<Tag,V>& from, V& to_);
488 #endif // ! MLN_CONVERT_FROM_TO_HXX