2592: Factor concrete windows of complex image.

* 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: Factor using mln::internal::complex_window_p_base. --- milena/ChangeLog | 9 ++ milena/mln/core/image/complex_higher_window_p.hh | 105 +------------------ .../core/image/complex_lower_higher_window_p.hh | 105 +------------------ milena/mln/core/image/complex_lower_window_p.hh | 105 +------------------ 4 files changed, 27 insertions(+), 297 deletions(-) diff --git a/milena/ChangeLog b/milena/ChangeLog index ae50733..cc3b10a 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -1,5 +1,14 @@ 2008-10-17 Roland Levillain <roland@lrde.epita.fr> + Factor concrete windows of complex image. + + * 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: + Factor using mln::internal::complex_window_p_base. + +2008-10-17 Roland Levillain <roland@lrde.epita.fr> + Add a factored implementation of window of complex image. * mln/core/internal/complex_window_p_base.hh: New. diff --git a/milena/mln/core/image/complex_higher_window_p.hh b/milena/mln/core/image/complex_higher_window_p.hh index b043ce9..cca6871 100644 --- a/milena/mln/core/image/complex_higher_window_p.hh +++ b/milena/mln/core/image/complex_higher_window_p.hh @@ -32,115 +32,22 @@ /// \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/concept/window.hh> - -# include <mln/core/site_set/complex_psite.hh> - -# include <mln/topo/centered_iter_adapter.hh> +# include <mln/core/internal/complex_window_p_base.hh> # include <mln/topo/adj_higher_face_iter.hh> namespace mln { - // Forward declarations. - template <unsigned D, typename G> class complex_higher_window_p; - template <typename I, typename G, typename W> class complex_window_fwd_piter; - template <typename I, typename G, typename W> class complex_window_bkd_piter; - - - namespace trait - { - - template <unsigned D, typename G> - struct window_< mln::complex_higher_window_p<D,G> > - { - typedef trait::window::size::unknown size; - typedef trait::window::support::irregular support; - typedef trait::window::definition::varying definition; - }; - - } // end of namespace mln::trait - - /// \brief Window centered on a n-face of complex returning its - /// adjacent (n+1)-faces as well as the center n-face. template <unsigned D, typename G> - class complex_higher_window_p - : public Window< complex_higher_window_p<D, 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> > { - typedef complex_higher_window_p<D, G> self_; - /// The complex iterators on the <em>adjacent</em> faces only - /// (without the center point). - /// \{ - typedef topo::adj_higher_face_fwd_iter<D> adj_fwd_iter_; - typedef topo::adj_higher_face_bkd_iter<D> adj_bkd_iter_; - /// \} - - public: - /// The associated complex iterators. - /// \{ - typedef topo::centered_fwd_iter_adapter<D, adj_fwd_iter_> complex_fwd_iter; - typedef topo::centered_bkd_iter_adapter<D, adj_bkd_iter_> complex_bkd_iter; - /// \} - - public: - /// Associated types. - /// \{ - /// The type of psite corresponding to the window. - typedef complex_psite<D, G> psite; - /// The type of site corresponding to the window. - typedef mln_site(psite) site; - - // FIXME: This is a dummy value. - typedef void dpsite; - - /// \brief Site_Iterator type to browse the psites of the window - /// w.r.t. the ordering of vertices. - typedef - complex_window_fwd_piter<complex_fwd_iter, G, self_> fwd_qiter; - - /// \brief Site_Iterator type to browse the psites of the window - /// w.r.t. the reverse ordering of vertices. - typedef - complex_window_bkd_piter<complex_bkd_iter, G, self_> bkd_qiter; - - /// The default qiter type. - typedef fwd_qiter qiter; - /// \} - - public: - /// Services. - /// \{ - /* FIXME: mln::morpho::dilation requires these method from models - of concept Window, but Window does not list them in its - requirements. Who's guilty: morpho::dilation or Window? */ - /// Is this window empty? (Always returns \c false). - bool is_empty() const; - /// Is this window centered? (Always returns \c true). - bool is_centered() const; - /// \} }; - - -# ifndef MLN_INCLUDE_ONLY - - template <unsigned D, typename G> - bool - complex_higher_window_p<D, G>::is_empty() const - { - return false; - } - - template <unsigned D, typename G> - bool - complex_higher_window_p<D, G>::is_centered() const - { - return true; - } - -# endif // ! MLN_INCLUDE_ONLY - } // 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 index f44a7c7..7ad62fa 100644 --- a/milena/mln/core/image/complex_lower_higher_window_p.hh +++ b/milena/mln/core/image/complex_lower_higher_window_p.hh @@ -33,115 +33,22 @@ /// returning its adjacent (n-1)-faces and (n+1)-faces as well as the /// center n-face. -# include <mln/core/concept/window.hh> - -# include <mln/core/site_set/complex_psite.hh> - -# include <mln/topo/centered_iter_adapter.hh> +# include <mln/core/internal/complex_window_p_base.hh> # include <mln/topo/adj_lower_higher_face_iter.hh> namespace mln { - // Forward declarations. - template <unsigned D, typename G> class complex_lower_higher_window_p; - template <typename I, typename G, typename W> class complex_window_fwd_piter; - template <typename I, typename G, typename W> class complex_window_bkd_piter; - - - namespace trait - { - - template <unsigned D, typename G> - struct window_< mln::complex_lower_higher_window_p<D,G> > - { - typedef trait::window::size::unknown size; - typedef trait::window::support::irregular support; - typedef trait::window::definition::varying definition; - }; - - } // end of namespace mln::trait - - /// \brief Window centered on a n-face of complex returning its - /// adjacent (n-1)-faces as well as the center n-face. template <unsigned D, typename G> - class complex_lower_higher_window_p - : public Window< complex_lower_higher_window_p<D, 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> > { - typedef complex_lower_higher_window_p<D, G> self_; - /// The complex iterators on the <em>adjacent</em> faces only - /// (without the center point). - /// \{ - typedef topo::adj_lower_higher_face_fwd_iter<D> adj_fwd_iter_; - typedef topo::adj_lower_higher_face_bkd_iter<D> adj_bkd_iter_; - /// \} - - public: - /// The associated complex iterators. - /// \{ - typedef topo::centered_fwd_iter_adapter<D, adj_fwd_iter_> complex_fwd_iter; - typedef topo::centered_bkd_iter_adapter<D, adj_bkd_iter_> complex_bkd_iter; - /// \} - - public: - /// Associated types. - /// \{ - /// The type of psite corresponding to the window. - typedef complex_psite<D, G> psite; - /// The type of site corresponding to the window. - typedef mln_site(psite) site; - - // FIXME: This is a dummy value. - typedef void dpsite; - - /// \brief Site_Iterator type to browse the psites of the window - /// w.r.t. the ordering of vertices. - typedef - complex_window_fwd_piter<complex_fwd_iter, G, self_> fwd_qiter; - - /// \brief Site_Iterator type to browse the psites of the window - /// w.r.t. the reverse ordering of vertices. - typedef - complex_window_bkd_piter<complex_bkd_iter, G, self_> bkd_qiter; - - /// The default qiter type. - typedef fwd_qiter qiter; - /// \} - - public: - /// Services. - /// \{ - /* FIXME: mln::morpho::dilation requires these method from models - of concept Window, but Window does not list them in its - requirements. Who's guilty: morpho::dilation or Window? */ - /// Is this window empty? (Always returns \c false). - bool is_empty() const; - /// Is this window centered? (Always returns \c true). - bool is_centered() const; - /// \} }; - - -# ifndef MLN_INCLUDE_ONLY - - template <unsigned D, typename G> - bool - complex_lower_higher_window_p<D, G>::is_empty() const - { - return false; - } - - template <unsigned D, typename G> - bool - complex_lower_higher_window_p<D, G>::is_centered() const - { - return true; - } - -# endif // ! MLN_INCLUDE_ONLY - } // 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 index 1a50d8f..7bd3cd1 100644 --- a/milena/mln/core/image/complex_lower_window_p.hh +++ b/milena/mln/core/image/complex_lower_window_p.hh @@ -32,115 +32,22 @@ /// \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/concept/window.hh> - -# include <mln/core/site_set/complex_psite.hh> - -# include <mln/topo/centered_iter_adapter.hh> +# include <mln/core/internal/complex_window_p_base.hh> # include <mln/topo/adj_lower_face_iter.hh> namespace mln { - // Forward declarations. - template <unsigned D, typename G> class complex_lower_window_p; - template <typename I, typename G, typename W> class complex_window_fwd_piter; - template <typename I, typename G, typename W> class complex_window_bkd_piter; - - - namespace trait - { - - template <unsigned D, typename G> - struct window_< mln::complex_lower_window_p<D,G> > - { - typedef trait::window::size::unknown size; - typedef trait::window::support::irregular support; - typedef trait::window::definition::varying definition; - }; - - } // end of namespace mln::trait - - /// \brief Window centered on a n-face of complex returning its - /// adjacent (n-1)-faces as well as the center n-face. template <unsigned D, typename G> - class complex_lower_window_p - : public Window< complex_lower_window_p<D, 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> > { - typedef complex_lower_window_p<D, G> self_; - /// The complex iterators on the <em>adjacent</em> faces only - /// (without the center point). - /// \{ - typedef topo::adj_lower_face_fwd_iter<D> adj_fwd_iter_; - typedef topo::adj_lower_face_bkd_iter<D> adj_bkd_iter_; - /// \} - - public: - /// The associated complex iterators. - /// \{ - typedef topo::centered_fwd_iter_adapter<D, adj_fwd_iter_> complex_fwd_iter; - typedef topo::centered_bkd_iter_adapter<D, adj_bkd_iter_> complex_bkd_iter; - /// \} - - public: - /// Associated types. - /// \{ - /// The type of psite corresponding to the window. - typedef complex_psite<D, G> psite; - /// The type of site corresponding to the window. - typedef mln_site(psite) site; - - // FIXME: This is a dummy value. - typedef void dpsite; - - /// \brief Site_Iterator type to browse the psites of the window - /// w.r.t. the ordering of vertices. - typedef - complex_window_fwd_piter<complex_fwd_iter, G, self_> fwd_qiter; - - /// \brief Site_Iterator type to browse the psites of the window - /// w.r.t. the reverse ordering of vertices. - typedef - complex_window_bkd_piter<complex_bkd_iter, G, self_> bkd_qiter; - - /// The default qiter type. - typedef fwd_qiter qiter; - /// \} - - public: - /// Services. - /// \{ - /* FIXME: mln::morpho::dilation requires these method from models - of concept Window, but Window does not list them in its - requirements. Who's guilty: morpho::dilation or Window? */ - /// Is this window empty? (Always returns \c false). - bool is_empty() const; - /// Is this window centered? (Always returns \c true). - bool is_centered() const; - /// \} }; - - -# ifndef MLN_INCLUDE_ONLY - - template <unsigned D, typename G> - bool - complex_lower_window_p<D, G>::is_empty() const - { - return false; - } - - template <unsigned D, typename G> - bool - complex_lower_window_p<D, G>::is_centered() const - { - return true; - } - -# endif // ! MLN_INCLUDE_ONLY - } // end of namespace mln #endif // ! MLN_CORE_IMAGE_COMPLEX_LOWER_WINDOW_P_HH -- 1.6.0.1
participants (1)
-
Roland Levillain