Olena-patches
Threads by month
- ----- 2025 -----
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- 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
- 9625 discussions
* mln/core/image/complex_window_piter.hh: New.
---
milena/ChangeLog | 6 +
milena/mln/core/image/complex_window_piter.hh | 345 +++++++++++++++++++++++++
2 files changed, 351 insertions(+), 0 deletions(-)
create mode 100644 milena/mln/core/image/complex_window_piter.hh
diff --git a/milena/ChangeLog b/milena/ChangeLog
index c86e12a..60b6c1e 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,11 @@
2008-10-04 Roland Levillain <roland(a)lrde.epita.fr>
+ Add generic site iterators on complex windows.
+
+ * mln/core/image/complex_window_piter.hh: New.
+
+2008-10-04 Roland Levillain <roland(a)lrde.epita.fr>
+
Add a complex relative iterator adapter adding the center/ref. face.
* mln/topo/centered_iter_adapter.hh: New.
diff --git a/milena/mln/core/image/complex_window_piter.hh b/milena/mln/core/image/complex_window_piter.hh
new file mode 100644
index 0000000..62c6f86
--- /dev/null
+++ b/milena/mln/core/image/complex_window_piter.hh
@@ -0,0 +1,345 @@
+// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License. This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+#ifndef MLN_CORE_IMAGE_COMPLEX_WINDOW_PITER_HH
+# define MLN_CORE_IMAGE_COMPLEX_WINDOW_PITER_HH
+
+/// \file mln/core/image/complex_window_piter.hh
+/// \brief Definition of a site iterator on a complex window.
+
+# include <mln/core/internal/site_relative_iterator_base.hh>
+
+// FIXME: These might be factor-able (notably with
+// complex_neighborhood_piter.hh)
+
+/* FIXME: Do we really want to inherit from
+ internal::site_relative_iterator_base? I might duplicate things,
+ since most of the implementation of this iterator is delegated to
+ the underlying complex iter. Moreover, change_target_() is
+ useless, and center_at() ``hides'' an existing method in (one of)
+ the super class(es) which is not sound, IMHO. Think about
+ introducing base class replacement. */
+
+
+namespace mln
+{
+
+ /*------------------------------------.
+ | complex_window_fwd_piter<I, P, W>. |
+ `------------------------------------*/
+
+ /// \brief Forward iterator on complex window.
+ template <typename I, typename P, typename W>
+ class complex_window_fwd_piter
+ : public internal::site_relative_iterator_base< W,
+ complex_window_fwd_piter<I, P, W> >
+ {
+ typedef complex_window_fwd_piter<I, P, W> self_;
+ typedef internal::site_relative_iterator_base< W, self_ > super_;
+
+ public:
+ /// The Pseudo_Site type.
+ typedef mln_psite(W) psite;
+
+ public:
+ /// Construction.
+ /// \{
+ complex_window_fwd_piter();
+ template <typename Pref>
+ complex_window_fwd_piter(const Window<W>& win, const Pref& p_ref);
+ /// \}
+
+ /// Manipulation.
+ /// \{
+ /// Test if the iterator is valid.
+ bool is_valid_() const;
+ /// Invalidate the iterator.
+ void invalidate_();
+
+ /// Start an iteration.
+ void do_start_();
+ /// Go to the next site.
+ void do_next_();
+
+ /// Set the reference psite.
+ /* FIXME: Careful, this method overrides the (non virtual) method
+ internal::site_relative_iterator_base<S, E>::center_at. See
+ FIXME above. */
+ template <typename Pref>
+ void center_at(const Pref& c);
+ /// Compute the current psite.
+ psite compute_p_() const;
+ /// \}
+
+ private:
+ /// The type of the underlying complex iterator.
+ typedef typename W::complex_fwd_iter iter;
+ /// The underlying complex iterator.
+ iter iter_;
+ };
+
+
+ /// Print an mln::complex_window_fwd_piter.
+ template <typename I, typename P, typename W>
+ std::ostream&
+ operator<<(std::ostream& ostr,
+ const complex_window_fwd_piter<I, P, W>& p);
+
+
+ /*------------------------------------.
+ | complex_window_bkd_piter<I, P, W>. |
+ `------------------------------------*/
+
+ /// \brief Backward iterator on complex window.
+ template <typename I, typename P, typename W>
+ class complex_window_bkd_piter
+ : public internal::site_relative_iterator_base< W,
+ complex_window_bkd_piter<I, P, W> >
+ {
+ typedef complex_window_bkd_piter<I, P, W> self_;
+ typedef internal::site_relative_iterator_base< W, self_ > super_;
+
+ public:
+ /// The Pseudo_Site type.
+ typedef mln_psite(W) psite;
+
+ public:
+ /// Construction.
+ /// \{
+ complex_window_bkd_piter();
+ template <typename Pref>
+ complex_window_bkd_piter(const Window<W>& win, const Pref& p_ref);
+ /// \}
+
+ /// Manipulation.
+ /// \{
+ /// Test if the iterator is valid.
+ bool is_valid_() const;
+ /// Invalidate the iterator.
+ void invalidate_();
+
+ /// Start an iteration.
+ void do_start_();
+ /// Go to the next site.
+ void do_next_();
+
+ /// Set the reference psite.
+ /* FIXME: Careful, this method overrides the (non virtual) method
+ internal::site_relative_iterator_base<S, E>::center_at. See
+ FIXME above. */
+ template <typename Pref>
+ void center_at(const Pref& c);
+ /// Compute the current psite.
+ psite compute_p_() const;
+ /// \}
+
+ private:
+ /// The type of the underlying complex iterator.
+ typedef typename W::complex_bkd_iter iter;
+ /// The underlying complex iterator.
+ iter iter_;
+ };
+
+
+ /// Print an mln::complex_window_bkd_piter.
+ template <typename I, typename P, typename W>
+ std::ostream&
+ operator<<(std::ostream& ostr,
+ const complex_window_bkd_piter<I, P, W>& p);
+
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ /*------------------------------------.
+ | complex_window_fwd_piter<I, P, W>. |
+ `------------------------------------*/
+
+ template <typename I, typename P, typename W>
+ inline
+ complex_window_fwd_piter<I, P, W>::complex_window_fwd_piter()
+ {
+ }
+
+ template <typename I, typename P, typename W>
+ template <typename Pref>
+ inline
+ complex_window_fwd_piter<I, P, W>::complex_window_fwd_piter(const Window<W>& win,
+ const Pref& p_ref)
+ {
+ this->change_target(exact(win));
+ center_at(p_ref);
+ mln_postcondition(!this->is_valid());
+ }
+
+ template <typename I, typename P, typename W>
+ inline
+ bool
+ complex_window_fwd_piter<I, P, W>::is_valid_() const
+ {
+ return iter_.is_valid();
+ }
+
+ template <typename I, typename P, typename W>
+ inline
+ void
+ complex_window_fwd_piter<I, P, W>::invalidate_()
+ {
+ iter_.invalidate();
+ }
+
+ template <typename I, typename P, typename W>
+ inline
+ void
+ complex_window_fwd_piter<I, P, W>::do_start_()
+ {
+ iter_.start();
+ }
+
+ template <typename I, typename P, typename W>
+ inline
+ void
+ complex_window_fwd_piter<I, P, W>::do_next_()
+ {
+ iter_.next();
+ }
+
+ template <typename I, typename P, typename W>
+ template <typename Pref>
+ inline
+ void
+ complex_window_fwd_piter<I, P, W>::center_at(const Pref& c)
+ {
+ super_::center_at(c);
+ iter_.center_at(this->center().face());
+ }
+
+ template <typename I, typename P, typename W>
+ inline
+ mln_psite(W)
+ complex_window_fwd_piter<I, P, W>::compute_p_() const
+ {
+ return psite(this->center().site_set(), iter_);
+ }
+
+
+ template <typename I, typename P, typename W>
+ inline
+ std::ostream&
+ operator<<(std::ostream& ostr,
+ const complex_window_fwd_piter<I, P, W>& p)
+ {
+ return ostr << p.unproxy_();
+ }
+
+
+ /*------------------------------------.
+ | complex_window_bkd_piter<I, P, W>. |
+ `------------------------------------*/
+
+ template <typename I, typename P, typename W>
+ inline
+ complex_window_bkd_piter<I, P, W>::complex_window_bkd_piter()
+ {
+ }
+
+ template <typename I, typename P, typename W>
+ template <typename Pref>
+ inline
+ complex_window_bkd_piter<I, P, W>::complex_window_bkd_piter(const Window<W>& win,
+ const Pref& p_ref)
+ {
+ this->change_target(exact(win));
+ center_at(p_ref);
+ mln_postcondition(!this->is_valid());
+ }
+
+ template <typename I, typename P, typename W>
+ inline
+ bool
+ complex_window_bkd_piter<I, P, W>::is_valid_() const
+ {
+ return iter_.is_valid();
+ }
+
+ template <typename I, typename P, typename W>
+ inline
+ void
+ complex_window_bkd_piter<I, P, W>::invalidate_()
+ {
+ iter_.invalidate();
+ }
+
+ template <typename I, typename P, typename W>
+ inline
+ void
+ complex_window_bkd_piter<I, P, W>::do_start_()
+ {
+ iter_.start();
+ }
+
+ template <typename I, typename P, typename W>
+ inline
+ void
+ complex_window_bkd_piter<I, P, W>::do_next_()
+ {
+ iter_.next();
+ }
+
+ template <typename I, typename P, typename W>
+ template <typename Pref>
+ inline
+ void
+ complex_window_bkd_piter<I, P, W>::center_at(const Pref& c)
+ {
+ super_::center_at(c);
+ iter_.center_at(this->center().face());
+ }
+
+ template <typename I, typename P, typename W>
+ inline
+ mln_psite(W)
+ complex_window_bkd_piter<I, P, W>::compute_p_() const
+ {
+ return psite(this->center().site_set(), iter_);
+ }
+
+
+ template <typename I, typename P, typename W>
+ inline
+ std::ostream&
+ operator<<(std::ostream& ostr,
+ const complex_window_bkd_piter<I, P, W>& p)
+ {
+ return ostr << p.unproxy_();
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+} // end of namespace mln
+
+#endif // ! MLN_CORE_IMAGE_COMPLEX_WINDOW_PITER_HH
--
1.6.0.1
1
0
2512: Add a complex relative iterator adapter adding the center/ref. face.
by Roland Levillain 04 Oct '08
by Roland Levillain 04 Oct '08
04 Oct '08
* mln/topo/centered_iter_adapter.hh: New.
---
milena/ChangeLog | 6 +
milena/mln/topo/centered_iter_adapter.hh | 161 ++++++++++++++++++++++++++++++
2 files changed, 167 insertions(+), 0 deletions(-)
create mode 100644 milena/mln/topo/centered_iter_adapter.hh
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 5375a7d..c86e12a 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,11 @@
2008-10-04 Roland Levillain <roland(a)lrde.epita.fr>
+ Add a complex relative iterator adapter adding the center/ref. face.
+
+ * mln/topo/centered_iter_adapter.hh: New.
+
+2008-10-04 Roland Levillain <roland(a)lrde.epita.fr>
+
Add a complex relative iterator iterating on its center only.
* mln/topo/center_only_iter.hh: New.
diff --git a/milena/mln/topo/centered_iter_adapter.hh b/milena/mln/topo/centered_iter_adapter.hh
new file mode 100644
index 0000000..b9cb399
--- /dev/null
+++ b/milena/mln/topo/centered_iter_adapter.hh
@@ -0,0 +1,161 @@
+// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License.
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+#ifndef MLN_TOPO_CENTERED_ITER_ADAPTER_HH
+# define MLN_TOPO_CENTERED_ITER_ADAPTER_HH
+
+/// \file mln/topo/centered_iter_adapter.hh
+/// \brief Complex relative iterator adapters adding the central
+/// (reference) point to the set of iterated faces.
+
+# include <mln/topo/internal/complex_relative_iterator_sequence.hh>
+# include <mln/topo/center_only_iter.hh>
+
+# include <mln/topo/face.hh>
+
+
+namespace mln
+{
+
+ namespace topo
+ {
+
+ /*----------------------------------------.
+ | topo::centered_fwd_iter_adapter<D, I>. |
+ `----------------------------------------*/
+
+ // FIXME: We should deduce D from I.
+
+ /// \brief Backward complex relative iterator adapters adding the
+ /// central (reference) point to the set of iterated faces.
+ ///
+ /// \arg \p D The dimension of the complex this iterator belongs to.
+ /// \arg \p I The adapated complex relative iterator.
+ template <unsigned D, typename I>
+ class centered_fwd_iter_adapter
+ : public internal::complex_relative_iterator_sequence< center_only_iter<D>,
+ I,
+ centered_fwd_iter_adapter<D, I> >
+ {
+ typedef centered_fwd_iter_adapter<D, I> self_;
+ typedef center_only_iter<D> iter1_;
+ typedef I iter2_;
+ typedef internal::complex_relative_iterator_sequence< iter1_,
+ iter2_,
+ self_ > super_;
+
+ public:
+ /// Construction.
+ /// \{
+ centered_fwd_iter_adapter();
+ template <typename Fref>
+ centered_fwd_iter_adapter(const Fref& f_ref);
+ /// \}
+ };
+
+
+ /*----------------------------------------.
+ | topo::centered_bkd_iter_adapter<D, I>. |
+ `----------------------------------------*/
+
+ // FIXME: We should deduce D from I.
+
+ /// \brief Forward complex relative iterator adapters adding the
+ /// central (reference) point to the set of iterated faces.
+ ///
+ /// \arg \p D The dimension of the complex this iterator belongs to.
+ /// \arg \p I The adapated complex relative iterator.
+ template <unsigned D, typename I>
+ class centered_bkd_iter_adapter
+ : public internal::complex_relative_iterator_sequence< I,
+ center_only_iter<D>,
+ centered_bkd_iter_adapter<D, I> >
+ {
+ typedef centered_bkd_iter_adapter<D, I> self_;
+ typedef I iter1_;
+ typedef center_only_iter<D> iter2_;
+ typedef internal::complex_relative_iterator_sequence< iter1_,
+ iter2_,
+ self_ > super_;
+
+ public:
+ /// Construction.
+ /// \{
+ centered_bkd_iter_adapter();
+ template <typename Fref>
+ centered_bkd_iter_adapter(const Fref& f_ref);
+ /// \}
+ };
+
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ /*----------------------------------------.
+ | topo::centered_fwd_iter_adapter<D, I>. |
+ `----------------------------------------*/
+
+ template <unsigned D, typename I>
+ inline
+ centered_fwd_iter_adapter<D, I>::centered_fwd_iter_adapter()
+ {
+ }
+
+ template <unsigned D, typename I>
+ template <typename Fref>
+ inline
+ centered_fwd_iter_adapter<D, I>::centered_fwd_iter_adapter(const Fref& f_ref)
+ : super_(f_ref)
+ {
+ }
+
+
+ /*----------------------------------------.
+ | topo::centered_bkd_iter_adapter<D, I>. |
+ `----------------------------------------*/
+
+ template <unsigned D, typename I>
+ inline
+ centered_bkd_iter_adapter<D, I>::centered_bkd_iter_adapter()
+ {
+ }
+
+ template <unsigned D, typename I>
+ template <typename Fref>
+ inline
+ centered_bkd_iter_adapter<D, I>::centered_bkd_iter_adapter(const Fref& f_ref)
+ : super_(f_ref)
+ {
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::topo
+
+} // end of namespace mln
+
+#endif // ! MLN_TOPO_CENTERED_ITER_ADAPTER_HH
--
1.6.0.1
1
0
04 Oct '08
* mln/topo/center_only_iter.hh: New.
* tests/topo/complex.cc: Exercise this iterator.
---
milena/ChangeLog | 7 ++
milena/mln/topo/center_only_iter.hh | 134 +++++++++++++++++++++++++++++++++++
milena/tests/topo/complex.cc | 14 ++++
3 files changed, 155 insertions(+), 0 deletions(-)
create mode 100644 milena/mln/topo/center_only_iter.hh
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 5097f23..5375a7d 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,12 @@
2008-10-04 Roland Levillain <roland(a)lrde.epita.fr>
+ Add a complex relative iterator iterating on its center only.
+
+ * mln/topo/center_only_iter.hh: New.
+ * tests/topo/complex.cc: Exercise this iterator.
+
+2008-10-04 Roland Levillain <roland(a)lrde.epita.fr>
+
Fix initialization and access to values in mln::complex_image.
* mln/core/image/complex_image.hh
diff --git a/milena/mln/topo/center_only_iter.hh b/milena/mln/topo/center_only_iter.hh
new file mode 100644
index 0000000..d55ffca
--- /dev/null
+++ b/milena/mln/topo/center_only_iter.hh
@@ -0,0 +1,134 @@
+// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License.
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+#ifndef MLN_TOPO_CENTER_ONLY_ITER_HH
+# define MLN_TOPO_CENTER_ONLY_ITER_HH
+
+/// \file mln/topo/center_only_iter.hh
+///
+/// \brief Definition of a complex relative iterator iterating on its
+/// center (reference face) only.
+///
+/// \see mln/topo/centered_iter_adapter.hh
+
+# include <mln/topo/internal/complex_relative_iterator_base.hh>
+# include <mln/topo/face.hh>
+
+
+namespace mln
+{
+
+ namespace topo
+ {
+
+ // Forward declaration.
+ template <unsigned D> class face;
+
+
+ /*----------------------------.
+ | topo::center_only_iter<D>. |
+ `----------------------------*/
+
+ /** \brief Iterator on all the adjacent (n-1)-faces of the n-face
+ of an mln::complex<D>.
+
+ \arg \p D The dimension of the complex this iterator belongs to.
+
+ mln::topo::center_only_iter inherits from
+ mln::topo::internal::forward_complex_relative_iterator_base,
+ but it could inherit from
+ mln::topo::internal::backward_complex_relative_iterator_base
+ as well, since it always contains a single element, the
+ center/reference face (and the traversal order is
+ meaningless).
+
+ This iterator is essentially used to implement other iterators.
+ \see mln::topo::centered_iter_adapter
+ \see mln::complex_lower_window
+ \see mln::complex_higher_window
+ \see mln::complex_lower_higher_window */
+ template <unsigned D>
+ class center_only_iter
+ : public internal::forward_complex_relative_iterator_base< face<D>,
+ center_only_iter<D> >
+ {
+ private:
+ typedef center_only_iter<D> self_;
+ typedef internal::forward_complex_relative_iterator_base< face<D>,
+ self_ > super_;
+
+ public:
+ /// Construction.
+ /// \{
+ center_only_iter();
+ template <typename Fref>
+ center_only_iter(const Fref& f_ref);
+ /// \}
+
+ /// Compute the set of faces adjacent to the reference face.
+ void update_adj_faces_();
+ };
+
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ /*----------------------------.
+ | topo::center_only_iter<D>. |
+ `----------------------------*/
+
+ template <unsigned D>
+ inline
+ center_only_iter<D>::center_only_iter()
+ {
+ }
+
+ template <unsigned D>
+ template <typename Fref>
+ inline
+ center_only_iter<D>::center_only_iter(const Fref& f_ref)
+ : super_(f_ref)
+ {
+ }
+
+ template <unsigned D>
+ inline
+ void
+ center_only_iter<D>::update_adj_faces_()
+ {
+ mln_precondition(this->c_);
+ this->adj_faces_.clear();
+ this->adj_faces_.push_back(*this->c_);
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::topo
+
+} // end of namespace mln
+
+#endif // ! MLN_TOPO_CENTER_ONLY_ITER_HH
diff --git a/milena/tests/topo/complex.cc b/milena/tests/topo/complex.cc
index 9e559de..92d0398 100644
--- a/milena/tests/topo/complex.cc
+++ b/milena/tests/topo/complex.cc
@@ -33,6 +33,7 @@
#include <iostream>
#include <mln/topo/complex.hh>
+#include <mln/topo/center_only_iter.hh>
using namespace mln;
@@ -324,6 +325,19 @@ int main()
face<D>'s.
-----------------------------------------------------------------
*/
+
+ /*------------------.
+ | Other iterators. |
+ `------------------*/
+
+ // For each face, iterate on itself. (This iterator is not
+ // interesting as-is, but is useful when combined with others,
+ // e.g. in topo::centered_iter_adapter).
+ topo::center_only_iter<D> center(fwd_f);
+ for_all(fwd_f)
+ for_all(center)
+ std::cout << " " << center << std::endl;
+ std::cout << std::endl;
}
--
1.6.0.1
1
0
04 Oct '08
* mln/core/image/complex_image.hh
(mln::complex_image<D, P, V>::face_values): Rename as...
(mln::complex_image<D, P, V>::values): ...this.
Fix access to the array of values.
(mln::complex_image<D, P, V>::complex_image(const p_complex<D, P>&)):
Initialize faces of all dimensions, including D.
(mln::init_): Likewise.
Fix the use of values from model.
---
milena/ChangeLog | 13 +++++++++++++
milena/mln/core/image/complex_image.hh | 12 ++++++------
2 files changed, 19 insertions(+), 6 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 1b2d085..5097f23 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,18 @@
2008-10-04 Roland Levillain <roland(a)lrde.epita.fr>
+ Fix initialization and access to values in mln::complex_image.
+
+ * mln/core/image/complex_image.hh
+ (mln::complex_image<D, P, V>::face_values): Rename as...
+ (mln::complex_image<D, P, V>::values): ...this.
+ Fix access to the array of values.
+ (mln::complex_image<D, P, V>::complex_image(const p_complex<D, P>&)):
+ Initialize faces of all dimensions, including D.
+ (mln::init_): Likewise.
+ Fix the use of values from model.
+
+2008-10-04 Roland Levillain <roland(a)lrde.epita.fr>
+
Remove a warning about not used arguments in mln::fill_dispatch.
* mln/extension/fill.hh
diff --git a/milena/mln/core/image/complex_image.hh b/milena/mln/core/image/complex_image.hh
index a9cea01..add88e9 100644
--- a/milena/mln/core/image/complex_image.hh
+++ b/milena/mln/core/image/complex_image.hh
@@ -154,7 +154,7 @@ namespace mln
const p_complex<D, P>& domain() const;
/// Return the array of values associated to the faces.
- const metal::vec<D + 1, std::vector<V> >& face_values() const;
+ const metal::vec<D + 1, std::vector<V> >& values() const;
/// \}
};
@@ -178,8 +178,8 @@ namespace mln
const complex_image<D, P, W>& model)
{
metal::vec<D + 1, std::vector<V> > values;
- for (unsigned i = 0; i < D; ++i)
- values[i].resize(model.values[i].size());
+ for (unsigned i = 0; i <= D; ++i)
+ values[i].resize(model.values()[i].size());
target.init_(model.domain(), values);
}
@@ -222,7 +222,7 @@ namespace mln
complex_image<D, P, V>::complex_image(const p_complex<D, P>& pc)
{
metal::vec<D + 1, std::vector<V> > values;
- for (unsigned i = 0; i < D; ++i)
+ for (unsigned i = 0; i <= D; ++i)
values[i].resize(pc.cplx().nfaces(i));
init_(pc, values);
}
@@ -272,9 +272,9 @@ namespace mln
template <unsigned D, typename P, typename V>
inline
const metal::vec< D + 1, std::vector<V> >&
- complex_image<D, P, V>::face_values() const
+ complex_image<D, P, V>::values() const
{
- return this->data_->val_;
+ return this->data_->values_;
}
template <unsigned D, typename P, typename V>
--
1.6.0.1
1
0
2509: Remove a warning about not used arguments in mln::fill_dispatch.
by Roland Levillain 04 Oct '08
by Roland Levillain 04 Oct '08
04 Oct '08
* mln/extension/fill.hh
(mln::fill_dispatch(none, any, I&, const mln_value(I)&)): Here.
---
milena/ChangeLog | 7 +++++++
milena/mln/extension/fill.hh | 2 +-
2 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 1775284..1b2d085 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,12 @@
2008-10-04 Roland Levillain <roland(a)lrde.epita.fr>
+ Remove a warning about not used arguments in mln::fill_dispatch.
+
+ * mln/extension/fill.hh
+ (mln::fill_dispatch(none, any, I&, const mln_value(I)&)): Here.
+
+2008-10-04 Roland Levillain <roland(a)lrde.epita.fr>
+
* mln/core/window.hh: Fix a closing-namespace comment.
2008-10-04 Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
diff --git a/milena/mln/extension/fill.hh b/milena/mln/extension/fill.hh
index 0259c5c..54b0619 100644
--- a/milena/mln/extension/fill.hh
+++ b/milena/mln/extension/fill.hh
@@ -129,7 +129,7 @@ namespace mln
template <typename I>
void fill_dispatch(mln::trait::image::ext_domain::none,
mln::trait::image::ext_io::any,
- I& ima, const mln_value(I)& val)
+ I& /* ima */, const mln_value(I)& /* val */)
{
// No-op cause no extension domain, no border.
}
--
1.6.0.1
1
0
04 Oct '08
---
milena/ChangeLog | 4 ++++
milena/mln/core/window.hh | 2 +-
2 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 4ff6cb2..1775284 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,3 +1,7 @@
+2008-10-04 Roland Levillain <roland(a)lrde.epita.fr>
+
+ * mln/core/window.hh: Fix a closing-namespace comment.
+
2008-10-04 Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Replace the inplace routine by the rw method.
diff --git a/milena/mln/core/window.hh b/milena/mln/core/window.hh
index b24cfcb..9689983 100644
--- a/milena/mln/core/window.hh
+++ b/milena/mln/core/window.hh
@@ -73,7 +73,7 @@ namespace mln
typedef trait::window::definition::unique definition;
};
- } // end of namespace trait
+ } // end of namespace mln::trait
--
1.6.0.1
1
0
* mln/core/image/complex_lower_neighborhood.hh,
* mln/core/image/complex_higher_neighborhood.hh,
* mln/core/image/complex_lower_higher_neighborhood.hh:
Do it.
---
milena/ChangeLog | 9 +++++++++
.../mln/core/image/complex_higher_neighborhood.hh | 6 +++---
.../image/complex_lower_higher_neighborhood.hh | 6 +++---
.../mln/core/image/complex_lower_neighborhood.hh | 6 +++---
4 files changed, 18 insertions(+), 9 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 2eaf357..4ff6cb2 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -144,6 +144,15 @@
2008-10-03 Roland Levillain <roland(a)lrde.epita.fr>
+ Fix header guards of complex neighborhoods.
+
+ * mln/core/image/complex_lower_neighborhood.hh,
+ * mln/core/image/complex_higher_neighborhood.hh,
+ * mln/core/image/complex_lower_higher_neighborhood.hh:
+ Do it.
+
+2008-10-03 Roland Levillain <roland(a)lrde.epita.fr>
+
Exercise neighborhood and piters on lower+higher-dim. adjacent faces.
* tests/core/image/complex_image.cc: Here.
diff --git a/milena/mln/core/image/complex_higher_neighborhood.hh b/milena/mln/core/image/complex_higher_neighborhood.hh
index 3b56d68..ed26932 100644
--- a/milena/mln/core/image/complex_higher_neighborhood.hh
+++ b/milena/mln/core/image/complex_higher_neighborhood.hh
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_CORE_COMPLEX_HIGHER_NEIGHBORHOOD_HH
-# define MLN_CORE_COMPLEX_HIGHER_NEIGHBORHOOD_HH
+#ifndef MLN_CORE_IMAGE_COMPLEX_HIGHER_NEIGHBORHOOD_HH
+# define MLN_CORE_IMAGE_COMPLEX_HIGHER_NEIGHBORHOOD_HH
/// \file mln/core/complex_higher_neighborhood.hh
/// \brief A neighborhood centered on a n-face of complex returning its
@@ -116,4 +116,4 @@ namespace mln
} // end of namespace mln
-#endif // ! MLN_CORE_COMPLEX_HIGHER_NEIGHBORHOOD_HH
+#endif // ! MLN_CORE_IMAGE_COMPLEX_HIGHER_NEIGHBORHOOD_HH
diff --git a/milena/mln/core/image/complex_lower_higher_neighborhood.hh b/milena/mln/core/image/complex_lower_higher_neighborhood.hh
index 3780709..9127442 100644
--- a/milena/mln/core/image/complex_lower_higher_neighborhood.hh
+++ b/milena/mln/core/image/complex_lower_higher_neighborhood.hh
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_CORE_COMPLEX_LOWER_HIGHER_NEIGHBORHOOD_HH
-# define MLN_CORE_COMPLEX_LOWER_HIGHER_NEIGHBORHOOD_HH
+#ifndef MLN_CORE_IMAGE_COMPLEX_LOWER_HIGHER_NEIGHBORHOOD_HH
+# define MLN_CORE_IMAGE_COMPLEX_LOWER_HIGHER_NEIGHBORHOOD_HH
/// \file mln/core/complex_lower_higher_neighborhood.hh
/// \brief A neighborhood centered on a n-face of complex returning its
@@ -118,4 +118,4 @@ namespace mln
} // end of namespace mln
-#endif // ! MLN_CORE_COMPLEX_LOWER_HIGHER_NEIGHBORHOOD_HH
+#endif // ! MLN_CORE_IMAGE_COMPLEX_LOWER_HIGHER_NEIGHBORHOOD_HH
diff --git a/milena/mln/core/image/complex_lower_neighborhood.hh b/milena/mln/core/image/complex_lower_neighborhood.hh
index 6c21acc..c02b8b8 100644
--- a/milena/mln/core/image/complex_lower_neighborhood.hh
+++ b/milena/mln/core/image/complex_lower_neighborhood.hh
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_CORE_COMPLEX_LOWER_NEIGHBORHOOD_HH
-# define MLN_CORE_COMPLEX_LOWER_NEIGHBORHOOD_HH
+#ifndef MLN_CORE_IMAGE_COMPLEX_LOWER_NEIGHBORHOOD_HH
+# define MLN_CORE_IMAGE_COMPLEX_LOWER_NEIGHBORHOOD_HH
/// \file mln/core/complex_lower_neighborhood.hh
/// \brief A neighborhood centered on a n-face of complex returning its
@@ -116,4 +116,4 @@ namespace mln
} // end of namespace mln
-#endif // ! MLN_CORE_COMPLEX_LOWER_NEIGHBORHOOD_HH
+#endif // ! MLN_CORE_IMAGE_COMPLEX_LOWER_NEIGHBORHOOD_HH
--
1.6.0.1
1
0
04 Oct '08
https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Replace the inplace routine by the rw method.
Get rid of the old inplace/instant files.
* sandbox/geraud/dead: New directory.
* mln/core/image/instant.hh: Move...
* sandbox/geraud/dead/instant.hh: ...here.
* mln/core/image/inplace.hh: Move...
* sandbox/geraud/dead/inplace.hh: ...here.
Add the rw method to do the job.
* mln/core/internal/image_morpher.hh (rw): New.
Update other files.
* tools/seed2tiling.cc,
* tests/core/site_set/p_image.cc,
* tests/core/image/sub_image.cc,
* tests/draw/line.cc,
* tests/level/memcpy_.cc,
* tests/convert/to_p_set.cc,
* tests/convert/to_window.cc,
* tests/display/show.cc,
* tests/display/save_and_show.cc,
* tests/display/color_pretty.cc,
* tests/canvas/chamfer.cc,
* doc/oldies/2008__tour1.cc,
* doc/oldies/2008__tour3.cc,
* doc/tutorial/examples/sub_image.cc,
* doc/tutorial/examples/p_line2d.cc,
* doc/tutorial/examples/for_Z.cc,
* doc/examples/tuto_bis.cc,
* mln/core/image/status.txt,
* mln/core/image/all.hh,
* mln/core/image/hexa_piter.hh,
* mln/core/image/sub_image.hh,
* mln/level/fill_with_image.hh,
* mln/level/paste.spe.hh,
* mln/level/replace.hh,
* mln/level/paste.hh,
* mln/level/fill_with_value.hh,
* mln/accu/rank.hh,
* mln/accu/rank_high_quant.hh,
* mln/accu/rank_bool.hh,
* mln/geom/chamfer.hh,
* sandbox/duhamel/slow_seed2tiling.cc,
* sandbox/duhamel/color_sub.cc,
* sandbox/duhamel/chamfer.cc,
* sandbox/duhamel/chamfer.hh,
* sandbox/geraud/fllt.svg.6.cc,
* sandbox/geraud/cs2d/tuto.cc,
* sandbox/geraud/fllt/fllt_tree_to_image.hh,
* sandbox/geraud/fllt/fllt.svg.3.cc,
* sandbox/geraud/fllt/fllt.svg.4.cc,
* sandbox/geraud/fllt/fllt.svg.5.cc,
* sandbox/geraud/fllt/fllt.svg.6.cc,
* sandbox/geraud/fllt/fllt_test.hh,
* sandbox/geraud/Rd/debase.union_find.hh,
* sandbox/vigouroux/yuv/get_blue.hh,
* sandbox/vigouroux/yuv/get_red.hh,
* sandbox/vigouroux/yuv/rgb_to_yuv.hh,
* sandbox/vigouroux/yuv/get_green.hh,
* sandbox/vigouroux/hsi/get_blue.hh,
* sandbox/vigouroux/hsi/get_red.hh,
* sandbox/vigouroux/hsi/rgb_to_hsi.hh,
* sandbox/vigouroux/hsi/get_green.hh,
* sandbox/vigouroux/function.hh,
* sandbox/vigouroux/tests.cc,
* sandbox/vigouroux/cmy/rgb_to_cmy.hh,
* sandbox/vigouroux/cmy/get_blue.hh,
* sandbox/vigouroux/cmy/fun.hh,
* sandbox/vigouroux/cmy/get_green.hh,
* sandbox/vigouroux/xyz/rgb_to_xyz.hh,
* sandbox/vigouroux/xyz/get_blue.hh,
* sandbox/vigouroux/xyz/get_red.hh,
* sandbox/vigouroux/xyz/get_green.hh,
* sandbox/vigouroux/yiq/get_blue.hh,
* sandbox/vigouroux/yiq/get_red.hh,
* sandbox/vigouroux/yiq/rgb_to_yiq.hh,
* sandbox/vigouroux/yiq/get_green.hh,
* sandbox/vigouroux/conv/getred.hh,
* sandbox/vigouroux/conv/tored.hh,
* sandbox/vigouroux/conv/torgb.hh,
* sandbox/vigouroux/conv/rgbto.hh,
* sandbox/vigouroux/color/rgb_to_hsl.hh,
* sandbox/vigouroux/color/rgb_to_cmy.hh,
* sandbox/vigouroux/color/rgb_to_xyz.hh,
* sandbox/vigouroux/color/tests.cc,
* sandbox/vigouroux/color/rgb_to_hsv.hh,
* sandbox/vigouroux/color/rgb_to_yiq.hh,
* sandbox/vigouroux/color/rgb_to_hsi.hh,
* sandbox/vigouroux/color/rgb_to_yuv.hh,
* sandbox/garrigues/level_set.hh,
* sandbox/garrigues/fllt/fllt_simple.svg.1.cc,
* sandbox/garrigues/fllt/fllt_simple.svg.3.cc,
* sandbox/garrigues/fllt/fllt_simple.cc,
* sandbox/garrigues/fllt/compute_level_set_fast2.hh,
* sandbox/garrigues/fllt/debug.hh,
* sandbox/garrigues/fllt/compute_level_set_fast.hh,
* sandbox/garrigues/fllt/fllt_simple.svg.2.cc,
* sandbox/garrigues/fllt/fllt.hh,
* sandbox/garrigues/fllt/compute_level_set.hh,
* sandbox/garrigues/tiled_image2d/tiled_image2d.hh,
* sandbox/garrigues/factures/extract_array_highlight.cc,
* sandbox/garrigues/factures/extract_array.cc,
* sandbox/ballas/test.cc: Update.
doc/examples/tuto_bis.cc | 2 -
doc/oldies/2008__tour1.cc | 21 ++++++------
doc/oldies/2008__tour3.cc | 7 ++--
doc/tutorial/examples/for_Z.cc | 2 -
doc/tutorial/examples/p_line2d.cc | 13 -------
doc/tutorial/examples/sub_image.cc | 7 ----
mln/accu/rank.hh | 2 -
mln/accu/rank_bool.hh | 2 -
mln/accu/rank_high_quant.hh | 5 +-
mln/core/image/all.hh | 1
mln/core/image/hexa_piter.hh | 2 -
mln/core/image/status.txt | 3 -
mln/core/image/sub_image.hh | 31 +-----------------
mln/core/internal/image_morpher.hh | 21 ++++++++++++
mln/geom/chamfer.hh | 8 ++--
mln/level/fill_with_image.hh | 2 -
mln/level/fill_with_value.hh | 18 +---------
mln/level/paste.hh | 2 -
mln/level/paste.spe.hh | 5 ++
mln/level/replace.hh | 2 -
sandbox/ballas/test.cc | 26 +++++++--------
sandbox/duhamel/chamfer.cc | 2 -
sandbox/duhamel/chamfer.hh | 4 +-
sandbox/duhamel/color_sub.cc | 8 ++--
sandbox/duhamel/slow_seed2tiling.cc | 2 -
sandbox/garrigues/factures/extract_array.cc | 6 +--
sandbox/garrigues/factures/extract_array_highlight.cc | 4 +-
sandbox/garrigues/fllt/compute_level_set.hh | 2 -
sandbox/garrigues/fllt/compute_level_set_fast.hh | 2 -
sandbox/garrigues/fllt/compute_level_set_fast2.hh | 2 -
sandbox/garrigues/fllt/debug.hh | 6 +--
sandbox/garrigues/fllt/fllt.hh | 2 -
sandbox/garrigues/fllt/fllt_simple.cc | 2 -
sandbox/garrigues/fllt/fllt_simple.svg.1.cc | 2 -
sandbox/garrigues/fllt/fllt_simple.svg.2.cc | 2 -
sandbox/garrigues/fllt/fllt_simple.svg.3.cc | 2 -
sandbox/garrigues/level_set.hh | 2 -
sandbox/garrigues/tiled_image2d/tiled_image2d.hh | 2 -
sandbox/geraud/Rd/debase.union_find.hh | 6 +--
sandbox/geraud/cs2d/tuto.cc | 8 ++--
sandbox/geraud/fllt.svg.6.cc | 4 +-
sandbox/geraud/fllt/fllt.svg.3.cc | 2 -
sandbox/geraud/fllt/fllt.svg.4.cc | 6 +--
sandbox/geraud/fllt/fllt.svg.5.cc | 6 +--
sandbox/geraud/fllt/fllt.svg.6.cc | 4 +-
sandbox/geraud/fllt/fllt_test.hh | 2 -
sandbox/geraud/fllt/fllt_tree_to_image.hh | 2 -
sandbox/vigouroux/cmy/fun.hh | 2 -
sandbox/vigouroux/cmy/get_blue.hh | 2 -
sandbox/vigouroux/cmy/get_green.hh | 2 -
sandbox/vigouroux/cmy/rgb_to_cmy.hh | 2 -
sandbox/vigouroux/color/rgb_to_cmy.hh | 2 -
sandbox/vigouroux/color/rgb_to_hsi.hh | 2 -
sandbox/vigouroux/color/rgb_to_hsl.hh | 2 -
sandbox/vigouroux/color/rgb_to_hsv.hh | 2 -
sandbox/vigouroux/color/rgb_to_xyz.hh | 2 -
sandbox/vigouroux/color/rgb_to_yiq.hh | 2 -
sandbox/vigouroux/color/rgb_to_yuv.hh | 2 -
sandbox/vigouroux/color/tests.cc | 2 -
sandbox/vigouroux/conv/getred.hh | 2 -
sandbox/vigouroux/conv/rgbto.hh | 2 -
sandbox/vigouroux/conv/tored.hh | 2 -
sandbox/vigouroux/conv/torgb.hh | 2 -
sandbox/vigouroux/function.hh | 2 -
sandbox/vigouroux/hsi/get_blue.hh | 2 -
sandbox/vigouroux/hsi/get_green.hh | 2 -
sandbox/vigouroux/hsi/get_red.hh | 2 -
sandbox/vigouroux/hsi/rgb_to_hsi.hh | 2 -
sandbox/vigouroux/tests.cc | 2 -
sandbox/vigouroux/xyz/get_blue.hh | 2 -
sandbox/vigouroux/xyz/get_green.hh | 2 -
sandbox/vigouroux/xyz/get_red.hh | 2 -
sandbox/vigouroux/xyz/rgb_to_xyz.hh | 2 -
sandbox/vigouroux/yiq/get_blue.hh | 2 -
sandbox/vigouroux/yiq/get_green.hh | 2 -
sandbox/vigouroux/yiq/get_red.hh | 2 -
sandbox/vigouroux/yiq/rgb_to_yiq.hh | 2 -
sandbox/vigouroux/yuv/get_blue.hh | 2 -
sandbox/vigouroux/yuv/get_green.hh | 2 -
sandbox/vigouroux/yuv/get_red.hh | 2 -
sandbox/vigouroux/yuv/rgb_to_yuv.hh | 2 -
tests/canvas/chamfer.cc | 2 -
tests/convert/to_p_set.cc | 6 +--
tests/convert/to_window.cc | 4 +-
tests/core/image/sub_image.cc | 8 ++--
tests/core/site_set/p_image.cc | 2 -
tests/display/color_pretty.cc | 6 +--
tests/display/save_and_show.cc | 4 +-
tests/display/show.cc | 4 +-
tests/draw/line.cc | 6 +--
tests/level/memcpy_.cc | 7 ++--
tools/seed2tiling.cc | 2 -
92 files changed, 182 insertions(+), 211 deletions(-)
Index: tools/seed2tiling.cc
--- tools/seed2tiling.cc (revision 2505)
+++ tools/seed2tiling.cc (working copy)
@@ -49,7 +49,7 @@
#include <mln/core/image/image2d.hh>
#include <mln/core/image/sub_image.hh>
#include <mln/core/image_if_value.hh>
-#include <mln/core/image/inplace.hh>
+
#include <mln/core/alias/w_window2d_int.hh>
#include <mln/make/win_chamfer.hh>
Index: tests/core/site_set/p_image.cc
--- tests/core/site_set/p_image.cc (revision 2505)
+++ tests/core/site_set/p_image.cc (working copy)
@@ -54,7 +54,7 @@
mln_assertion(ps.nsites() == 0);
mln_assertion(ps.is_empty());
- mln_fwd_piter_(box2d) p(inplace(make::box2d(13,13,19,15)));
+ mln_fwd_piter_(box2d) p(make::box2d(13,13,19,15));
for_all(p)
{
ps.insert(p);
Index: tests/core/image/sub_image.cc
--- tests/core/image/sub_image.cc (revision 2505)
+++ tests/core/image/sub_image.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
@@ -32,7 +32,7 @@
#include <mln/core/image/image2d.hh>
#include <mln/core/image/sub_image.hh>
-#include <mln/core/image/inplace.hh>
+
#include <mln/level/fill.hh>
#include <mln/debug/println.hh>
@@ -46,8 +46,8 @@
level::fill(ima, 0);
debug::println(ima);
- level::fill(inplace(ima | make::box2d(1,1, 3,3)), 5);
- level::fill(inplace(ima | make::box2d(4,4, 6,6)), 1);
+ level::fill((ima | make::box2d(1,1, 3,3)).rw(), 5);
+ level::fill((ima | make::box2d(4,4, 6,6)).rw(), 1);
debug::println(ima);
}
Index: tests/draw/line.cc
--- tests/draw/line.cc (revision 2505)
+++ tests/draw/line.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
@@ -34,7 +34,7 @@
#include <mln/core/image/image2d.hh>
#include <mln/core/image/sub_image.hh>
-#include <mln/core/image/inplace.hh>
+
#include <mln/level/fill.hh>
#include <mln/level/compare.hh>
@@ -62,7 +62,7 @@
image2d<bool> ima3(10,10);
level::fill(ima3, false);
- level::fill(inplace(ima3 | l), true);
+ level::fill((ima3 | l).rw(), true);
mln_assertion(ima3 == ima);
}
Index: tests/level/memcpy_.cc
--- tests/level/memcpy_.cc (revision 2505)
+++ tests/level/memcpy_.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
@@ -33,7 +33,7 @@
*/
#include <mln/core/image/image2d.hh>
-#include <mln/core/image/inplace.hh>
+
#include <mln/debug/iota.hh>
#include <mln/level/memcpy_.hh>
@@ -50,7 +50,8 @@
src = point2d(0, 2),
dest = point2d(1, 2);
- level::memcpy_(inplace(make::pixel(ima, dest)),
+ pixel<I> pix = make::pixel(ima, dest);
+ level::memcpy_(pix,
make::pixel(ima, src),
2 + 2 * ima.border());
Index: tests/convert/to_p_set.cc
--- tests/convert/to_p_set.cc (revision 2505)
+++ tests/convert/to_p_set.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007. 2008 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
@@ -36,7 +36,7 @@
#include <mln/core/alias/window2d.hh>
#include <mln/core/alias/box2d.hh>
#include <mln/core/alias/neighb2d.hh>
-#include <mln/core/image/inplace.hh>
+
#include <mln/level/fill.hh>
@@ -75,7 +75,7 @@
// Image :
image2d<bool> ima(make::box2d(-6, -6, 6, 6));
level::fill(ima, false);
- level::fill(inplace(ima | ref), true);
+ level::fill((ima | ref).rw(), true);
p_set<point2d> test_ima = convert::to_p_set(ima);
test(ref, test_ima);
Index: tests/convert/to_window.cc
--- tests/convert/to_window.cc (revision 2505)
+++ tests/convert/to_window.cc (working copy)
@@ -36,7 +36,7 @@
#include <mln/core/alias/window2d.hh>
#include <mln/core/alias/box2d.hh>
#include <mln/core/alias/neighb2d.hh>
-#include <mln/core/image/inplace.hh>
+
#include <mln/level/fill.hh>
@@ -77,7 +77,7 @@
// Image :
image2d<bool> ima(make::box2d(-6, -6, 6, 6));
level::fill(ima, false);
- level::fill(inplace(ima | convert::to_p_set(ref)), true);
+ level::fill((ima | convert::to_p_set(ref)).rw(), true);
window2d test_ima = convert::to_window(ima);
test(ref, test_ima);
Index: tests/display/show.cc
--- tests/display/show.cc (revision 2505)
+++ tests/display/show.cc (working copy)
@@ -37,7 +37,7 @@
#include <mln/value/rgb8.hh>
#include <mln/core/image/sub_image.hh>
#include <mln/core/image_if_value.hh>
-#include <mln/core/image/inplace.hh>
+
#include <mln/core/alias/w_window2d_int.hh>
#include <mln/display/show.hh>
#include <mln/display/save.hh>
@@ -69,7 +69,7 @@
// Call color_pretty for sub_image.
for (unsigned i = 2; i < 6; i += 2)
{
- image_if_value<image2d<unsigned> > t = inplace (tmp | i);
+ image_if_value<image2d<unsigned> > t = tmp | i;
display::save (t);
display::show (t, "display", 1);
}
Index: tests/display/save_and_show.cc
--- tests/display/save_and_show.cc (revision 2505)
+++ tests/display/save_and_show.cc (working copy)
@@ -37,7 +37,7 @@
#include <mln/value/rgb8.hh>
#include <mln/core/image/sub_image.hh>
#include <mln/core/image_if_value.hh>
-#include <mln/core/image/inplace.hh>
+
#include <mln/core/alias/w_window2d_int.hh>
#include <mln/display/show.hh>
#include <mln/io/ppm/save.hh>
@@ -67,7 +67,7 @@
// Call color_pretty for sub_image.
for (unsigned i = 2; i < 6; i += 2)
{
- image_if_value<image2d<unsigned> > t = inplace (tmp | i);
+ image_if_value<image2d<unsigned> > t = tmp | i;
display::save_and_show (t, "display", 1);
}
Index: tests/display/color_pretty.cc
--- tests/display/color_pretty.cc (revision 2505)
+++ tests/display/color_pretty.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
@@ -35,7 +35,7 @@
# include <mln/level/fill.hh>
# include <mln/core/site_set/p_set.hh>
# include <mln/core/image/sub_image.hh>
-# include <mln/core/image/inplace.hh>
+
# include <mln/value/rgb8.hh>
# include <mln/display/color_pretty.hh>
# include <mln/level/compare.hh>
@@ -55,7 +55,7 @@
s.insert(point2d(0, 0));
s.insert(point2d(1, 1));
- sub_image<image2d<int_u8>, p_set<point2d > > input = inplace(ima | s);
+ sub_image<image2d<int_u8>, p_set<point2d > > input = ima | s;
image2d<value::rgb8> out = display::color_pretty(input);
value::rgb8 vs[2][2] = {
Index: tests/canvas/chamfer.cc
--- tests/canvas/chamfer.cc (revision 2505)
+++ tests/canvas/chamfer.cc (working copy)
@@ -32,7 +32,7 @@
#include <mln/core/image/image2d.hh>
#include <mln/core/image/sub_image.hh>
-#include <mln/core/image/inplace.hh>
+
#include <mln/level/fill.hh>
#include <mln/debug/println.hh>
Index: doc/oldies/2008__tour1.cc
--- doc/oldies/2008__tour1.cc (revision 2505)
+++ doc/oldies/2008__tour1.cc (working copy)
@@ -1,4 +1,5 @@
-// Copyright (C) 2001, 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2001, 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
@@ -165,7 +166,7 @@
// Memory has been allocated so data can be stored but pixel values
// have not been initialized yet. So we fill img3a, that is, all
// pixels of img3a, with the value 'a':
- level::fill(inplace(img3a), 'a');
+ level::fill(img3a, 'a');
// The "fill" algorithm is located in the sub-namespace "level"
// since this algorithm deals with the "level" of pixel values.
@@ -183,12 +184,14 @@
// Most algorithms in Olena are constructed following the classical
// scheme: "output algo(input)", where the input image is only read.
// However some few algorithms take an input image in order to
- // modify it. To enforce this particular feature, the user shall
- // explicitly state that the image is provided so that its data is
- // modified "inplace".
+ // modify it.
- // The algorithm call shall be "level::fill(inplace(ima), val)".
- // When forgetting the "inplace(..)" statement it does not compile.
+ // Obsolete: To enforce this particular feature, the user shall
+ // Obsolete: explicitly state that the image is provided so that its data is
+ // Obsolete: modified "inplace".
+
+ // Obsolete: The algorithm call shall be "level::fill(inplace(ima), val)".
+ // Obsolete: When forgetting the "inplace(..)" statement it does not compile.
// We then define below a second image to play with. As you can see
@@ -198,10 +201,10 @@
image1d<char> img3b(5, 14);
// We initialize the image values.
- level::fill(inplace(img3b), 'b');
+ level::fill(img3b, 'b');
// Last we now paste the contents of img3b in img3a...
- level::paste(img3b, inplace(img3a));
+ level::paste(img3b, img3a);
// ...and print the result.
debug::println(img3a);
Index: doc/oldies/2008__tour3.cc
--- doc/oldies/2008__tour3.cc (revision 2505)
+++ doc/oldies/2008__tour3.cc (working copy)
@@ -1,4 +1,5 @@
-// Copyright (C) 2001, 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2001, 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
@@ -76,7 +77,7 @@
0, 1, 1 };
// ...the debug::fill routine allows for manually initializing
// image data:
- debug::fill(inplace(img), vals);
+ debug::fill(img, vals);
std::cout << "img = " << std::endl;
debug::println(img);
// img =
@@ -137,7 +138,7 @@
// And now for a little test: what is the result of this code?
{
image2d<int> test(ima.points());
- level::fill(inplace(test), ima);
+ level::fill(test, ima);
(test + c4).at(1, 1) = 9;
debug::println(test);
}
Index: doc/tutorial/examples/sub_image.cc
--- doc/tutorial/examples/sub_image.cc (revision 2505)
+++ doc/tutorial/examples/sub_image.cc (working copy)
@@ -22,13 +22,8 @@
debug::println(sub);
debug::println(morpho::gradient_elementary(sub, c4()));
- level::fill_with_value(ima | box2d(2,3), 0);
+ level::fill_with_value((ima | box2d(2,3)).rw(), 0);
debug::println(ima);
trait::image::print(sub);
-
-
- {
- instant_<I> tmp(ima);
- }
}
Index: doc/tutorial/examples/p_line2d.cc
--- doc/tutorial/examples/p_line2d.cc (revision 2505)
+++ doc/tutorial/examples/p_line2d.cc (working copy)
@@ -10,10 +10,6 @@
-# include <mln/core/image/instant.hh>
-
-
-
int main()
{
using namespace mln;
@@ -25,7 +21,7 @@
point2d(1,1));
std::cout << line << std::endl;
- level::fill(inplace(ima | line), 'x');
+ level::fill((ima | line).rw(), 'x');
debug::println(ima);
p_set<point2d> s;
@@ -35,11 +31,4 @@
debug::println(pw::cst('o') | line);
// ...
-
-
- {
- typedef image2d<char> I;
- instant_<I> ima_(ima);
- debug::println(ima_);
- }
}
Index: doc/tutorial/examples/for_Z.cc
--- doc/tutorial/examples/for_Z.cc (revision 2505)
+++ doc/tutorial/examples/for_Z.cc (working copy)
@@ -207,7 +207,7 @@
// image2d<rgb8> cool(ima.domain());
// level::fill(cool, literal::black);
-// level::fill( inplace(cool | (pw::value(lab) == 1u)),
+// level::fill( (cool | (pw::value(lab) == 1u)).rw(),
// literal::red );
// debug::println(cool);
Index: doc/examples/tuto_bis.cc
--- doc/examples/tuto_bis.cc (revision 2505)
+++ doc/examples/tuto_bis.cc (working copy)
@@ -227,7 +227,7 @@
- mln_VAR(edge, extend(inplace(ima | is_edge),
+ mln_VAR(edge, extend((ima | is_edge).rw(),
pw::value(ima)));
level::paste(morpho::gradient(edge, e2c), edge);
// ^^^
Index: mln/core/image/status.txt
--- mln/core/image/status.txt (revision 2505)
+++ mln/core/image/status.txt (working copy)
@@ -45,7 +45,7 @@
** domain morpher
ok image_if
-... sub_image = 1st attempt to use the 'instant' mechanism...
+ok sub_image
rm image_if_interval
rm image_if_value
@@ -56,7 +56,6 @@
** identity morpher
-new instant
new extension_ima
new extension_fun
new extension_val
Index: mln/core/image/all.hh
--- mln/core/image/all.hh (revision 2505)
+++ mln/core/image/all.hh (working copy)
@@ -36,7 +36,6 @@
*/
-# include <mln/core/image/instant.hh>
// FIXME: Complete...
Index: mln/core/image/hexa_piter.hh
--- mln/core/image/hexa_piter.hh (revision 2505)
+++ mln/core/image/hexa_piter.hh (working copy)
@@ -37,7 +37,7 @@
# include <mln/core/alias/box2d.hh>
# include <mln/core/alias/box2d_h.hh>
-# include <mln/core/image/inplace.hh>
+
namespace mln
{
Index: mln/core/image/sub_image.hh
--- mln/core/image/sub_image.hh (revision 2505)
+++ mln/core/image/sub_image.hh (working copy)
@@ -39,7 +39,7 @@
*/
# include <mln/core/internal/image_domain_morpher.hh>
-# include <mln/core/image/instant.hh>
+
namespace mln
@@ -129,27 +129,11 @@
operator|(const Image<I>& ima, const Site_Set<S>& pset);
-// template <typename I, typename S>
-// sub_image<I, S>
-// operator|(Image<I>& ima, const Site_Set<S>& pset);
-
-
-// REPLACEMENT:
-
template <typename I, typename S>
- instant_< sub_image<I, S> >
+ sub_image<I, S>
operator|(Image<I>& ima, const Site_Set<S>& pset);
-// NEW:
-
- template <typename I, typename S>
- sub_image<I, S>
- operator|(instant_<I> ima, const Site_Set<S>& pset)
- {
- return ima.un_instant() | pset;
- }
-
template <typename I, typename S, typename J>
void init_(tag::image_t, sub_image<I,S>& target, const J& model);
@@ -241,18 +225,9 @@
return tmp;
}
-// template <typename I, typename S>
-// inline
-// sub_image<I, S>
-// operator|(Image<I>& ima, const Site_Set<S>& pset)
-// {
-// sub_image<I, S> tmp(exact(ima), exact(pset));
-// return tmp;
-// }
-
template <typename I, typename S>
inline
- instant_< sub_image<I, S> >
+ sub_image<I, S>
operator|(Image<I>& ima, const Site_Set<S>& pset)
{
sub_image<I, S> tmp(exact(ima), exact(pset));
Index: mln/core/internal/image_morpher.hh
--- mln/core/internal/image_morpher.hh (revision 2505)
+++ mln/core/internal/image_morpher.hh (working copy)
@@ -31,11 +31,14 @@
/*! \file mln/core/internal/image_morpher.hh
*
* \brief Definition of a base class for image morphers.
+ *
+ * \todo Add the appropriate checks in .rw().
*/
# include <mln/core/internal/image_base.hh>
# include <mln/metal/const.hh>
# include <mln/metal/is_const.hh>
+# include <mln/metal/is_not_const.hh>
namespace mln
@@ -77,6 +80,12 @@
/// Conversion to the underlying (morphed) image.
operator I() const; // FIXME: Very dangerous? Remove?
+
+ /// State that the morpher is writable. This allows for C++ to
+ /// use it as a mutable object even if it is a temporary object.
+ E& rw();
+
+
protected:
image_morpher();
};
@@ -162,6 +171,18 @@
this->delegatee_()->has_data();
}
+ template <typename I, typename T, typename S, typename E>
+ inline
+ E&
+ image_morpher<I, T, S, E>::rw()
+ {
+ mlc_is_not_const(I)::check();
+ mlc_equal(mln_trait_image_value_io(I),
+ mln::trait::image::value_io::read_write)::check();
+ // FIXME Nicolas: pw_io == read_write OR vw_io == read_write...
+ return exact(*this);
+ }
+
} // end of namespace mln::internal
Index: mln/level/fill_with_image.hh
--- mln/level/fill_with_image.hh (revision 2505)
+++ mln/level/fill_with_image.hh (working copy)
@@ -36,7 +36,7 @@
*/
# include <mln/core/concept/image.hh>
-# include <mln/core/image/inplace.hh>
+
// Specializations are in:
# include <mln/level/fill_with_image.spe.hh>
Index: mln/level/paste.spe.hh
--- mln/level/paste.spe.hh (revision 2505)
+++ mln/level/paste.spe.hh (working copy)
@@ -73,9 +73,12 @@
// typename I::line_piter p(data.domain()); // FIXME: Alias mln_line_piter!
// // mln_line_piter(I) p(data.domain());
// for_all(p)
-// memcpy_(inplace(make::pixel(destination, p)),
+// {
+// FIXME: TYPE pix = make::pixel(destination, p);
+// memcpy_(pix,
// make::pixel(data, p),
// n);
+// }
// trace::exiting("level::impl::paste_lines_");
// }
Index: mln/level/replace.hh
--- mln/level/replace.hh (revision 2505)
+++ mln/level/replace.hh (working copy)
@@ -72,7 +72,7 @@
const mln_value(I)& new_value)
{
trace::entering("level::impl::generic::replace");
- level::fill(inplace(exact(input_) | pw::value(input_) == pw::cst(old_value)), new_value);
+ level::fill((exact(input_) | pw::value(input_) == pw::cst(old_value)).rw(), new_value);
trace::exiting("level::impl::generic::replace");
}
Index: mln/level/paste.hh
--- mln/level/paste.hh (revision 2505)
+++ mln/level/paste.hh (working copy)
@@ -35,7 +35,7 @@
*/
# include <mln/core/concept/image.hh>
-# include <mln/core/image/inplace.hh>
+
// Specializations are in:
Index: mln/level/fill_with_value.hh
--- mln/level/fill_with_value.hh (revision 2505)
+++ mln/level/fill_with_value.hh (working copy)
@@ -44,8 +44,8 @@
# include <cstdlib>
# include <mln/core/concept/image.hh>
-# include <mln/core/image/inplace.hh>
-# include <mln/core/image/instant.hh>
+
+
// Specializations are in:
# include <mln/level/fill_with_value.spe.hh>
@@ -68,11 +68,6 @@
void fill_with_value(Image<I>& ima, const V& val);
- // Case of instant images.
- template <typename I, typename V>
- void fill_with_value(const Image< instant_<I> >& ima, const V& val);
-
-
# ifndef MLN_INCLUDE_ONLY
@@ -138,15 +133,6 @@
}
- // Un-instant.
-
- template <typename I, typename V>
- void fill_with_value(const Image< instant_<I> >& ima, const V& val)
- {
- fill_with_value(exact(ima).un_instant_(), val);
- }
-
-
# endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln::level
Index: mln/accu/rank.hh
--- mln/accu/rank.hh (revision 2505)
+++ mln/accu/rank.hh (working copy)
@@ -39,7 +39,7 @@
# include <mln/core/concept/meta_accumulator.hh>
# include <mln/trait/value_.hh>
# include <mln/util/pix.hh>
-# include <mln/core/image/inplace.hh>
+
namespace mln
{
Index: mln/accu/rank_high_quant.hh
--- mln/accu/rank_high_quant.hh (revision 2505)
+++ mln/accu/rank_high_quant.hh (working copy)
@@ -38,7 +38,7 @@
# include <mln/core/concept/meta_accumulator.hh>
# include <mln/trait/value_.hh>
# include <mln/util/pix.hh>
-# include <mln/core/image/inplace.hh>
+
namespace mln
{
@@ -149,8 +149,7 @@
T
rank_<T>::to_result() const
{
- // Fixme : Call to inplace to unconst (*this).
- inplace(*this).sort();
+ const_cast<rank_<T>&>(*this).sort();
if (n_ == elts_.size())
return elts_[k_];
Index: mln/accu/rank_bool.hh
--- mln/accu/rank_bool.hh (revision 2505)
+++ mln/accu/rank_bool.hh (working copy)
@@ -38,7 +38,7 @@
# include <mln/core/concept/meta_accumulator.hh>
# include <mln/trait/value_.hh>
# include <mln/util/pix.hh>
-# include <mln/core/image/inplace.hh>
+
namespace mln
{
Index: mln/geom/chamfer.hh
--- mln/geom/chamfer.hh (revision 2505)
+++ mln/geom/chamfer.hh (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,7 @@
# include <mln/core/alias/w_window2d_int.hh>
# include <mln/core/alias/w_window2d_float.hh>
# include <mln/core/image/sub_image.hh>
-# include <mln/core/image/inplace.hh>
+
# include <mln/core/image/image_if.hh>
# include <mln/canvas/chamfer.hh>
@@ -83,8 +83,8 @@
inline
void init() { initialize(output, exact(input));
- level::fill(inplace(output | (input | pw::cst(true)).domain()), 0);
- level::fill(inplace(output | (input | pw::cst(false)).domain()), max); }
+ level::fill((output | (input | pw::cst(true)).domain()).rw(), 0);
+ level::fill((output | (input | pw::cst(false)).domain()).rw(), max); }
inline
bool handles(const P& p) const { return input(p) == false; }
Index: sandbox/duhamel/slow_seed2tiling.cc
--- sandbox/duhamel/slow_seed2tiling.cc (revision 2505)
+++ sandbox/duhamel/slow_seed2tiling.cc (working copy)
@@ -50,7 +50,7 @@
#include <mln/core/image/image2d.hh>
#include <mln/core/image/sub_image.hh>
#include <mln/core/image_if_value.hh>
-#include <mln/core/image/inplace.hh>
+
#include <mln/core/alias/w_window2d_int.hh>
#include <mln/make/win_chamfer.hh>
Index: sandbox/duhamel/color_sub.cc
--- sandbox/duhamel/color_sub.cc (revision 2505)
+++ sandbox/duhamel/color_sub.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
@@ -32,7 +32,7 @@
# include <mln/core/image2d_b.hh>
# include <mln/core/image/sub_image.hh>
-# include <mln/core/image/inplace.hh>
+
# include <mln/value/int_u8.hh>
# include <mln/value/rgb8.hh>
# include <mln/level/fill.hh>
@@ -43,7 +43,7 @@
# include <mln/core/image_if_value.hh>
# include <mln/core/image/sub_image.hh>
# include <mln/core/image_if_value.hh>
-# include <mln/core/image/inplace.hh>
+
# include <mln/debug/println.hh>
# include <mln/core/alias/w_window2d_int.hh>
@@ -64,7 +64,7 @@
image2d_b<bool> input = io::pbm::load("../../img/toto.pbm");
const w_window2d_int& w_win = win_chamfer::mk_chamfer_3x3_int<2, 0> ();
image2d_b<unsigned> tmp = geom::chamfer(input, w_win, max);
- image2d_b<value::rgb8> out = display::color_pretty(inplace (tmp | 4));
+ image2d_b<value::rgb8> out = display::color_pretty(tmp | 4);
io::ppm::save(out, "out.ppm");
std::cout << "out.ppm generate" << std::endl;
}
Index: sandbox/duhamel/chamfer.cc
--- sandbox/duhamel/chamfer.cc (revision 2505)
+++ sandbox/duhamel/chamfer.cc (working copy)
@@ -1,7 +1,7 @@
#include <mln/core/image2d_b.hh>
#include <mln/core/image/sub_image.hh>
#include <mln/core/image_if_value.hh>
-#include <mln/core/image/inplace.hh>
+
#include <mln/level/fill.hh>
# include <mln/debug/println.hh>
Index: sandbox/duhamel/chamfer.hh
--- sandbox/duhamel/chamfer.hh (revision 2505)
+++ sandbox/duhamel/chamfer.hh (working copy)
@@ -76,8 +76,8 @@
unsigned max;
void init() { initialize(output, exact(input));
- level::fill(inplace(output | (input | true).domain()), 0);
- level::fill(inplace(output | (input | false).domain()), max); }
+ level::fill((output | (input | true).domain()).rw(), 0);
+ level::fill((output | (input | false).domain()).rw(), max); }
bool handles(const P& p) const { return input(p) == false; }
// end of requirements
Index: sandbox/geraud/fllt.svg.6.cc
--- sandbox/geraud/fllt.svg.6.cc (revision 2505)
+++ sandbox/geraud/fllt.svg.6.cc (working copy)
@@ -1003,7 +1003,7 @@
fllt_tree(P, V) subtree(node);
fllt_branch_iter_ind(P, V) s(fllt_branch(P, V)(subtree, *node));
for_all(s)
- level::fill(inplace(output | (*s).elt().points), (*s).elt().value);
+ level::fill(output | (*s).elt().points), (*s).elt().value);
}
void area_filter(image2d<value::int_u8>& output,
@@ -1037,7 +1037,7 @@
}
accu += (*node).elt().nsites;
- level::fill(inplace(output | (*node).elt().points), g);
+ level::fill(output | (*node).elt().points), g);
for (int i = 0; i < node->children().size();i++)
area_filter_min(output, node->children()[i], min_area, g, accu);
Index: sandbox/geraud/cs2d/tuto.cc
--- sandbox/geraud/cs2d/tuto.cc (revision 2505)
+++ sandbox/geraud/cs2d/tuto.cc (working copy)
@@ -66,9 +66,9 @@
//
// o o o
- level::fill(inplace(ima | is_cell), 'c');
- level::fill(inplace(ima | is_edge), 'e');
- level::fill(inplace(ima | is_point), 'p');
+ level::fill((ima | is_cell).rw(), 'c');
+ level::fill((ima | is_edge).rw(), 'e');
+ level::fill((ima | is_point).rw(), 'p');
debug::println(ima);
// c e c e c
@@ -85,7 +85,7 @@
// 0 0 0 0 0
// 0 0 0 0 0
- level::fill(inplace(ima | is_cell), fun::p2v::iota);
+ level::fill((ima | is_cell).rw(), fun::p2v::iota);
debug::println(ima | is_cell);
// 1 2 3
//
Index: sandbox/geraud/fllt/fllt_tree_to_image.hh
--- sandbox/geraud/fllt/fllt_tree_to_image.hh (revision 2505)
+++ sandbox/geraud/fllt/fllt_tree_to_image.hh (working copy)
@@ -9,7 +9,7 @@
void fllt_tree_to_image_(I& output,
fllt_node(point2d, value::int_u8)* node)
{
- level::fill(inplace(output | node->elt().points), node->elt().value);
+ level::fill((output | node->elt().points).rw(), node->elt().value);
for (int i = 0; i < node->children().size(); i++)
fllt_tree_to_image_(output, node->children()[i]);
Index: sandbox/geraud/fllt/fllt.svg.3.cc
--- sandbox/geraud/fllt/fllt.svg.3.cc (revision 2505)
+++ sandbox/geraud/fllt/fllt.svg.3.cc (working copy)
@@ -189,7 +189,7 @@
{
// R <- 0 and N <- 0
if (N_box.is_valid() != 0)
- level::fill(inplace(is | N_box.to_result()), in_O);
+ level::fill((is | N_box.to_result()).rw(), in_O);
clear_N(N);
N_box.init();
Index: sandbox/geraud/fllt/fllt.svg.4.cc
--- sandbox/geraud/fllt/fllt.svg.4.cc (revision 2505)
+++ sandbox/geraud/fllt/fllt.svg.4.cc (working copy)
@@ -195,8 +195,8 @@
// R <- 0 and N <- 0
if (N_box.is_valid() != 0)
{
-// level::fill(inplace(is | N_box.to_result()), in_O);
- level::fill(inplace(deja_vu | N_box.to_result()), false);
+// level::fill((is | N_box.to_result()).rw(), in_O);
+ level::fill(deja_vu | N_box.to_result()), false);
}
clear_N(N);
N_box.init();
@@ -296,7 +296,7 @@
for (unsigned i = 0; i < 256; ++i)
if (N[i].nsites())
- level::fill(inplace(deja_vu | N[i]), false);
+ level::fill(deja_vu | N[i]), false);
// {
// mln_piter(arr_t) p(N[i]);
// for_all(p)
Index: sandbox/geraud/fllt/fllt.svg.5.cc
--- sandbox/geraud/fllt/fllt.svg.5.cc (revision 2505)
+++ sandbox/geraud/fllt/fllt.svg.5.cc (working copy)
@@ -197,8 +197,8 @@
// R <- 0 and N <- 0
if (N_box.is_valid() != 0)
{
-// level::fill(inplace(is | N_box.to_result()), in_O);
- level::fill(inplace(deja_vu | N_box.to_result()), false);
+// level::fill((is | N_box.to_result()).rw(), in_O);
+ level::fill(deja_vu | N_box.to_result()), false);
}
clear_N(N);
N_box.init();
@@ -302,7 +302,7 @@
for (unsigned i = 0; i < 256; ++i)
if (N[i]->nsites())
- level::fill(inplace(deja_vu | *N[i]), false);
+ level::fill(deja_vu | *N[i]), false);
// mln_invariant(deja_vu == ((pw::value(is) == pw::cst(in_R)) | input.domain()));
Index: sandbox/geraud/fllt/fllt.svg.6.cc
--- sandbox/geraud/fllt/fllt.svg.6.cc (revision 2505)
+++ sandbox/geraud/fllt/fllt.svg.6.cc (working copy)
@@ -1003,7 +1003,7 @@
fllt_tree(P, V) subtree(node);
fllt_branch_iter_ind(P, V) s(fllt_branch(P, V)(subtree, *node));
for_all(s)
- level::fill(inplace(output | (*s).elt().points), (*s).elt().value);
+ level::fill(output | (*s).elt().points), (*s).elt().value);
}
void area_filter(image2d<value::int_u8>& output,
@@ -1037,7 +1037,7 @@
}
accu += (*node).elt().nsites;
- level::fill(inplace(output | (*node).elt().points), g);
+ level::fill(output | (*node).elt().points), g);
for (int i = 0; i < node->children().size();i++)
area_filter_min(output, node->children()[i], min_area, g, accu);
Index: sandbox/geraud/fllt/fllt_test.hh
--- sandbox/geraud/fllt/fllt_test.hh (revision 2505)
+++ sandbox/geraud/fllt/fllt_test.hh (working copy)
@@ -474,7 +474,7 @@
fllt_branch_iter(P, V) n(*child);
for_all(n)
- level::fill(inplace(ima | (*n).elt().points), true);
+ level::fill((ima | (*n).elt().points).rw(), true);
tmp.append((*n).elt().points);
Index: sandbox/geraud/Rd/debase.union_find.hh
--- sandbox/geraud/Rd/debase.union_find.hh (revision 2505)
+++ sandbox/geraud/Rd/debase.union_find.hh (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
@@ -70,7 +70,7 @@
// init
std::cout << "0 ";
- level::fill(inplace(is_proc), false);
+ level::fill(is_proc, false);
S = histo_reverse_sort(g);
// first pass
@@ -91,7 +91,7 @@
// second pass
std::cout << "2 ";
- level::fill(inplace(is_proc), false);
+ level::fill(is_proc, false);
for (int i = S.size() - 1; i >= 0; --i)
{
point p = S[i];
Index: sandbox/vigouroux/yuv/get_blue.hh
--- sandbox/vigouroux/yuv/get_blue.hh (revision 2505)
+++ sandbox/vigouroux/yuv/get_blue.hh (working copy)
@@ -1,7 +1,7 @@
#include <cmath>
#include <mln/core/image_if_value.hh>
-#include <mln/core/image/inplace.hh>
+
#include <mln/core/alias/w_window2d_int.hh>
#include <mln/display/show.hh>
#include <mln/io/ppm/save.hh>
Index: sandbox/vigouroux/yuv/get_red.hh
--- sandbox/vigouroux/yuv/get_red.hh (revision 2505)
+++ sandbox/vigouroux/yuv/get_red.hh (working copy)
@@ -1,7 +1,7 @@
#include <cmath>
#include <mln/core/image_if_value.hh>
-#include <mln/core/image/inplace.hh>
+
#include <mln/core/alias/w_window2d_int.hh>
#include <mln/display/show.hh>
#include <mln/io/ppm/save.hh>
Index: sandbox/vigouroux/yuv/rgb_to_yuv.hh
--- sandbox/vigouroux/yuv/rgb_to_yuv.hh (revision 2505)
+++ sandbox/vigouroux/yuv/rgb_to_yuv.hh (working copy)
@@ -1,7 +1,7 @@
#include <cmath>
#include <mln/core/image_if_value.hh>
-#include <mln/core/image/inplace.hh>
+
#include <mln/core/alias/w_window2d_int.hh>
#include <mln/display/show.hh>
#include <mln/io/ppm/save.hh>
Index: sandbox/vigouroux/yuv/get_green.hh
--- sandbox/vigouroux/yuv/get_green.hh (revision 2505)
+++ sandbox/vigouroux/yuv/get_green.hh (working copy)
@@ -1,7 +1,7 @@
#include <cmath>
#include <mln/core/image_if_value.hh>
-#include <mln/core/image/inplace.hh>
+
#include <mln/core/alias/w_window2d_int.hh>
#include <mln/display/show.hh>
#include <mln/io/ppm/save.hh>
Index: sandbox/vigouroux/hsi/get_blue.hh
--- sandbox/vigouroux/hsi/get_blue.hh (revision 2505)
+++ sandbox/vigouroux/hsi/get_blue.hh (working copy)
@@ -1,7 +1,7 @@
#include <cmath>
#include <mln/core/image_if_value.hh>
-#include <mln/core/image/inplace.hh>
+
#include <mln/core/alias/w_window2d_int.hh>
#include <mln/display/show.hh>
#include <mln/io/ppm/save.hh>
Index: sandbox/vigouroux/hsi/get_red.hh
--- sandbox/vigouroux/hsi/get_red.hh (revision 2505)
+++ sandbox/vigouroux/hsi/get_red.hh (working copy)
@@ -1,7 +1,7 @@
#include <cmath>
#include <mln/core/image_if_value.hh>
-#include <mln/core/image/inplace.hh>
+
#include <mln/core/alias/w_window2d_int.hh>
#include <mln/display/show.hh>
#include <mln/io/ppm/save.hh>
Index: sandbox/vigouroux/hsi/rgb_to_hsi.hh
--- sandbox/vigouroux/hsi/rgb_to_hsi.hh (revision 2505)
+++ sandbox/vigouroux/hsi/rgb_to_hsi.hh (working copy)
@@ -1,7 +1,7 @@
#include <cmath>
#include <mln/core/image_if_value.hh>
-#include <mln/core/image/inplace.hh>
+
#include <mln/core/alias/w_window2d_int.hh>
#include <mln/display/show.hh>
#include <mln/io/ppm/save.hh>
Index: sandbox/vigouroux/hsi/get_green.hh
--- sandbox/vigouroux/hsi/get_green.hh (revision 2505)
+++ sandbox/vigouroux/hsi/get_green.hh (working copy)
@@ -1,7 +1,7 @@
#include <cmath>
#include <mln/core/image_if_value.hh>
-#include <mln/core/image/inplace.hh>
+
#include <mln/core/alias/w_window2d_int.hh>
#include <mln/display/show.hh>
#include <mln/io/ppm/save.hh>
Index: sandbox/vigouroux/function.hh
--- sandbox/vigouroux/function.hh (revision 2505)
+++ sandbox/vigouroux/function.hh (working copy)
@@ -1,5 +1,5 @@
#include <mln/core/image_if_value.hh>
-#include <mln/core/image/inplace.hh>
+
#include <mln/core/alias/w_window2d_int.hh>
#include <mln/display/show.hh>
#include <mln/io/ppm/save.hh>
Index: sandbox/vigouroux/tests.cc
--- sandbox/vigouroux/tests.cc (revision 2505)
+++ sandbox/vigouroux/tests.cc (working copy)
@@ -1,5 +1,5 @@
#include <mln/core/image_if_value.hh>
-#include <mln/core/image/inplace.hh>
+
#include <mln/core/alias/w_window2d_int.hh>
#include <mln/display/show.hh>
#include <mln/io/ppm/save.hh>
Index: sandbox/vigouroux/cmy/rgb_to_cmy.hh
--- sandbox/vigouroux/cmy/rgb_to_cmy.hh (revision 2505)
+++ sandbox/vigouroux/cmy/rgb_to_cmy.hh (working copy)
@@ -1,7 +1,7 @@
#include <cmath>
#include <mln/core/image_if_value.hh>
-#include <mln/core/image/inplace.hh>
+
#include <mln/core/alias/w_window2d_int.hh>
#include <mln/display/show.hh>
#include <mln/io/ppm/save.hh>
Index: sandbox/vigouroux/cmy/get_blue.hh
--- sandbox/vigouroux/cmy/get_blue.hh (revision 2505)
+++ sandbox/vigouroux/cmy/get_blue.hh (working copy)
@@ -1,7 +1,7 @@
#include <cmath>
#include <mln/core/image_if_value.hh>
-#include <mln/core/image/inplace.hh>
+
#include <mln/core/alias/w_window2d_int.hh>
#include <mln/display/show.hh>
#include <mln/io/ppm/save.hh>
Index: sandbox/vigouroux/cmy/fun.hh
--- sandbox/vigouroux/cmy/fun.hh (revision 2505)
+++ sandbox/vigouroux/cmy/fun.hh (working copy)
@@ -1,7 +1,7 @@
#include <cmath>
#include <mln/core/image_if_value.hh>
-#include <mln/core/image/inplace.hh>
+
#include <mln/core/alias/w_window2d_int.hh>
#include <mln/display/show.hh>
#include <mln/io/ppm/save.hh>
Index: sandbox/vigouroux/cmy/get_green.hh
--- sandbox/vigouroux/cmy/get_green.hh (revision 2505)
+++ sandbox/vigouroux/cmy/get_green.hh (working copy)
@@ -1,7 +1,7 @@
#include <cmath>
#include <mln/core/image_if_value.hh>
-#include <mln/core/image/inplace.hh>
+
#include <mln/core/alias/w_window2d_int.hh>
#include <mln/display/show.hh>
#include <mln/io/ppm/save.hh>
Index: sandbox/vigouroux/xyz/rgb_to_xyz.hh
--- sandbox/vigouroux/xyz/rgb_to_xyz.hh (revision 2505)
+++ sandbox/vigouroux/xyz/rgb_to_xyz.hh (working copy)
@@ -2,7 +2,7 @@
# define OLENA_CONVERT_RGBXYZ_HH
# include <mln/core/image_if_value.hh>
-# include <mln/core/image/inplace.hh>
+
# include <mln/core/alias/w_window2d_int.hh>
# include <mln/display/show.hh>
# include <mln/io/ppm/save.hh>
Index: sandbox/vigouroux/xyz/get_blue.hh
--- sandbox/vigouroux/xyz/get_blue.hh (revision 2505)
+++ sandbox/vigouroux/xyz/get_blue.hh (working copy)
@@ -1,7 +1,7 @@
#include <cmath>
#include <mln/core/image_if_value.hh>
-#include <mln/core/image/inplace.hh>
+
#include <mln/core/alias/w_window2d_int.hh>
#include <mln/display/show.hh>
#include <mln/io/ppm/save.hh>
Index: sandbox/vigouroux/xyz/get_red.hh
--- sandbox/vigouroux/xyz/get_red.hh (revision 2505)
+++ sandbox/vigouroux/xyz/get_red.hh (working copy)
@@ -1,7 +1,7 @@
#include <cmath>
#include <mln/core/image_if_value.hh>
-#include <mln/core/image/inplace.hh>
+
#include <mln/core/alias/w_window2d_int.hh>
#include <mln/display/show.hh>
#include <mln/io/ppm/save.hh>
Index: sandbox/vigouroux/xyz/get_green.hh
--- sandbox/vigouroux/xyz/get_green.hh (revision 2505)
+++ sandbox/vigouroux/xyz/get_green.hh (working copy)
@@ -1,7 +1,7 @@
#include <cmath>
#include <mln/core/image_if_value.hh>
-#include <mln/core/image/inplace.hh>
+
#include <mln/core/alias/w_window2d_int.hh>
#include <mln/display/show.hh>
#include <mln/io/ppm/save.hh>
Index: sandbox/vigouroux/yiq/get_blue.hh
--- sandbox/vigouroux/yiq/get_blue.hh (revision 2505)
+++ sandbox/vigouroux/yiq/get_blue.hh (working copy)
@@ -1,7 +1,7 @@
#include <cmath>
#include <mln/core/image_if_value.hh>
-#include <mln/core/image/inplace.hh>
+
#include <mln/core/alias/w_window2d_int.hh>
#include <mln/display/show.hh>
#include <mln/io/ppm/save.hh>
Index: sandbox/vigouroux/yiq/get_red.hh
--- sandbox/vigouroux/yiq/get_red.hh (revision 2505)
+++ sandbox/vigouroux/yiq/get_red.hh (working copy)
@@ -1,7 +1,7 @@
#include <cmath>
#include <mln/core/image_if_value.hh>
-#include <mln/core/image/inplace.hh>
+
#include <mln/core/alias/w_window2d_int.hh>
#include <mln/display/show.hh>
#include <mln/io/ppm/save.hh>
Index: sandbox/vigouroux/yiq/rgb_to_yiq.hh
--- sandbox/vigouroux/yiq/rgb_to_yiq.hh (revision 2505)
+++ sandbox/vigouroux/yiq/rgb_to_yiq.hh (working copy)
@@ -1,7 +1,7 @@
#include <cmath>
#include <mln/core/image_if_value.hh>
-#include <mln/core/image/inplace.hh>
+
#include <mln/core/alias/w_window2d_int.hh>
#include <mln/display/show.hh>
#include <mln/io/ppm/save.hh>
Index: sandbox/vigouroux/yiq/get_green.hh
--- sandbox/vigouroux/yiq/get_green.hh (revision 2505)
+++ sandbox/vigouroux/yiq/get_green.hh (working copy)
@@ -1,7 +1,7 @@
#include <cmath>
#include <mln/core/image_if_value.hh>
-#include <mln/core/image/inplace.hh>
+
#include <mln/core/alias/w_window2d_int.hh>
#include <mln/display/show.hh>
#include <mln/io/ppm/save.hh>
Index: sandbox/vigouroux/conv/getred.hh
--- sandbox/vigouroux/conv/getred.hh (revision 2505)
+++ sandbox/vigouroux/conv/getred.hh (working copy)
@@ -1,7 +1,7 @@
#include <cmath>
#include <mln/core/image_if_value.hh>
-#include <mln/core/image/inplace.hh>
+
#include <mln/core/alias/w_window2d_int.hh>
#include <mln/display/show.hh>
#include <mln/io/ppm/save.hh>
Index: sandbox/vigouroux/conv/tored.hh
--- sandbox/vigouroux/conv/tored.hh (revision 2505)
+++ sandbox/vigouroux/conv/tored.hh (working copy)
@@ -1,7 +1,7 @@
#include <cmath>
#include <mln/core/image_if_value.hh>
-#include <mln/core/image/inplace.hh>
+
#include <mln/core/alias/w_window2d_int.hh>
#include <mln/display/show.hh>
#include <mln/io/ppm/save.hh>
Index: sandbox/vigouroux/conv/torgb.hh
--- sandbox/vigouroux/conv/torgb.hh (revision 2505)
+++ sandbox/vigouroux/conv/torgb.hh (working copy)
@@ -1,7 +1,7 @@
#include <cmath>
#include <mln/core/image_if_value.hh>
-#include <mln/core/image/inplace.hh>
+
#include <mln/core/alias/w_window2d_int.hh>
#include <mln/display/show.hh>
#include <mln/io/ppm/save.hh>
Index: sandbox/vigouroux/conv/rgbto.hh
--- sandbox/vigouroux/conv/rgbto.hh (revision 2505)
+++ sandbox/vigouroux/conv/rgbto.hh (working copy)
@@ -1,7 +1,7 @@
#include <cmath>
#include <mln/core/image_if_value.hh>
-#include <mln/core/image/inplace.hh>
+
#include <mln/core/alias/w_window2d_int.hh>
#include <mln/display/show.hh>
#include <mln/io/ppm/save.hh>
Index: sandbox/vigouroux/color/rgb_to_hsl.hh
--- sandbox/vigouroux/color/rgb_to_hsl.hh (revision 2505)
+++ sandbox/vigouroux/color/rgb_to_hsl.hh (working copy)
@@ -2,7 +2,7 @@
# define OLENA_CONVERT_NRGBHSL_HH
# include <mln/core/image_if_value.hh>
-# include <mln/core/image/inplace.hh>
+
# include <mln/core/alias/w_window2d_int.hh>
# include <mln/display/show.hh>
# include <mln/io/ppm/save.hh>
Index: sandbox/vigouroux/color/rgb_to_cmy.hh
--- sandbox/vigouroux/color/rgb_to_cmy.hh (revision 2505)
+++ sandbox/vigouroux/color/rgb_to_cmy.hh (working copy)
@@ -1,5 +1,5 @@
#include <mln/core/image_if_value.hh>
-#include <mln/core/image/inplace.hh>
+
#include <mln/core/alias/w_window2d_int.hh>
#include <mln/display/show.hh>
#include <mln/io/ppm/save.hh>
Index: sandbox/vigouroux/color/rgb_to_xyz.hh
--- sandbox/vigouroux/color/rgb_to_xyz.hh (revision 2505)
+++ sandbox/vigouroux/color/rgb_to_xyz.hh (working copy)
@@ -2,7 +2,7 @@
# define OLENA_CONVERT_RGBXYZ_HH
# include <mln/core/image_if_value.hh>
-# include <mln/core/image/inplace.hh>
+
# include <mln/core/alias/w_window2d_int.hh>
# include <mln/display/show.hh>
# include <mln/io/ppm/save.hh>
Index: sandbox/vigouroux/color/tests.cc
--- sandbox/vigouroux/color/tests.cc (revision 2505)
+++ sandbox/vigouroux/color/tests.cc (working copy)
@@ -1,5 +1,5 @@
#include <mln/core/image_if_value.hh>
-#include <mln/core/image/inplace.hh>
+
#include <mln/core/alias/w_window2d_int.hh>
#include <mln/display/show.hh>
#include <mln/io/ppm/save.hh>
Index: sandbox/vigouroux/color/rgb_to_hsv.hh
--- sandbox/vigouroux/color/rgb_to_hsv.hh (revision 2505)
+++ sandbox/vigouroux/color/rgb_to_hsv.hh (working copy)
@@ -2,7 +2,7 @@
# define OLENA_CONVERT_NRGBHSV_HH
# include <mln/core/image_if_value.hh>
-# include <mln/core/image/inplace.hh>
+
# include <mln/core/alias/w_window2d_int.hh>
# include <mln/display/show.hh>
# include <mln/io/ppm/save.hh>
Index: sandbox/vigouroux/color/rgb_to_yiq.hh
--- sandbox/vigouroux/color/rgb_to_yiq.hh (revision 2505)
+++ sandbox/vigouroux/color/rgb_to_yiq.hh (working copy)
@@ -1,5 +1,5 @@
#include <mln/core/image_if_value.hh>
-#include <mln/core/image/inplace.hh>
+
#include <mln/core/alias/w_window2d_int.hh>
#include <mln/display/show.hh>
#include <mln/io/ppm/save.hh>
Index: sandbox/vigouroux/color/rgb_to_hsi.hh
--- sandbox/vigouroux/color/rgb_to_hsi.hh (revision 2505)
+++ sandbox/vigouroux/color/rgb_to_hsi.hh (working copy)
@@ -2,7 +2,7 @@
#include <cmath>
#include <mln/core/image_if_value.hh>
-#include <mln/core/image/inplace.hh>
+
#include <mln/core/alias/w_window2d_int.hh>
#include <mln/display/show.hh>
#include <mln/io/ppm/save.hh>
Index: sandbox/vigouroux/color/rgb_to_yuv.hh
--- sandbox/vigouroux/color/rgb_to_yuv.hh (revision 2505)
+++ sandbox/vigouroux/color/rgb_to_yuv.hh (working copy)
@@ -1,5 +1,5 @@
#include <mln/core/image_if_value.hh>
-#include <mln/core/image/inplace.hh>
+
#include <mln/core/alias/w_window2d_int.hh>
#include <mln/display/show.hh>
#include <mln/io/ppm/save.hh>
Index: sandbox/garrigues/level_set.hh
--- sandbox/garrigues/level_set.hh (revision 2505)
+++ sandbox/garrigues/level_set.hh (working copy)
@@ -43,7 +43,7 @@
# include <mln/core/alias/point2d.hh>
# include <mln/core/site_set/p_set.hh>
-# include <mln/core/image/inplace.hh>
+
# include <mln/core/alias/neighb2d.hh>
# include <mln/core/clock_neighb2d.hh>
# include <mln/core/p_if_piter.hh>
Index: sandbox/garrigues/fllt/fllt_simple.svg.1.cc
--- sandbox/garrigues/fllt/fllt_simple.svg.1.cc (revision 2505)
+++ sandbox/garrigues/fllt/fllt_simple.svg.1.cc (working copy)
@@ -192,7 +192,7 @@
std::cout << "Step 2" << std::endl;
#endif
if (N_box.is_valid())
- level::fill(inplace(is | N_box.to_result()), in_O);
+ level::fill((is | N_box.to_result()).rw(), in_O);
N_box.init();
R_box.init();
Index: sandbox/garrigues/fllt/fllt_simple.svg.3.cc
--- sandbox/garrigues/fllt/fllt_simple.svg.3.cc (revision 2505)
+++ sandbox/garrigues/fllt/fllt_simple.svg.3.cc (working copy)
@@ -387,7 +387,7 @@
std::cout << "Step 2" << std::endl;
#endif
if (N_box.is_valid())
- level::fill(inplace(is | N_box.to_result()), in_O);
+ level::fill((is | N_box.to_result()).rw(), in_O);
N_box.init();
R_box.init();
Index: sandbox/garrigues/fllt/fllt_simple.cc
--- sandbox/garrigues/fllt/fllt_simple.cc (revision 2505)
+++ sandbox/garrigues/fllt/fllt_simple.cc (working copy)
@@ -505,7 +505,7 @@
std::cout << "Step 2" << std::endl;
#endif
if (N_box.is_valid())
- level::fill(inplace(is | N_box.to_result()), in_O);
+ level::fill((is | N_box.to_result()).rw(), in_O);
N_box.init();
R_box.init();
Index: sandbox/garrigues/fllt/compute_level_set_fast2.hh
--- sandbox/garrigues/fllt/compute_level_set_fast2.hh (revision 2505)
+++ sandbox/garrigues/fllt/compute_level_set_fast2.hh (working copy)
@@ -244,7 +244,7 @@
// static image2d<bool> border_ima(tmp.domain());
// level::fill(border_ima, false);
-// // level::fill(inplace(border_ima | N), true);
+// // level::fill((border_ima | N).rw(), true);
// // std::cout << "tmp border = " << tmp.border () << std::endl;
// // std::cout << "ima border = " << border_ima.border () << std::endl;
// mln_piter(p_image2d<P>) z(N);
Index: sandbox/garrigues/fllt/debug.hh
--- sandbox/garrigues/fllt/debug.hh (revision 2505)
+++ sandbox/garrigues/fllt/debug.hh (working copy)
@@ -187,11 +187,11 @@
level::fill(out, literal::white);
if (R.nsites() != 0)
- level::fill(inplace(out | R), literal::green);
+ level::fill((out | R).rw(), literal::green);
if (A.nsites() != 0)
- level::fill(inplace(out | A), literal::blue);
+ level::fill((out | A).rw(), literal::blue);
if (N.nsites() != 0)
- level::fill(inplace(out | N), literal::red);
+ level::fill((out | N).rw(), literal::red);
io::ppm::save(out, filename.str());
}
Index: sandbox/garrigues/fllt/compute_level_set_fast.hh
--- sandbox/garrigues/fllt/compute_level_set_fast.hh (revision 2505)
+++ sandbox/garrigues/fllt/compute_level_set_fast.hh (working copy)
@@ -238,7 +238,7 @@
// static image2d<bool> border_ima(tmp.domain());
// level::fill(border_ima, false);
-// // level::fill(inplace(border_ima | N), true);
+// // level::fill((border_ima | N).rw(), true);
// // std::cout << "tmp border = " << tmp.border () << std::endl;
// // std::cout << "ima border = " << border_ima.border () << std::endl;
// mln_piter(p_image2d<P>) z(N);
Index: sandbox/garrigues/fllt/fllt_simple.svg.2.cc
--- sandbox/garrigues/fllt/fllt_simple.svg.2.cc (revision 2505)
+++ sandbox/garrigues/fllt/fllt_simple.svg.2.cc (working copy)
@@ -209,7 +209,7 @@
std::cout << "Step 2" << std::endl;
#endif
if (N_box.is_valid())
- level::fill(inplace(is | N_box.to_result()), in_O);
+ level::fill((is | N_box.to_result()).rw(), in_O);
N_box.init();
R_box.init();
Index: sandbox/garrigues/fllt/fllt.hh
--- sandbox/garrigues/fllt/fllt.hh (revision 2505)
+++ sandbox/garrigues/fllt/fllt.hh (working copy)
@@ -37,7 +37,7 @@
# include <mln/core/image/image2d.hh>
# include <mln/core/site_set/p_set.hh>
-# include <mln/core/image/inplace.hh>
+
# include <mln/core/alias/neighb2d.hh>
# include <mln/core/p_if_piter.hh>
# include <mln/core/site_set/p_if.hh>
Index: sandbox/garrigues/fllt/compute_level_set.hh
--- sandbox/garrigues/fllt/compute_level_set.hh (revision 2505)
+++ sandbox/garrigues/fllt/compute_level_set.hh (working copy)
@@ -179,7 +179,7 @@
static image2d<bool> border_ima(tmp.domain());
level::fill(border_ima, false);
- // level::fill(inplace(border_ima | N), true);
+ // level::fill((border_ima | N).rw(), true);
// std::cout << "tmp border = " << tmp.border () << std::endl;
// std::cout << "ima border = " << border_ima.border () << std::endl;
mln_piter(p_set<P>) z(N);
Index: sandbox/garrigues/tiled_image2d/tiled_image2d.hh
--- sandbox/garrigues/tiled_image2d/tiled_image2d.hh (revision 2505)
+++ sandbox/garrigues/tiled_image2d/tiled_image2d.hh (working copy)
@@ -36,7 +36,7 @@
# include <mln/core/internal/image_primary.hh>
# include <mln/core/internal/fixme.hh>
# include <mln/core/alias/box2d.hh>
-# include <mln/core/image/inplace.hh>
+
# include <mln/core/routine/init.hh>
# include <mln/core/line_piter.hh>
Index: sandbox/garrigues/factures/extract_array_highlight.cc
--- sandbox/garrigues/factures/extract_array_highlight.cc (revision 2505)
+++ sandbox/garrigues/factures/extract_array_highlight.cc (working copy)
@@ -37,7 +37,7 @@
#include <mln/win/disk2d.hh>
#include <mln/pw/all.hh>
-#include <mln/core/image/inplace.hh>
+
#include <mln/level/stretch.hh>
#include <mln/level/median.hh>
#include <mln/morpho/gradient.hh>
@@ -150,7 +150,7 @@
// Binarisation.
ima2d_bool bin(in.domain());
- level::paste(inplace(pw::value(in) > pw::cst(50) | in.domain()), bin);
+ level::paste(pw::value(in) > pw::cst(50) | in.domain(), bin);
image2d<value::rgb8> output_h = highlight_hlines(bin);
image2d<value::rgb8> output_v = highlight_vlines(bin);
Index: sandbox/garrigues/factures/extract_array.cc
--- sandbox/garrigues/factures/extract_array.cc (revision 2505)
+++ sandbox/garrigues/factures/extract_array.cc (working copy)
@@ -35,7 +35,7 @@
#include <mln/win/rectangle2d.hh>
#include <mln/pw/all.hh>
-#include <mln/core/image/inplace.hh>
+
#include <mln/level/stretch.hh>
#include <mln/labeling/level.hh>
#include <mln/literal/all.hh>
@@ -63,7 +63,7 @@
// Binarisation.
ima2d_bool bin(small.domain());
- level::paste(inplace(pw::value(small) > pw::cst(50) | small.domain()), bin);
+ level::paste(pw::value(small) > pw::cst(50) | small.domain(), bin);
// Labeling.
unsigned nlabels;
@@ -108,7 +108,7 @@
// Draw the bounding boxes.
for (int i = 0; i < nlabels; i++)
if (is_array[i])
- draw::box(output, inplace(caracteristics[i].to_result().first), inplace(value::rgb8(literal::green)));
+ draw::box(output, caracteristics[i].to_result().first, value::rgb8(literal::green));
io::ppm::save(output, "array.ppm");
}
Index: sandbox/ballas/test.cc
--- sandbox/ballas/test.cc (revision 2505)
+++ sandbox/ballas/test.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
@@ -40,30 +40,30 @@
image1d<float> ima1d3(5);
image1d<double> ima1d4(5);
- level::fill(inplace(ima1d1), 5);
- level::fill(inplace(ima1d2), 5);
- level::fill(inplace(ima1d3), 5);
- level::fill(inplace(ima1d4), 5);
+ level::fill(ima1d1, 5);
+ level::fill(ima1d2, 5);
+ level::fill(ima1d3, 5);
+ level::fill(ima1d4, 5);
image2d<char> ima2d1(5, 5);
image2d<int> ima2d2(5, 5);
image2d<float> ima2d3(5, 5);
image2d<double> ima2d4(5, 5);
- level::fill(inplace(ima2d1), 5);
- level::fill(inplace(ima2d2), 5);
- level::fill(inplace(ima2d3), 5);
- level::fill(inplace(ima2d4), 5);
+ level::fill(ima2d1, 5);
+ level::fill(ima2d2, 5);
+ level::fill(ima2d3, 5);
+ level::fill(ima2d4, 5);
image3d<char> ima3d1(5, 5, 5);
image3d<int> ima3d2(5, 5, 5);
image3d<float> ima3d3(5, 5, 5);
image3d<double> ima3d4(5, 5, 5);
- level::fill(inplace(ima3d1), 5);
- level::fill(inplace(ima3d2), 5);
- level::fill(inplace(ima3d3), 5);
- level::fill(inplace(ima3d4), 5);
+ level::fill(ima3d1, 5);
+ level::fill(ima3d2, 5);
+ level::fill(ima3d3, 5);
+ level::fill(ima3d4, 5);
return 0;
}
1
0
04 Oct '08
https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Add multiple-size windows and dual neighborhoods.
* tests/make: New.
* tests/make/dual_neighb.cc: New.
* tests/make/Makefile.am: New.
* tests/Makefile.am: Update.
* mln/core/concept/window.hh (todo): New.
* mln/make/dual_neighb.hh: New.
* mln/make/double_neighb2d.hh: Fix dox.
(todo): New.
* mln/README: Remove; obsolete file contents.
* mln/win/multiple.hh: Remove non-activate code.
(W): New static checks.
Copy to...
* mln/win/multiple_size.hh: ...this new file.
(size_around): Activate.
(multiple): Rename as...
(multiple_size): ...this new class.
(size_): Replace this attribute by...
(size_): ...this new method.
(change_target): Remove; useless.
(siae): Remove; obsolete.
(set_window): Remove no more valid tests.
* mln/win/all.hh: Update.
mln/core/concept/window.hh | 2
mln/make/double_neighb2d.hh | 4 -
mln/make/dual_neighb.hh | 94 ++++++++++++++++++++++++
mln/win/all.hh | 1
mln/win/multiple.hh | 33 ++------
mln/win/multiple_size.hh | 166 +++++++++++++++++++-------------------------
tests/Makefile.am | 1
tests/make/Makefile.am | 10 ++
tests/make/dual_neighb.cc | 65 +++++++++++++++++
9 files changed, 260 insertions(+), 116 deletions(-)
Index: tests/make/dual_neighb.cc
--- tests/make/dual_neighb.cc (revision 0)
+++ tests/make/dual_neighb.cc (revision 0)
@@ -0,0 +1,65 @@
+// Copyright (C) 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
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License. This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+/*! \file tests/make/dual_neighb.cc
+ *
+ * \brief Tests on mln::make::dual_neighb.
+ */
+
+#include <mln/make/dual_neighb.hh>
+#include <mln/core/alias/neighb2d.hh>
+#include <mln/core/image/image2d.hh>
+
+
+
+template <typename I, typename N>
+unsigned count(const I& ima, const N& nbh)
+{
+ mln_piter(I) p(ima.domain());
+ mln_niter(N) n(nbh, p);
+ unsigned c = 0;
+ for_all(p)
+ for_all(n)
+ { std::cout << n << std::endl; ++c; }
+ return c;
+}
+
+
+int main()
+{
+ using namespace mln;
+
+ image2d<bool> ima(1, 2, 1);
+ ima.at(0, 0) = true;
+ ima.at(0, 1) = false;
+
+ mln_assertion( count(ima, make::dual_neighb(ima, c4(), c8()))
+ == c4().size() + c8().size() );
+
+ // We can observe that the neighboord is not restricted by the
+ // respective domains defined by ima(p) == false and true.
+}
Index: tests/make/Makefile.am
--- tests/make/Makefile.am (revision 0)
+++ tests/make/Makefile.am (revision 0)
@@ -0,0 +1,10 @@
+## Process this file through Automake to create Makefile.in -*- Makefile -*-
+
+include $(top_srcdir)/milena/tests/tests.mk
+
+check_PROGRAMS = \
+ dual_neighb
+
+dual_neighb_SOURCES = dual_neighb.cc
+
+TESTS = $(check_PROGRAMS)
Index: tests/Makefile.am
--- tests/Makefile.am (revision 2504)
+++ tests/Makefile.am (working copy)
@@ -25,6 +25,7 @@
linear \
literal \
logical \
+ make \
math \
metal \
morpho \
Index: mln/core/concept/window.hh
--- mln/core/concept/window.hh (revision 2504)
+++ mln/core/concept/window.hh (working copy)
@@ -32,6 +32,8 @@
* \brief Definition of the concept of mln::Window.
*
* \todo Operator== should test if the cmp is possible.
+ *
+ * \todo Add an is_valid() method.
*/
# include <mln/core/concept/object.hh>
Index: mln/make/dual_neighb.hh
--- mln/make/dual_neighb.hh (revision 0)
+++ mln/make/dual_neighb.hh (revision 0)
@@ -0,0 +1,94 @@
+// Copyright (C) 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
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License. This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+#ifndef MLN_MAKE_DUAL_NEIGHB_HH
+# define MLN_MAKE_DUAL_NEIGHB_HH
+
+/*! \file mln/make/dual_neighb.hh
+ *
+ * \brief Routine to create a dual neighborhood.
+ */
+
+# include <mln/core/concept/image.hh>
+# include <mln/core/concept/neighborhood.hh>
+# include <mln/pw/value.hh>
+# include <mln/win/multiple_size.hh>
+# include <mln/core/neighb.hh>
+
+
+namespace mln
+{
+
+ namespace make
+ {
+
+ template <typename I, typename N>
+ neighb< win::multiple_size< mln_window(N), pw::value_<I> > >
+ dual_neighb(const Image<I>& ima,
+ const Neighborhood<N>& nbh_true,
+ const Neighborhood<N>& nbh_false);
+
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+
+ template <typename I, typename N>
+ inline
+ neighb< win::multiple_size< mln_window(N), pw::value_<I> > >
+ dual_neighb(const Image<I>& ima_,
+ const Neighborhood<N>& nbh_true_,
+ const Neighborhood<N>& nbh_false_)
+ {
+ trace::entering("make::dual_neighb");
+
+ mlc_is(mln_trait_image_kind(I), trait::image::kind::logic)::check();
+
+ const I& ima = exact(ima_);
+ const N& nbh_true = exact(nbh_true_);
+ const N& nbh_false = exact(nbh_false_);
+ mln_precondition(ima.has_data());
+
+ typedef win::multiple_size< mln_window(N), pw::value_<I> > W;
+ W win(pw::value(ima));
+ win.set_window(false, nbh_false.win()); // 0
+ win.set_window(true, nbh_true .win()); // 1
+
+ neighb<W> nbh(win);
+
+ trace::exiting("make::dual_neighb");
+ return nbh;
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::make
+
+} // end of namespace mln
+
+
+#endif // ! MLN_MAKE_DUAL_NEIGHB_HH
Index: mln/make/double_neighb2d.hh
--- mln/make/double_neighb2d.hh (revision 2504)
+++ mln/make/double_neighb2d.hh (working copy)
@@ -30,7 +30,9 @@
/*! \file mln/make/double_neighb2d.hh
*
- * \brief Routine to create a dual neighborhood.
+ * \brief Routine to create a double neighborhood.
+ *
+ * \todo Add overload with 'when_*' being Neighborhood<N>...
*/
# include <mln/convert/to.hh>
Index: mln/win/multiple_size.hh
--- mln/win/multiple_size.hh (revision 2504)
+++ mln/win/multiple_size.hh (working copy)
@@ -25,12 +25,12 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_WIN_MULTIPLE_HH
-# define MLN_WIN_MULTIPLE_HH
+#ifndef MLN_WIN_MULTIPLE_SIZE_HH
+# define MLN_WIN_MULTIPLE_SIZE_HH
-/*! \file mln/win/multiple.hh
+/*! \file mln/win/multiple_size.hh
*
- * \brief Definition of a multiple window.
+ * \brief Definition of a multiple-size window.
*/
# include <mln/core/internal/window_base.hh>
@@ -45,8 +45,8 @@
// Forward declarations.
namespace win
{
- template <typename W, typename F> class multiple;
- template <typename W, typename F> class multiple_qiter;
+ template <typename W, typename F> class multiple_size;
+ template <typename W, typename F> class multiple_size_qiter;
}
@@ -55,9 +55,9 @@
{
template <typename W, typename F>
- struct window_< win::multiple<W,F> >
+ struct window_< win::multiple_size<W,F> >
{
- typedef trait::window::size::fixed size;
+ typedef trait::window::size::unknown size;
typedef trait::window::support::regular support;
typedef trait::window::definition::n_ary definition;
};
@@ -70,7 +70,14 @@
{
template <typename W, typename F>
- class multiple : public internal::window_base< mln_dpsite(W), multiple<W,F> >
+ class multiple_size
+
+ : public internal::window_base< mln_dpsite(W), multiple_size<W,F> >,
+
+ private metal::and_< mlc_is(mln_trait_window_size(W),
+ trait::window::size::fixed),
+ mlc_is(mln_trait_window_support(W),
+ trait::window::support::regular) >::check_t
{
public:
@@ -78,17 +85,17 @@
typedef mln_psite(W) psite;
typedef mln_site(W) site;
- typedef multiple< window<dpsite>, F > regular;
+ typedef multiple_size< window<dpsite>, F > regular;
- typedef multiple_qiter<W,F> fwd_qiter;
- typedef multiple_qiter<W,F> bkd_qiter;
- typedef multiple_qiter<W,F> qiter;
+ typedef multiple_size_qiter<W,F> fwd_qiter;
+ typedef multiple_size_qiter<W,F> bkd_qiter;
+ typedef multiple_size_qiter<W,F> qiter;
typedef W element;
- multiple();
+ multiple_size();
- multiple(const F& f);
+ multiple_size(const F& f);
bool is_empty() const;
@@ -100,9 +107,7 @@
const F& function() const;
- unsigned size() const;
-
-// unsigned size_around(const mln_psite(W)& p) const;
+ unsigned size_around(const mln_psite(W)& p) const;
const mln_dpsite(W)& ith_dp_around(unsigned i, const mln_psite(W)& p) const;
@@ -122,20 +127,18 @@
template <typename W, typename F>
- class multiple_qiter
- : public internal::site_relative_iterator_base< multiple<W,F>,
- multiple_qiter<W,F> >
+ class multiple_size_qiter
+ : public internal::site_relative_iterator_base< multiple_size<W,F>,
+ multiple_size_qiter<W,F> >
{
- typedef multiple_qiter<W,F> self_;
- typedef internal::site_relative_iterator_base< multiple<W,F>, self_ > super_;
+ typedef multiple_size_qiter<W,F> self_;
+ typedef internal::site_relative_iterator_base< multiple_size<W,F>, self_ > super_;
public:
- multiple_qiter();
+ multiple_size_qiter();
template <typename P>
- multiple_qiter(const multiple<W,F>& w, const P& c);
-
- void change_target(const multiple<W,F>& w); // Overridden to initialize size_.
+ multiple_size_qiter(const multiple_size<W,F>& w, const P& c);
/// Test the iterator validity.
bool is_valid_() const;
@@ -154,26 +157,25 @@
private:
unsigned i_;
- unsigned size_;
-// unsigned n_() const;
+ unsigned size_() const;
};
# ifndef MLN_INCLUDE_ONLY
- // win::multiple<W,F>
+ // win::multiple_size<W,F>
template <typename W, typename F>
inline
- multiple<W,F>::multiple()
+ multiple_size<W,F>::multiple_size()
: f_()
{
}
template <typename W, typename F>
inline
- multiple<W,F>::multiple(const F& f)
+ multiple_size<W,F>::multiple_size(const F& f)
: f_(f)
{
}
@@ -181,7 +183,7 @@
template <typename W, typename F>
inline
bool
- multiple<W,F>::is_empty() const
+ multiple_size<W,F>::is_empty() const
{
return win_.is_empty();
}
@@ -189,18 +191,16 @@
template <typename W, typename F>
inline
void
- multiple<W,F>::set_window(unsigned i, const W& win)
+ multiple_size<W,F>::set_window(unsigned i, const W& win)
{
mln_precondition(i == win_.nelements());
- if (i >= 1)
- mln_precondition(win.size() == win_[0].size());
win_.append(win);
}
template <typename W, typename F>
inline
const W&
- multiple<W,F>::window(unsigned i) const
+ multiple_size<W,F>::window(unsigned i) const
{
mln_precondition(i < win_.nelements());
return win_[i];
@@ -209,7 +209,7 @@
template <typename W, typename F>
inline
unsigned
- multiple<W,F>::nwindows() const
+ multiple_size<W,F>::nwindows() const
{
return win_.nelements();
}
@@ -217,27 +217,15 @@
template <typename W, typename F>
inline
const F&
- multiple<W,F>::function() const
+ multiple_size<W,F>::function() const
{
return f_;
}
template <typename W, typename F>
inline
- unsigned
- multiple<W,F>::size() const
- {
- mln_precondition(win_.nelements() >= 2); // Multiple cannot be just 1 element.
- unsigned s = win_[0].size();
- for (unsigned i = 1; i < win_.nelements(); ++i)
- mln_precondition(win_[i].size() == s);
- return s;
- }
-
- template <typename W, typename F>
- inline
bool
- multiple<W,F>::is_centered() const
+ multiple_size<W,F>::is_centered() const
{
mln_precondition(win_.nelements() >= 1);
for (unsigned i = 0; i < win_.nelements(); ++i)
@@ -249,7 +237,7 @@
template <typename W, typename F>
inline
bool
- multiple<W,F>::is_symmetric() const
+ multiple_size<W,F>::is_symmetric() const
{
mln_precondition(win_.nelements() >= 1);
for (unsigned i = 0; i < win_.nelements(); ++i)
@@ -258,11 +246,10 @@
return true;
}
-
template <typename W, typename F>
inline
void
- multiple<W,F>::sym()
+ multiple_size<W,F>::sym()
{
mln_precondition(win_.nelements() >= 1);
for (unsigned i = 0; i < win_.nelements(); ++i)
@@ -272,7 +259,7 @@
template <typename W, typename F>
inline
unsigned
- multiple<W,F>::delta() const
+ multiple_size<W,F>::delta() const
{
mln_precondition(win_.nelements() >= 1);
unsigned d = win_[0].delta();
@@ -285,74 +272,67 @@
return d;
}
-// template <typename W, typename F>
-// inline
-// unsigned
-// multiple<W,F>::size_around(const mln_psite(W)& p) const
-// {
-// mln_precondition(f_(p) < win_.nelements());
-// return win_[f_(p)].size();
-// }
+ template <typename W, typename F>
+ inline
+ unsigned
+ multiple_size<W,F>::size_around(const mln_psite(W)& p) const
+ {
+ mln_precondition(win_.nelements() >= 2);
+ mln_precondition(f_(p) < win_.nelements());
+ return win_[f_(p)].size();
+ }
template <typename W, typename F>
inline
const mln_dpsite(W)&
- multiple<W,F>::ith_dp_around(unsigned i, const mln_psite(W)& p) const
+ multiple_size<W,F>::ith_dp_around(unsigned i, const mln_psite(W)& p) const
{
+ mln_precondition(win_.nelements() >= 2);
mln_precondition(f_(p) < win_.nelements());
mln_precondition(i < win_[f_(p)].size());
return win_[f_(p)].dp(i);
}
- // win::multiple_qiter<W,F>
+ // win::multiple_size_qiter<W,F>
template <typename W, typename F>
inline
- multiple_qiter<W,F>::multiple_qiter()
+ multiple_size_qiter<W,F>::multiple_size_qiter()
{
}
template <typename W, typename F>
template <typename P>
inline
- multiple_qiter<W,F>::multiple_qiter(const multiple<W,F>& w, const P& c)
+ multiple_size_qiter<W,F>::multiple_size_qiter(const multiple_size<W,F>& w, const P& c)
{
this->center_at(c);
// We have to first change the center so that 'invalidate' can
// work when changing the target.
- change_target(w);
- }
-
- template <typename W, typename F>
- inline
- void
- multiple_qiter<W,F>::change_target(const multiple<W,F>& w)
- {
- this->super_::change_target(w);
- size_ = w.size();
+ this->change_target(w);
}
template <typename W, typename F>
inline
bool
- multiple_qiter<W,F>::is_valid_() const
+ multiple_size_qiter<W,F>::is_valid_() const
{
- return i_ < size_;
+ return i_ < size_();
}
template <typename W, typename F>
inline
void
- multiple_qiter<W,F>::invalidate_()
+ multiple_size_qiter<W,F>::invalidate_()
{
- i_ = size_;
+ i_ = size_();
}
template <typename W, typename F>
inline
void
- multiple_qiter<W,F>::do_start_()
+ multiple_size_qiter<W,F>::do_start_()
{
i_ = 0;
}
@@ -360,7 +340,7 @@
template <typename W, typename F>
inline
void
- multiple_qiter<W,F>::do_next_()
+ multiple_size_qiter<W,F>::do_next_()
{
++i_;
}
@@ -368,18 +348,18 @@
template <typename W, typename F>
inline
mln_psite(W)
- multiple_qiter<W,F>::compute_p_() const
+ multiple_size_qiter<W,F>::compute_p_() const
{
return *this->c_ + this->s_->ith_dp_around(i_, *this->c_);
}
-// template <typename W, typename F>
-// inline
-// unsigned
-// multiple_qiter<W,F>::size_() const
-// {
-// return this->s_->size_around(*this->c_);
-// }
+ template <typename W, typename F>
+ inline
+ unsigned
+ multiple_size_qiter<W,F>::size_() const
+ {
+ return this->s_->size_around(*this->c_);
+ }
# endif // ! MLN_INCLUDE_ONLY
@@ -389,4 +369,4 @@
} // end of namespace mln
-#endif // ! MLN_WIN_MULTIPLE_HH
+#endif // ! MLN_WIN_MULTIPLE_SIZE_HH
Index: mln/win/multiple.hh
--- mln/win/multiple.hh (revision 2504)
+++ mln/win/multiple.hh (working copy)
@@ -31,6 +31,8 @@
/*! \file mln/win/multiple.hh
*
* \brief Definition of a multiple window.
+ *
+ * \todo Implementation of the bkd_qiter (see FIXME).
*/
# include <mln/core/internal/window_base.hh>
@@ -70,7 +72,14 @@
{
template <typename W, typename F>
- class multiple : public internal::window_base< mln_dpsite(W), multiple<W,F> >
+ class multiple
+
+ : public internal::window_base< mln_dpsite(W), multiple<W,F> >,
+
+ private metal::and_< mlc_is(mln_trait_window_size(W),
+ trait::window::size::fixed),
+ mlc_is(mln_trait_window_support(W),
+ trait::window::support::regular) >::check_t
{
public:
@@ -81,7 +90,7 @@
typedef multiple< window<dpsite>, F > regular;
typedef multiple_qiter<W,F> fwd_qiter;
- typedef multiple_qiter<W,F> bkd_qiter;
+ typedef /* FIXME: */ multiple_qiter<W,F> bkd_qiter;
typedef multiple_qiter<W,F> qiter;
typedef W element;
@@ -102,8 +111,6 @@
unsigned size() const;
-// unsigned size_around(const mln_psite(W)& p) const;
-
const mln_dpsite(W)& ith_dp_around(unsigned i, const mln_psite(W)& p) const;
bool is_centered() const;
@@ -155,7 +162,6 @@
private:
unsigned i_;
unsigned size_;
-// unsigned n_() const;
};
@@ -285,15 +291,6 @@
return d;
}
-// template <typename W, typename F>
-// inline
-// unsigned
-// multiple<W,F>::size_around(const mln_psite(W)& p) const
-// {
-// mln_precondition(f_(p) < win_.nelements());
-// return win_[f_(p)].size();
-// }
-
template <typename W, typename F>
inline
const mln_dpsite(W)&
@@ -373,14 +370,6 @@
return *this->c_ + this->s_->ith_dp_around(i_, *this->c_);
}
-// template <typename W, typename F>
-// inline
-// unsigned
-// multiple_qiter<W,F>::size_() const
-// {
-// return this->s_->size_around(*this->c_);
-// }
-
# endif // ! MLN_INCLUDE_ONLY
Index: mln/win/all.hh
--- mln/win/all.hh (revision 2504)
+++ mln/win/all.hh (working copy)
@@ -53,6 +53,7 @@
# include <mln/win/hline2d.hh>
# include <mln/win/line.hh>
# include <mln/win/multiple.hh>
+# include <mln/win/multiple_size.hh>
# include <mln/win/octagon2d.hh>
# include <mln/win/rectangle2d.hh>
# include <mln/win/segment1d.hh>
1
0
URL: https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008
ChangeLog:
2008-10-03 Guillaume Lazzara <z(a)lrde.epita.fr>
Various small fixes.
* milena/mln/algebra/vec.hh: add missing header.
* milena/mln/core/image/obased_rle_image.hh,
* milena/mln/core/image/rle_image.hh: Use pruns.
* milena/mln/core/image/obased_rle_image.hh,
* milena/mln/core/image/t_image.hh: add missing init_ function.
* milena/mln/core/image/tr_image.hh,
* milena/tests/core/alias/point1d.cc,
* milena/tests/core/alias/point2d.cc: cleanup.
* milena/tests/core/image/Makefile.am: Disable known broken test
such as graph related tests.
* milena/tests/core/image/tr_image.cc: make it compile.
---
mln/algebra/vec.hh | 1
mln/core/image/obased_rle_image.hh | 45 +++++++++++++++++++++++--------------
mln/core/image/rle_image.hh | 12 ++++-----
mln/core/image/t_image.hh | 14 +++++++++++
mln/core/image/tr_image.hh | 23 +++++++-----------
tests/core/alias/point1d.cc | 1
tests/core/alias/point2d.cc | 2 -
tests/core/image/Makefile.am | 20 ++++++++--------
tests/core/image/tr_image.cc | 13 ++++++----
9 files changed, 76 insertions(+), 55 deletions(-)
Index: branches/cleanup-2008/milena/tests/core/image/Makefile.am
===================================================================
--- branches/cleanup-2008/milena/tests/core/image/Makefile.am (revision 2503)
+++ branches/cleanup-2008/milena/tests/core/image/Makefile.am (revision 2504)
@@ -17,13 +17,13 @@
image_if \
## interpolated \
line_graph_image \
- mono_obased_rle_image \
- mono_rle_image \
- obased_rle_image \
+## mono_obased_rle_image \
+## mono_rle_image \
+## obased_rle_image \
plain \
- rle_image \
+## rle_image \
safe_image \
- sparse_image \
+## sparse_image \
sub_image \
t_image \
tr_image \
@@ -44,13 +44,13 @@
image_if_SOURCES = image_if.cc
##interpolated_SOURCES = interpolated.cc
line_graph_image_SOURCES = line_graph_image.cc
-mono_obased_rle_image_SOURCES = mono_obased_rle_image.cc
-mono_rle_image_SOURCES = mono_rle_image.cc
-obased_rle_image_SOURCES = obased_rle_image.cc
+##mono_obased_rle_image_SOURCES = mono_obased_rle_image.cc
+##mono_rle_image_SOURCES = mono_rle_image.cc
+##obased_rle_image_SOURCES = obased_rle_image.cc
plain_SOURCES = plain.cc
-rle_image_SOURCES = rle_image.cc
+##rle_image_SOURCES = rle_image.cc
safe_image_SOURCES = safe_image.cc
-sparse_image_SOURCES = sparse_image.cc
+##sparse_image_SOURCES = sparse_image.cc
sub_image_SOURCES = sub_image.cc
t_image_SOURCES = t_image.cc
tr_image_SOURCES = tr_image.cc
Index: branches/cleanup-2008/milena/tests/core/image/tr_image.cc
===================================================================
--- branches/cleanup-2008/milena/tests/core/image/tr_image.cc (revision 2503)
+++ branches/cleanup-2008/milena/tests/core/image/tr_image.cc (revision 2504)
@@ -32,7 +32,7 @@
#include <iostream>
-#include <mln/fun/x2x/rotation.hh>
+#include <mln/fun/x2x/geom/rotation.hh>
#include <mln/core/image/image3d.hh>
#include <mln/value/int_u8.hh>
#include <mln/core/image/tr_image.hh>
@@ -50,16 +50,19 @@
debug::iota(in);
debug::println(in);
- fun::x2x::rotation<3,float> rot1(1.67, 0);
+ fun::x2x::geom::rotation<3,float> rot1(1.67, literal::zero);
- tr_image<fun::x2x::rotation<3,float>, image3d<int_u8> > inter(in, rot1);
+ tr_image<mln_pset_(image3d<int_u8>),
+ image3d<int_u8>,
+ fun::x2x::geom::rotation<3,float> >
+ inter(out.domain(), in, rot1);
image3d<int_u8>::fwd_piter p(out.domain());
for_all(p)
{
- algebra::vec<3,int> vec = (image3d<int_u8>::point)p;
- if (inter.has(vec))
+ algebra::vec<3,int> vec = p.to_site().to_vec();
+ if (inter.has(p))
out(p) = inter(vec);
else
out(p) = 255;
Index: branches/cleanup-2008/milena/tests/core/alias/point1d.cc
===================================================================
--- branches/cleanup-2008/milena/tests/core/alias/point1d.cc (revision 2503)
+++ branches/cleanup-2008/milena/tests/core/alias/point1d.cc (revision 2504)
@@ -44,7 +44,6 @@
p[0] = 4;
algebra::vec<1,def::coord> v = p;
- std::cout << v << std::endl;
p.ind() += 1;
mln_assertion(p.ind() == 5 && p[0] == 5);
Index: branches/cleanup-2008/milena/tests/core/alias/point2d.cc
===================================================================
--- branches/cleanup-2008/milena/tests/core/alias/point2d.cc (revision 2503)
+++ branches/cleanup-2008/milena/tests/core/alias/point2d.cc (revision 2504)
@@ -73,6 +73,4 @@
q.set_all(0);
for (unsigned i = 0; i < p.dim; ++i)
mln_assertion(q[i] == 0);
-
- std::cout << 3.4 * algebra::vec<2, def::coord>(p) << std::endl;
}
Index: branches/cleanup-2008/milena/mln/core/image/obased_rle_image.hh
===================================================================
--- branches/cleanup-2008/milena/mln/core/image/obased_rle_image.hh (revision 2503)
+++ branches/cleanup-2008/milena/mln/core/image/obased_rle_image.hh (revision 2504)
@@ -34,8 +34,8 @@
*/
# include <mln/core/internal/run_image.hh>
-# include <mln/core/p_runs.hh>
-# include <mln/core/runs_psite.hh>
+# include <mln/core/site_set/p_run.hh>
+# include <mln/core/site_set/p_set_of.hh>
# include <mln/core/site_set/box.hh>
# include <mln/value/set.hh>
# include <vector>
@@ -52,9 +52,9 @@
/// Data structure for \c mln::obased_rle_image<P,T>.
template <typename P, typename T>
- struct data_< obased_rle_image<P,T> >
+ struct data< obased_rle_image<P,T> >
{
- data_(const std::set<T>& values);
+ data(const std::set<T>& values);
/// Objects.
std::vector< std::vector<unsigned> > obj_;
@@ -69,7 +69,7 @@
std::vector<T> values_;
/// domain of the image
- p_runs_<P> domain_;
+ p_set_of< p_run<P> > domain_;
/// Return the size of the data in memory.
unsigned memory_size() const;
@@ -118,24 +118,27 @@
typedef T value;
typedef T& lvalue;
typedef const T rvalue;
- typedef runs_psite<P> psite;
- typedef p_runs_<P> pset;
+ typedef p_set_of< p_run<P> > pset;
+ typedef mln_psite(pset) psite;
/// Skeleton.
typedef obased_rle_image< tag::psite_<P>, tag::value_<T> > skeleton;
-
+ /// Constructor
obased_rle_image(const std::set<T>& values);
+ /// Initialize an empty image
+ void init_(const std::set<T>& values);
+
/// Add a new range to the image.
void insert(const p_run<P>& pr, T value);
/// Read-only access to the image value located at point \p p.
- rvalue operator() (const runs_psite<P>& site) const;
+ rvalue operator() (const mln_psite(pset)& site) const;
/// Read-write access to the image value located at point \p p.
- lvalue operator() (const runs_psite<P>& site);
+ lvalue operator() (const mln_psite(pset)& site);
/// Test if this image has been initialized.
bool has_data() const;
@@ -176,7 +179,7 @@
{
return domain_.memory_size() + bbox_.size()
* (sizeof(T) + sizeof(box<P>) + sizeof(std::vector<unsigned>))
- + (sizeof(unsigned) + sizeof(T)) * domain_.nruns();
+ + (sizeof(unsigned) + sizeof(T)) * domain_.nsites();
}
template <typename P, typename T>
@@ -193,7 +196,15 @@
inline
obased_rle_image<P, T>::obased_rle_image(const std::set<T>& values)
{
- this->data_ = new internal::data_< obased_rle_image<P,T> >(values);
+ init_(values);
+ }
+
+ template <typename P, typename T>
+ inline
+ void
+ obased_rle_image<P, T>::init_(const std::set<T>& values)
+ {
+ this->data_ = new internal::data< obased_rle_image<P,T> >(values);
}
template <typename P, typename T>
@@ -209,8 +220,8 @@
void
obased_rle_image<P, T>::insert(const p_run<P>& pr, T value)
{
- mln_assertion(this->data_->v_obj_.size() == 0 || this->data_->domain_.nruns() == 0 ||
- pr.first() > this->data_->domain_[this->data_->domain_.nruns() - 1].first());
+ mln_assertion(this->data_->v_obj_.size() == 0 || this->data_->domain_.nsites() == 0 ||
+ pr[0] > this->data_->domain_[this->data_->domain_.nsites() - 1].start());
this->data_->domain_.insert(pr);
this->data_->values_.push_back(value);
unsigned i;
@@ -218,7 +229,7 @@
&& this->data_->v_obj_[i] != value; ++i)
;
mln_assertion(i != this->data_->v_obj_.size());
- this->data_->obj_[i].push_back(this->data_->domain_.nruns() - 1);
+ this->data_->obj_[i].push_back(this->data_->domain_.nsites() - 1);
this->data_->bbox_[i].take(pr.bbox().pmin());
this->data_->bbox_[i].take(pr.bbox().pmax());
}
@@ -226,7 +237,7 @@
template <typename P, typename T>
inline
typename obased_rle_image<P, T>::rvalue
- obased_rle_image<P, T>::operator() (const runs_psite<P>& site)
+ obased_rle_image<P, T>::operator() (const mln_psite(pset)& site)
const
{
mln_precondition(this->has(site));
@@ -236,7 +247,7 @@
template <typename P, typename T>
inline
typename obased_rle_image<P, T>::lvalue
- obased_rle_image<P, T>::operator() (const runs_psite<P>& site)
+ obased_rle_image<P, T>::operator() (const mln_psite(pset)& site)
{
mln_precondition(this->has(site));
return this->data_->values_[site.index()];
Index: branches/cleanup-2008/milena/mln/core/image/rle_image.hh
===================================================================
--- branches/cleanup-2008/milena/mln/core/image/rle_image.hh (revision 2503)
+++ branches/cleanup-2008/milena/mln/core/image/rle_image.hh (revision 2504)
@@ -115,17 +115,17 @@
/// Skeleton.
typedef rle_image< tag::psite_<P>, tag::value_<T> > skeleton;
-
+ /// Constructor.
rle_image();
/// Add a new range to the image.
void insert(const p_run<P>& pr, T value);
/// Read-only access to the image value located at point \p p.
- rvalue operator() (const runs_psite<P>& site) const;
+ rvalue operator() (const mln_psite(pset)& site) const;
/// Read-write access to the image value located at point \p p.
- lvalue operator() (const runs_psite<P>& site);
+ lvalue operator() (const mln_psite(pset)& site);
/// Test if this image has been initialized.
bool has_data() const;
@@ -190,7 +190,7 @@
if (!this->has_data())
this->data_ = new internal::data< rle_image<P,T> >();
mln_assertion(this->data_->values_.size() == 0 ||
- pr.first() > this->data_->domain_[this->data_->domain_.nruns() - 1].first());
+ pr[0] > this->data_->domain_[this->data_->domain_.nsites() - 1].start());
this->data_->domain_.insert(pr);
this->data_->values_.push_back(value);
}
@@ -198,7 +198,7 @@
template <typename P, typename T>
inline
typename rle_image<P, T>::rvalue
- rle_image<P, T>::operator() (const runs_psite<P>& site)
+ rle_image<P, T>::operator() (const mln_psite(pset)& site)
const
{
mln_precondition(this->has(site));
@@ -208,7 +208,7 @@
template <typename P, typename T>
inline
typename rle_image<P, T>::lvalue
- rle_image<P, T>::operator() (const runs_psite<P>& site)
+ rle_image<P, T>::operator() (const mln_psite(pset)& site)
{
mln_precondition(this->has(site));
return this->data_->values_[site.index()];
Index: branches/cleanup-2008/milena/mln/core/image/tr_image.hh
===================================================================
--- branches/cleanup-2008/milena/mln/core/image/tr_image.hh (revision 2503)
+++ branches/cleanup-2008/milena/mln/core/image/tr_image.hh (revision 2504)
@@ -51,7 +51,7 @@
namespace internal
{
- /// Data structure for \c mln::tr_image<T,I>.
+ /// Data structure for \c mln::tr_image<S,I,T>.
template <typename S, typename I, typename T>
struct data< tr_image<S,I,T> >
{
@@ -117,7 +117,7 @@
if we do not provide set_ima(). */
tr_image();
-
+ /// Initialize an empty image.
void init_(const S& s, I& ima, const T& tr);
/// Test if this image has been initialized.
@@ -163,13 +163,13 @@
inline
tr_image<S,I,T>::tr_image(const S& s, I& ima, const T& tr)
{
- mln_precondition(ima.has_data());
- this->data_ = new internal::data< tr_image<S,I,T> >(s, ima, tr);
+ init_(s, ima, tr);
}
template <typename S, typename I, typename T>
inline
- void tr_image<S,I,T>::init_(const S& s, I& ima, const T& tr)
+ void
+ tr_image<S,I,T>::init_(const S& s, I& ima, const T& tr)
{
mln_precondition(ima.has_data());
this->data_ = new internal::data< tr_image<S,I,T> >(s, ima, tr);
@@ -177,13 +177,8 @@
template <typename S, typename I, typename T>
inline
- tr_image<S,I,T>::tr_image()
- {
- }
-
- template <typename S, typename I, typename T>
- inline
- bool tr_image<S,I,T>::has_data() const
+ bool
+ tr_image<S,I,T>::has_data() const
{
mln_invariant(this->delegatee_()->has_data());
return true;
@@ -191,7 +186,8 @@
template <typename S, typename I, typename T>
inline
- bool tr_image<S,I,T>::has(const algebra::vec<I::psite::dim, float>& v) const
+ bool
+ tr_image<S,I,T>::has(const algebra::vec<I::psite::dim, float>& v) const
{
mln_psite(I) p;
algebra::vec<I::point::dim, float> v2 = this->data_->tr_.inv()(v);
@@ -215,7 +211,6 @@
mln_value(I)
tr_image<S,I,T>::operator()(const psite& p)
{
- std::cout << "yay" << std::endl;
algebra::vec<I::psite::dim, float> v = p;
return this->data_->ima_(this->data_->tr_.inv()(v));
}
Index: branches/cleanup-2008/milena/mln/core/image/t_image.hh
===================================================================
--- branches/cleanup-2008/milena/mln/core/image/t_image.hh (revision 2503)
+++ branches/cleanup-2008/milena/mln/core/image/t_image.hh (revision 2504)
@@ -119,6 +119,11 @@
/// \param dim2 The second dimension to be swapped.
t_image(I& ima, unsigned dim1, unsigned dim2);
+
+ /// Initialize an empty image.
+ void init_(I& ima, unsigned dim1, unsigned dim2);
+
+
/// Test if this image has been initialized.
bool has_data() const;
@@ -182,6 +187,14 @@
inline
t_image<I>::t_image(I& ima, unsigned dim1, unsigned dim2)
{
+ init_(ima, dim1, dim2);
+ }
+
+ template <typename I>
+ inline
+ void
+ t_image<I>::init_(I& ima, unsigned dim1, unsigned dim2)
+ {
mln_precondition(ima.has_data());
/* FIXME: Add a precondition on the fact that the domain of ima is
a box. */
@@ -193,6 +206,7 @@
this->data_ = new internal::data< t_image<I> >(ima, dim1, dim2, box);
}
+
template <typename I>
inline
bool t_image<I>::has_data() const
Index: branches/cleanup-2008/milena/mln/algebra/vec.hh
===================================================================
--- branches/cleanup-2008/milena/mln/algebra/vec.hh (revision 2503)
+++ branches/cleanup-2008/milena/mln/algebra/vec.hh (revision 2504)
@@ -39,6 +39,7 @@
# include <mln/core/concept/object.hh>
+# include <mln/literal/zero.hh>
# include <mln/trait/all.hh>
# include <mln/trait/value_.hh>
# include <mln/fun/i2v/all_to.hh>
1
0