[PATCH 3/7] Complete mln/world/inter_pixel/neighb2d.hh.

* mln/world/inter_pixel/neighb2d.hh (mln::world::inter_pixel::c2c, mln::world::inter_pixel::c2e): New functions. --- milena/ChangeLog | 8 ++++++++ milena/mln/world/inter_pixel/neighb2d.hh | 26 ++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 0 deletions(-) diff --git a/milena/ChangeLog b/milena/ChangeLog index db4d604..1d88171 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -1,5 +1,13 @@ 2009-09-23 Roland Levillain <roland@lrde.epita.fr> + Complete mln/world/inter_pixel/neighb2d.hh. + + * mln/world/inter_pixel/neighb2d.hh + (mln::world::inter_pixel::c2c, mln::world::inter_pixel::c2e): + New functions. + +2009-09-23 Roland Levillain <roland@lrde.epita.fr> + Fix documentation in mln/world/inter_pixel/neighb2d.hh. * mln/world/inter_pixel/neighb2d.hh diff --git a/milena/mln/world/inter_pixel/neighb2d.hh b/milena/mln/world/inter_pixel/neighb2d.hh index 21233ef..048eb9b 100644 --- a/milena/mln/world/inter_pixel/neighb2d.hh +++ b/milena/mln/world/inter_pixel/neighb2d.hh @@ -47,6 +47,12 @@ namespace mln /// Double neighborhood used for inter-pixel images. typedef neighb< win::multiple<window2d, dim2::is_row_odd> > dbl_neighb2d; + // Pixel to neighboring pixels. + const neighb2d& c2c(); + + // Pixel to neighboring edges. + const neighb2d& c2e(); + // Edge to neighborhood pixels. const dbl_neighb2d& e2c(); @@ -56,6 +62,26 @@ namespace mln # ifndef MLN_INCLUDE_ONLY + const neighb2d& c2c() + { + static neighb2d it; + if (it.size() == 0) + { + static const bool vals[] = { 0, 0, 1, 0, 0, + 0, 0, 0, 0, 0, + 1, 0, 0, 0, 1, + 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0 }; + convert::from_to(vals, it); + } + return it; + } + + const neighb2d& c2e() + { + return c4(); + } + const dbl_neighb2d& e2c() { static const bool e2c_h[] = { 0, 1, 0, -- 1.6.4.4
participants (1)
-
Roland Levillain