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
https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Fix typo.
* mln/core/pset_array.hh,
* mln/core/dpoints_piter.hh,
* mln/core/decorated_image.hh,
* mln/core/image_if.hh,
* mln/core/line_piter.hh,
* mln/core/image_if_interval.hh,
* mln/core/safe.hh,
* mln/core/concept/doc/value_iterator.hh,
* mln/core/concept/doc/point_iterator.hh,
* mln/core/plain.hh,
* mln/core/p_runs.hh,
* mln/value/proxy.hh,
* mln/value/graylevel.hh,
* mln/value/graylevel_f.hh,
* mln/value/internal/gray_.hh,
* mln/value/internal/gray_f.hh,
* mln/value/viter.hh,
* mln/value/float01.hh,
* mln/value/label.hh,
* mln/convert/all.hh,
* mln/util/branch_iter_ind.hh,
* mln/util/branch_iter.hh,
* sandbox/pellegrin/set/core/p_runs.hh,
* sandbox/geraud/cs2d/dbl_neighb.hh,
* sandbox/geraud/cs2d/cs2d_morpho.hh (convertion): Fix typo.
mln/convert/all.hh | 4 ++--
mln/core/concept/doc/point_iterator.hh | 2 +-
mln/core/concept/doc/value_iterator.hh | 2 +-
mln/core/decorated_image.hh | 2 +-
mln/core/dpoints_piter.hh | 4 ++--
mln/core/image_if.hh | 2 +-
mln/core/image_if_interval.hh | 2 +-
mln/core/line_piter.hh | 2 +-
mln/core/p_runs.hh | 6 +++---
mln/core/plain.hh | 2 +-
mln/core/pset_array.hh | 4 ++--
mln/core/safe.hh | 2 +-
mln/util/branch_iter.hh | 2 +-
mln/util/branch_iter_ind.hh | 2 +-
mln/value/float01.hh | 2 +-
mln/value/graylevel.hh | 2 +-
mln/value/graylevel_f.hh | 2 +-
mln/value/internal/gray_.hh | 4 ++--
mln/value/internal/gray_f.hh | 6 +++---
mln/value/label.hh | 2 +-
mln/value/proxy.hh | 8 ++++----
mln/value/viter.hh | 4 ++--
sandbox/geraud/cs2d/cs2d_morpho.hh | 2 +-
sandbox/geraud/cs2d/dbl_neighb.hh | 2 +-
sandbox/pellegrin/set/core/p_runs.hh | 6 +++---
25 files changed, 39 insertions(+), 39 deletions(-)
Index: mln/core/pset_array.hh
--- mln/core/pset_array.hh (revision 2050)
+++ mln/core/pset_array.hh (working copy)
@@ -223,13 +223,13 @@
void next_();
- /// Convertion into a point.
+ /// Conversion into a point.
operator point () const;
/// Reference to the corresponding point.
const point& to_point() const;
- /// Convertion into a point-site.
+ /// Conversion into a point-site.
operator psite () const;
/// Access to the current point coordinates.
Index: mln/core/dpoints_piter.hh
--- mln/core/dpoints_piter.hh (revision 2050)
+++ mln/core/dpoints_piter.hh (working copy)
@@ -61,7 +61,7 @@
dpoints_fwd_piter(const Dps& dps, // FIXME: explicitly set_of_<D>?
const Point_Site<Pref>& p_ref);
- /// Convertion to point.
+ /// Conversion to point.
operator mln_point(D) () const;
/// Reference to the corresponding point.
@@ -119,7 +119,7 @@
dpoints_bkd_piter(const Dps& dps, // FIXME: explicitly set_of_<D>?
const Point_Site<Pref>& p_ref);
- /// Convertion to point.
+ /// Conversion to point.
operator mln_point(D) () const;
/// Reference to the corresponding point.
Index: mln/core/decorated_image.hh
--- mln/core/decorated_image.hh (revision 2050)
+++ mln/core/decorated_image.hh (working copy)
@@ -107,7 +107,7 @@
mln_value(I) read_(const mln_psite(I)& p) const;
- /// Const promotion via convertion.
+ /// Const promotion via conversion.
operator decorated_image<const I, D>() const;
/// Give the decoration.
Index: mln/core/image_if.hh
--- mln/core/image_if.hh (revision 2050)
+++ mln/core/image_if.hh (working copy)
@@ -107,7 +107,7 @@
/// Give the definition domain.
const pset_if<mln_pset(I), F>& domain() const;
- /// Const promotion via convertion.
+ /// Const promotion via conversion.
operator image_if<const I, F>() const;
};
Index: mln/core/line_piter.hh
--- mln/core/line_piter.hh (revision 2050)
+++ mln/core/line_piter.hh (working copy)
@@ -62,7 +62,7 @@
*/
line_piter_(const box_<P>& b);
- /// Convertion to point.
+ /// Conversion to point.
operator P() const;
/// Reference to the corresponding point.
Index: mln/core/image_if_interval.hh
--- mln/core/image_if_interval.hh (revision 2050)
+++ mln/core/image_if_interval.hh (working copy)
@@ -100,7 +100,7 @@
/// Constructor without argument.
image_if_interval();
- /// Const promotion via convertion.
+ /// Const promotion via conversion.
operator image_if_interval<const I>() const;
};
Index: mln/core/safe.hh
--- mln/core/safe.hh (revision 2050)
+++ mln/core/safe.hh (working copy)
@@ -82,7 +82,7 @@
typedef typename super_::lvalue lvalue;
lvalue operator()(const mln_psite(I)& p);
- /// Const promotion via convertion.
+ /// Const promotion via conversion.
operator safe_image<const I>() const;
};
Index: mln/core/concept/doc/value_iterator.hh
--- mln/core/concept/doc/value_iterator.hh (revision 2050)
+++ mln/core/concept/doc/value_iterator.hh (working copy)
@@ -46,7 +46,7 @@
*/
typedef void value;
- /*! \brief Convertion into a value.
+ /*! \brief Conversion into a value.
*
* \return A value.
*/
Index: mln/core/concept/doc/point_iterator.hh
--- mln/core/concept/doc/point_iterator.hh (revision 2050)
+++ mln/core/concept/doc/point_iterator.hh (working copy)
@@ -48,7 +48,7 @@
*/
typedef void psite;
- /*! \brief Convertion into a point-site.
+ /*! \brief Conversion into a point-site.
*
* \return A point site.
*/
Index: mln/core/plain.hh
--- mln/core/plain.hh (revision 2050)
+++ mln/core/plain.hh (working copy)
@@ -99,7 +99,7 @@
plain& operator=(const I& rhs);
- /// Convertion into an I image
+ /// Conversion into an I image
operator I () const;
};
Index: mln/core/p_runs.hh
--- mln/core/p_runs.hh (revision 2050)
+++ mln/core/p_runs.hh (working copy)
@@ -260,7 +260,7 @@
{
public:
- /// Convertion into a point.
+ /// Conversion into a point.
operator P () const;
/// Reference to the corresponding point.
@@ -362,7 +362,7 @@
/// Go to the next point.
void next_();
- /// Convertion into a point-site.
+ /// Conversion into a point-site.
operator runs_psite<P> () const;
protected:
@@ -479,7 +479,7 @@
/// Go to the next point.
void next_();
- /// Convertion into a point-site.
+ /// Conversion into a point-site.
operator runs_psite<P> () const;
protected:
Index: mln/value/proxy.hh
--- mln/value/proxy.hh (revision 2050)
+++ mln/value/proxy.hh (working copy)
@@ -102,11 +102,11 @@
template <typename II>
proxy<I>& operator=(const proxy<II>& rhs);
- /// Convertion (read access); general version.
+ /// Conversion (read access); general version.
template <typename V>
operator V() const;
- /// Convertion (read access); precise version.
+ /// Conversion (read access); precise version.
operator mln_value(I)() const;
/// Explicit read access.
@@ -140,11 +140,11 @@
/// Destructor.
~proxy();
- /// Convertion (read access); general version.
+ /// Conversion (read access); general version.
template <typename V>
operator V() const;
- /// Convertion (read access); precise version.
+ /// Conversion (read access); precise version.
operator mln_value(I)() const;
/// Explicit read access.
Index: mln/value/graylevel.hh
--- mln/value/graylevel.hh (revision 2050)
+++ mln/value/graylevel.hh (working copy)
@@ -236,7 +236,7 @@
// |gray|| |gray_f |gray_f |gray_f |
// |--------------------------------------------|
- // Valid Convertions are :
+ // Valid Conversions are :
// gray_f -> gray_<n>
// gray_f -> graylevel<n>
Index: mln/value/graylevel_f.hh
--- mln/value/graylevel_f.hh (revision 2050)
+++ mln/value/graylevel_f.hh (working copy)
@@ -233,7 +233,7 @@
graylevel_f& operator=(const literal::white_t&);
/// \}
- /// Convertion to graylevel<n>.
+ /// Conversion to graylevel<n>.
template <unsigned n>
operator graylevel<n>() const;
Index: mln/value/internal/gray_.hh
--- mln/value/internal/gray_.hh (revision 2050)
+++ mln/value/internal/gray_.hh (working copy)
@@ -170,11 +170,11 @@
template <unsigned m>
operator gray_<m>() const;
- /// Convertion to graylevel.
+ /// Conversion to graylevel.
template <unsigned m>
operator graylevel<m>() const;
- /// Convertion to graylevel_f.
+ /// Conversion to graylevel_f.
operator graylevel_f() const;
};
Index: mln/value/internal/gray_f.hh
--- mln/value/internal/gray_f.hh (revision 2050)
+++ mln/value/internal/gray_f.hh (working copy)
@@ -177,15 +177,15 @@
gray_f& operator=(const graylevel_f& val);
/// \}
- /// Convertion to graylevel<n>
+ /// Conversion to graylevel<n>
template <unsigned m>
operator graylevel<m>() const;
- /// Convertion to gray_<n>
+ /// Conversion to gray_<n>
template <unsigned m>
operator gray_<m>() const;
- /// Convertion to graylevel_f
+ /// Conversion to graylevel_f
operator graylevel_f() const;
/// Access to std type.
Index: mln/value/viter.hh
--- mln/value/viter.hh (revision 2050)
+++ mln/value/viter.hh (working copy)
@@ -57,7 +57,7 @@
/// Constructor.
fwd_viter_(const Value_Set<S>& s);
- /// Convertion into a value.
+ /// Conversion into a value.
operator mln_value(S) () const;
/// Test if the iterator is valid.
@@ -94,7 +94,7 @@
/// Constructor.
bkd_viter_(const Value_Set<S>& s);
- /// Convertion into a value.
+ /// Conversion into a value.
operator mln_value(S) () const;
/// Test if the iterator is valid.
Index: mln/value/float01.hh
--- mln/value/float01.hh (revision 2050)
+++ mln/value/float01.hh (working copy)
@@ -93,7 +93,7 @@
/// Return an equivalent gray encoded on \p nbits bits.
const float01 to_nbits(unsigned nbits) const;
- /// Convertion to float.
+ /// Conversion to float.
operator float() const;
// template <unsigned n>
Index: mln/value/label.hh
--- mln/value/label.hh (revision 2050)
+++ mln/value/label.hh (working copy)
@@ -112,7 +112,7 @@
/// Self decrement.
label<n>& operator--();
- /// Convertion to unsigned.
+ /// Conversion to unsigned.
const enc& to_enc() const;
/// Unit value.
Index: mln/convert/all.hh
--- mln/convert/all.hh (revision 2050)
+++ mln/convert/all.hh (working copy)
@@ -30,13 +30,13 @@
/*! \file mln/convert/all.hh
*
- * \brief File that includes all convertion-related routines.
+ * \brief File that includes all conversion-related routines.
*/
namespace mln
{
- /// Namespace of convertion routines.
+ /// Namespace of conversion routines.
namespace convert {}
}
Index: mln/util/branch_iter_ind.hh
--- mln/util/branch_iter_ind.hh (revision 2050)
+++ mln/util/branch_iter_ind.hh (working copy)
@@ -70,7 +70,7 @@
public:
branch_iter_ind(branch<T> branch);
- /// Convertion to node.
+ /// Conversion to node.
operator util::tree_node<T>&() const;
util::tree_node<T>& operator *();
Index: mln/util/branch_iter.hh
--- mln/util/branch_iter.hh (revision 2050)
+++ mln/util/branch_iter.hh (working copy)
@@ -56,7 +56,7 @@
public:
branch_iter(branch<T> branch);
- /// Convertion to node.
+ /// Conversion to node.
operator util::tree_node<T>&() const;
util::tree_node<T>& operator *();
Index: sandbox/pellegrin/set/core/p_runs.hh
--- sandbox/pellegrin/set/core/p_runs.hh (revision 2050)
+++ sandbox/pellegrin/set/core/p_runs.hh (working copy)
@@ -273,7 +273,7 @@
{
public:
- /// Convertion into a point.
+ /// Conversion into a point.
operator P () const;
/// Reference to the corresponding point.
@@ -355,7 +355,7 @@
/// Go to the next point.
void next_();
- /// Convertion into a point-site.
+ /// Conversion into a point-site.
operator runs_psite<P> () const;
protected:
@@ -457,7 +457,7 @@
/// Go to the next point.
void next_();
- /// Convertion into a point-site.
+ /// Conversion into a point-site.
operator runs_psite<P> () const;
protected:
Index: sandbox/geraud/cs2d/dbl_neighb.hh
--- sandbox/geraud/cs2d/dbl_neighb.hh (revision 2050)
+++ sandbox/geraud/cs2d/dbl_neighb.hh (working copy)
@@ -91,7 +91,7 @@
invalidate();
}
- /// Convertion to point.
+ /// Conversion to point.
operator point () const
{
mln_precondition(is_valid());
Index: sandbox/geraud/cs2d/cs2d_morpho.hh
--- sandbox/geraud/cs2d/cs2d_morpho.hh (revision 2050)
+++ sandbox/geraud/cs2d/cs2d_morpho.hh (working copy)
@@ -109,7 +109,7 @@
invalidate();
}
- /// Convertion to point.
+ /// Conversion to point.
operator point2d () const
{
mln_precondition(is_valid());
1
0
***SPAM*** L2 cleanup-2008 2050: Make sub_image, image_if, and pw::image work again.
by Thierry Geraud 20 Jun '08
by Thierry Geraud 20 Jun '08
20 Jun '08
https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Make sub_image, image_if, and pw::image work again.
* doc/tutorial/examples/sub_image.cc: Augment.
* doc/tutorial/examples/image_if.cc: New.
* mln/trait/image/status.txt: Update.
* mln/trait/image/print.hh: Add default arg.
* mln/trait/images.hh (todo): New; about 'nature'.
(mln_trait_image_io_from_): Rename as...
(mln_internal_trait_image_value_io_from): ...this.
(mln_internal_trait_image_speed_from): New.
(default_image_morpher_): Add size and speed.
* mln/core/internal/site_iterator_base.hh (todo): New.
* mln/core/internal/image_morpher.hh: Typo.
* mln/core/internal/site_set_iterator_base.hh: Layout.
* mln/core/internal/piter_adaptor.hh: Update.
Though this class seems useless.
* mln/core/box_piter.hh: Overload ctor without arg.
* mln/core/sub_image.hh: Typo, layout, and update.
* mln/core/pset_if_piter.hh: Update.
* mln/core/image_if.hh: Fetch impl from base.
Update.
* mln/core/alias.hh: New.
* mln/core/pset_if.hh (trait): New specialization.
(pset_if): Update; remove bbox and npoints.
* mln/core/concept/image.hh (nsites): Deactivate check line.
* mln/core/concept/gpoint.hh: Inherit from Site.
* mln/core/concept/site.hh: New.
* mln/pw/image.hh (trait): Update.
(has): Remove; it is factored.
* mln/fun/internal/selector.hh (point_site): Remove dep.
Use both Site and Pseudo_Site. Yet it is not enough since
many types can be sites.
doc/tutorial/examples/image_if.cc | 23 ++++++++
doc/tutorial/examples/sub_image.cc | 2
mln/core/alias.hh | 43 +++++++++++++++
mln/core/box_piter.hh | 20 ++++++-
mln/core/concept/gpoint.hh | 6 +-
mln/core/concept/image.hh | 7 +-
mln/core/concept/site.hh | 79 ++++++++++++++++++++++++++++
mln/core/image_if.hh | 68 +++++++++++++++++++-----
mln/core/internal/image_morpher.hh | 2
mln/core/internal/piter_adaptor.hh | 57 +++-----------------
mln/core/internal/site_iterator_base.hh | 6 +-
mln/core/internal/site_set_iterator_base.hh | 1
mln/core/pset_if.hh | 56 ++++++-------------
mln/core/pset_if_piter.hh | 78 +++++++++++++++++++--------
mln/core/sub_image.hh | 20 +++----
mln/fun/internal/selector.hh | 7 +-
mln/pw/image.hh | 40 +++++++-------
mln/trait/image/print.hh | 6 +-
mln/trait/image/status.txt | 10 +--
mln/trait/images.hh | 28 +++++++--
20 files changed, 383 insertions(+), 176 deletions(-)
Index: doc/tutorial/examples/sub_image.cc
--- doc/tutorial/examples/sub_image.cc (revision 2049)
+++ doc/tutorial/examples/sub_image.cc (working copy)
@@ -17,4 +17,6 @@
sub_image<I, box2d> sub(ima, box2d(2,3));
debug::println(sub);
+
+ trait::image::print(sub);
}
Index: doc/tutorial/examples/image_if.cc
--- doc/tutorial/examples/image_if.cc (revision 0)
+++ doc/tutorial/examples/image_if.cc (revision 0)
@@ -0,0 +1,23 @@
+# include <mln/core/image2d.hh>
+# include <mln/core/image_if.hh>
+# include <mln/core/alias.hh>
+
+# include <mln/debug/iota.hh>
+# include <mln/debug/println.hh>
+# include <mln/fun/p2b/chess.hh>
+
+
+
+int main()
+{
+ using namespace mln;
+
+ typedef image2d<unsigned> I;
+ I ima(3, 5);
+ debug::iota(ima);
+
+ debug::println(ima);
+ debug::println(ima | fun::p2b::chess);
+
+ trait::image::print(ima | fun::p2b::chess);
+}
Index: mln/trait/image/status.txt
--- mln/trait/image/status.txt (revision 2049)
+++ mln/trait/image/status.txt (working copy)
@@ -7,20 +7,20 @@
KO image1d
ok image2d
KO image3d
-KO image_if
-KO image_if_interval
-KO image_if_value
+ ok image_if
+ rm image_if_interval
+ rm image_if_value
KO interpolated
KO line_graph_image
KO mono_obased_rle_image
KO mono_rle_image
KO obased_rle_image
KO plain
-KO pw::image
+ ok pw::image
KO rle_image
KO safe
KO sparse_image
-KO sub_image
+ ok sub_image
KO t_image
KO tr_image
KO translate_image
Index: mln/trait/image/print.hh
--- mln/trait/image/print.hh (revision 2049)
+++ mln/trait/image/print.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
@@ -53,10 +53,10 @@
{
template <typename I>
- void print(std::ostream& ostr);
+ void print(std::ostream& ostr = std::cout);
template <typename I>
- void print(const Image<I>& ima, std::ostream& ostr);
+ void print(const Image<I>& ima, std::ostream& ostr = std::cout);
# ifndef MLN_INCLUDE_ONLY
Index: mln/trait/images.hh
--- mln/trait/images.hh (revision 2049)
+++ mln/trait/images.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
@@ -33,6 +33,8 @@
* \brief Some base trait types for images.
*
* \todo Split this file into many.
+ *
+ * \todo the 'nature' prop is not set yet in image types.
*/
# include <iostream>
@@ -70,9 +72,20 @@
# define mln_trait_image_quant(I) typename mln::trait::image_< I >::quant
-// for io: I const => read_only, otherwise like I
-# define mln_trait_image_io_from_(I) \
-mlc_if( mlc_is_const(I), mln::trait::image::value_io::read_only, mln_trait_image_value_io(I) )
+// For value_io: I const => read_only, otherwise like I
+
+# define mln_internal_trait_image_value_io_from(I) \
+ \
+ mlc_if( mlc_is_const(I), \
+ mln::trait::image::value_io::read_only, \
+ mln_trait_image_value_io(I) )
+
+
+# define mln_internal_trait_image_speed_from(I) \
+ \
+ mlc_if( mlc_equal( mln_trait_image_speed(I), mln::trait::image::speed::fastest ), \
+ mln::trait::image::speed::fast, \
+ mln_trait_image_speed(I) )
@@ -164,14 +177,15 @@
template <typename D, typename T, typename I>
struct default_image_morpher_ : default_image_<T, I>
{
- // misc => NO delegation
- // for category, speed, and size
+ // misc => delegation except for 'category'
+ typedef typename image_<D>::size size;
+ typedef mln_internal_trait_image_speed_from(D) speed; // un-fastest
// value => delegation
typedef typename image_<D>::value_access value_access;
typedef typename image_<D>::value_storage value_storage;
typedef typename image_<D>::value_browsing value_browsing;
- typedef typename image_<D>::value_io value_io;
+ typedef mln_internal_trait_image_value_io_from(D) value_io; // un-write when D is const
// site => delegation
typedef typename image_<D>::localization localization;
Index: mln/core/internal/site_iterator_base.hh
--- mln/core/internal/site_iterator_base.hh (revision 2049)
+++ mln/core/internal/site_iterator_base.hh (working copy)
@@ -31,6 +31,11 @@
/*! \file mln/core/internal/site_iterator_base.hh
*
* \brief Base class to factor code for site iterator classes.
+ *
+ * \todo Make p_ private and add a p() method that can be overridden
+ * so that a subclass can use some other info than this attribute.
+ * See for instance start_ and next_ in pset_if_piter.hh: we have
+ * both pi_ and p_ to designate the current site.
*/
# include <mln/core/concept/site_iterator.hh>
@@ -61,7 +66,6 @@
mln_site(S),
E >
{
-
/// The associated site type (as a Site_Proxy).
typedef mln_site(S) site;
Index: mln/core/internal/image_morpher.hh
--- mln/core/internal/image_morpher.hh (revision 2049)
+++ mln/core/internal/image_morpher.hh (working copy)
@@ -68,7 +68,7 @@
*/
bool has_data() const;
- /// Convertion to the underlying (morphed) image.
+ /// Conversion to the underlying (morphed) image.
operator I() const; // FIXME: Very dangerous? Remove?
protected:
Index: mln/core/internal/site_set_iterator_base.hh
--- mln/core/internal/site_set_iterator_base.hh (revision 2049)
+++ mln/core/internal/site_set_iterator_base.hh (working copy)
@@ -50,7 +50,6 @@
template <typename S, typename E>
struct site_set_iterator_base : site_iterator_base<S, E>
{
-
/// Give the site set that this iterator browses.
const S& site_set() const;
Index: mln/core/internal/piter_adaptor.hh
--- mln/core/internal/piter_adaptor.hh (revision 2049)
+++ mln/core/internal/piter_adaptor.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
@@ -33,7 +33,7 @@
* \brief Definition of iterators on points of boxes.
*/
-# include <mln/core/internal/site_iterator_base.hh>
+# include <mln/core/internal/site_set_iterator_base.hh>
# include <mln/core/concept/box.hh>
@@ -48,34 +48,21 @@
* parameter E is the exact type.
*/
template <typename Pi, typename E>
- class piter_adaptor_ : public internal::site_iterator_base_< mln_psite(Pi), E >
+ class piter_adaptor_ : public internal::site_set_iterator_base< mln_pset(Pi), E >
{
- typedef internal::site_iterator_base_< mln_psite(Pi), E > super_;
public:
- // Make dim definition from super class available.
- enum { dim = super_::dim };
-
/// Constructor from a point iterator \p piter.
piter_adaptor_(const Pi& piter);
- /// Convertion to point.
- operator mln_point(Pi) () const;
-
- /// Reference to the corresponding point.
- const mln_point(Pi)& to_point() const;
-
- /// Give the i-th coordinate.
- mln_coord(Pi) operator[](unsigned i) const;
-
/// Test the iterator validity.
- bool is_valid() const;
+ bool is_valid_() const;
/// Invalidate the iterator.
- void invalidate();
+ void invalidate_();
/// Start an iteration.
- void start();
+ void start_();
/// Go to the next point.
void next_();
@@ -95,37 +82,13 @@
piter_adaptor_<Pi,E>::piter_adaptor_(const Pi& piter)
: piter_(piter)
{
- invalidate();
- }
-
- template <typename Pi, typename E>
- inline
- piter_adaptor_<Pi,E>::operator mln_point(Pi) () const
- {
- return piter_;
- }
-
- template <typename Pi, typename E>
- inline
- const mln_point(Pi)&
- piter_adaptor_<Pi,E>::to_point() const
- {
- return piter_.to_point();
- }
-
- template <typename Pi, typename E>
- inline
- mln_coord(Pi)
- piter_adaptor_<Pi,E>::operator[](unsigned i) const
- {
- assert(i < dim);
- return piter_[i];
+ invalidate_();
}
template <typename Pi, typename E>
inline
bool
- piter_adaptor_<Pi,E>::is_valid() const
+ piter_adaptor_<Pi,E>::is_valid_() const
{
return piter_.is_valid();
}
@@ -133,7 +96,7 @@
template <typename Pi, typename E>
inline
void
- piter_adaptor_<Pi,E>::invalidate()
+ piter_adaptor_<Pi,E>::invalidate_()
{
piter_.invalidate();
}
@@ -141,7 +104,7 @@
template <typename Pi, typename E>
inline
void
- piter_adaptor_<Pi,E>::start()
+ piter_adaptor_<Pi,E>::start_()
{
piter_.start();
}
Index: mln/core/box_piter.hh
--- mln/core/box_piter.hh (revision 2049)
+++ mln/core/box_piter.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
@@ -58,6 +58,9 @@
// Make definitions from super class available.
enum { dim = P::dim };
+ /// Constructor without argument.
+ box_fwd_piter_();
+
/*! \brief Constructor.
*
* \param[in] b A box.
@@ -102,6 +105,9 @@
// Make definitions from super class available.
enum { dim = P::dim };
+ /// Constructor without argument.
+ box_bkd_piter_();
+
/*! \brief Constructor.
*
* \param[in] b A box.
@@ -136,6 +142,12 @@
template <typename P>
inline
+ box_fwd_piter_<P>::box_fwd_piter_()
+ {
+ }
+
+ template <typename P>
+ inline
box_fwd_piter_<P>::box_fwd_piter_(const box_<P>& b)
{
this->change_target(b);
@@ -187,6 +199,12 @@
template <typename P>
inline
+ box_bkd_piter_<P>::box_bkd_piter_()
+ {
+ }
+
+ template <typename P>
+ inline
box_bkd_piter_<P>::box_bkd_piter_(const box_<P>& b)
{
this->change_target(b);
Index: mln/core/sub_image.hh
--- mln/core/sub_image.hh (revision 2049)
+++ mln/core/sub_image.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
@@ -33,7 +33,6 @@
*
* \brief Definition of morpher that makes an image become restricted
* given by a point set.
- *
*/
# include <mln/core/internal/image_domain_morpher.hh>
@@ -68,7 +67,8 @@
{
template <typename I, typename S>
- struct image_< sub_image<I,S> > : default_image_morpher_< I, mln_value(I),
+ struct image_< sub_image<I,S> > : default_image_morpher_< I,
+ mln_value(I),
sub_image<I,S> >
{
// private:
@@ -82,8 +82,6 @@
typedef trait::image::ext_value::irrelevant ext_value;
typedef trait::image::ext_io::irrelevant ext_io;
- typedef mln_trait_image_io_from_(I) io; // un-write when I const
-
typedef trait::image::value_storage::disrupted value_storage;
// HOT FIXME: except if S is a Box
};
@@ -95,7 +93,9 @@
// FIXME: Doc!
template <typename I, typename S>
- struct sub_image : public internal::image_domain_morpher_< I, S, sub_image<I,S> >
+ struct sub_image : public internal::image_domain_morpher_< I,
+ S,
+ sub_image<I,S> >
{
/// Skeleton.
typedef sub_image< tag::image_<I>, tag::pset_<S> > skeleton;
@@ -112,7 +112,7 @@
/// Give the definition domain.
const S& domain() const;
- /// Const promotion via convertion.
+ /// Const promotion via conversion.
operator sub_image<const I, S>() const;
};
@@ -120,10 +120,12 @@
template <typename I, typename S>
- sub_image<const I, S> operator|(const Image<I>& ima, const Site_Set<S>& pset);
+ sub_image<const I, S>
+ 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);
+ sub_image<I, S>
+ operator|(Image<I>& ima, const Site_Set<S>& pset);
Index: mln/core/pset_if_piter.hh
--- mln/core/pset_if_piter.hh (revision 2049)
+++ mln/core/pset_if_piter.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
@@ -30,11 +30,12 @@
/*! \file mln/core/pset_if_piter.hh
*
- * \brief Definition of iterators on points of pset_ifes.
+ * \brief Definition of iterators on pset_if<S,F>.
+ *
+ * \todo See todo in site_iterator_base.hh
*/
-# include <mln/core/concept/site_iterator.hh>
-# include <mln/core/internal/piter_adaptor.hh>
+# include <mln/core/internal/site_set_iterator_base.hh>
# include <mln/core/pset_if.hh>
@@ -50,27 +51,34 @@
*/
template <typename S, typename F>
class pset_if_fwd_piter_
- : public internal::piter_adaptor_< mln_fwd_piter(S),
+ : public internal::site_set_iterator_base< pset_if<S,F>,
pset_if_fwd_piter_<S,F> >
{
- typedef mln_fwd_piter(S) adaptee_;
- typedef pset_if_fwd_piter_<S,F> self_;
- typedef internal::piter_adaptor_<adaptee_, self_> super_;
-
public:
- /// Constructor from a subset of points.
- pset_if_fwd_piter_(const pset_if<S,F>& subset);
+ /// Constructor without argument.
+ pset_if_fwd_piter_();
+
+ /// Constructor from a site set.
+ pset_if_fwd_piter_(const pset_if<S,F>& s);
+
+ /// Test if the iterator is valid.
+ bool is_valid_() const;
+
+ /// Invalidate the iterator.
+ void invalidate_();
/// Start an iteration.
- void start();
+ void start_();
/// Go to the next point.
void next_();
+ mln_fwd_piter(S)& hook_pi_() { return pi_; }
+
private:
- const pset_if<S,F>& subset_;
+ mln_fwd_piter(S) pi_;
};
@@ -90,20 +98,44 @@
template <typename S, typename F>
inline
- pset_if_fwd_piter_<S,F>::pset_if_fwd_piter_(const pset_if<S,F>& subset)
- : super_(adaptee_(subset.overset())),
- subset_(subset)
+ pset_if_fwd_piter_<S,F>::pset_if_fwd_piter_()
+ {
+ }
+
+ template <typename S, typename F>
+ inline
+ pset_if_fwd_piter_<S,F>::pset_if_fwd_piter_(const pset_if<S,F>& s)
+ {
+ pi_.change_target(s.overset());
+ this->change_target(s);
+ }
+
+ template <typename S, typename F>
+ inline
+ bool
+ pset_if_fwd_piter_<S,F>::is_valid_() const
+ {
+ return pi_.is_valid();
+ }
+
+ template <typename S, typename F>
+ inline
+ void
+ pset_if_fwd_piter_<S,F>::invalidate_()
{
+ pi_.invalidate();
}
template <typename S, typename F>
inline
void
- pset_if_fwd_piter_<S,F>::start()
+ pset_if_fwd_piter_<S,F>::start_()
{
- this->piter_.start();
- while (this->piter_.is_valid() && ! subset_.pred(this->piter_))
- this->piter_.next();
+ pi_.start();
+ while (pi_.is_valid() && ! this->s_->pred(pi_))
+ pi_.next();
+ if (is_valid_())
+ this->p_ = pi_;
}
template <typename S, typename F>
@@ -112,8 +144,10 @@
pset_if_fwd_piter_<S,F>::next_()
{
do
- this->piter_.next();
- while (this->piter_.is_valid() && ! subset_.pred(this->piter_));
+ pi_.next();
+ while (pi_.is_valid() && ! this->s_->pred(pi_));
+ if (is_valid_())
+ this->p_ = pi_;
}
Index: mln/core/image_if.hh
--- mln/core/image_if.hh (revision 2049)
+++ mln/core/image_if.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
@@ -33,13 +33,12 @@
* \brief Definition of a image which domain is restricted by a
* function.
*
- * \todo FIXME for theo : add image_if_great_than / less_than
+ * \todo Relax Function_p2v into Function_v2v.
*/
-# include <mln/core/internal/image_if_base.hh>
-
-
-# define Super mln::internal::image_if_base_< I, F, image_if<I,F> >
+# include <mln/core/internal/image_domain_morpher.hh>
+# include <mln/core/pset_if.hh>
+# include <mln/pw/all.hh>
namespace mln
@@ -54,9 +53,12 @@
/// \internal Data structure for \c mln::image_if<I,F>.
template <typename I, typename F>
- struct data_< image_if<I,F> > : data_< Super >
+ struct data_< image_if<I,F> >
{
data_(I& ima, const F& f);
+
+ I ima_;
+ pset_if<mln_pset(I), F> pset_;
};
} // end of namespace mln::internal
@@ -66,8 +68,17 @@
{
template <typename I, typename F>
- struct image_< image_if<I,F> > : trait::image_< Super >
+ struct image_< image_if<I,F> > : default_image_morpher_< I,
+ mln_value(I),
+ image_if<I,F> >
{
+ typedef trait::image::category::domain_morpher category;
+
+ typedef trait::image::ext_domain::none ext_domain; // No extension of domain.
+ typedef trait::image::ext_value::irrelevant ext_value;
+ typedef trait::image::ext_io::irrelevant ext_io;
+
+ typedef trait::image::value_storage::disrupted value_storage;
};
} // end of namespace mln::trait
@@ -78,16 +89,23 @@
*
*/
template <typename I, typename F>
- struct image_if : public Super
+ struct image_if : public internal::image_domain_morpher_< I,
+ pset_if<mln_pset(I), F>,
+ image_if<I, F> >
{
/// Skeleton.
typedef image_if< tag::image_<I>, tag::function_<F> > skeleton;
+ /// Constructor without argument.
+ image_if();
+
/// Constructor from an image \p ima and a predicate \p f.
image_if(I& ima, const F& f);
- /// Constructor without argument.
- image_if();
+ void init_(I& ima, const F& f);
+
+ /// Give the definition domain.
+ const pset_if<mln_pset(I), F>& domain() const;
/// Const promotion via convertion.
operator image_if<const I, F>() const;
@@ -130,9 +148,10 @@
operator | (const Image<I>& ima, const Function_p2b<F>& f);
+
# ifndef MLN_INCLUDE_ONLY
- /// \internal internal::data_
+ // internal::data_< image_if<I,F> >
namespace internal
{
@@ -140,12 +159,14 @@
template <typename I, typename F>
inline
data_< image_if<I,F> >::data_(I& ima, const F& f)
- : data_< Super >(ima, f)
+ : ima_(ima),
+ pset_(ima.domain() | f)
{
}
}
+
// image_if<I,F>
template <typename I, typename F>
@@ -158,7 +179,25 @@
inline
image_if<I,F>::image_if(I& ima, const F& f)
{
- this->init_(ima, f);
+ init_(ima, f);
+ }
+
+ template <typename I, typename F>
+ inline
+ void
+ image_if<I,F>::init_(I& ima, const F& f)
+ {
+ mln_precondition(! this->has_data());
+ this->data_ = new internal::data_< image_if<I,F> >(ima, f);
+ }
+
+ template <typename I, typename F>
+ inline
+ const pset_if<mln_pset(I), F>&
+ image_if<I,F>::domain() const
+ {
+ mln_precondition(this->has_data());
+ return this->data_->pset_;
}
template <typename I, typename F>
@@ -171,6 +210,7 @@
return tmp;
}
+
// Operators.
template <typename I, typename F>
Index: mln/core/alias.hh
--- mln/core/alias.hh (revision 0)
+++ mln/core/alias.hh (revision 0)
@@ -0,0 +1,43 @@
+// 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_ALIAS_HH
+# define MLN_CORE_ALIAS_HH
+
+/*! \file mln/core/alias.hh
+ *
+ * \brief Definition of FIXME
+ */
+
+
+#define mln_alias(Var, Expr) \
+ \
+ typeof(Expr) Var = Expr; \
+ typedef typeof(Expr) Var##_t
+
+
+#endif // ! MLN_CORE_ALIAS_HH
Index: mln/core/pset_if.hh
--- mln/core/pset_if.hh (revision 2049)
+++ mln/core/pset_if.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
@@ -45,6 +45,19 @@
template <typename S, typename F> struct pset_if_fwd_piter_;
template <typename S, typename F> struct pset_if_bkd_piter_;
+ namespace trait
+ {
+
+ template <typename S, typename F>
+ struct site_set_< pset_if<S,F> >
+ {
+ typedef trait::site_set::nsites::unknown nsites;
+ typedef trait::site_set::bbox::unknown bbox;
+ typedef trait::site_set::contents::fixed contents;
+ typedef mln_trait_site_set_arity(S) arity;
+ };
+
+ } // end of namespace trait
/*! \brief Restrict a point set \p pset to points that verify \p f.
@@ -71,11 +84,15 @@
typedef internal::site_set_base_<mln_psite(S), self_> super_;
public:
- typedef mln_psite(super_) psite;
+ typedef mln_psite(S) psite;
+
/// Forward Site_Iterator associated type.
typedef pset_if_fwd_piter_<S,F> fwd_piter;
+ /// Site_Iterator associated type.
+ typedef fwd_piter piter;
+
/// Backward Site_Iterator associated type.
typedef mln::internal::fixme bkd_piter;
@@ -90,12 +107,6 @@
/// Test if \p p belongs to the subset.
bool has(const psite& p) const;
- /// Give a bounding box of the subset.
- const box_<mln_point(S)>& bbox() const;
-
- /// Give the number of points of the subset.
- std::size_t npoints() const;
-
/// Give the primary overset.
const S& overset() const;
@@ -138,14 +149,6 @@
template <typename S, typename F>
inline
- const box_<mln_point(S)>&
- pset_if<S,F>::bbox() const
- {
- return pset_.bbox();
- }
-
- template <typename S, typename F>
- inline
const S&
pset_if<S,F>::overset() const
{
@@ -192,25 +195,4 @@
-namespace mln
-{
-
-# ifndef MLN_INCLUDE_ONLY
-
- template <typename S, typename F>
- std::size_t
- pset_if<S,F>::npoints() const
- {
- std::size_t n = 0;
- fwd_piter p(*this);
- for_all(p)
- ++n;
- return n;
- }
-
-# endif // ! MLN_INCLUDE_ONLY
-
-} // end of namespace mln
-
-
#endif // ! MLN_CORE_PSET_IF_HH
Index: mln/core/concept/image.hh
--- mln/core/concept/image.hh (revision 2049)
+++ mln/core/concept/image.hh (working copy)
@@ -126,8 +126,11 @@
bool (E::*m1)(const psite& p) const = & E::has;
m1 = 0;
- std::size_t (E::*m2)() const = & E::nsites;
- m2 = 0;
+
+ // Only some image types feature the 'nsites' method.
+// std::size_t (E::*m2)() const = & E::nsites;
+// m2 = 0;
+
bool (E::*m3)() const = & E::has_data;
m3 = 0;
Index: mln/core/concept/gpoint.hh
--- mln/core/concept/gpoint.hh (revision 2049)
+++ mln/core/concept/gpoint.hh (working copy)
@@ -33,7 +33,7 @@
* \brief Definition of the concept of mln::Gpoint.
*/
-# include <mln/core/concept/object.hh>
+# include <mln/core/concept/site.hh>
# include <mln/core/concept/gdpoint.hh>
# include <mln/value/concept/scalar.hh>
@@ -78,7 +78,7 @@
template <>
struct Gpoint<void>
{
- typedef Object<void> super;
+ typedef Site<void> super;
};
@@ -90,7 +90,7 @@
* discrete square grid of the 2D plane.
*/
template <typename E>
- struct Gpoint : public Object<E>
+ struct Gpoint : public Site<E>
{
typedef Gpoint<void> category;
Index: mln/core/concept/site.hh
--- mln/core/concept/site.hh (revision 0)
+++ mln/core/concept/site.hh (revision 0)
@@ -0,0 +1,79 @@
+// 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_CORE_CONCEPT_SITE_HH
+# define MLN_CORE_CONCEPT_SITE_HH
+
+/*! \file mln/core/concept/site.hh
+ *
+ * \brief Definition of the concept of mln::Site.
+ */
+
+# include <mln/core/concept/object.hh>
+
+
+namespace mln
+{
+
+ // Fwd decl.
+ template <typename E> struct Site;
+
+
+ /// Site category flag type.
+ template <>
+ struct Site<void>
+ {
+ typedef Object<void> super;
+ };
+
+
+ /*! \brief Base class for classes that are explicitly sites.
+ */
+ template <typename E>
+ struct Site : public Object<E>
+ {
+ typedef Site<void> category;
+
+ protected:
+ Site();
+ };
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ template <typename E>
+ inline
+ Site<E>::Site()
+ {
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+} // end of namespace mln
+
+
+#endif // ! MLN_CORE_CONCEPT_SITE_HH
Index: mln/pw/image.hh
--- mln/pw/image.hh (revision 2049)
+++ mln/pw/image.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
@@ -31,6 +31,8 @@
/*! \file mln/pw/image.hh
*
* \brief FIXME.
+ *
+ * \todo Relax Function_p2v into Function_v2v.
*/
# include <mln/core/internal/image_primary.hh>
@@ -81,18 +83,25 @@
struct image_< pw::image<F,S> > : default_image_< mlc_unqualif(mln_result(F)),
pw::image<F,S> >
{
+ // misc
typedef trait::image::category::primary category;
-
- typedef trait::image::value::fixme value;
-
- typedef trait::image::access::browsing access;
- typedef trait::image::space::fixme_ space;
+ typedef trait::image::speed::fastest speed;
typedef trait::image::size::regular size;
- typedef trait::image::support::fixme_ support;
- typedef trait::image::border::none border;
- typedef trait::image::data::computed data;
- typedef trait::image::io::read_only io;
+ // value
+ typedef trait::image::value_access::computed value_access;
+ typedef trait::image::value_storage::disrupted value_storage;
+ typedef trait::image::value_browsing::site_wise_only value_browsing;
+ typedef trait::image::value_io::read_only value_io;
+
+ // site / domain
+ typedef /* FIXME: depends on S */ undef localization;
+ typedef /* FIXME: depends on S */ undef dimension;
+
+ // extended domain
+ typedef trait::image::ext_domain::none ext_domain;
+ typedef trait::image::ext_value::irrelevant ext_value;
+ typedef trait::image::ext_io::irrelevant ext_io;
};
} // end of namespace mln::trait
@@ -130,9 +139,7 @@
/// Constructor.
image(const Function_p2v<F>& f, const Site_Set<S>& ps);
-
- /// Test if a pixel value is accessible at \p p.
- bool has(const mln_psite(S)& p) const;
+ // No init_ method here since this image type is not "concrete".
/// Give the definition domain.
const S& domain() const;
@@ -199,13 +206,6 @@
template <typename F, typename S>
inline
- bool image<F,S>::has(const mln_psite(S)& p) const
- {
- return this->data_->pset_.has(p);
- }
-
- template <typename F, typename S>
- inline
const S&
image<F,S>::domain() const
{
Index: mln/fun/internal/selector.hh
--- mln/fun/internal/selector.hh (revision 2049)
+++ mln/fun/internal/selector.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
@@ -34,7 +34,8 @@
*/
# include <mln/core/concept/function.hh>
-# include <mln/core/concept/point_site.hh>
+# include <mln/core/concept/site.hh>
+# include <mln/core/concept/pseudo_site.hh>
# include <mln/metal/unqualif.hh>
# include <mln/metal/if.hh>
# include <mln/metal/is_a.hh>
@@ -160,7 +161,7 @@
template <typename T>
struct tag_
{
- enum { value = mlc_is_a(T, Point_Site)::value
+ enum { value = (mlc_is_a(T, Site)::value || mlc_is_a(T, Pseudo_Site)::value)
? p_
: v_ };
};
1
0
https://svn.lrde.epita.fr/svn/oln/trunk/milena
Index: ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
Fix compilation of tools/.
* mln/make/voronoi.hh (mln::make::voronoi): Catch up with the new
interface of mln::util::graph.
voronoi.hh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: mln/make/voronoi.hh
--- mln/make/voronoi.hh (revision 2048)
+++ mln/make/voronoi.hh (working copy)
@@ -116,7 +116,7 @@
/// Compute the center of label.
for (unsigned i = 0; i < nb; ++i)
{
- gr.add_node ();
+ gr.add_vertex();
/// FIXME
v[i] = make::point2d ((unsigned)tab_mean[i].to_result ()[0],
1
0
https://svn.lrde.epita.fr/svn/oln/trunk
Index: ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
* configure.ac: Configure files in milena/apps/.
configure.ac | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
Index: configure.ac
--- configure.ac (revision 2047)
+++ configure.ac (working copy)
@@ -189,4 +189,21 @@
milena/tests/win/Makefile
])
+
+## -------------- ##
+## Applications. ##
+## -------------- ##
+
+# Ask for the creation of applications' Makefiles.
+# FIXME: Should it be achieved through oln.m4 macros, as we did in Olena 0.11?
+AC_CONFIG_FILES([
+ milena/apps/Makefile
+ milena/apps/statues/Makefile
+])
+
+# Configure tests.
+AC_CONFIG_FILES([milena/apps/statues/test],
+ [chmod +x milena/apps/statues/test])
+
+
AC_OUTPUT
1
0
https://svn.lrde.epita.fr/svn/oln/trunk/milena
Index: ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
Add support for Autotools in apps/statues/.
* Makefile.am (SUBDIRS): Add apps.
* apps/Makefile.am: New.
* apps/statues/test: Rename as...
* apps/statues/test.in: ...this.
(mesh_dir): Depend on @top_srcdir@.
* apps/statues/Makefile: Rename as...
* apps/statues/Makefile.am: ...this.
Convert this Makefile to Automake.
Makefile.am | 2 +-
apps/Makefile.am | 3 +++
apps/statues/Makefile.am | 38 +++++++++-----------------------------
apps/statues/test.in | 2 +-
4 files changed, 14 insertions(+), 31 deletions(-)
Index: Makefile.am
--- Makefile.am (revision 2046)
+++ Makefile.am (working copy)
@@ -1,6 +1,6 @@
## Process this file through Automake to create Makefile.in -*- Makefile -*-
-SUBDIRS = doc tests tools
+SUBDIRS = doc tests tools apps
.PHONY: doc
doc:
Index: apps/statues/test.in
--- apps/statues/test.in (revision 2046)
+++ apps/statues/test.in (working copy)
@@ -2,7 +2,7 @@
set -ex
-mesh_dir=../../../mesh
+mesh_dir=@top_srcdir@/milena/mesh
time ./mesh-segm $mesh_dir/socket.off 25 socket-segm.off
time ./mesh-segm $mesh_dir/teapot.off 50 teapot-segm.off
Index: apps/statues/Makefile.am
--- apps/statues/Makefile.am (revision 2046)
+++ apps/statues/Makefile.am (working copy)
@@ -1,33 +1,13 @@
-# To be redefined if TriMesh is located elsewhere.
-# FIXME: Trimesh could be part of the Olena distribution, as a
-# dependency. Or we could just rewrite the required features (I/O &
-# curvature computation).
-TRIMESH = $(HOME)/opt/trimesh2
-
-# Warning: we should use the same compiler as the one that was used to
-# compile TriMesh to avoid any ABI-related problems.
+## Process this file through Automake to produce Makefile.in -*- Makefile -*-
+# Find Milena and trimesh headers.
+AM_CPPFLAGS = -I$(top_srcdir)/milena -I$(top_srcdir)/external/trimesh/include
# Produce fast code.
-CXXFLAGS = -O3 -DNDEBUG -ggdb
-# Produce debuggable code.
-#CXXFLAGS = -O0 -ggdb -fno-inline -fno-default-inline
-
-# Milena and Trimesh paths.
-CPPFLAGS = -I../../../ -I$(TRIMESH)/include
-# Link with Trimesh.
-LDFLAGS = -L$(TRIMESH)/lib.Darwin -ltrimesh
-
-all: mesh-segm
-
-mesh-segm.o: mesh-segm.cc io.hh
-mesh-segm: mesh-segm.o
- $(CXX) -o $@ $(LDFLAGS) $<
-
-check: mesh-segm test
- ./test
+AM_CXXFLAGS = -O3 -DNDEBUG -ggdb
+# Find trimesh archive.
+AM_LDFLAGS = -L$(top_builddir)/external/trimesh/libsrc -ltrimesh
-CLEANFILES = mesh-segm.o mesh-segm
-clean:
- rm -f $(CLEANFILES)
+bin_PROGRAMS = mesh-segm
+mesh_segm_SOURCES = mesh-segm.cc io.hh
-.PHONY: all clean check
+TESTS = test
Index: apps/Makefile.am
--- apps/Makefile.am (revision 0)
+++ apps/Makefile.am (revision 0)
@@ -0,0 +1,3 @@
+## Process this file through Automake to produce Makefile.in -*- Makefile -*-
+
+SUBDIRS = statues
1
0
2046: Move the application on the segmentation of statues into Milena.
by Roland Levillain 19 Jun '08
by Roland Levillain 19 Jun '08
19 Jun '08
https://svn.lrde.epita.fr/svn/oln/trunk/milena
Index: ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
Move the application on the segmentation of statues into Milena.
* apps/: New directory.
* sandbox/levillain/statues/: Move...
* apps/statues/: ...here.
0 files changed
1
0
https://svn.lrde.epita.fr/svn/oln/trunk/milena/sandbox
Index: ChangeLog
from Ugo Jardonnet <jardonnet(a)lrde.epita.fr>
Sandbox: ICP: clean-up before milena update.
Prepare patch for math and geom modules.
* jardonnet/registration/power_it.hh: Add comment .
* jardonnet/registration/cov.hh: New: clean math::covariance.
* jardonnet/registration/variance.hh: New: clean math::variance.
* jardonnet/registration/exp_val.hh: New: clean math::expected value.
* jardonnet/registration/cross_cov.hh: Update: clean cross covariance.
* jardonnet/registration/center.hh: New: clean geom::center.
Update rendering for seminar.
* jardonnet/registration/save.hh: Update rendering.
* jardonnet/test/img/c5.pbm,
* jardonnet/test/img/x5.pbm: Update images .
registration/center.hh | 73 ++++++++++++++++++++++++++++++++++++++++
registration/cov.hh | 82
++++++++++++++++++++++++++++++++++++++++++++++
registration/cross_cov.hh | 6 +--
registration/exp_val.hh | 77
+++++++++++++++++++++++++++++++++++++++++++
registration/power_it.hh | 3 +
registration/save.hh | 52 ++++++++++++++---------------
registration/variance.hh | 27 +++++++++++++++
test/icp_ref.cc | 2 -
8 files changed, 292 insertions(+), 30 deletions(-)
Index: jardonnet/test/icp_ref.cc
--- jardonnet/test/icp_ref.cc (revision 2044)
+++ jardonnet/test/icp_ref.cc (working copy)
@@ -60,7 +60,7 @@
}
//working box
- const box_< point_<grid::cube, float> > working_box =
enlarge(bigger(c.bbox(),x.bbox()),100);
+ const box_< point_<grid::cube, float> > working_box =
enlarge(bigger(c.bbox(),x.bbox()),50);
// FIXME : TODO : map : vec<3,float> -> point
closest_point< point_<grid::cube, float> > map(x, working_box);
Index: jardonnet/test/img/c5.pbm
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: jardonnet/test/img/x5.pbm
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: jardonnet/registration/cov.hh
--- jardonnet/registration/cov.hh (revision 0)
+++ jardonnet/registration/cov.hh (revision 0)
@@ -0,0 +1,82 @@
+// Copyright (C) 2007 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_MATH_COV_HH
+# define MLN_MATH_COV_HH
+
+/*! \file mln/math/cov.hh
+ *
+ * \brief Define the covariance (cov) routine.
+ */
+
+# include "exp_val.hh"
+
+namespace mln
+{
+
+ namespace math
+ {
+
+ template <typename P>
+ algebra::mat<P::dim,P::dim,float>
+ cov(const p_array<P>& a1,
+ const p_array<P>& a2);
+
+# ifndef MLN_INCLUDE_ONLY
+
+ template <typename P>
+ algebra::mat<P::dim,P::dim,float>
+ cov(const p_array<P>& a1,
+ const p_array<P>& a2)
+ {
+ mln_precondition(a1.npoints() == a2.npoints());
+
+ //centers of mass
+ algebra::vec<P::dim,float> mu_a1 = math::exp_value(a1);
+ algebra::vec<P::dim,float> mu_a2 = math::exp_value(a2);
+
+ //covariance matrix
+ algebra::mat<P::dim,P::dim,float> Mk(literal::zero);
+ for (unsigned i = 0; i < a1.npoints(); ++i)
+ {
+ // FIXME: ugly cast.
+ algebra::vec<P::dim,float> a1i = a1[i];
+ algebra::vec<P::dim,float> a2i = a2[i];
+ Mk += make::mat(a1i - mu_a1) * trans(make::mat(a2i - mu_a2));
+ }
+
+ return Mk / a1.npoints();
+ }
+
+ # endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::math
+
+} // end of namespace mln
+
+
+#endif // ! MLN_MATH_COV_HH
Index: jardonnet/registration/power_it.hh
--- jardonnet/registration/power_it.hh (revision 2044)
+++ jardonnet/registration/power_it.hh (working copy)
@@ -12,6 +12,9 @@
namespace mln
{
+ /**
+ * Return the biggest eigen vector.
+ */
template <uint n>
algebra::vec<n,float> power_it(algebra::mat<n,n,float>& A)
{
Index: jardonnet/registration/variance.hh
--- jardonnet/registration/variance.hh (revision 0)
+++ jardonnet/registration/variance.hh (revision 0)
@@ -0,0 +1,27 @@
+// Copyright (C) 2007 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.
+
Index: jardonnet/registration/save.hh
--- jardonnet/registration/save.hh (revision 2044)
+++ jardonnet/registration/save.hh (working copy)
@@ -5,11 +5,16 @@
# include <mln/io/ppm/save.hh>
# include <mln/io/pbm/save.hh>
# include <mln/draw/all.hh>
+# include <mln/morpho/erosion.hh>
+# include <mln/make/window2d.hh>
# include <string>
# include "quat7.hh"
# include "tools.hh"
# include "power_it.hh"
+# include "center.hh"
+# include "cov.hh"
+
namespace mln
{
@@ -55,17 +60,11 @@
level::fill(out, literal::white);
//plot mu_Ck
- algebra::vec<P::dim,float> mu_Ck = center(ck, ck.npoints());
+ algebra::vec<P::dim,float> mu_Ck = geom::center(ck);
draw::plot(out, point2d(mu_Ck[0], mu_Ck[1]), literal::green);
//Ck orientation
- algebra::mat<P::dim,P::dim,float> Mk(literal::zero);
- for (unsigned i = 0; i < ck.npoints(); ++i)
- {
- algebra::vec<P::dim,float> Cki = ck[i];
- Mk += make::mat(Cki - mu_Ck) * trans(make::mat(Cki - mu_Ck));
- }
- Mk /= c.npoints();
+ algebra::mat<P::dim,P::dim,float> Mk = math::cov(ck,ck);
algebra::vec<3,float> vck = power_it(Mk);
draw::line(out, point2d(mu_Ck[0], mu_Ck[1]),
point2d(mu_Ck[0]+vck[0]*10, mu_Ck[1]+vck[1]*10),
@@ -77,31 +76,16 @@
xk.append(map(ck[i]));
//plot mu_Xk
- algebra::vec<P::dim,float> mu_Xk = center(xk, xk.npoints());
+ algebra::vec<P::dim,float> mu_Xk = geom::center(xk);
draw::plot(out, point2d(mu_Xk[0], mu_Xk[1]), literal::blue);
//Xk orientation
- algebra::mat<P::dim,P::dim,float> Mxk(literal::zero);
- for (unsigned i = 0; i < xk.npoints(); ++i)
- {
- algebra::vec<P::dim,float> Xki = xk[i];
- Mxk += make::mat(Xki - mu_Xk) * trans(make::mat(Xki - mu_Xk));
- }
- Mxk /= c.npoints();
+ algebra::mat<P::dim,P::dim,float> Mxk = math::cov(xk,xk);
algebra::vec<3,float> vxk = power_it(Mxk);
draw::line(out, point2d(mu_Xk[0], mu_Xk[1]),
point2d(mu_Xk[0]+vxk[0]*10, mu_Xk[1]+vxk[1]*10),
literal::red);
-
- //ck in green
- for (unsigned i = 0; i < ck.npoints(); i++)
- {
- point2d p(ck[i][0], ck[i][1]);
- if (out.has(p))
- out(p) = literal::green;
- }
-
//x in black
for (unsigned i = 0; i < x.npoints(); i++)
{
@@ -110,7 +94,7 @@
out(p) = literal::black;
}
- //xk in blue
+ //xk in red
for (unsigned i = 0; i < xk.npoints(); i++)
{
point2d p(xk[i][0], xk[i][1]);
@@ -118,6 +102,22 @@
out(p) = literal::red;
}
+ //ck in green
+ for (unsigned i = 0; i < ck.npoints(); i++)
+ {
+ point2d p(ck[i][0], ck[i][1]);
+ if (out.has(p))
+ out(p) = literal::green;
+ }
+
+ /*
+ FIXME:
+ bool vals[] = {1, 1, 1,
+ 1, 1, 1,
+ 1, 1, 1};
+ morpho::erosion(out, make::window2d(vals));
+ */
+
//save
std::stringstream oss;
oss << "step_" << id++ << ".ppm";
Index: jardonnet/registration/exp_val.hh
--- jardonnet/registration/exp_val.hh (revision 0)
+++ jardonnet/registration/exp_val.hh (revision 0)
@@ -0,0 +1,77 @@
+// Copyright (C) 2007 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_MATH_EXP_VAL_HH
+# define MLN_MATH_EXP_VAL_HH
+
+/*! \file mln/math/exp_val.hh
+ *
+ * \brief Define the expected value (exp_val) routine.
+ */
+
+# include <mln/algebra/vec.hh>
+
+namespace mln
+{
+
+ namespace math
+ {
+
+ template <typename P>
+ algebra::vec<P::dim,float>
+ exp_value(const p_array<P>& a);
+
+# ifndef MLN_INCLUDE_ONLY
+
+ template <typename P>
+ inline
+ algebra::vec<P::dim,float>
+ exp_value(const p_array<P>& a)
+ {
+ if (a.npoints() == 0)
+ return P();
+
+ algebra::vec<P::dim,float> c(literal::zero);
+ for (unsigned i = 0; i < a.npoints(); ++i)
+ {
+ // FIXME : Ugly.
+ algebra::vec<P::dim,float> ai = a[i];
+ c += ai;
+ }
+
+ return c / a.npoints();
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::math
+
+} // end of namespace mln
+
+
+#endif // ! MLN_MATH_ABS_HH
Index: jardonnet/registration/cross_cov.hh
--- jardonnet/registration/cross_cov.hh (revision 2044)
+++ jardonnet/registration/cross_cov.hh (working copy)
@@ -1,5 +1,5 @@
-#ifndef MLN_ACCU_CROSS_COV_HH_HH
-# define MLN_ACCU_CROSS_COV_HH_HH
+#ifndef MLN_ACCU_CROSS_COV_HH
+# define MLN_ACCU_CROSS_COV_HH
namespace mln
@@ -15,4 +15,4 @@
}
-#endif // ! MLN_ACCU_CROSS_COV_HH_HH
+#endif // ! MLN_ACCU_CROSS_COV_HH
Index: jardonnet/registration/center.hh
--- jardonnet/registration/center.hh (revision 0)
+++ jardonnet/registration/center.hh (revision 0)
@@ -0,0 +1,73 @@
+// Copyright (C) 2007 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_GEOM_CENTER_HH
+# define MLN_GEOM_CENTER_HH
+
+/*! \file mln/math/exp_val.hh
+ *
+ * \brief Define the center routine.
+ */
+
+namespace mln
+{
+
+ namespace geom
+ {
+
+ template <typename P>
+ P center(const p_array<P>& a);
+
+# ifndef MLN_INCLUDE_ONLY
+
+ template <typename P>
+ inline
+ P exp_value(const p_array<P>& a)
+ {
+ if (a.npoints() == 0)
+ return P();
+
+ algebra::vec<P::dim,float> c(literal::zero);
+ for (unsigned i = 0; i < a.npoints(); ++i)
+ {
+ // FIXME : Ugly.
+ algebra::vec<P::dim,float> ai = a[i];
+ c += ai;
+ }
+
+ return algebra::to_point<P>(c / a.npoints());
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::geom
+
+} // end of namespace mln
+
+
+#endif // ! MLN_MATH_ABS_HH
1
0
https://svn.lrde.epita.fr/svn/oln/trunk
See also the contents of external/trimesh/ChangeLog below.
Index: ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
Autoconfiscate trimesh2.
* configure.ac: Require Autoconf 2.16 and Automake 1.10.
Configure external/Makefile.
Configure subdirectory external/trimesh/.
Fix the definition of TESTS_CXXFLAGS_DEBUG.
* Makefile.am (SUBDIR): Add external.
* external/Makefile.am: New.
* external/README: Update.
* external/trimesh/ChangeLog: New.
Makefile.am | 2
configure.ac | 18 ++---
external/Makefile.am | 3
external/README | 4 -
external/trimesh/ChangeLog | 21 ++++++
external/trimesh/Makefile.am | 37 +++++-----
external/trimesh/configure.ac | 62 ++++++++++++++++++
external/trimesh/gluit/Makefile.am | 118 ++++++++++++++++++++---------------
external/trimesh/include/Makefile.am | 23 ++++++
external/trimesh/libsrc/Makefile.am | 36 +++-------
external/trimesh/utilsrc/Makefile.am | 71 ++++++++-------------
11 files changed, 250 insertions(+), 145 deletions(-)
Index: configure.ac
--- configure.ac (revision 2043)
+++ configure.ac (working copy)
@@ -1,7 +1,7 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
-AC_PREREQ([2.59])
+AC_PREREQ([2.61])
## ---------------- ##
@@ -15,8 +15,7 @@
AC_CONFIG_FILES([build-aux/Makefile])
# Automake.
-# 1.9.4 because of changelog vs. ChangeLog on Darwin.
-AM_INIT_AUTOMAKE([1.9.4 foreign check-news dist-bzip2 nostdinc -Wall])
+AM_INIT_AUTOMAKE([1.10 foreign check-news dist-bzip2 nostdinc -Wall])
## --------------------- ##
@@ -69,8 +68,7 @@
# * GNU C++ Library Compile Time Checks (a.k.a. concept checking):
# http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt12ch29.html
if test "$GXX" = yes && test -z "$TESTS_CXXFLAGS_DEBUG"; then
- TESTS_CXXFLAGS_DEBUG=\
- "-O0 -ggdb -Wall -W -D_GLIBCXX_DEBUG -D_GLIBCXX_CONCEPT_CHECKS"
+ TESTS_CXXFLAGS_DEBUG="-O0 -ggdb -Wall -W -D_GLIBCXX_DEBUG -D_GLIBCXX_CONCEPT_CHECKS"
fi
# ----------------- #
@@ -84,9 +82,12 @@
fi
-## -------------- ##
-## Dependencies. ##
-## -------------- ##
+## ----------- ##
+## Libraries. ##
+## ----------- ##
+
+# (Bundled) trimesh2 library.
+AC_CONFIG_SUBDIRS([external/trimesh])
# FreeImage library.
OLN_WITH_FREEIMAGEPLUS
@@ -107,6 +108,7 @@
# Ask for the Makefile creations.
AC_CONFIG_FILES([
Makefile
+ external/Makefile
milena/Makefile
milena/doc/Makefile
milena/tools/Makefile
Index: Makefile.am
--- Makefile.am (revision 2043)
+++ Makefile.am (working copy)
@@ -2,4 +2,4 @@
ACLOCAL_AMFLAGS = -I build-aux
-SUBDIRS = build-aux milena
+SUBDIRS = build-aux external milena
Index: external/Makefile.am
--- external/Makefile.am (revision 0)
+++ external/Makefile.am (revision 0)
@@ -0,0 +1,3 @@
+## Process this file through Automake to produce Makefile.in -*- Makefile -*-
+
+SUBDIRS = trimesh
Index: external/trimesh/include/Makefile.am
--- external/trimesh/include/Makefile.am (revision 0)
+++ external/trimesh/include/Makefile.am (revision 0)
@@ -0,0 +1,23 @@
+## Process this file through Automake to produce Makefile.in -*- Makefile -*-
+
+trimeshdir = $(includedir)/trimesh
+nobase_trimesh_HEADERS = \
+ GL/freeglut.h \
+ GL/freeglut_ext.h \
+ GL/freeglut_std.h \
+ GL/glui.h \
+ GL/glut.h \
+ \
+ bsphere.h \
+ Color.h \
+ GLCamera.h \
+ ICP.h \
+ KDtree.h \
+ lineqn.h \
+ mempool.h \
+ noise3d.h \
+ timestamp.h \
+ TriMesh.h \
+ TriMesh_algo.h \
+ Vec.h \
+ XForm.h
Index: external/trimesh/gluit/Makefile.am
--- external/trimesh/gluit/Makefile.am (revision 2041)
+++ external/trimesh/gluit/Makefile.am (working copy)
@@ -1,38 +1,19 @@
-#DEBUG = y
-MAKERULESDIR = ..
-DESTDIR = ../lib.$(UNAME)
-INCLUDES = -I../include -I../include/GL
+## Process this file through Automake to produce Makefile.in -*- Makefile -*-
-include $(MAKERULESDIR)/Makerules
-
-ifeq ($(UNAME),Darwin)
-CFILES =
-else
-CFILES = freeglut_callbacks.c \
- freeglut_cursor.c \
- freeglut_display.c \
- freeglut_ext.c \
- freeglut_font.c \
- freeglut_font_data.c \
- freeglut_gamemode.c \
- freeglut_geometry.c \
- freeglut_glutfont_definitions.c \
- freeglut_init.c \
- freeglut_joystick.c \
- freeglut_main.c \
- freeglut_menu.c \
- freeglut_misc.c \
- freeglut_overlay.c \
- freeglut_state.c \
- freeglut_stroke_mono_roman.c \
- freeglut_stroke_roman.c \
- freeglut_structure.c \
- freeglut_teapot.c \
- freeglut_videoresize.c \
- freeglut_window.c
-endif
-
-CCFILES = glui.cc \
+# Find config.h.
+AM_CPPFLAGS = -I$(top_builddir)
+AM_CPPFLAGS += -I$(top_srcdir)/include -I$(top_srcdir)/include/GL
+
+# FIXME: We should use Libtool instead.
+lib_LIBRARIES = libgluit.a
+
+libgluit_a_SOURCES = \
+ glui_algebra3.h \
+ glui_arcball.h \
+ glui_quaternion.h \
+ glui_stdinc.h \
+ \
+ glui.cc \
glui_add_controls.cc \
glui_algebra3.cc \
glui_arcball.cc \
@@ -57,19 +38,56 @@
glui_statictext.cc \
glui_translation.cc
-OFILES = $(addprefix $(OBJDIR)/,$(CFILES:.c=.o) $(CCFILES:.cc=.o))
-LIB = $(DESTDIR)/libgluit.a
-default: $(LIB)
-
-$(LIB): $(OFILES)
- $(STATICLIB)
-
-clean:
- -rm -f $(OFILES) $(OBJDIR)/Makedepend $(OBJDIR)/*.d
- -rm -rf $(OBJDIR)/ii_files
- -rmdir $(OBJDIR)
-
-spotless: clean
- -rm -f $(LIB)
- -rmdir $(DESTDIR)
-
+# These files are actually header, despite their `.c' extension!
+noinst_HEADERS = \
+ glui_img_checkbox_0.c \
+ glui_img_checkbox_0_dis.c \
+ glui_img_checkbox_1.c \
+ glui_img_checkbox_1_dis.c \
+ glui_img_downarrow.c \
+ glui_img_leftarrow.c \
+ glui_img_listbox_down.c \
+ glui_img_listbox_up.c \
+ glui_img_listbox_up_dis.c \
+ glui_img_radiobutton_0.c \
+ glui_img_radiobutton_0_dis.c \
+ glui_img_radiobutton_1.c \
+ glui_img_radiobutton_1_dis.c \
+ glui_img_rightarrow.c \
+ glui_img_spindown_0.c \
+ glui_img_spindown_1.c \
+ glui_img_spindown_dis.c \
+ glui_img_spinup_0.c \
+ glui_img_spinup_1.c \
+ glui_img_spinup_dis.c \
+ glui_img_uparrow.c
+
+# These files are not needed on Darwin (Mac OS X).
+if ! DARWIN
+ libgluit_a_SOURCES += \
+ freeglut_internal.h \
+ freeglut_teapot_data.h \
+ \
+ freeglut_callbacks.c \
+ freeglut_cursor.c \
+ freeglut_display.c \
+ freeglut_ext.c \
+ freeglut_font.c \
+ freeglut_font_data.c \
+ freeglut_gamemode.c \
+ freeglut_geometry.c \
+ freeglut_glutfont_definitions.c \
+ freeglut_init.c \
+ freeglut_joystick.c \
+ freeglut_main.c \
+ freeglut_menu.c \
+ freeglut_misc.c \
+ freeglut_overlay.c \
+ freeglut_state.c \
+ freeglut_stroke_mono_roman.c \
+ freeglut_stroke_roman.c \
+ freeglut_structure.c \
+ freeglut_teapot.c \
+ freeglut_videoresize.c \
+ freeglut_window.c
+endif ! DARWIN
Index: external/trimesh/utilsrc/Makefile.am
--- external/trimesh/utilsrc/Makefile.am (revision 2041)
+++ external/trimesh/utilsrc/Makefile.am (working copy)
@@ -1,46 +1,31 @@
-# DEBUG = y
-MAKERULESDIR = ..
-DESTDIR = ../bin.$(UNAME)
-INCLUDES = -I../include
-LIBDIR = -L../lib.$(UNAME)
+## Process this file through Automake to produce Makefile.in -*- Makefile -*-
-include $(MAKERULESDIR)/Makerules
+AM_CPPFLAGS = -I$(top_srcdir)/include
+AM_LDFLAGS = -L$(top_builddir)/libsrc -L$(top_builddir)/gluit -lm -ltrimesh
-VIEWSOURCES = mesh_view.cc
-
-OTHERSOURCES = mesh_align.cc \
- mesh_cat.cc \
- mesh_cc.cc \
- mesh_filter.cc \
- mesh_make.cc \
- mesh_shade.cc
-
-VIEWOFILES = $(addprefix $(OBJDIR)/,$(VIEWSOURCES:.cc=.o))
-OTHEROFILES = $(addprefix $(OBJDIR)/,$(OTHERSOURCES:.cc=.o))
-OFILES = $(VIEWOFILES) $(OTHEROFILES)
-
-VIEWPROG = $(DESTDIR)/mesh_view$(EXE)
-OTHERPROGS = $(addsuffix $(EXE), $(addprefix $(DESTDIR)/, $(OTHERSOURCES:.cc=)))
-PROGS = $(OTHERPROGS) $(VIEWPROG)
-
-default: $(PROGS)
-
-
-LIBS += -ltrimesh
-$(VIEWPROG) : $(VIEWOFILES)
- $(LINK) $(GLLIBS)
-
-$(OTHERPROGS) : $(DESTDIR)/%$(EXE) : $(OBJDIR)/%.o
- $(LINK)
-
-$(PROGS) : ../lib.$(UNAME)/libtrimesh.a
-
-clean :
- -rm -f $(OFILES) $(OBJDIR)/Makedepend $(OBJDIR)/*.d
- -rm -rf $(OBJDIR)/ii_files
- -rmdir $(OBJDIR)
-
-spotless : clean
- -rm -f $(PROGS)
- -rmdir $(DESTDIR)
+# FIXME: Handle other OSes as well (Win32, SunOS, etc.)
+if DARWIN
+# LIBS += -lobjc
+ GLLIBS = -framework GLUT -framework OpenGL -lgluit
+else !DARWIN
+ GLLIBS = -lgluit -lGL -lGLU -lX11 -lXmu -lXi
+endif !DARWIN
+
+bin_PROGRAMS = \
+ mesh_align \
+ mesh_cat \
+ mesh_cc \
+ mesh_filter \
+ mesh_make \
+ mesh_shade \
+ mesh_view
+
+mesh_align_SOURCES = mesh_align.cc
+mesh_cat_SOURCES = mesh_cat.cc
+mesh_cc_SOURCES = mesh_cc.cc
+mesh_filter_SOURCES = mesh_filter.cc
+mesh_make_SOURCES = mesh_make.cc
+mesh_shade_SOURCES = mesh_shade.cc
+mesh_view_SOURCES = mesh_view.cc
+mesh_view_LDFLAGS = $(AM_LDFLAGS) $(GLLIBS)
Index: external/trimesh/ChangeLog
--- external/trimesh/ChangeLog (revision 0)
+++ external/trimesh/ChangeLog (revision 0)
@@ -0,0 +1,21 @@
+2008-06-19 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Autoconfiscate the package.
+
+ * configure.ac: New.
+ * Makefile, gluit/Makefile, include/Makefile,
+ * libsrc/Makefile, utilsrc/Makefile:
+ Rename as...
+ * Makefile.am, gluit/Makefile.am, libsrc/Makefile.am,
+ * include/Makefile.am, utilsrc/Makefile.am:
+ ...these.
+ Convert these Makefiles to Automake.
+
+
+Local Variables:
+ispell-local-dictionary: "american"
+End:
+
+$Rev$
+$Id$
+$Date$
Property changes on: external/trimesh/ChangeLog
___________________________________________________________________
Name: svn:keywords
+ Rev
Id
Date
Index: external/trimesh/configure.ac
--- external/trimesh/configure.ac (revision 0)
+++ external/trimesh/configure.ac (revision 0)
@@ -0,0 +1,62 @@
+# -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ([2.61])
+
+AC_INIT([trimesh2], [2.8], [smr at princeton edu])
+
+# Auxiliary files.
+AC_CONFIG_AUX_DIR([build-aux])
+
+# Automake.
+AM_INIT_AUTOMAKE([1.10 foreign dist-bzip2 nostdinc -Wall])
+
+## --------------------- ##
+## C++ compiler set up. ##
+## --------------------- ##
+
+# If the user doesn't provide any CXXFLAGS, prevent Autoconf from
+# settings its own default ones (e.g., `-g -O2' for g++).
+if test ! ${CXXFLAGS+set}; then
+ CXXFLAGS=""
+fi
+
+# Look for a C compiler (used by freeglut).
+AC_LANG([C])
+AC_PROG_CC
+
+# Look for a C++ compiler.
+AC_LANG([C++])
+AC_PROG_CXX
+
+# Look for ranlib.
+AC_PROG_RANLIB
+
+# Speed up compiling times.
+if test "$GXX" = yes; then
+ CXXFLAGS="$CXXFLAGS -pipe"
+fi
+
+## ------------------ ##
+## Libraries set up. ##
+## ------------------ ##
+
+# Check for Darwin.
+AC_CANONICAL_HOST
+AM_CONDITIONAL([DARWIN], [echo "$host_os" | grep '^darwin'])
+
+## --------------- ##
+## Configuration. ##
+## --------------- ##
+
+# Ask for config.h.
+AM_CONFIG_HEADER([config.h])
+
+# Ask for the Makefile creations.
+AC_CONFIG_FILES([Makefile
+ gluit/Makefile
+ include/Makefile
+ libsrc/Makefile
+ utilsrc/Makefile])
+
+AC_OUTPUT
Index: external/trimesh/Makefile.am
--- external/trimesh/Makefile.am (revision 2041)
+++ external/trimesh/Makefile.am (working copy)
@@ -1,20 +1,21 @@
-all win32 linux32 linux64 clean:
- $(MAKE) -C libsrc $@
- $(MAKE) -C gluit $@
- $(MAKE) -C utilsrc $@
+## Process this file through Automake to produce Makefile.in -*- Makefile -*-
-debug:
- $(MAKE) -C libsrc DEBUG=y
- $(MAKE) -C gluit DEBUG=y
- $(MAKE) -C utilsrc DEBUG=y
-
-FINDCMD = find trimesh2 -name 'OBJ*' -prune -o -name CVS -prune -o -type f -print
-
-tar:
- cd .. && tar zcvf trimesh2.tar.gz `$(FINDCMD) | sort`
-
-zip:
- cd .. && $(FINDCMD) | sort | zip -9 trimesh2 -@
-
-.PHONY : all clean debug default tar win32 zip
+SUBDIRS = include libsrc gluit utilsrc
+# FIXME: These files are not used with the new (Autotool'd) build
+# system. We keep them until all their parameters have been
+# transferred to configure.ac and Makefile.am's (e.g., support for
+# Win32/Cygwin, etc.)
+EXTRA_DIST = \
+ Makedefs.Darwin \
+ Makedefs.Linux \
+ Makedefs.Linux64 \
+ Makedefs.SunOS \
+ Makedefs.Win32 \
+ Makerules
+
+# FIXME: Convert this to Automake.
+# debug:
+# $(MAKE) -C libsrc DEBUG=y
+# $(MAKE) -C gluit DEBUG=y
+# $(MAKE) -C utilsrc DEBUG=y
Index: external/trimesh/libsrc/Makefile.am
--- external/trimesh/libsrc/Makefile.am (revision 2041)
+++ external/trimesh/libsrc/Makefile.am (working copy)
@@ -1,11 +1,12 @@
-# DEBUG = y
-MAKERULESDIR = ..
-DESTDIR = ../lib.$(UNAME)
-INCLUDES = -I../include
+## Process this file through Automake to produce Makefile.in -*- Makefile -*-
-include $(MAKERULESDIR)/Makerules
+AM_CPPFLAGS = -I$(top_srcdir)/include
-CCFILES = TriMesh_bounding.cc \
+# FIXME: We should use Libtool instead.
+lib_LIBRARIES = libtrimesh.a
+
+libtrimesh_a_SOURCES = \
+ TriMesh_bounding.cc \
TriMesh_connectivity.cc \
TriMesh_curvature.cc \
TriMesh_io.cc \
@@ -26,20 +27,9 @@
reorder_verts.cc \
subdiv.cc
-
-OFILES = $(addprefix $(OBJDIR)/,$(CCFILES:.cc=.o))
-LIB = $(DESTDIR)/libtrimesh.a
-default: $(LIB)
-
-$(LIB): $(OFILES)
- $(STATICLIB)
-
-clean:
- -rm -f $(OFILES) $(OBJDIR)/Makedepend $(OBJDIR)/*.d
- -rm -rf $(OBJDIR)/ii_files
- -rmdir $(OBJDIR)
-
-spotless: clean
- -rm -f $(LIB)
- -rmdir $(DESTDIR)
-
+# FIXME: Convert this to Automake.
+# ifdef DEBUG
+# AM_CPPFLAGS += -DDEBUG
+# endif
+# debug:
+# $(MAKE) DEBUG=y
Index: external/README
--- external/README (revision 2043)
+++ external/README (working copy)
@@ -17,8 +17,8 @@
trimesh2 are open source, and are believed to be covered by
GPL-compatible licenses. Please see the COPYING file.''
-This version of trimesh2 shipped with Olena no longer contains the
-following files and directories:
+This version of trimesh2 shipped with Olena has been autoconfiscated,
+and no longer contains the following files and directories:
bin.Linux/
mesh_align
1
0
https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Make sub_image work again.
* doc/tutorial/examples/sub_image.cc: New.
* mln/trait/image/props.hh (ext_io): Fix missing subtype.
* mln/debug/println.hh: Update; now rely on geom::bbox.
* mln/core/macros.hh (mln_piter, mln_piter_): Fix definition.
Now rely on piter, no more on fwd_piter.
* mln/core/p_array.hh (mln_piter): New.
* mln/core/internal/image_base.hh (piter): New.
* mln/core/internal/check/image_fastest.hh: Update.
* mln/core/sub_image.hh (border, data): Update in props.
* mln/core/image2d.hh (typedef): Remove dangerous copy.
doc/tutorial/examples/sub_image.cc | 20 ++++++++++++++++++++
mln/core/image2d.hh | 17 -----------------
mln/core/internal/check/image_fastest.hh | 5 +++--
mln/core/internal/image_base.hh | 8 ++++++++
mln/core/macros.hh | 4 ++--
mln/core/p_array.hh | 3 +++
mln/core/sub_image.hh | 10 +++++-----
mln/debug/println.hh | 6 ++++--
mln/trait/image/props.hh | 4 +++-
9 files changed, 48 insertions(+), 29 deletions(-)
Index: doc/tutorial/examples/sub_image.cc
--- doc/tutorial/examples/sub_image.cc (revision 0)
+++ doc/tutorial/examples/sub_image.cc (revision 0)
@@ -0,0 +1,20 @@
+# include <mln/core/image2d.hh>
+# include <mln/core/sub_image.hh>
+
+# include <mln/debug/iota.hh>
+# include <mln/debug/println.hh>
+
+
+
+int main()
+{
+ using namespace mln;
+
+ typedef image2d<unsigned> I;
+ I ima(3, 5);
+ debug::iota(ima);
+ debug::println(ima);
+
+ sub_image<I, box2d> sub(ima, box2d(2,3));
+ debug::println(sub);
+}
Index: mln/trait/image/props.hh
--- mln/trait/image/props.hh (revision 2042)
+++ mln/trait/image/props.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
@@ -464,6 +464,8 @@
struct ext_io
{
struct any { protected: any() {} };
+ struct irrelevant
+ : any { std::string name() const { return "ext_io::irrelevant"; } };
struct read_only
: any { std::string name() const { return "ext_io::read_only"; } };
struct read_write
Index: mln/debug/println.hh
--- mln/debug/println.hh (revision 2042)
+++ mln/debug/println.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
@@ -35,6 +35,7 @@
# include <mln/core/concept/image.hh>
# include <mln/core/concept/window.hh>
+# include <mln/geom/bbox.hh>
# include <mln/debug/format.hh>
// Specializations are in:
@@ -78,7 +79,8 @@
void
println(const Image<I>& input)
{
- impl::println(exact(input).bbox(), exact(input));
+ impl::println(geom::bbox(exact(input).domain()),
+ exact(input));
}
# endif // ! MLN_INCLUDE_ONLY
Index: mln/core/macros.hh
--- mln/core/macros.hh (revision 2042)
+++ mln/core/macros.hh (working copy)
@@ -198,8 +198,8 @@
/// Shortcuts to access the type of point iterator (piter) associated to T.
/// \{
-# define mln_piter(T) typename T::fwd_piter
-# define mln_piter_(T) T::fwd_piter
+# define mln_piter(T) typename T::piter
+# define mln_piter_(T) T::piter
/// \}
/// Shortcuts to access the type of point by line iterator
Index: mln/core/internal/image_base.hh
--- mln/core/internal/image_base.hh (revision 2042)
+++ mln/core/internal/image_base.hh (working copy)
@@ -78,6 +78,7 @@
};
+
template <typename E>
struct image_checked_
:
@@ -87,6 +88,7 @@
};
+
/*! \internal A base class for images.
* Parameter \p S is a point set type.
*
@@ -106,6 +108,7 @@
/// Point associated type.
typedef mln_site(S) site;
+
/// Forward Site_Iterator associated type.
typedef mln_fwd_piter(S) fwd_piter;
@@ -113,6 +116,11 @@
typedef mln_bkd_piter(S) bkd_piter;
+ /// Site_Iterator associated type; default definition is
+ /// fwd_piter.
+ typedef fwd_piter piter;
+
+
/// Test if \p p belongs to the image domain.
bool has(const psite& p) const;
Index: mln/core/internal/check/image_fastest.hh
--- mln/core/internal/check/image_fastest.hh (revision 2042)
+++ mln/core/internal/check/image_fastest.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
@@ -87,7 +87,8 @@
image_fastest_<E,B>::image_fastest_()
{
typedef mln_site(E) site;
- typedef mln_dpsite(E) dpsite;
+ typedef mln_psite(E) psite;
+ typedef mln_delta(psite) dpsite;
typedef mln_fwd_pixter(E) fwd_pixter;
typedef mln_bkd_pixter(E) bkd_pixter;
Index: mln/core/sub_image.hh
--- mln/core/sub_image.hh (revision 2042)
+++ mln/core/sub_image.hh (working copy)
@@ -78,14 +78,14 @@
typedef trait::image::category::domain_morpher category;
- typedef trait::image::border::none border; // no more accessible border
+ typedef trait::image::ext_domain::none ext_domain; // No extension of domain.
+ typedef trait::image::ext_value::irrelevant ext_value;
+ typedef trait::image::ext_io::irrelevant ext_io;
typedef mln_trait_image_io_from_(I) io; // un-write when I const
- typedef mln_trait_image_data_from_(I) data;
-// typedef mlc_if( I_data_are_linear_,
-// trait::data::stored, // if linear then just stored
-// I_data_ ) data; // otherwise like I
+ typedef trait::image::value_storage::disrupted value_storage;
+ // HOT FIXME: except if S is a Box
};
} // end of namespace mln::trait
Index: mln/core/p_array.hh
--- mln/core/p_array.hh (revision 2042)
+++ mln/core/p_array.hh (working copy)
@@ -148,6 +148,9 @@
/// The associated site type.
typedef typename super::site site;
+ /// Site_Iterator associated type.
+ typedef p_array_fwd_piter_<P> piter;
+
/// Forward Site_Iterator associated type.
typedef p_array_fwd_piter_<P> fwd_piter;
Index: mln/core/image2d.hh
--- mln/core/image2d.hh (revision 2042)
+++ mln/core/image2d.hh (working copy)
@@ -122,23 +122,6 @@
template <typename T>
struct image2d : public internal::image_primary_< box2d, image2d<T> >
{
- typedef point2d point; // FIXME: HOT: to be removed.
-
-
- // Warning: just to make effective types appear in Doxygen:
-
- typedef box2d pset;
-
- typedef point2d psite;
- typedef point2d site;
- typedef dpoint2d dpsite;
-
- typedef mln_fwd_piter(box2d) fwd_piter;
- typedef mln_bkd_piter(box2d) bkd_piter;
-
- // End of warning.
-
-
/// Value associated type.
typedef T value;
1
0
https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Starting the migration point -> site.
This patch is a start to fix the point / site ambiguity due to
genericity. The main idea is to deactivate the point-related
macros so that a lot of "non-generic" code does not work anymore.
We change mln_[d]point(I) into mln_[d]psite(I) in order to have
"probably-generic" code work again. Then fix code from the
doc tutorial examples.
Step 1.
* mln/core/macros.hh (mln_point, mln_point_): Deactivate.
(mln_dpoint, mln_dpoint_): Likewise.
Step 2.
* mln/subsampling/subsampling.hh,
* mln/subsampling/gaussian_subsampling.hh,
* mln/debug/println_with_border.spe.hh,
* mln/core/translate_image.hh,
* mln/core/sparse_encode.hh,
* mln/core/interpolated.hh,
* mln/core/value_encode.hh,
* mln/core/mono_obased_rle_encode.hh,
* mln/core/pixel.hh,
* mln/core/t_image.hh,
* mln/core/mono_rle_encode.hh,
* mln/core/tr_image.hh,
* mln/core/init.hh,
* mln/core/obased_rle_encode.hh,
* mln/core/rle_encode.hh,
* mln/core/a_point_of.hh,
* mln/draw/line.hh,
* mln/draw/box.hh,
* mln/level/fill.hh,
* mln/level/memset_.hh,
* mln/level/median.hh,
* mln/level/paste.spe.hh,
* mln/linear/line_convolve.hh,
* mln/linear/gaussian.hh,
* mln/make/pixel.hh,
* mln/make/voronoi.hh,
* mln/border/fill.hh,
* mln/border/duplicate.hh,
* mln/border/mirror.hh,
* mln/convert/to_window.hh,
* mln/convert/to_p_set.hh,
* mln/convert/to_w_window.hh,
* mln/geom/pmin_pmax.hh,
* mln/geom/resize.hh,
* mln/morpho/erosion_fast.hh,
* mln/morpho/rank_filter.hh,
* mln/morpho/Rd.hh,
* mln/morpho/dilation_fast.hh,
* mln/display/color_pretty.hh,
* mln/canvas/chamfer.hh,
* mln/canvas/browsing/dir_struct_elt_incr_update.hh,
* mln/canvas/browsing/directional.hh,
* mln/canvas/labeling.hh,
* mln/util/greater_point.hh,
* mln/util/lemmings.hh,
* sandbox/duhamel/translate_image.hh,
* sandbox/duhamel/canvas_chamfer.hh,
* sandbox/duhamel/canvas_labeling.hh,
* sandbox/duhamel/labeling_algo.hh,
* sandbox/duhamel/border_duplicate.hh,
* sandbox/duhamel/draw_mesh.hh,
* sandbox/duhamel/debug_print_3d_with_border.hh,
* sandbox/duhamel/labeling_cpy_from_mln.hh,
* sandbox/duhamel/border_fill.hh,
* sandbox/duhamel/labeling_level.hh,
* sandbox/duhamel/labeling.hh,
* sandbox/nivault/median.hh,
* sandbox/jardonnet/subsampling/gaussian_subsampling.hh,
* sandbox/jardonnet/subsampling/sub_sampled_image.hh,
* sandbox/jardonnet/registration/tools.hh,
* sandbox/jardonnet/registration/chamfer.hh,
* sandbox/geraud/cs2d/cs2d_morpho.hh,
* sandbox/garrigues/image_identity/interpolated.hh,
* sandbox/folio/canevas_dt.hh (mln_point(I)): Rename as...
(mln_psite(I)): ...this.
(mln_dpoint(I)): Rename as...
(mln_dpsite(I)): ...this.
Step 3.
* doc/tutorial/examples/p_array.2.cc: New test; == on window<D>.
* mln/core/window.hh (operator==): New.
(is_symmetric): Rewrite.
(include): Remove dependencies to box, dpoint, and sym.
(todo): New one.
* mln/core/dpoints_pixter.hh (point_site): Remove dependency.
* mln/core/concept/value_iterator.hh: Likewise.
* mln/core/concept/site_set.hh: Likewise.
* mln/core/concept/window.hh (operator==): Remove; this operator
cannot be general.
* mln/geom/bbox.hh (bbox): Remove all overloads except...
(bbox): ...this and rewrite it.
* mln/util/set.hh: Add inheritance from Object.
(operator): New bunch of operators.
doc/tutorial/examples/p_array.2.cc | 2
mln/border/duplicate.hh | 8 -
mln/border/fill.hh | 8 -
mln/border/mirror.hh | 2
mln/canvas/browsing/dir_struct_elt_incr_update.hh | 4
mln/canvas/browsing/directional.hh | 2
mln/canvas/chamfer.hh | 2
mln/canvas/labeling.hh | 2
mln/convert/to_p_set.hh | 8 -
mln/convert/to_w_window.hh | 6
mln/convert/to_window.hh | 6
mln/core/a_point_of.hh | 4
mln/core/concept/site_set.hh | 1
mln/core/concept/value_iterator.hh | 3
mln/core/concept/window.hh | 32 ----
mln/core/dpoints_pixter.hh | 17 +-
mln/core/init.hh | 2
mln/core/interpolated.hh | 4
mln/core/macros.hh | 20 +--
mln/core/mono_obased_rle_encode.hh | 12 -
mln/core/mono_rle_encode.hh | 12 -
mln/core/obased_rle_encode.hh | 12 -
mln/core/pixel.hh | 10 -
mln/core/rle_encode.hh | 12 -
mln/core/sparse_encode.hh | 12 -
mln/core/t_image.hh | 42 +++---
mln/core/tr_image.hh | 6
mln/core/translate_image.hh | 16 +-
mln/core/value_encode.hh | 12 -
mln/core/window.hh | 24 ++-
mln/debug/println_with_border.spe.hh | 2
mln/display/color_pretty.hh | 24 +--
mln/draw/box.hh | 12 -
mln/draw/line.hh | 4
mln/geom/bbox.hh | 116 ++++++------------
mln/geom/pmin_pmax.hh | 12 -
mln/geom/resize.hh | 2
mln/level/fill.hh | 6
mln/level/median.hh | 12 -
mln/level/memset_.hh | 4
mln/level/paste.spe.hh | 2
mln/linear/gaussian.hh | 8 -
mln/linear/line_convolve.hh | 2
mln/make/pixel.hh | 8 -
mln/make/voronoi.hh | 2
mln/morpho/Rd.hh | 6
mln/morpho/dilation_fast.hh | 4
mln/morpho/erosion_fast.hh | 4
mln/morpho/rank_filter.hh | 2
mln/subsampling/gaussian_subsampling.hh | 4
mln/subsampling/subsampling.hh | 4
mln/util/greater_point.hh | 4
mln/util/lemmings.hh | 28 ++--
mln/util/set.hh | 54 ++++++++
sandbox/duhamel/border_duplicate.hh | 8 -
sandbox/duhamel/border_fill.hh | 20 +--
sandbox/duhamel/canvas_chamfer.hh | 2
sandbox/duhamel/canvas_labeling.hh | 4
sandbox/duhamel/debug_print_3d_with_border.hh | 2
sandbox/duhamel/draw_mesh.hh | 2
sandbox/duhamel/labeling.hh | 2
sandbox/duhamel/labeling_algo.hh | 4
sandbox/duhamel/labeling_cpy_from_mln.hh | 4
sandbox/duhamel/labeling_level.hh | 2
sandbox/duhamel/translate_image.hh | 16 +-
sandbox/folio/canevas_dt.hh | 4
sandbox/garrigues/image_identity/interpolated.hh | 4
sandbox/geraud/cs2d/cs2d_morpho.hh | 2
sandbox/jardonnet/registration/chamfer.hh | 22 +--
sandbox/jardonnet/registration/tools.hh | 4
sandbox/jardonnet/subsampling/gaussian_subsampling.hh | 4
sandbox/jardonnet/subsampling/sub_sampled_image.hh | 40 +++---
sandbox/nivault/median.hh | 10 -
73 files changed, 394 insertions(+), 391 deletions(-)
Index: doc/tutorial/examples/p_array.2.cc
--- doc/tutorial/examples/p_array.2.cc (revision 2040)
+++ doc/tutorial/examples/p_array.2.cc (working copy)
@@ -60,6 +60,8 @@
std::cout << "win = " << win << std::endl
<< std::endl;
+ mln_assertion(win == win);
+
util::index i;
mln_qiter_(W) j(win, i);
int n = arr.nsites();
Index: mln/subsampling/subsampling.hh
--- mln/subsampling/subsampling.hh (revision 2040)
+++ mln/subsampling/subsampling.hh (working copy)
@@ -51,7 +51,7 @@
inline
mln_concrete(I)
subsampling(const Image<I>& input,
- const mln_dpoint(I)& first_p,
+ const mln_dpsite(I)& first_p,
const mln_coord(I)& gap);
# ifndef MLN_INCLUDE_ONLY
@@ -92,7 +92,7 @@
inline
mln_concrete(I)
subsampling(const Image<I>& input,
- const mln_dpoint(I)& first_p,
+ const mln_dpsite(I)& first_p,
const mln_coord(I)& gap)
{
trace::entering("subsampling::subsampling");
Index: mln/subsampling/gaussian_subsampling.hh
--- mln/subsampling/gaussian_subsampling.hh (revision 2040)
+++ mln/subsampling/gaussian_subsampling.hh (working copy)
@@ -56,7 +56,7 @@
inline
mln_concrete(I)
gaussian_subsampling(const Image<I>& input, float sigma
- const mln_dpoint(I)& first_p,
+ const mln_dpsite(I)& first_p,
const mln_coord(I)& gap);
# ifndef MLN_INCLUDE_ONLY
@@ -66,7 +66,7 @@
inline
mln_concrete(I)
gaussian_subsampling(const Image<I>& input, float sigma,
- const mln_dpoint(I)& first_p,
+ const mln_dpsite(I)& first_p,
const mln_coord(I)& gap)
{
trace::entering("subsampling::gaussian_subsampling");
Index: mln/debug/println_with_border.spe.hh
--- mln/debug/println_with_border.spe.hh (revision 2040)
+++ mln/debug/println_with_border.spe.hh (working copy)
@@ -79,7 +79,7 @@
void
println_with_border(const box3d& b, const I& input)
{
- typedef mln_point(I) P;
+ typedef mln_psite(I) P;
std::size_t len_s = b.len(P::dim - 3);
std::size_t len_r = b.len(P::dim - 2);
Index: mln/core/macros.hh
--- mln/core/macros.hh (revision 2040)
+++ mln/core/macros.hh (working copy)
@@ -97,11 +97,11 @@
# define mln_delta_(T) T::delta
/// \}
-/// Shortcuts to access the dpoint type associated to T.
-/// \{
-# define mln_dpoint(T) typename T::dpoint
-# define mln_dpoint_(T) T::dpoint
-/// \}
+// /// Shortcuts to access the dpoint type associated to T.
+// /// \{
+// # define mln_dpoint(T) typename T::dpoint
+// # define mln_dpoint_(T) T::dpoint
+// /// \}
/// Shortcuts to access the dpsite type associated to T.
/// \{
@@ -221,11 +221,11 @@
# define mln_psite_(T) T::psite
/// \}
-/// Shortcuts to access the point type associated to T.
-/// \{
-# define mln_point(T) typename T::point
-# define mln_point_(T) T::point
-/// \}
+// /// Shortcuts to access the point type associated to T.
+// /// \{
+// # define mln_point(T) typename T::point
+// # define mln_point_(T) T::point
+// /// \}
// q
Index: mln/core/translate_image.hh
--- mln/core/translate_image.hh (revision 2040)
+++ mln/core/translate_image.hh (working copy)
@@ -53,7 +53,7 @@
template <typename I>
struct data_< translate_image<I> >
{
- data_(I& ima, const mln_dpoint(I) dp);
+ data_(I& ima, const mln_dpsite(I) dp);
I ima_;
@@ -61,7 +61,7 @@
box2d bb_;
/// Delta point of translation.
- const mln_dpoint(I) dp_;
+ const mln_dpsite(I) dp_;
};
} // end of namespace mln::internal
@@ -114,7 +114,7 @@
using super_::has_data;
/// Constructors.
- translate_image(I& ima, const mln_dpoint(I) dp);
+ translate_image(I& ima, const mln_dpsite(I) dp);
translate_image();
/// Return domain of translated_image.
@@ -141,7 +141,7 @@
template <typename I>
inline
- data_< translate_image<I> >::data_(I& ima, const mln_dpoint(I) dp)
+ data_< translate_image<I> >::data_(I& ima, const mln_dpsite(I) dp)
: ima_ (ima),
dp_ (dp)
{
@@ -159,7 +159,7 @@
template <typename I>
inline
- translate_image<I>::translate_image(I& ima, const mln_dpoint(I) dp)
+ translate_image<I>::translate_image(I& ima, const mln_dpsite(I) dp)
{
mln_precondition(ima.has_data());
this->data_ = new internal::data_< translate_image<I> >(ima, dp);
@@ -175,7 +175,7 @@
inline
bool translate_image<I>::has(const mln_psite(I)& p) const
{
- mln_point(I) np = p - this->data_->dp_;
+ mln_psite(I) np = p - this->data_->dp_;
return this->data_->ima_.has(np);
}
@@ -185,7 +185,7 @@
translate_image<I>::operator()(const mln_psite(I)& p) const
{
mln_assertion(this->has(p));
- mln_point(I) np = p - this->data_->dp_;
+ mln_psite(I) np = p - this->data_->dp_;
return this->data_->ima_(np);
}
@@ -196,7 +196,7 @@
translate_image<I>::operator()(const mln_psite(I)& p)
{
mln_assertion(this->has(p));
- mln_point(I) np = p - this->data_->dp_;
+ mln_psite(I) np = p - this->data_->dp_;
return this->data_->ima_(np);
}
Index: mln/core/window.hh
--- mln/core/window.hh (revision 2040)
+++ mln/core/window.hh (working copy)
@@ -34,15 +34,13 @@
*
* \todo Make naming coherent: we have window (without '_') but
* point_, neighb_, etc.
+ *
+ * \todo Code other comparisons (< and <=).
*/
# include <mln/core/internal/window_base.hh>
# include <mln/core/internal/basic_window_impl.hh>
-# include <mln/core/dpoint.hh>
-# include <mln/core/box.hh>
-# include <mln/convert/to_dpoint.hh>
-# include <mln/geom/sym.hh>
# include <mln/metal/is_a.hh>
@@ -89,6 +87,15 @@
+ /*! \brief Equality comparison between windows \p lhs and \p rhs.
+ *
+ * \relates mln::window<D>
+ */
+ template <typename D>
+ bool operator==(const window<D>& lhs, const window<D>& rhs);
+
+
+
# ifndef MLN_INCLUDE_ONLY
// window<D>
@@ -105,7 +112,8 @@
inline
bool window<D>::is_symmetric() const
{
- return geom::sym(*this) == *this;
+ window<D> cpy = *this;
+ return cpy.sym() == *this;
}
template <typename D>
@@ -134,6 +142,12 @@
return ostr << win.dps_hook();
}
+ template <typename D>
+ bool operator==(const window<D>& lhs, const window<D>& rhs)
+ {
+ return lhs.dps_hook() == rhs.dps_hook();
+ }
+
# endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln
Index: mln/core/sparse_encode.hh
--- mln/core/sparse_encode.hh (revision 2040)
+++ mln/core/sparse_encode.hh (working copy)
@@ -47,7 +47,7 @@
** @return sparse_image
*/
template <typename I>
- sparse_image<mln_point(I), mln_value(I)>
+ sparse_image<mln_psite(I), mln_value(I)>
sparse_encode(const Image<I>& input, bool ignore_zero = true);
# ifndef MLN_INCLUDE_ONLY
@@ -69,16 +69,16 @@
template <typename I>
inline
- sparse_image<mln_point(I), mln_value(I)>
+ sparse_image<mln_psite(I), mln_value(I)>
sparse_encode(const Image<I>& input, bool ignore_zero)
{
- typedef mln_point(I) P;
+ typedef mln_psite(I) P;
- sparse_image<mln_point(I), mln_value(I)> output;
+ sparse_image<mln_psite(I), mln_value(I)> output;
const I& ima = exact(input);
mln_piter(I) p (exact(input).domain());
unsigned len = 0;
- mln_point(I) rstart;
+ mln_psite(I) rstart;
std::vector< mln_value(I) > rvalue;
rvalue.clear();
@@ -93,7 +93,7 @@
}
else
if ((!ignore_zero || ima(p) != literal::zero) &&
- on_the_same_line(rstart, mln_point(I)(p), len))
+ on_the_same_line(rstart, mln_psite(I)(p), len))
{
++len;
rvalue.push_back(ima(p));
Index: mln/core/dpoints_pixter.hh
--- mln/core/dpoints_pixter.hh (revision 2040)
+++ mln/core/dpoints_pixter.hh (working copy)
@@ -37,7 +37,6 @@
# include <vector>
# include <mln/core/concept/pixel_iterator.hh>
-# include <mln/core/concept/point_site.hh>
# include <mln/core/internal/pixel_impl.hh>
@@ -70,7 +69,7 @@
template <typename Dps, typename Pref>
dpoints_fwd_pixter(I& image,
const Dps& dps,
- const Point_Site<Pref>& p_ref);
+ const Pref& p_ref);
/// \brief Constructor (using a generalized pixel).
///
@@ -122,7 +121,7 @@
/// Reference value the image
mln_qlf_value(I)** value_ref_;
/// Reference pixel / point in the image
- const mln_point(I)* p_ref_;
+ const mln_psite(I)* p_ref_;
/// \}
};
@@ -153,7 +152,7 @@
template <typename Dps, typename Pref>
dpoints_bkd_pixter(I& image,
const Dps& dps,
- const Point_Site<Pref>& p_ref);
+ const Pref& p_ref);
/// \brief Constructor (using a generalized pixel).
///
@@ -205,7 +204,7 @@
/// Reference value the image
mln_qlf_value(I)** value_ref_;
/// Reference pixel / point in the image
- const mln_point(I)* p_ref_;
+ const mln_psite(I)* p_ref_;
/// \}
};
@@ -222,11 +221,11 @@
inline
dpoints_fwd_pixter<I>::dpoints_fwd_pixter(I& image,
const Dps& dps,
- const Point_Site<Pref>& p_ref)
+ const Pref& p_ref)
: super_(image)
{
mln_precondition(image.has_data());
- p_ref_ = & exact(p_ref).to_point();
+ p_ref_ = & exact(p_ref).to_site();
value_ref_ = 0;
init_(dps);
}
@@ -333,11 +332,11 @@
inline
dpoints_bkd_pixter<I>::dpoints_bkd_pixter(I& image,
const Dps& dps,
- const Point_Site<Pref>& p_ref)
+ const Pref& p_ref)
: super_(image)
{
mln_precondition(image.has_data());
- p_ref_ = & exact(p_ref).to_point();
+ p_ref_ = & exact(p_ref).to_site();
value_ref_ = 0;
init_(dps);
}
Index: mln/core/interpolated.hh
--- mln/core/interpolated.hh (revision 2040)
+++ mln/core/interpolated.hh (working copy)
@@ -158,7 +158,7 @@
inline
bool interpolated<I>::has(const mln::algebra::vec<I::point::dim, float>& v) const
{
- mln_point(I) p;
+ mln_psite(I) p;
for (unsigned i = 0; i < I::point::dim; ++i)
p[i] = static_cast<int>(round(v[i]));
return this->data_->ima_.has(p);
@@ -169,7 +169,7 @@
mln_value(I)
interpolated<I>::operator()(const mln::algebra::vec<I::point::dim, float>& v) const
{
- mln_point(I) p;
+ mln_psite(I) p;
for (unsigned i = 0; i < I::point::dim; ++i)
p[i] = static_cast<int>(round(v[i]));
mln_assertion(this->data_->ima_.has(p));
Index: mln/core/value_encode.hh
--- mln/core/value_encode.hh (revision 2040)
+++ mln/core/value_encode.hh (working copy)
@@ -48,7 +48,7 @@
** @return value_enc_image
*/
template <typename I>
- value_enc_image<mln_point(I), mln_value(I)>
+ value_enc_image<mln_psite(I), mln_value(I)>
value_encode(const Image<I>& input, bool ignore_zero = true);
# ifndef MLN_INCLUDE_ONLY
@@ -70,15 +70,15 @@
template <typename I>
inline
- value_enc_image<mln_point(I), mln_value(I)>
+ value_enc_image<mln_psite(I), mln_value(I)>
value_encode(const Image<I>& input, bool ignore_zero)
{
- value_enc_image<mln_point(I), mln_value(I)> output;
+ value_enc_image<mln_psite(I), mln_value(I)> output;
const I& ima = exact(input);
mln_piter(I) p (exact(input).domain());
unsigned len = 0;
- mln_point(I) rstart;
+ mln_psite(I) rstart;
mln_value(I) rvalue;
for_all(p)
@@ -92,12 +92,12 @@
}
else
if (rvalue == ima(p)
- && on_the_same_line(rstart, mln_point(I)(p)))
+ && on_the_same_line(rstart, mln_psite(I)(p)))
++len;
else
{
//FIXME is it right??
- output.insert(p_run<mln_point(I)>(rstart, len), rvalue);
+ output.insert(p_run<mln_psite(I)>(rstart, len), rvalue);
if ((len = (!ignore_zero || ima(p) != literal::zero)))
{
rstart = p;
Index: mln/core/mono_obased_rle_encode.hh
--- mln/core/mono_obased_rle_encode.hh (revision 2040)
+++ mln/core/mono_obased_rle_encode.hh (working copy)
@@ -47,7 +47,7 @@
** @return mono_obased_rle_image.
*/
template <typename I>
- mono_obased_rle_image<mln_point(I), mln_value(I)>
+ mono_obased_rle_image<mln_psite(I), mln_value(I)>
mono_obased_rle_encode(const Image<I>& input, bool ignore_zero = true);
# ifndef MLN_INCLUDE_ONLY
@@ -69,15 +69,15 @@
template <typename I>
inline
- mono_obased_rle_image<mln_point(I), mln_value(I)>
+ mono_obased_rle_image<mln_psite(I), mln_value(I)>
mono_obased_rle_encode(const Image<I>& input, bool ignore_zero)
{
- typedef mln_point(I) P;
+ typedef mln_psite(I) P;
const I& ima = exact(input);
mln_piter(I) p (exact(input).domain());
unsigned len = 0;
- mln_point(I) rstart;
+ mln_psite(I) rstart;
mln_value(I) rvalue;
std::set< mln_value(I) > sv;
@@ -87,7 +87,7 @@
sv.insert(ima(p));
}
- mono_obased_rle_image<mln_point(I), mln_value(I)> output(sv);
+ mono_obased_rle_image<mln_psite(I), mln_value(I)> output(sv);
for_all(p)
if (!ignore_zero || ima(p) != literal::zero || len)
{
@@ -99,7 +99,7 @@
}
else
if (rvalue == ima(p)
- && on_the_same_line(rstart, mln_point(I)(p)))
+ && on_the_same_line(rstart, mln_psite(I)(p)))
++len;
else
{
Index: mln/core/pixel.hh
--- mln/core/pixel.hh (revision 2040)
+++ mln/core/pixel.hh (working copy)
@@ -54,10 +54,10 @@
pixel(I& image);
/// Constructor.
- pixel(I& image, const mln_point(I)& p);
+ pixel(I& image, const mln_psite(I)& p);
/// Change the pixel to the one at point \p p.
- void change_to(const mln_point(I)& p);
+ void change_to(const mln_psite(I)& p);
/// Test if this pixel is valid.
bool is_valid() const;
@@ -78,7 +78,7 @@
template <typename I>
inline
- pixel<I>::pixel(I& image, const mln_point(I)& p)
+ pixel<I>::pixel(I& image, const mln_psite(I)& p)
: super(image)
{
mln_precondition(this->image_.has(p));
@@ -88,7 +88,7 @@
template <typename I>
inline
void
- pixel<I>::change_to(const mln_point(I)& p)
+ pixel<I>::change_to(const mln_psite(I)& p)
{
mln_precondition(this->image_.has(p));
this->value_ptr_ = & this->image_(p);
@@ -102,7 +102,7 @@
if (this->value_ptr_ == 0 || ! this->image_.has_data())
return false;
int o = this->value_ptr_ - this->image_.buffer();
- mln_point(I) p = this->image_.point_at_offset(o);
+ mln_psite(I) p = this->image_.point_at_offset(o);
return this->image_.has(p);
}
Index: mln/core/t_image.hh
--- mln/core/t_image.hh (revision 2040)
+++ mln/core/t_image.hh (working copy)
@@ -57,7 +57,7 @@
/// \param dim2 The second dimension to be swapped.
/// \param box The bounding box (domain) of the morphed image.
data_(I& ima, unsigned dim1, unsigned dim2,
- mln::box_<mln_point(I)>& box);
+ mln::box_<mln_psite(I)>& box);
/// Underlying image.
I ima_;
@@ -67,7 +67,7 @@
unsigned dim2_;
/// \}
/// The bounding box of the morphed image.
- mln::box_<mln_point(I)> box_;
+ mln::box_<mln_psite(I)> box_;
};
} // end of namespace mln::internal
@@ -127,25 +127,25 @@
bool has_data() const;
/// Test if a pixel value is accessible at \p p.
- bool has(const mln_point(I)& p) const;
+ bool has(const mln_psite(I)& p) const;
/// Give the definition domain.
- const box_<mln_point(I)>& domain() const;
+ const box_<mln_psite(I)>& domain() const;
/// Read-only access of pixel value at point site \p p.
- mln_rvalue(I) operator()(const mln_point(I)& p) const;
+ mln_rvalue(I) operator()(const mln_psite(I)& p) const;
/// Read-write access of pixel value at point site \p p.
- lvalue operator()(const mln_point(I)& p);
+ lvalue operator()(const mln_psite(I)& p);
/// Give the set of values of the image.
const vset& values() const;
protected:
/// Exchange components \a dim1_ and \a dim2_ of point \a p.
- mln_point(I) transpose_(const mln_point(I)& p) const;
+ mln_psite(I) transpose_(const mln_psite(I)& p) const;
/// Exchange components \a dim1 and \a dim2 of point \a p.
- mln_point(I) exchange_coords_(const mln_point(I)& p,
+ mln_psite(I) exchange_coords_(const mln_psite(I)& p,
unsigned dim1, unsigned dim2) const;
};
@@ -174,7 +174,7 @@
inline
data_< t_image<I> >::data_(I& ima,
unsigned dim1, unsigned dim2,
- mln::box_<mln_point(I)>& box)
+ mln::box_<mln_psite(I)>& box)
: ima_(ima),
dim1_(dim1), dim2_(dim2),
box_(box)
@@ -194,7 +194,7 @@
// We don't use mln::t_image::transpose here, since one its
// prerequisite is that data_ is initialized, which is not done
// yet at this point.
- box_<mln_point(I)> box(exchange_coords_(ima.bbox().pmin(), dim1, dim2),
+ box_<mln_psite(I)> box(exchange_coords_(ima.bbox().pmin(), dim1, dim2),
exchange_coords_(ima.bbox().pmax(), dim1, dim2));
this->data_ = new internal::data_< t_image<I> >(ima, dim1, dim2, box);
}
@@ -210,7 +210,7 @@
template <typename I>
inline
bool
- t_image<I>::has(const mln_point(I)& p) const
+ t_image<I>::has(const mln_psite(I)& p) const
{
mln_precondition(this->has_data());
return this->delegatee_()->has(transpose_(p));
@@ -218,8 +218,8 @@
template <typename I>
inline
- mln_point(I)
- t_image<I>::transpose_(const mln_point(I)& p) const
+ mln_psite(I)
+ t_image<I>::transpose_(const mln_psite(I)& p) const
{
mln_precondition(this->has_data());
return exchange_coords_(p, this->data_->dim1_, this->data_->dim2_);
@@ -227,11 +227,11 @@
template <typename I>
inline
- mln_point(I)
- t_image<I>::exchange_coords_(const mln_point(I)& p,
+ mln_psite(I)
+ t_image<I>::exchange_coords_(const mln_psite(I)& p,
unsigned dim1, unsigned dim2) const
{
- mln_point(I) tmp(p);
+ mln_psite(I) tmp(p);
tmp[dim1] = p[dim2];
tmp[dim2] = p[dim1];
return tmp;
@@ -239,7 +239,7 @@
template <typename I>
inline
- const box_<mln_point(I)>&
+ const box_<mln_psite(I)>&
t_image<I>::domain() const
{
mln_precondition(this->has_data());
@@ -249,7 +249,7 @@
template <typename I>
inline
mln_rvalue(I)
- t_image<I>::operator()(const mln_point(I)& p) const
+ t_image<I>::operator()(const mln_psite(I)& p) const
{
mln_precondition(this->has(p));
return (*this->delegatee_())(transpose_(p));
@@ -258,7 +258,7 @@
template <typename I>
inline
typename internal::morpher_lvalue_<I>::ret
- t_image<I>::operator()(const mln_point(I)& p)
+ t_image<I>::operator()(const mln_psite(I)& p)
{
mln_precondition(this->has(p));
return (*this->delegatee_())(transpose_(p));
@@ -279,7 +279,7 @@
t_image<I>
swap_coords(Image<I>& ima, unsigned dim1, unsigned dim2)
{
- typedef mln_point(I) P;
+ typedef mln_psite(I) P;
mln_precondition(dim1 != dim2);
mln_precondition(dim1 <= P::dim && dim2 <= P::dim);
t_image<I> tmp(exact(ima), dim1, dim2);
@@ -291,7 +291,7 @@
t_image<const I>
swap_coords(const Image<I>& ima, unsigned dim1, unsigned dim2)
{
- typedef mln_point(I) P;
+ typedef mln_psite(I) P;
mln_precondition(dim1 != dim2);
mln_precondition(dim1 <= P::dim && dim2 <= P::dim);
t_image<const I> tmp(exact(ima), dim1, dim2);
Index: mln/core/mono_rle_encode.hh
--- mln/core/mono_rle_encode.hh (revision 2040)
+++ mln/core/mono_rle_encode.hh (working copy)
@@ -47,7 +47,7 @@
** @return mono_rle_image
*/
template <typename I>
- mono_rle_image<mln_point(I), mln_value(I)>
+ mono_rle_image<mln_psite(I), mln_value(I)>
mono_rle_encode(const Image<I>& input, mln_value(I) val);
# ifndef MLN_INCLUDE_ONLY
@@ -69,16 +69,16 @@
template <typename I>
inline
- mono_rle_image<mln_point(I), mln_value(I)>
+ mono_rle_image<mln_psite(I), mln_value(I)>
mono_rle_encode(const Image<I>& input, mln_value(I) val)
{
- typedef mln_point(I) P;
+ typedef mln_psite(I) P;
- mono_rle_image<mln_point(I), mln_value(I)> output(val);
+ mono_rle_image<mln_psite(I), mln_value(I)> output(val);
const I& ima = exact(input);
mln_piter(I) p (exact(input).domain());
unsigned len = 0;
- mln_point(I) rstart;
+ mln_psite(I) rstart;
for_all(p)
if (ima(p) == val || len)
@@ -90,7 +90,7 @@
}
else
if (val == ima(p)
- && on_the_same_line(rstart, mln_point(I)(p)))
+ && on_the_same_line(rstart, mln_psite(I)(p)))
++len;
else
{
Index: mln/core/tr_image.hh
--- mln/core/tr_image.hh (revision 2040)
+++ mln/core/tr_image.hh (working copy)
@@ -175,7 +175,7 @@
inline
bool tr_image<T,I>::has(const algebra::vec<I::point::dim, float>& v) const
{
- mln_point(I) p;
+ mln_psite(I) p;
algebra::vec<I::point::dim, float> v2 = this->data_->tr_.inv()(v);
for (unsigned i = 0; i < I::point::dim; ++i)
p[i] = static_cast<int>(round(v2[i]));
@@ -186,7 +186,7 @@
inline
bool tr_image<T,I>::has(const algebra::vec<I::point::dim, float>& v) const
{
- mln_point(I) p;
+ mln_psite(I) p;
algebra::vec<I::point::dim, float> v2 = this->data_->tr_.inv()(v);
for (unsigned i = 0; i < I::point::dim; ++i)
p[i] = static_cast<int>(round(v2[i]));
@@ -198,7 +198,7 @@
mln_value(I)
tr_image<T,I>::operator()(const algebra::vec<I::point::dim, float>& v) const
{
- mln_point(I) p;
+ mln_psite(I) p;
algebra::vec<I::point::dim, float> v2 = this->data_->tr_.inv()(v);
for (unsigned i = 0; i < I::point::dim; ++i)
p[i] = static_cast<int>(round(v2[i]));
Index: mln/core/init.hh
--- mln/core/init.hh (revision 2040)
+++ mln/core/init.hh (working copy)
@@ -78,7 +78,7 @@
inline
void init_(tag::bbox_t, B& b, const Image<I>& ima)
{
- b = geom::bbox(ima);
+ b = geom::bbox(ima.domain());
}
template <typename I>
Index: mln/core/obased_rle_encode.hh
--- mln/core/obased_rle_encode.hh (revision 2040)
+++ mln/core/obased_rle_encode.hh (working copy)
@@ -47,7 +47,7 @@
** @return obased_rle_image
*/
template <typename I>
- obased_rle_image<mln_point(I), mln_value(I)>
+ obased_rle_image<mln_psite(I), mln_value(I)>
obased_rle_encode(const Image<I>& input, bool ignore_zero = true);
# ifndef MLN_INCLUDE_ONLY
@@ -69,15 +69,15 @@
template <typename I>
inline
- obased_rle_image<mln_point(I), mln_value(I)>
+ obased_rle_image<mln_psite(I), mln_value(I)>
obased_rle_encode(const Image<I>& input, bool ignore_zero)
{
- typedef mln_point(I) P;
+ typedef mln_psite(I) P;
const I& ima = exact(input);
mln_piter(I) p (exact(input).domain());
unsigned len = 0;
- mln_point(I) rstart;
+ mln_psite(I) rstart;
mln_value(I) rvalue;
std::set< mln_value(I) > sv;
@@ -87,7 +87,7 @@
sv.insert(ima(p));
}
- obased_rle_image<mln_point(I), mln_value(I)> output(sv);
+ obased_rle_image<mln_psite(I), mln_value(I)> output(sv);
for_all(p)
if (!ignore_zero || ima(p) != literal::zero || len)
{
@@ -99,7 +99,7 @@
}
else
if (rvalue == ima(p)
- && on_the_same_line(rstart, mln_point(I)(p)))
+ && on_the_same_line(rstart, mln_psite(I)(p)))
++len;
else
{
Index: mln/core/concept/value_iterator.hh
--- mln/core/concept/value_iterator.hh (revision 2040)
+++ mln/core/concept/value_iterator.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
@@ -34,7 +34,6 @@
*/
# include <mln/core/concept/iterator.hh>
-# include <mln/core/concept/point_site.hh>
namespace mln
Index: mln/core/concept/window.hh
--- mln/core/concept/window.hh (revision 2040)
+++ mln/core/concept/window.hh (working copy)
@@ -34,6 +34,7 @@
# include <mln/core/concept/object.hh>
# include <mln/core/concept/iterator.hh>
+# include <mln/core/p_array.hh>
namespace mln
@@ -75,16 +76,6 @@
};
- /*! \brief Equality comparison between windows \p lhs and \p rhs.
- *
- * \relates mln::Window
- *
- * \todo Move into mln/set/compare.hh and delegate to replace this special impl.
- */
- template <typename Wl, typename Wr>
- bool operator==(const Window<Wl>& lhs, const Window<Wr>& rhs);
-
-
# ifndef MLN_INCLUDE_ONLY
@@ -101,27 +92,6 @@
typedef mln_bkd_qiter(E) bkd_qiter;
}
- template <typename Wl, typename Wr>
- inline
- bool operator==(const Window<Wl>& lhs, const Window<Wr>& rhs)
- {
- // FIXME: Same grid!
- typedef mln_point(Wl) P;
-
- mln_fwd_qiter(Wl) ql(exact(lhs), P::origin);
- mln_fwd_qiter(Wr) qr(exact(rhs), P::origin);
-
- for (ql.start(), qr.start();
- ql.is_valid() && qr.is_valid();
- ql.next(), qr.next())
- if (ql != qr)
- return false; // difference found
-
- // both windows are equal only if both browsings are completed at
- // the same time:
- return ! ql.is_valid() && ! qr.is_valid();
- }
-
# endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln
Index: mln/core/concept/site_set.hh
--- mln/core/concept/site_set.hh (revision 2040)
+++ mln/core/concept/site_set.hh (working copy)
@@ -37,7 +37,6 @@
* \todo Check optional methods s.a. nsites and bbox.
*/
-# include <mln/core/concept/point_site.hh>
# include <mln/core/concept/site_iterator.hh>
# include <mln/trait/site_sets.hh>
# include <mln/metal/not_equal.hh>
Index: mln/core/rle_encode.hh
--- mln/core/rle_encode.hh (revision 2040)
+++ mln/core/rle_encode.hh (working copy)
@@ -47,7 +47,7 @@
** @return rle_image
*/
template <typename I>
- rle_image<mln_point(I), mln_value(I)>
+ rle_image<mln_psite(I), mln_value(I)>
rle_encode(const Image<I>& input, bool ignore_zero = true);
# ifndef MLN_INCLUDE_ONLY
@@ -69,16 +69,16 @@
template <typename I>
inline
- rle_image<mln_point(I), mln_value(I)>
+ rle_image<mln_psite(I), mln_value(I)>
rle_encode(const Image<I>& input, bool ignore_zero)
{
- typedef mln_point(I) P;
+ typedef mln_psite(I) P;
- rle_image<mln_point(I), mln_value(I)> output;
+ rle_image<mln_psite(I), mln_value(I)> output;
const I& ima = exact(input);
mln_piter(I) p (exact(input).domain());
unsigned len = 0;
- mln_point(I) rstart;
+ mln_psite(I) rstart;
mln_value(I) rvalue;
for_all(p)
@@ -92,7 +92,7 @@
}
else
if (rvalue == ima(p)
- && on_the_same_line(rstart, mln_point(I)(p)))
+ && on_the_same_line(rstart, mln_psite(I)(p)))
++len;
else
{
Index: mln/core/a_point_of.hh
--- mln/core/a_point_of.hh (revision 2040)
+++ mln/core/a_point_of.hh (working copy)
@@ -43,14 +43,14 @@
* \brief Give a point of an image.
*/
template <typename I>
- mln_point(I) a_point_of(const Image<I>& ima);
+ mln_psite(I) a_point_of(const Image<I>& ima);
# ifndef MLN_INCLUDE_ONLY
template <typename I>
inline
- mln_point(I) a_point_of(const Image<I>& ima_)
+ mln_psite(I) a_point_of(const Image<I>& ima_)
{
const I& ima = exact(ima_);
mln_piter(I) p(ima.domain());
Index: mln/draw/line.hh
--- mln/draw/line.hh (revision 2040)
+++ mln/draw/line.hh (working copy)
@@ -61,7 +61,7 @@
*/
template <typename I>
void line(Image<I>& ima,
- const mln_point(I)& beg, const mln_point(I)& end,
+ const mln_psite(I)& beg, const mln_psite(I)& end,
const mln_value(I)& v);
@@ -70,7 +70,7 @@
template <typename I>
inline
void line(Image<I>& ima,
- const mln_point(I)& beg, const mln_point(I)& end,
+ const mln_psite(I)& beg, const mln_psite(I)& end,
const mln_value(I)& v)
{
mln_precondition(exact(ima).has_data());
Index: mln/draw/box.hh
--- mln/draw/box.hh (revision 2040)
+++ mln/draw/box.hh (working copy)
@@ -74,15 +74,15 @@
{
mln_precondition(exact(ima).has_data());
- mln_point(I) pmin = exact(b).pmin();
- mln_point(I) pmax = exact(b).pmax();
+ mln_psite(I) pmin = exact(b).pmin();
+ mln_psite(I) pmax = exact(b).pmax();
mln_precondition(exact(ima).has(pmin) && exact(ima).has(pmax));
- mln_point(I) p1 (pmin[0], pmin[1]);
- mln_point(I) p2 (pmax[0], pmin[1]);
- mln_point(I) p3 (pmin[0], pmax[1]);
- mln_point(I) p4 (pmax[0], pmax[1]);
+ mln_psite(I) p1 (pmin[0], pmin[1]);
+ mln_psite(I) p2 (pmax[0], pmin[1]);
+ mln_psite(I) p3 (pmin[0], pmax[1]);
+ mln_psite(I) p4 (pmax[0], pmax[1]);
draw::line (ima, p1, p2, v);
draw::line (ima, p2, p4, v);
Index: mln/level/fill.hh
--- mln/level/fill.hh (revision 2040)
+++ mln/level/fill.hh (working copy)
@@ -91,10 +91,10 @@
* \todo Take benefit from quantization when possible.
*/
template <typename I>
- void fill(Image<I>& ima, mln_value(I) (*(&f))(const mln_point(I)& p));
+ void fill(Image<I>& ima, mln_value(I) (*(&f))(const mln_psite(I)& p));
template <typename I>
- void fill_f(Image<I>& ima, mln_value(I) (*f)(const mln_point(I)& p));
+ void fill_f(Image<I>& ima, mln_value(I) (*f)(const mln_psite(I)& p));
/*! Fill the image \p ima with the values given by the array \p arr.
@@ -198,7 +198,7 @@
template <typename I>
inline
void fill_f(Image<I>& ima_,
- mln_value(I) (*f)(const mln_point(I)& p))
+ mln_value(I) (*f)(const mln_psite(I)& p))
{
trace::entering("level::fill_f");
Index: mln/level/memset_.hh
--- mln/level/memset_.hh (revision 2040)
+++ mln/level/memset_.hh (working copy)
@@ -70,7 +70,7 @@
* \pre \p p + \p n is <= \p input size.
*/
template <typename I>
- void memset_(I& input, const mln_point(I)& p,
+ void memset_(I& input, const mln_psite(I)& p,
const mln_value(I)& v, std::size_t n);
@@ -139,7 +139,7 @@
template <typename I>
inline
- void memset_(I& input, const mln_point(I)& p,
+ void memset_(I& input, const mln_psite(I)& p,
const mln_value(I)& v, std::size_t n)
{
trace::entering("level::memset_");
Index: mln/level/median.hh
--- mln/level/median.hh (revision 2040)
+++ mln/level/median.hh (working copy)
@@ -97,8 +97,8 @@
template <typename I, typename W, typename O>
struct median_t
{
- typedef mln_point(I) P;
- typedef mln_dpoint(I) D;
+ typedef mln_psite(I) P;
+ typedef mln_dpsite(I) D;
// i/o
@@ -195,7 +195,7 @@
O& output;
// aux data
- mln_point(I) p;
+ mln_psite(I) p;
accu::median<mln_vset(I)> med;
// ctor
@@ -224,13 +224,13 @@
}
inline
- void add_point(mln_point(I) pt)
+ void add_point(mln_psite(I) pt)
{
med.take(input(pt));
}
inline
- void remove_point(mln_point(I) pu)
+ void remove_point(mln_psite(I) pu)
{
med.untake(input(pu));
}
@@ -308,7 +308,7 @@
mlc_converts_to(mln_value(I), mln_value(O))::check();
mln_precondition(exact(output).domain() == exact(input).domain());
- typedef mln_point(I) P;
+ typedef mln_psite(I) P;
mln_precondition(dir < P::dim);
mln_precondition(length % 2 == 1);
Index: mln/level/paste.spe.hh
--- mln/level/paste.spe.hh (revision 2040)
+++ mln/level/paste.spe.hh (working copy)
@@ -63,7 +63,7 @@
void paste_lines_(const I& data, J& destination)
{
trace::entering("level::impl::paste_lines_");
- typedef mln_point(I) P;
+ typedef mln_psite(I) P;
std::size_t n = data.bbox().len(P::dim - 1);
// FIXME: Works only for raw data images
// FIXME: For linear data images, we should get the len for each line...
Index: mln/linear/line_convolve.hh
--- mln/linear/line_convolve.hh (revision 2040)
+++ mln/linear/line_convolve.hh (working copy)
@@ -71,7 +71,7 @@
{
mln_precondition(exact(output).domain() == exact(input).domain());
linear::convolve(input,
- make::w_window_line<mln_dpoint(I)>(weights),
+ make::w_window_line<mln_dpsite(I)>(weights),
output);
}
Index: mln/linear/gaussian.hh
--- mln/linear/gaussian.hh (revision 2040)
+++ mln/linear/gaussian.hh (working copy)
@@ -157,10 +157,10 @@
void
recursivefilter_(I& ima,
const recursivefilter_coef_& c,
- const mln_point(I)& start,
- const mln_point(I)& finish,
+ const mln_psite(I)& start,
+ const mln_psite(I)& finish,
int len,
- const mln_dpoint(I)& d)
+ const mln_dpsite(I)& d)
{
std::vector<WorkType> tmp1(len);
std::vector<WorkType> tmp2(len);
@@ -195,7 +195,7 @@
- c.d[1] * tmp1[2] - c.d[2]*tmp1[1]
- c.d[3] * tmp1[0];
- mln_point(I) current(start + d + d + d + d);
+ mln_psite(I) current(start + d + d + d + d);
for (mln_coord(I) i = 4; i < len; ++i)
{
tmp1[i] =
Index: mln/make/pixel.hh
--- mln/make/pixel.hh (revision 2040)
+++ mln/make/pixel.hh (working copy)
@@ -43,18 +43,18 @@
/// Create a mln::pixel from a constant image \p ima and a point \p p.
template <typename I>
- mln::pixel<const I> pixel(const Image<I>& ima, const mln_point(I)& p);
+ mln::pixel<const I> pixel(const Image<I>& ima, const mln_psite(I)& p);
/// Create a mln::pixel from a mutable image \p ima and a point \p p.
template <typename I>
- mln::pixel<I> pixel(Image<I>& ima, const mln_point(I)& p);
+ mln::pixel<I> pixel(Image<I>& ima, const mln_psite(I)& p);
# ifndef MLN_INCLUDE_ONLY
template <typename I>
inline
- mln::pixel<const I> pixel(const Image<I>& ima, const mln_point(I)& p)
+ mln::pixel<const I> pixel(const Image<I>& ima, const mln_psite(I)& p)
{
mln::pixel<const I> tmp(exact(ima), p);
return tmp;
@@ -62,7 +62,7 @@
template <typename I>
inline
- mln::pixel<I> pixel(Image<I>& ima, const mln_point(I)& p)
+ mln::pixel<I> pixel(Image<I>& ima, const mln_psite(I)& p)
{
mln::pixel<I> tmp(exact(ima), p);
return tmp;
Index: mln/make/voronoi.hh
--- mln/make/voronoi.hh (revision 2040)
+++ mln/make/voronoi.hh (working copy)
@@ -94,7 +94,7 @@
{
if (orig(p) != 0)
{
- X x = mln_point(I)(p);
+ X x = mln_psite(I)(p);
tab_mean[orig(p) - min].take(x);
}
}
Index: mln/border/fill.hh
--- mln/border/fill.hh (revision 2040)
+++ mln/border/fill.hh (working copy)
@@ -66,8 +66,8 @@
{
trace::entering("border::impl::fill_size_1_");
- typedef mln_point(I) P;
- typedef mln_point(I) P;
+ typedef mln_psite(I) P;
+ typedef mln_psite(I) P;
typename I::line_piter pl(ima.domain());
std::size_t len_r = ima.bbox().len(P::dim - 1);
std::size_t st = 0;
@@ -93,7 +93,7 @@
{
trace::entering("border::impl::fill_size_n_");
- typedef mln_point(I) P;
+ typedef mln_psite(I) P;
typename I::line_piter pl(ima.domain());
std::size_t len_r = ima.bbox().len(P::dim - 1);
std::size_t st = 0;
@@ -121,7 +121,7 @@
{
trace::entering("border::fill");
- typedef mln_point(I) P;
+ typedef mln_psite(I) P;
const I& ima = exact(ima_);
mlc_is(mln_trait_image_speed(I), trait::image::speed::fastest)::check();
Index: mln/border/duplicate.hh
--- mln/border/duplicate.hh (revision 2040)
+++ mln/border/duplicate.hh (working copy)
@@ -69,7 +69,7 @@
{
trace::entering("border::impl::duplicate_1d_");
- typedef mln_point(I) P;
+ typedef mln_psite(I) P;
typename I::line_piter pl(ima.domain());
std::size_t len_c = exact(ima).bbox().len(P::dim - 1);
std::size_t border = ima.border ();
@@ -90,7 +90,7 @@
{
trace::entering("border::impl::duplicate_2d_");
- typedef mln_point(I) P;
+ typedef mln_psite(I) P;
typename I::line_piter pl(ima.domain());
std::size_t border = ima.border ();
std::size_t border_2x = 2 * ima.border ();
@@ -134,7 +134,7 @@
const I& ima = exact(ima_);
mln_precondition(ima.has_data());
- typedef mln_point(I) P;
+ typedef mln_psite(I) P;
typename I::line_piter pl(ima.domain());
std::size_t border = ima.border ();
std::size_t border_2x = 2 * ima.border ();
@@ -207,7 +207,7 @@
mlc_is(mln_trait_image_speed(I), trait::image::speed::fastest)::check();
- typedef mln_point(I) P;
+ typedef mln_psite(I) P;
if (!ima.border ())
return;
Index: mln/border/mirror.hh
--- mln/border/mirror.hh (revision 2040)
+++ mln/border/mirror.hh (working copy)
@@ -198,7 +198,7 @@
mln_precondition(ima.has_data());
mlc_is(mln_trait_image_speed(I), trait::image::speed::fastest)::check();
- typedef mln_point(I) P;
+ typedef mln_psite(I) P;
if (!ima.border ())
return;
Index: mln/convert/to_window.hh
--- mln/convert/to_window.hh (revision 2040)
+++ mln/convert/to_window.hh (working copy)
@@ -73,7 +73,7 @@
/// Convert a binary image \p ima into a window.
template <typename I>
- window<mln_dpoint(I)> to_window(const Image<I>& ima);
+ window<mln_dpsite(I)> to_window(const Image<I>& ima);
/// Convert a point set \p pset into a window.
template <typename S>
@@ -141,12 +141,12 @@
depth in milena/core/concepts/README. */
template <typename I>
inline
- window<mln_dpoint(I)> to_window(const Image<I>& ima_)
+ window<mln_dpsite(I)> to_window(const Image<I>& ima_)
{
const I& ima = exact(ima_);
mln_precondition(ima.has_data());
// FIXME: Check that ima is binary!
- typedef mln_dpoint(I) D;
+ typedef mln_dpsite(I) D;
typedef mln_point(D) P;
window<D> win;
mln_piter(I) p(ima.domain());
Index: mln/convert/to_p_set.hh
--- mln/convert/to_p_set.hh (revision 2040)
+++ mln/convert/to_p_set.hh (working copy)
@@ -57,7 +57,7 @@
/// Convert a binary image \p ima into a point set.
template <typename I>
- p_set<mln_point(I)> to_p_set(const Image<I>& ima);
+ p_set<mln_psite(I)> to_p_set(const Image<I>& ima);
/// Convert a Window \p win into a point set.
template <typename W>
@@ -90,7 +90,7 @@
template <typename I>
inline
- p_set<mln_point(I)> to_p_set(const Image<I>& ima_)
+ p_set<mln_psite(I)> to_p_set(const Image<I>& ima_)
{
const I& ima = exact(ima_);
mln_precondition(ima.has_data());
@@ -98,8 +98,8 @@
// FIXME: Check that ima is binary!
// mln::metal::templated_by<mln_value(I), bool >::check();
- typedef mln_dpoint(I) D;
- typedef mln_point(I) P;
+ typedef mln_dpsite(I) D;
+ typedef mln_psite(I) P;
p_set<P> pset;
mln_piter(I) p(ima.domain());
for_all(p)
Index: mln/convert/to_w_window.hh
--- mln/convert/to_w_window.hh (revision 2040)
+++ mln/convert/to_w_window.hh (working copy)
@@ -45,19 +45,19 @@
/// Convert an image \p input into a weighted window.
template <typename I>
- w_window<mln_dpoint(I), mln_value(I)> to_w_window(const Image<I>& input);
+ w_window<mln_dpsite(I), mln_value(I)> to_w_window(const Image<I>& input);
# ifndef MLN_INCLUDE_ONLY
template <typename I>
inline
- w_window<mln_dpoint(I), mln_value(I)> to_w_window(const Image<I>& input_)
+ w_window<mln_dpsite(I), mln_value(I)> to_w_window(const Image<I>& input_)
{
const I& input = exact(input_);
mln_precondition(input.has_data());
// FIXME: Check that input is scalar?
- typedef mln_dpoint(I) D;
+ typedef mln_dpsite(I) D;
typedef mln_point(D) P;
w_window<D, mln_value(I)> w_win;
mln_piter(I) p(input.domain());
Index: mln/geom/pmin_pmax.hh
--- mln/geom/pmin_pmax.hh (revision 2040)
+++ mln/geom/pmin_pmax.hh (working copy)
@@ -64,7 +64,7 @@
/// Compute the minimum and maximum points when browsing with
/// iterator \p p.
template <typename I>
- std::pair<mln_point(I), mln_point(I)>
+ std::pair<mln_psite(I), mln_psite(I)>
pmin_pmax(const Site_Iterator<I>& p);
@@ -72,7 +72,7 @@
/// when browsing with iterator \p p.
template <typename I>
void
- pmin_pmax(const Site_Iterator<I>& p, mln_point(I)& pmin, mln_point(I)& pmax);
+ pmin_pmax(const Site_Iterator<I>& p, mln_psite(I)& pmin, mln_psite(I)& pmax);
@@ -84,7 +84,7 @@
template <typename I>
inline
void
- pmin_pmax(const Site_Iterator<I>& p_, mln_point(I)& pmin, mln_point(I)& pmax)
+ pmin_pmax(const Site_Iterator<I>& p_, mln_psite(I)& pmin, mln_psite(I)& pmax)
{
I p = exact(p_); // a copy of p_
@@ -94,7 +94,7 @@
pmin = pmax = p;
// update with remaining points
- typedef mln_point(I) P;
+ typedef mln_psite(I) P;
for_all_remaining(p)
for (unsigned i = 0; i < P::dim; ++i)
if (p[i] < pmin[i])
@@ -105,10 +105,10 @@
template <typename I>
inline
- std::pair<mln_point(I), mln_point(I)>
+ std::pair<mln_psite(I), mln_psite(I)>
pmin_pmax(const Site_Iterator<I>& p)
{
- typedef mln_point(I) P;
+ typedef mln_psite(I) P;
std::pair<P, P> tmp;
pmin_pmax(p, tmp.first, tmp.second); // Calls the previous version.
return tmp;
Index: mln/geom/bbox.hh
--- mln/geom/bbox.hh (revision 2040)
+++ mln/geom/bbox.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
@@ -32,14 +32,14 @@
*
* \brief Several routines to compute the precise bounding box of some
* objects.
+ *
+ * \todo Re-activate precondition so introduce
+ * "set::nsites(Site_Set)"...
+ *
+ * \todo Add a static check "domain is ok for bbox (like grid)".
*/
-# include <mln/core/concept/image.hh>
-# include <mln/core/concept/site_set.hh>
# include <mln/core/concept/box.hh>
-# include <mln/core/concept/window.hh>
-# include <mln/core/concept/weighted_window.hh>
-# include <mln/geom/pmin_pmax.hh>
namespace mln
@@ -48,96 +48,66 @@
namespace geom
{
-
- /// Compute the precise bounding box of a window \p win when
- /// centered at the origin.
- template <typename W>
- box_<mln_point(W)> bbox(const Window<W>& win);
-
-
- /// Compute the precise bounding box of a weighted window \p w_win
- /// when centered at the origin.
- template <typename W>
- box_<mln_point(W)> bbox(const Weighted_Window<W>& w_win);
-
-
/// Compute the precise bounding box of a point set \p pset.
template <typename S>
- box_<mln_point(S)> bbox(const Site_Set<S>& pset);
-
-
- /// Compute the precise bounding box of an image \p ima.
- template <typename I>
- box_<mln_point(I)> bbox(const Image<I>& ima);
-
+ box_<mln_site(S)> bbox(const Site_Set<S>& pset);
# ifndef MLN_INCLUDE_ONLY
- template <typename W>
- inline
- box_<mln_point(W)> bbox(const Window<W>& win_)
- {
- const W& win = exact(win_);
- mln_precondition(! win.is_empty());
-
- typedef mln_point(W) P;
- mln_qiter(W) q(win, P::origin);
- std::pair<P, P> pp = geom::pmin_pmax(q);
-
- box_<P> tmp(pp.first, pp.second);
- return tmp;
- }
-
- template <typename W>
- inline
- box_<mln_point(W)> bbox(const Weighted_Window<W>& w_win)
- {
- return bbox(exact(w_win).win());
- }
-
-
namespace impl
{
template <typename S>
- inline
- box_<mln_point(S)> bbox_(const Site_Set<S>& pset_)
+ box_<mln_site(S)> bbox_(trait::site_set::bbox::known,
+ const S& pset)
{
- const S& pset = exact(pset_);
- typedef mln_point(S) P;
- std::pair<P, P> pp = geom::pmin_pmax(pset);
- box_<P> tmp(pp.first, pp.second);
- return tmp;
+ return pset.bbox();
}
- template <typename B>
- inline
- box_<mln_point(B)> bbox_(const Box<B>& pset_)
+ template <typename S>
+ box_<mln_site(S)> bbox_(trait::site_set::bbox::unknown,
+ const S& pset)
{
- return exact(pset_);
+ typedef mln_site(S) P;
+ P pmin, pmax;
+
+ // Init with first point.
+ mln_piter(S) p(pset);
+ p.start();
+ mln_precondition(p.is_valid());
+ pmin = pmax = p;
+
+ // Update with remaining points.
+ for_all_remaining(p)
+ for (unsigned i = 0; i < P::dim; ++i)
+ if (p[i] < pmin[i])
+ pmin[i] = p[i];
+ else
+ if (p[i] > pmax[i])
+ pmax[i] = p[i];
+
+ box_<P> bb(pmin, pmax);
+ return bb;
}
} // end of namespace mln::geom::impl
+
+ // Facade.
+
template <typename S>
inline
- box_<mln_point(S)> bbox(const Site_Set<S>& pset)
+ box_<mln_site(S)> bbox(const Site_Set<S>& pset)
{
- mln_precondition(exact(pset).npoints() != 0);
- box_<mln_point(S)> tmp = impl::bbox_(exact(pset));
- mln_postcondition(tmp <= exact(pset).bbox());
- return tmp;
- }
+ trace::entering("geom::bbox");
+// mln_precondition(set::is_empty(pset) != 0);
+ box_<mln_site(S)> b = impl::bbox_(mln_trait_site_set_bbox(S)(),
+ exact(pset));
- template <typename I>
- inline
- box_<mln_point(I)> bbox(const Image<I>& ima_)
- {
- const I& ima = exact(ima_);
- mln_precondition(ima.has_data());
- return bbox(ima.domain());
+ trace::exiting("geom::bbox");
+ return b;
}
# endif // ! MLN_INCLUDE_ONLY
Index: mln/geom/resize.hh
--- mln/geom/resize.hh (revision 2040)
+++ mln/geom/resize.hh (working copy)
@@ -149,7 +149,7 @@
mlc_is(mln_trait_image_speed(I), trait::image::speed::fastest)::check();
I output;
- typedef mln_point(I) P;
+ typedef mln_psite(I) P;
/// FIXME : Find a better way for the disjunction.
Index: mln/morpho/erosion_fast.hh
--- mln/morpho/erosion_fast.hh (revision 2040)
+++ mln/morpho/erosion_fast.hh (working copy)
@@ -79,8 +79,8 @@
template <typename I, typename W, typename O>
struct erosion_fast_t
{
- typedef mln_point(I) P;
- typedef mln_dpoint(I) D;
+ typedef mln_psite(I) P;
+ typedef mln_dpsite(I) D;
// i/o
Index: mln/morpho/rank_filter.hh
--- mln/morpho/rank_filter.hh (revision 2040)
+++ mln/morpho/rank_filter.hh (working copy)
@@ -69,7 +69,7 @@
mln_concrete(I) output;
initialize(output, input);
- accu::rank_<mln_value(I)> accu(k, convert::to_p_array(win, mln_point(I)()).npoints());
+ accu::rank_<mln_value(I)> accu(k, convert::to_p_array(win, mln_psite(I)()).npoints());
mln_piter(I) p(input.domain());
mln_qiter(W) q(win, p);
for_all(p)
Index: mln/morpho/Rd.hh
--- mln/morpho/Rd.hh (revision 2040)
+++ mln/morpho/Rd.hh (working copy)
@@ -77,7 +77,7 @@
template <typename I>
inline
- std::vector<mln_point(I)> histo_reverse_sort(const I& ima)
+ std::vector<mln_psite(I)> histo_reverse_sort(const I& ima)
{
std::vector<unsigned> h = compute_histo(ima);
// preparing output data
@@ -85,7 +85,7 @@
loc[255] = 0;
for (int l = 254; l >= 0; --l)
loc[l] = loc[l+1] + h[l+1];
- std::vector<mln_point(I)> vec(ima.domain().npoints());
+ std::vector<mln_psite(I)> vec(ima.domain().npoints());
// storing output data
mln_piter(I) p(ima.domain());
for_all(p)
@@ -97,7 +97,7 @@
template <typename I, typename N>
struct Rd
{
- typedef mln_point(I) point;
+ typedef mln_psite(I) point;
typedef mln_value(I) value;
// in:
Index: mln/morpho/dilation_fast.hh
--- mln/morpho/dilation_fast.hh (revision 2040)
+++ mln/morpho/dilation_fast.hh (working copy)
@@ -79,8 +79,8 @@
template <typename I, typename W, typename O>
struct dilation_fast_t
{
- typedef mln_point(I) P;
- typedef mln_dpoint(I) D;
+ typedef mln_psite(I) P;
+ typedef mln_dpsite(I) D;
// i/o
Index: mln/display/color_pretty.hh
--- mln/display/color_pretty.hh (revision 2040)
+++ mln/display/color_pretty.hh (working copy)
@@ -82,9 +82,9 @@
template <typename I>
typename trait::image_from_mesh < mln_mesh(I), value::rgb8 >::ret
color_pretty_rgb(const Image<I>& input_,
- const p_set<mln_point(I) >& s1_,
- const p_set<mln_point(I) >& s2_,
- const p_set<mln_point(I) >& s3_);
+ const p_set<mln_psite(I) >& s1_,
+ const p_set<mln_psite(I) >& s2_,
+ const p_set<mln_psite(I) >& s3_);
# ifndef MLN_INCLUDE_ONLY
@@ -142,9 +142,9 @@
inline
typename trait::image_from_mesh < mln_mesh(I), value::rgb8 >::ret
color_pretty_rgb(const Image<I>& input_,
- const p_set<mln_point(I) >& s1_,
- const p_set<mln_point(I) >& s2_,
- const p_set<mln_point(I) >& s3_)
+ const p_set<mln_psite(I) >& s1_,
+ const p_set<mln_psite(I) >& s2_,
+ const p_set<mln_psite(I) >& s3_)
{
trace::entering("display::impl::color_pretty_rgb");
@@ -154,21 +154,21 @@
level::fill(output, value::rgb8(0, 0, 0));
{
- mln_piter(p_set<mln_point(I) >) p(s1_);
+ mln_piter(p_set<mln_psite(I) >) p(s1_);
for_all(p)
output(p).red() = 255;
}
{
- mln_piter(p_set<mln_point(I) >) p(s2_);
+ mln_piter(p_set<mln_psite(I) >) p(s2_);
for_all(p)
output(p).green() = 255;
}
{
- mln_piter(p_set<mln_point(I) >) p(s3_);
+ mln_piter(p_set<mln_psite(I) >) p(s3_);
for_all(p)
output(p).blue() = 255;
@@ -207,9 +207,9 @@
inline
typename trait::image_from_mesh < mln_mesh(I), value::rgb8 >::ret
color_pretty_rgb(const Image<I>& input_,
- const p_set<mln_point(I) >& s1_,
- const p_set<mln_point(I) >& s2_,
- const p_set<mln_point(I) >& s3_)
+ const p_set<mln_psite(I) >& s1_,
+ const p_set<mln_psite(I) >& s2_,
+ const p_set<mln_psite(I) >& s3_)
{
trace::entering("display::color_pretty_rgb");
Index: mln/canvas/chamfer.hh
--- mln/canvas/chamfer.hh (revision 2040)
+++ mln/canvas/chamfer.hh (working copy)
@@ -50,7 +50,7 @@
{
typedef typename F::I I;
typedef typename F::W W;
- typedef mln_point(I) point;
+ typedef mln_psite(I) point;
F& f;
Index: mln/canvas/browsing/dir_struct_elt_incr_update.hh
--- mln/canvas/browsing/dir_struct_elt_incr_update.hh (revision 2040)
+++ mln/canvas/browsing/dir_struct_elt_incr_update.hh (working copy)
@@ -105,7 +105,7 @@
mln_precondition(f.dir < f.dim);
typedef typename F::I I;
- const mln_point(I)
+ const mln_psite(I)
pmin = f.input.domain().pmin(),
pmax = f.input.domain().pmax();
@@ -115,7 +115,7 @@
pmin_dir_plus_half_length = pmin_dir + f.length / 2,
pmax_dir_minus_half_length = pmax_dir - f.length / 2;
- mln_point(I) pt, pu;
+ mln_psite(I) pt, pu;
typedef mln_coord(I)& coord_ref;
coord_ref
Index: mln/canvas/browsing/directional.hh
--- mln/canvas/browsing/directional.hh (revision 2040)
+++ mln/canvas/browsing/directional.hh (working copy)
@@ -94,7 +94,7 @@
mln_precondition(f.dir < f.dim);
typedef typename F::I I;
- mln_point(I)
+ mln_psite(I)
pmin = f.input.domain().pmin(),
pmax = f.input.domain().pmax();
Index: mln/canvas/labeling.hh
--- mln/canvas/labeling.hh (revision 2040)
+++ mln/canvas/labeling.hh (working copy)
@@ -282,7 +282,7 @@
{
mln_bkd_pixter(const I) p(f.input);
- typedef window<mln_dpoint(I)> W;
+ typedef window<mln_dpsite(I)> W;
W win = mln::convert::to_upper_window(f.nbh);
mln_qixter(const I, W) n(p, win);
Index: mln/util/set.hh
--- mln/util/set.hh (revision 2040)
+++ mln/util/set.hh (working copy)
@@ -41,7 +41,7 @@
# include <algorithm>
# include <iostream>
-# include <mln/core/contract.hh>
+# include <mln/core/concept/object.hh>
# include <mln/util/less.hh>
@@ -75,7 +75,7 @@
* \see mln::util::less
*/
template <typename T>
- class set
+ class set : public Object< mln::util::set<T> >
{
public:
@@ -197,6 +197,19 @@
};
+ template <typename T>
+ bool operator == (const set<T>& lhs, const set<T>& rhs);
+
+
+ template <typename T>
+ bool operator < (const set<T>& lhs, const set<T>& rhs);
+
+
+ template <typename T>
+ bool operator <= (const set<T>& lhs, const set<T>& rhs);
+
+
+
# ifndef MLN_INCLUDE_ONLY
template <typename T>
@@ -326,6 +339,43 @@
return ostr;
}
+ template <typename T>
+ bool operator == (const set<T>& lhs, const set<T>& rhs)
+ {
+ const unsigned n = lhs.nelements();
+ if (rhs.nelements() != n)
+ return false;
+ for (unsigned i = 0; i < n; ++i)
+ if (lhs[i] != rhs[i])
+ return false;
+ return true;
+ }
+
+ template <typename T>
+ bool operator < (const set<T>& lhs, const set<T>& rhs)
+ {
+ return lhs.nelements() < rhs.nelements() && lhs <= rhs;
+ }
+
+ template <typename T>
+ bool operator <= (const set<T>& lhs, const set<T>& rhs)
+ {
+ const unsigned
+ nl = lhs.nelements(),
+ nr = rhs.nelements();
+ if (nl > nr)
+ return false;
+ // Every element of lhs can be found in rhs.
+ for (unsigned l = 0, r = 0; l < nl; ++l, ++r)
+ {
+ while (rhs[r] != lhs[l] && r < nr)
+ ++r;
+ if (r == nr)
+ return false; // lhs[l] has not been found in rhs.
+ }
+ return true;
+ }
+
# endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln::util
Index: mln/util/greater_point.hh
--- mln/util/greater_point.hh (revision 2040)
+++ mln/util/greater_point.hh (working copy)
@@ -44,7 +44,7 @@
class greater_point
{
public:
- typedef mln_point(I) point;
+ typedef mln_psite(I) point;
greater_point(const Image<I>& ima);
@@ -73,7 +73,7 @@
template <typename I>
bool
- greater_point<I>::operator()(const mln_point(I)& x, const mln_point(I)& y)
+ greater_point<I>::operator()(const mln_psite(I)& x, const mln_psite(I)& y)
{
return ima_(x) > ima_(y);
}
Index: mln/util/lemmings.hh
--- mln/util/lemmings.hh (revision 2040)
+++ mln/util/lemmings.hh (working copy)
@@ -49,14 +49,14 @@
template <typename I>
struct lemmings_ : public Object< lemmings_<I> >
{
- lemmings_(const Image<I>& ima, const mln_point(I)& pt,
- const mln_dpoint(I)& dpt, const mln_value(I)& val);
+ lemmings_(const Image<I>& ima, const mln_psite(I)& pt,
+ const mln_dpsite(I)& dpt, const mln_value(I)& val);
- mln_point(I) operator()();
+ mln_psite(I) operator()();
const I& ima_;
- mln_point(I) pt_;
- const mln_dpoint(I)& dpt_;
+ mln_psite(I) pt_;
+ const mln_dpsite(I)& dpt_;
const mln_value(I)& val_;
};
@@ -74,9 +74,9 @@
** ima.
*/
template <typename I>
- mln_point(I)
- lemmings(const Image<I>& ima, const mln_point(I)& pt,
- const mln_dpoint(I)& dpt, const mln_value(I)& val);
+ mln_psite(I)
+ lemmings(const Image<I>& ima, const mln_psite(I)& pt,
+ const mln_dpsite(I)& dpt, const mln_value(I)& val);
# ifndef MLN_INCLUDE_ONLY
@@ -84,8 +84,8 @@
template <typename I>
inline
- lemmings_<I>::lemmings_(const Image<I>& ima, const mln_point(I)& pt,
- const mln_dpoint(I)& dpt, const mln_value(I)& val)
+ lemmings_<I>::lemmings_(const Image<I>& ima, const mln_psite(I)& pt,
+ const mln_dpsite(I)& dpt, const mln_value(I)& val)
: ima_(exact(ima)),
pt_(pt),
dpt_(dpt),
@@ -94,7 +94,7 @@
}
template <typename I>
- mln_point(I)
+ mln_psite(I)
lemmings_<I>::operator()()
{
while (ima_.domain().has(pt_) && ima_(pt_) == val_)
@@ -103,9 +103,9 @@
}
template <typename I>
- mln_point(I)
- lemmings(const Image<I>& ima, const mln_point(I)& pt,
- const mln_dpoint(I)& dpt, const mln_value(I)& val)
+ mln_psite(I)
+ lemmings(const Image<I>& ima, const mln_psite(I)& pt,
+ const mln_dpsite(I)& dpt, const mln_value(I)& val)
{
lemmings_<I> lm(ima, pt, dpt, val);
return lm();
Index: sandbox/duhamel/translate_image.hh
--- sandbox/duhamel/translate_image.hh (revision 2040)
+++ sandbox/duhamel/translate_image.hh (working copy)
@@ -51,11 +51,11 @@
template <typename I>
struct data_< translate_image<I> >
{
- data_(I& ima, const mln_dpoint(I) dp);
+ data_(I& ima, const mln_dpsite(I) dp);
I ima_;
box2d bb_;
- const mln_dpoint(I) dp_;
+ const mln_dpsite(I) dp_;
};
} // end of namespace mln::internal
@@ -101,7 +101,7 @@
using super_::has_data;
/// Constructors.
- translate_image(I& ima, const mln_dpoint(I) dp);
+ translate_image(I& ima, const mln_dpsite(I) dp);
translate_image();
/// Return domain of translated_image.
@@ -127,7 +127,7 @@
// internal::data_< translate_image<I,S> >
template <typename I>
- data_< translate_image<I> >::data_(I& ima, const mln_dpoint(I) dp)
+ data_< translate_image<I> >::data_(I& ima, const mln_dpsite(I) dp)
: ima_ (ima),
dp_ (dp)
{
@@ -144,7 +144,7 @@
} // end of namespace mln::internal
template <typename I>
- translate_image<I>::translate_image(I& ima, const mln_dpoint(I) dp)
+ translate_image<I>::translate_image(I& ima, const mln_dpsite(I) dp)
{
mln_precondition(ima.has_data());
this->data_ = new internal::data_< translate_image<I> >(ima, dp);
@@ -158,7 +158,7 @@
template <typename I>
bool translate_image<I>::has(const mln_psite(I)& p) const
{
- mln_point(I) np = p - this->data_->dp_;
+ mln_psite(I) np = p - this->data_->dp_;
return this->data_->ima_.has(np);
}
@@ -167,7 +167,7 @@
translate_image<I>::operator()(const mln_psite(I)& p) const
{
mln_assertion(this->has(p));
- mln_point(I) np = p - this->data_->dp_;
+ mln_psite(I) np = p - this->data_->dp_;
return this->data_->ima_(np);
}
@@ -177,7 +177,7 @@
translate_image<I>::operator()(const mln_psite(I)& p)
{
mln_assertion(this->has(p));
- mln_point(I) np = p - this->data_->dp_;
+ mln_psite(I) np = p - this->data_->dp_;
return this->data_->ima_(np);
}
Index: sandbox/duhamel/canvas_chamfer.hh
--- sandbox/duhamel/canvas_chamfer.hh (revision 2040)
+++ sandbox/duhamel/canvas_chamfer.hh (working copy)
@@ -46,7 +46,7 @@
typedef typename F::I I;
typedef typename F::W W;
- typedef mln_point(I) point;
+ typedef mln_psite(I) point;
chamfer(F& f)
: f(f)
Index: sandbox/duhamel/canvas_labeling.hh
--- sandbox/duhamel/canvas_labeling.hh (revision 2040)
+++ sandbox/duhamel/canvas_labeling.hh (working copy)
@@ -170,7 +170,7 @@
typedef typename F::N N;
typedef typename F::O O;
typedef typename F::S S;
- typedef mln_point(I) point;
+ typedef mln_psite(I) point;
// aux:
mln_ch_value(O, bool) deja_vu;
@@ -294,7 +294,7 @@
typedef typename F::N N;
typedef typename F::O O;
typedef typename F::S S;
- typedef mln_point(I) point;
+ typedef mln_psite(I) point;
labeling_fast(F& f)
: f(f)
Index: sandbox/duhamel/labeling_algo.hh
--- sandbox/duhamel/labeling_algo.hh (revision 2040)
+++ sandbox/duhamel/labeling_algo.hh (working copy)
@@ -82,7 +82,7 @@
for_all(p)
{
- X x = mln_point(I)(p);
+ X x = mln_psite(I)(p);
tab_mean[ima(p) - min].take(x);
for_all (n) if (ima.has(n))
if (ima(p) != ima(n))
@@ -132,7 +132,7 @@
{
if (orig(p) != 0)
{
- X x = mln_point(I)(p);
+ X x = mln_psite(I)(p);
tab_mean[orig(p) - min].take(x);
}
}
Index: sandbox/duhamel/border_duplicate.hh
--- sandbox/duhamel/border_duplicate.hh (revision 2040)
+++ sandbox/duhamel/border_duplicate.hh (working copy)
@@ -73,7 +73,7 @@
const I& ima = exact(ima_);
mln_precondition(ima.has_data());
- typedef mln_point(I) P;
+ typedef mln_psite(I) P;
typename I::line_piter pl(ima.domain());
std::size_t len_c = exact(ima).bbox().len(P::dim - 1);
std::size_t border = ima.border ();
@@ -92,7 +92,7 @@
const I& ima = exact(ima_);
mln_precondition(ima.has_data());
- typedef mln_point(I) P;
+ typedef mln_psite(I) P;
typename I::line_piter pl(ima.domain());
std::size_t border = ima.border ();
std::size_t border_2x = 2 * ima.border ();
@@ -131,7 +131,7 @@
const I& ima = exact(ima_);
mln_precondition(ima.has_data());
- typedef mln_point(I) P;
+ typedef mln_psite(I) P;
typename I::line_piter pl(ima.domain());
std::size_t border = ima.border ();
std::size_t border_2x = 2 * ima.border ();
@@ -196,7 +196,7 @@
template <typename I>
void duplicate(const Fast_Image<I>& ima_)
{
- typedef mln_point(I) P;
+ typedef mln_psite(I) P;
const I& ima = exact(ima_);
mln_precondition(ima.has_data());
Index: sandbox/duhamel/draw_mesh.hh
--- sandbox/duhamel/draw_mesh.hh (revision 2040)
+++ sandbox/duhamel/draw_mesh.hh (working copy)
@@ -20,7 +20,7 @@
point2d p2,
mln_value(I) link_v)
{
- mln_dpoint(I) d = p1 - p2;
+ mln_dpsite(I) d = p1 - p2;
std::cout << "dx = "
<< d[0]
Index: sandbox/duhamel/debug_print_3d_with_border.hh
--- sandbox/duhamel/debug_print_3d_with_border.hh (revision 2040)
+++ sandbox/duhamel/debug_print_3d_with_border.hh (working copy)
@@ -43,7 +43,7 @@
const I& ima = exact(input_);
mln_precondition(ima.has_data());
- typedef mln_point(I) P;
+ typedef mln_psite(I) P;
std::size_t len_s = exact(ima).bbox().len(P::dim - 3);
std::size_t len_r = exact(ima).bbox().len(P::dim - 2);
Index: sandbox/duhamel/labeling_cpy_from_mln.hh
--- sandbox/duhamel/labeling_cpy_from_mln.hh (revision 2040)
+++ sandbox/duhamel/labeling_cpy_from_mln.hh (working copy)
@@ -56,7 +56,7 @@
typedef typename F::N N;
typedef typename F::O O;
typedef typename F::S S;
- typedef mln_point(I) point;
+ typedef mln_psite(I) point;
// aux:
mln_ch_value(O, bool) deja_vu;
@@ -165,7 +165,7 @@
typedef typename F::N N;
typedef typename F::O O;
typedef typename F::S S;
- typedef mln_point(I) point;
+ typedef mln_psite(I) point;
labeling_fast(F& f)
: f(f)
Index: sandbox/duhamel/border_fill.hh
--- sandbox/duhamel/border_fill.hh (revision 2040)
+++ sandbox/duhamel/border_fill.hh (working copy)
@@ -68,7 +68,7 @@
const I& ima = exact(ima_);
mln_precondition(ima.has_data());
- typedef mln_point(I) P;
+ typedef mln_psite(I) P;
std::size_t border = ima.border ();
std::size_t len = exact(ima).bbox().len(P::dim - 1);
@@ -87,7 +87,7 @@
const I& ima = exact(ima_);
mln_precondition(ima.has_data());
- typedef mln_point(I) P;
+ typedef mln_psite(I) P;
std::size_t border = ima.border ();
std::size_t len = exact(ima).bbox().len(P::dim - 1);
std::size_t i = 0;
@@ -106,7 +106,7 @@
const I& ima = exact(ima_);
mln_precondition(ima.has_data());
- typedef mln_point(I) P;
+ typedef mln_psite(I) P;
std::size_t border = ima.border ();
std::size_t border_2x = 2 * border;
@@ -139,7 +139,7 @@
const I& ima = exact(ima_);
mln_precondition(ima.has_data());
- typedef mln_point(I) P;
+ typedef mln_psite(I) P;
std::size_t border = ima.border ();
std::size_t border_2x = 2 * border;
@@ -169,7 +169,7 @@
// const I& ima = exact(ima_);
// mln_precondition(ima.has_data());
-// typedef mln_point(I) P;
+// typedef mln_psite(I) P;
// std::size_t border = ima.border ();
// std::size_t border_2x = 2 * border;
@@ -222,9 +222,9 @@
template <typename I>
void fill_size_1_(const Fast_Image<I>& ima_, const mln_value(I)& v)
{
- typedef mln_point(I) P;
+ typedef mln_psite(I) P;
const I& ima = exact(ima_);
- typedef mln_point(I) P;
+ typedef mln_psite(I) P;
typename I::line_piter pl(ima.domain());
std::size_t len_r = exact(ima).bbox().len(P::dim - 1);
std::size_t st = 0;
@@ -245,9 +245,9 @@
template <typename I>
void fill_size_n_(const Fast_Image<I>& ima_, const mln_value(I)& v)
{
- typedef mln_point(I) P;
+ typedef mln_psite(I) P;
const I& ima = exact(ima_);
- typedef mln_point(I) P;
+ typedef mln_psite(I) P;
typename I::line_piter pl(ima.domain());
std::size_t len_r = exact(ima).bbox().len(P::dim - 1);
std::size_t st = 0;
@@ -270,7 +270,7 @@
template <typename I>
void fill(const Fast_Image<I>& ima_, const mln_value(I)& v)
{
- typedef mln_point(I) P;
+ typedef mln_psite(I) P;
const I& ima = exact(ima_);
mln_precondition(ima.has_data());
Index: sandbox/duhamel/labeling_level.hh
--- sandbox/duhamel/labeling_level.hh (revision 2040)
+++ sandbox/duhamel/labeling_level.hh (working copy)
@@ -101,7 +101,7 @@
mln_bkd_pixter(const I) p(f.input);
// mln_nixter(const I, N) n(p, f.nbh);
- typedef window<mln_dpoint(I)> W;
+ typedef window<mln_dpsite(I)> W;
W win = convert::to_upper_window(f.nbh);
mln_qixter(const I, W) n(p, win);
Index: sandbox/duhamel/labeling.hh
--- sandbox/duhamel/labeling.hh (revision 2040)
+++ sandbox/duhamel/labeling.hh (working copy)
@@ -33,7 +33,7 @@
typedef typename F::N N;
typedef typename F::O O;
typedef typename F::S S;
- typedef mln_point(I) point;
+ typedef mln_psite(I) point;
// // aux:
// mln_ch_value(O, bool) deja_vu;
Index: sandbox/nivault/median.hh
--- sandbox/nivault/median.hh (revision 2040)
+++ sandbox/nivault/median.hh (working copy)
@@ -90,7 +90,7 @@
template <typename I, typename O>
struct median_dir_t
{
- typedef mln_point(I) point;
+ typedef mln_psite(I) point;
enum { dim = point::dim };
// i/o
@@ -100,7 +100,7 @@
O& output;
// aux data
- const mln_point(I)
+ const mln_psite(I)
pmin = input.domain().pmin(),
pmax = input.domain().pmax();
const mln_coord(I)
@@ -132,9 +132,9 @@
{
}
- void process(const mln_point(I)& p_)
+ void process(const mln_psite(I)& p_)
{
- mln_point(I)
+ mln_psite(I)
p = p_,
pt = p,
pu = p;
@@ -241,7 +241,7 @@
Image<O>& output)
{
mln_precondition(exact(output).domain() == exact(input).domain());
- typedef mln_point(I) P;
+ typedef mln_psite(I) P;
mln_precondition(dir < P::dim);
mln_precondition(length % 2 == 1);
impl::median_dir_(exact(input), exact(win), exact(output));
Index: sandbox/jardonnet/subsampling/gaussian_subsampling.hh
--- sandbox/jardonnet/subsampling/gaussian_subsampling.hh (revision 2040)
+++ sandbox/jardonnet/subsampling/gaussian_subsampling.hh (working copy)
@@ -56,7 +56,7 @@
inline
mln_concrete(I)
gaussian_subsampling(const Image<I>& input, float sigma,
- const mln_dpoint(I)& first_p,
+ const mln_dpsite(I)& first_p,
const mln_coord(I)& gap);
# ifndef MLN_INCLUDE_ONLY
@@ -66,7 +66,7 @@
inline
mln_concrete(I)
gaussian_subsampling(const Image<I>& input, float sigma,
- const mln_dpoint(I)& first_p,
+ const mln_dpsite(I)& first_p,
const mln_coord(I)& gap)
{
trace::entering("subsampling::gaussian_subsampling");
Index: sandbox/jardonnet/subsampling/sub_sampled_image.hh
--- sandbox/jardonnet/subsampling/sub_sampled_image.hh (revision 2040)
+++ sandbox/jardonnet/subsampling/sub_sampled_image.hh (working copy)
@@ -55,13 +55,13 @@
///
/// \param ima The underlying image.
/// \param box The bounding box (domain) of the morphed image.
- data_(I& ima, mln::box_<mln_point(I)>& box);
+ data_(I& ima, mln::box_<mln_psite(I)>& box);
/// Underlying image.
I ima_;
/// The bounding box of the morphed image.
- mln::box_<mln_point(I)> box_;
+ mln::box_<mln_psite(I)> box_;
};
} // end of namespace mln::internal
@@ -95,33 +95,33 @@
/// Give the definition domain.
- const box_<mln_point(I)>& domain() const;
+ const box_<mln_psite(I)>& domain() const;
/// Test if this image has been initialized.
bool has_data() const;
/// Test if a pixel value is accessible at \p p.
- bool has(const mln_point(I)& p) const;
+ bool has(const mln_psite(I)& p) const;
/// Give the set of values of the image.
const vset& values() const;
/// Read-only access of pixel value at point site \p p.
- mln_rvalue(I) operator()(const mln_point(I)& p) const;
+ mln_rvalue(I) operator()(const mln_psite(I)& p) const;
/// Read-write access of pixel value at point site \p p.
- lvalue operator()(const mln_point(I)& p);
+ lvalue operator()(const mln_psite(I)& p);
public:
- sub_sampled_image(I& ima, const mln_point(I)& first_p, int gap);
+ sub_sampled_image(I& ima, const mln_psite(I)& first_p, int gap);
- void set_sampling(const mln_point(I)& first_p, int gap);
+ void set_sampling(const mln_psite(I)& first_p, int gap);
protected:
/// Compute physical coordinates.
- mln_point(I) translate_coords_(const mln_point(I)& p) const;
+ mln_psite(I) translate_coords_(const mln_psite(I)& p) const;
- const mln_point(I)& first_p;
+ const mln_psite(I)& first_p;
int gap;
};
@@ -135,7 +135,7 @@
template <typename I>
inline
- data_< sub_sampled_image<I> >::data_(I& ima, mln::box_<mln_point(I)>& box)
+ data_< sub_sampled_image<I> >::data_(I& ima, mln::box_<mln_psite(I)>& box)
: ima_(ima), box_(box)
{
}
@@ -144,17 +144,17 @@
template <typename I>
- sub_sampled_image<I>::sub_sampled_image(I& ima, const mln_point(I)& first_p, int gap)
+ sub_sampled_image<I>::sub_sampled_image(I& ima, const mln_psite(I)& first_p, int gap)
: first_p(first_p), gap(gap)
{
- box_<mln_point(I)> box(ima.bbox().pmin(),ima.bbox().pmax());
+ box_<mln_psite(I)> box(ima.bbox().pmin(),ima.bbox().pmax());
this->data_ = new internal::data_< sub_sampled_image<I> >(ima, box);
}
template <typename I>
inline
- const box_<mln_point(I)>&
+ const box_<mln_psite(I)>&
sub_sampled_image<I>::domain() const
{
mln_precondition(this->has_data());
@@ -184,7 +184,7 @@
template <typename I>
inline
bool
- sub_sampled_image<I>::has(const mln_point(I)& p) const
+ sub_sampled_image<I>::has(const mln_psite(I)& p) const
{
mln_precondition(this->has_data());
return this->delegatee_()->has(translate_coords_(p));
@@ -193,7 +193,7 @@
template <typename I>
inline
mln_rvalue(I)
- sub_sampled_image<I>::operator()(const mln_point(I)& p) const
+ sub_sampled_image<I>::operator()(const mln_psite(I)& p) const
{
mln_precondition(this->has(p));
return (*this->delegatee_())(translate_coords_(p));
@@ -202,7 +202,7 @@
template <typename I>
inline
typename internal::morpher_lvalue_<I>::ret
- sub_sampled_image<I>::operator()(const mln_point(I)& p)
+ sub_sampled_image<I>::operator()(const mln_psite(I)& p)
{
mln_precondition(this->has(p));
return (*this->delegatee_())(translate_coords_(p));
@@ -210,11 +210,11 @@
template <typename I>
inline
- mln_point(I)
- sub_sampled_image<I>::translate_coords_(const mln_point(I)& p) const
+ mln_psite(I)
+ sub_sampled_image<I>::translate_coords_(const mln_psite(I)& p) const
{
- return mln_point(I)(algebra::vec<2, int>(p) * gap + algebra::vec<2, int>(first_p));
+ return mln_psite(I)(algebra::vec<2, int>(p) * gap + algebra::vec<2, int>(first_p));
}
Index: sandbox/jardonnet/registration/tools.hh
--- sandbox/jardonnet/registration/tools.hh (revision 2040)
+++ sandbox/jardonnet/registration/tools.hh (working copy)
@@ -134,12 +134,12 @@
// to_p_array
template <typename I>
inline
- p_array<mln_point(I)>
+ p_array<mln_psite(I)>
to_p_array(const Image<I>& img_)
{
const I& img = exact(img_);
- p_array<mln_point(I)> a;
+ p_array<mln_psite(I)> a;
mln_piter(I) p(img.domain());
for_all(p)
Index: sandbox/jardonnet/registration/chamfer.hh
--- sandbox/jardonnet/registration/chamfer.hh (revision 2040)
+++ sandbox/jardonnet/registration/chamfer.hh (working copy)
@@ -46,9 +46,9 @@
* \pre \p img has to be initialized.
*/
template<typename I, typename T>
- std::pair<mln_ch_value(I, T), mln_ch_value(I, mln_point(I))>
+ std::pair<mln_ch_value(I, T), mln_ch_value(I, mln_psite(I))>
chamfer(const Image<I>& input_,
- w_window<mln_dpoint(I), T> chamfer);
+ w_window<mln_dpsite(I), T> chamfer);
# ifndef MLN_INCLUDE_ONLY
@@ -67,18 +67,18 @@
template<typename Q, typename I, typename T>
inline
void
- chamfer_pass(const w_window<mln_dpoint(I), T> chamfer,
+ chamfer_pass(const w_window<mln_dpsite(I), T> chamfer,
const I& input,
mln_ch_value(I, T)& outputDistance,
- mln_ch_value(I, mln_point(I))& outputNearest)
+ mln_ch_value(I, mln_psite(I))& outputNearest)
{
- typedef w_window<mln_dpoint(I), T> W;
+ typedef w_window<mln_dpsite(I), T> W;
Q p(input.domain());
mln_qiter(W) q(chamfer, p);
for_all(p)
{
- std::pair<T, mln_point(I)> min(mln_max(T), p);
+ std::pair<T, mln_psite(I)> min(mln_max(T), p);
for_all(q)
if (input.has(q) && outputDistance(q) != mln_max(T))
@@ -108,11 +108,11 @@
template<typename I, typename T>
inline
- std::pair<mln_ch_value(I, T), mln_ch_value(I, mln_point(I))>
+ std::pair<mln_ch_value(I, T), mln_ch_value(I, mln_psite(I))>
chamfer(const Image<I>& input_,
- w_window<mln_dpoint(I), T> chamfer)
+ w_window<mln_dpsite(I), T> chamfer)
{
- typedef w_window<mln_dpoint(I), T> W;
+ typedef w_window<mln_dpsite(I), T> W;
const I& input = exact(input_);
mln_precondition(input.has_data());
@@ -120,7 +120,7 @@
mln_ch_value(I, T) outputDistance;
initialize(outputDistance, input);
- mln_ch_value(I, mln_point(I)) outputNearest;
+ mln_ch_value(I, mln_psite(I)) outputNearest;
initialize(outputNearest, input);
// Initialization.
@@ -143,7 +143,7 @@
impl::chamfer_pass<mln_bkd_piter(I)>
(chamfer, input, outputDistance, outputNearest);
- return std::pair<mln_ch_value(I, T), mln_ch_value(I, mln_point(I))>
+ return std::pair<mln_ch_value(I, T), mln_ch_value(I, mln_psite(I))>
(outputDistance, outputNearest);
}
Index: sandbox/geraud/cs2d/cs2d_morpho.hh
--- sandbox/geraud/cs2d/cs2d_morpho.hh (revision 2040)
+++ sandbox/geraud/cs2d/cs2d_morpho.hh (working copy)
@@ -23,7 +23,7 @@
mln_piter(I) p(input.domain());
for_all(p)
{
- mln_point(I) p_ = p;
+ mln_psite(I) p_ = p;
input(p) =
p_.row() % 2 ?
// Odd so horizontal edge and vertical cells.
Index: sandbox/garrigues/image_identity/interpolated.hh
--- sandbox/garrigues/image_identity/interpolated.hh (revision 2040)
+++ sandbox/garrigues/image_identity/interpolated.hh (working copy)
@@ -151,7 +151,7 @@
template <typename I>
bool interpolated<I>::has(const mln::algebra::vec<I::point::dim, float>& v) const
{
- mln_point(I) p;
+ mln_psite(I) p;
for (unsigned i = 0; i < I::point::dim; ++i)
p[i] = static_cast<int>(round(v[i]));
return this->data_->ima_.has(p);
@@ -161,7 +161,7 @@
mln_value(I)
interpolated<I>::operator()(const mln::algebra::vec<I::point::dim, float>& v) const
{
- mln_point(I) p;
+ mln_psite(I) p;
for (unsigned i = 0; i < I::point::dim; ++i)
p[i] = static_cast<int>(round(v[i]));
mln_assertion(this->data_->ima_.has(p));
Index: sandbox/folio/canevas_dt.hh
--- sandbox/folio/canevas_dt.hh (revision 2040)
+++ sandbox/folio/canevas_dt.hh (working copy)
@@ -31,7 +31,7 @@
typedef typename F::I I;
typedef typename F::N N;
typedef typename F::L L;
- typedef mln_point(I) point;
+ typedef mln_psite(I) point;
mln_ch_value(I, L) output;
@@ -56,7 +56,7 @@
typedef typename F::I I;
typedef typename F::N N;
typedef typename F::L L;
- typedef mln_point(I) point;
+ typedef mln_psite(I) point;
mln_ch_value(I, L) output;
1
0