26 #ifndef MLN_MAKE_DUAL_NEIGHB_HH
27 # define MLN_MAKE_DUAL_NEIGHB_HH
33 # include <mln/core/concept/image.hh>
34 # include <mln/core/concept/neighborhood.hh>
35 # include <mln/pw/value.hh>
36 # include <mln/win/multiple_size.hh>
37 # include <mln/core/neighb.hh>
46 template <
typename I,
typename N>
47 neighb< win::multiple_size< 2, mln_window(N), pw::value_<I> > >
48 dual_neighb(
const Image<I>& ima,
49 const Neighborhood<N>& nbh_true,
50 const Neighborhood<N>& nbh_false);
54 # ifndef MLN_INCLUDE_ONLY
57 template <
typename I,
typename N>
59 neighb< win::multiple_size< 2, mln_window(N), pw::value_<I> > >
60 dual_neighb(
const Image<I>& ima_,
61 const Neighborhood<N>& nbh_true_,
62 const Neighborhood<N>& nbh_false_)
64 trace::entering(
"make::dual_neighb");
66 mlc_is(mln_trait_image_kind(I), trait::image::kind::logic)::check();
68 const I& ima = exact(ima_);
69 const N& nbh_true = exact(nbh_true_);
70 const N& nbh_false = exact(nbh_false_);
71 mln_precondition(ima.is_valid());
73 typedef win::multiple_size< 2, mln_window(N), pw::value_<I> > W;
74 W win(pw::value(ima));
75 win.set_window(
false, nbh_false.win());
76 win.set_window(
true, nbh_true .win());
80 trace::exiting(
"make::dual_neighb");
84 # endif // ! MLN_INCLUDE_ONLY
91 #endif // ! MLN_MAKE_DUAL_NEIGHB_HH