LRE
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
List overview
Download
Olena-patches
----- 2025 -----
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
olena-patches@lrde.epita.fr
9625 discussions
Start a n
N
ew thread
2692: Various small Fixes and cleanup.
by Guillaume Lazzara
* mln/util/internal/graph_edge.hh, * mln/util/internal/graph_base.hh, * mln/core/site_set/p_edges.hh, * mln/core/site_set/p_vertices.hh: fix compilation issues. * mln/fun/i2v/array.hh, * mln/pw/image.hh, * mln/core/site_set/p_graph_piter.hh: cleanup. * mln/util/internal/graph_vertex_psite.hh, * mln/util/graph.hh: fix wrong include. * tests/core/site_set/pset_if.cc: use geom::nsites() instead of estim::nsites(). --- milena/ChangeLog | 19 +++ milena/mln/core/site_set/p_edges.hh | 2 +- milena/mln/core/site_set/p_graph_piter.hh | 140 +----------------------- milena/mln/core/site_set/p_vertices.hh | 6 +- milena/mln/fun/i2v/array.hh | 2 +- milena/mln/pw/image.hh | 2 +- milena/mln/util/graph.hh | 3 +- milena/mln/util/internal/graph_base.hh | 23 +++- milena/mln/util/internal/graph_edge.hh | 2 +- milena/mln/util/internal/graph_vertex_psite.hh | 1 + milena/tests/core/site_set/pset_if.cc | 4 +- 11 files changed, 49 insertions(+), 155 deletions(-) diff --git a/milena/ChangeLog b/milena/ChangeLog index b0a73d6..4535ac6 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -14,6 +14,25 @@ 2008-10-26 Guillaume Lazzara <z(a)lrde.epita.fr> + Various small Fixes and cleanup. + + * mln/util/internal/graph_edge.hh, + * mln/util/internal/graph_base.hh, + * mln/core/site_set/p_edges.hh, + * mln/core/site_set/p_vertices.hh: fix compilation issues. + + * mln/fun/i2v/array.hh, + * mln/pw/image.hh, + * mln/core/site_set/p_graph_piter.hh: cleanup. + + * mln/util/internal/graph_vertex_psite.hh, + * mln/util/graph.hh: fix wrong include. + + * tests/core/site_set/pset_if.cc: use geom::nsites() instead of + estim::nsites(). + +2008-10-26 Guillaume Lazzara <z(a)lrde.epita.fr> + Change return type of Site_set::nsites() from unsigned to std:size_t. * mln/core/concept/box.hh, diff --git a/milena/mln/core/site_set/p_edges.hh b/milena/mln/core/site_set/p_edges.hh index 3c94998..16d7c45 100644 --- a/milena/mln/core/site_set/p_edges.hh +++ b/milena/mln/core/site_set/p_edges.hh @@ -207,7 +207,7 @@ namespace mln p_edges<G, F>::has(const util::edge<G2>& e) const { mln_precondition(is_valid()); - return e.g()->is_subgraph_of(*g_) && g_->has(e) && e.is_valid(); + return e.g().is_subgraph_of(*g_) && g_->has(e) && e.is_valid(); } template <typename G, typename F> diff --git a/milena/mln/core/site_set/p_graph_piter.hh b/milena/mln/core/site_set/p_graph_piter.hh index 2a235c5..da5ae3d 100644 --- a/milena/mln/core/site_set/p_graph_piter.hh +++ b/milena/mln/core/site_set/p_graph_piter.hh @@ -35,10 +35,6 @@ //# include <mln/core/site_set/p_graph.hh> //# include <mln/core/image/graph_psite.hh> -/* FIXME: Iterators on p_graph and p_line_graph share common code. - Factor as much as possible. */ - - namespace mln { // Fwd decls. @@ -49,7 +45,7 @@ namespace mln | p_graph_piter<S,I>. | `------------------------*/ - /// \brief Forward iterator on point sites of a mln::S. + /// \brief Generic iterator on point sites of a mln::S. template <typename S, typename I> class p_graph_piter : public internal::site_set_iterator_base< S, @@ -99,66 +95,11 @@ namespace mln operator<<(std::ostream& ostr, const p_graph_piter<S,I>& p); - /*------------------------. - | p_graph_bkd_piter_<S,I>. | - `------------------------*/ - - /// \brief Backward iterator on point sites of a mln::S. -/* template <typename S, typename I> - class p_graph_bkd_piter_ - : public internal::site_set_iterator_base< S, - p_graph_bkd_piter_<S,I> > - { - typedef p_graph_bkd_piter_<S,I> self_; - typedef internal::site_set_iterator_base< S, self_ > super_; - typedef I iter; - - public: - /// Construction and assignment. - /// \{ - p_graph_bkd_piter_(); - p_graph_bkd_piter_(const S& pv); - /// \} - - /// Manipulation. - /// \{ - /// Test if the iterator is valid. - bool is_valid_() const; - /// Invalidate the iterator. - void invalidate_(); - - /// Start an iteration. - void start_(); - /// Go to the next point. - void next_(); - /// \} - - private: - /// Update the psite corresponding to this iterator. - void update_(); - - private: - /// The psite corresponding to this iterator. - using super_::p_; - - /// The underlying vertex iterator. - iter iter_; - }; - - - /// Print an mln::p_graph_bkd_piter_<S,I>. - template <typename S, typename I> - inline - std::ostream& - operator<<(std::ostream& ostr, const p_graph_bkd_piter_<S,I>& p); -*/ - - # ifndef MLN_INCLUDE_ONLY - /*------------------------. + /*---------------------. | p_graph_piter<S,I>. | - `------------------------*/ + `---------------------*/ template <typename S, typename I> inline @@ -232,81 +173,6 @@ namespace mln return ostr << p.unproxy_(); } - - /*------------------------. - | p_graph_bkd_piter_<S,I>. | - `------------------------*/ - -/* template <typename S, typename I> - inline - p_graph_bkd_piter_<S,I>::p_graph_bkd_piter_() - { - mln_postcondition(!this->is_valid()); - } - - template <typename S, typename I> - inline - p_graph_bkd_piter_<S,I>::p_graph_bkd_piter_(const S& pv) - : iter_(pv.g()) - { - this->change_target(pv); - mln_postcondition(!this->is_valid()); - } - - template <typename S, typename I> - inline - bool - p_graph_bkd_piter_<S,I>::is_valid_() const - { - return p_.is_valid(); - } - - template <typename S, typename I> - inline - void - p_graph_bkd_piter_<S,I>::invalidate_() - { - p_.invalidate(); - } - - template <typename S, typename I> - inline - void - p_graph_bkd_piter_<S,I>::start_() - { - iter_.start(); - if (this->is_valid()) - update_(); - } - - template <typename S, typename I> - inline - void - p_graph_bkd_piter_<S,I>::next_() - { - iter_.next(); - if (this->is_valid()) - update_(); - } - - template <typename S, typename I> - inline - void - p_graph_bkd_piter_<S,I>::update_() - { - mln_precondition(this->is_valid()); - // Update psite_. - p_.update_id(iter_.id()); - } - - template <typename S, typename I> - inline - std::ostream& - operator<<(std::ostream& ostr, const p_graph_bkd_piter_<S,I>& p) - { - return ostr << p.unproxy_(); - } -*/ # endif // ! MLN_INCLUDE_ONLY } // end of mln diff --git a/milena/mln/core/site_set/p_vertices.hh b/milena/mln/core/site_set/p_vertices.hh index 461bd51..371c581 100644 --- a/milena/mln/core/site_set/p_vertices.hh +++ b/milena/mln/core/site_set/p_vertices.hh @@ -222,7 +222,7 @@ namespace mln mln_precondition(is_valid()); return // Check whether P is compatible with this psite set. - (p.g() == g_) && + (p.g() == *g_) && // Check that the vertex id of P belongs to the range of valid // vertex ids. (p.is_valid()); @@ -259,10 +259,6 @@ namespace mln bool operator==(const p_vertices<G, F>& lhs, const p_vertices<G, F>& rhs) { - /* FIXME: We should not rely on pointer equality here, as graph - will soon become shells using (shared) tracked pointers to - actual data. So, delegate the equality test to the graphs - themselves. */ return (*lhs.g_) == (*rhs.g_); } diff --git a/milena/mln/fun/i2v/array.hh b/milena/mln/fun/i2v/array.hh index 3fb026c..219be8a 100644 --- a/milena/mln/fun/i2v/array.hh +++ b/milena/mln/fun/i2v/array.hh @@ -62,7 +62,7 @@ namespace mln T operator()(unsigned i) const; T& operator()(unsigned i); - + private: std::vector<T> v_; }; diff --git a/milena/mln/pw/image.hh b/milena/mln/pw/image.hh index 624fc11..ba07d40 100644 --- a/milena/mln/pw/image.hh +++ b/milena/mln/pw/image.hh @@ -259,7 +259,7 @@ namespace mln template <typename F, typename S> inline mln_result(F) - image<F,S>::operator()(const mln_psite(S)& p) const + image<F,S>::operator()(const mln_psite(S)& p) const { mln_precondition(this->data_->pset_.has(p)); return this->data_->f_(p); diff --git a/milena/mln/util/graph.hh b/milena/mln/util/graph.hh index aecb8e9..1cafb19 100644 --- a/milena/mln/util/graph.hh +++ b/milena/mln/util/graph.hh @@ -33,7 +33,7 @@ # include <mln/util/internal/graph_base.hh> # include <mln/util/internal/graph_iter.hh> -# include <mln/util/internal/graph_nbh_iter_base.hh> +# include <mln/util/internal/graph_nbh_iter.hh> # include <mln/util/ord_pair.hh> namespace mln @@ -210,7 +210,6 @@ namespace mln } // end of namespace mln - # ifndef MLN_INCLUDE_ONLY namespace mln diff --git a/milena/mln/util/internal/graph_base.hh b/milena/mln/util/internal/graph_base.hh index d98c6ff..2937258 100644 --- a/milena/mln/util/internal/graph_base.hh +++ b/milena/mln/util/internal/graph_base.hh @@ -125,8 +125,14 @@ namespace mln }; } // end of namespace mln::util::internal + } // End of namespace mln::util + template <typename E> + bool + operator==(const util::internal::graph_base<E>& lhs, + const util::internal::graph_base<E>& rhs); + # ifndef MLN_INCLUDE_ONLY namespace util @@ -186,7 +192,7 @@ namespace mln bool graph_base<E>::has(const util::vertex<E>& v) const { - return has_v(v.id()); + return exact(this)->has_v(v.id()); } /*--------------. @@ -198,7 +204,7 @@ namespace mln bool graph_base<E>::has(const util::edge<E>& e) const { - return has_e(e.id()); + return exact(this)->has_e(e.id()); } /*--------. @@ -216,15 +222,14 @@ namespace mln for (unsigned v = 0; v < g->v_nmax(); ++v) { ostr << "vertex: " << v << std::endl << " -- adjacent vertices: "; - for (int n = 0; n < g->v_nmax_nbh_vertices(v); ++n) + for (unsigned n = 0; n < g->v_nmax_nbh_vertices(v); ++n) ostr << g->v_ith_nbh_vertex(v, n) << " "; ostr << std::endl; } ostr << std::endl; ostr << "edges:" << std::endl; - unsigned ei = 0; - for (int i = 0; i < g->e_nmax(); ++i) + for (unsigned i = 0; i < g->e_nmax(); ++i) ostr << "edge " << i << ": (" << g->v1(i) << ", " << g->v2(i) << " )" @@ -237,6 +242,14 @@ namespace mln # endif // ! MLN_INCLUDE_ONLY + template <typename E> + inline + bool + operator==(const util::internal::graph_base<E>& lhs, + const util::internal::graph_base<E>& rhs) + { + return lhs.graph_id() == rhs.graph_id(); + } } // end of namespace mln diff --git a/milena/mln/util/internal/graph_edge.hh b/milena/mln/util/internal/graph_edge.hh index 42d0e62..510bfd9 100644 --- a/milena/mln/util/internal/graph_edge.hh +++ b/milena/mln/util/internal/graph_edge.hh @@ -170,7 +170,7 @@ namespace mln template <typename G> inline edge<G>::edge() - : g_(0), id_(0) + : id_(0) { } diff --git a/milena/mln/util/internal/graph_vertex_psite.hh b/milena/mln/util/internal/graph_vertex_psite.hh index b0b57cd..3db903c 100644 --- a/milena/mln/util/internal/graph_vertex_psite.hh +++ b/milena/mln/util/internal/graph_vertex_psite.hh @@ -30,6 +30,7 @@ # include <mln/core/concept/pseudo_site.hh> # include <mln/util/internal/graph_psite_base.hh> +# include <mln/util/internal/graph_vertex.hh> namespace mln { diff --git a/milena/tests/core/site_set/pset_if.cc b/milena/tests/core/site_set/pset_if.cc index b4a9469..9918f56 100644 --- a/milena/tests/core/site_set/pset_if.cc +++ b/milena/tests/core/site_set/pset_if.cc @@ -36,7 +36,7 @@ #include <mln/fun/p2b/chess.hh> #include <mln/convert/to_image.hh> #include <mln/convert/to_p_set.hh> -#include <mln/estim/nsites.hh> +#include <mln/geom/nsites.hh> int main() @@ -44,7 +44,7 @@ int main() using namespace mln; box2d box_8x8 = make::box2d(8, 8); - mln_assertion(estim::nsites((box_8x8 | fun::p2b::chess)) == 32); + mln_assertion(geom::nsites((box_8x8 | fun::p2b::chess)) == 32); { p_set<point2d> s = convert::to_p_set(box_8x8 | fun::p2b::chess); -- 1.5.6.5
16Â years, 2Â months
1
0
0
0
2691: Change return type of Site_set::nsites() from unsigned to std:size_t.
by Guillaume Lazzara
* mln/core/concept/box.hh, * mln/core/concept/site_set.hh, * mln/core/site_set/p_array.hh, * mln/core/site_set/p_complex.hh, * mln/core/site_set/p_faces.hh, * mln/core/site_set/p_graph.hh, * mln/core/site_set/p_image.hh, * mln/core/site_set/p_key.hh, * mln/core/site_set/p_line2d.hh, * mln/core/site_set/p_line_graph.hh, * mln/core/site_set/p_priority.hh, * mln/core/site_set/p_queue.hh, * mln/core/site_set/p_queue_fast.hh, * mln/core/site_set/p_run.hh, * mln/core/site_set/p_set.hh: Update declarations. --- milena/ChangeLog | 21 +++++++++++++++++++++ milena/mln/core/concept/box.hh | 6 +++--- milena/mln/core/concept/site_set.hh | 3 +-- milena/mln/core/site_set/p_array.hh | 4 ++-- milena/mln/core/site_set/p_complex.hh | 4 ++-- milena/mln/core/site_set/p_faces.hh | 4 ++-- milena/mln/core/site_set/p_graph.hh | 4 ++-- milena/mln/core/site_set/p_image.hh | 6 +++--- milena/mln/core/site_set/p_key.hh | 6 +++--- milena/mln/core/site_set/p_line2d.hh | 4 ++-- milena/mln/core/site_set/p_line_graph.hh | 4 ++-- milena/mln/core/site_set/p_priority.hh | 6 +++--- milena/mln/core/site_set/p_queue.hh | 4 ++-- milena/mln/core/site_set/p_queue_fast.hh | 4 ++-- milena/mln/core/site_set/p_run.hh | 6 +++--- milena/mln/core/site_set/p_set.hh | 4 ++-- 16 files changed, 55 insertions(+), 35 deletions(-) diff --git a/milena/ChangeLog b/milena/ChangeLog index 2c1de6a..b0a73d6 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -12,6 +12,27 @@ * mln/level/transform.hh, * mln/level/paste.hh: Rename routines. +2008-10-26 Guillaume Lazzara <z(a)lrde.epita.fr> + + Change return type of Site_set::nsites() from unsigned to std:size_t. + + * mln/core/concept/box.hh, + * mln/core/concept/site_set.hh, + * mln/core/site_set/p_array.hh, + * mln/core/site_set/p_complex.hh, + * mln/core/site_set/p_faces.hh, + * mln/core/site_set/p_graph.hh, + * mln/core/site_set/p_image.hh, + * mln/core/site_set/p_key.hh, + * mln/core/site_set/p_line2d.hh, + * mln/core/site_set/p_line_graph.hh, + * mln/core/site_set/p_priority.hh, + * mln/core/site_set/p_queue.hh, + * mln/core/site_set/p_queue_fast.hh, + * mln/core/site_set/p_run.hh, + * mln/core/site_set/p_set.hh: + Update declarations. + 2008-10-24 Roland Levillain <roland(a)lrde.epita.fr> Fix mln::level::stretch w.r.t. the initialization. diff --git a/milena/mln/core/concept/box.hh b/milena/mln/core/concept/box.hh index 607372e..aabb8a7 100644 --- a/milena/mln/core/concept/box.hh +++ b/milena/mln/core/concept/box.hh @@ -82,7 +82,7 @@ namespace mln * * \warning This method is final for all box classes. */ - unsigned nsites() const; + std::size_t nsites() const; protected: Box(); @@ -157,12 +157,12 @@ namespace mln template <typename E> inline - unsigned + std::size_t Box<E>::nsites() const { if (! exact(this)->is_valid()) return 0; - unsigned count = 1; + std::size_t count = 1; typedef mln_site(E) P; // Helps g++-3.3.5. for (unsigned i = 0; i < P::dim; ++i) count *= exact(this)->len(i); diff --git a/milena/mln/core/concept/site_set.hh b/milena/mln/core/concept/site_set.hh index 40b288e..dff5a11 100644 --- a/milena/mln/core/concept/site_set.hh +++ b/milena/mln/core/concept/site_set.hh @@ -186,8 +186,7 @@ namespace mln { static void run() { - // FIXME: Return type should be std::size_t. - unsigned (E::*m)() const = & E::nsites; + std::size_t (E::*m)() const = & E::nsites; m = 0; } }; diff --git a/milena/mln/core/site_set/p_array.hh b/milena/mln/core/site_set/p_array.hh index 7e0a95b..31fa521 100644 --- a/milena/mln/core/site_set/p_array.hh +++ b/milena/mln/core/site_set/p_array.hh @@ -125,7 +125,7 @@ namespace mln void change(const psite& p, const P& new_p); /// Give the number of sites. - unsigned nsites() const; + std::size_t nsites() const; /// Append a point \p p. @@ -383,7 +383,7 @@ namespace mln template <typename P> inline - unsigned + std::size_t p_array<P>::nsites() const { return vect_.size(); diff --git a/milena/mln/core/site_set/p_complex.hh b/milena/mln/core/site_set/p_complex.hh index 7b5e815..5f5c656 100644 --- a/milena/mln/core/site_set/p_complex.hh +++ b/milena/mln/core/site_set/p_complex.hh @@ -149,7 +149,7 @@ namespace mln /// `known'.) /* FIXME: Return type should be std::size_t (see mln/core/concept/site_set.hh). */ - unsigned nsites() const; + std::size_t nsites() const; /// Return The number of faces in the complex. std::size_t nfaces() const; @@ -236,7 +236,7 @@ namespace mln template <unsigned D, typename G> inline - unsigned + std::size_t p_complex<D, G>::nsites() const { return nfaces(); diff --git a/milena/mln/core/site_set/p_faces.hh b/milena/mln/core/site_set/p_faces.hh index 0d79798..5827ad4 100644 --- a/milena/mln/core/site_set/p_faces.hh +++ b/milena/mln/core/site_set/p_faces.hh @@ -120,7 +120,7 @@ namespace mln /// `known'.) /* FIXME: Return type should be std::size_t (see mln/core/concept/site_set.hh). */ - unsigned nsites() const; + std::size_t nsites() const; /// Return The number of faces in the complex. std::size_t nfaces() const; @@ -212,7 +212,7 @@ namespace mln template <unsigned N, unsigned D, typename P> inline - unsigned + std::size_t p_faces<N, D, P>::nsites() const { return nfaces(); diff --git a/milena/mln/core/site_set/p_graph.hh b/milena/mln/core/site_set/p_graph.hh index b530152..6146d6f 100644 --- a/milena/mln/core/site_set/p_graph.hh +++ b/milena/mln/core/site_set/p_graph.hh @@ -104,7 +104,7 @@ namespace mln /// Required by the mln::Point_Set concept. /* FIXME: Return type should be std::size_t (see mln/core/concept/site_set.hh). */ - unsigned nsites() const; + std::size_t nsites() const; /// Return The number of vertices in the graph. std::size_t nvertices() const; @@ -208,7 +208,7 @@ namespace mln template <typename P> inline - unsigned + std::size_t p_graph<P>::nsites() const { return nvertices(); diff --git a/milena/mln/core/site_set/p_image.hh b/milena/mln/core/site_set/p_image.hh index 930de2e..b3d9511 100644 --- a/milena/mln/core/site_set/p_image.hh +++ b/milena/mln/core/site_set/p_image.hh @@ -115,7 +115,7 @@ namespace mln bool is_valid() const; /// Give the number of sites. - unsigned nsites() const; + std::size_t nsites() const; /// Insertion element associated type. @@ -149,7 +149,7 @@ namespace mln private: I ima_; - unsigned nsites_; + std::size_t nsites_; }; @@ -198,7 +198,7 @@ namespace mln template <typename I> inline - unsigned + std::size_t p_image<I>::nsites() const { return nsites_; diff --git a/milena/mln/core/site_set/p_key.hh b/milena/mln/core/site_set/p_key.hh index 4b416be..7b294b9 100644 --- a/milena/mln/core/site_set/p_key.hh +++ b/milena/mln/core/site_set/p_key.hh @@ -115,7 +115,7 @@ namespace mln bool is_valid() const; /// Give the number of sites. - unsigned nsites() const; + std::size_t nsites() const; /// Insertion element associated type. @@ -192,7 +192,7 @@ namespace mln k_t k_; // Number of sites. - unsigned n_; + std::size_t n_; // Run invariance tests and return the result. bool run_() const; @@ -245,7 +245,7 @@ namespace mln template <typename K, typename P> inline - unsigned + std::size_t p_key<K,P>::nsites() const { mln_invariant(run_()); diff --git a/milena/mln/core/site_set/p_line2d.hh b/milena/mln/core/site_set/p_line2d.hh index 9ad9549..262c2f0 100644 --- a/milena/mln/core/site_set/p_line2d.hh +++ b/milena/mln/core/site_set/p_line2d.hh @@ -112,7 +112,7 @@ namespace mln /// Give the number of points. - unsigned nsites() const; + std::size_t nsites() const; /// Give the point that begins the line. const point2d& begin() const; @@ -252,7 +252,7 @@ namespace mln } inline - unsigned + std::size_t p_line2d::nsites() const { return arr_.nsites(); diff --git a/milena/mln/core/site_set/p_line_graph.hh b/milena/mln/core/site_set/p_line_graph.hh index b9a3ed0..0cd6680 100644 --- a/milena/mln/core/site_set/p_line_graph.hh +++ b/milena/mln/core/site_set/p_line_graph.hh @@ -109,7 +109,7 @@ namespace mln /// `known'.) /* FIXME: Return type should be std::size_t (see mln/core/concept/site_set.hh). */ - unsigned nsites() const; + std::size_t nsites() const; /// Return The number of vertices in the graph. std::size_t nvertices() const; @@ -196,7 +196,7 @@ namespace mln template <typename P> inline - unsigned + std::size_t p_line_graph<P>::nsites() const { return nedges(); diff --git a/milena/mln/core/site_set/p_priority.hh b/milena/mln/core/site_set/p_priority.hh index 147dece..3a630cf 100644 --- a/milena/mln/core/site_set/p_priority.hh +++ b/milena/mln/core/site_set/p_priority.hh @@ -114,7 +114,7 @@ namespace mln bool is_valid() const; /// Give the number of sites. - unsigned nsites() const; + std::size_t nsites() const; /// Push in the queue with \p priority the element \p e. @@ -181,7 +181,7 @@ namespace mln util::set<P> p_; q_type_ q_; - unsigned n_; + std::size_t n_; // Run invariance tests and return the result. bool run_() const; @@ -225,7 +225,7 @@ namespace mln template <typename P, typename Q> inline - unsigned + std::size_t p_priority<P,Q>::nsites() const { mln_invariant(run_()); diff --git a/milena/mln/core/site_set/p_queue.hh b/milena/mln/core/site_set/p_queue.hh index babc994..8692f57 100644 --- a/milena/mln/core/site_set/p_queue.hh +++ b/milena/mln/core/site_set/p_queue.hh @@ -108,7 +108,7 @@ namespace mln /// Give the number of sites. - unsigned nsites() const; + std::size_t nsites() const; /// Push a site \p p in the queue. @@ -195,7 +195,7 @@ namespace mln template <typename P> inline - unsigned + std::size_t p_queue<P>::nsites() const { return q_.size(); diff --git a/milena/mln/core/site_set/p_queue_fast.hh b/milena/mln/core/site_set/p_queue_fast.hh index 199edc4..54f8146 100644 --- a/milena/mln/core/site_set/p_queue_fast.hh +++ b/milena/mln/core/site_set/p_queue_fast.hh @@ -110,7 +110,7 @@ namespace mln bool compute_has(const P& p) const; /// Give the number of sites. - unsigned nsites() const; + std::size_t nsites() const; /// Push a site \p p in the queue. @@ -236,7 +236,7 @@ namespace mln template <typename P> inline - unsigned + std::size_t p_queue_fast<P>::nsites() const { mln_invariant(end_ >= begin_); diff --git a/milena/mln/core/site_set/p_run.hh b/milena/mln/core/site_set/p_run.hh index 21644eb..f618d89 100644 --- a/milena/mln/core/site_set/p_run.hh +++ b/milena/mln/core/site_set/p_run.hh @@ -128,7 +128,7 @@ namespace mln bool has_index(unsigned short i) const; /// Give the number of sites. - unsigned nsites() const; + std::size_t nsites() const; /// Give the length of the run. unsigned short length() const; @@ -162,7 +162,7 @@ namespace mln P start_; /// The length of the run. - unsigned short len_; + std::size_t len_; }; @@ -307,7 +307,7 @@ namespace mln template <typename P> inline - unsigned + std::size_t p_run<P>::nsites() const { mln_precondition(is_valid()); diff --git a/milena/mln/core/site_set/p_set.hh b/milena/mln/core/site_set/p_set.hh index 817d56b..041b4a2 100644 --- a/milena/mln/core/site_set/p_set.hh +++ b/milena/mln/core/site_set/p_set.hh @@ -107,7 +107,7 @@ namespace mln /// Give the number of sites. - unsigned nsites() const; + std::size_t nsites() const; /// Insertion element associated type. @@ -192,7 +192,7 @@ namespace mln template <typename P> inline - unsigned + std::size_t p_set<P>::nsites() const { return s_.nelements(); -- 1.5.6.5
16Â years, 2Â months
1
0
0
0
cleanup-2008 2689: INIM: Clean up classification.
by Ugo Jardonnet
https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena/sandbox
Index: ChangeLog from Ugo Jardonnet <ugo.jardonnet(a)lrde.epita.fr> INIM: Clean up classification. * classif/iccvg04.cc: Clean it up. iccvg04.cc | 82 ++++++++----------------------------------------------------- 1 file changed, 11 insertions(+), 71 deletions(-) Index: classif/iccvg04.cc --- classif/iccvg04.cc (revision 2688) +++ classif/iccvg04.cc (working copy) @@ -14,7 +14,6 @@ #include <mln/util/array.hh> #include <mln/labeling/compute.hh> -// FIXME: !? #include <mln/geom/all.hh> #include <mln/io/ppm/load.hh> @@ -99,86 +98,45 @@ void classify_image(const I& ima, const J& histo, const K& ws, int nbasins, int f) { - unsigned count[nbasins + 1]; memset(count, 0, (nbasins + 1) * sizeof(unsigned)); - algebra::vec<3, unsigned> sum[nbasins + 1]; + algebra::vec<3, unsigned> sum[nbasins + 1]; for (int i = 1; i < nbasins + 1; ++i) sum[i] = literal::zero; + // Compute representatives of every class mln_piter(I) p(ima.domain()); for_all(p) { point3d p3(ima(p).red() / f, ima(p).green() / f, ima(p).blue() / f); int w = ws(p3); - // Check if we are not on a border of the WS + //check if we are not on a border of the WS if (w != 0) { count[w] += histo(p3); sum[w] += histo(p3) * convert::to< algebra::vec<3, value::int_u8> >(p3); } -#if DEBUG - std::cerr << "p3 : " << p3 << " == " << convert::to<algebra::vec<3, value::int_u8> >(p3) << std::endl; -#endif // DEBUG } - for (int i = 1; i < nbasins + 1; ++i) - { - sum[i] *= f; - sum[i] /= count[i]; - //std::cout << "count[" << i << "] = " << count[i] << std::endl; -#if DEBUG - std::cout << "sum[" << i << "] = " << sum[i] << std::endl; -#endif // DEBUG - } - + sum[i] = (sum[i] * f) / count[i]; + // Make an output image where colors are replaced by their representatives. mln_piter(I) pi(ima.domain()); I out(ima.domain()); - I ws_out(ima.domain()); - for_all(pi) { - value::rgb8 coul = ima(pi); + //retrieve color class + value::rgb8 coul = ima(pi); int w = ws(point3d(coul.red() / f, coul.green() / f, coul.blue() / f)); - if (w != 0) // If w == 0 it means that the current point is part of a border of the watershed - { -#if DEBUG - std::cerr << "out(" << pi << ") = sum[" << w << "]; //" << sum[w] << std::endl; -#endif + //if w == 0, out(pi) = 0 ie is part of a border of the watershed out(pi) = convert::to<value::rgb8>(sum[w]); - //out(pi) = value::rgb8(sum[w][0], sum[w][1], sum[w][2]); - ws_out(pi) = value::rgb8(0, 0, 0); } - else - { -#if DEBUG - std::cerr << "Border : " << pi << std::endl; -#endif - ws_out(pi) = value::rgb8(255, 255, 255); - - // FIXME - // ima(pi) is a border in the histogram and therefore lacks of a mean color. - // Choosing a good value for out(pi) is not so easy. One idea could be to randomly - // choose a color from one of the surrounding classes, but it's not the best idea - // because of large « border » zones. - out(pi) = value::rgb8(255, 255, 255); - } - - //std::cerr << "(" << coul << ") -> (" << out(pi) << "); sum[" << w << "] = " << sum[w] << " -> " << convert::to<value::rgb8>(sum[w]) << std::endl; - } - - // 1- La valeur contenue dans sum n'est pas correctement écrite dans out.ppm. À vérifier ! - // 2- Le cast de sum[w] en rgb8 se passe très bizarrement. À vérifier ! - // 3- Rajoute le std::cout de count change le comportement du programme. À vérifier ! - // 4- Le WS semble faire des pâtés (beaucoup de points de classe 0) io::ppm::save(out, "out.ppm"); - io::ppm::save(ws_out, "out-ws.ppm"); } bool usage(int argc, char ** argv) @@ -196,7 +154,6 @@ { if (not usage(argc, argv)) return 1; - const int div_factor = atoi(argv[2]); const int lambda = atoi(argv[3]); @@ -205,36 +162,19 @@ //make histo image3d<unsigned> histo = fill_histo(ima,div_factor); - { - unsigned m, M; - estim::min_max(histo, m, M); - std::cout << "histo : " << m << ' ' << M << std::endl; - } //revert histo image3d<unsigned> rhisto = arith::revert(histo); - { - unsigned m, M; - estim::min_max(rhisto, m, M); - std::cout << "rhisto : " << m << ' ' << M << std::endl; - } - //compute closing_area of histo + //compute closing_volume of histo image3d<unsigned> histo_closure(histo.domain()); - morpho::closing_area(rhisto, c6(), lambda, histo_closure); - { - unsigned m, M; - estim::min_max(histo_closure, m, M); - std::cout << "histo_closure : " << m << ' ' << M << std::endl; - } + morpho::closing_volume(rhisto, c6(), lambda, histo_closure); //watershed over histo_closure unsigned nbasins = 0; image3d<unsigned> ws = morpho::meyer_wst(histo_closure, c6(), nbasins); - std::cout << "nbassins : " << nbasins << std::endl; - // Classify image ! - //classify_image(const I& ima, const J& histo, const K& ws, int nbasins, int f) + //classify image classify_image(ima, histo, ws, nbasins, div_factor); }
16Â years, 2Â months
1
0
0
0
cleanup-2008 2688: Fix bugs in low level routines.
by Nicolas Ballas
https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena
Index: ChangeLog from Nicolas Ballas <ballas(a)lrde.epita.fr> Fix bugs in low level routines. * tests/level/fill_with_image.cc, * tests/level/transform.cc, * tests/level/paste.cc: Add tests. * mln/core/image/cast_image.hh: Update properties. * mln/level/transform.spe.hh, * mln/level/paste.spe.hh, * mln/level/fill_with_image.spe.hh: Update dispatch, fix bugs. * mln/level/transform.hh, * mln/level/paste.hh: Rename routines. mln/core/image/cast_image.hh | 12 +++ mln/level/fill_with_image.spe.hh | 111 +++++++++++++++++++++++-------- mln/level/paste.hh | 2 mln/level/paste.spe.hh | 117 ++++++++++++++++++++++++-------- mln/level/transform.hh | 2 mln/level/transform.spe.hh | 135 ++++++++++++++++++++++++++----------- tests/level/fill_with_image.cc | 139 +++++++++++++++++++++++++++++++++++++-- tests/level/paste.cc | 122 +++++++++++++++++++++++++++++++++- tests/level/transform.cc | 62 +++++++++++++++++ 9 files changed, 592 insertions(+), 110 deletions(-) Index: tests/level/fill_with_image.cc --- tests/level/fill_with_image.cc (revision 2687) +++ tests/level/fill_with_image.cc (working copy) @@ -32,17 +32,24 @@ #include <mln/level/fill_with_value.hh> #include <mln/level/fill_with_image.hh> +#include <mln/level/compare.hh> +#include <mln/core/image/image1d.hh> #include <mln/core/image/image2d.hh> +#include <mln/core/image/image3d.hh> +#include <mln/pw/image.hh> #include <mln/core/image/flat_image.hh> +#include <mln/core/image/cast_image.hh> +#include <mln/core/image/image_if.hh> #include <mln/core/image/sub_image.hh> +#include <mln/core/image/extension_val.hh> -#include <mln/core/image/image_if.hh> -#include <mln/level/compare.hh> +#include <mln/fun/p2b/chess.hh> +#include <mln/fun/p2v/iota.hh> #include <mln/debug/iota.hh> #include <mln/debug/println.hh> -#include <mln/fun/p2b/chess.hh> +#include <mln/trace/all.hh> int main() @@ -50,6 +57,7 @@ using namespace mln; const unsigned size = 100; + // 2d tests { image2d<unsigned int> ima(size, size); image2d<unsigned int> ima2(size, size); @@ -68,7 +76,7 @@ debug::iota(ima2); level::fill_with_image(ima, ima2); - assert(ima == (ima2 | b)); + mln_assertion(ima == (ima2 | b)); } { @@ -88,4 +96,127 @@ mln_assertion(ima_if(p) == 42); } + + // tests in three dimension + { + box3d b(point3d(1,2,1), point3d(2,4,3)); + image3d<int> ima(b, 2); + debug::iota(ima); + + box3d b2(point3d(-1,-2,-1), point3d(3,6,3)); + image3d<int> ima2(b2, 2); + debug::iota(ima2); + + image3d<int> ima3(b, 2); + + level::fill_with_image(ima, ima2); // Not so fast version... + mln_assertion(ima == (ima2 | b)); + + level::fill_with_image(ima3, ima); // Fast version... + mln_assertion(ima == ima3); + } + + // image 1d test + { + image1d<unsigned short> ima(size); + image1d<unsigned short> out(size); + + debug::iota(ima); + level::fill_with_image(out, ima); + + mln_assertion(ima == out); + } + + + // pw image test + { + const pw::image<fun::p2v::iota_t, box2d> ima(fun::p2v::iota, + make::box2d(-2,-2, 15,15)); + image2d<short unsigned int> out(8, 8); + + level::fill(out, 0); + level::fill_with_image(out, ima); + } + + // flat image test + { + flat_image<short, box2d> ima(5, make::box2d(size, size)); + image2d<unsigned short> out(size, size); + + level::fill_with_value(ima, 51); + level::fill_with_image(out, ima); + + mln_assertion(ima == out); + } + + // image if test + { + typedef image2d<unsigned short> I; + typedef image_if<I, fun::p2b::chess_t> II; + + I ima(size, size); + I out(size, size); + II ima_if = ima | fun::p2b::chess; + + level::fill_with_value(ima, 42); + level::fill_with_value(out, 0); + level::fill_with_image(ima_if, ima); + + mln_piter_(II) p(ima_if.domain()); + for_all(p) + mln_assertion(ima_if(p) == ima(p)); + } + + // cast image test + { + typedef image2d<unsigned short> I; + typedef cast_image_<int, I> II; + + I in(size, size); + II cast(in); + I out(size, size); + + level::fill(in, 51); + level::fill(out, 42); + + level::fill_with_image(out, cast); + + mln_assertion(cast == out); + } + + // sub_image test + { + typedef image2d<int> I; + typedef sub_image< image2d<int>, box2d > II; + + I ima(size, size); + I out(size, size); + II sub_ima(ima, make::box2d(4,4, 10,10)); + + + level::fill(ima, 51); + level::fill(out, 0); + level::fill_with_image(sub_ima, ima); + + II::piter p(sub_ima.domain()); + for_all(p) + mln_assertion(sub_ima(p) == ima(p)); + } + + // extended image test + { + typedef image2d<int> I; + typedef extension_val< image2d<int> > II; + typedef image2d<unsigned short> III; + + I ima(size, size); + II extend_ima(ima, 5); + III out(size, size); + + level::fill(ima, 51); + level::fill_with_image(out, extend_ima); + + mln_assertion(out == extend_ima); + } + } Index: tests/level/transform.cc --- tests/level/transform.cc (revision 2687) +++ tests/level/transform.cc (working copy) @@ -1,4 +1,4 @@ -// Copyright (C) 2007 EPITA Research and Development Laboratory +// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory // // This file is part of the Olena Library. This library is free // software; you can redistribute it and/or modify it under the terms @@ -37,7 +37,11 @@ #include <mln/core/image/image3d.hh> #include <mln/pw/image.hh> #include <mln/core/image/flat_image.hh> +#include <mln/core/image/cast_image.hh> #include <mln/core/image/image_if.hh> +#include <mln/core/image/sub_image.hh> +#include <mln/core/image/extension_val.hh> + #include <mln/level/fill.hh> #include <mln/level/transform.hh> @@ -140,6 +144,7 @@ mln_assertion((unsigned short)std::sqrt(ima(p)) == out(p)); } + // image if test { typedef image2d<unsigned short> I; typedef image_if<I, fun::p2b::chess_t> II; @@ -157,4 +162,59 @@ mln_assertion((unsigned short)std::sqrt(ima_if(p)) == out(p)); } + // cast image test + { + typedef image2d<unsigned short> I; + typedef cast_image_<int, I> II; + typedef image2d<unsigned short> III; + + I in(size, size); + II cast(in); + III out(size, size); + + level::fill(in, 51); + level::fill(out, 42); + + out = level::transform(cast, mysqrt()); + + II::piter p(cast.domain()); + for_all(p) + mln_assertion((unsigned short)std::sqrt(cast(p)) == out(p)); + } + + // sub_image test + { + typedef image2d<int> I; + typedef sub_image< image2d<int>, box2d > II; + typedef image2d<unsigned short> III; + + I ima(size, size); + II sub_ima(ima, make::box2d(4,4, 10,10)); + III out(size, size); + + level::fill(ima, 51); + out = level::transform(sub_ima, mysqrt()); + + II::piter p(sub_ima.domain()); + for_all(p) + mln_assertion((unsigned short)std::sqrt(sub_ima(p)) == out(p)); + } + + // extended image test + { + typedef image2d<int> I; + typedef extension_val< image2d<int> > II; + typedef image2d<unsigned short> III; + + I ima(size, size); + II extend_ima(ima, 5); + III out(size, size); + + level::fill(ima, 51); + out = level::transform(extend_ima, mysqrt()); + + II::piter p(extend_ima.domain()); + for_all(p) + mln_assertion((unsigned short)std::sqrt(extend_ima(p)) == out(p)); + } } Index: tests/level/paste.cc --- tests/level/paste.cc (revision 2687) +++ tests/level/paste.cc (working copy) @@ -30,21 +30,32 @@ * \brief Tests on mln::level::paste. */ +#include <mln/core/image/image1d.hh> #include <mln/core/image/image2d.hh> #include <mln/core/image/image3d.hh> +#include <mln/pw/image.hh> +#include <mln/core/image/flat_image.hh> +#include <mln/core/image/cast_image.hh> +#include <mln/core/image/image_if.hh> #include <mln/core/image/sub_image.hh> +#include <mln/core/image/extension_val.hh> #include <mln/level/fill.hh> #include <mln/level/paste.hh> #include <mln/level/compare.hh> +#include <mln/fun/p2b/chess.hh> +#include <mln/fun/p2v/iota.hh> + #include <mln/debug/iota.hh> #include <mln/debug/println.hh> +#include <mln/trace/all.hh> int main() { using namespace mln; + const unsigned size = 50; // tests in two dimension { @@ -59,10 +70,10 @@ image2d<int> ima3(b, 2); level::paste(ima, ima2); // Not so fast version... - assert(ima == (ima2 | b)); + mln_assertion(ima == (ima2 | b)); level::paste(ima, ima3); // Fast version... - assert(ima == ima3); + mln_assertion(ima == ima3); } // tests in three dimension @@ -78,9 +89,112 @@ image3d<int> ima3(b, 2); level::paste(ima, ima2); // Not so fast version... - assert(ima == (ima2 | b)); + mln_assertion(ima == (ima2 | b)); level::paste(ima, ima3); // Fast version... - assert(ima == ima3); + mln_assertion(ima == ima3); + } + + /// image 1d test + { + image1d<unsigned short> ima(size); + image1d<unsigned short> out(size); + + debug::iota(ima); + level::paste(ima, out); + + mln_assertion(ima == out); + } + + + /// pw image test + { + const pw::image<fun::p2v::iota_t, box2d> ima(fun::p2v::iota, + make::box2d(2,2, 5,5)); + image2d<short unsigned int> out(8, 8); + + level::fill(out, 0); + level::paste(ima, out); + } + + // flat image test + { + flat_image<short, box2d> ima(5, make::box2d(size, size)); + image2d<unsigned short> out(size, size); + + level::fill_with_value(ima, 51); + level::paste(ima, out); + + mln_assertion(ima == out); + } + + // image if test + { + typedef image2d<unsigned short> I; + typedef image_if<I, fun::p2b::chess_t> II; + + I ima(size, size); + I out(size, size); + II ima_if = ima | fun::p2b::chess; + + level::fill_with_value(ima, 0); + debug::iota(ima); + level::paste(ima_if, out); + + mln_assertion(ima_if == out); + } + + // cast image test + { + typedef image2d<unsigned short> I; + typedef cast_image_<int, I> II; + typedef image2d<unsigned short> III; + + I in(size, size); + II cast(in); + III out(size, size); + + level::fill(in, 51); + level::fill(out, 42); + + level::paste(cast, out); + + mln_assertion(cast == out); + } + + // sub_image test + { + typedef image2d<int> I; + typedef sub_image< image2d<int>, box2d > II; + typedef image2d<unsigned short> III; + + I ima(size, size); + II sub_ima(ima, make::box2d(4,4, 10,10)); + III out(size, size); + + level::fill(ima, 51); + level::paste(sub_ima, out); + + II::piter p(sub_ima.domain()); + for_all(p) + mln_assertion(sub_ima(p) == out(p)); + } + + // extended image test + { + typedef image2d<int> I; + typedef extension_val< image2d<int> > II; + typedef image2d<unsigned short> III; + + I ima(size, size); + II extend_ima(ima, 5); + III out(size, size); + + level::fill(ima, 51); + level::paste(extend_ima, out); + + II::piter p(extend_ima.domain()); + for_all(p) + mln_assertion(extend_ima(p) == out(p)); } } Index: mln/core/image/cast_image.hh --- mln/core/image/cast_image.hh (revision 2687) +++ mln/core/image/cast_image.hh (working copy) @@ -91,8 +91,20 @@ struct image_< cast_image_<T,I> > : cast_image_trait_selector<T, I, mln_trait_image_vw_io(I)> { + private: + typedef mlc_equal(mln_trait_value_quant(T), + trait::value::quant::high) is_high_quant_; + public: + typedef mlc_if(is_high_quant_, + trait::image::quant::high, + trait::image::quant::low) quant; + typedef trait::image::value_io::read_only value_io; typedef trait::image::pw_io::read pw_io; + typedef trait::image::value_access::indirect value_access; + + /// FIXME is the following property correct? + typedef trait::image::ext_domain::none ext_domain; }; } // end of namespace mln::trait Index: mln/level/transform.spe.hh --- mln/level/transform.spe.hh (revision 2687) +++ mln/level/transform.spe.hh (working copy) @@ -175,6 +175,7 @@ for_all(pi) { po.val() = f(pi.val()); + po.next(); } trace::exiting("level::impl::transform_fast"); @@ -204,8 +205,8 @@ po.start(); for_all(pi) { - //po.val() = lut(pi.val); - po.val() = f(pi.val()); + po.val() = lut(pi.val()); + po.next(); } trace::exiting("level::impl::transform_fast_lowq"); @@ -221,7 +222,7 @@ /// Deal with image not updated template <typename I, typename F, typename O> inline - void transform_dispatch(mln::trait::undef, + void transform_dispatch_(mln::trait::undef, mln::trait::image::quant::any, const Image<I>& input, const Function_v2v<F>& f, @@ -232,7 +233,7 @@ template <typename I, typename F, typename O> inline - void transform_dispatch(mln::trait::image::vw_set::any, + void transform_dispatch_(mln::trait::image::vw_set::any, mln::trait::image::quant::any, const Image<I>& input, const Function_v2v<F>& f, @@ -243,7 +244,7 @@ template <typename I, typename F, typename O> inline - void transform_dispatch(mln::trait::image::vw_set::uni, + void transform_dispatch_(mln::trait::image::vw_set::uni, mln::trait::image::quant::any, const Image<I>& input, const Function_v2v<F>& f, @@ -255,7 +256,7 @@ template <typename I, typename F, typename O> inline - void transform_dispatch(mln::trait::image::vw_set::none, + void transform_dispatch_(mln::trait::image::vw_set::none, mln::trait::image::quant::low, const Image<I>& input, const Function_v2v<F>& f, @@ -266,7 +267,34 @@ template <typename I, typename F, typename O> inline - void transform_dispatch_oneblock(mln::trait::image::quant::any, + void transform_dispatch_(mln::trait::image::quant::any, + mln::trait::image::value_access::direct, + mln::trait::image::value_access::direct, + mln::trait::image::ext_domain::some, + mln::trait::image::ext_domain::some, + const Image<I>& input_, + const Function_v2v<F>& f, + Image<O>& output_) + { + const I& input = exact(input_); + O& output = exact(output_); + + + if (input.domain() == output.domain()) + transform_fast(input, f, output); + else + transform_dispatch_(mln_trait_image_vw_set(I)(), + mln_trait_image_quant(I)(), + input, f, output); + } + + template <typename I, typename F, typename O> + inline + void transform_dispatch_(mln::trait::image::quant::any, + mln::trait::image::value_access::direct, + mln::trait::image::value_access::direct, + mln::trait::image::ext_domain::none, + mln::trait::image::ext_domain::none, const Image<I>& input, const Function_v2v<F>& f, Image<O>& output) @@ -276,7 +304,33 @@ template <typename I, typename F, typename O> inline - void transform_dispatch_oneblock(mln::trait::image::quant::low, + void transform_dispatch_(mln::trait::image::quant::low, + mln::trait::image::value_access::direct, + mln::trait::image::value_access::direct, + mln::trait::image::ext_domain::some, + mln::trait::image::ext_domain::some, + const Image<I>& input_, + const Function_v2v<F>& f, + Image<O>& output_) + { + const I& input = exact(input_); + O& output = exact(output_); + + if (input.domain() == output.domain()) + transform_fast_lowq(input, f, output); + else + transform_dispatch_(mln_trait_image_vw_set(I)(), + mln_trait_image_quant(I)(), + input, f, output); + } + + template <typename I, typename F, typename O> + inline + void transform_dispatch_(mln::trait::image::quant::low, + mln::trait::image::value_access::direct, + mln::trait::image::value_access::direct, + mln::trait::image::ext_domain::none, + mln::trait::image::ext_domain::none, const Image<I>& input, const Function_v2v<F>& f, Image<O>& output) @@ -287,20 +341,37 @@ template <typename I, typename F, typename O> inline - void transform_dispatch(mln::trait::image::value_storage::any, + void transform_dispatch_(mln::trait::image::quant::any, + mln::trait::image::value_access::any, + mln::trait::image::value_access::any, + mln::trait::image::ext_domain::any, + mln::trait::image::ext_domain::any, + const Image<I>& input, + const Function_v2v<F>& f, + Image<O>& output) + { + transform_dispatch_(mln_trait_image_vw_set(I)(), + mln_trait_image_quant(I)(), + input, f, output); + } + + + template <typename I, typename F, typename O> + inline + void transform_dispatch_(mln::trait::image::value_storage::any, mln::trait::image::value_storage::any, const Image<I>& input, const Function_v2v<F>& f, Image<O>& output) { - transform_dispatch(mln_trait_image_vw_set(I)(), + transform_dispatch_(mln_trait_image_vw_set(I)(), mln_trait_image_quant(I)(), input, f, output); } template <typename I, typename F, typename O> inline - void transform_dispatch(mln::trait::image::value_storage::singleton, + void transform_dispatch_(mln::trait::image::value_storage::singleton, mln::trait::image::value_storage::any, const Image<I>& input, const Function_v2v<F>& f, @@ -311,7 +382,7 @@ template <typename I, typename F, typename O> inline - void transform_dispatch(mln::trait::image::value_storage::one_block, + void transform_dispatch_(mln::trait::image::value_storage::one_block, mln::trait::image::value_storage::one_block, const Image<I>& input_, const Function_v2v<F>& f_, @@ -320,40 +391,22 @@ const I& input = exact(input_); O& output = exact(output_); + /// Check basic properties - if (mlc_is(mln_trait_image_value_access(O), - trait::image::value_access::direct)::value && - mlc_is(mln_trait_image_value_access(I), - trait::image::value_access::direct)::value && - mlc_is(mln_trait_image_value_alignement(I), + if (mlc_is(mln_trait_image_value_alignement(I), trait::image::value_alignement::with_grid)::value && mlc_is(mln_trait_image_value_alignement(O), trait::image::value_alignement::with_grid)::value) { - /// Check ext_domain - if ( - ((mlc_is(mln_trait_image_ext_domain(I), - trait::image::ext_domain::fixed)::value || - mlc_is(mln_trait_image_ext_domain(I), - trait::image::ext_domain::extendable)::value) && - (mlc_is(mln_trait_image_ext_domain(O), - trait::image::ext_domain::fixed)::value || - mlc_is(mln_trait_image_ext_domain(O), - trait::image::ext_domain::extendable)::value) && - input.border() == output.border()) || - (mlc_is(mln_trait_image_ext_domain(I), - trait::image::ext_domain::none)::value && - mlc_is(mln_trait_image_ext_domain(O), - trait::image::ext_domain::none)::value)) - { - - /// Check domain - if (input.domain() == output.domain()) - transform_dispatch_oneblock(mln_trait_image_quant(I)(), + transform_dispatch_(mln_trait_image_quant(I)(), + mln_trait_image_value_access(I)(), + mln_trait_image_value_access(O)(), + mln_trait_image_ext_domain(I)(), + mln_trait_image_ext_domain(O)(), input, f_, output); } - } - transform_dispatch(mln_trait_image_vw_set(I)(), + else + transform_dispatch_(mln_trait_image_vw_set(I)(), mln_trait_image_quant(I)(), input, f_, output); } @@ -362,11 +415,11 @@ template <typename I, typename F, typename O> inline - void transform_dispatch(const Image<I>& input, + void transform_dispatch_(const Image<I>& input, const Function_v2v<F>& f, Image<O>& output) { - transform_dispatch(mln_trait_image_value_storage(I)(), + transform_dispatch_(mln_trait_image_value_storage(I)(), mln_trait_image_value_storage(O)(), input, f, output); } Index: mln/level/paste.spe.hh --- mln/level/paste.spe.hh (revision 2687) +++ mln/level/paste.spe.hh (working copy) @@ -66,11 +66,9 @@ namespace generic { template <typename I, typename J> - void paste_(const Image<I>& input, Image<J>& output); + void paste(const Image<I>& input, Image<J>& output); } - - // template <typename I, typename J> // inline // void paste_lines_(const I& data, J& destination) @@ -111,10 +109,30 @@ for_all(pi) { po.val() = pi.val(); + po.next(); } trace::entering("level::impl::paste_fast"); } + + template <typename I, typename J> + void paste_fast_singleton(const Image<I>& input_, Image<J>& output_) + { + trace::entering("level::impl::paste_fast_singleton"); + + const I& input = exact(input_); + J& output = exact(output_); + + level::internal::paste_tests(input, output); + + mln_pixter(J) po(output); + + for_all(po) + po.val() = input.val(); + + trace::entering("level::impl::paste_fast_singleton"); + } + } // end of namespace impl. @@ -122,6 +140,48 @@ namespace internal { + template <typename I, typename J> + inline + void paste_(mln::trait::image::value_access::direct, + mln::trait::image::value_access::direct, + mln::trait::image::ext_domain::some, + mln::trait::image::ext_domain::some, + const Image<I>& input_, + Image<J>& output_) + { + const I& input = exact(input_); + J& output = exact(output_); + + if (input.domain() == output.domain()) + impl::paste_fast(input, output); + else + impl::generic::paste(input, output); + } + + template <typename I, typename J> + inline + void paste_(mln::trait::image::value_access::direct, + mln::trait::image::value_access::direct, + mln::trait::image::ext_domain::none, + mln::trait::image::ext_domain::none, + const Image<I>& input, + Image<J>& output) + { + impl::paste_fast(input, output); + } + + + template <typename I, typename J> + inline + void paste_(mln::trait::image::value_access::any, + mln::trait::image::value_access::any, + mln::trait::image::ext_domain::any, + mln::trait::image::ext_domain::any, + const Image<I>& input, + Image<J>& output) + { + impl::generic::paste(input, output); + } template <typename I, typename J> inline @@ -130,51 +190,45 @@ const Image<I>& input, Image<J>& output) { - impl::generic::paste_(input, output); + impl::generic::paste(input, output); } template <typename I, typename J> inline - void paste_(trait::image::value_storage::one_block, + void paste_(trait::image::value_storage::singleton, trait::image::value_storage::one_block, + const Image<I>& input, + Image<J>& output) + { + impl::paste_fast_singleton(input, output); + } + + + template <typename I, typename J> + inline + void paste_(mln::trait::image::value_storage::one_block, + mln::trait::image::value_storage::one_block, const Image<I>& input_, Image<J>& output_) { const I& input = exact(input_); J& output = exact(output_); + /// Check basic properties - if (mlc_is(mln_trait_image_value_access(J), - trait::image::value_access::direct)::value && - mlc_is(mln_trait_image_value_access(I), - trait::image::value_access::direct)::value && - mlc_is(mln_trait_image_value_alignement(I), + if (mlc_is(mln_trait_image_value_alignement(I), trait::image::value_alignement::with_grid)::value && mlc_is(mln_trait_image_value_alignement(J), trait::image::value_alignement::with_grid)::value) { - /// Check ext_domain - if ( - ((mlc_is(mln_trait_image_ext_domain(I), - trait::image::ext_domain::fixed)::value || - mlc_is(mln_trait_image_ext_domain(I), - trait::image::ext_domain::extendable)::value) && - (mlc_is(mln_trait_image_ext_domain(J), - trait::image::ext_domain::fixed)::value || - mlc_is(mln_trait_image_ext_domain(J), - trait::image::ext_domain::extendable)::value) && - input.border() == output.border()) || - (mlc_is(mln_trait_image_ext_domain(I), - trait::image::ext_domain::none)::value && - mlc_is(mln_trait_image_ext_domain(J), - trait::image::ext_domain::none)::value)) - { - /// Check domain - if (input.domain() == output.domain()) - impl::paste_fast(input, output); - } + paste_(mln_trait_image_value_access(I)(), + mln_trait_image_value_access(J)(), + mln_trait_image_ext_domain(I)(), + mln_trait_image_ext_domain(J)(), + input, output); } - impl::generic::paste_(input, output); + else + impl::generic::paste(input, output); } @@ -182,6 +236,7 @@ inline void paste_(const Image<I>& input, Image<J>& output) { + paste_(mln_trait_image_value_storage(I)(), mln_trait_image_value_storage(J)(), input, output); Index: mln/level/fill_with_image.spe.hh --- mln/level/fill_with_image.spe.hh (revision 2687) +++ mln/level/fill_with_image.spe.hh (working copy) @@ -86,9 +86,31 @@ for_all(pi) { pi.val() = d.val(); + d.next(); } trace::entering("level::impl::fill_with_image_fast"); } + + + template <typename I, typename J> + void fill_with_image_fast_singleton(Image<I>& ima_, + const Image<J>& data_) + { + trace::entering("level::impl::fill_with_image_fast_singleton"); + + I& ima = exact(ima_); + const J& data = exact(data_); + + level::internal::fill_with_image_tests(ima, data); + + mln_pixter(I) pi(ima); + + for_all(pi) + pi.val() = data.val(); + + trace::entering("level::impl::fill_with_image_fast_singleton"); + } + } // end of namespace mln::level::impl @@ -99,6 +121,49 @@ template <typename I, typename J> inline + void fill_with_image_(mln::trait::image::value_access::direct, + mln::trait::image::value_access::direct, + mln::trait::image::ext_domain::some, + mln::trait::image::ext_domain::some, + Image<I>& ima_, + const Image<J>& data_) + { + I& ima = exact(ima_); + const J& data = exact(data_); + + if (ima.domain() == data.domain()) + impl::fill_with_image_fast(ima, data); + else + impl::generic::fill_with_image(ima, data); + } + + template <typename I, typename J> + inline + void fill_with_image_(mln::trait::image::value_access::direct, + mln::trait::image::value_access::direct, + mln::trait::image::ext_domain::none, + mln::trait::image::ext_domain::none, + Image<I>& ima, + const Image<J>& data) + { + impl::fill_with_image_fast(ima, data); + } + + + template <typename I, typename J> + inline + void fill_with_image_(mln::trait::image::value_access::any, + mln::trait::image::value_access::any, + mln::trait::image::ext_domain::any, + mln::trait::image::ext_domain::any, + Image<I>& ima, + const Image<J>& data) + { + impl::generic::fill_with_image(ima, data); + } + + template <typename I, typename J> + inline void fill_with_image_(trait::image::value_storage::any, trait::image::value_storage::any, Image<I>& ima, @@ -110,49 +175,41 @@ template <typename I, typename J> inline void fill_with_image_(trait::image::value_storage::one_block, - trait::image::value_storage::one_block, + trait::image::value_storage::singleton, + Image<I>& ima, + const Image<J>& data) + { + impl::generic::fill_with_image(ima, data); + } + + template <typename I, typename J> + inline + void fill_with_image_(mln::trait::image::value_storage::one_block, + mln::trait::image::value_storage::one_block, Image<I>& ima_, const Image<J>& data_) { I& ima = exact(ima_); const J& data = exact(data_); + /// Check basic properties - if (mlc_is(mln_trait_image_value_access(J), - trait::image::value_access::direct)::value && - mlc_is(mln_trait_image_value_access(I), - trait::image::value_access::direct)::value && - mlc_is(mln_trait_image_value_alignement(I), + if (mlc_is(mln_trait_image_value_alignement(I), trait::image::value_alignement::with_grid)::value && mlc_is(mln_trait_image_value_alignement(J), trait::image::value_alignement::with_grid)::value) { - /// Check ext_domain - if ( - ((mlc_is(mln_trait_image_ext_domain(I), - trait::image::ext_domain::fixed)::value || - mlc_is(mln_trait_image_ext_domain(I), - trait::image::ext_domain::extendable)::value) && - (mlc_is(mln_trait_image_ext_domain(J), - trait::image::ext_domain::fixed)::value || - mlc_is(mln_trait_image_ext_domain(J), - trait::image::ext_domain::extendable)::value) && - data.border() == data.border()) || - (mlc_is(mln_trait_image_ext_domain(I), - trait::image::ext_domain::none)::value && - mlc_is(mln_trait_image_ext_domain(J), - trait::image::ext_domain::none)::value)) - { - /// Check domain - if (data.domain() == data.domain()) - impl::fill_with_image_fast(ima, data); - } + fill_with_image_(mln_trait_image_value_access(I)(), + mln_trait_image_value_access(J)(), + mln_trait_image_ext_domain(I)(), + mln_trait_image_ext_domain(J)(), + ima, data); } + else impl::generic::fill_with_image(ima, data); } - template <typename I, typename J> inline void fill_with_image_(Image<I>& ima, const Image<J>& data) Index: mln/level/transform.hh --- mln/level/transform.hh (revision 2687) +++ mln/level/transform.hh (working copy) @@ -159,7 +159,7 @@ trace::entering("level::transform"); mln_precondition(exact(output).domain() >= exact(input).domain()); - transform_dispatch(exact(input), exact(f), exact(output)); + transform_dispatch_(exact(input), exact(f), exact(output)); trace::exiting("level::transform"); } Index: mln/level/paste.hh --- mln/level/paste.hh (revision 2687) +++ mln/level/paste.hh (working copy) @@ -102,7 +102,7 @@ template <typename I, typename J> inline - void paste_(const Image<I>& input_, Image<J>& output_) + void paste(const Image<I>& input_, Image<J>& output_) { trace::entering("level::impl::generic::paste");
16Â years, 2Â months
1
0
0
0
2688: Fix bugs in low level routines.
by Guillaume Lazzara
* tests/level/fill_with_image.cc, * tests/level/transform.cc, * tests/level/paste.cc: Add tests. * mln/core/image/cast_image.hh: Update properties. * mln/level/transform.spe.hh, * mln/level/paste.spe.hh, * mln/level/fill_with_image.spe.hh: Update dispatch, fix bugs. * mln/level/transform.hh, * mln/level/paste.hh: Rename routines. --- milena/ChangeLog | 14 ++ milena/mln/core/image/cast_image.hh | 12 ++ milena/mln/level/fill_with_image.spe.hh | 113 ++++++++++++---- milena/mln/level/paste.hh | 2 +- milena/mln/level/paste.spe.hh | 117 ++++++++++++----- milena/mln/level/transform.hh | 2 +- milena/mln/level/transform.spe.hh | 225 +++++++++++++++++++------------ milena/tests/level/fill_with_image.cc | 139 ++++++++++++++++++- milena/tests/level/paste.cc | 122 ++++++++++++++++- milena/tests/level/transform.cc | 62 +++++++++- 10 files changed, 652 insertions(+), 156 deletions(-) diff --git a/milena/ChangeLog b/milena/ChangeLog index 35f360b..2c1de6a 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -1,3 +1,17 @@ +2008-10-27 Nicolas Ballas <ballas(a)lrde.epita.fr> + + Fix bugs in low level routines. + + * tests/level/fill_with_image.cc, + * tests/level/transform.cc, + * tests/level/paste.cc: Add tests. + * mln/core/image/cast_image.hh: Update properties. + * mln/level/transform.spe.hh, + * mln/level/paste.spe.hh, + * mln/level/fill_with_image.spe.hh: Update dispatch, fix bugs. + * mln/level/transform.hh, + * mln/level/paste.hh: Rename routines. + 2008-10-24 Roland Levillain <roland(a)lrde.epita.fr> Fix mln::level::stretch w.r.t. the initialization. diff --git a/milena/mln/core/image/cast_image.hh b/milena/mln/core/image/cast_image.hh index 6de5892..d5baa8d 100644 --- a/milena/mln/core/image/cast_image.hh +++ b/milena/mln/core/image/cast_image.hh @@ -91,8 +91,20 @@ namespace mln struct image_< cast_image_<T,I> > : cast_image_trait_selector<T, I, mln_trait_image_vw_io(I)> { + private: + typedef mlc_equal(mln_trait_value_quant(T), + trait::value::quant::high) is_high_quant_; + public: + typedef mlc_if(is_high_quant_, + trait::image::quant::high, + trait::image::quant::low) quant; + typedef trait::image::value_io::read_only value_io; typedef trait::image::pw_io::read pw_io; + typedef trait::image::value_access::indirect value_access; + + /// FIXME is the following property correct? + typedef trait::image::ext_domain::none ext_domain; }; } // end of namespace mln::trait diff --git a/milena/mln/level/fill_with_image.spe.hh b/milena/mln/level/fill_with_image.spe.hh index 846da96..6084e72 100644 --- a/milena/mln/level/fill_with_image.spe.hh +++ b/milena/mln/level/fill_with_image.spe.hh @@ -86,9 +86,31 @@ namespace mln for_all(pi) { pi.val() = d.val(); + d.next(); } trace::entering("level::impl::fill_with_image_fast"); } + + + template <typename I, typename J> + void fill_with_image_fast_singleton(Image<I>& ima_, + const Image<J>& data_) + { + trace::entering("level::impl::fill_with_image_fast_singleton"); + + I& ima = exact(ima_); + const J& data = exact(data_); + + level::internal::fill_with_image_tests(ima, data); + + mln_pixter(I) pi(ima); + + for_all(pi) + pi.val() = data.val(); + + trace::entering("level::impl::fill_with_image_fast_singleton"); + } + } // end of namespace mln::level::impl @@ -99,6 +121,49 @@ namespace mln template <typename I, typename J> inline + void fill_with_image_(mln::trait::image::value_access::direct, + mln::trait::image::value_access::direct, + mln::trait::image::ext_domain::some, + mln::trait::image::ext_domain::some, + Image<I>& ima_, + const Image<J>& data_) + { + I& ima = exact(ima_); + const J& data = exact(data_); + + if (ima.domain() == data.domain()) + impl::fill_with_image_fast(ima, data); + else + impl::generic::fill_with_image(ima, data); + } + + template <typename I, typename J> + inline + void fill_with_image_(mln::trait::image::value_access::direct, + mln::trait::image::value_access::direct, + mln::trait::image::ext_domain::none, + mln::trait::image::ext_domain::none, + Image<I>& ima, + const Image<J>& data) + { + impl::fill_with_image_fast(ima, data); + } + + + template <typename I, typename J> + inline + void fill_with_image_(mln::trait::image::value_access::any, + mln::trait::image::value_access::any, + mln::trait::image::ext_domain::any, + mln::trait::image::ext_domain::any, + Image<I>& ima, + const Image<J>& data) + { + impl::generic::fill_with_image(ima, data); + } + + template <typename I, typename J> + inline void fill_with_image_(trait::image::value_storage::any, trait::image::value_storage::any, Image<I>& ima, @@ -110,49 +175,41 @@ namespace mln template <typename I, typename J> inline void fill_with_image_(trait::image::value_storage::one_block, - trait::image::value_storage::one_block, + trait::image::value_storage::singleton, + Image<I>& ima, + const Image<J>& data) + { + impl::generic::fill_with_image(ima, data); + } + + template <typename I, typename J> + inline + void fill_with_image_(mln::trait::image::value_storage::one_block, + mln::trait::image::value_storage::one_block, Image<I>& ima_, const Image<J>& data_) { I& ima = exact(ima_); const J& data = exact(data_); + /// Check basic properties - if (mlc_is(mln_trait_image_value_access(J), - trait::image::value_access::direct)::value && - mlc_is(mln_trait_image_value_access(I), - trait::image::value_access::direct)::value && - mlc_is(mln_trait_image_value_alignement(I), + if (mlc_is(mln_trait_image_value_alignement(I), trait::image::value_alignement::with_grid)::value && mlc_is(mln_trait_image_value_alignement(J), trait::image::value_alignement::with_grid)::value) { - /// Check ext_domain - if ( - ((mlc_is(mln_trait_image_ext_domain(I), - trait::image::ext_domain::fixed)::value || - mlc_is(mln_trait_image_ext_domain(I), - trait::image::ext_domain::extendable)::value) && - (mlc_is(mln_trait_image_ext_domain(J), - trait::image::ext_domain::fixed)::value || - mlc_is(mln_trait_image_ext_domain(J), - trait::image::ext_domain::extendable)::value) && - data.border() == data.border()) || - (mlc_is(mln_trait_image_ext_domain(I), - trait::image::ext_domain::none)::value && - mlc_is(mln_trait_image_ext_domain(J), - trait::image::ext_domain::none)::value)) - { - /// Check domain - if (data.domain() == data.domain()) - impl::fill_with_image_fast(ima, data); - } + fill_with_image_(mln_trait_image_value_access(I)(), + mln_trait_image_value_access(J)(), + mln_trait_image_ext_domain(I)(), + mln_trait_image_ext_domain(J)(), + ima, data); } - impl::generic::fill_with_image(ima, data); + else + impl::generic::fill_with_image(ima, data); } - template <typename I, typename J> inline void fill_with_image_(Image<I>& ima, const Image<J>& data) diff --git a/milena/mln/level/paste.hh b/milena/mln/level/paste.hh index c3b8fcc..6bbac4a 100644 --- a/milena/mln/level/paste.hh +++ b/milena/mln/level/paste.hh @@ -102,7 +102,7 @@ namespace mln template <typename I, typename J> inline - void paste_(const Image<I>& input_, Image<J>& output_) + void paste(const Image<I>& input_, Image<J>& output_) { trace::entering("level::impl::generic::paste"); diff --git a/milena/mln/level/paste.spe.hh b/milena/mln/level/paste.spe.hh index 028ced8..e7c7390 100644 --- a/milena/mln/level/paste.spe.hh +++ b/milena/mln/level/paste.spe.hh @@ -66,11 +66,9 @@ namespace mln namespace generic { template <typename I, typename J> - void paste_(const Image<I>& input, Image<J>& output); + void paste(const Image<I>& input, Image<J>& output); } - - // template <typename I, typename J> // inline // void paste_lines_(const I& data, J& destination) @@ -111,10 +109,30 @@ namespace mln for_all(pi) { po.val() = pi.val(); + po.next(); } trace::entering("level::impl::paste_fast"); } + + template <typename I, typename J> + void paste_fast_singleton(const Image<I>& input_, Image<J>& output_) + { + trace::entering("level::impl::paste_fast_singleton"); + + const I& input = exact(input_); + J& output = exact(output_); + + level::internal::paste_tests(input, output); + + mln_pixter(J) po(output); + + for_all(po) + po.val() = input.val(); + + trace::entering("level::impl::paste_fast_singleton"); + } + } // end of namespace impl. @@ -122,6 +140,48 @@ namespace mln namespace internal { + template <typename I, typename J> + inline + void paste_(mln::trait::image::value_access::direct, + mln::trait::image::value_access::direct, + mln::trait::image::ext_domain::some, + mln::trait::image::ext_domain::some, + const Image<I>& input_, + Image<J>& output_) + { + const I& input = exact(input_); + J& output = exact(output_); + + if (input.domain() == output.domain()) + impl::paste_fast(input, output); + else + impl::generic::paste(input, output); + } + + template <typename I, typename J> + inline + void paste_(mln::trait::image::value_access::direct, + mln::trait::image::value_access::direct, + mln::trait::image::ext_domain::none, + mln::trait::image::ext_domain::none, + const Image<I>& input, + Image<J>& output) + { + impl::paste_fast(input, output); + } + + + template <typename I, typename J> + inline + void paste_(mln::trait::image::value_access::any, + mln::trait::image::value_access::any, + mln::trait::image::ext_domain::any, + mln::trait::image::ext_domain::any, + const Image<I>& input, + Image<J>& output) + { + impl::generic::paste(input, output); + } template <typename I, typename J> inline @@ -130,51 +190,45 @@ namespace mln const Image<I>& input, Image<J>& output) { - impl::generic::paste_(input, output); + impl::generic::paste(input, output); } template <typename I, typename J> inline - void paste_(trait::image::value_storage::one_block, + void paste_(trait::image::value_storage::singleton, trait::image::value_storage::one_block, + const Image<I>& input, + Image<J>& output) + { + impl::paste_fast_singleton(input, output); + } + + + template <typename I, typename J> + inline + void paste_(mln::trait::image::value_storage::one_block, + mln::trait::image::value_storage::one_block, const Image<I>& input_, Image<J>& output_) { const I& input = exact(input_); J& output = exact(output_); + /// Check basic properties - if (mlc_is(mln_trait_image_value_access(J), - trait::image::value_access::direct)::value && - mlc_is(mln_trait_image_value_access(I), - trait::image::value_access::direct)::value && - mlc_is(mln_trait_image_value_alignement(I), + if (mlc_is(mln_trait_image_value_alignement(I), trait::image::value_alignement::with_grid)::value && mlc_is(mln_trait_image_value_alignement(J), trait::image::value_alignement::with_grid)::value) { - /// Check ext_domain - if ( - ((mlc_is(mln_trait_image_ext_domain(I), - trait::image::ext_domain::fixed)::value || - mlc_is(mln_trait_image_ext_domain(I), - trait::image::ext_domain::extendable)::value) && - (mlc_is(mln_trait_image_ext_domain(J), - trait::image::ext_domain::fixed)::value || - mlc_is(mln_trait_image_ext_domain(J), - trait::image::ext_domain::extendable)::value) && - input.border() == output.border()) || - (mlc_is(mln_trait_image_ext_domain(I), - trait::image::ext_domain::none)::value && - mlc_is(mln_trait_image_ext_domain(J), - trait::image::ext_domain::none)::value)) - { - /// Check domain - if (input.domain() == output.domain()) - impl::paste_fast(input, output); - } + paste_(mln_trait_image_value_access(I)(), + mln_trait_image_value_access(J)(), + mln_trait_image_ext_domain(I)(), + mln_trait_image_ext_domain(J)(), + input, output); } - impl::generic::paste_(input, output); + else + impl::generic::paste(input, output); } @@ -182,6 +236,7 @@ namespace mln inline void paste_(const Image<I>& input, Image<J>& output) { + paste_(mln_trait_image_value_storage(I)(), mln_trait_image_value_storage(J)(), input, output); diff --git a/milena/mln/level/transform.hh b/milena/mln/level/transform.hh index adece40..255751e 100644 --- a/milena/mln/level/transform.hh +++ b/milena/mln/level/transform.hh @@ -159,7 +159,7 @@ namespace mln trace::entering("level::transform"); mln_precondition(exact(output).domain() >= exact(input).domain()); - transform_dispatch(exact(input), exact(f), exact(output)); + transform_dispatch_(exact(input), exact(f), exact(output)); trace::exiting("level::transform"); } diff --git a/milena/mln/level/transform.spe.hh b/milena/mln/level/transform.spe.hh index 0f044d2..e498997 100644 --- a/milena/mln/level/transform.spe.hh +++ b/milena/mln/level/transform.spe.hh @@ -175,6 +175,7 @@ namespace mln for_all(pi) { po.val() = f(pi.val()); + po.next(); } trace::exiting("level::impl::transform_fast"); @@ -195,8 +196,8 @@ namespace mln level::internal::transform_tests(input, f, output); - value::lut_vec<mln_vset(I), mln_result(F)> - lut(input.values_eligible(), f); + value::lut_vec<mln_vset(I), mln_result(F)> + lut(input.values_eligible(), f); mln_pixter(const I) pi(input); mln_pixter(O) po(output); @@ -204,8 +205,8 @@ namespace mln po.start(); for_all(pi) { - //po.val() = lut(pi.val); - po.val() = f(pi.val()); + po.val() = lut(pi.val()); + po.next(); } trace::exiting("level::impl::transform_fast_lowq"); @@ -221,33 +222,33 @@ namespace mln /// Deal with image not updated template <typename I, typename F, typename O> inline - void transform_dispatch(mln::trait::undef, - mln::trait::image::quant::any, - const Image<I>& input, - const Function_v2v<F>& f, - Image<O>& output) + void transform_dispatch_(mln::trait::undef, + mln::trait::image::quant::any, + const Image<I>& input, + const Function_v2v<F>& f, + Image<O>& output) { impl::generic::transform(input, f, output); } template <typename I, typename F, typename O> inline - void transform_dispatch(mln::trait::image::vw_set::any, - mln::trait::image::quant::any, - const Image<I>& input, - const Function_v2v<F>& f, - Image<O>& output) + void transform_dispatch_(mln::trait::image::vw_set::any, + mln::trait::image::quant::any, + const Image<I>& input, + const Function_v2v<F>& f, + Image<O>& output) { impl::generic::transform(input, f, output); } template <typename I, typename F, typename O> inline - void transform_dispatch(mln::trait::image::vw_set::uni, - mln::trait::image::quant::any, - const Image<I>& input, - const Function_v2v<F>& f, - Image<O>& output) + void transform_dispatch_(mln::trait::image::vw_set::uni, + mln::trait::image::quant::any, + const Image<I>& input, + const Function_v2v<F>& f, + Image<O>& output) { impl::transform_taken(input, f, output); } @@ -255,31 +256,84 @@ namespace mln template <typename I, typename F, typename O> inline - void transform_dispatch(mln::trait::image::vw_set::none, - mln::trait::image::quant::low, - const Image<I>& input, - const Function_v2v<F>& f, - Image<O>& output) + void transform_dispatch_(mln::trait::image::vw_set::none, + mln::trait::image::quant::low, + const Image<I>& input, + const Function_v2v<F>& f, + Image<O>& output) { impl::transform_lowq(input, f, output); } template <typename I, typename F, typename O> inline - void transform_dispatch_oneblock(mln::trait::image::quant::any, - const Image<I>& input, - const Function_v2v<F>& f, - Image<O>& output) + void transform_dispatch_(mln::trait::image::quant::any, + mln::trait::image::value_access::direct, + mln::trait::image::value_access::direct, + mln::trait::image::ext_domain::some, + mln::trait::image::ext_domain::some, + const Image<I>& input_, + const Function_v2v<F>& f, + Image<O>& output_) + { + const I& input = exact(input_); + O& output = exact(output_); + + + if (input.domain() == output.domain()) + transform_fast(input, f, output); + else + transform_dispatch_(mln_trait_image_vw_set(I)(), + mln_trait_image_quant(I)(), + input, f, output); + } + + template <typename I, typename F, typename O> + inline + void transform_dispatch_(mln::trait::image::quant::any, + mln::trait::image::value_access::direct, + mln::trait::image::value_access::direct, + mln::trait::image::ext_domain::none, + mln::trait::image::ext_domain::none, + const Image<I>& input, + const Function_v2v<F>& f, + Image<O>& output) { transform_fast(input, f, output); } template <typename I, typename F, typename O> inline - void transform_dispatch_oneblock(mln::trait::image::quant::low, - const Image<I>& input, - const Function_v2v<F>& f, - Image<O>& output) + void transform_dispatch_(mln::trait::image::quant::low, + mln::trait::image::value_access::direct, + mln::trait::image::value_access::direct, + mln::trait::image::ext_domain::some, + mln::trait::image::ext_domain::some, + const Image<I>& input_, + const Function_v2v<F>& f, + Image<O>& output_) + { + const I& input = exact(input_); + O& output = exact(output_); + + if (input.domain() == output.domain()) + transform_fast_lowq(input, f, output); + else + transform_dispatch_(mln_trait_image_vw_set(I)(), + mln_trait_image_quant(I)(), + input, f, output); + } + + template <typename I, typename F, typename O> + inline + void transform_dispatch_(mln::trait::image::quant::low, + mln::trait::image::value_access::direct, + mln::trait::image::value_access::direct, + mln::trait::image::ext_domain::none, + mln::trait::image::ext_domain::none, + const Image<I>& input, + const Function_v2v<F>& f, + Image<O>& output) { transform_fast_lowq(input, f, output); } @@ -287,88 +341,87 @@ namespace mln template <typename I, typename F, typename O> inline - void transform_dispatch(mln::trait::image::value_storage::any, - mln::trait::image::value_storage::any, - const Image<I>& input, - const Function_v2v<F>& f, - Image<O>& output) + void transform_dispatch_(mln::trait::image::quant::any, + mln::trait::image::value_access::any, + mln::trait::image::value_access::any, + mln::trait::image::ext_domain::any, + mln::trait::image::ext_domain::any, + const Image<I>& input, + const Function_v2v<F>& f, + Image<O>& output) { - transform_dispatch(mln_trait_image_vw_set(I)(), - mln_trait_image_quant(I)(), - input, f, output); + transform_dispatch_(mln_trait_image_vw_set(I)(), + mln_trait_image_quant(I)(), + input, f, output); } + template <typename I, typename F, typename O> inline - void transform_dispatch(mln::trait::image::value_storage::singleton, - mln::trait::image::value_storage::any, - const Image<I>& input, - const Function_v2v<F>& f, - Image<O>& output) + void transform_dispatch_(mln::trait::image::value_storage::any, + mln::trait::image::value_storage::any, + const Image<I>& input, + const Function_v2v<F>& f, + Image<O>& output) + { + transform_dispatch_(mln_trait_image_vw_set(I)(), + mln_trait_image_quant(I)(), + input, f, output); + } + + template <typename I, typename F, typename O> + inline + void transform_dispatch_(mln::trait::image::value_storage::singleton, + mln::trait::image::value_storage::any, + const Image<I>& input, + const Function_v2v<F>& f, + Image<O>& output) { transform_singleton(input, f, output); } template <typename I, typename F, typename O> inline - void transform_dispatch(mln::trait::image::value_storage::one_block, - mln::trait::image::value_storage::one_block, - const Image<I>& input_, - const Function_v2v<F>& f_, - Image<O>& output_) + void transform_dispatch_(mln::trait::image::value_storage::one_block, + mln::trait::image::value_storage::one_block, + const Image<I>& input_, + const Function_v2v<F>& f_, + Image<O>& output_) { const I& input = exact(input_); O& output = exact(output_); + /// Check basic properties - if (mlc_is(mln_trait_image_value_access(O), - trait::image::value_access::direct)::value && - mlc_is(mln_trait_image_value_access(I), - trait::image::value_access::direct)::value && - mlc_is(mln_trait_image_value_alignement(I), + if (mlc_is(mln_trait_image_value_alignement(I), trait::image::value_alignement::with_grid)::value && mlc_is(mln_trait_image_value_alignement(O), trait::image::value_alignement::with_grid)::value) { - /// Check ext_domain - if ( - ((mlc_is(mln_trait_image_ext_domain(I), - trait::image::ext_domain::fixed)::value || - mlc_is(mln_trait_image_ext_domain(I), - trait::image::ext_domain::extendable)::value) && - (mlc_is(mln_trait_image_ext_domain(O), - trait::image::ext_domain::fixed)::value || - mlc_is(mln_trait_image_ext_domain(O), - trait::image::ext_domain::extendable)::value) && - input.border() == output.border()) || - (mlc_is(mln_trait_image_ext_domain(I), - trait::image::ext_domain::none)::value && - mlc_is(mln_trait_image_ext_domain(O), - trait::image::ext_domain::none)::value)) - { - - /// Check domain - if (input.domain() == output.domain()) - transform_dispatch_oneblock(mln_trait_image_quant(I)(), - input, f_, output); - } + transform_dispatch_(mln_trait_image_quant(I)(), + mln_trait_image_value_access(I)(), + mln_trait_image_value_access(O)(), + mln_trait_image_ext_domain(I)(), + mln_trait_image_ext_domain(O)(), + input, f_, output); } - transform_dispatch(mln_trait_image_vw_set(I)(), - mln_trait_image_quant(I)(), - input, f_, output); + else + transform_dispatch_(mln_trait_image_vw_set(I)(), + mln_trait_image_quant(I)(), + input, f_, output); } template <typename I, typename F, typename O> inline - void transform_dispatch(const Image<I>& input, - const Function_v2v<F>& f, - Image<O>& output) + void transform_dispatch_(const Image<I>& input, + const Function_v2v<F>& f, + Image<O>& output) { - transform_dispatch(mln_trait_image_value_storage(I)(), - mln_trait_image_value_storage(O)(), - input, f, output); + transform_dispatch_(mln_trait_image_value_storage(I)(), + mln_trait_image_value_storage(O)(), + input, f, output); } } diff --git a/milena/tests/level/fill_with_image.cc b/milena/tests/level/fill_with_image.cc index a9bd8cf..303dad8 100644 --- a/milena/tests/level/fill_with_image.cc +++ b/milena/tests/level/fill_with_image.cc @@ -32,17 +32,24 @@ #include <mln/level/fill_with_value.hh> #include <mln/level/fill_with_image.hh> +#include <mln/level/compare.hh> +#include <mln/core/image/image1d.hh> #include <mln/core/image/image2d.hh> +#include <mln/core/image/image3d.hh> +#include <mln/pw/image.hh> #include <mln/core/image/flat_image.hh> +#include <mln/core/image/cast_image.hh> +#include <mln/core/image/image_if.hh> #include <mln/core/image/sub_image.hh> +#include <mln/core/image/extension_val.hh> -#include <mln/core/image/image_if.hh> -#include <mln/level/compare.hh> +#include <mln/fun/p2b/chess.hh> +#include <mln/fun/p2v/iota.hh> #include <mln/debug/iota.hh> #include <mln/debug/println.hh> -#include <mln/fun/p2b/chess.hh> +#include <mln/trace/all.hh> int main() @@ -50,6 +57,7 @@ int main() using namespace mln; const unsigned size = 100; + // 2d tests { image2d<unsigned int> ima(size, size); image2d<unsigned int> ima2(size, size); @@ -68,7 +76,7 @@ int main() debug::iota(ima2); level::fill_with_image(ima, ima2); - assert(ima == (ima2 | b)); + mln_assertion(ima == (ima2 | b)); } { @@ -88,4 +96,127 @@ int main() mln_assertion(ima_if(p) == 42); } + + // tests in three dimension + { + box3d b(point3d(1,2,1), point3d(2,4,3)); + image3d<int> ima(b, 2); + debug::iota(ima); + + box3d b2(point3d(-1,-2,-1), point3d(3,6,3)); + image3d<int> ima2(b2, 2); + debug::iota(ima2); + + image3d<int> ima3(b, 2); + + level::fill_with_image(ima, ima2); // Not so fast version... + mln_assertion(ima == (ima2 | b)); + + level::fill_with_image(ima3, ima); // Fast version... + mln_assertion(ima == ima3); + } + + // image 1d test + { + image1d<unsigned short> ima(size); + image1d<unsigned short> out(size); + + debug::iota(ima); + level::fill_with_image(out, ima); + + mln_assertion(ima == out); + } + + + // pw image test + { + const pw::image<fun::p2v::iota_t, box2d> ima(fun::p2v::iota, + make::box2d(-2,-2, 15,15)); + image2d<short unsigned int> out(8, 8); + + level::fill(out, 0); + level::fill_with_image(out, ima); + } + + // flat image test + { + flat_image<short, box2d> ima(5, make::box2d(size, size)); + image2d<unsigned short> out(size, size); + + level::fill_with_value(ima, 51); + level::fill_with_image(out, ima); + + mln_assertion(ima == out); + } + + // image if test + { + typedef image2d<unsigned short> I; + typedef image_if<I, fun::p2b::chess_t> II; + + I ima(size, size); + I out(size, size); + II ima_if = ima | fun::p2b::chess; + + level::fill_with_value(ima, 42); + level::fill_with_value(out, 0); + level::fill_with_image(ima_if, ima); + + mln_piter_(II) p(ima_if.domain()); + for_all(p) + mln_assertion(ima_if(p) == ima(p)); + } + + // cast image test + { + typedef image2d<unsigned short> I; + typedef cast_image_<int, I> II; + + I in(size, size); + II cast(in); + I out(size, size); + + level::fill(in, 51); + level::fill(out, 42); + + level::fill_with_image(out, cast); + + mln_assertion(cast == out); + } + + // sub_image test + { + typedef image2d<int> I; + typedef sub_image< image2d<int>, box2d > II; + + I ima(size, size); + I out(size, size); + II sub_ima(ima, make::box2d(4,4, 10,10)); + + + level::fill(ima, 51); + level::fill(out, 0); + level::fill_with_image(sub_ima, ima); + + II::piter p(sub_ima.domain()); + for_all(p) + mln_assertion(sub_ima(p) == ima(p)); + } + + // extended image test + { + typedef image2d<int> I; + typedef extension_val< image2d<int> > II; + typedef image2d<unsigned short> III; + + I ima(size, size); + II extend_ima(ima, 5); + III out(size, size); + + level::fill(ima, 51); + level::fill_with_image(out, extend_ima); + + mln_assertion(out == extend_ima); + } + } diff --git a/milena/tests/level/paste.cc b/milena/tests/level/paste.cc index cd97898..e748602 100644 --- a/milena/tests/level/paste.cc +++ b/milena/tests/level/paste.cc @@ -30,21 +30,32 @@ * \brief Tests on mln::level::paste. */ +#include <mln/core/image/image1d.hh> #include <mln/core/image/image2d.hh> #include <mln/core/image/image3d.hh> +#include <mln/pw/image.hh> +#include <mln/core/image/flat_image.hh> +#include <mln/core/image/cast_image.hh> +#include <mln/core/image/image_if.hh> #include <mln/core/image/sub_image.hh> +#include <mln/core/image/extension_val.hh> #include <mln/level/fill.hh> #include <mln/level/paste.hh> #include <mln/level/compare.hh> +#include <mln/fun/p2b/chess.hh> +#include <mln/fun/p2v/iota.hh> + #include <mln/debug/iota.hh> #include <mln/debug/println.hh> +#include <mln/trace/all.hh> int main() { using namespace mln; + const unsigned size = 50; // tests in two dimension { @@ -59,10 +70,10 @@ int main() image2d<int> ima3(b, 2); level::paste(ima, ima2); // Not so fast version... - assert(ima == (ima2 | b)); + mln_assertion(ima == (ima2 | b)); level::paste(ima, ima3); // Fast version... - assert(ima == ima3); + mln_assertion(ima == ima3); } // tests in three dimension @@ -78,9 +89,112 @@ int main() image3d<int> ima3(b, 2); level::paste(ima, ima2); // Not so fast version... - assert(ima == (ima2 | b)); + mln_assertion(ima == (ima2 | b)); level::paste(ima, ima3); // Fast version... - assert(ima == ima3); + mln_assertion(ima == ima3); + } + + /// image 1d test + { + image1d<unsigned short> ima(size); + image1d<unsigned short> out(size); + + debug::iota(ima); + level::paste(ima, out); + + mln_assertion(ima == out); + } + + + /// pw image test + { + const pw::image<fun::p2v::iota_t, box2d> ima(fun::p2v::iota, + make::box2d(2,2, 5,5)); + image2d<short unsigned int> out(8, 8); + + level::fill(out, 0); + level::paste(ima, out); + } + + // flat image test + { + flat_image<short, box2d> ima(5, make::box2d(size, size)); + image2d<unsigned short> out(size, size); + + level::fill_with_value(ima, 51); + level::paste(ima, out); + + mln_assertion(ima == out); + } + + // image if test + { + typedef image2d<unsigned short> I; + typedef image_if<I, fun::p2b::chess_t> II; + + I ima(size, size); + I out(size, size); + II ima_if = ima | fun::p2b::chess; + + level::fill_with_value(ima, 0); + debug::iota(ima); + level::paste(ima_if, out); + + mln_assertion(ima_if == out); + } + + // cast image test + { + typedef image2d<unsigned short> I; + typedef cast_image_<int, I> II; + typedef image2d<unsigned short> III; + + I in(size, size); + II cast(in); + III out(size, size); + + level::fill(in, 51); + level::fill(out, 42); + + level::paste(cast, out); + + mln_assertion(cast == out); + } + + // sub_image test + { + typedef image2d<int> I; + typedef sub_image< image2d<int>, box2d > II; + typedef image2d<unsigned short> III; + + I ima(size, size); + II sub_ima(ima, make::box2d(4,4, 10,10)); + III out(size, size); + + level::fill(ima, 51); + level::paste(sub_ima, out); + + II::piter p(sub_ima.domain()); + for_all(p) + mln_assertion(sub_ima(p) == out(p)); + } + + // extended image test + { + typedef image2d<int> I; + typedef extension_val< image2d<int> > II; + typedef image2d<unsigned short> III; + + I ima(size, size); + II extend_ima(ima, 5); + III out(size, size); + + level::fill(ima, 51); + level::paste(extend_ima, out); + + II::piter p(extend_ima.domain()); + for_all(p) + mln_assertion(extend_ima(p) == out(p)); } } diff --git a/milena/tests/level/transform.cc b/milena/tests/level/transform.cc index f177446..e0b8ec9 100644 --- a/milena/tests/level/transform.cc +++ b/milena/tests/level/transform.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2007 EPITA Research and Development Laboratory +// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory // // This file is part of the Olena Library. This library is free // software; you can redistribute it and/or modify it under the terms @@ -37,7 +37,11 @@ #include <mln/core/image/image3d.hh> #include <mln/pw/image.hh> #include <mln/core/image/flat_image.hh> +#include <mln/core/image/cast_image.hh> #include <mln/core/image/image_if.hh> +#include <mln/core/image/sub_image.hh> +#include <mln/core/image/extension_val.hh> + #include <mln/level/fill.hh> #include <mln/level/transform.hh> @@ -140,6 +144,7 @@ int main() mln_assertion((unsigned short)std::sqrt(ima(p)) == out(p)); } + // image if test { typedef image2d<unsigned short> I; typedef image_if<I, fun::p2b::chess_t> II; @@ -157,4 +162,59 @@ int main() mln_assertion((unsigned short)std::sqrt(ima_if(p)) == out(p)); } + // cast image test + { + typedef image2d<unsigned short> I; + typedef cast_image_<int, I> II; + typedef image2d<unsigned short> III; + + I in(size, size); + II cast(in); + III out(size, size); + + level::fill(in, 51); + level::fill(out, 42); + + out = level::transform(cast, mysqrt()); + + II::piter p(cast.domain()); + for_all(p) + mln_assertion((unsigned short)std::sqrt(cast(p)) == out(p)); + } + + // sub_image test + { + typedef image2d<int> I; + typedef sub_image< image2d<int>, box2d > II; + typedef image2d<unsigned short> III; + + I ima(size, size); + II sub_ima(ima, make::box2d(4,4, 10,10)); + III out(size, size); + + level::fill(ima, 51); + out = level::transform(sub_ima, mysqrt()); + + II::piter p(sub_ima.domain()); + for_all(p) + mln_assertion((unsigned short)std::sqrt(sub_ima(p)) == out(p)); + } + + // extended image test + { + typedef image2d<int> I; + typedef extension_val< image2d<int> > II; + typedef image2d<unsigned short> III; + + I ima(size, size); + II extend_ima(ima, 5); + III out(size, size); + + level::fill(ima, 51); + out = level::transform(extend_ima, mysqrt()); + + II::piter p(extend_ima.domain()); + for_all(p) + mln_assertion((unsigned short)std::sqrt(extend_ima(p)) == out(p)); + } } -- 1.5.6.5
16Â years, 2Â months
1
0
0
0
2687: INIM: classif: Fix iccvg04.
by Guillaume Lazzara
* classif/iccvg04.cc: Cleanup. Fix wrong initialization. --- milena/sandbox/ChangeLog | 6 ++++ milena/sandbox/classif/iccvg04.cc | 54 +++++++++++++++--------------------- 2 files changed, 29 insertions(+), 31 deletions(-) diff --git a/milena/sandbox/ChangeLog b/milena/sandbox/ChangeLog index 074d329..686d969 100644 --- a/milena/sandbox/ChangeLog +++ b/milena/sandbox/ChangeLog @@ -1,3 +1,9 @@ +2008-10-25 Ugo Jardonnet <jardonnet(a)lrde.epita.fr> + + INIM: classif: Fix iccvg04. + + * classif/iccvg04.cc: Cleanup. Fix wrong initialization. + 2008-10-24 Thierry Geraud <thierry.geraud(a)lrde.epita.fr> Update morpho classif for LN. diff --git a/milena/sandbox/classif/iccvg04.cc b/milena/sandbox/classif/iccvg04.cc index b0525ef..1902e90 100644 --- a/milena/sandbox/classif/iccvg04.cc +++ b/milena/sandbox/classif/iccvg04.cc @@ -101,20 +101,11 @@ classify_image(const I& ima, const J& histo, const K& ws, int nbasins, int f) { unsigned count[nbasins + 1]; - memset(count, 0, nbasins + 1); + memset(count, 0, (nbasins + 1) * sizeof(unsigned)); algebra::vec<3, unsigned> sum[nbasins + 1]; for (int i = 1; i < nbasins + 1; ++i) - { sum[i] = literal::zero; - } - - /*mln_piter(K) p(ws.domain()); - for_all(p) - { - count[ws(p)] += histo(p); - sum[ws(p)] += histo(p) * convert::to<algebra::vec<3, value::int_u8> >(p) * f; - }*/ mln_piter(I) p(ima.domain()); for_all(p) @@ -128,7 +119,9 @@ classify_image(const I& ima, const J& histo, const K& ws, int nbasins, int f) count[w] += histo(p3); sum[w] += histo(p3) * convert::to< algebra::vec<3, value::int_u8> >(p3); } +#if DEBUG std::cerr << "p3 : " << p3 << " == " << convert::to<algebra::vec<3, value::int_u8> >(p3) << std::endl; +#endif // DEBUG } for (int i = 1; i < nbasins + 1; ++i) @@ -136,7 +129,9 @@ classify_image(const I& ima, const J& histo, const K& ws, int nbasins, int f) sum[i] *= f; sum[i] /= count[i]; //std::cout << "count[" << i << "] = " << count[i] << std::endl; +#if DEBUG std::cout << "sum[" << i << "] = " << sum[i] << std::endl; +#endif // DEBUG } @@ -152,14 +147,18 @@ classify_image(const I& ima, const J& histo, const K& ws, int nbasins, int f) if (w != 0) // If w == 0 it means that the current point is part of a border of the watershed { +#if DEBUG std::cerr << "out(" << pi << ") = sum[" << w << "]; //" << sum[w] << std::endl; +#endif out(pi) = convert::to<value::rgb8>(sum[w]); //out(pi) = value::rgb8(sum[w][0], sum[w][1], sum[w][2]); ws_out(pi) = value::rgb8(0, 0, 0); } else { +#if DEBUG std::cerr << "Border : " << pi << std::endl; +#endif ws_out(pi) = value::rgb8(255, 255, 255); // FIXME @@ -182,8 +181,22 @@ classify_image(const I& ima, const J& histo, const K& ws, int nbasins, int f) io::ppm::save(ws_out, "out-ws.ppm"); } +bool usage(int argc, char ** argv) +{ + if (argc != 4) + { + std::cout << "usage: " << argv[0] << " image div_factor lambda" << std::endl; + return false; + } + return true; +} + + int main(int argc, char **argv) { + if (not usage(argc, argv)) + return 1; + const int div_factor = atoi(argv[2]); const int lambda = atoi(argv[3]); @@ -198,20 +211,6 @@ int main(int argc, char **argv) std::cout << "histo : " << m << ' ' << M << std::endl; } -// Normalize histogram frequences -#if 0 - image3d<value::int_u8> nhisto(histo.domain()); - level::stretch(histo, nhisto); - //image3d<value::int_u8> nhisto = normalizeu8(histo); - { - value::int_u8 m, M; - estim::min_max(nhisto, m, M); - std::cout << "nhisto : " << m << ' ' << M << std::endl; - } -#endif - - //display(nhisto, "histo"); - //revert histo image3d<unsigned> rhisto = arith::revert(histo); { @@ -219,7 +218,6 @@ int main(int argc, char **argv) estim::min_max(rhisto, m, M); std::cout << "rhisto : " << m << ' ' << M << std::endl; } - //display(rhisto, "rhisto"); //compute closing_area of histo image3d<unsigned> histo_closure(histo.domain()); @@ -230,18 +228,12 @@ int main(int argc, char **argv) std::cout << "histo_closure : " << m << ' ' << M << std::endl; } - //display_proj_revert(histo_closure, "chisto.ppm"); - //watershed over histo_closure unsigned nbasins = 0; image3d<unsigned> ws = morpho::meyer_wst(histo_closure, c6(), nbasins); std::cout << "nbassins : " << nbasins << std::endl; - //display(ws, "ws"); - //display_proj_revert(ws, "whisto.ppm"); - //gplot(ws); - // Classify image ! //classify_image(const I& ima, const J& histo, const K& ws, int nbasins, int f) classify_image(ima, histo, ws, nbasins, div_factor); -- 1.5.6.5
16Â years, 2Â months
1
0
0
0
2687: INIM: classif: Fix iccvg04.
by Ugo Jardonnet
https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena/sandbox
Index: ChangeLog from Ugo Jardonnet <jardonnet(a)lrde.epita.fr> INIM: classif: Fix iccvg04. * classif/iccvg04.cc: Cleanup. Fix wrong initialization. iccvg04.cc | 54 +++++++++++++++++++++++------------------------------- 1 file changed, 23 insertions(+), 31 deletions(-) Index: classif/iccvg04.cc --- classif/iccvg04.cc (revision 2686) +++ classif/iccvg04.cc (working copy) @@ -101,20 +101,11 @@ { unsigned count[nbasins + 1]; - memset(count, 0, nbasins + 1); + memset(count, 0, (nbasins + 1) * sizeof(unsigned)); algebra::vec<3, unsigned> sum[nbasins + 1]; for (int i = 1; i < nbasins + 1; ++i) - { sum[i] = literal::zero; - } - - /*mln_piter(K) p(ws.domain()); - for_all(p) - { - count[ws(p)] += histo(p); - sum[ws(p)] += histo(p) * convert::to<algebra::vec<3, value::int_u8> >(p) * f; - }*/ mln_piter(I) p(ima.domain()); for_all(p) @@ -128,7 +119,9 @@ count[w] += histo(p3); sum[w] += histo(p3) * convert::to< algebra::vec<3, value::int_u8> >(p3); } +#if DEBUG std::cerr << "p3 : " << p3 << " == " << convert::to<algebra::vec<3, value::int_u8> >(p3) << std::endl; +#endif // DEBUG } for (int i = 1; i < nbasins + 1; ++i) @@ -136,7 +129,9 @@ sum[i] *= f; sum[i] /= count[i]; //std::cout << "count[" << i << "] = " << count[i] << std::endl; +#if DEBUG std::cout << "sum[" << i << "] = " << sum[i] << std::endl; +#endif // DEBUG } @@ -152,14 +147,18 @@ if (w != 0) // If w == 0 it means that the current point is part of a border of the watershed { +#if DEBUG std::cerr << "out(" << pi << ") = sum[" << w << "]; //" << sum[w] << std::endl; +#endif out(pi) = convert::to<value::rgb8>(sum[w]); //out(pi) = value::rgb8(sum[w][0], sum[w][1], sum[w][2]); ws_out(pi) = value::rgb8(0, 0, 0); } else { +#if DEBUG std::cerr << "Border : " << pi << std::endl; +#endif ws_out(pi) = value::rgb8(255, 255, 255); // FIXME @@ -182,8 +181,22 @@ io::ppm::save(ws_out, "out-ws.ppm"); } +bool usage(int argc, char ** argv) +{ + if (argc != 4) + { + std::cout << "usage: " << argv[0] << " image div_factor lambda" << std::endl; + return false; + } + return true; +} + + int main(int argc, char **argv) { + if (not usage(argc, argv)) + return 1; + const int div_factor = atoi(argv[2]); const int lambda = atoi(argv[3]); @@ -198,20 +211,6 @@ std::cout << "histo : " << m << ' ' << M << std::endl; } -// Normalize histogram frequences -#if 0 - image3d<value::int_u8> nhisto(histo.domain()); - level::stretch(histo, nhisto); - //image3d<value::int_u8> nhisto = normalizeu8(histo); - { - value::int_u8 m, M; - estim::min_max(nhisto, m, M); - std::cout << "nhisto : " << m << ' ' << M << std::endl; - } -#endif - - //display(nhisto, "histo"); - //revert histo image3d<unsigned> rhisto = arith::revert(histo); { @@ -219,7 +218,6 @@ estim::min_max(rhisto, m, M); std::cout << "rhisto : " << m << ' ' << M << std::endl; } - //display(rhisto, "rhisto"); //compute closing_area of histo image3d<unsigned> histo_closure(histo.domain()); @@ -230,18 +228,12 @@ std::cout << "histo_closure : " << m << ' ' << M << std::endl; } - //display_proj_revert(histo_closure, "chisto.ppm"); - //watershed over histo_closure unsigned nbasins = 0; image3d<unsigned> ws = morpho::meyer_wst(histo_closure, c6(), nbasins); std::cout << "nbassins : " << nbasins << std::endl; - //display(ws, "ws"); - //display_proj_revert(ws, "whisto.ppm"); - //gplot(ws); - // Classify image ! //classify_image(const I& ima, const J& histo, const K& ws, int nbasins, int f) classify_image(ima, histo, ws, nbasins, div_factor);
16Â years, 2Â months
1
0
0
0
2686: Fix mln::level::stretch w.r.t. the initialization.
by Roland Levillain
* mln/level/stretch.hh (mln::level::impl::stretch(int_u<n>, const Image<I>&, Image<O>&)): Initialize the output image from the input. --- milena/ChangeLog | 8 ++++++++ milena/mln/level/stretch.hh | 2 ++ 2 files changed, 10 insertions(+), 0 deletions(-) diff --git a/milena/ChangeLog b/milena/ChangeLog index 47a4f3a..35f360b 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -1,5 +1,13 @@ 2008-10-24 Roland Levillain <roland(a)lrde.epita.fr> + Fix mln::level::stretch w.r.t. the initialization. + + * mln/level/stretch.hh + (mln::level::impl::stretch(int_u<n>, const Image<I>&, Image<O>&)): + Initialize the output image from the input. + +2008-10-24 Roland Levillain <roland(a)lrde.epita.fr> + First attempt at generating a GraphViz' neato output. * tests/morpho/complex_image_wst.cc: Generate a neato graph. diff --git a/milena/mln/level/stretch.hh b/milena/mln/level/stretch.hh index 81c516f..4b70e66 100644 --- a/milena/mln/level/stretch.hh +++ b/milena/mln/level/stretch.hh @@ -70,6 +70,8 @@ namespace mln { trace::entering("level::impl::stretch"); + initialize(output, input); + mln_value(I) min_, max_; estim::min_max(input, min_, max_); if (max_ != min_) -- 1.6.0.1
16Â years, 3Â months
1
0
0
0
2686: Fix mln::level::stretch w.r.t. the initialization.
by Guillaume Lazzara
* mln/level/stretch.hh (mln::level::impl::stretch(int_u<n>, const Image<I>&, Image<O>&)): Initialize the output image from the input. --- milena/ChangeLog | 8 ++++++++ milena/mln/level/stretch.hh | 2 ++ 2 files changed, 10 insertions(+), 0 deletions(-) diff --git a/milena/ChangeLog b/milena/ChangeLog index 47a4f3a..35f360b 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -1,5 +1,13 @@ 2008-10-24 Roland Levillain <roland(a)lrde.epita.fr> + Fix mln::level::stretch w.r.t. the initialization. + + * mln/level/stretch.hh + (mln::level::impl::stretch(int_u<n>, const Image<I>&, Image<O>&)): + Initialize the output image from the input. + +2008-10-24 Roland Levillain <roland(a)lrde.epita.fr> + First attempt at generating a GraphViz' neato output. * tests/morpho/complex_image_wst.cc: Generate a neato graph. diff --git a/milena/mln/level/stretch.hh b/milena/mln/level/stretch.hh index 81c516f..4b70e66 100644 --- a/milena/mln/level/stretch.hh +++ b/milena/mln/level/stretch.hh @@ -70,6 +70,8 @@ namespace mln { trace::entering("level::impl::stretch"); + initialize(output, input); + mln_value(I) min_, max_; estim::min_max(input, min_, max_); if (max_ != min_) -- 1.5.6.5
16Â years, 3Â months
1
0
0
0
2685: First attempt at generating a GraphViz' neato output.
by Roland Levillain
* tests/morpho/complex_image_wst.cc: Generate a neato graph. --- milena/ChangeLog | 6 ++ milena/tests/morpho/complex_image_wst.cc | 111 +++++++++++++++++++++++++++++- 2 files changed, 116 insertions(+), 1 deletions(-) diff --git a/milena/ChangeLog b/milena/ChangeLog index 9994d8b..47a4f3a 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -1,3 +1,9 @@ +2008-10-24 Roland Levillain <roland(a)lrde.epita.fr> + + First attempt at generating a GraphViz' neato output. + + * tests/morpho/complex_image_wst.cc: Generate a neato graph. + 2008-10-24 Nicolas Ballas <ballas(a)lrde.epita.fr> Update transform routine interface. diff --git a/milena/tests/morpho/complex_image_wst.cc b/milena/tests/morpho/complex_image_wst.cc index 88e5bc9..8060cee 100644 --- a/milena/tests/morpho/complex_image_wst.cc +++ b/milena/tests/morpho/complex_image_wst.cc @@ -29,8 +29,15 @@ /// \brief Testing Meyer's Watershed Transform on mln::complex_image. #include <iostream> +#include <fstream> +#include <sstream> +#include <iomanip> #include <mln/value/int_u8.hh> +#include <mln/value/rgb8.hh> +#include <mln/literal/black.hh> +#include <mln/literal/white.hh> + #include <mln/core/alias/point2d.hh> #include <mln/core/site_set/p_faces.hh> @@ -47,6 +54,29 @@ #include <mln/morpho/closing_area.hh> #include <mln/morpho/meyer_wst.hh> +#include <mln/core/concept/function.hh> + +// FIXME: To be put elsewhere (from milena/sandbox/geraud/wst_edge.cc). +struct colorize : mln::Function_v2v< colorize > +{ + typedef mln::value::rgb8 result; + colorize(unsigned max) + : lut(max + 1) + { + lut[0] = mln::literal::black; + for (unsigned i = 1; i <= max; ++i) + lut[i] = result(100 + std::rand() % 150, + 100 + std::rand() % 150, + 100 + std::rand() % 150); + } + result operator()(unsigned i) const + { + return lut[i]; + } + std::vector<result> lut; +}; + + int main() { @@ -203,5 +233,84 @@ int main() We definitely need a complex_image that can accept a subset of a complex as domain (or at least a p_face<N, D, P>. */ - std::cout << "nbasins = " << nbasins << std::endl; + wst_val_t actual_nbasins = nbasins - c.nfaces<0>(); + std::cout << "nbasins = " << actual_nbasins << std::endl; + + + colorize color(nbasins); + + std::ofstream g("wst.neato"); + g << "graph wst" << std::endl + << "{" << std::endl + << " graph [bgcolor = \"#000000\"]" << std::endl + << " edge [color = \"#FFFFFF\"]" << std::endl + << " node [color = \"#FFFFFF\", fontcolor = \"#FFFFFF\" ]" << std::endl; + + // Vertices. + typedef complex_higher_neighborhood<D, G> e_nbh_t; + e_nbh_t e_nbh; + mln_niter_(e_nbh_t) v_e(e_nbh, v_); + for_all(v_) + { + // Find the adjacent basin (color). + value::rgb8 basin_color = literal::white; + for_all(v_e) + if (wshed(v_e) != 0) + { + basin_color = color(wshed(v_e)); + break; + } + std::ostringstream basin_color_str; + basin_color_str << '#' + << std::hex + << std::setfill('0') + << std::setw(2) << basin_color.red() + << std::setw(2) << basin_color.green() + << std::setw(2) << basin_color.blue() + << std::dec; + + g << " v" << v_.unproxy_().face_id() + << " [pos = \"" + << std::fixed << std::setprecision(1) + << (float)v_.to_site().front()[1] << ", " + << -(float)v_.to_site().front()[0] + << "\", color = \"" << basin_color_str.str() + << "\", fillcolor = \"" << basin_color_str.str() + << "\", pin = \"true\", style=\"filled,setlinewidth(3)\"];" + << std::endl; + } + + for_all(e) + { + value::rgb8 basin_color = color(wshed(e)); + std::ostringstream basin_color_str; + basin_color_str << '#' + << std::hex + << std::setfill('0') + << std::setw(2) << basin_color.red() + << std::setw(2) << basin_color.green() + << std::setw(2) << basin_color.blue() + << std::dec; + + // Adjacent vertices. + v.start(); + topo::face<1> v1 = v.unproxy_().face(); + point2d p1 = v.to_site().front(); + v.next(); + topo::face<1> v2 = v.unproxy_().face(); + point2d p2 = v.to_site().front(); + v.next(); + mln_invariant(!v.is_valid()); + + // Edges. + g << " v" << v1.face_id() << " -- v" << v2.face_id() << " "; + if (wshed(e) == 0) + g << "[color = \"#FFFFFF\"];" << std::endl; + else + g << "[color = \"" << basin_color_str.str() + << "\", style=\"setlinewidth(3)\"];" << std::endl; + } + + g << "}" << std::endl; + g.close(); } -- 1.5.6.5
16Â years, 3Â months
1
0
0
0
← Newer
1
...
679
680
681
682
683
684
685
...
963
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
Results per page:
10
25
50
100
200