* apps/statues/mesh-complex-max-curv-segm.cc,
* apps/statues/mesh-complex-max-curv.cc,
* apps/statues/mesh-complex-segm.cc,
* apps/statues/trimesh/misc.hh:
Adjust to the new interface of mln::morpho::closing_area and the
renaming of mln::level as mln::data.
* apps/statues/Makefile.am: Adjust comments.
---
milena/ChangeLog | 12 ++++++++++++
milena/apps/statues/Makefile.am | 6 +++++-
milena/apps/statues/mesh-complex-max-curv-segm.cc | 7 +++----
milena/apps/statues/mesh-complex-max-curv.cc | 8 ++++----
milena/apps/statues/mesh-complex-segm.cc | 5 ++---
milena/apps/statues/trimesh/misc.hh | 10 ++++++----
6 files changed, 32 insertions(+), 16 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index a33b571..7ffa783 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,17 @@
2009-02-11 Roland Levillain <roland(a)lrde.epita.fr>
+ Update apps/statues/ to catch up with recent changes of interface.
+
+ * apps/statues/mesh-complex-max-curv-segm.cc,
+ * apps/statues/mesh-complex-max-curv.cc,
+ * apps/statues/mesh-complex-segm.cc,
+ * apps/statues/trimesh/misc.hh:
+ Adjust to the new interface of mln::morpho::closing_area and the
+ renaming of mln::level as mln::data.
+ * apps/statues/Makefile.am: Adjust comments.
+
+2009-02-11 Roland Levillain <roland(a)lrde.epita.fr>
+
Add a shortcut for planar 1-complex-based images.
* mln/core/alias/complex_image.hh (mln::int_u8_1complex_image2d):
diff --git a/milena/apps/statues/Makefile.am b/milena/apps/statues/Makefile.am
index b0225c8..e132895 100644
--- a/milena/apps/statues/Makefile.am
+++ b/milena/apps/statues/Makefile.am
@@ -68,12 +68,16 @@ TESTS += test-mesh-max-curv
noinst_HEADERS = trimesh/misc.hh
EXTRA_DIST = trimesh/README
-# A small test exercising the curvature computation routines ported
+# A small program exercising the curvature computation routines ported
# from Trimesh to Milena.
bin_PROGRAMS += mesh-complex-max-curv
mesh_complex_max_curv_SOURCES = mesh-complex-max-curv.cc
TESTS += test-mesh-complex-max-curv
+# FIXME: Write a program showing the local minima (and maxima) of
+# scalar-valued complex-based mesh (to see the curvature extrema).
+# ...
+
# Segmentation program working on precomputed meshes with curvatures data.
bin_PROGRAMS += mesh-complex-segm
mesh_complex_segm_SOURCES = mesh-complex-segm.cc
diff --git a/milena/apps/statues/mesh-complex-max-curv-segm.cc b/milena/apps/statues/mesh-complex-max-curv-segm.cc
index 8a0537e..e52d990 100644
--- a/milena/apps/statues/mesh-complex-max-curv-segm.cc
+++ b/milena/apps/statues/mesh-complex-max-curv-segm.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009 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
@@ -131,8 +131,7 @@ int main(int argc, char* argv[])
adj_edges_nbh_t;
adj_edges_nbh_t adj_edges_nbh;
- ima_t closed_input(input.domain());
- mln::morpho::closing_area(input, adj_edges_nbh, lambda, closed_input);
+ ima_t closed_input = mln::morpho::closing_area(input, adj_edges_nbh, lambda);
/*------.
| WST. |
@@ -168,7 +167,7 @@ int main(int argc, char* argv[])
`---------*/
mln::rgb8_2complex_image3df output(wshed.domain());
- mln::level::fill(output, mln::literal::white);
+ mln::data::fill(output, mln::literal::white);
// FIXME: Use a colorize functor instead.
// Choose random colors for each basin number.
diff --git a/milena/apps/statues/mesh-complex-max-curv.cc b/milena/apps/statues/mesh-complex-max-curv.cc
index 0a75da5..5c93d7d 100644
--- a/milena/apps/statues/mesh-complex-max-curv.cc
+++ b/milena/apps/statues/mesh-complex-max-curv.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009 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
@@ -42,7 +42,7 @@
#include <mln/morpho/closing_area.hh>
#include <mln/morpho/meyer_wst.hh>
-#include <mln/level/fill.hh>
+#include <mln/data/fill.hh>
#include <mln/literal/zero.hh>
#include <mln/math/max.hh>
@@ -103,7 +103,7 @@ int main(int argc, char* argv[])
// Compute the max curvature at each vertex.
ima_t max_curv(input.domain());
- mln::level::fill(max_curv, mln::literal::zero);
+ mln::data::fill(max_curv, mln::literal::zero);
mln::p_n_faces_fwd_piter<D, G> v(max_curv.domain(), 0);
for_all(v)
max_curv(v) = mln::math::max(mln::math::sqr(curv.first(v)),
@@ -141,7 +141,7 @@ int main(int argc, char* argv[])
the only values accepted a an RGB floating-point component in the
OFF file format. */
ima_t output(max_curv.domain());
- mln::level::fill(output, mln::literal::zero);
+ mln::data::fill(output, mln::literal::zero);
std::pair<float, float> min_max(acc);
// FIXME: Taken from mln/level/stretch.hh (this should be factored).
float min = min_max.first;
diff --git a/milena/apps/statues/mesh-complex-segm.cc b/milena/apps/statues/mesh-complex-segm.cc
index 80f87a1..b67d7f6 100644
--- a/milena/apps/statues/mesh-complex-segm.cc
+++ b/milena/apps/statues/mesh-complex-segm.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009 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
@@ -106,8 +106,7 @@ int main(int argc, char* argv[])
adj_edges_nbh_t;
adj_edges_nbh_t adj_edges_nbh;
- ima_t closed_input(input.domain());
- mln::morpho::closing_area(input, adj_edges_nbh, lambda, closed_input);
+ ima_t closed_input = mln::morpho::closing_area(input, adj_edges_nbh, lambda);
/*------.
| WST. |
diff --git a/milena/apps/statues/trimesh/misc.hh b/milena/apps/statues/trimesh/misc.hh
index 78af913..a9f0fce 100644
--- a/milena/apps/statues/trimesh/misc.hh
+++ b/milena/apps/statues/trimesh/misc.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009 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
@@ -39,6 +39,8 @@
# include <mln/norm/l2.hh>
+# include <mln/data/fill.hh>
+
/** See http://gcc.gnu.org/onlinedocs/gcc-4.3.2/gcc/Other-Builtins.html
for a definition of __builtin_expect.
@@ -166,7 +168,7 @@ namespace mln
typedef complex_image< D, G, vec3f > normal_t;
normal_t normal(mesh);
- level::fill(normal, literal::zero);
+ data::fill(normal, literal::zero);
mln::p_n_faces_fwd_piter<D, G> f(mesh, 2);
// A neighborhood where neighbors are the set of 0-faces
@@ -263,8 +265,8 @@ namespace mln
output_t output(mesh, mesh);
corner_area_t& corner_area = output.first;
point_area_t& point_area = output.second;
- level::fill(corner_area, literal::zero);
- level::fill(point_area, literal::zero);
+ data::fill(corner_area, literal::zero);
+ data::fill(point_area, literal::zero);
mln::p_n_faces_fwd_piter<D, G> f(mesh, 2);
// A neighborhood where neighbors are the set of 0-faces
--
1.6.1.2
* mln/core/alias/complex_image.hh (mln::int_u8_1complex_image2d):
New typedef.
---
milena/ChangeLog | 7 +++++++
milena/mln/core/alias/complex_image.hh | 18 +++++++++++++++++-
2 files changed, 24 insertions(+), 1 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 55260fd..a33b571 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,12 @@
2009-02-11 Roland Levillain <roland(a)lrde.epita.fr>
+ Add a shortcut for planar 1-complex-based images.
+
+ * mln/core/alias/complex_image.hh (mln::int_u8_1complex_image2d):
+ New typedef.
+
+2009-02-11 Roland Levillain <roland(a)lrde.epita.fr>
+
Add a shortcut for planar 1-complex geometry.
* mln/core/alias/complex_geometry.hh
diff --git a/milena/mln/core/alias/complex_image.hh b/milena/mln/core/alias/complex_image.hh
index 0d8e379..31aa50c 100644
--- a/milena/mln/core/alias/complex_image.hh
+++ b/milena/mln/core/alias/complex_image.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009 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
@@ -30,6 +30,9 @@
/// \file mln/core/alias/complex_image.hh
/// \brief Definition of mln::complex_image aliases.
+///
+/// As C++ does not allow template typedefs (yet), using shortcuts for
+/// very long image names is handy.
# include <mln/core/image/complex_image.hh>
# include <mln/core/alias/complex_geometry.hh>
@@ -41,6 +44,19 @@
namespace mln
{
/*------------------------------.
+ | 2-d plane 1-complex aliases. |
+ `------------------------------*/
+
+ /// \brief Type alias for an 8-bit gray-level image based on a
+ /// 1-complex, where 0-faces are located at discrete (integer)
+ /// 2-dimensional points.
+ typedef
+ mln::complex_image<1, mln::discrete_plane_1complex_geometry,
+ mln::value::int_u8>
+ int_u8_1complex_image2d;
+
+
+ /*------------------------------.
| 2-d plane 2-complex aliases. |
`------------------------------*/
--
1.6.1.2
* mln/core/alias/complex_geometry.hh
(mln::discrete_plane_1complex_geometry): New typedef.
---
milena/ChangeLog | 7 +++++++
milena/mln/core/alias/complex_geometry.hh | 6 ++++++
2 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 0d2e7ed..55260fd 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,12 @@
2009-02-11 Roland Levillain <roland(a)lrde.epita.fr>
+ Add a shortcut for planar 1-complex geometry.
+
+ * mln/core/alias/complex_geometry.hh
+ (mln::discrete_plane_1complex_geometry): New typedef.
+
+2009-02-11 Roland Levillain <roland(a)lrde.epita.fr>
+
Fix and factor mln::point3df and mln::point3d.
* mln/core/alias/point3df.hh (mln::point3df): Move typedef...
diff --git a/milena/mln/core/alias/complex_geometry.hh b/milena/mln/core/alias/complex_geometry.hh
index e9ce8de..79c7db1 100644
--- a/milena/mln/core/alias/complex_geometry.hh
+++ b/milena/mln/core/alias/complex_geometry.hh
@@ -40,6 +40,12 @@
namespace mln
{
+ /// \brief Type alias for the geometry of a 1-complex (e.g., a
+ /// graph) located in a discrete 2-dimensional plane (with integer
+ /// coordinates).
+ typedef mln::geom::complex_geometry<1, point2d>
+ discrete_plane_1complex_geometry;
+
/// \brief Type alias for the geometry of a 2-complex located in a
/// discrete 2-dimensional plane (with integer coordinates).
typedef mln::geom::complex_geometry<2, point2d>
--
1.6.1.2
* mln/core/alias/point3df.hh (mln::point3df): Move typedef...
* mln/core/alias/point3d.hh: ...here.
* mln/core/alias/point3df.hh: Remove file.
* mln/core/alias/all.hh: Remove inclusion of
mln/core/alias/point3df.hh.
* mln/core/alias/complex_geometry.hh: Adjust.
---
milena/ChangeLog | 11 ++
milena/mln/core/alias/all.hh | 1 -
milena/mln/core/alias/complex_geometry.hh | 4 +-
milena/mln/core/alias/point3d.hh | 7 +-
milena/mln/core/alias/point3df.hh | 216 -----------------------------
5 files changed, 19 insertions(+), 220 deletions(-)
delete mode 100644 milena/mln/core/alias/point3df.hh
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 7172cfb..0d2e7ed 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,3 +1,14 @@
+2009-02-11 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Fix and factor mln::point3df and mln::point3d.
+
+ * mln/core/alias/point3df.hh (mln::point3df): Move typedef...
+ * mln/core/alias/point3d.hh: ...here.
+ * mln/core/alias/point3df.hh: Remove file.
+ * mln/core/alias/all.hh: Remove inclusion of
+ mln/core/alias/point3df.hh.
+ * mln/core/alias/complex_geometry.hh: Adjust.
+
2009-02-11 Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Minor fixes.
diff --git a/milena/mln/core/alias/all.hh b/milena/mln/core/alias/all.hh
index a7dde7f..e79a358 100644
--- a/milena/mln/core/alias/all.hh
+++ b/milena/mln/core/alias/all.hh
@@ -51,7 +51,6 @@
#include <mln/core/alias/point2d.hh>
#include <mln/core/alias/point2d_h.hh>
#include <mln/core/alias/point3d.hh>
-#include <mln/core/alias/point3df.hh>
#include <mln/core/alias/vec3d.hh>
#include <mln/core/alias/w_window1d_float.hh>
#include <mln/core/alias/w_window1d_int.hh>
diff --git a/milena/mln/core/alias/complex_geometry.hh b/milena/mln/core/alias/complex_geometry.hh
index 2ba0362..e9ce8de 100644
--- a/milena/mln/core/alias/complex_geometry.hh
+++ b/milena/mln/core/alias/complex_geometry.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009 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
@@ -34,7 +34,7 @@
# include <mln/geom/complex_geometry.hh>
# include <mln/core/alias/point2d.hh>
-# include <mln/core/alias/point3df.hh>
+# include <mln/core/alias/point3d.hh>
namespace mln
diff --git a/milena/mln/core/alias/point3d.hh b/milena/mln/core/alias/point3d.hh
index 7ffac8f..acbf721 100644
--- a/milena/mln/core/alias/point3d.hh
+++ b/milena/mln/core/alias/point3d.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory
// (LRDE)
//
// This file is part of the Olena Library. This library is free
@@ -48,6 +48,11 @@ namespace mln
*/
typedef point<grid::cube, def::coord> point3d;
+ /*! \brief Type alias for a point defined on the 3D square grid with
+ * floating-point coordinates.
+ */
+ typedef point<grid::cube, def::coordf> point3df;
+
namespace internal
{
diff --git a/milena/mln/core/alias/point3df.hh b/milena/mln/core/alias/point3df.hh
deleted file mode 100644
index 4fed640..0000000
--- a/milena/mln/core/alias/point3df.hh
+++ /dev/null
@@ -1,216 +0,0 @@
-// Copyright (C) 2007, 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_POINT3DF_HH
-# define MLN_CORE_ALIAS_POINT3DF_HH
-
-/*! \file mln/core/alias/point3df.hh
- *
- * \brief Definition of the mln::point3df alias and of its construction
- * routine.
- */
-
-/* FIXME: Factor with mln/core/alias/point3d.hh (these two files are
- almost identical). */
-
-# include <mln/core/point.hh>
-# include <mln/core/def/coordf.hh>
-// For site_const_impl and site_mutable_impl:
-# include <mln/core/concept/site_proxy.hh>
-# include <mln/core/internal/force_exact.hh>
-
-namespace mln
-{
-
- /*! \brief Type alias for a point defined on the 3D square grid with
- * floating-point coordinates.
- */
- typedef point<grid::cube, def::coordf> point3df;
-
- namespace internal
- {
-
- // Specialization.
-
- template <typename C, typename E>
- struct subject_impl< const point<grid::cube, C>, E >
- {
- typedef C coordf;
- enum { dim = 3 };
-
- typedef const C& row_t;
- const C& row() const;
-
- typedef const C& col_t;
- const C& col() const;
-
- typedef const C& sli_t;
- const C& sli() const;
-
- const C& operator[](unsigned i) const;
- const C& last_coord() const;
- private:
- const E& exact_() const;
- };
-
-
- // Specialization for point<M,C>.
-
- template <typename C, typename E>
- struct subject_impl< point<grid::cube, C>, E > :
- subject_impl< const point<grid::cube, C>, E >
- {
- private:
- typedef subject_impl< const point<grid::cube, C>, E > super_;
- E& exact_();
- public:
-
- using super_::row;
- C& row();
-
- using super_::col;
- C& col();
-
- using super_::sli;
- C& sli();
-
- using super_::operator[];
- C& operator[](unsigned i);
- };
-
-
-
-# ifndef MLN_INCLUDE_ONLY
-
- // subject_impl
-
- template <typename C, typename E>
- inline
- const C&
- subject_impl< const point<grid::cube, C>, E >::row() const
- {
- return exact_().get_subject().row();
- }
-
- template <typename C, typename E>
- inline
- const C&
- subject_impl< const point<grid::cube, C>, E >::col() const
- {
- return exact_().get_subject().col();
- }
-
- template <typename C, typename E>
- inline
- const C&
- subject_impl< const point<grid::cube, C>, E >::sli() const
- {
- return exact_().get_subject().sli();
- }
-
- template <typename C, typename E>
- inline
- const C&
- subject_impl< const point<grid::cube, C>, E >::operator[](unsigned i) const
- {
- mln_precondition(i < 3);
- return exact_().get_subject()[i];
- }
-
- template <typename C, typename E>
- inline
- const C&
- subject_impl< const point<grid::cube, C>, E >::last_coord() const
- {
- return this->col();
- }
-
- template <typename C, typename E>
- inline
- const E&
- subject_impl< const point<grid::cube, C>, E >::exact_() const
- {
- return internal::force_exact<const E>(*this);
- }
-
- // subject_impl
-
- template <typename C, typename E>
- inline
- C&
- subject_impl< point<grid::cube, C>, E >::row()
- {
- return exact_().get_subject().row();
- }
-
- template <typename C, typename E>
- inline
- C&
- subject_impl< point<grid::cube, C>, E >::col()
- {
- return exact_().get_subject().col();
- }
-
- template <typename C, typename E>
- inline
- C&
- subject_impl< point<grid::cube, C>, E >::sli()
- {
- return exact_().get_subject().sli();
- }
-
- template <typename C, typename E>
- inline
- C&
- subject_impl< point<grid::cube, C>, E >::operator[](unsigned i)
- {
- mln_precondition(i < 3);
- return exact_().get_subject()[i];
- }
-
- template <typename C, typename E>
- inline
- E&
- subject_impl< point<grid::cube, C>, E >::exact_()
- {
- return internal::force_exact<E>(*this);
- }
-
-# endif // ! MLN_INCLUDE_ONLY
-
- } // end of namespace mln::internal
-
-
-} // end of namespace mln
-
-// FIXME: File mln/core/alias/dpoint3df does not exist yet.
-# if 0
-# include <mln/core/alias/dpoint3df.hh>
-# endif
-
-#endif // ! MLN_CORE_ALIAS_POINT3DF_HH
--
1.6.1.2