https://svn.lrde.epita.fr/svn/oln/trunk/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Help g++-2.95.
* mln/topo/skeleton/crest.hh: Layout. Upgrade doc style.
* mln/world/binary_2d/enlarge.hh: Help g++-2.95.
* mln/metal/converts_to.hh: Layout.
* mln/make/image3d.hh (image3d): Disambiguate overloading.
Help g++-2.95.
Explicitly use mln::box2d in static check.
* mln/convert/from_to.hh (todo): New.
Layout.
* tests/topo/skeleton/crest.cc: Upgrade doc style.
Disambiguate transform call (mln v. std) for g++-2.95.
mln/convert/from_to.hh | 17 +++++++++++------
mln/make/image3d.hh | 18 +++++++++++-------
mln/topo/skeleton/crest.hh | 3 +--
mln/world/binary_2d/enlarge.hh | 3 ++-
tests/topo/skeleton/crest.cc | 10 ++--------
5 files changed, 27 insertions(+), 24 deletions(-)
Index: mln/topo/skeleton/crest.hh
--- mln/topo/skeleton/crest.hh (revision 3950)
+++ mln/topo/skeleton/crest.hh (working copy)
@@ -30,11 +30,10 @@
/// \file mln/topo/skeleton/crest.hh
///
-/// Compute skeletization constraints.
+/// \brief Compute skeletization constraints.
# include <mln/core/concept/image.hh>
# include <mln/core/concept/neighborhood.hh>
-
# include <mln/data/fill.hh>
Index: mln/world/binary_2d/enlarge.hh
--- mln/world/binary_2d/enlarge.hh (revision 3950)
+++ mln/world/binary_2d/enlarge.hh (working copy)
@@ -356,7 +356,8 @@
trace::entering("mln::world::binary_2d::enlarge");
mln_precondition(exact(input).is_valid());
- mlc_bool(mln_site_(I)::dim == 2)::check();
+ typedef mln_site(I) S;
+ mlc_bool(S::dim == 2)::check();
mln_concrete(I) output;
if (n == 0)
Index: mln/metal/converts_to.hh
Index: mln/make/image3d.hh
--- mln/make/image3d.hh (revision 3950)
+++ mln/make/image3d.hh (working copy)
@@ -1,4 +1,5 @@
-// 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,7 +31,8 @@
/// \file mln/make/image3d.hh
///
-/// Routine to create a 3D image from an array of 2D images.
+/// \brief Routine to create a 3D image from an array of 2D images or
+/// from one 2D image.
///
/// \todo Think about removing make::image3d since it is redundant
/// with convert::to and convert::from_to.
@@ -55,11 +57,11 @@
mln::image3d<mln_value(I)>
image3d(const util::array<I>& ima);
- /// Create an image3d from a 2D images.
+ /// Create an image3d from a 2D image.
///
template <typename I>
mln::image3d<mln_value(I)>
- image3d(const I& ima);
+ image3d(const Image<I>& ima);
# ifndef MLN_INCLUDE_ONLY
@@ -69,7 +71,7 @@
mln::image3d<mln_value(I)>
image3d(const util::array<I>& ima)
{
- mlc_is_a(mln_domain(I), Box)::check();
+ mlc_is_a(mln_domain(I), mln::box2d)::check();
mln_precondition(! ima.is_empty());
def::coord n_slices = ima.nelements();
@@ -89,9 +91,11 @@
template <typename I>
inline
mln::image3d<mln_value(I)>
- image3d(const I& ima)
+ image3d(const Image<I>& ima_)
{
- mlc_is_a(mln_domain(I), Box)::check();
+ const I& ima = exact(ima_);
+
+ mlc_equal(mln_domain(I), mln::box2d)::check();
mln_precondition(ima.is_valid());
mln::box2d b = ima.domain();
Index: mln/convert/from_to.hh
--- mln/convert/from_to.hh (revision 3950)
+++ mln/convert/from_to.hh (working copy)
@@ -1,4 +1,5 @@
-// 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,11 +31,13 @@
/// \file mln/convert/from_to.hh
///
-/// General conversion procedure between two objects.
+/// \brief General conversion procedure between two objects.
///
/// \todo Test the effectiveness of guards.
+///
/// \todo Dispatch code in appropriate files.
-
+///
+/// \todo Find a solution for g++-2.95 and '...'; see FIXME below.
# include <mln/convert/impl/all.hh>
# include <mln/convert/from_to.hxx>
@@ -112,7 +115,8 @@
template <typename F, typename T>
inline
void
- from_to_dispatch(const metal::true_&, const Object<F>& from,
Object<T>& to)
+ from_to_dispatch(metal::true_,
+ const Object<F>& from, Object<T>& to)
{
exact(to) = exact(from);
}
@@ -122,7 +126,8 @@
template <typename F, typename T>
inline
void
- from_to_dispatch(const metal::false_&, const Object<F>& from,
Object<T>& to)
+ from_to_dispatch(metal::false_,
+ const Object<F>& from, Object<T>& to)
{
over_load::from_to_(exact(from), exact(to));
}
@@ -137,7 +142,7 @@
void
from_to_dispatch(const Object<F>& from, Object<T>& to)
{
- typedef mlc_converts_to(F, T) F_converts_to_T;
+ typedef mlc_converts_to(F, T) F_converts_to_T; // FIXME: HERE we've got a problem
with g++-2.95.
internal::from_to_dispatch(F_converts_to_T(),
exact(from), exact(to));
}
Index: tests/topo/skeleton/crest.cc
--- tests/topo/skeleton/crest.cc (revision 3950)
+++ tests/topo/skeleton/crest.cc (working copy)
@@ -27,22 +27,16 @@
/// \file tests/topo/skeleton/crest.cc
///
-/// Test of mln::topo::skeleton::crest.
+/// \brief Test of mln::topo::skeleton::crest.
# include <mln/core/alias/neighb2d.hh>
# include <mln/core/image/image2d.hh>
-
# include <mln/data/compare.hh>
-
# include <mln/logical/not.hh>
-
# include <mln/make/image.hh>
# include <mln/make/w_window2d_int.hh>
-
# include <mln/topo/skeleton/crest.hh>
-
# include <mln/transform/distance_front.hh>
-
# include <mln/value/int_u8.hh>
@@ -76,7 +70,7 @@
image2d<bool> crest_ref = make::image(ref_dat);
image2d<value::int_u8>
- dist_map = transform::distance_front(logical::not_(input), c8(),
+ dist_map = mln::transform::distance_front(logical::not_(input), c8(),
make::w_window2d_int(vals),
mln_max(value::int_u8));
image2d<bool> crest_ima = topo::skeleton::crest(input, dist_map, c8());