[PATCH 20/31] Small adaptations of Milena to fix Swilena.

* mln/core/concept/image.hh (mln::Image<E>::Image): Add concept checks for typedef piter. Update documentation. Aesthetic changes. * mln/core/alias/point2d.hh (mln::point2d, mln::point2df) * mln/core/alias/dpoint2d.hh (mln::dpoint2d) * mln/core/image/image2d.hh (mln::image2d<T>::at_) * mln/core/window.hh (mln::window<D>::dps_hook_): Use fully qualified type names. --- milena/ChangeLog | 14 ++++++++++++++ milena/mln/core/alias/dpoint2d.hh | 4 ++-- milena/mln/core/alias/point2d.hh | 4 ++-- milena/mln/core/concept/image.hh | 35 ++++++++++++++++++++++------------- milena/mln/core/image/image2d.hh | 8 ++++---- milena/mln/core/window.hh | 4 ++-- 6 files changed, 46 insertions(+), 23 deletions(-) diff --git a/milena/ChangeLog b/milena/ChangeLog index 8a351bd..b863fea 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -1,5 +1,19 @@ 2009-05-14 Roland Levillain <roland@lrde.epita.fr> + Small adaptations of Milena to fix Swilena. + + * mln/core/concept/image.hh (mln::Image<E>::Image): Add concept + checks for typedef piter. + Update documentation. + Aesthetic changes. + * mln/core/alias/point2d.hh (mln::point2d, mln::point2df) + * mln/core/alias/dpoint2d.hh (mln::dpoint2d) + * mln/core/image/image2d.hh (mln::image2d<T>::at_) + * mln/core/window.hh (mln::window<D>::dps_hook_): + Use fully qualified type names. + +2009-05-14 Roland Levillain <roland@lrde.epita.fr> + Have uniform signatures for watershed transforms. * mln/morpho/meyer_wst.hh diff --git a/milena/mln/core/alias/dpoint2d.hh b/milena/mln/core/alias/dpoint2d.hh index c7dc880..893f30e 100644 --- a/milena/mln/core/alias/dpoint2d.hh +++ b/milena/mln/core/alias/dpoint2d.hh @@ -1,4 +1,4 @@ -// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory +// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory // (LRDE) // // This file is part of the Olena Library. This library is free @@ -43,7 +43,7 @@ namespace mln /// Type alias for a delta-point defined on the 2D square /// grid with integer coordinates. - typedef dpoint<mln::grid::square, def::coord> dpoint2d; + typedef dpoint<mln::grid::square, mln::def::coord> dpoint2d; } // end of namespace mln diff --git a/milena/mln/core/alias/point2d.hh b/milena/mln/core/alias/point2d.hh index 3059169..898cf92 100644 --- a/milena/mln/core/alias/point2d.hh +++ b/milena/mln/core/alias/point2d.hh @@ -45,8 +45,8 @@ namespace mln /// Type alias for a point defined on the 2D square grid with /// integer coordinates. /// - typedef point<grid::square, def::coord> point2d; - typedef point<grid::square, def::coordf> point2df; + typedef point<mln::grid::square, mln::def::coord> point2d; + typedef point<mln::grid::square, mln::def::coordf> point2df; namespace internal diff --git a/milena/mln/core/concept/image.hh b/milena/mln/core/concept/image.hh index 494c8b4..6cf4fda 100644 --- a/milena/mln/core/concept/image.hh +++ b/milena/mln/core/concept/image.hh @@ -84,6 +84,7 @@ namespace mln typedef site; typedef psite; + typedef piter; typedef fwd_piter; typedef bkd_piter; @@ -92,10 +93,16 @@ namespace mln bool is_valid() const; - // to be provided in concrete image classes: + typedef t_eligible_values_set; + const t_eligible_values_set& values_eligible() const; + + typedef t_values_space; + const t_values_space& values_space() const; typedef value; + // to be provided in concrete image classes: + typedef vset; const vset& values() const; @@ -200,10 +207,11 @@ namespace mln { // provided by internal::image_base: - typedef mln_domain(E) domain_t; - typedef mln_site(E) site; - typedef mln_psite(E) psite; + typedef mln_domain(E) domain_t; + typedef mln_site(E) site; + typedef mln_psite(E) psite; + typedef mln_piter(E) piter; typedef mln_fwd_piter(E) fwd_piter; typedef mln_bkd_piter(E) bkd_piter; @@ -217,14 +225,21 @@ namespace mln bool (E::*m3)() const = & E::is_valid; m3 = 0; + typedef typename E::t_eligible_values_set t_eligible_values_set; + + const t_eligible_values_set& (E::*m4)() const = & E::values_eligible; + m4 = 0; + + typedef typename E::t_values_space t_values_space; + + const t_values_space& (E::*m5)() const = & E::values_space; + m5 = 0; + // to be provided in concrete image classes: typedef mln_value(E) value; typedef mln_rvalue(E) rvalue; typedef mln_lvalue(E) lvalue; - typedef typename E::t_eligible_values_set t_eligible_values_set; - typedef typename E::t_values_space t_values_space; - // FIXME Doc //typedef mln_vset(E) vset; @@ -239,12 +254,6 @@ namespace mln const domain_t& (E::*m8)() const = & E::domain; m8 = 0; - const t_eligible_values_set& (E::*m9)() const = & E::values_eligible; - m9 = 0; - - const t_values_space& (E::*m10)() const = & E::values_space; - m10 = 0; - typedef typename E::skeleton skeleton; // Check E::init_ presence. Since its signature varies from an diff --git a/milena/mln/core/image/image2d.hh b/milena/mln/core/image/image2d.hh index 40a9eb0..f5d30cc 100644 --- a/milena/mln/core/image/image2d.hh +++ b/milena/mln/core/image/image2d.hh @@ -209,10 +209,10 @@ namespace mln // ----------------- /// Read-only access to the image value located at (\p row, \p col). - const T& at_(def::coord row, def::coord col) const; + const T& at_(mln::def::coord row, mln::def::coord col) const; /// Read-write access to the image value located at (\p row, \p col). - T& at_(def::coord row, def::coord col); + T& at_(mln::def::coord row, mln::def::coord col); /// Give the number of rows. unsigned nrows() const; @@ -467,7 +467,7 @@ namespace mln template <typename T> inline const T& - image2d<T>::at_(def::coord row, def::coord col) const + image2d<T>::at_(mln::def::coord row, mln::def::coord col) const { mln_precondition(this->has(point2d(row, col))); return this->data_->array_[row][col]; @@ -476,7 +476,7 @@ namespace mln template <typename T> inline T& - image2d<T>::at_(def::coord row, def::coord col) + image2d<T>::at_(mln::def::coord row, mln::def::coord col) { mln_precondition(this->has(point2d(row, col))); return this->data_->array_[row][col]; diff --git a/milena/mln/core/window.hh b/milena/mln/core/window.hh index 81ba931..99c4913 100644 --- a/milena/mln/core/window.hh +++ b/milena/mln/core/window.hh @@ -1,4 +1,4 @@ -// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory +// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory // (LRDE) // // This file is part of the Olena Library. This library is free @@ -176,7 +176,7 @@ namespace mln const std::vector<D>& std_vector() const; /// Hook to the set of D. - const util::set<D>& dps_hook_() const; + const mln::util::set<D>& dps_hook_() const; /// Print the window definition into \p ostr. void print(std::ostream& ostr) const; -- 1.6.1.2
participants (1)
-
Roland Levillain