27 #ifndef MLN_CORE_ALIAS_NEIGHB2D_HH
28 # define MLN_CORE_ALIAS_NEIGHB2D_HH
38 # include <mln/core/alias/window2d.hh>
39 # include <mln/core/neighb.hh>
40 # include <mln/convert/from_to.hh>
41 # include <mln/make/double_neighb2d.hh>
42 # include <mln/fun/p2b/chess.hh>
207 neighb< win::multiple<window2d, mln::fun::p2b::chess> >
c6_2d();
211 template <
unsigned S>
212 void from_to_(
const bool (&values)[S], neighb2d& nbh);
215 template <
unsigned R,
unsigned C>
216 void from_to_(
bool const (&values)[R][C], neighb2d& nbh);
220 # ifndef MLN_INCLUDE_ONLY
228 static const bool vals[] = { 0, 1, 0,
242 static const bool vals[] = { 1, 1, 1,
256 static const bool vals[] = { 0, 0, 0,
270 static const bool vals[] = { 0, 1, 0,
280 neighb< win::multiple<window2d, mln::fun::p2b::chess> >
283 bool vert[] = { 1, 1, 0,
287 bool hori[] = { 0, 1, 1,
297 template <
unsigned S>
299 from_to_(
const bool (&values)[S], neighb2d& nbh)
301 enum { h = mlc_sqrt_int(S) / 2 };
302 mlc_bool((2 * h + 1) * (2 * h + 1) == S)::check();
303 window2d&
win = nbh.hook_win_();
305 mln_postcondition(win.is_neighbable_());
308 template <
unsigned R,
unsigned C>
310 from_to_(
bool const (&values)[R][C], neighb2d& nbh)
312 mlc_bool(R % 2 == 1)::check();
313 mlc_bool(C % 2 == 1)::check();
314 window2d& win = nbh.hook_win_();
316 mln_postcondition(win.is_neighbable_());
320 # endif // ! MLN_INCLUDE_ONLY
326 #endif // ! MLN_CORE_ALIAS_NEIGHB2D_HH