
* mln/core/image/complex_windows.hh (mln::complex_lower_dim_connected_n_face_window_p) (mln::complex_higher_dim_connected_n_face_window_p): New windows. (trait::window_< complex_lower_dim_connected_n_face_window_p<D, G> >) (trait::window_< complex_higher_dim_connected_n_face_window_p<D, G> >): New traits. Exercise these new windows... * tests/morpho/complex_image_morpho.cc: ...here. --- milena/ChangeLog | 14 +++++++ milena/mln/core/image/complex_windows.hh | 54 +++++++++++++++++++++++++++ milena/tests/morpho/complex_image_morpho.cc | 5 ++ 3 files changed, 73 insertions(+), 0 deletions(-) diff --git a/milena/ChangeLog b/milena/ChangeLog index 185b935..37db01d 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -1,5 +1,19 @@ 2008-10-18 Roland Levillain <roland@lrde.epita.fr> + Add windows based on lower/higher-dimension connected n-faces. + + * mln/core/image/complex_windows.hh + (mln::complex_lower_dim_connected_n_face_window_p) + (mln::complex_higher_dim_connected_n_face_window_p): + New windows. + (trait::window_< complex_lower_dim_connected_n_face_window_p<D, G> >) + (trait::window_< complex_higher_dim_connected_n_face_window_p<D, G> >): + New traits. + Exercise these new windows... + * tests/morpho/complex_image_morpho.cc: ...here. + +2008-10-18 Roland Levillain <roland@lrde.epita.fr> + Add neighborhoods based on lower/higher-dimension connected n-faces. * mln/core/image/complex_neighborhoods.hh diff --git a/milena/mln/core/image/complex_windows.hh b/milena/mln/core/image/complex_windows.hh index 662b528..6c074e7 100644 --- a/milena/mln/core/image/complex_windows.hh +++ b/milena/mln/core/image/complex_windows.hh @@ -75,6 +75,38 @@ namespace mln { }; + /// \brief Window centered on an n-face of complex returning the + /// n-faces sharing an (n-1)-face with the center n-face, as well as + /// this center n-face. + template <unsigned D, typename G> + struct complex_lower_dim_connected_n_face_window_p + : internal::complex_window_p_base< + D, G, + topo::adj_lower_dim_connected_n_face_fwd_iter<D>, + topo::adj_lower_dim_connected_n_face_bkd_iter<D>, + complex_lower_dim_connected_n_face_window_p<D, G> + > + { + }; + + /// \brief Window centered on an n-face of complex returning the + /// n-faces sharing an (n+1)-face with the center n-face, as well as + /// this center n-face. + template <unsigned D, typename G> + struct complex_higher_dim_connected_n_face_window_p + : internal::complex_window_p_base< + D, G, + topo::adj_higher_dim_connected_n_face_fwd_iter<D>, + topo::adj_higher_dim_connected_n_face_bkd_iter<D>, + complex_higher_dim_connected_n_face_window_p<D, G> + > + { + }; + + + // -------- // + // Traits. // + // -------- // namespace trait { @@ -112,6 +144,28 @@ namespace mln { }; + template <unsigned D, typename G> + struct window_< mln::complex_lower_dim_connected_n_face_window_p<D, G> > + : window_< mln::internal::complex_window_p_base< + D, G, + mln::topo::adj_lower_dim_connected_n_face_fwd_iter<D>, + mln::topo::adj_lower_dim_connected_n_face_bkd_iter<D>, + mln::complex_lower_dim_connected_n_face_window_p<D, G> > + > + { + }; + + template <unsigned D, typename G> + struct window_< mln::complex_higher_dim_connected_n_face_window_p<D, G> > + : window_< mln::internal::complex_window_p_base< + D, G, + mln::topo::adj_higher_dim_connected_n_face_fwd_iter<D>, + mln::topo::adj_higher_dim_connected_n_face_bkd_iter<D>, + mln::complex_higher_dim_connected_n_face_window_p<D, G> > + > + { + }; + } // end of namespace mln::trait } // end of namespace mln diff --git a/milena/tests/morpho/complex_image_morpho.cc b/milena/tests/morpho/complex_image_morpho.cc index bcf74bd..80b80f5 100644 --- a/milena/tests/morpho/complex_image_morpho.cc +++ b/milena/tests/morpho/complex_image_morpho.cc @@ -162,6 +162,11 @@ int main() test_morpho(ima, complex_lower_higher_window_p<D, G>(), "lower- and higer-dimension faces"); + test_morpho(ima, complex_lower_dim_connected_n_face_window_p<D, G>(), + "lower-dimension connected n-faces"); + test_morpho(ima, complex_higher_dim_connected_n_face_window_p<D, G>(), + "higher-dimension connected n-faces"); + /* FIXME: Exercise elementary erosion/dilation (with neighborhoods) when available. */ } -- 1.6.0.1