26 #include <mln/core/image/image2d.hh>
27 #include <mln/core/image/image3d.hh>
28 #include <mln/canvas/browsing/hyper_directional.hh>
29 #include <mln/fun/p2v/iota.hh>
30 #include <mln/debug/println.hh>
31 #include <mln/data/fill.hh>
34 template <
typename I_,
typename F>
35 struct assign_browsing_functor
38 typedef mln_site(I) S;
39 enum { dim = S::dim };
46 assign_browsing_functor(I& input, F f = F(),
int dir_ = 0)
60 mln_assertion(p[dir] == 0);
62 void fwd() { next(); }
63 void bkd() { next(); }
64 void down() { next(); }
70 template <
typename I,
typename F,
typename B>
71 void my_test(Image<I>& ima_,
72 const Function_v2v<F>& f_,
73 const Browsing<B>& browse_,
77 const F& f = exact(f_);
78 const B& browse = exact(browse_);
80 assign_browsing_functor<I, F> fun(ima, f, dir);
94 my_test(ima2, fun::p2v::iota(), canvas::browsing::hyper_directional, 0);
98 my_test(ima2, fun::p2v::iota(), canvas::browsing::hyper_directional, 1);
103 my_test(ima3, fun::p2v::iota(), canvas::browsing::hyper_directional, 0);
107 my_test(ima3, fun::p2v::iota(), canvas::browsing::hyper_directional, 1);
111 my_test(ima3, fun::p2v::iota(), canvas::browsing::hyper_directional, 2);