2594: Fix and factor windows of complex images.

* mln/core/image/complex_windows.hh: New. Replace... * mln/core/image/complex_lower_window_p.hh, * mln/core/image/complex_higher_window_p.hh, * mln/core/image/complex_lower_higher_window_p.hh: ...these files. Remove. * mln/core/internal/complex_window_p_base.hh: Fix headers inclusions. * tests/morpho/complex_image_morpho.cc: Adjust. --- milena/ChangeLog | 15 +++ milena/mln/core/image/complex_higher_window_p.hh | 53 --------- .../core/image/complex_lower_higher_window_p.hh | 54 --------- milena/mln/core/image/complex_lower_window_p.hh | 53 --------- milena/mln/core/image/complex_windows.hh | 119 ++++++++++++++++++++ milena/mln/core/internal/complex_window_p_base.hh | 3 +- milena/tests/morpho/complex_image_morpho.cc | 4 +- 7 files changed, 137 insertions(+), 164 deletions(-) delete mode 100644 milena/mln/core/image/complex_higher_window_p.hh delete mode 100644 milena/mln/core/image/complex_lower_higher_window_p.hh delete mode 100644 milena/mln/core/image/complex_lower_window_p.hh create mode 100644 milena/mln/core/image/complex_windows.hh diff --git a/milena/ChangeLog b/milena/ChangeLog index 09d633d..aa31232 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -1,5 +1,20 @@ 2008-10-17 Roland Levillain <roland@lrde.epita.fr> + Fix and factor windows of complex images. + + * mln/core/image/complex_windows.hh: New. + Replace... + * mln/core/image/complex_lower_window_p.hh, + * mln/core/image/complex_higher_window_p.hh, + * mln/core/image/complex_lower_higher_window_p.hh: + ...these files. + Remove. + * mln/core/internal/complex_window_p_base.hh: Fix headers + inclusions. + * tests/morpho/complex_image_morpho.cc: Adjust. + +2008-10-17 Roland Levillain <roland@lrde.epita.fr> + Factor concrete windows of complex image. * mln/core/image/complex_lower_window_p.hh, diff --git a/milena/mln/core/image/complex_higher_window_p.hh b/milena/mln/core/image/complex_higher_window_p.hh deleted file mode 100644 index cca6871..0000000 --- a/milena/mln/core/image/complex_higher_window_p.hh +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE) -// -// This file is part of the Olena Library. This library is free -// software; you can redistribute it and/or modify it under the terms -// of the GNU General Public License version 2 as published by the -// Free Software Foundation. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this library; see the file COPYING. If not, write to -// the Free Software Foundation, 51 Franklin Street, Fifth Floor, -// Boston, MA 02111-1307, USA. -// -// As a special exception, you may use this file as part of a free -// software library without restriction. Specifically, if other files -// instantiate templates or use macros or inline functions from this -// file, or you compile this file and link it with other files to -// produce an executable, this file does not by itself cause the -// resulting executable to be covered by the GNU General Public -// License. This exception does not however invalidate any other -// reasons why the executable file might be covered by the GNU General -// Public License. - -#ifndef MLN_CORE_IMAGE_COMPLEX_HIGHER_WINDOW_P_HH -# define MLN_CORE_IMAGE_COMPLEX_HIGHER_WINDOW_P_HH - -/// \file mln/core/image/complex_higher_window_p.hh -/// \brief Definition of a window centered on a n-face of complex -/// returning its adjacent (n+1)-faces as well as the center n-face. - -# include <mln/core/internal/complex_window_p_base.hh> -# include <mln/topo/adj_higher_face_iter.hh> - - -namespace mln -{ - - template <unsigned D, typename G> - struct complex_higher_window_p - : internal::complex_window_p_base< D, G, - topo::adj_higher_face_fwd_iter<D>, - topo::adj_higher_face_bkd_iter<D>, - complex_higher_window_p<D, G> > - { - }; - -} // end of namespace mln - -#endif // ! MLN_CORE_IMAGE_COMPLEX_HIGHER_WINDOW_P_HH diff --git a/milena/mln/core/image/complex_lower_higher_window_p.hh b/milena/mln/core/image/complex_lower_higher_window_p.hh deleted file mode 100644 index 7ad62fa..0000000 --- a/milena/mln/core/image/complex_lower_higher_window_p.hh +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE) -// -// This file is part of the Olena Library. This library is free -// software; you can redistribute it and/or modify it under the terms -// of the GNU General Public License version 2 as published by the -// Free Software Foundation. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this library; see the file COPYING. If not, write to -// the Free Software Foundation, 51 Franklin Street, Fifth Floor, -// Boston, MA 02111-1307, USA. -// -// As a special exception, you may use this file as part of a free -// software library without restriction. Specifically, if other files -// instantiate templates or use macros or inline functions from this -// file, or you compile this file and link it with other files to -// produce an executable, this file does not by itself cause the -// resulting executable to be covered by the GNU General Public -// License. This exception does not however invalidate any other -// reasons why the executable file might be covered by the GNU General -// Public License. - -#ifndef MLN_CORE_IMAGE_COMPLEX_LOWER_HIGHER_WINDOW_P_HH -# define MLN_CORE_IMAGE_COMPLEX_LOWER_HIGHER_WINDOW_P_HH - -/// \file mln/core/image/complex_lower_higher_window_p.hh -/// \brief Definition of a window centered on a n-face of complex -/// returning its adjacent (n-1)-faces and (n+1)-faces as well as the -/// center n-face. - -# include <mln/core/internal/complex_window_p_base.hh> -# include <mln/topo/adj_lower_higher_face_iter.hh> - - -namespace mln -{ - - template <unsigned D, typename G> - struct complex_lower_higher_window_p - : internal::complex_window_p_base< D, G, - topo::adj_lower_higher_face_fwd_iter<D>, - topo::adj_lower_higher_face_bkd_iter<D>, - complex_lower_higher_window_p<D, G> > - { - }; - -} // end of namespace mln - -#endif // ! MLN_CORE_IMAGE_COMPLEX_LOWER_HIGHER_WINDOW_P_HH diff --git a/milena/mln/core/image/complex_lower_window_p.hh b/milena/mln/core/image/complex_lower_window_p.hh deleted file mode 100644 index 7bd3cd1..0000000 --- a/milena/mln/core/image/complex_lower_window_p.hh +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE) -// -// This file is part of the Olena Library. This library is free -// software; you can redistribute it and/or modify it under the terms -// of the GNU General Public License version 2 as published by the -// Free Software Foundation. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this library; see the file COPYING. If not, write to -// the Free Software Foundation, 51 Franklin Street, Fifth Floor, -// Boston, MA 02111-1307, USA. -// -// As a special exception, you may use this file as part of a free -// software library without restriction. Specifically, if other files -// instantiate templates or use macros or inline functions from this -// file, or you compile this file and link it with other files to -// produce an executable, this file does not by itself cause the -// resulting executable to be covered by the GNU General Public -// License. This exception does not however invalidate any other -// reasons why the executable file might be covered by the GNU General -// Public License. - -#ifndef MLN_CORE_IMAGE_COMPLEX_LOWER_WINDOW_P_HH -# define MLN_CORE_IMAGE_COMPLEX_LOWER_WINDOW_P_HH - -/// \file mln/core/image/complex_lower_window_p.hh -/// \brief Definition of a window centered on a n-face of complex -/// returning its adjacent (n-1)-faces as well as the center n-face. - -# include <mln/core/internal/complex_window_p_base.hh> -# include <mln/topo/adj_lower_face_iter.hh> - - -namespace mln -{ - - template <unsigned D, typename G> - struct complex_lower_window_p - : internal::complex_window_p_base< D, G, - topo::adj_lower_face_fwd_iter<D>, - topo::adj_lower_face_bkd_iter<D>, - complex_lower_window_p<D, G> > - { - }; - -} // end of namespace mln - -#endif // ! MLN_CORE_IMAGE_COMPLEX_LOWER_WINDOW_P_HH diff --git a/milena/mln/core/image/complex_windows.hh b/milena/mln/core/image/complex_windows.hh new file mode 100644 index 0000000..662b528 --- /dev/null +++ b/milena/mln/core/image/complex_windows.hh @@ -0,0 +1,119 @@ +// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE) +// +// This file is part of the Olena Library. This library is free +// software; you can redistribute it and/or modify it under the terms +// of the GNU General Public License version 2 as published by the +// Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this library; see the file COPYING. If not, write to +// the Free Software Foundation, 51 Franklin Street, Fifth Floor, +// Boston, MA 02111-1307, USA. +// +// As a special exception, you may use this file as part of a free +// software library without restriction. Specifically, if other files +// instantiate templates or use macros or inline functions from this +// file, or you compile this file and link it with other files to +// produce an executable, this file does not by itself cause the +// resulting executable to be covered by the GNU General Public +// License. This exception does not however invalidate any other +// reasons why the executable file might be covered by the GNU General +// Public License. + +#ifndef MLN_CORE_IMAGE_COMPLEX_WINDOWS_P_HH +# define MLN_CORE_IMAGE_COMPLEX_WINDOWS_P_HH + +/// \file mln/core/image/complex_windows.hh +/// \brief Definitions of some windows of complex images. + +# include <mln/core/internal/complex_window_p_base.hh> + +# include <mln/topo/adj_lower_face_iter.hh> +# include <mln/topo/adj_higher_face_iter.hh> +# include <mln/topo/adj_lower_higher_face_iter.hh> + + +namespace mln +{ + + /// \brief Window centered on an n-face of complex returning its + /// adjacent (n-1)-faces as well as the center n-face. + template <unsigned D, typename G> + struct complex_lower_window_p + : internal::complex_window_p_base< D, G, + topo::adj_lower_face_fwd_iter<D>, + topo::adj_lower_face_bkd_iter<D>, + complex_lower_window_p<D, G> > + { + }; + + /// \brief Window centered on an n-face of complex returning its + /// adjacent (n+1)-faces as well as the center n-face. + template <unsigned D, typename G> + struct complex_higher_window_p + : internal::complex_window_p_base< D, G, + topo::adj_higher_face_fwd_iter<D>, + topo::adj_higher_face_bkd_iter<D>, + complex_higher_window_p<D, G> > + { + }; + + /// \brief Window centered on an n-face of complex returning its + /// adjacent (n-1)-faces and (n+1)-faces as well as the center + /// n-face. + template <unsigned D, typename G> + struct complex_lower_higher_window_p + : internal::complex_window_p_base< D, G, + topo::adj_lower_higher_face_fwd_iter<D>, + topo::adj_lower_higher_face_bkd_iter<D>, + complex_lower_higher_window_p<D, G> > + { + }; + + + namespace trait + { + + template <unsigned D, typename G> + struct window_< mln::complex_lower_window_p<D, G> > + : window_< mln::internal::complex_window_p_base< + D, G, + mln::topo::adj_lower_face_fwd_iter<D>, + mln::topo::adj_lower_face_bkd_iter<D>, + mln::complex_lower_window_p<D, G> > + > + { + }; + + template <unsigned D, typename G> + struct window_< mln::complex_higher_window_p<D, G> > + : window_< mln::internal::complex_window_p_base< + D, G, + mln::topo::adj_higher_face_fwd_iter<D>, + mln::topo::adj_higher_face_bkd_iter<D>, + mln::complex_higher_window_p<D, G> > + > + { + }; + + template <unsigned D, typename G> + struct window_< mln::complex_lower_higher_window_p<D, G> > + : window_< mln::internal::complex_window_p_base< + D, G, + mln::topo::adj_lower_higher_face_fwd_iter<D>, + mln::topo::adj_lower_higher_face_bkd_iter<D>, + mln::complex_lower_higher_window_p<D, G> > + > + { + }; + + } // end of namespace mln::trait + +} // end of namespace mln + +#endif // ! MLN_CORE_IMAGE_COMPLEX_WINDOWS_P_HH diff --git a/milena/mln/core/internal/complex_window_p_base.hh b/milena/mln/core/internal/complex_window_p_base.hh index a50d594..3494552 100644 --- a/milena/mln/core/internal/complex_window_p_base.hh +++ b/milena/mln/core/internal/complex_window_p_base.hh @@ -36,7 +36,8 @@ # include <mln/core/concept/window.hh> # include <mln/core/site_set/complex_psite.hh> -# include <mln/topo/adj_lower_face_iter.hh> +# include <mln/topo/centered_iter_adapter.hh> + // FIXME: Factor with mln::internal::complex_neighborhood_base. diff --git a/milena/tests/morpho/complex_image_morpho.cc b/milena/tests/morpho/complex_image_morpho.cc index baf0f68..e3823c7 100644 --- a/milena/tests/morpho/complex_image_morpho.cc +++ b/milena/tests/morpho/complex_image_morpho.cc @@ -37,9 +37,7 @@ #include <mln/core/image/complex_image.hh> // FIXME: Include these elsewhere? (In complex_image.hh?) -#include <mln/core/image/complex_lower_window_p.hh> -#include <mln/core/image/complex_higher_window_p.hh> -#include <mln/core/image/complex_lower_higher_window_p.hh> +#include <mln/core/image/complex_windows.hh> #include <mln/core/image/complex_window_piter.hh> #include <mln/debug/iota.hh> -- 1.6.0.1
participants (1)
-
Roland Levillain