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/trunk/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Fix data::paste test.
* tests/data/paste.cc (main): Fix test.
paste.cc | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
Index: tests/data/paste.cc
--- tests/data/paste.cc (revision 3127)
+++ tests/data/paste.cc (working copy)
@@ -131,17 +131,19 @@
// image if test
{
typedef image2d<unsigned short> I;
- typedef image_if<I, fun::p2b::chess> II;
+ typedef fun::p2b::chess F;
+ F f;
+ typedef image_if<I, F> II;
I ima(size, size);
I out(size, size);
- II ima_if = ima | fun::p2b::chess();
+ II ima_if = ima | f;
data::fill_with_value(ima, 0);
debug::iota(ima);
data::paste(ima_if, out);
- mln_assertion(ima_if == out);
+ mln_assertion(ima_if == (out | f));
}
// cast image test
1
0
02 Jan '09
https://svn.lrde.epita.fr/svn/oln/trunk/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Replace dynamic dispatch in data::paste by static dispatch.
* mln/metal/bool.hh: Upgrade file doc style.
* mln/data/paste.spe.hh (paste_): Rename as...
(paste_dispatch): ...this.
Replace dynamic dispatch by static dispatch:
(paste_direct_ext_dispatch): New.
(paste_direct_noext_dispatch): New.
(paste_one_block_dispatch): New.
* mln/data/paste.hh: Update.
data/paste.hh | 2
data/paste.spe.hh | 140 ++++++++++++++++++++++++++++++++++--------------------
metal/bool.hh | 8 +--
3 files changed, 94 insertions(+), 56 deletions(-)
Index: mln/metal/bool.hh
--- mln/metal/bool.hh (revision 3126)
+++ mln/metal/bool.hh (working copy)
@@ -1,4 +1,5 @@
// 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
@@ -28,10 +29,9 @@
#ifndef MLN_METAL_BOOL_HH
# define MLN_METAL_BOOL_HH
-/*! \file mln/metal/bool.hh
- *
- * \brief Definition of a Boolean value type.
- */
+/// \file mln/metal/bool.hh
+///
+/// Definition of a Boolean value type.
# include <string>
Index: mln/data/paste.spe.hh
--- mln/data/paste.spe.hh (revision 3126)
+++ mln/data/paste.spe.hh (working copy)
@@ -67,6 +67,7 @@
namespace generic
{
+ // Forward declaration.
template <typename I, typename J>
void paste(const Image<I>& input, Image<J>& output);
}
@@ -151,73 +152,99 @@
// Dispatch.
+
namespace internal
{
template <typename I, typename J>
- inline
- void paste_(mln::trait::image::value_access::direct,
- mln::trait::image::value_access::direct,
- mln::trait::image::ext_domain::some,
- mln::trait::image::ext_domain::some,
- const Image<I>& input_,
- Image<J>& output_)
+ inline // Direct access and extension.
+ void paste_direct_ext_dispatch(metal::true_, // Same value size.
+ const I& input,
+ J& output)
{
- const I& input = exact(input_);
- J& output = exact(output_);
-
- if (sizeof(mln_value(I)) == sizeof(mln_value(J)))
- {
- if (border::get(input) == border::get(output) &&
- input.domain() == output.domain())
+ if (input.domain() == output.domain()
+ && border::get(input) == border::get(output))
impl::paste_fastest(input, output);
else
impl::paste_lines(input, output);
}
- else
+
+ template <typename I, typename J>
+ inline // Direct access and extension.
+ void paste_direct_ext_dispatch(metal::false_, // Different value size.
+ const I& input,
+ J& output)
+ {
impl::paste_fast(input, output);
}
template <typename I, typename J>
inline
- void paste_(mln::trait::image::value_access::direct,
- mln::trait::image::value_access::direct,
- mln::trait::image::ext_domain::none,
- mln::trait::image::ext_domain::none,
- const Image<I>& input_,
- Image<J>& output_)
+ void paste_dispatch(trait::image::value_access::direct,
+ trait::image::value_access::direct,
+ trait::image::ext_domain::some,
+ trait::image::ext_domain::some,
+ const Image<I>& input,
+ Image<J>& output)
{
- const I& input = exact(input_);
- J& output = exact(output_);
-
+ enum { same_size = sizeof(mln_value(I)) == sizeof(mln_value(J)) };
+ paste_direct_ext_dispatch(metal::bool_<same_size>(),
+ exact(input), exact(output));
+ }
- if (sizeof(mln_value(I)) == sizeof(mln_value(J)))
+ template <typename I, typename J>
+ inline // Direct access and no extension.
+ void paste_direct_noext_dispatch(metal::true_, // Same value size.
+ const I& input,
+ J& output)
{
if (input.domain() == output.domain())
impl::paste_fastest(input, output);
else
impl::paste_lines(input, output);
}
- else
+
+ template <typename I, typename J>
+ inline // Direct access and no extension.
+ void paste_direct_noext_dispatch(metal::false_, // Different value size.
+ const I& input,
+ J& output)
+ {
impl::paste_fast(input, output);
}
+ template <typename I, typename J>
+ inline
+ void paste_dispatch(trait::image::value_access::direct,
+ trait::image::value_access::direct,
+ trait::image::ext_domain::none,
+ trait::image::ext_domain::none,
+ const Image<I>& input,
+ Image<J>& output)
+ {
+ enum { same_size = sizeof(mln_value(I)) == sizeof(mln_value(J)) };
+ paste_direct_noext_dispatch(metal::bool_<same_size>(),
+ exact(input), exact(output));
+ }
template <typename I, typename J>
inline
- void paste_(mln::trait::image::value_access::any,
- mln::trait::image::value_access::any,
- mln::trait::image::ext_domain::any,
- mln::trait::image::ext_domain::any,
+ void paste_dispatch(trait::image::value_access::any,
+ trait::image::value_access::any,
+ trait::image::ext_domain::any,
+ trait::image::ext_domain::any,
const Image<I>& input,
Image<J>& output)
{
impl::generic::paste(input, output);
}
+
+ // Dispatch w.r.t. "value storage".
+
template <typename I, typename J>
inline
- void paste_(trait::image::value_storage::any,
+ void paste_dispatch(trait::image::value_storage::any,
trait::image::value_storage::any,
const Image<I>& input,
Image<J>& output)
@@ -227,7 +254,7 @@
template <typename I, typename J>
inline
- void paste_(trait::image::value_storage::singleton,
+ void paste_dispatch(trait::image::value_storage::singleton,
trait::image::value_storage::any,
const Image<I>& input,
Image<J>& output)
@@ -238,38 +265,49 @@
template <typename I, typename J>
inline
- void paste_(mln::trait::image::value_storage::one_block,
- mln::trait::image::value_storage::one_block,
- const Image<I>& input_,
- Image<J>& output_)
- {
- const I& input = exact(input_);
- J& output = exact(output_);
-
-
- /// Check basic properties
- if (mlc_is(mln_trait_image_value_alignement(I),
- trait::image::value_alignement::with_grid)::value &&
- mlc_is(mln_trait_image_value_alignement(J),
- trait::image::value_alignement::with_grid)::value)
+ void paste_one_block_dispatch(metal::true_, // One-block values and "grid-aligned".
+ const Image<I>& input,
+ Image<J>& output)
{
- paste_(mln_trait_image_value_access(I)(),
+ paste_dispatch(mln_trait_image_value_access(I)(),
mln_trait_image_value_access(J)(),
mln_trait_image_ext_domain(I)(),
mln_trait_image_ext_domain(J)(),
input, output);
}
- else
+
+ template <typename I, typename J>
+ inline
+ void paste_one_block_dispatch(metal::false_, // One-block values but not "grid-aligned".
+ const Image<I>& input,
+ Image<J>& output)
+ {
impl::generic::paste(input, output);
}
+ template <typename I, typename J>
+ inline
+ void paste_dispatch(trait::image::value_storage::one_block,
+ trait::image::value_storage::one_block,
+ const Image<I>& input,
+ Image<J>& output)
+ {
+ enum { alignments = mlc_is(mln_trait_image_value_alignement(I),
+ trait::image::value_alignement::with_grid)::value
+ && mlc_is(mln_trait_image_value_alignement(J),
+ trait::image::value_alignement::with_grid)::value };
+ paste_one_block_dispatch(metal::bool_<alignments>(), input, output);
+ }
+
+
+ // Dispatch entry.
template <typename I, typename J>
inline
- void paste_(const Image<I>& input, Image<J>& output)
+ void paste_dispatch(const Image<I>& input, Image<J>& output)
{
- paste_(mln_trait_image_value_storage(I)(),
+ paste_dispatch(mln_trait_image_value_storage(I)(),
mln_trait_image_value_storage(J)(),
input, output);
}
@@ -283,4 +321,4 @@
# endif // ! MLN_INCLUDE_ONLY
-#endif // ! MLN_DATA_PASTE_HH
+#endif // ! MLN_DATA_PASTE_SPE_HH
Index: mln/data/paste.hh
--- mln/data/paste.hh (revision 3126)
+++ mln/data/paste.hh (working copy)
@@ -130,7 +130,7 @@
trace::entering("data::paste");
internal::paste_tests(input, output);
- internal::paste_(input, output);
+ internal::paste_dispatch(input, output);
trace::exiting("data::paste");
}
1
0
* mln/border/resize.hh: precise mln:: in order to avoir ambiguity.
* mln/fun/internal/array_base.hh: add append().
* mln/geom/complex_geometry.hh: cleanup comments.
* mln/util/site_pair.hh: add operator<<.
* mln/morpho/line_gradient.hh,
* tests/morpho/lena_line_graph_image_wst1.cc: use i2v::array::append().
* tests/morpho/line_graph_image_wst.cc: Fix test. Associate edges to
the proper sites.
---
milena/ChangeLog | 18 ++++++++++++++++++
milena/mln/border/resize.hh | 2 +-
milena/mln/fun/internal/array_base.hh | 12 ++++++++++++
milena/mln/geom/complex_geometry.hh | 12 ++++++------
milena/mln/morpho/line_gradient.hh | 7 ++-----
milena/mln/util/site_pair.hh | 13 +++++++++++++
milena/tests/morpho/lena_line_graph_image_wst1.cc | 8 +++-----
milena/tests/morpho/line_graph_image_wst.cc | 16 ++++++++++++----
8 files changed, 67 insertions(+), 21 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index dbb1dea..3b45f6e 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,23 @@
2008-12-31 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Few small fixes.
+
+ * mln/border/resize.hh: precise mln:: in order to avoir ambiguity.
+
+ * mln/fun/internal/array_base.hh: add append().
+
+ * mln/geom/complex_geometry.hh: cleanup comments.
+
+ * mln/util/site_pair.hh: add operator<<.
+
+ * mln/morpho/line_gradient.hh,
+ * tests/morpho/lena_line_graph_image_wst1.cc: use i2v::array::append().
+
+ * tests/morpho/line_graph_image_wst.cc: Fix test. Associate edges to
+ the proper sites.
+
+2008-12-31 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Propagate renaming has_data as is_valid.
* doc/tutorial/image_types.txt,
diff --git a/milena/mln/border/resize.hh b/milena/mln/border/resize.hh
index fcdfad8..1963469 100644
--- a/milena/mln/border/resize.hh
+++ b/milena/mln/border/resize.hh
@@ -79,7 +79,7 @@ namespace mln
if (border::get(ima) == thickness)
return; // No-op.
- mln_concrete(I) memo = duplicate(ima);
+ mln_concrete(I) memo = mln::duplicate(ima);
ima.resize_(thickness);
data::fill(ima, memo);
diff --git a/milena/mln/fun/internal/array_base.hh b/milena/mln/fun/internal/array_base.hh
index e26ab91..637fab7 100644
--- a/milena/mln/fun/internal/array_base.hh
+++ b/milena/mln/fun/internal/array_base.hh
@@ -62,6 +62,10 @@ namespace mln
/// Set the function size to \p n and initialize the value with
/// \p val.
void resize(unsigned n, const T& val);
+
+ /// Append a new value in the function.
+ void append(const T& val);
+
/// Return the number of values.
unsigned size() const;
@@ -160,6 +164,14 @@ namespace mln
template <typename T>
inline
void
+ array_base<T>::append(const T& val)
+ {
+ v_.push_back(val);
+ }
+
+ template <typename T>
+ inline
+ void
array_base<T>::resize(unsigned n, const T& val)
{
v_.resize(n, val);
diff --git a/milena/mln/geom/complex_geometry.hh b/milena/mln/geom/complex_geometry.hh
index 18ed6da..a162c6c 100644
--- a/milena/mln/geom/complex_geometry.hh
+++ b/milena/mln/geom/complex_geometry.hh
@@ -29,7 +29,7 @@
# define MLN_GEOM_COMPLEX_GEOMETRY_HH
/// \file mln/geom/complex_geometry.hh
-/// \brief A functor associating geometry (location) data to the faces
+/// A functor associating geometry (location) data to the faces
/// of a complex.
///
/// \see mln::topo::complex.
@@ -68,7 +68,7 @@ namespace mln
}
- /** \brief A functor returning the sites of the faces of a complex
+ /** A functor returning the sites of the faces of a complex
where the locations of each 0-face is stored. Faces of higher
dimensions are computed.
@@ -94,18 +94,18 @@ namespace mln
typedef util::multi_site<P> site;
public:
- /// \brief Build a complex geometry object.
+ /// Build a complex geometry object.
complex_geometry();
public:
- /// \brief Populate the set of locations.
+ /// Populate the set of locations.
///
/// Append a new location \a p. Return the index of the newly
/// created location (which should semantically match the id of
/// the corresonding 0-face in the complex).
unsigned add_location(const P& p);
- /// \brief Retrieve the site associated to \a f.
+ /// Retrieve the site associated to \a f.
site operator()(const mln::topo::face<D>& f) const;
private:
@@ -115,7 +115,7 @@ namespace mln
namespace internal
{
- /// \brief The data stored in a complex_geometry object.
+ /// The data stored in a complex_geometry object.
///
/// \arg \p P The type of the location of a 0-face.
template <typename P>
diff --git a/milena/mln/morpho/line_gradient.hh b/milena/mln/morpho/line_gradient.hh
index bc49df9..4b12d4a 100644
--- a/milena/mln/morpho/line_gradient.hh
+++ b/milena/mln/morpho/line_gradient.hh
@@ -107,11 +107,8 @@ namespace mln
{
g.add_edge(vpsite(p), vpsite(q));
// The computed value is a norm of the gradient between P and Q.
- unsigned edge_id = edge_values.size();
- edge_values.resize(edge_values.size() + 1);
- edge_sites.resize(edge_sites.size() + 1);
- edge_values(edge_id) = math::abs(ima(p) - ima(q));
- edge_sites(edge_id) = util::site_pair<point2d>(p, q);
+ edge_values.append(math::abs(ima(p) - ima(q)));
+ edge_sites.append(util::site_pair<point2d>(p, q));
}
// Line graph point set.
diff --git a/milena/mln/util/site_pair.hh b/milena/mln/util/site_pair.hh
index 9bb3162..0dbc531 100644
--- a/milena/mln/util/site_pair.hh
+++ b/milena/mln/util/site_pair.hh
@@ -83,6 +83,10 @@ namespace mln
template <typename P>
bool operator< (const site_pair<P>& lhs, const site_pair<P>& rhs);
+ template <typename P>
+ std::ostream&
+ operator<<(std::ostream& ostr, const site_pair<P>& p);
+
} // end of namespace mln::util
@@ -181,6 +185,15 @@ namespace mln
return lhs.pair() <= rhs.pair();
}
+ template <typename P>
+ inline
+ std::ostream&
+ operator<<(std::ostream& ostr, const site_pair<P>& p)
+ {
+ ostr << "(" << p.first() << ", " << p.second() << ")";
+ return ostr;
+ }
+
} // end of mln::util
namespace internal
diff --git a/milena/tests/morpho/lena_line_graph_image_wst1.cc b/milena/tests/morpho/lena_line_graph_image_wst1.cc
index d897d96..b100bec 100644
--- a/milena/tests/morpho/lena_line_graph_image_wst1.cc
+++ b/milena/tests/morpho/lena_line_graph_image_wst1.cc
@@ -139,11 +139,9 @@ int main()
for_all(q)
if (work.domain().has(q))
{
- unsigned edge_id = g.add_edge(equiv_vertex(p), equiv_vertex(q));
- edge_values.resize(edge_values.size() + 1);
- edge_sites.resize(edge_sites.size() + 1);
- edge_values(edge_id) = math::max(work(p), work(q));
- edge_sites(edge_id) = util::site_pair<point2d>(p, q);
+ g.add_edge(equiv_vertex(p), equiv_vertex(q));
+ edge_values.append(math::max(work(p), work(q)));
+ edge_sites.append(util::site_pair<point2d>(p, q));
}
// Line graph point set.
diff --git a/milena/tests/morpho/line_graph_image_wst.cc b/milena/tests/morpho/line_graph_image_wst.cc
index e9f5871..c6c2ac0 100644
--- a/milena/tests/morpho/line_graph_image_wst.cc
+++ b/milena/tests/morpho/line_graph_image_wst.cc
@@ -39,6 +39,7 @@
#include <mln/pw/all.hh>
#include <mln/fun/i2v/array.hh>
#include <mln/util/graph.hh>
+#include <mln/util/site_pair.hh>
#include <mln/morpho/meyer_wst.hh>
@@ -70,7 +71,7 @@ int main()
// Sites associated to vertices.
typedef fun::i2v::array<point2d> fsite_t;
- fsite_t sites(5);
+ fsite_t sites(8);
sites(0) = point2d(0,0); // Point associated to vertex 0.
sites(1) = point2d(0,1); // Point associated to vertex 1.
sites(2) = point2d(0,2); // Point associated to vertex 2.
@@ -97,8 +98,15 @@ int main()
g.add_edge(5, 6);
g.add_edge(6, 7);
- typedef p_edges<util::graph, fsite_t> pe_t;
- pe_t pe(g, sites);
+ // Associate edges to sites.
+ typedef fun::i2v::array< util::site_pair<point2d> > edge_sites_t;
+ edge_sites_t edge_sites(g.e_nmax());
+ mln_edge_iter_(util::graph) e(g);
+ for_all(e)
+ edge_sites(e) = util::site_pair<point2d>(sites(e.v1()), sites(e.v2()));
+
+ typedef p_edges<util::graph, edge_sites_t> pe_t;
+ pe_t pe(g, edge_sites);
// Edge values.
typedef fun::i2v::array<int> edge_values_t;
@@ -122,7 +130,7 @@ int main()
std::cout << "ima (" << p << ") = " << ima(p) << std::endl;
std::cout << std::endl;
- typedef line_graph_elt_window<util::graph, fsite_t> win_t;
+ typedef line_graph_elt_window<util::graph, edge_sites_t> win_t;
win_t win;
neighb<win_t> nbh(win);
--
1.5.6.5
1
0
* doc/tutorial/image_types.txt,
* sandbox/abraham/mln/level/thru.hh,
* sandbox/abraham/mln/morpho/autarkical_leveling.hh,
* sandbox/abraham/mln/morpho/hit_or_miss.hh,
* sandbox/abraham/mln/morpho/vector_median.hh,
* sandbox/abraham/mln/morpho/vmt.hh,
* sandbox/ballas/color/reference.cc,
* sandbox/ballas/refactorization/rle_image.hh,
* sandbox/duhamel/border_duplicate.cc,
* sandbox/duhamel/border_duplicate.hh,
* sandbox/duhamel/border_fill.cc,
* sandbox/duhamel/border_fill.hh,
* sandbox/duhamel/border_mirror.hh,
* sandbox/duhamel/debug_print_3d_with_border.hh,
* sandbox/duhamel/mesh_image.hh,
* sandbox/duhamel/translate_image.hh,
* sandbox/folio/chamfer.cc,
* sandbox/folio/dt.hh,
* sandbox/folio/dt/canvas_dt.hh,
* sandbox/folio/dt/chamfer.hh,
* sandbox/folio/dt/cp.hh,
* sandbox/folio/dt/dmap.hh,
* sandbox/folio/dt/path.hh,
* sandbox/folio/dt/raw_cp_fast.hh,
* sandbox/folio/dt/raw_cp_slow.hh,
* sandbox/folio/dt/raw_dmap_fast.hh,
* sandbox/folio/dt/raw_dmap_slow.hh,
* sandbox/folio/dt/raw_path_fast.hh,
* sandbox/folio/dt/raw_path_slow.hh,
* sandbox/folio/naive.cc,
* sandbox/folio/psn.cc,
* sandbox/folio/psn_log.cc,
* sandbox/folio/test/canvas/dt.hh,
* sandbox/folio/test/naive.cc,
* sandbox/folio/test/psn.cc,
* sandbox/folio/test/psn_log.cc,
* sandbox/garrigues/fllt/compute_level_set_fast2.hh,
* sandbox/garrigues/fllt/types.hh,
* sandbox/garrigues/image_identity/interpolated.hh,
* sandbox/garrigues/tiled_image2d/tiled_image2d.hh,
* sandbox/garrigues/union_find/reconstructions_on_function.hh,
* sandbox/garrigues/union_find/reconstructions_on_set.hh,
* sandbox/garrigues/union_find/self_dual_reconstruction.hh,
* sandbox/geraud/Rd/min.cc,
* sandbox/geraud/Rd/utils.hh,
* sandbox/geraud/browsing/fwd.hh,
* sandbox/geraud/dead/instant.hh,
* sandbox/geraud/dmap.cc,
* sandbox/geraud/estimate.hh,
* sandbox/inim/binarization/binarization.hh,
* sandbox/jardonnet/registration/chamfer.hh,
* sandbox/jardonnet/subsampling/gaussian_subsampling.hh,
* sandbox/jardonnet/subsampling/sub_sampled_image.hh,
* sandbox/nivault/plugin-gimp/src/gimp-image.hh,
* sandbox/vigouroux/moyenne.cc,
* tests/core/image/graph_image.cc,
* tests/core/image/line_graph_image.cc,
* tests/core/other/graph_elt_neighborhood.cc,
* tests/core/other/graph_elt_window.cc,
* tests/core/other/line_graph_elt_neighborhood.cc,
* tests/core/other/line_graph_elt_window.cc,
* tests/fun/v2v/rgb_hsi_conversion.cc,
* tests/morpho/complex_image_morpho.cc,
* tests/morpho/graph_image_morpho.cc,
* tests/morpho/graph_image_wst.cc,
* tests/morpho/line_graph_image_morpho.cc,
* tests/morpho/line_graph_image_wst.cc,
* tools/area_flooding.cc,
* trash/display_color_pretty.hh,
* trash/display_save.hh,
* trash/fi_adaptor.hh,
* trash/graph_image.hh,
* trash/line_graph_image.hh,
* trash/neighb_get.hh,
* trash/neighb_image.hh,
* trash/translate_image.hh: rename in these files.
---
milena/ChangeLog | 81 ++++++++++++++++++++
milena/doc/tutorial/image_types.txt | 4 +-
milena/sandbox/abraham/mln/level/thru.hh | 2 +-
.../abraham/mln/morpho/autarkical_leveling.hh | 2 +-
milena/sandbox/abraham/mln/morpho/hit_or_miss.hh | 2 +-
milena/sandbox/abraham/mln/morpho/vector_median.hh | 2 +-
milena/sandbox/abraham/mln/morpho/vmt.hh | 2 +-
milena/sandbox/ballas/color/reference.cc | 4 +-
milena/sandbox/ballas/refactorization/rle_image.hh | 6 +-
milena/sandbox/duhamel/border_duplicate.cc | 2 +-
milena/sandbox/duhamel/border_duplicate.hh | 8 +-
milena/sandbox/duhamel/border_fill.cc | 2 +-
milena/sandbox/duhamel/border_fill.hh | 12 ++--
milena/sandbox/duhamel/border_mirror.hh | 2 +-
.../sandbox/duhamel/debug_print_3d_with_border.hh | 2 +-
milena/sandbox/duhamel/mesh_image.hh | 2 +-
milena/sandbox/duhamel/translate_image.hh | 4 +-
milena/sandbox/folio/chamfer.cc | 2 +-
milena/sandbox/folio/dt.hh | 2 +-
milena/sandbox/folio/dt/canvas_dt.hh | 2 +-
milena/sandbox/folio/dt/chamfer.hh | 2 +-
milena/sandbox/folio/dt/cp.hh | 2 +-
milena/sandbox/folio/dt/dmap.hh | 2 +-
milena/sandbox/folio/dt/path.hh | 2 +-
milena/sandbox/folio/dt/raw_cp_fast.hh | 2 +-
milena/sandbox/folio/dt/raw_cp_slow.hh | 2 +-
milena/sandbox/folio/dt/raw_dmap_fast.hh | 2 +-
milena/sandbox/folio/dt/raw_dmap_slow.hh | 2 +-
milena/sandbox/folio/dt/raw_path_fast.hh | 2 +-
milena/sandbox/folio/dt/raw_path_slow.hh | 2 +-
milena/sandbox/folio/naive.cc | 2 +-
milena/sandbox/folio/psn.cc | 2 +-
milena/sandbox/folio/psn_log.cc | 2 +-
milena/sandbox/folio/test/canvas/dt.hh | 2 +-
milena/sandbox/folio/test/naive.cc | 2 +-
milena/sandbox/folio/test/psn.cc | 2 +-
milena/sandbox/folio/test/psn_log.cc | 2 +-
.../garrigues/fllt/compute_level_set_fast2.hh | 6 +-
milena/sandbox/garrigues/fllt/types.hh | 2 +-
.../garrigues/image_identity/interpolated.hh | 8 +-
.../garrigues/tiled_image2d/tiled_image2d.hh | 8 +-
.../union_find/reconstructions_on_function.hh | 12 ++--
.../garrigues/union_find/reconstructions_on_set.hh | 16 ++--
.../union_find/self_dual_reconstruction.hh | 4 +-
milena/sandbox/geraud/Rd/min.cc | 2 +-
milena/sandbox/geraud/Rd/utils.hh | 2 +-
milena/sandbox/geraud/browsing/fwd.hh | 6 +-
milena/sandbox/geraud/dead/instant.hh | 8 +-
milena/sandbox/geraud/dmap.cc | 2 +-
milena/sandbox/geraud/estimate.hh | 2 +-
milena/sandbox/inim/binarization/binarization.hh | 2 +-
milena/sandbox/jardonnet/registration/chamfer.hh | 2 +-
.../jardonnet/subsampling/gaussian_subsampling.hh | 2 +-
.../jardonnet/subsampling/sub_sampled_image.hh | 10 +-
.../sandbox/nivault/plugin-gimp/src/gimp-image.hh | 16 ++--
milena/sandbox/vigouroux/moyenne.cc | 2 +-
milena/tests/core/image/graph_image.cc | 5 +-
milena/tests/core/image/line_graph_image.cc | 5 +-
milena/tests/core/other/graph_elt_neighborhood.cc | 3 +-
milena/tests/core/other/graph_elt_window.cc | 3 +-
.../core/other/line_graph_elt_neighborhood.cc | 3 +-
milena/tests/core/other/line_graph_elt_window.cc | 5 +-
milena/tests/fun/v2v/rgb_hsi_conversion.cc | 5 +-
milena/tests/morpho/complex_image_morpho.cc | 5 +-
milena/tests/morpho/graph_image_morpho.cc | 3 +-
milena/tests/morpho/graph_image_wst.cc | 3 +-
milena/tests/morpho/line_graph_image_morpho.cc | 3 +-
milena/tests/morpho/line_graph_image_wst.cc | 3 +-
milena/tools/area_flooding.cc | 2 +-
milena/trash/display_color_pretty.hh | 2 +-
milena/trash/display_save.hh | 2 +-
milena/trash/fi_adaptor.hh | 14 ++--
milena/trash/graph_image.hh | 4 +-
milena/trash/line_graph_image.hh | 4 +-
milena/trash/neighb_get.hh | 2 +-
milena/trash/neighb_image.hh | 8 +-
milena/trash/translate_image.hh | 4 +-
77 files changed, 229 insertions(+), 150 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 1ab3eff..dbb1dea 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,86 @@
2008-12-31 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Propagate renaming has_data as is_valid.
+
+ * doc/tutorial/image_types.txt,
+ * sandbox/abraham/mln/level/thru.hh,
+ * sandbox/abraham/mln/morpho/autarkical_leveling.hh,
+ * sandbox/abraham/mln/morpho/hit_or_miss.hh,
+ * sandbox/abraham/mln/morpho/vector_median.hh,
+ * sandbox/abraham/mln/morpho/vmt.hh,
+ * sandbox/ballas/color/reference.cc,
+ * sandbox/ballas/refactorization/rle_image.hh,
+ * sandbox/duhamel/border_duplicate.cc,
+ * sandbox/duhamel/border_duplicate.hh,
+ * sandbox/duhamel/border_fill.cc,
+ * sandbox/duhamel/border_fill.hh,
+ * sandbox/duhamel/border_mirror.hh,
+ * sandbox/duhamel/debug_print_3d_with_border.hh,
+ * sandbox/duhamel/mesh_image.hh,
+ * sandbox/duhamel/translate_image.hh,
+ * sandbox/folio/chamfer.cc,
+ * sandbox/folio/dt.hh,
+ * sandbox/folio/dt/canvas_dt.hh,
+ * sandbox/folio/dt/chamfer.hh,
+ * sandbox/folio/dt/cp.hh,
+ * sandbox/folio/dt/dmap.hh,
+ * sandbox/folio/dt/path.hh,
+ * sandbox/folio/dt/raw_cp_fast.hh,
+ * sandbox/folio/dt/raw_cp_slow.hh,
+ * sandbox/folio/dt/raw_dmap_fast.hh,
+ * sandbox/folio/dt/raw_dmap_slow.hh,
+ * sandbox/folio/dt/raw_path_fast.hh,
+ * sandbox/folio/dt/raw_path_slow.hh,
+ * sandbox/folio/naive.cc,
+ * sandbox/folio/psn.cc,
+ * sandbox/folio/psn_log.cc,
+ * sandbox/folio/test/canvas/dt.hh,
+ * sandbox/folio/test/naive.cc,
+ * sandbox/folio/test/psn.cc,
+ * sandbox/folio/test/psn_log.cc,
+ * sandbox/garrigues/fllt/compute_level_set_fast2.hh,
+ * sandbox/garrigues/fllt/types.hh,
+ * sandbox/garrigues/image_identity/interpolated.hh,
+ * sandbox/garrigues/tiled_image2d/tiled_image2d.hh,
+ * sandbox/garrigues/union_find/reconstructions_on_function.hh,
+ * sandbox/garrigues/union_find/reconstructions_on_set.hh,
+ * sandbox/garrigues/union_find/self_dual_reconstruction.hh,
+ * sandbox/geraud/Rd/min.cc,
+ * sandbox/geraud/Rd/utils.hh,
+ * sandbox/geraud/browsing/fwd.hh,
+ * sandbox/geraud/dead/instant.hh,
+ * sandbox/geraud/dmap.cc,
+ * sandbox/geraud/estimate.hh,
+ * sandbox/inim/binarization/binarization.hh,
+ * sandbox/jardonnet/registration/chamfer.hh,
+ * sandbox/jardonnet/subsampling/gaussian_subsampling.hh,
+ * sandbox/jardonnet/subsampling/sub_sampled_image.hh,
+ * sandbox/nivault/plugin-gimp/src/gimp-image.hh,
+ * sandbox/vigouroux/moyenne.cc,
+ * tests/core/image/graph_image.cc,
+ * tests/core/image/line_graph_image.cc,
+ * tests/core/other/graph_elt_neighborhood.cc,
+ * tests/core/other/graph_elt_window.cc,
+ * tests/core/other/line_graph_elt_neighborhood.cc,
+ * tests/core/other/line_graph_elt_window.cc,
+ * tests/fun/v2v/rgb_hsi_conversion.cc,
+ * tests/morpho/complex_image_morpho.cc,
+ * tests/morpho/graph_image_morpho.cc,
+ * tests/morpho/graph_image_wst.cc,
+ * tests/morpho/line_graph_image_morpho.cc,
+ * tests/morpho/line_graph_image_wst.cc,
+ * tools/area_flooding.cc,
+ * trash/display_color_pretty.hh,
+ * trash/display_save.hh,
+ * trash/fi_adaptor.hh,
+ * trash/graph_image.hh,
+ * trash/line_graph_image.hh,
+ * trash/neighb_get.hh,
+ * trash/neighb_image.hh,
+ * trash/translate_image.hh: rename in these files.
+
+2008-12-31 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Rename at() to at_().
* mln/core/image/image1d.hh,
diff --git a/milena/doc/tutorial/image_types.txt b/milena/doc/tutorial/image_types.txt
index 89ef349..1bb2bd9 100644
--- a/milena/doc/tutorial/image_types.txt
+++ b/milena/doc/tutorial/image_types.txt
@@ -406,10 +406,10 @@ used to define ::location.
*** about the image variable
-**** has_data
+**** is_valid
sig is:
-bool has_data() const
+bool is_valid() const
is "is_allocated" / "is_ready" a better name?
diff --git a/milena/sandbox/abraham/mln/level/thru.hh b/milena/sandbox/abraham/mln/level/thru.hh
index 22aa880..c5189c4 100644
--- a/milena/sandbox/abraham/mln/level/thru.hh
+++ b/milena/sandbox/abraham/mln/level/thru.hh
@@ -98,7 +98,7 @@ namespace mln
{
trace::entering("level::apply");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
impl::apply_(mln_trait_image_speed(I)(), exact(input),
exact(f));
diff --git a/milena/sandbox/abraham/mln/morpho/autarkical_leveling.hh b/milena/sandbox/abraham/mln/morpho/autarkical_leveling.hh
index 1a71b75..d4541ae 100644
--- a/milena/sandbox/abraham/mln/morpho/autarkical_leveling.hh
+++ b/milena/sandbox/abraham/mln/morpho/autarkical_leveling.hh
@@ -137,7 +137,7 @@ namespace mln
autarkical_leveling(const Image<I>& input, const Image<I>& marker, const Window<W>& win)
{
trace::entering("morpho::autarkical_leveling");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
mln_precondition(! exact(win).is_empty());
mln_concrete(I) output = impl::autarkical_leveling(input, marker, win);
diff --git a/milena/sandbox/abraham/mln/morpho/hit_or_miss.hh b/milena/sandbox/abraham/mln/morpho/hit_or_miss.hh
index 94f8f99..3c975cf 100644
--- a/milena/sandbox/abraham/mln/morpho/hit_or_miss.hh
+++ b/milena/sandbox/abraham/mln/morpho/hit_or_miss.hh
@@ -61,7 +61,7 @@ namespace mln
mln_concrete(I) hit_or_miss(const Image<I>& input, const Window<Wout>& win_out, const Window<Win>& win_in)
{
trace::entering("morpho::hit_or_miss");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
mln_precondition(! exact(win_out).is_empty());
mln_precondition(! exact(win_in).is_empty());
diff --git a/milena/sandbox/abraham/mln/morpho/vector_median.hh b/milena/sandbox/abraham/mln/morpho/vector_median.hh
index 05b2a4c..177bb3a 100644
--- a/milena/sandbox/abraham/mln/morpho/vector_median.hh
+++ b/milena/sandbox/abraham/mln/morpho/vector_median.hh
@@ -110,7 +110,7 @@ namespace mln
vector_median(const Image<I>& input, const Window<W>& win)
{
trace::entering("morpho::vector_median");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
mln_precondition(! exact(win).is_empty());
mln_concrete(I) output = impl::vector_median(input, win);
diff --git a/milena/sandbox/abraham/mln/morpho/vmt.hh b/milena/sandbox/abraham/mln/morpho/vmt.hh
index ab5321d..761912e 100644
--- a/milena/sandbox/abraham/mln/morpho/vmt.hh
+++ b/milena/sandbox/abraham/mln/morpho/vmt.hh
@@ -107,7 +107,7 @@ namespace mln
vmt(const Image<I>& input, const Window<W>& win)
{
trace::entering("morpho::vector_median");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
mln_precondition(! exact(win).is_empty());
mln_concrete(I) output = impl::vector_median(input, win);
diff --git a/milena/sandbox/ballas/color/reference.cc b/milena/sandbox/ballas/color/reference.cc
index c967789..411cd20 100644
--- a/milena/sandbox/ballas/color/reference.cc
+++ b/milena/sandbox/ballas/color/reference.cc
@@ -56,7 +56,7 @@ namespace mln
void
gaussian_2nd_derivative(const Image<I>& input, float sigma, Image<O>& output)
{
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
impl::recursivefilter_coef_
coef(-1.331f, 3.661f,
@@ -73,7 +73,7 @@ namespace mln
void
gaussian_1st_derivative(const Image<I>& input, float sigma, Image<O>& output)
{
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
impl::recursivefilter_coef_
coef(-0.6472f, -4.531f,
diff --git a/milena/sandbox/ballas/refactorization/rle_image.hh b/milena/sandbox/ballas/refactorization/rle_image.hh
index b0480c3..b34ee5c 100644
--- a/milena/sandbox/ballas/refactorization/rle_image.hh
+++ b/milena/sandbox/ballas/refactorization/rle_image.hh
@@ -33,7 +33,7 @@ namespace mln
void insert(const p_run<P>& pr, T value);
rvalue operator() (const rle_psite<P>& psite) const;
lvalue operator() (const rle_psite<P>& psite);
- bool has_data() const;
+ bool is_valid() const;
bool has(const rle_psite<P>& ps) const;
const pset& domain() const;
@@ -55,7 +55,7 @@ namespace mln
template <typename P, typename T>
inline
bool
- rle_image<P, T>::has_data() const
+ rle_image<P, T>::is_valid() const
{
return this->values_.size() != 0;
}
@@ -101,7 +101,7 @@ namespace mln
bool
rle_image<P, T>::has(const rle_psite<P>& ps) const
{
- if (!this->has_data())
+ if (!this->is_valid())
return false;
else
return (ps.p_of_run() < this->domain_.nruns() &&
diff --git a/milena/sandbox/duhamel/border_duplicate.cc b/milena/sandbox/duhamel/border_duplicate.cc
index 72815e9..4379aff 100644
--- a/milena/sandbox/duhamel/border_duplicate.cc
+++ b/milena/sandbox/duhamel/border_duplicate.cc
@@ -46,7 +46,7 @@ template <typename I>
void print_3d_with_border (const Fast_Image<I>& input_)
{
const I& ima = exact(input_);
- mln_precondition(ima.has_data());
+ mln_precondition(ima.is_valid());
typedef mln_point(I) P;
diff --git a/milena/sandbox/duhamel/border_duplicate.hh b/milena/sandbox/duhamel/border_duplicate.hh
index 2438590..a037c73 100644
--- a/milena/sandbox/duhamel/border_duplicate.hh
+++ b/milena/sandbox/duhamel/border_duplicate.hh
@@ -71,7 +71,7 @@ namespace mln
void duplicate_1d_(const Fast_Image<I>& ima_)
{
const I& ima = exact(ima_);
- mln_precondition(ima.has_data());
+ mln_precondition(ima.is_valid());
typedef mln_psite(I) P;
typename I::line_piter pl(ima.domain());
@@ -90,7 +90,7 @@ namespace mln
void duplicate_2d_(const Fast_Image<I>& ima_)
{
const I& ima = exact(ima_);
- mln_precondition(ima.has_data());
+ mln_precondition(ima.is_valid());
typedef mln_psite(I) P;
typename I::line_piter pl(ima.domain());
@@ -129,7 +129,7 @@ namespace mln
void duplicate_3d_(const Fast_Image<I>& ima_)
{
const I& ima = exact(ima_);
- mln_precondition(ima.has_data());
+ mln_precondition(ima.is_valid());
typedef mln_psite(I) P;
typename I::line_piter pl(ima.domain());
@@ -198,7 +198,7 @@ namespace mln
{
typedef mln_psite(I) P;
const I& ima = exact(ima_);
- mln_precondition(ima.has_data());
+ mln_precondition(ima.is_valid());
if (!ima.border ())
return;
diff --git a/milena/sandbox/duhamel/border_fill.cc b/milena/sandbox/duhamel/border_fill.cc
index 3fc2380..dad46c1 100644
--- a/milena/sandbox/duhamel/border_fill.cc
+++ b/milena/sandbox/duhamel/border_fill.cc
@@ -44,7 +44,7 @@ template <typename I>
void print_3d_with_border (const Fast_Image<I>& input_)
{
const I& ima = exact(input_);
- mln_precondition(ima.has_data());
+ mln_precondition(ima.is_valid());
typedef mln_point(I) P;
diff --git a/milena/sandbox/duhamel/border_fill.hh b/milena/sandbox/duhamel/border_fill.hh
index 1179483..44ca897 100644
--- a/milena/sandbox/duhamel/border_fill.hh
+++ b/milena/sandbox/duhamel/border_fill.hh
@@ -66,7 +66,7 @@ namespace mln
void fill_1d_size_1_(const Fast_Image<I>& ima_, const mln_value(I)& v)
{
const I& ima = exact(ima_);
- mln_precondition(ima.has_data());
+ mln_precondition(ima.is_valid());
typedef mln_psite(I) P;
std::size_t border = ima.border ();
@@ -85,7 +85,7 @@ namespace mln
void fill_1d_size_n_(const Fast_Image<I>& ima_, const mln_value(I)& v)
{
const I& ima = exact(ima_);
- mln_precondition(ima.has_data());
+ mln_precondition(ima.is_valid());
typedef mln_psite(I) P;
std::size_t border = ima.border ();
@@ -104,7 +104,7 @@ namespace mln
void fill_2d_size_1_(const Fast_Image<I>& ima_, const mln_value(I)& v)
{
const I& ima = exact(ima_);
- mln_precondition(ima.has_data());
+ mln_precondition(ima.is_valid());
typedef mln_psite(I) P;
@@ -137,7 +137,7 @@ namespace mln
void fill_2d_size_n_(const Fast_Image<I>& ima_, const mln_value(I)& v)
{
const I& ima = exact(ima_);
- mln_precondition(ima.has_data());
+ mln_precondition(ima.is_valid());
typedef mln_psite(I) P;
@@ -167,7 +167,7 @@ namespace mln
// void fill_3d_size_n_(const Fast_Image<I>& ima_, const mln_value(I)& v)
// {
// const I& ima = exact(ima_);
-// mln_precondition(ima.has_data());
+// mln_precondition(ima.is_valid());
// typedef mln_psite(I) P;
@@ -272,7 +272,7 @@ namespace mln
{
typedef mln_psite(I) P;
const I& ima = exact(ima_);
- mln_precondition(ima.has_data());
+ mln_precondition(ima.is_valid());
if (!ima.border ())
return;
diff --git a/milena/sandbox/duhamel/border_mirror.hh b/milena/sandbox/duhamel/border_mirror.hh
index ab12649..ad2e1ee 100644
--- a/milena/sandbox/duhamel/border_mirror.hh
+++ b/milena/sandbox/duhamel/border_mirror.hh
@@ -69,7 +69,7 @@ namespace mln
void mirror(const Fast_Image<I>& ima_)
{
const I& ima = exact(ima_);
- mln_precondition(ima.has_data());
+ mln_precondition(ima.is_valid());
// internal::fixme();
// FIX
std::size_t border = ima.border ();
diff --git a/milena/sandbox/duhamel/debug_print_3d_with_border.hh b/milena/sandbox/duhamel/debug_print_3d_with_border.hh
index 0be0f6c..8df962a 100644
--- a/milena/sandbox/duhamel/debug_print_3d_with_border.hh
+++ b/milena/sandbox/duhamel/debug_print_3d_with_border.hh
@@ -41,7 +41,7 @@ namespace mln
void print_3d_with_border (const Fast_Image<I>& input_)
{
const I& ima = exact(input_);
- mln_precondition(ima.has_data());
+ mln_precondition(ima.is_valid());
typedef mln_psite(I) P;
diff --git a/milena/sandbox/duhamel/mesh_image.hh b/milena/sandbox/duhamel/mesh_image.hh
index 087e5f7..3c740d8 100644
--- a/milena/sandbox/duhamel/mesh_image.hh
+++ b/milena/sandbox/duhamel/mesh_image.hh
@@ -178,7 +178,7 @@ namespace mln
const mesh_p<P>&
mesh_image<P, V>::domain() const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return this->data_->mesh_;
}
diff --git a/milena/sandbox/duhamel/translate_image.hh b/milena/sandbox/duhamel/translate_image.hh
index 7cdedf3..1fa4144 100644
--- a/milena/sandbox/duhamel/translate_image.hh
+++ b/milena/sandbox/duhamel/translate_image.hh
@@ -98,7 +98,7 @@ namespace mln
typedef translate_image< tag::image_<I> > skeleton;
/// Test if a pixel value is accessible at \p p.
- using super_::has_data;
+ using super_::is_valid;
/// Constructors.
translate_image(I& ima, const mln_dpsite(I) dp);
@@ -146,7 +146,7 @@ namespace mln
template <typename I>
translate_image<I>::translate_image(I& ima, const mln_dpsite(I) dp)
{
- mln_precondition(ima.has_data());
+ mln_precondition(ima.is_valid());
this->data_ = new internal::data_< translate_image<I> >(ima, dp);
}
diff --git a/milena/sandbox/folio/chamfer.cc b/milena/sandbox/folio/chamfer.cc
index 3ed603c..9390a66 100644
--- a/milena/sandbox/folio/chamfer.cc
+++ b/milena/sandbox/folio/chamfer.cc
@@ -115,7 +115,7 @@ namespace mln
typedef w_window<mln_dpoint(I), T> W;
const I& input = exact(input_);
- mln_precondition(input.has_data());
+ mln_precondition(input.is_valid());
mln_ch_value(I, T) outputDistance;
initialize(outputDistance, input);
diff --git a/milena/sandbox/folio/dt.hh b/milena/sandbox/folio/dt.hh
index b93accb..b69a8c1 100644
--- a/milena/sandbox/folio/dt.hh
+++ b/milena/sandbox/folio/dt.hh
@@ -82,7 +82,7 @@ namespace mln
dt(const Image<I>& input, const N& nbh, unsigned max)
{
trace::entering("dt::dt");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
mln_ch_value(I, L) output =
impl::dt_(mln_trait_image_speed(I)(),
diff --git a/milena/sandbox/folio/dt/canvas_dt.hh b/milena/sandbox/folio/dt/canvas_dt.hh
index dd5170b..aa225b0 100644
--- a/milena/sandbox/folio/dt/canvas_dt.hh
+++ b/milena/sandbox/folio/dt/canvas_dt.hh
@@ -90,7 +90,7 @@ namespace mln
dt<F>::init()
{
// Preconditions.
- mln_precondition(f.input.has_data());
+ mln_precondition(f.input.is_valid());
f.init(); //< f call.
diff --git a/milena/sandbox/folio/dt/chamfer.hh b/milena/sandbox/folio/dt/chamfer.hh
index e031f51..9719651 100644
--- a/milena/sandbox/folio/dt/chamfer.hh
+++ b/milena/sandbox/folio/dt/chamfer.hh
@@ -115,7 +115,7 @@ namespace mln
typedef w_window<mln_dpoint(I), T> W;
const I& input = exact(input_);
- mln_precondition(input.has_data());
+ mln_precondition(input.is_valid());
mln_ch_value(I, T) outputDistance;
initialize(outputDistance, input);
diff --git a/milena/sandbox/folio/dt/cp.hh b/milena/sandbox/folio/dt/cp.hh
index a17230b..2083bfa 100644
--- a/milena/sandbox/folio/dt/cp.hh
+++ b/milena/sandbox/folio/dt/cp.hh
@@ -102,7 +102,7 @@ namespace mln
cp(const Image<I>& input, const N& nbh, unsigned max)
{
trace::entering("dt::cp");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
typedef impl::cp_functor<I, N> F;
F f(exact(input), nbh, max);
diff --git a/milena/sandbox/folio/dt/dmap.hh b/milena/sandbox/folio/dt/dmap.hh
index b914834..fdfff7f 100644
--- a/milena/sandbox/folio/dt/dmap.hh
+++ b/milena/sandbox/folio/dt/dmap.hh
@@ -100,7 +100,7 @@ namespace mln
dmap(const Image<I>& input, const N& nbh, unsigned max)
{
trace::entering("dt::dmap");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
typedef impl::dmap_functor<I, N> F;
F f(exact(input), nbh, max);
diff --git a/milena/sandbox/folio/dt/path.hh b/milena/sandbox/folio/dt/path.hh
index 475d38a..f61d3f6 100644
--- a/milena/sandbox/folio/dt/path.hh
+++ b/milena/sandbox/folio/dt/path.hh
@@ -102,7 +102,7 @@ namespace mln
path(const Image<I>& input, const N& nbh, unsigned max)
{
trace::entering("dt::path");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
typedef impl::path_functor<I, N> F;
F f(exact(input), nbh, max);
diff --git a/milena/sandbox/folio/dt/raw_cp_fast.hh b/milena/sandbox/folio/dt/raw_cp_fast.hh
index 44e8e27..27b77ba 100644
--- a/milena/sandbox/folio/dt/raw_cp_fast.hh
+++ b/milena/sandbox/folio/dt/raw_cp_fast.hh
@@ -78,7 +78,7 @@ namespace mln
{
// Preconditions.
const I& input = exact(input_);
- mln_precondition(input.has_data());
+ mln_precondition(input.is_valid());
// Types.
typedef mln_point(I) point;
diff --git a/milena/sandbox/folio/dt/raw_cp_slow.hh b/milena/sandbox/folio/dt/raw_cp_slow.hh
index 18389d7..84eae57 100644
--- a/milena/sandbox/folio/dt/raw_cp_slow.hh
+++ b/milena/sandbox/folio/dt/raw_cp_slow.hh
@@ -77,7 +77,7 @@ namespace mln
{
// Preconditions.
const I& input = exact(input_);
- mln_precondition(input.has_data());
+ mln_precondition(input.is_valid());
// Types.
typedef mln_point(I) point;
diff --git a/milena/sandbox/folio/dt/raw_dmap_fast.hh b/milena/sandbox/folio/dt/raw_dmap_fast.hh
index bf80dab..712b82b 100644
--- a/milena/sandbox/folio/dt/raw_dmap_fast.hh
+++ b/milena/sandbox/folio/dt/raw_dmap_fast.hh
@@ -77,7 +77,7 @@ namespace mln
{
// Preconditions.
const I& input = exact(input_);
- mln_precondition(input.has_data());
+ mln_precondition(input.is_valid());
// Types.
typedef mln_point(I) point;
diff --git a/milena/sandbox/folio/dt/raw_dmap_slow.hh b/milena/sandbox/folio/dt/raw_dmap_slow.hh
index 838e816..22c9f94 100644
--- a/milena/sandbox/folio/dt/raw_dmap_slow.hh
+++ b/milena/sandbox/folio/dt/raw_dmap_slow.hh
@@ -77,7 +77,7 @@ namespace mln
{
// Preconditions.
const I& input = exact(input_);
- mln_precondition(input.has_data());
+ mln_precondition(input.is_valid());
// Types.
typedef mln_point(I) point;
diff --git a/milena/sandbox/folio/dt/raw_path_fast.hh b/milena/sandbox/folio/dt/raw_path_fast.hh
index 1d5f1d7..3a3f32b 100644
--- a/milena/sandbox/folio/dt/raw_path_fast.hh
+++ b/milena/sandbox/folio/dt/raw_path_fast.hh
@@ -78,7 +78,7 @@ namespace mln
{
// Preconditions.
const I& input = exact(input_);
- mln_precondition(input.has_data());
+ mln_precondition(input.is_valid());
// Types.
typedef mln_point(I) point;
diff --git a/milena/sandbox/folio/dt/raw_path_slow.hh b/milena/sandbox/folio/dt/raw_path_slow.hh
index f1d7472..40adf52 100644
--- a/milena/sandbox/folio/dt/raw_path_slow.hh
+++ b/milena/sandbox/folio/dt/raw_path_slow.hh
@@ -77,7 +77,7 @@ namespace mln
{
// Preconditions.
const I& input = exact(input_);
- mln_precondition(input.has_data());
+ mln_precondition(input.is_valid());
// Types.
typedef mln_point(I) point;
diff --git a/milena/sandbox/folio/naive.cc b/milena/sandbox/folio/naive.cc
index 348a89b..9b1aff8 100644
--- a/milena/sandbox/folio/naive.cc
+++ b/milena/sandbox/folio/naive.cc
@@ -72,7 +72,7 @@ namespace mln
{
const I& input = exact(input_);
const F& fun = exact(fun_);
- mln_precondition(input.has_data());
+ mln_precondition(input.is_valid());
mln_ch_value(I, mln_result(F)) output;
initialize(output, input);
diff --git a/milena/sandbox/folio/psn.cc b/milena/sandbox/folio/psn.cc
index a47627c..b9c9e7f 100644
--- a/milena/sandbox/folio/psn.cc
+++ b/milena/sandbox/folio/psn.cc
@@ -77,7 +77,7 @@ namespace mln
{
// Preconditions.
const I& input = exact(input_);
- mln_precondition(input.has_data());
+ mln_precondition(input.is_valid());
// Types.
typedef mln_point(I) point;
diff --git a/milena/sandbox/folio/psn_log.cc b/milena/sandbox/folio/psn_log.cc
index 2c6c3e3..5f0816c 100644
--- a/milena/sandbox/folio/psn_log.cc
+++ b/milena/sandbox/folio/psn_log.cc
@@ -148,7 +148,7 @@ namespace mln
psn(const Image<I>& input_, const N& nbh)
{
const I& input = exact(input_);
- mln_precondition(input.has_data());
+ mln_precondition(input.is_valid());
mln_ch_value(I, unsigned) D;
initialize(D, input);
diff --git a/milena/sandbox/folio/test/canvas/dt.hh b/milena/sandbox/folio/test/canvas/dt.hh
index 06b186c..4557ca6 100644
--- a/milena/sandbox/folio/test/canvas/dt.hh
+++ b/milena/sandbox/folio/test/canvas/dt.hh
@@ -82,7 +82,7 @@ namespace mln
dt(const Image<I>& input, const N& nbh, const unsigned max)
{
trace::entering("dt::dt");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
mln_ch_value(I, L) output =
impl::dt_(mln_trait_image_speed(I)(),
diff --git a/milena/sandbox/folio/test/naive.cc b/milena/sandbox/folio/test/naive.cc
index 348a89b..9b1aff8 100644
--- a/milena/sandbox/folio/test/naive.cc
+++ b/milena/sandbox/folio/test/naive.cc
@@ -72,7 +72,7 @@ namespace mln
{
const I& input = exact(input_);
const F& fun = exact(fun_);
- mln_precondition(input.has_data());
+ mln_precondition(input.is_valid());
mln_ch_value(I, mln_result(F)) output;
initialize(output, input);
diff --git a/milena/sandbox/folio/test/psn.cc b/milena/sandbox/folio/test/psn.cc
index a47627c..b9c9e7f 100644
--- a/milena/sandbox/folio/test/psn.cc
+++ b/milena/sandbox/folio/test/psn.cc
@@ -77,7 +77,7 @@ namespace mln
{
// Preconditions.
const I& input = exact(input_);
- mln_precondition(input.has_data());
+ mln_precondition(input.is_valid());
// Types.
typedef mln_point(I) point;
diff --git a/milena/sandbox/folio/test/psn_log.cc b/milena/sandbox/folio/test/psn_log.cc
index 2c6c3e3..5f0816c 100644
--- a/milena/sandbox/folio/test/psn_log.cc
+++ b/milena/sandbox/folio/test/psn_log.cc
@@ -148,7 +148,7 @@ namespace mln
psn(const Image<I>& input_, const N& nbh)
{
const I& input = exact(input_);
- mln_precondition(input.has_data());
+ mln_precondition(input.is_valid());
mln_ch_value(I, unsigned) D;
initialize(D, input);
diff --git a/milena/sandbox/garrigues/fllt/compute_level_set_fast2.hh b/milena/sandbox/garrigues/fllt/compute_level_set_fast2.hh
index 037e5cb..0118c8b 100644
--- a/milena/sandbox/garrigues/fllt/compute_level_set_fast2.hh
+++ b/milena/sandbox/garrigues/fllt/compute_level_set_fast2.hh
@@ -105,12 +105,12 @@ namespace mln
// p_image2d_fwd_pixter<point2d> qa(A);
image_sub_if_value ima(r_a_n.image() | SET_A);
- mln_assertion(ima.has_data());
+ mln_assertion(ima.is_valid());
image_sub_if_value::fwd_piter qa(ima.domain());
- mln_assertion(ima.has_data());
+ mln_assertion(ima.is_valid());
for_all(qa)
{
- mln_assertion(ima.has_data());
+ mln_assertion(ima.is_valid());
mln_niter(neighb2d) n(F::reg_nbh(), qa);
for_all (n)
if (u.has(n) && !r_a_n.belongs_to<SET_R>(n) &&
diff --git a/milena/sandbox/garrigues/fllt/types.hh b/milena/sandbox/garrigues/fllt/types.hh
index 8828668..7afbd16 100644
--- a/milena/sandbox/garrigues/fllt/types.hh
+++ b/milena/sandbox/garrigues/fllt/types.hh
@@ -196,7 +196,7 @@ namespace mln
ran_domains::image()
{
mln_precondition(nsites_ > 0);
- mln_assertion(ima_.has_data());
+ mln_assertion(ima_.is_valid());
return ima_ | bb_.to_result();
}
diff --git a/milena/sandbox/garrigues/image_identity/interpolated.hh b/milena/sandbox/garrigues/image_identity/interpolated.hh
index 9450bdb..14409ea 100644
--- a/milena/sandbox/garrigues/image_identity/interpolated.hh
+++ b/milena/sandbox/garrigues/image_identity/interpolated.hh
@@ -93,7 +93,7 @@ namespace mln
/// Test if this image has been initialized.
- bool has_data() const;
+ bool is_valid() const;
/// Test if a pixel value is accessible at \p p.
using super_::has;
@@ -132,7 +132,7 @@ namespace mln
template <typename I>
interpolated<I>::interpolated(I& ima)
{
- mln_precondition(ima.has_data());
+ mln_precondition(ima.is_valid());
this->data_ = new internal::data_< interpolated<I> >(ima);
}
@@ -142,9 +142,9 @@ namespace mln
}
template <typename I>
- bool interpolated<I>::has_data() const
+ bool interpolated<I>::is_valid() const
{
- mln_invariant(this->data_->ima_.has_data());
+ mln_invariant(this->data_->ima_.is_valid());
return true;
}
diff --git a/milena/sandbox/garrigues/tiled_image2d/tiled_image2d.hh b/milena/sandbox/garrigues/tiled_image2d/tiled_image2d.hh
index 40d83dc..cbc44cc 100644
--- a/milena/sandbox/garrigues/tiled_image2d/tiled_image2d.hh
+++ b/milena/sandbox/garrigues/tiled_image2d/tiled_image2d.hh
@@ -300,7 +300,7 @@ namespace mln
void
tiled_image2d<T>::init_(const box2d& b)
{
- mln_precondition(! this->has_data());
+ mln_precondition(! this->is_valid());
this->data_ = new internal::data_< tiled_image2d<T> >(b);
}
@@ -317,7 +317,7 @@ namespace mln
const box2d&
tiled_image2d<T>::domain() const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return this->data_->b_;
}
@@ -326,7 +326,7 @@ namespace mln
std::size_t
tiled_image2d<T>::nelements() const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return this->data_->b_.nsites();
}
@@ -335,7 +335,7 @@ namespace mln
bool
tiled_image2d<T>::has(const point2d& p) const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return this->data_->b_.has(p);
}
diff --git a/milena/sandbox/garrigues/union_find/reconstructions_on_function.hh b/milena/sandbox/garrigues/union_find/reconstructions_on_function.hh
index a0f1faa..c42a7f6 100644
--- a/milena/sandbox/garrigues/union_find/reconstructions_on_function.hh
+++ b/milena/sandbox/garrigues/union_find/reconstructions_on_function.hh
@@ -132,8 +132,8 @@ namespace mln
const J& mask = exact(mask_);
const N& nbh = exact(nbh_);
- mln_precondition(marker.has_data());
- mln_precondition(mask.has_data());
+ mln_precondition(marker.is_valid());
+ mln_precondition(mask.is_valid());
mln_precondition(mask.domain() == marker.domain());
mln_precondition(marker <= mask);
@@ -164,8 +164,8 @@ namespace mln
const J& mask = exact(mask_);
const N& nbh = exact(nbh_);
- mln_precondition(marker.has_data());
- mln_precondition(mask.has_data());
+ mln_precondition(marker.is_valid());
+ mln_precondition(mask.is_valid());
mln_precondition(mask.domain() == marker.domain());
mln_precondition(marker >= mask);
@@ -197,8 +197,8 @@ namespace mln
const J& mask = exact(mask_);
const N& nbh = exact(nbh_);
- mln_precondition(marker.has_data());
- mln_precondition(mask.has_data());
+ mln_precondition(marker.is_valid());
+ mln_precondition(mask.is_valid());
mln_precondition(mask.domain() == marker.domain());
mln_precondition(marker <= mask);
diff --git a/milena/sandbox/garrigues/union_find/reconstructions_on_set.hh b/milena/sandbox/garrigues/union_find/reconstructions_on_set.hh
index cbe16e3..b71e84e 100644
--- a/milena/sandbox/garrigues/union_find/reconstructions_on_set.hh
+++ b/milena/sandbox/garrigues/union_find/reconstructions_on_set.hh
@@ -135,8 +135,8 @@ namespace mln
{
trace::entering("morpho::reconstruction_on_set_by_dilation");
- mln_precondition(exact(marker).has_data());
- mln_precondition(exact(mask).has_data());
+ mln_precondition(exact(marker).is_valid());
+ mln_precondition(exact(mask).is_valid());
mln_precondition(exact(marker) <= exact(mask));
image2d<bool> output;
initialize(output, marker);
@@ -157,8 +157,8 @@ namespace mln
{
trace::entering("morpho::reconstruction_on_set_by_dilation_alt");
- mln_precondition(exact(marker).has_data());
- mln_precondition(exact(mask).has_data());
+ mln_precondition(exact(marker).is_valid());
+ mln_precondition(exact(mask).is_valid());
mln_precondition(exact(marker) <= exact(mask));
image2d<bool> output;
@@ -180,8 +180,8 @@ namespace mln
{
trace::entering("morpho::reconstruction_on_set_by_erosion");
- mln_precondition(exact(marker).has_data());
- mln_precondition(exact(mask).has_data());
+ mln_precondition(exact(marker).is_valid());
+ mln_precondition(exact(mask).is_valid());
mln_precondition(exact(marker) <= exact(mask));
image2d<bool> output;
@@ -203,8 +203,8 @@ namespace mln
{
trace::entering("morpho::reconstruction_on_set_by_erosion_alt");
- mln_precondition(exact(marker).has_data());
- mln_precondition(exact(mask).has_data());
+ mln_precondition(exact(marker).is_valid());
+ mln_precondition(exact(mask).is_valid());
mln_precondition(exact(marker) <= exact(mask));
image2d<bool> output;
diff --git a/milena/sandbox/garrigues/union_find/self_dual_reconstruction.hh b/milena/sandbox/garrigues/union_find/self_dual_reconstruction.hh
index 16bc6a8..fa6ac1b 100644
--- a/milena/sandbox/garrigues/union_find/self_dual_reconstruction.hh
+++ b/milena/sandbox/garrigues/union_find/self_dual_reconstruction.hh
@@ -133,8 +133,8 @@ namespace mln
const J& mask = exact(mask_);
const N& nbh = exact(nbh_);
- mln_precondition(marker.has_data());
- mln_precondition(mask.has_data());
+ mln_precondition(marker.is_valid());
+ mln_precondition(mask.is_valid());
mln_precondition(mask.domain() == marker.domain());
mln_concrete(I) output;
diff --git a/milena/sandbox/geraud/Rd/min.cc b/milena/sandbox/geraud/Rd/min.cc
index 61e2ac1..99b8532 100644
--- a/milena/sandbox/geraud/Rd/min.cc
+++ b/milena/sandbox/geraud/Rd/min.cc
@@ -15,7 +15,7 @@ void usage(char* argv[])
template <typename I>
I min(const I& ima1, const I& ima2)
{
- mln_precondition(ima1.has_data() and ima2.has_data());
+ mln_precondition(ima1.is_valid() and ima2.is_valid());
mln_precondition(ima1.domain() == ima2.domain());
I out(ima1.domain());
mln_piter(I) p(ima1.domain());
diff --git a/milena/sandbox/geraud/Rd/utils.hh b/milena/sandbox/geraud/Rd/utils.hh
index f9c0150..656aec3 100644
--- a/milena/sandbox/geraud/Rd/utils.hh
+++ b/milena/sandbox/geraud/Rd/utils.hh
@@ -61,7 +61,7 @@ namespace mln
template <typename I>
I minimun(const I& ima1, const I& ima2)
{
- mln_precondition(ima1.has_data() && ima2.has_data());
+ mln_precondition(ima1.is_valid() && ima2.is_valid());
mln_precondition(ima1.domain() == ima2.domain());
I out(ima1.domain());
mln_piter(I) p(ima1.domain());
diff --git a/milena/sandbox/geraud/browsing/fwd.hh b/milena/sandbox/geraud/browsing/fwd.hh
index 1f92953..5ed936d 100644
--- a/milena/sandbox/geraud/browsing/fwd.hh
+++ b/milena/sandbox/geraud/browsing/fwd.hh
@@ -13,7 +13,7 @@ namespace mln
void fwd(F& f)
{
trace::entering("canvas::browsing::fwd");
- mln_precondition(f.input.has_data());
+ mln_precondition(f.input.is_valid());
typedef typename F::I I;
mln_fwd_piter(I) p(f.input.domain());
f.init();
@@ -31,7 +31,7 @@ namespace mln
void row_fwd(F& f)
{
trace::entering("canvas::browsing::row_fwd");
- mln_precondition(f.input.has_data());
+ mln_precondition(f.input.is_valid());
box2d b = f.input.domain();
unsigned nrows = b.nrows(), ncols = b.ncols();
def::coord& row = f.p.row();
@@ -58,7 +58,7 @@ namespace mln
void col_fwd(F& f)
{
trace::entering("canvas::browsing::col_fwd");
- mln_precondition(f.input.has_data());
+ mln_precondition(f.input.is_valid());
box2d b = f.input.domain();
unsigned nrows = b.nrows(), ncols = b.ncols();
def::coord& row = f.p.row();
diff --git a/milena/sandbox/geraud/dead/instant.hh b/milena/sandbox/geraud/dead/instant.hh
index 439cb46..5a8892a 100644
--- a/milena/sandbox/geraud/dead/instant.hh
+++ b/milena/sandbox/geraud/dead/instant.hh
@@ -128,7 +128,7 @@ namespace mln
inline
instant_<I>::instant_(I& ima)
{
- mln_precondition(ima.has_data());
+ mln_precondition(ima.is_valid());
this->init_(ima);
this->data_ = new internal::data< instant_<I> >(ima);
}
@@ -138,7 +138,7 @@ namespace mln
void
instant_<I>::init_(I& ima)
{
- mln_precondition(ima.has_data());
+ mln_precondition(ima.is_valid());
this->data_ = new internal::data< instant_<I> >(ima);
}
@@ -147,7 +147,7 @@ namespace mln
I&
instant_<I>::un_instant_()
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return this->data_->ima_;
}
@@ -156,7 +156,7 @@ namespace mln
I&
instant_<I>::un_instant_() const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return const_cast<I&>(this->data_->ima_);
}
diff --git a/milena/sandbox/geraud/dmap.cc b/milena/sandbox/geraud/dmap.cc
index 32c3f7e..02b992a 100644
--- a/milena/sandbox/geraud/dmap.cc
+++ b/milena/sandbox/geraud/dmap.cc
@@ -20,7 +20,7 @@ namespace mln
{
const I& input = exact(input_);
const W& win = exact(win_);
- mln_precondition(input.has_data());
+ mln_precondition(input.is_valid());
typedef std::vector<mln_site(I)> bucket_t;
diff --git a/milena/sandbox/geraud/estimate.hh b/milena/sandbox/geraud/estimate.hh
index 44117b5..a394a28 100644
--- a/milena/sandbox/geraud/estimate.hh
+++ b/milena/sandbox/geraud/estimate.hh
@@ -70,7 +70,7 @@ namespace mln
{
trace::entering("labeling::estimate");
mlc_equal(mln_trait_image_kind(I), mln::trait::image::kind::binary)::check();
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
std::cerr << "Sorry: mln::labeling::estimate is not yet implemented!" << std::endl;
diff --git a/milena/sandbox/inim/binarization/binarization.hh b/milena/sandbox/inim/binarization/binarization.hh
index c9015f3..26c1327 100644
--- a/milena/sandbox/inim/binarization/binarization.hh
+++ b/milena/sandbox/inim/binarization/binarization.hh
@@ -62,7 +62,7 @@ namespace mln
binarization(const Image<I>& input, const Window<W>& win, int strength)
{
trace::entering("binarisation");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
mln_concrete_ch_value(I, bool) output(exact(input).domain());
output = impl::binarization_(exact(input), exact(win), strength);
diff --git a/milena/sandbox/jardonnet/registration/chamfer.hh b/milena/sandbox/jardonnet/registration/chamfer.hh
index 1d99041..d4de5de 100644
--- a/milena/sandbox/jardonnet/registration/chamfer.hh
+++ b/milena/sandbox/jardonnet/registration/chamfer.hh
@@ -115,7 +115,7 @@ namespace mln
typedef w_window<mln_dpsite(I), T> W;
const I& input = exact(input_);
- mln_precondition(input.has_data());
+ mln_precondition(input.is_valid());
mln_ch_value(I, T) outputDistance;
initialize(outputDistance, input);
diff --git a/milena/sandbox/jardonnet/subsampling/gaussian_subsampling.hh b/milena/sandbox/jardonnet/subsampling/gaussian_subsampling.hh
index 583a597..08ef2af 100644
--- a/milena/sandbox/jardonnet/subsampling/gaussian_subsampling.hh
+++ b/milena/sandbox/jardonnet/subsampling/gaussian_subsampling.hh
@@ -70,7 +70,7 @@ namespace mln
const mln_coord(I)& gap)
{
trace::entering("subsampling::gaussian_subsampling");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
mln_concrete(I) temp(exact(input).domain());
mln_concrete(I) output(geom::nrows(input) / gap,
diff --git a/milena/sandbox/jardonnet/subsampling/sub_sampled_image.hh b/milena/sandbox/jardonnet/subsampling/sub_sampled_image.hh
index 669d549..91153ed 100644
--- a/milena/sandbox/jardonnet/subsampling/sub_sampled_image.hh
+++ b/milena/sandbox/jardonnet/subsampling/sub_sampled_image.hh
@@ -98,7 +98,7 @@ namespace mln
const box_<mln_psite(I)>& domain() const;
/// Test if this image has been initialized.
- bool has_data() const;
+ bool is_valid() const;
/// Test if a pixel value is accessible at \p p.
bool has(const mln_psite(I)& p) const;
@@ -157,7 +157,7 @@ namespace mln
const box_<mln_psite(I)>&
sub_sampled_image<I>::domain() const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return this->data_->box_;
}
@@ -174,9 +174,9 @@ namespace mln
template <typename I>
inline
- bool sub_sampled_image<I>::has_data() const
+ bool sub_sampled_image<I>::is_valid() const
{
- mln_invariant(this->delegatee_()->has_data());
+ mln_invariant(this->delegatee_()->is_valid());
return true;
}
@@ -186,7 +186,7 @@ namespace mln
bool
sub_sampled_image<I>::has(const mln_psite(I)& p) const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return this->delegatee_()->has(translate_coords_(p));
}
diff --git a/milena/sandbox/nivault/plugin-gimp/src/gimp-image.hh b/milena/sandbox/nivault/plugin-gimp/src/gimp-image.hh
index 2404d4e..2f75a56 100644
--- a/milena/sandbox/nivault/plugin-gimp/src/gimp-image.hh
+++ b/milena/sandbox/nivault/plugin-gimp/src/gimp-image.hh
@@ -351,7 +351,7 @@ namespace mln
void
gimp_image<t>::init_(GimpPixelRgn* rgn)
{
- mln_precondition(! this->has_data());
+ mln_precondition(! this->is_valid());
this->data_ = new internal::data_< gimp_image<t> >(rgn);
}
@@ -359,7 +359,7 @@ namespace mln
void
gimp_image<t>::init_(box2d box)
{
- mln_precondition(! this->has_data());
+ mln_precondition(! this->is_valid());
this->data_ = new internal::data_< gimp_image<t> >(box);
}
@@ -375,7 +375,7 @@ namespace mln
const box2d&
gimp_image<t>::domain() const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return this->data_->b_;
}
@@ -392,7 +392,7 @@ namespace mln
std::size_t
gimp_image<t>::nelements() const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return this->data_->b_.nsites();
}
@@ -401,7 +401,7 @@ namespace mln
bool
gimp_image<t>::has(const point2d& p) const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return this->data_->b_.has(p);
}
@@ -474,7 +474,7 @@ namespace mln
const mln_value(gimp_image<t>)*
gimp_image<t>::buffer() const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return this->data_->buffer_;
}
@@ -483,7 +483,7 @@ namespace mln
mln_value(gimp_image<t>)*
gimp_image<t>::buffer()
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return this->data_->buffer_;
}
@@ -492,7 +492,7 @@ namespace mln
// int
// gimp_image<t>::delta_index(const dpoint2d& dp) const
// {
-// mln_precondition(this->has_data());
+// mln_precondition(this->is_valid());
// int o = dp[0] * this->data_->b_.len(1) + dp[1];
// return o;
// }
diff --git a/milena/sandbox/vigouroux/moyenne.cc b/milena/sandbox/vigouroux/moyenne.cc
index 5e50ec5..f2a5f37 100644
--- a/milena/sandbox/vigouroux/moyenne.cc
+++ b/milena/sandbox/vigouroux/moyenne.cc
@@ -19,7 +19,7 @@ float rms(const mln::Image<I1>& ima1_, const mln::Image<I2>& ima2_)
const I1& ima1 = exact(ima1_);
const I2& ima2 = exact(ima2_);
- mln_precondition(ima1.has_data() && ima2.has_data());
+ mln_precondition(ima1.is_valid() && ima2.is_valid());
double sum = 0, nb = 0;
diff --git a/milena/tests/core/image/graph_image.cc b/milena/tests/core/image/graph_image.cc
index 2e88446..f12d8f9 100644
--- a/milena/tests/core/image/graph_image.cc
+++ b/milena/tests/core/image/graph_image.cc
@@ -94,9 +94,10 @@ int main()
// Edges.
util::graph g;
+
// Populate the graph with vertices.
- for (unsigned i = 0; i < sites.size(); ++i)
- g.add_vertex();
+ g.add_vertices(sites.size());
+
// Populate the graph with edges.
g.add_edge(0, 1);
g.add_edge(1, 2);
diff --git a/milena/tests/core/image/line_graph_image.cc b/milena/tests/core/image/line_graph_image.cc
index 981a09a..d565a9f 100644
--- a/milena/tests/core/image/line_graph_image.cc
+++ b/milena/tests/core/image/line_graph_image.cc
@@ -87,9 +87,10 @@ int main()
sites(4) = point2d(4,4); // Point associated to edge 4.
util::graph g;
+
// Populate the graph with vertices.
- for(unsigned i = 0; i < sites.size(); ++i)
- g.add_vertex();
+ g.add_vertices(sites.size());
+
// Populate the graph with edges.
g.add_edge(0, 1);
g.add_edge(1, 2);
diff --git a/milena/tests/core/other/graph_elt_neighborhood.cc b/milena/tests/core/other/graph_elt_neighborhood.cc
index 4de2216..797b826 100644
--- a/milena/tests/core/other/graph_elt_neighborhood.cc
+++ b/milena/tests/core/other/graph_elt_neighborhood.cc
@@ -80,8 +80,7 @@ int main()
G g;
// Populate the graph with vertices.
- for (unsigned i = 0; i < points.size(); ++i)
- g.add_vertex ();
+ g.add_vertices(points.size());
// Populate the graph with edges.
g.add_edge(0, 1);
diff --git a/milena/tests/core/other/graph_elt_window.cc b/milena/tests/core/other/graph_elt_window.cc
index 46da228..62a43e3 100644
--- a/milena/tests/core/other/graph_elt_window.cc
+++ b/milena/tests/core/other/graph_elt_window.cc
@@ -80,8 +80,7 @@ int main()
G g;
// Populate the graph with vertices.
- for (unsigned i = 0; i < points.size(); ++i)
- g.add_vertex ();
+ g.add_vertices(points.size());
// Populate the graph with edges.
g.add_edge(0, 1);
diff --git a/milena/tests/core/other/line_graph_elt_neighborhood.cc b/milena/tests/core/other/line_graph_elt_neighborhood.cc
index 2564c7d..197091e 100644
--- a/milena/tests/core/other/line_graph_elt_neighborhood.cc
+++ b/milena/tests/core/other/line_graph_elt_neighborhood.cc
@@ -79,8 +79,7 @@ int main()
G g;
// Populate the graph with vertices.
- for (unsigned i = 0; i < points.size(); ++i)
- g.add_vertex ();
+ g.add_vertices(points.size());
// Populate the graph with edges.
g.add_edge(0, 1);
diff --git a/milena/tests/core/other/line_graph_elt_window.cc b/milena/tests/core/other/line_graph_elt_window.cc
index 4792d67..6d6934e 100644
--- a/milena/tests/core/other/line_graph_elt_window.cc
+++ b/milena/tests/core/other/line_graph_elt_window.cc
@@ -77,9 +77,10 @@ int main()
// Edges.
typedef mln::util::graph G;
G g;
+
// Populate the graph with vertices.
- for (unsigned i = 0; i < points.size(); ++i)
- g.add_vertex ();
+ g.add_vertices(points.size());
+
// Populate the graph with edges.
g.add_edge(0, 1);
g.add_edge(1, 2);
diff --git a/milena/tests/fun/v2v/rgb_hsi_conversion.cc b/milena/tests/fun/v2v/rgb_hsi_conversion.cc
index da7d8c3..f760fa1 100644
--- a/milena/tests/fun/v2v/rgb_hsi_conversion.cc
+++ b/milena/tests/fun/v2v/rgb_hsi_conversion.cc
@@ -26,7 +26,8 @@
// Public License.
/// \file tests/fun/v2v/rgb_hsi_conversion.cc
-/// \brief Test RGB-to-HSI conversion.
+///
+/// Test RGB-to-HSI conversion.
#include <cmath>
@@ -50,7 +51,7 @@ float rms(const mln::Image<I1>& ima1_, const mln::Image<I2>& ima2_)
const I1& ima1 = exact(ima1_);
const I2& ima2 = exact(ima2_);
- mln_precondition(ima1.has_data() && ima2.has_data());
+ mln_precondition(ima1.is_valid() && ima2.is_valid());
double sum = 0, nb = 0;
diff --git a/milena/tests/morpho/complex_image_morpho.cc b/milena/tests/morpho/complex_image_morpho.cc
index 80b80f5..e3bffe6 100644
--- a/milena/tests/morpho/complex_image_morpho.cc
+++ b/milena/tests/morpho/complex_image_morpho.cc
@@ -26,7 +26,8 @@
// Public License.
/// \file tests/morpho/complex_image_morpho.cc
-/// \brief Test of mln::complex_image with morphological filters.
+///
+/// Test of mln::complex_image with morphological filters.
#include <iostream>
@@ -178,7 +179,7 @@ test_morpho(const mln::Image<I>& ima_, const mln::Window<W> win,
const std::string& comment)
{
const I& ima = exact(ima_);
- mln_assertion(ima.has_data());
+ mln_assertion(ima.is_valid());
mln_piter(I) p(ima.domain());
mln_concrete(I) ima_dil = mln::morpho::dilation(ima, win);
diff --git a/milena/tests/morpho/graph_image_morpho.cc b/milena/tests/morpho/graph_image_morpho.cc
index 8552061..04c18ad 100644
--- a/milena/tests/morpho/graph_image_morpho.cc
+++ b/milena/tests/morpho/graph_image_morpho.cc
@@ -83,8 +83,7 @@ int main()
util::graph g;
// Populate the graph with vertices.
- for (unsigned i = 0; i < sites.size(); ++i)
- g.add_vertex();
+ g.add_vertices(sites.size());
// Populate the graph with edges.
g.add_edge(0, 1);
diff --git a/milena/tests/morpho/graph_image_wst.cc b/milena/tests/morpho/graph_image_wst.cc
index 53f78cd..2893903 100644
--- a/milena/tests/morpho/graph_image_wst.cc
+++ b/milena/tests/morpho/graph_image_wst.cc
@@ -78,8 +78,7 @@ int main()
util::graph g;
// Populate the graph with vertices.
- for (unsigned i = 0; i < sites.size(); ++i)
- g.add_vertex();
+ g.add_vertices(sites.size());
// Populate the graph with edges.
g.add_edge(0, 1);
diff --git a/milena/tests/morpho/line_graph_image_morpho.cc b/milena/tests/morpho/line_graph_image_morpho.cc
index ce32528..2b32421 100644
--- a/milena/tests/morpho/line_graph_image_morpho.cc
+++ b/milena/tests/morpho/line_graph_image_morpho.cc
@@ -77,8 +77,7 @@ int main()
sites(4) = point2d(4,4); // Point associated to vertex 4.
// Populate the graph with vertices.
- for (unsigned i = 0; i < sites.size(); ++i)
- g.add_vertex();
+ g.add_vertices(sites.size());
// Populate the graph with edges.
g.add_edge(0, 1);
diff --git a/milena/tests/morpho/line_graph_image_wst.cc b/milena/tests/morpho/line_graph_image_wst.cc
index a700d16..e9f5871 100644
--- a/milena/tests/morpho/line_graph_image_wst.cc
+++ b/milena/tests/morpho/line_graph_image_wst.cc
@@ -81,8 +81,7 @@ int main()
sites(7) = point2d(1,3); // Point associated to vertex 7.
// Populate the graph with vertices.
- for(unsigned i = 0; i < sites.size(); ++i)
- g.add_vertex();
+ g.add_vertices(sites.size());
// Populate the graph with edges.
g.add_edge(0, 1);
diff --git a/milena/tools/area_flooding.cc b/milena/tools/area_flooding.cc
index 10abdb7..da7c378 100644
--- a/milena/tools/area_flooding.cc
+++ b/milena/tools/area_flooding.cc
@@ -92,7 +92,7 @@ int main(int argc, char* argv[])
orig_ima_t input;
io::pgm::load(input, argv[2]);
- if (!input.has_data())
+ if (!input.is_valid())
{
std::cerr << "Error reading input " << argv[2] << std::endl;
std::exit(2);
diff --git a/milena/trash/display_color_pretty.hh b/milena/trash/display_color_pretty.hh
index 9574fe4..31239b8 100644
--- a/milena/trash/display_color_pretty.hh
+++ b/milena/trash/display_color_pretty.hh
@@ -191,7 +191,7 @@ namespace mln
trace::entering("display::color_pretty");
const I& input = exact(input_);
- mln_precondition(input.has_data());
+ mln_precondition(input.is_valid());
mlc_is_not(mln_trait_value_kind(mln_value(I)) (),
trait::value::kind::color)::check();
diff --git a/milena/trash/display_save.hh b/milena/trash/display_save.hh
index addd6b7..956276d 100644
--- a/milena/trash/display_save.hh
+++ b/milena/trash/display_save.hh
@@ -124,7 +124,7 @@ namespace mln
trace::entering("display::save");
const I& input = exact(input_);
- mln_precondition(input.has_data());
+ mln_precondition(input.is_valid());
impl::save(mln_trait_value_kind(mln_value(I)) (), input);
trace::exiting("display::save");
diff --git a/milena/trash/fi_adaptor.hh b/milena/trash/fi_adaptor.hh
index 3d24b12..33fdaa9 100644
--- a/milena/trash/fi_adaptor.hh
+++ b/milena/trash/fi_adaptor.hh
@@ -302,7 +302,7 @@ namespace mln
const box2d&
fi_adaptor<I>::domain() const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return this->data_->b_;
}
@@ -310,7 +310,7 @@ namespace mln
unsigned
fi_adaptor<I>::nelements() const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return this->data_->b_.nsites();
}
@@ -374,7 +374,7 @@ namespace mln
const mln_value(I)*
fi_adaptor<I>::buffer() const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return this->data_->buffer_;
}
@@ -382,7 +382,7 @@ namespace mln
mln_value(I)*
fi_adaptor<I>::buffer()
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return this->data_->buffer_;
}
@@ -390,7 +390,7 @@ namespace mln
int
fi_adaptor<I>::delta_index(const dpoint2d& dp) const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
int o = dp[0] * this->data_->b_.len(1) + dp[1];
return o;
}
@@ -411,7 +411,7 @@ namespace mln
fipImage&
fi_adaptor<I>::adaptee()
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return this->data_->fi_ima_;
}
@@ -419,7 +419,7 @@ namespace mln
const fipImage&
fi_adaptor<I>::adaptee() const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return this->data_->fi_ima_;
}
diff --git a/milena/trash/graph_image.hh b/milena/trash/graph_image.hh
index 91918bd..e8d84a8 100644
--- a/milena/trash/graph_image.hh
+++ b/milena/trash/graph_image.hh
@@ -233,7 +233,7 @@ namespace mln
void
graph_image<P, V>::init_(const p_graph<P>& pg, const std::vector<V>& val)
{
- mln_precondition(! this->has_data());
+ mln_precondition(! this->is_valid());
this->data_ = new internal::data< graph_image<P, V> > (pg, val);
}
@@ -274,7 +274,7 @@ namespace mln
const p_graph<P>&
graph_image<P, V>::domain() const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return this->data_->pg_;
}
diff --git a/milena/trash/line_graph_image.hh b/milena/trash/line_graph_image.hh
index d87dc62..148b941 100644
--- a/milena/trash/line_graph_image.hh
+++ b/milena/trash/line_graph_image.hh
@@ -262,7 +262,7 @@ namespace mln
const std::vector<V>& vertex_val,
const std::vector<V>& edge_val)
{
- mln_precondition(! this->has_data());
+ mln_precondition(! this->is_valid());
this->data_ =
new internal::data< line_graph_image<P, V> >(plg, vertex_val, edge_val);
}
@@ -312,7 +312,7 @@ namespace mln
const p_line_graph<P>&
line_graph_image<P, V>::domain() const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return this->data_->plg_;
}
diff --git a/milena/trash/neighb_get.hh b/milena/trash/neighb_get.hh
index 576ae1d..748db6f 100644
--- a/milena/trash/neighb_get.hh
+++ b/milena/trash/neighb_get.hh
@@ -176,7 +176,7 @@ namespace mln
{
trace::entering("neighb::get");
- mln_precondition(exact(ima).has_data());
+ mln_precondition(exact(ima).is_valid());
typename neighb::get_helper<I>::type res =
neighb::get_helper<I>::run(exact(ima));
diff --git a/milena/trash/neighb_image.hh b/milena/trash/neighb_image.hh
index 11380a3..2338b24 100644
--- a/milena/trash/neighb_image.hh
+++ b/milena/trash/neighb_image.hh
@@ -114,7 +114,7 @@ namespace mln
/// \}
/// Test if this image has been initialized.
- bool has_data() const;
+ bool is_valid() const;
/// Accessors.
/// \{
@@ -208,7 +208,7 @@ namespace mln
void
image<I, N>::init_(Image<I>& ima, const Neighborhood<N>& nbh)
{
- mln_precondition(! this->has_data());
+ mln_precondition(! this->is_valid());
this->data_ =
new mln::internal::data< mln::neighb::image<I, N> >(exact(ima),
exact(nbh));
@@ -217,9 +217,9 @@ namespace mln
template <typename I, typename N>
inline
bool
- image<I, N>::has_data() const
+ image<I, N>::is_valid() const
{
- return this->delegatee_() && this->delegatee_()->has_data();
+ return this->delegatee_() && this->delegatee_()->is_valid();
}
template <typename I, typename N>
diff --git a/milena/trash/translate_image.hh b/milena/trash/translate_image.hh
index 39a990c..57738ca 100644
--- a/milena/trash/translate_image.hh
+++ b/milena/trash/translate_image.hh
@@ -106,7 +106,7 @@ namespace mln
typedef translate_image< tag::image_<I> > skeleton;
/// Test if a pixel value is accessible at \p p.
- using super_::has_data;
+ using super_::is_valid;
/// Constructors.
translate_image(I& ima, const mln_site(I)::dpsite dp);
@@ -156,7 +156,7 @@ namespace mln
inline
translate_image<I>::translate_image(I& ima, const mln_site(I)::dpsite dp)
{
- mln_precondition(ima.has_data());
+ mln_precondition(ima.is_valid());
this->data_ = new internal::data< translate_image<I> >(ima, dp);
}
--
1.5.6.5
1
0
* mln/core/image/image1d.hh,
* mln/core/image/image2d.hh,
* mln/core/image/image3d.hh,
* mln/opt/at.hh: rename at() to at_().
* doc/tutorial/images_tour.txt,
* doc/tutorial/outputs/ima2d-3.txt,
* doc/tutorial/samples/ima2d-3.cc,
* doc/tutorial/tutorial.tex: use opt::at(ima,...) instead of ima.at()
* doc/tutorial/outputs/ima2d-3-output.txt: remove useless file.
---
milena/ChangeLog | 16 ++++++++++++++++
milena/doc/tutorial/images_tour.txt | 4 ++--
milena/doc/tutorial/outputs/ima2d-3-output.txt | 6 ------
milena/doc/tutorial/outputs/ima2d-3.txt | 4 ++--
milena/doc/tutorial/samples/ima2d-3.cc | 4 ++--
milena/doc/tutorial/tutorial.tex | 4 ++--
milena/mln/core/image/image1d.hh | 8 ++++----
milena/mln/core/image/image2d.hh | 8 ++++----
milena/mln/core/image/image3d.hh | 10 +++++-----
milena/mln/opt/at.hh | 12 ++++++------
10 files changed, 43 insertions(+), 33 deletions(-)
delete mode 100644 milena/doc/tutorial/outputs/ima2d-3-output.txt
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 577c1dd..1ab3eff 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,21 @@
2008-12-31 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Rename at() to at_().
+
+ * mln/core/image/image1d.hh,
+ * mln/core/image/image2d.hh,
+ * mln/core/image/image3d.hh,
+ * mln/opt/at.hh: rename at() to at_().
+
+ * doc/tutorial/images_tour.txt,
+ * doc/tutorial/outputs/ima2d-3.txt,
+ * doc/tutorial/samples/ima2d-3.cc,
+ * doc/tutorial/tutorial.tex: use opt::at(ima,...) instead of ima.at()
+
+ * doc/tutorial/outputs/ima2d-3-output.txt: remove useless file.
+
+2008-12-31 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Rename Image::has_data() to Image::is_valid().
* mln/accu/compute.hh,
diff --git a/milena/doc/tutorial/images_tour.txt b/milena/doc/tutorial/images_tour.txt
index b9dcefd..693c447 100644
--- a/milena/doc/tutorial/images_tour.txt
+++ b/milena/doc/tutorial/images_tour.txt
@@ -338,8 +338,8 @@ retrieve v from (the key) p; testing that this image has p is costly.
*** example
-ima.at(0,0) := 5
-ima.at(1,1) := 7
+opt::at(ima, 0,0) := 5
+opt::at(ima, 1,1) := 7
ima =
5 .
. 7
diff --git a/milena/doc/tutorial/outputs/ima2d-3-output.txt b/milena/doc/tutorial/outputs/ima2d-3-output.txt
deleted file mode 100644
index 096ef4f..0000000
--- a/milena/doc/tutorial/outputs/ima2d-3-output.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-ima.at(1,2) = 9
-ima(p) = 9
----
-ima.at(1,2) = 2
-ima(p) = 2
-
diff --git a/milena/doc/tutorial/outputs/ima2d-3.txt b/milena/doc/tutorial/outputs/ima2d-3.txt
index b0fda85..a0a8707 100644
--- a/milena/doc/tutorial/outputs/ima2d-3.txt
+++ b/milena/doc/tutorial/outputs/ima2d-3.txt
@@ -1,5 +1,5 @@
-ima.at(1,2) = 9
+opt::at(ima, 1,2) = 9
ima(p) = 9
---
-ima.at(1,2) = 2
+opt::at(ima, 1,2) = 2
ima(p) = 2
diff --git a/milena/doc/tutorial/samples/ima2d-3.cc b/milena/doc/tutorial/samples/ima2d-3.cc
index 3ab11a7..97d1ebf 100644
--- a/milena/doc/tutorial/samples/ima2d-3.cc
+++ b/milena/doc/tutorial/samples/ima2d-3.cc
@@ -16,7 +16,7 @@ int main()
// Associate '9' as value for the site/point2d (1,2).
// The value is returned by reference and can be changed.
opt::at(ima, 1,2) = 9;
- std::cout << "ima.at(1,2) = " << opt::at(ima, 1,2)
+ std::cout << "opt::at(ima, 1,2) = " << opt::at(ima, 1,2)
<< std::endl;
std::cout << "ima(p) = " << ima(p) << std::endl;
@@ -27,7 +27,7 @@ int main()
// The value is returned by reference
// and can be changed as well.
ima(p) = 2;
- std::cout << "ima.at(1,2) = " << opt::at(ima, 1,2)
+ std::cout << "opt::at(ima, 1,2) = " << opt::at(ima, 1,2)
<< std::endl;
std::cout << "ima(p) = " << ima(p) << std::endl;
// \}
diff --git a/milena/doc/tutorial/tutorial.tex b/milena/doc/tutorial/tutorial.tex
index a2affa1..73ac9fd 100644
--- a/milena/doc/tutorial/tutorial.tex
+++ b/milena/doc/tutorial/tutorial.tex
@@ -1040,7 +1040,7 @@ the default one, e.g 0. By using \code{initialize} \var{img2b} is initialized
There are several ways to access/modify an image ``\var{ima}'':
\begin{itemize}
-\item \code{ima.at(x, y, \dots)}
+\item \code{opt::at(ima, x, y, \dots)}
\item \code{ima(Site)}
\end{itemize}
@@ -1048,7 +1048,7 @@ Most of the time, images can be modified and these two methods can be used both
to read a value and modify it. Both methods are equivalent.
\doxycode{ima2d-3}
Output:
-\doxyoutput{ima2d-3-output}
+\doxyoutput{ima2d-3}
Usually, you will want to use the functional way, ``\code{ima(Site)}'', more
particularly while iterating over all the sites through an iterator. This use
diff --git a/milena/mln/core/image/image1d.hh b/milena/mln/core/image/image1d.hh
index d86bc53..4cd48ec 100644
--- a/milena/mln/core/image/image1d.hh
+++ b/milena/mln/core/image/image1d.hh
@@ -181,10 +181,10 @@ namespace mln
// -----------------
/// Read-only access to the image value located at (\p index).
- const T& at(def::coord index) const;
+ const T& at_(def::coord index) const;
/// Read-write access to the image value located at (\p index).
- T& at(def::coord index);
+ T& at_(def::coord index);
/// Fast Image method
@@ -426,7 +426,7 @@ namespace mln
template <typename T>
inline
const T&
- image1d<T>::at(def::coord index) const
+ image1d<T>::at_(def::coord index) const
{
mln_precondition(this->has(point1d(index)));
return this->data_->array_[index];
@@ -435,7 +435,7 @@ namespace mln
template <typename T>
inline
T&
- image1d<T>::at(def::coord index)
+ image1d<T>::at_(def::coord index)
{
mln_precondition(this->has(point1d(index)));
return this->data_->array_[index];
diff --git a/milena/mln/core/image/image2d.hh b/milena/mln/core/image/image2d.hh
index 3146b14..c491c10 100644
--- a/milena/mln/core/image/image2d.hh
+++ b/milena/mln/core/image/image2d.hh
@@ -205,10 +205,10 @@ namespace mln
// -----------------
/// Read-only access to the image value located at (\p row, \p col).
- const T& at(def::coord row, def::coord col) const;
+ const T& at_(def::coord row, def::coord col) const;
/// Read-write access to the image value located at (\p row, \p col).
- T& at(def::coord row, def::coord col);
+ T& at_(def::coord row, def::coord col);
/// Give the number of rows.
unsigned nrows() const;
@@ -463,7 +463,7 @@ namespace mln
template <typename T>
inline
const T&
- image2d<T>::at(def::coord row, def::coord col) const
+ image2d<T>::at_(def::coord row, def::coord col) const
{
mln_precondition(this->has(point2d(row, col)));
return this->data_->array_[row][col];
@@ -472,7 +472,7 @@ namespace mln
template <typename T>
inline
T&
- image2d<T>::at(def::coord row, def::coord col)
+ image2d<T>::at_(def::coord row, def::coord col)
{
mln_precondition(this->has(point2d(row, col)));
return this->data_->array_[row][col];
diff --git a/milena/mln/core/image/image3d.hh b/milena/mln/core/image/image3d.hh
index 839f8d4..8016414 100644
--- a/milena/mln/core/image/image3d.hh
+++ b/milena/mln/core/image/image3d.hh
@@ -52,7 +52,7 @@
namespace mln
{
- // Fwd decl.
+ // Forward declaration.
template <typename T> struct image3d;
@@ -201,11 +201,11 @@ namespace mln
/// Read-only access to the image value located at (\p sli, \p
/// row, \p col).
- const T& at(def::coord sli, def::coord row, def::coord col) const;
+ const T& at_(def::coord sli, def::coord row, def::coord col) const;
/// Read-write access to the image value located at (\p sli, \p
/// row, \p col).
- T& at(def::coord sli, def::coord row, def::coord col);
+ T& at_(def::coord sli, def::coord row, def::coord col);
/// Fast Image method
@@ -484,7 +484,7 @@ namespace mln
template <typename T>
inline
const T&
- image3d<T>::at(def::coord sli, def::coord row, def::coord col) const
+ image3d<T>::at_(def::coord sli, def::coord row, def::coord col) const
{
mln_precondition(this->has(point3d(sli, row, col)));
return data_->array_[sli][row][col];
@@ -493,7 +493,7 @@ namespace mln
template <typename T>
inline
T&
- image3d<T>::at(def::coord sli, def::coord row, def::coord col)
+ image3d<T>::at_(def::coord sli, def::coord row, def::coord col)
{
mln_precondition(this->has(point3d(sli, row, col)));
return data_->array_[sli][row][col];
diff --git a/milena/mln/opt/at.hh b/milena/mln/opt/at.hh
index b064a79..6cfb85a 100644
--- a/milena/mln/opt/at.hh
+++ b/milena/mln/opt/at.hh
@@ -101,7 +101,7 @@ namespace mln
mln_rvalue(I) at_1d_impl(trait::image::category::primary,
const Image<I>& ima, def::coord ind)
{
- return exact(ima).at(ind);
+ return exact(ima).at_(ind);
}
@@ -132,7 +132,7 @@ namespace mln
mln_lvalue(I) at_1d_impl(trait::image::category::primary,
Image<I>& ima, def::coord ind)
{
- return exact(ima).at(ind);
+ return exact(ima).at_(ind);
}
} // end of namespace mln::opt::impl
@@ -186,7 +186,7 @@ namespace mln
mln_rvalue(I) at_2d_impl(trait::image::category::primary,
const Image<I>& ima, def::coord row, def::coord col)
{
- return exact(ima).at(row, col);
+ return exact(ima).at_(row, col);
}
@@ -217,7 +217,7 @@ namespace mln
mln_lvalue(I) at_2d_impl(trait::image::category::primary,
Image<I>& ima, def::coord row, def::coord col)
{
- return exact(ima).at(row, col);
+ return exact(ima).at_(row, col);
}
} // end of namespace mln::opt::impl
@@ -270,7 +270,7 @@ namespace mln
mln_rvalue(I) at_3d_impl(trait::image::category::primary,
const Image<I>& ima, def::coord sli, def::coord row, def::coord col)
{
- return exact(ima).at(sli, row, col);
+ return exact(ima).at_(sli, row, col);
}
@@ -301,7 +301,7 @@ namespace mln
mln_lvalue(I) at_3d_impl(trait::image::category::primary,
Image<I>& ima, def::coord sli, def::coord row, def::coord col)
{
- return exact(ima).at(sli, row, col);
+ return exact(ima).at_(sli, row, col);
}
} // end of namespace mln::opt::impl
--
1.5.6.5
1
0
* mln/accu/compute.hh,
* mln/accu/line.hh,
* mln/accu/take.hh,
* mln/accu/transform.hh,
* mln/accu/transform_diagonal.hh,
* mln/accu/transform_directional.hh,
* mln/accu/transform_snake.hh,
* mln/accu/transform_stop.hh,
* mln/arith/diff_abs.hh,
* mln/arith/minus.hh,
* mln/arith/plus.hh,
* mln/arith/revert.hh,
* mln/arith/times.hh,
* mln/binarization/binarization.hh,
* mln/binarization/threshold.hh,
* mln/border/adjust.hh,
* mln/border/duplicate.hh,
* mln/border/equalize.hh,
* mln/border/fill.hh,
* mln/border/find.hh,
* mln/border/get.hh,
* mln/border/mirror.hh,
* mln/border/resize.hh,
* mln/canvas/browsing/fwd.hh,
* mln/canvas/browsing/snake_fwd.hh,
* mln/canvas/browsing/snake_generic.hh,
* mln/canvas/browsing/snake_vert.hh,
* mln/canvas/distance_front.hh,
* mln/canvas/distance_geodesic.hh,
* mln/canvas/labeling.hh,
* mln/convert/from_to.hh,
* mln/convert/to_p_set.hh,
* mln/convert/to_window.hh,
* mln/core/concept/doc/image.hh,
* mln/core/concept/image.hh,
* mln/core/concept/window.hh,
* mln/core/dpoints_pixter.hh,
* mln/core/image/bgraph_image.hh,
* mln/core/image/cast_image.hh,
* mln/core/image/ch_piter.hh,
* mln/core/image/complex_image.hh,
* mln/core/image/decorated_image.hh,
* mln/core/image/extended.hh,
* mln/core/image/extension_fun.hh,
* mln/core/image/extension_ima.hh,
* mln/core/image/extension_val.hh,
* mln/core/image/flat_image.hh,
* mln/core/image/fun_image.hh,
* mln/core/image/hexa.hh,
* mln/core/image/image1d.hh,
* mln/core/image/image2d.hh,
* mln/core/image/image3d.hh,
* mln/core/image/image_if.hh,
* mln/core/image/interpolated.hh,
* mln/core/image/lazy_image.hh,
* mln/core/image/mono_obased_rle_image.hh,
* mln/core/image/mono_rle_image.hh,
* mln/core/image/obased_rle_image.hh,
* mln/core/image/plain.hh,
* mln/core/image/rle_image.hh,
* mln/core/image/safe.hh,
* mln/core/image/sparse_image.hh,
* mln/core/image/sub_image.hh,
* mln/core/image/sub_image_if.hh,
* mln/core/image/t_image.hh,
* mln/core/image/tr_image.hh,
* mln/core/image/value_enc_image.hh,
* mln/core/image/violent_cast_image.hh,
* mln/core/internal/check/image_fastest.hh,
* mln/core/internal/image_base.hh,
* mln/core/internal/image_morpher.hh,
* mln/core/internal/pixel_iterator_base.hh,
* mln/core/internal/run_image.hh,
* mln/core/pixel.hh,
* mln/core/pixter1d.hh,
* mln/core/pixter2d.hh,
* mln/core/pixter3d.hh,
* mln/core/routine/duplicate.hh,
* mln/core/routine/initialize.hh,
* mln/core/routine/primary.hh,
* mln/core/site_set/p_image.hh,
* mln/core/w_window.hh,
* mln/data/fill.hh,
* mln/data/fill_with_image.hh,
* mln/data/fill_with_value.hh,
* mln/data/memcpy_.hh,
* mln/data/memset_.hh,
* mln/data/paste.hh,
* mln/debug/colorize.hh,
* mln/debug/iota.hh,
* mln/draw/box.hh,
* mln/draw/line.hh,
* mln/draw/plot.hh,
* mln/estim/mean.hh,
* mln/estim/min_max.hh,
* mln/estim/sum.hh,
* mln/extension/adjust.hh,
* mln/extension/fill.hh,
* mln/geom/bbox.hh,
* mln/geom/max_col.hh,
* mln/geom/max_ind.hh,
* mln/geom/max_row.hh,
* mln/geom/max_sli.hh,
* mln/geom/min_col.hh,
* mln/geom/min_ind.hh,
* mln/geom/min_row.hh,
* mln/geom/min_sli.hh,
* mln/geom/ncols.hh,
* mln/geom/ninds.hh,
* mln/geom/nrows.hh,
* mln/geom/nsites.hh,
* mln/geom/nslis.hh,
* mln/geom/seeds2tiling.hh,
* mln/geom/seeds2tiling_roundness.hh,
* mln/histo/compute.hh,
* mln/io/txt/save.hh,
* mln/labeling/background.hh,
* mln/labeling/blobs.hh,
* mln/labeling/compute.hh,
* mln/labeling/flat_zones.hh,
* mln/labeling/foreground.hh,
* mln/labeling/level.hh,
* mln/labeling/regional_maxima.hh,
* mln/labeling/regional_minima.hh,
* mln/labeling/relabel.hh,
* mln/level/abs.hh,
* mln/level/apply.hh,
* mln/level/convert.hh,
* mln/level/fast_median.hh,
* mln/level/replace.hh,
* mln/level/saturate.hh,
* mln/level/sort_psites.hh,
* mln/level/stretch.hh,
* mln/level/transform.hh,
* mln/level/transform_inplace.hh,
* mln/level/update.hh,
* mln/level/was.median.hh,
* mln/linear/convolve.hh,
* mln/linear/convolve_2x1d.hh,
* mln/linear/convolve_directional.hh,
* mln/linear/gaussian.hh,
* mln/linear/lap.hh,
* mln/linear/local/convolve.hh,
* mln/linear/log.hh,
* mln/linear/sobel_2d.hh,
* mln/logical/includes.hh,
* mln/logical/not.hh,
* mln/make/dual_neighb.hh,
* mln/make/graph.hh,
* mln/morpho/closing.hh,
* mln/morpho/closing_area.hh,
* mln/morpho/closing_area_on_vertices.hh,
* mln/morpho/closing_attribute.hh,
* mln/morpho/closing_height.hh,
* mln/morpho/closing_volume.hh,
* mln/morpho/complementation.hh,
* mln/morpho/contrast.hh,
* mln/morpho/dilation.hh,
* mln/morpho/elementary/closing.hh,
* mln/morpho/elementary/dilation.hh,
* mln/morpho/elementary/erosion.hh,
* mln/morpho/elementary/gradient.hh,
* mln/morpho/elementary/gradient_external.hh,
* mln/morpho/elementary/gradient_internal.hh,
* mln/morpho/elementary/laplacian.hh,
* mln/morpho/elementary/opening.hh,
* mln/morpho/elementary/top_hat.hh,
* mln/morpho/erosion.hh,
* mln/morpho/general.hh,
* mln/morpho/gradient.hh,
* mln/morpho/hit_or_miss.hh,
* mln/morpho/laplacian.hh,
* mln/morpho/opening.hh,
* mln/morpho/opening_area.hh,
* mln/morpho/opening_area_on_vertices.hh,
* mln/morpho/opening_attribute.hh,
* mln/morpho/opening_height.hh,
* mln/morpho/opening_volume.hh,
* mln/morpho/rank_filter.hh,
* mln/morpho/thickening.hh,
* mln/morpho/thin_fit.hh,
* mln/morpho/thinning.hh,
* mln/morpho/top_hat.hh,
* mln/morpho/tree/compute_parent.hh,
* mln/morpho/tree/data.hh,
* mln/morpho/tree/max.hh,
* mln/morpho/tree/utils.hh,
* mln/pw/value.hh,
* mln/subsampling/gaussian_subsampling.hh,
* mln/subsampling/subsampling.hh,
* mln/test/positive.hh,
* mln/test/predicate.hh,
* mln/transform/distance_front.hh,
* mln/transform/distance_geodesic.hh,
* mln/transform/influence_zone_front.hh,
* mln/transform/influence_zone_geodesic.hh,
* mln/value/stack.hh: apply the renaming here.
---
milena/ChangeLog | 202 +++++++++++++++++++++
milena/mln/accu/compute.hh | 6 +-
milena/mln/accu/line.hh | 4 +-
milena/mln/accu/take.hh | 2 +-
milena/mln/accu/transform.hh | 8 +-
milena/mln/accu/transform_diagonal.hh | 2 +-
milena/mln/accu/transform_directional.hh | 2 +-
milena/mln/accu/transform_snake.hh | 2 +-
milena/mln/accu/transform_stop.hh | 8 +-
milena/mln/arith/diff_abs.hh | 4 +-
milena/mln/arith/minus.hh | 16 +-
milena/mln/arith/plus.hh | 20 +-
milena/mln/arith/revert.hh | 8 +-
milena/mln/arith/times.hh | 6 +-
milena/mln/binarization/binarization.hh | 2 +-
milena/mln/binarization/threshold.hh | 2 +-
milena/mln/border/adjust.hh | 2 +-
milena/mln/border/duplicate.hh | 4 +-
milena/mln/border/equalize.hh | 2 +-
milena/mln/border/fill.hh | 2 +-
milena/mln/border/find.hh | 2 +-
milena/mln/border/get.hh | 2 +-
milena/mln/border/mirror.hh | 2 +-
milena/mln/border/resize.hh | 2 +-
milena/mln/canvas/browsing/fwd.hh | 2 +-
milena/mln/canvas/browsing/snake_fwd.hh | 2 +-
milena/mln/canvas/browsing/snake_generic.hh | 2 +-
milena/mln/canvas/browsing/snake_vert.hh | 2 +-
milena/mln/canvas/distance_front.hh | 2 +-
milena/mln/canvas/distance_geodesic.hh | 2 +-
milena/mln/canvas/labeling.hh | 2 +-
milena/mln/convert/from_to.hh | 2 +-
milena/mln/convert/to_p_set.hh | 2 +-
milena/mln/convert/to_window.hh | 2 +-
milena/mln/core/concept/doc/image.hh | 2 +-
milena/mln/core/concept/image.hh | 6 +-
milena/mln/core/concept/window.hh | 2 +-
milena/mln/core/dpoints_pixter.hh | 8 +-
milena/mln/core/image/bgraph_image.hh | 2 +-
milena/mln/core/image/cast_image.hh | 6 +-
milena/mln/core/image/ch_piter.hh | 4 +-
milena/mln/core/image/complex_image.hh | 4 +-
milena/mln/core/image/decorated_image.hh | 4 +-
milena/mln/core/image/extended.hh | 6 +-
milena/mln/core/image/extension_fun.hh | 6 +-
milena/mln/core/image/extension_ima.hh | 12 +-
milena/mln/core/image/extension_val.hh | 8 +-
milena/mln/core/image/flat_image.hh | 12 +-
milena/mln/core/image/fun_image.hh | 4 +-
milena/mln/core/image/hexa.hh | 10 +-
milena/mln/core/image/image1d.hh | 18 +-
milena/mln/core/image/image2d.hh | 24 ++--
milena/mln/core/image/image3d.hh | 18 +-
milena/mln/core/image/image_if.hh | 6 +-
milena/mln/core/image/interpolated.hh | 10 +-
milena/mln/core/image/lazy_image.hh | 2 +-
milena/mln/core/image/mono_obased_rle_image.hh | 4 +-
milena/mln/core/image/mono_rle_image.hh | 4 +-
milena/mln/core/image/obased_rle_image.hh | 4 +-
milena/mln/core/image/plain.hh | 12 +-
milena/mln/core/image/rle_image.hh | 6 +-
milena/mln/core/image/safe.hh | 12 +-
milena/mln/core/image/sparse_image.hh | 6 +-
milena/mln/core/image/sub_image.hh | 2 +-
milena/mln/core/image/sub_image_if.hh | 2 +-
milena/mln/core/image/t_image.hh | 14 +-
milena/mln/core/image/tr_image.hh | 8 +-
milena/mln/core/image/value_enc_image.hh | 6 +-
milena/mln/core/image/violent_cast_image.hh | 6 +-
milena/mln/core/internal/check/image_fastest.hh | 2 +-
milena/mln/core/internal/image_base.hh | 14 +-
milena/mln/core/internal/image_morpher.hh | 8 +-
milena/mln/core/internal/pixel_iterator_base.hh | 2 +-
milena/mln/core/internal/run_image.hh | 2 +-
milena/mln/core/pixel.hh | 2 +-
milena/mln/core/pixter1d.hh | 4 +-
milena/mln/core/pixter2d.hh | 4 +-
milena/mln/core/pixter3d.hh | 4 +-
milena/mln/core/routine/duplicate.hh | 2 +-
milena/mln/core/routine/initialize.hh | 8 +-
milena/mln/core/routine/primary.hh | 2 +-
milena/mln/core/site_set/p_image.hh | 4 +-
milena/mln/core/w_window.hh | 2 +-
milena/mln/data/fill.hh | 2 +-
milena/mln/data/fill_with_image.hh | 4 +-
milena/mln/data/fill_with_value.hh | 2 +-
milena/mln/data/memcpy_.hh | 4 +-
milena/mln/data/memset_.hh | 4 +-
milena/mln/data/paste.hh | 2 +-
milena/mln/debug/colorize.hh | 2 +-
milena/mln/debug/iota.hh | 2 +-
milena/mln/draw/box.hh | 2 +-
milena/mln/draw/line.hh | 2 +-
milena/mln/draw/plot.hh | 2 +-
milena/mln/estim/mean.hh | 4 +-
milena/mln/estim/min_max.hh | 2 +-
milena/mln/estim/sum.hh | 4 +-
milena/mln/extension/adjust.hh | 2 +-
milena/mln/extension/fill.hh | 2 +-
milena/mln/geom/bbox.hh | 2 +-
milena/mln/geom/max_col.hh | 2 +-
milena/mln/geom/max_ind.hh | 2 +-
milena/mln/geom/max_row.hh | 2 +-
milena/mln/geom/max_sli.hh | 2 +-
milena/mln/geom/min_col.hh | 2 +-
milena/mln/geom/min_ind.hh | 2 +-
milena/mln/geom/min_row.hh | 2 +-
milena/mln/geom/min_sli.hh | 2 +-
milena/mln/geom/ncols.hh | 2 +-
milena/mln/geom/ninds.hh | 2 +-
milena/mln/geom/nrows.hh | 2 +-
milena/mln/geom/nsites.hh | 2 +-
milena/mln/geom/nslis.hh | 2 +-
milena/mln/geom/seeds2tiling.hh | 2 +-
milena/mln/geom/seeds2tiling_roundness.hh | 2 +-
milena/mln/histo/compute.hh | 2 +-
milena/mln/io/txt/save.hh | 2 +-
milena/mln/labeling/background.hh | 2 +-
milena/mln/labeling/blobs.hh | 2 +-
milena/mln/labeling/compute.hh | 6 +-
milena/mln/labeling/flat_zones.hh | 2 +-
milena/mln/labeling/foreground.hh | 2 +-
milena/mln/labeling/level.hh | 2 +-
milena/mln/labeling/regional_maxima.hh | 2 +-
milena/mln/labeling/regional_minima.hh | 2 +-
milena/mln/labeling/relabel.hh | 4 +-
milena/mln/level/abs.hh | 2 +-
milena/mln/level/apply.hh | 2 +-
milena/mln/level/convert.hh | 2 +-
milena/mln/level/fast_median.hh | 4 +-
milena/mln/level/replace.hh | 2 +-
milena/mln/level/saturate.hh | 6 +-
milena/mln/level/sort_psites.hh | 8 +-
milena/mln/level/stretch.hh | 4 +-
milena/mln/level/transform.hh | 6 +-
milena/mln/level/transform_inplace.hh | 6 +-
milena/mln/level/update.hh | 2 +-
milena/mln/level/was.median.hh | 4 +-
milena/mln/linear/convolve.hh | 4 +-
milena/mln/linear/convolve_2x1d.hh | 4 +-
milena/mln/linear/convolve_directional.hh | 4 +-
milena/mln/linear/gaussian.hh | 24 ++--
milena/mln/linear/lap.hh | 8 +-
milena/mln/linear/local/convolve.hh | 2 +-
milena/mln/linear/log.hh | 8 +-
milena/mln/linear/sobel_2d.hh | 8 +-
milena/mln/logical/includes.hh | 4 +-
milena/mln/logical/not.hh | 8 +-
milena/mln/make/dual_neighb.hh | 2 +-
milena/mln/make/graph.hh | 2 +-
milena/mln/morpho/closing.hh | 2 +-
milena/mln/morpho/closing_area.hh | 2 +-
milena/mln/morpho/closing_area_on_vertices.hh | 2 +-
milena/mln/morpho/closing_attribute.hh | 2 +-
milena/mln/morpho/closing_height.hh | 2 +-
milena/mln/morpho/closing_volume.hh | 2 +-
milena/mln/morpho/complementation.hh | 4 +-
milena/mln/morpho/contrast.hh | 2 +-
milena/mln/morpho/dilation.hh | 2 +-
milena/mln/morpho/elementary/closing.hh | 2 +-
milena/mln/morpho/elementary/dilation.hh | 2 +-
milena/mln/morpho/elementary/erosion.hh | 2 +-
milena/mln/morpho/elementary/gradient.hh | 2 +-
milena/mln/morpho/elementary/gradient_external.hh | 2 +-
milena/mln/morpho/elementary/gradient_internal.hh | 2 +-
milena/mln/morpho/elementary/laplacian.hh | 2 +-
milena/mln/morpho/elementary/opening.hh | 2 +-
milena/mln/morpho/elementary/top_hat.hh | 6 +-
milena/mln/morpho/erosion.hh | 2 +-
milena/mln/morpho/general.hh | 4 +-
milena/mln/morpho/gradient.hh | 6 +-
milena/mln/morpho/hit_or_miss.hh | 2 +-
milena/mln/morpho/laplacian.hh | 2 +-
milena/mln/morpho/opening.hh | 2 +-
milena/mln/morpho/opening_area.hh | 2 +-
milena/mln/morpho/opening_area_on_vertices.hh | 2 +-
milena/mln/morpho/opening_attribute.hh | 2 +-
milena/mln/morpho/opening_height.hh | 2 +-
milena/mln/morpho/opening_volume.hh | 2 +-
milena/mln/morpho/rank_filter.hh | 4 +-
milena/mln/morpho/thickening.hh | 2 +-
milena/mln/morpho/thin_fit.hh | 2 +-
milena/mln/morpho/thinning.hh | 2 +-
milena/mln/morpho/top_hat.hh | 6 +-
milena/mln/morpho/tree/compute_parent.hh | 2 +-
milena/mln/morpho/tree/data.hh | 2 +-
milena/mln/morpho/tree/max.hh | 2 +-
milena/mln/morpho/tree/utils.hh | 12 +-
milena/mln/pw/value.hh | 2 +-
milena/mln/subsampling/gaussian_subsampling.hh | 2 +-
milena/mln/subsampling/subsampling.hh | 2 +-
milena/mln/test/positive.hh | 2 +-
milena/mln/test/predicate.hh | 6 +-
milena/mln/transform/distance_front.hh | 2 +-
milena/mln/transform/distance_geodesic.hh | 2 +-
milena/mln/transform/influence_zone_front.hh | 2 +-
milena/mln/transform/influence_zone_geodesic.hh | 2 +-
milena/mln/value/stack.hh | 8 +-
198 files changed, 608 insertions(+), 406 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index d5c4ca8..577c1dd 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,207 @@
2008-12-31 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Rename Image::has_data() to Image::is_valid().
+
+ * mln/accu/compute.hh,
+ * mln/accu/line.hh,
+ * mln/accu/take.hh,
+ * mln/accu/transform.hh,
+ * mln/accu/transform_diagonal.hh,
+ * mln/accu/transform_directional.hh,
+ * mln/accu/transform_snake.hh,
+ * mln/accu/transform_stop.hh,
+ * mln/arith/diff_abs.hh,
+ * mln/arith/minus.hh,
+ * mln/arith/plus.hh,
+ * mln/arith/revert.hh,
+ * mln/arith/times.hh,
+ * mln/binarization/binarization.hh,
+ * mln/binarization/threshold.hh,
+ * mln/border/adjust.hh,
+ * mln/border/duplicate.hh,
+ * mln/border/equalize.hh,
+ * mln/border/fill.hh,
+ * mln/border/find.hh,
+ * mln/border/get.hh,
+ * mln/border/mirror.hh,
+ * mln/border/resize.hh,
+ * mln/canvas/browsing/fwd.hh,
+ * mln/canvas/browsing/snake_fwd.hh,
+ * mln/canvas/browsing/snake_generic.hh,
+ * mln/canvas/browsing/snake_vert.hh,
+ * mln/canvas/distance_front.hh,
+ * mln/canvas/distance_geodesic.hh,
+ * mln/canvas/labeling.hh,
+ * mln/convert/from_to.hh,
+ * mln/convert/to_p_set.hh,
+ * mln/convert/to_window.hh,
+ * mln/core/concept/doc/image.hh,
+ * mln/core/concept/image.hh,
+ * mln/core/concept/window.hh,
+ * mln/core/dpoints_pixter.hh,
+ * mln/core/image/bgraph_image.hh,
+ * mln/core/image/cast_image.hh,
+ * mln/core/image/ch_piter.hh,
+ * mln/core/image/complex_image.hh,
+ * mln/core/image/decorated_image.hh,
+ * mln/core/image/extended.hh,
+ * mln/core/image/extension_fun.hh,
+ * mln/core/image/extension_ima.hh,
+ * mln/core/image/extension_val.hh,
+ * mln/core/image/flat_image.hh,
+ * mln/core/image/fun_image.hh,
+ * mln/core/image/hexa.hh,
+ * mln/core/image/image1d.hh,
+ * mln/core/image/image2d.hh,
+ * mln/core/image/image3d.hh,
+ * mln/core/image/image_if.hh,
+ * mln/core/image/interpolated.hh,
+ * mln/core/image/lazy_image.hh,
+ * mln/core/image/mono_obased_rle_image.hh,
+ * mln/core/image/mono_rle_image.hh,
+ * mln/core/image/obased_rle_image.hh,
+ * mln/core/image/plain.hh,
+ * mln/core/image/rle_image.hh,
+ * mln/core/image/safe.hh,
+ * mln/core/image/sparse_image.hh,
+ * mln/core/image/sub_image.hh,
+ * mln/core/image/sub_image_if.hh,
+ * mln/core/image/t_image.hh,
+ * mln/core/image/tr_image.hh,
+ * mln/core/image/value_enc_image.hh,
+ * mln/core/image/violent_cast_image.hh,
+ * mln/core/internal/check/image_fastest.hh,
+ * mln/core/internal/image_base.hh,
+ * mln/core/internal/image_morpher.hh,
+ * mln/core/internal/pixel_iterator_base.hh,
+ * mln/core/internal/run_image.hh,
+ * mln/core/pixel.hh,
+ * mln/core/pixter1d.hh,
+ * mln/core/pixter2d.hh,
+ * mln/core/pixter3d.hh,
+ * mln/core/routine/duplicate.hh,
+ * mln/core/routine/initialize.hh,
+ * mln/core/routine/primary.hh,
+ * mln/core/site_set/p_image.hh,
+ * mln/core/w_window.hh,
+ * mln/data/fill.hh,
+ * mln/data/fill_with_image.hh,
+ * mln/data/fill_with_value.hh,
+ * mln/data/memcpy_.hh,
+ * mln/data/memset_.hh,
+ * mln/data/paste.hh,
+ * mln/debug/colorize.hh,
+ * mln/debug/iota.hh,
+ * mln/draw/box.hh,
+ * mln/draw/line.hh,
+ * mln/draw/plot.hh,
+ * mln/estim/mean.hh,
+ * mln/estim/min_max.hh,
+ * mln/estim/sum.hh,
+ * mln/extension/adjust.hh,
+ * mln/extension/fill.hh,
+ * mln/geom/bbox.hh,
+ * mln/geom/max_col.hh,
+ * mln/geom/max_ind.hh,
+ * mln/geom/max_row.hh,
+ * mln/geom/max_sli.hh,
+ * mln/geom/min_col.hh,
+ * mln/geom/min_ind.hh,
+ * mln/geom/min_row.hh,
+ * mln/geom/min_sli.hh,
+ * mln/geom/ncols.hh,
+ * mln/geom/ninds.hh,
+ * mln/geom/nrows.hh,
+ * mln/geom/nsites.hh,
+ * mln/geom/nslis.hh,
+ * mln/geom/seeds2tiling.hh,
+ * mln/geom/seeds2tiling_roundness.hh,
+ * mln/histo/compute.hh,
+ * mln/io/txt/save.hh,
+ * mln/labeling/background.hh,
+ * mln/labeling/blobs.hh,
+ * mln/labeling/compute.hh,
+ * mln/labeling/flat_zones.hh,
+ * mln/labeling/foreground.hh,
+ * mln/labeling/level.hh,
+ * mln/labeling/regional_maxima.hh,
+ * mln/labeling/regional_minima.hh,
+ * mln/labeling/relabel.hh,
+ * mln/level/abs.hh,
+ * mln/level/apply.hh,
+ * mln/level/convert.hh,
+ * mln/level/fast_median.hh,
+ * mln/level/replace.hh,
+ * mln/level/saturate.hh,
+ * mln/level/sort_psites.hh,
+ * mln/level/stretch.hh,
+ * mln/level/transform.hh,
+ * mln/level/transform_inplace.hh,
+ * mln/level/update.hh,
+ * mln/level/was.median.hh,
+ * mln/linear/convolve.hh,
+ * mln/linear/convolve_2x1d.hh,
+ * mln/linear/convolve_directional.hh,
+ * mln/linear/gaussian.hh,
+ * mln/linear/lap.hh,
+ * mln/linear/local/convolve.hh,
+ * mln/linear/log.hh,
+ * mln/linear/sobel_2d.hh,
+ * mln/logical/includes.hh,
+ * mln/logical/not.hh,
+ * mln/make/dual_neighb.hh,
+ * mln/make/graph.hh,
+ * mln/morpho/closing.hh,
+ * mln/morpho/closing_area.hh,
+ * mln/morpho/closing_area_on_vertices.hh,
+ * mln/morpho/closing_attribute.hh,
+ * mln/morpho/closing_height.hh,
+ * mln/morpho/closing_volume.hh,
+ * mln/morpho/complementation.hh,
+ * mln/morpho/contrast.hh,
+ * mln/morpho/dilation.hh,
+ * mln/morpho/elementary/closing.hh,
+ * mln/morpho/elementary/dilation.hh,
+ * mln/morpho/elementary/erosion.hh,
+ * mln/morpho/elementary/gradient.hh,
+ * mln/morpho/elementary/gradient_external.hh,
+ * mln/morpho/elementary/gradient_internal.hh,
+ * mln/morpho/elementary/laplacian.hh,
+ * mln/morpho/elementary/opening.hh,
+ * mln/morpho/elementary/top_hat.hh,
+ * mln/morpho/erosion.hh,
+ * mln/morpho/general.hh,
+ * mln/morpho/gradient.hh,
+ * mln/morpho/hit_or_miss.hh,
+ * mln/morpho/laplacian.hh,
+ * mln/morpho/opening.hh,
+ * mln/morpho/opening_area.hh,
+ * mln/morpho/opening_area_on_vertices.hh,
+ * mln/morpho/opening_attribute.hh,
+ * mln/morpho/opening_height.hh,
+ * mln/morpho/opening_volume.hh,
+ * mln/morpho/rank_filter.hh,
+ * mln/morpho/thickening.hh,
+ * mln/morpho/thin_fit.hh,
+ * mln/morpho/thinning.hh,
+ * mln/morpho/top_hat.hh,
+ * mln/morpho/tree/compute_parent.hh,
+ * mln/morpho/tree/data.hh,
+ * mln/morpho/tree/max.hh,
+ * mln/morpho/tree/utils.hh,
+ * mln/pw/value.hh,
+ * mln/subsampling/gaussian_subsampling.hh,
+ * mln/subsampling/subsampling.hh,
+ * mln/test/positive.hh,
+ * mln/test/predicate.hh,
+ * mln/transform/distance_front.hh,
+ * mln/transform/distance_geodesic.hh,
+ * mln/transform/influence_zone_front.hh,
+ * mln/transform/influence_zone_geodesic.hh,
+ * mln/value/stack.hh: apply the renaming here.
+
+2008-12-31 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Various small fixes (again).
* mln/core/image/complex_image.hh: update comments.
diff --git a/milena/mln/accu/compute.hh b/milena/mln/accu/compute.hh
index d5bbdaf..69af068 100644
--- a/milena/mln/accu/compute.hh
+++ b/milena/mln/accu/compute.hh
@@ -94,7 +94,7 @@ namespace mln
trace::entering("accu::impl::generic::compute");
const I& input = exact(input_);
- mln_precondition(input.has_data());
+ mln_precondition(input.is_valid());
A a;
mln_piter(I) p(input.domain());
@@ -132,7 +132,7 @@ namespace mln
{
trace::entering("accu::compute");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
mln_result(A) output = internal::compute_dispatch(a, input);
trace::exiting("accu::compute");
@@ -146,7 +146,7 @@ namespace mln
{
trace::entering("accu::compute");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
typedef mln_accu_with(A, util::pix<I>) A_;
util::pix<I>* pix_; // So we can pass a pixel below (pixel has
diff --git a/milena/mln/accu/line.hh b/milena/mln/accu/line.hh
index 8521c99..c8a440e 100644
--- a/milena/mln/accu/line.hh
+++ b/milena/mln/accu/line.hh
@@ -97,8 +97,8 @@ namespace mln
const I& input = exact(input_);
O& output = exact(output_);
- mln_precondition(input.has_data());
- mln_precondition(output.has_data());
+ mln_precondition(input.is_valid());
+ mln_precondition(output.is_valid());
}
} // end of namespace mln::accu::internal
diff --git a/milena/mln/accu/take.hh b/milena/mln/accu/take.hh
index 5b7f3e8..6bf6119 100644
--- a/milena/mln/accu/take.hh
+++ b/milena/mln/accu/take.hh
@@ -87,7 +87,7 @@ namespace mln
inline
void take(const Image<I>& input, Accumulator<A>& a)
{
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
impl::take(exact(input), exact(a));
}
diff --git a/milena/mln/accu/transform.hh b/milena/mln/accu/transform.hh
index c7d300b..f5f9096 100644
--- a/milena/mln/accu/transform.hh
+++ b/milena/mln/accu/transform.hh
@@ -82,7 +82,7 @@ namespace mln
const W& win = exact(win_);
A a = exact(a_);
- mln_precondition(input.has_data());
+ mln_precondition(input.is_valid());
// mln_precondition(win.is_valid());
extension::adjust(input, win);
@@ -119,7 +119,7 @@ namespace mln
const W& win = exact(win_);
A a = exact(a_);
- mln_precondition(input.has_data());
+ mln_precondition(input.is_valid());
// mln_precondition(win.is_valid());
extension::adjust(input, win);
@@ -188,7 +188,7 @@ namespace mln
{
trace::entering("accu::transform");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
// mln_precondition(exact(win).is_valid());
mln_ch_value(I, mln_result(A)) output;
@@ -204,7 +204,7 @@ namespace mln
{
trace::entering("accu::transform");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
// mln_precondition(exact(win).is_valid());
typedef mln_accu_with(A, mln_value(I)) A_;
diff --git a/milena/mln/accu/transform_diagonal.hh b/milena/mln/accu/transform_diagonal.hh
index 49c2f3f..18d396b 100644
--- a/milena/mln/accu/transform_diagonal.hh
+++ b/milena/mln/accu/transform_diagonal.hh
@@ -88,7 +88,7 @@ namespace mln
const I& input = exact(input_);
const W& win = exact(win_);
- mln_precondition(input.has_data());
+ mln_precondition(input.is_valid());
mln_precondition(! win.is_empty());
// mln_precondition(! win.is_valid());
diff --git a/milena/mln/accu/transform_directional.hh b/milena/mln/accu/transform_directional.hh
index b3957f5..16f5dd0 100644
--- a/milena/mln/accu/transform_directional.hh
+++ b/milena/mln/accu/transform_directional.hh
@@ -86,7 +86,7 @@ namespace mln
const I& input = exact(input_);
const W& win = exact(win_);
- mln_precondition(input.has_data());
+ mln_precondition(input.is_valid());
mln_precondition(! win.is_empty());
// mln_precondition(! win.is_valid());
diff --git a/milena/mln/accu/transform_snake.hh b/milena/mln/accu/transform_snake.hh
index 3fb50fe..fa3da5b 100644
--- a/milena/mln/accu/transform_snake.hh
+++ b/milena/mln/accu/transform_snake.hh
@@ -81,7 +81,7 @@ namespace mln
const I& input = exact(input_);
const W& win = exact(win_);
- mln_precondition(input.has_data());
+ mln_precondition(input.is_valid());
mln_precondition(! win.is_empty());
// mln_precondition(! win.is_valid());
diff --git a/milena/mln/accu/transform_stop.hh b/milena/mln/accu/transform_stop.hh
index df61e5d..1978b32 100644
--- a/milena/mln/accu/transform_stop.hh
+++ b/milena/mln/accu/transform_stop.hh
@@ -78,7 +78,7 @@ namespace mln
const W& win = exact(win_);
A a = exact(a_);
- mln_precondition(input.has_data());
+ mln_precondition(input.is_valid());
// mln_precondition(win.is_valid());
extension::adjust(input, win);
@@ -119,7 +119,7 @@ namespace mln
const W& win = exact(win_);
A a = exact(a_);
- mln_precondition(input.has_data());
+ mln_precondition(input.is_valid());
// mln_precondition(win.is_valid());
extension::adjust(input, win);
@@ -192,7 +192,7 @@ namespace mln
{
trace::entering("accu::transform_stop");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
// mln_precondition(exact(win).is_valid());
mln_ch_value(I, mln_result(A)) output;
@@ -208,7 +208,7 @@ namespace mln
{
trace::entering("accu::transform_stop");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
// mln_precondition(exact(win).is_valid());
typedef mln_accu_with(A, mln_value(I)) A_;
diff --git a/milena/mln/arith/diff_abs.hh b/milena/mln/arith/diff_abs.hh
index 623a0b0..4636596 100644
--- a/milena/mln/arith/diff_abs.hh
+++ b/milena/mln/arith/diff_abs.hh
@@ -66,8 +66,8 @@ namespace mln
diff_abs(const Image<I>& lhs, const Image<I>& rhs)
{
trace::entering("arith::diff_abs");
- mln_precondition(exact(lhs).has_data());
- mln_precondition(exact(rhs).has_data());
+ mln_precondition(exact(lhs).is_valid());
+ mln_precondition(exact(rhs).is_valid());
mln_precondition(exact(rhs).domain() == exact(lhs).domain());
mln_concrete(I) output = level::transform(lhs, rhs, fun::vv2v::diff_abs<mln_value(I)>());
diff --git a/milena/mln/arith/minus.hh b/milena/mln/arith/minus.hh
index 5a7db44..f6fd030 100644
--- a/milena/mln/arith/minus.hh
+++ b/milena/mln/arith/minus.hh
@@ -151,7 +151,7 @@ namespace mln
* \param[in] val The value.
* \result The result image.
*
- * \pre \p input.has_data
+ * \pre \p input.is_valid
*/
template <typename I, typename V>
mln_trait_op_minus(I, V)
@@ -165,7 +165,7 @@ namespace mln
* \param[in] f Function.
* \result The result image.
*
- * \pre \p input.has_data
+ * \pre \p input.is_valid
*/
template <typename I, typename V, typename F>
mln_ch_value(I, mln_result(F))
@@ -177,7 +177,7 @@ namespace mln
* \param[in,out] input The image.
* \param[in] val The value.
*
- * \pre \p input.has_data
+ * \pre \p input.is_valid
*/
template <typename I, typename V>
I&
@@ -228,7 +228,7 @@ namespace mln
{
trace::entering("operator::minus");
- mln_precondition(exact(ima).has_data());
+ mln_precondition(exact(ima).is_valid());
mln_trait_op_minus(I,S) output = arith::minus_cst(ima, exact(s));
trace::exiting("operator::minus");
@@ -242,7 +242,7 @@ namespace mln
{
trace::entering("operator::minus_eq");
- mln_precondition(exact(ima).has_data());
+ mln_precondition(exact(ima).is_valid());
arith::minus_cst_inplace(ima, exact(s));
trace::exiting("operator::minus_eq");
@@ -391,7 +391,7 @@ namespace mln
{
trace::entering("arith::minus_cst");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
// Calls the previous version.
mln_trait_op_minus(I, V) output = minus(input,
@@ -409,7 +409,7 @@ namespace mln
{
trace::entering("arith::minus_cst");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
// Calls the previous version.
mln_ch_value(I, mln_result(F)) output = minus(input,
@@ -444,7 +444,7 @@ namespace mln
{
trace::entering("arith::minus_cst_inplace");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
// Calls the previous version.
minus_inplace(input,
diff --git a/milena/mln/arith/plus.hh b/milena/mln/arith/plus.hh
index b4f7b2f..a62522c 100644
--- a/milena/mln/arith/plus.hh
+++ b/milena/mln/arith/plus.hh
@@ -151,7 +151,7 @@ namespace mln
* \param[in] val The value.
* \result The result image.
*
- * \pre \p input.has_data
+ * \pre \p input.is_valid
*/
template <typename I, typename V>
mln_trait_op_plus(I, V)
@@ -165,7 +165,7 @@ namespace mln
* \param[in] f Function.
* \result The result image.
*
- * \pre \p input.has_data
+ * \pre \p input.is_valid
*/
template <typename I, typename V, typename F>
mln_ch_value(I, mln_result(F))
@@ -178,7 +178,7 @@ namespace mln
* \param[in] val The value.
* \result The result image.
*
- * \pre \p input.has_data
+ * \pre \p input.is_valid
*/
template <typename W, typename I, typename V>
mln_ch_value(I, W)
@@ -190,7 +190,7 @@ namespace mln
* \param[in,out] input The image.
* \param[in] val The value.
*
- * \pre \p input.has_data
+ * \pre \p input.is_valid
*/
template <typename I, typename V>
I&
@@ -243,7 +243,7 @@ namespace mln
{
trace::entering("operator::plus");
- mln_precondition(exact(ima).has_data());
+ mln_precondition(exact(ima).is_valid());
mln_trait_op_plus(I,S) output = arith::plus_cst(ima, exact(s));
@@ -258,7 +258,7 @@ namespace mln
{
trace::entering("operator::plus_eq");
- mln_precondition(exact(ima).has_data());
+ mln_precondition(exact(ima).is_valid());
arith::plus_cst_inplace(ima, exact(s));
@@ -408,7 +408,7 @@ namespace mln
{
trace::entering("arith::plus_cst");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
// Calls the previous version.
mln_trait_op_plus(I, V) output = plus(input,
@@ -426,7 +426,7 @@ namespace mln
{
trace::entering("arith::plus_cst");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
// Calls the previous version.
mln_ch_value(I, mln_result(F)) output = plus(input,
@@ -445,7 +445,7 @@ namespace mln
{
trace::entering("arith::plus_cst");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
// Calls the previous version.
mln_ch_value(I, W) output = plus_cst(input, val,
@@ -479,7 +479,7 @@ namespace mln
{
trace::entering("arith::plus_cst_inplace");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
// Calls the previous version.
plus_inplace(input,
diff --git a/milena/mln/arith/revert.hh b/milena/mln/arith/revert.hh
index ee0a386..21a3962 100644
--- a/milena/mln/arith/revert.hh
+++ b/milena/mln/arith/revert.hh
@@ -57,7 +57,7 @@ namespace mln
* \param[in] input the input image.
* \result The result image.
*
- * \pre \p input.has_data
+ * \pre \p input.is_valid
*
* It performs: \n
* for all p of input.domain \n
@@ -71,7 +71,7 @@ namespace mln
/*!
* \param[in,out] input The target image.
*
- * \pre \p input.has_data
+ * \pre \p input.is_valid
*
* It performs: \n
* for all p of input.domain \n
@@ -116,7 +116,7 @@ namespace mln
{
trace::entering("arith::revert");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
mln_concrete(I) output;
initialize(output, input);
@@ -132,7 +132,7 @@ namespace mln
{
trace::entering("arith::revert_inplace");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
impl::revert_(mln_trait_image_speed(I)(), exact(input), exact(input));
diff --git a/milena/mln/arith/times.hh b/milena/mln/arith/times.hh
index eedab41..0ac8a98 100644
--- a/milena/mln/arith/times.hh
+++ b/milena/mln/arith/times.hh
@@ -163,7 +163,7 @@ namespace mln
mln_trait_op_times(I,S)
operator*(const Image<I>& ima, const value::Scalar<S>& s)
{
- mln_precondition(exact(ima).has_data());
+ mln_precondition(exact(ima).is_valid());
mln_trait_op_times(I,S) tmp;
initialize(tmp, ima);
arith::times_cst(ima, exact(s), tmp);
@@ -175,7 +175,7 @@ namespace mln
I&
operator*=(Image<I>& ima, const value::Scalar<S>& s)
{
- mln_precondition(exact(ima).has_data());
+ mln_precondition(exact(ima).is_valid());
arith::times_cst(ima, exact(s), ima);
return exact(ima);
}
@@ -271,7 +271,7 @@ namespace mln
{
trace::entering("arith::times_cst_inplace");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
times_inplace(input, pw::cst(val) | exact(input).domain());
// Calls the previous version.
diff --git a/milena/mln/binarization/binarization.hh b/milena/mln/binarization/binarization.hh
index 0c8d2bd..a333ef2 100644
--- a/milena/mln/binarization/binarization.hh
+++ b/milena/mln/binarization/binarization.hh
@@ -85,7 +85,7 @@ namespace mln
binarization(const Image<I>& input, const Function_v2b<F>& fun)
{
trace::entering("binarization::binarization");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
mlc_is(mln_trait_value_nature(mln_value(I)),
trait::value::nature::scalar)::check();
diff --git a/milena/mln/binarization/threshold.hh b/milena/mln/binarization/threshold.hh
index 3607699..104d40e 100644
--- a/milena/mln/binarization/threshold.hh
+++ b/milena/mln/binarization/threshold.hh
@@ -67,7 +67,7 @@ namespace mln
{
trace::entering("binarization::threshold");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
mlc_is(mln_trait_value_nature(mln_value(I)),
trait::value::nature::scalar)::check();
diff --git a/milena/mln/border/adjust.hh b/milena/mln/border/adjust.hh
index aa878da..2d3b02c 100644
--- a/milena/mln/border/adjust.hh
+++ b/milena/mln/border/adjust.hh
@@ -66,7 +66,7 @@ namespace mln
{
trace::entering("border::adjust");
- mln_precondition(exact(ima).has_data());
+ mln_precondition(exact(ima).is_valid());
if (border::get(ima) < min_thickness)
border::resize(ima, min_thickness);
diff --git a/milena/mln/border/duplicate.hh b/milena/mln/border/duplicate.hh
index cb02f92..cae556d 100644
--- a/milena/mln/border/duplicate.hh
+++ b/milena/mln/border/duplicate.hh
@@ -131,7 +131,7 @@ namespace mln
{
trace::entering("border::impl::duplicate_3D");
- mln_precondition(ima.has_data());
+ mln_precondition(ima.is_valid());
typedef mln_psite(I) P;
mln_box_runstart_piter(I) pl(ima.domain());
@@ -252,7 +252,7 @@ namespace mln
void duplicate(const Image<I>& ima)
{
trace::entering("border::duplicate");
- mln_precondition(exact(ima).has_data());
+ mln_precondition(exact(ima).is_valid());
if (border::get(ima) != 0)
internal::duplicate_dispatch(ima);
diff --git a/milena/mln/border/equalize.hh b/milena/mln/border/equalize.hh
index a18112c..d80a8bd 100644
--- a/milena/mln/border/equalize.hh
+++ b/milena/mln/border/equalize.hh
@@ -121,7 +121,7 @@ namespace mln
//mlc_is(mln_trait_image_border(J), trait::image::border::some)::check();
const I& ima1 = exact(ima1_);
const J& ima2 = exact(ima2_);
- mln_precondition(ima1.has_data() && ima2.has_data());
+ mln_precondition(ima1.is_valid() && ima2.is_valid());
impl::equalize_(ima1, ima2, min_thickness);
diff --git a/milena/mln/border/fill.hh b/milena/mln/border/fill.hh
index 2b837eb..d622f3b 100644
--- a/milena/mln/border/fill.hh
+++ b/milena/mln/border/fill.hh
@@ -70,7 +70,7 @@ namespace mln
inline
void fill_tests(const Image<I>& ima, const mln_value(I)&)
{
- mln_precondition(exact(ima).has_data());
+ mln_precondition(exact(ima).is_valid());
(void) ima;
}
diff --git a/milena/mln/border/find.hh b/milena/mln/border/find.hh
index 0665e8a..24ee48a 100644
--- a/milena/mln/border/find.hh
+++ b/milena/mln/border/find.hh
@@ -98,7 +98,7 @@ namespace mln
{
trace::entering("border::find");
- mln_precondition(exact(ima).has_data());
+ mln_precondition(exact(ima).is_valid());
unsigned res = border::impl::find_(mln_trait_image_speed(I)(), exact(ima));
trace::exiting("border::find");
diff --git a/milena/mln/border/get.hh b/milena/mln/border/get.hh
index 9d752fa..c156a07 100644
--- a/milena/mln/border/get.hh
+++ b/milena/mln/border/get.hh
@@ -94,7 +94,7 @@ namespace mln
{
trace::entering("border::get");
- mln_precondition(exact(ima).has_data());
+ mln_precondition(exact(ima).is_valid());
unsigned res = border::impl::get_(mln_trait_image_ext_domain(I)(),
mln_trait_image_category(I)(),
exact(ima));
diff --git a/milena/mln/border/mirror.hh b/milena/mln/border/mirror.hh
index 130e3a6..fd203a8 100644
--- a/milena/mln/border/mirror.hh
+++ b/milena/mln/border/mirror.hh
@@ -202,7 +202,7 @@ namespace mln
const I& ima = exact(ima_);
- mln_precondition(ima.has_data());
+ mln_precondition(ima.is_valid());
mlc_is(mln_trait_image_speed(I), trait::image::speed::fastest)::check();
typedef mln_psite(I) P;
diff --git a/milena/mln/border/resize.hh b/milena/mln/border/resize.hh
index b2a2a22..fcdfad8 100644
--- a/milena/mln/border/resize.hh
+++ b/milena/mln/border/resize.hh
@@ -130,7 +130,7 @@ namespace mln
{
trace::entering("border::resize");
- mln_precondition(exact(ima).has_data());
+ mln_precondition(exact(ima).is_valid());
// Try to resize the primary image behind ima.
internal::resize_dispatch(primary(ima), thickness);
diff --git a/milena/mln/canvas/browsing/fwd.hh b/milena/mln/canvas/browsing/fwd.hh
index 79a07d5..fe98e42 100644
--- a/milena/mln/canvas/browsing/fwd.hh
+++ b/milena/mln/canvas/browsing/fwd.hh
@@ -90,7 +90,7 @@ namespace mln
fwd_t::operator()(F& f) const
{
trace::entering("canvas::browsing::fwd");
- mln_precondition(f.input.has_data());
+ mln_precondition(f.input.is_valid());
typedef typename F::I I;
mln_fwd_piter(I) p(f.input.domain());
f.init();
diff --git a/milena/mln/canvas/browsing/snake_fwd.hh b/milena/mln/canvas/browsing/snake_fwd.hh
index 04565e4..0627be1 100644
--- a/milena/mln/canvas/browsing/snake_fwd.hh
+++ b/milena/mln/canvas/browsing/snake_fwd.hh
@@ -104,7 +104,7 @@ namespace mln
// mlc_equal(mln_trait_image_dimension(I)(),
// trait::image::dimension::two_d)::check();
trace::entering("canvas::browsing::snake_fwd");
- mln_precondition(f.input.has_data());
+ mln_precondition(f.input.is_valid());
def::coord
min_row = geom::min_row(f.input), max_row = geom::max_row(f.input),
min_col = geom::min_col(f.input), max_col = geom::max_col(f.input);
diff --git a/milena/mln/canvas/browsing/snake_generic.hh b/milena/mln/canvas/browsing/snake_generic.hh
index 0bc951d..906ca5a 100644
--- a/milena/mln/canvas/browsing/snake_generic.hh
+++ b/milena/mln/canvas/browsing/snake_generic.hh
@@ -95,7 +95,7 @@ namespace mln
snake_generic_t::operator()(F& f) const
{
trace::entering("canvas::browsing::snake_generic");
- mln_precondition(f.input.has_data());
+ mln_precondition(f.input.is_valid());
// p init
f.p = f.input.bbox().pmin();// - f.dps[0];
diff --git a/milena/mln/canvas/browsing/snake_vert.hh b/milena/mln/canvas/browsing/snake_vert.hh
index 36b1ceb..ea0d20f 100644
--- a/milena/mln/canvas/browsing/snake_vert.hh
+++ b/milena/mln/canvas/browsing/snake_vert.hh
@@ -104,7 +104,7 @@ namespace mln
// mlc_equal(mln_trait_image_dimension(I)(),
// trait::image::dimension::two_d)::check();
trace::entering("canvas::browsing::snake_vert");
- mln_precondition(f.input.has_data());
+ mln_precondition(f.input.is_valid());
int
min_row = geom::min_row(f.input), max_row = geom::max_row(f.input),
min_col = geom::min_col(f.input), max_col = geom::max_col(f.input);
diff --git a/milena/mln/canvas/distance_front.hh b/milena/mln/canvas/distance_front.hh
index e0eb8a6..caefa91 100644
--- a/milena/mln/canvas/distance_front.hh
+++ b/milena/mln/canvas/distance_front.hh
@@ -74,7 +74,7 @@ namespace mln
const N& nbh = exact(nbh_);
const W& w_win = exact(w_win_);
- mln_precondition(input.has_data());
+ mln_precondition(input.is_valid());
// mln_precondition(w_win.is_valid());
typedef mln_site(I) P;
diff --git a/milena/mln/canvas/distance_geodesic.hh b/milena/mln/canvas/distance_geodesic.hh
index 8abd850..7d7362b 100644
--- a/milena/mln/canvas/distance_geodesic.hh
+++ b/milena/mln/canvas/distance_geodesic.hh
@@ -67,7 +67,7 @@ namespace mln
const I& input = exact(input_);
const N& nbh = exact(nbh_);
- mln_precondition(input.has_data());
+ mln_precondition(input.is_valid());
// mln_precondition(nbh.is_valid());
mln_ch_value(I, D) dmap; // Distance map is aux data.
diff --git a/milena/mln/canvas/labeling.hh b/milena/mln/canvas/labeling.hh
index fb539f7..e0333c6 100644
--- a/milena/mln/canvas/labeling.hh
+++ b/milena/mln/canvas/labeling.hh
@@ -69,7 +69,7 @@ namespace mln
const I& input = exact(input_);
const N& nbh = exact(nbh_);
- mln_precondition(input.has_data());
+ mln_precondition(input.is_valid());
// mln_precondition(nbh.is_valid());
(void) input;
diff --git a/milena/mln/convert/from_to.hh b/milena/mln/convert/from_to.hh
index e86e73a..e10276c 100644
--- a/milena/mln/convert/from_to.hh
+++ b/milena/mln/convert/from_to.hh
@@ -77,7 +77,7 @@ namespace mln
{
mlc_is(mln_trait_site_set_contents(S),
mln::trait::site_set::contents::dynamic)::check();
- mln_precondition(exact(from).has_data());
+ mln_precondition(exact(from).is_valid());
mln::convert::impl::from_image_to_site_set(from, to);
}
diff --git a/milena/mln/convert/to_p_set.hh b/milena/mln/convert/to_p_set.hh
index 0c08d03..db246f2 100644
--- a/milena/mln/convert/to_p_set.hh
+++ b/milena/mln/convert/to_p_set.hh
@@ -100,7 +100,7 @@ namespace mln
to_p_set(const Image<I>& ima_)
{
const I& ima = exact(ima_);
- mln_precondition(ima.has_data());
+ mln_precondition(ima.is_valid());
// FIXME: Check that ima is binary!
// mln::metal::templated_by<mln_value(I), bool >::check();
diff --git a/milena/mln/convert/to_window.hh b/milena/mln/convert/to_window.hh
index 95cdf2b..a706675 100644
--- a/milena/mln/convert/to_window.hh
+++ b/milena/mln/convert/to_window.hh
@@ -97,7 +97,7 @@ namespace mln
window<mln_site(I)::dpsite> to_window(const Image<I>& ima_)
{
const I& ima = exact(ima_);
- mln_precondition(ima.has_data());
+ mln_precondition(ima.is_valid());
// FIXME: Check that ima is binary!
typedef mln_site(I) P;
typedef mln_dpsite(P) D;
diff --git a/milena/mln/core/concept/doc/image.hh b/milena/mln/core/concept/doc/image.hh
index cc8c949..a3c7bac 100644
--- a/milena/mln/core/concept/doc/image.hh
+++ b/milena/mln/core/concept/doc/image.hh
@@ -73,7 +73,7 @@ namespace mln
/*! \brief Test if the image have been initialized.
*/
- bool has_data() const;
+ bool is_valid() const;
/*! \brief Test if the image owns the point site \p p.
*
diff --git a/milena/mln/core/concept/image.hh b/milena/mln/core/concept/image.hh
index 88a5582..3cf738c 100644
--- a/milena/mln/core/concept/image.hh
+++ b/milena/mln/core/concept/image.hh
@@ -88,7 +88,7 @@ namespace mln
bool has(const psite& p) const;
unsigned nsites() const; // If relevant.
- bool has_data() const;
+ bool is_valid() const;
// to be provided in concrete image classes:
@@ -202,7 +202,7 @@ namespace mln
// unsigned (E::*m2)() const = & E::nsites;
// m2 = 0;
- bool (E::*m3)() const = & E::has_data;
+ bool (E::*m3)() const = & E::is_valid;
m3 = 0;
// to be provided in concrete image classes:
@@ -263,7 +263,7 @@ namespace mln
metal::bool_<(mlc_pow_int(s, d) == S)>::check();
I& to = exact(to_);
- mln_precondition(! to.has_data());
+ mln_precondition(! to.is_valid());
box<P> b(all_to(0), all_to(s - 1));
to.init_(b);
diff --git a/milena/mln/core/concept/window.hh b/milena/mln/core/concept/window.hh
index 0b6ba51..158e5dd 100644
--- a/milena/mln/core/concept/window.hh
+++ b/milena/mln/core/concept/window.hh
@@ -328,7 +328,7 @@ namespace mln
I& ima = exact(ima_);
// mln_precondition(win.is_valid());
- mln_precondition(! ima.has_data());
+ mln_precondition(! ima.is_valid());
// Hack (below) to avoid circular dependency.
ima.init_(mln::internal::geom_bbox(win));
diff --git a/milena/mln/core/dpoints_pixter.hh b/milena/mln/core/dpoints_pixter.hh
index 7b570d2..1056a21 100644
--- a/milena/mln/core/dpoints_pixter.hh
+++ b/milena/mln/core/dpoints_pixter.hh
@@ -227,7 +227,7 @@ namespace mln
const Pref& p_ref)
: super_(image)
{
- mln_precondition(image.has_data());
+ mln_precondition(image.is_valid());
mlc_converts_to(Pref, const mln_psite(I)&)::check();
p_ref_ = & static_cast< const mln_psite(I)& >(p_ref);
@@ -244,7 +244,7 @@ namespace mln
: super_(internal::force_exact<Pref>(pxl_ref_).ima())
{
const Pref& pxl_ref = internal::force_exact<Pref>(pxl_ref_);
- mln_precondition(pxl_ref.ima().has_data());
+ mln_precondition(pxl_ref.ima().is_valid());
p_ref_ = 0;
// Potential promotion from (T**) to (const T**) shall be forced.
value_ref_ = const_cast<mln_qlf_value(I)**>(pxl_ref.address_());
@@ -341,7 +341,7 @@ namespace mln
const Pref& p_ref)
: super_(image)
{
- mln_precondition(image.has_data());
+ mln_precondition(image.is_valid());
internal::get_adr(p_ref_, p_ref);
value_ref_ = 0;
init_(dps);
@@ -355,7 +355,7 @@ namespace mln
: super_(internal::force_exact<Pref>(pxl_ref_).ima())
{
const Pref& pxl_ref = internal::force_exact<Pref>(pxl_ref_);
- mln_precondition(pxl_ref.ima().has_data());
+ mln_precondition(pxl_ref.ima().is_valid());
p_ref_ = 0;
// Potential promotion from (T**) to (const T**) shall be forced.
value_ref_ = const_cast<mln_qlf_value(I)**>(pxl_ref.address_());
diff --git a/milena/mln/core/image/bgraph_image.hh b/milena/mln/core/image/bgraph_image.hh
index c0a71e1..a59c1de 100644
--- a/milena/mln/core/image/bgraph_image.hh
+++ b/milena/mln/core/image/bgraph_image.hh
@@ -259,7 +259,7 @@ namespace mln
const p_bgraph<P>&
bgraph_image<P, V>::domain() const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return this->data_->pg_;
}
diff --git a/milena/mln/core/image/cast_image.hh b/milena/mln/core/image/cast_image.hh
index 1d3dbfc..91e5339 100644
--- a/milena/mln/core/image/cast_image.hh
+++ b/milena/mln/core/image/cast_image.hh
@@ -150,7 +150,7 @@ namespace mln
cast_image_<T,I>
cast_image(const Image<I>& ima)
{
- mln_precondition(exact(ima).has_data());
+ mln_precondition(exact(ima).is_valid());
cast_image_<T,I> tmp(ima);
return tmp;
}
@@ -179,7 +179,7 @@ namespace mln
inline
cast_image_<T,I>::cast_image_(const Image<I>& ima)
{
- mln_precondition(exact(ima).has_data());
+ mln_precondition(exact(ima).is_valid());
this->data_ = new internal::data< cast_image_<T,I> >(exact(ima));
}
@@ -188,7 +188,7 @@ namespace mln
void
cast_image_<T,I>::init_(const Image<I>& ima)
{
- mln_precondition(exact(ima).has_data());
+ mln_precondition(exact(ima).is_valid());
this->data_ = new internal::data<cast_image_<T,I> >(exact(ima));
}
diff --git a/milena/mln/core/image/ch_piter.hh b/milena/mln/core/image/ch_piter.hh
index bf498cf..10787fa 100644
--- a/milena/mln/core/image/ch_piter.hh
+++ b/milena/mln/core/image/ch_piter.hh
@@ -134,7 +134,7 @@ namespace mln
inline
ch_piter_image<I,Fwd>::ch_piter_image(I& ima)
{
- mln_precondition(ima.has_data());
+ mln_precondition(ima.is_valid());
init_(ima);
}
@@ -143,7 +143,7 @@ namespace mln
void
ch_piter_image<I,Fwd>::init_(I& ima)
{
- mln_precondition(ima.has_data());
+ mln_precondition(ima.is_valid());
this->data_ = new internal::data< ch_piter_image<I,Fwd> >(ima);
}
diff --git a/milena/mln/core/image/complex_image.hh b/milena/mln/core/image/complex_image.hh
index 0e98c4e..b5303a4 100644
--- a/milena/mln/core/image/complex_image.hh
+++ b/milena/mln/core/image/complex_image.hh
@@ -260,7 +260,7 @@ namespace mln
complex_image<D, G, V>::init_(const p_complex<D, G>& pc,
const metal::vec< D + 1, std::vector<V> >& values)
{
- mln_precondition(! this->has_data());
+ mln_precondition(! this->is_valid());
this->data_ =
new internal::data< complex_image<D, G, V> >(pc, values);
}
@@ -300,7 +300,7 @@ namespace mln
const p_complex<D, G>&
complex_image<D, G, V>::domain() const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return this->data_->pc_;
}
diff --git a/milena/mln/core/image/decorated_image.hh b/milena/mln/core/image/decorated_image.hh
index 0ef3c28..f97eceb 100644
--- a/milena/mln/core/image/decorated_image.hh
+++ b/milena/mln/core/image/decorated_image.hh
@@ -169,7 +169,7 @@ namespace mln
inline
decorated_image<I,D>::decorated_image(I& ima, const D& deco)
{
- mln_precondition(exact(ima).has_data());
+ mln_precondition(exact(ima).is_valid());
this->data_ = new internal::data< decorated_image<I,D> >(ima, deco);
}
@@ -178,7 +178,7 @@ namespace mln
void
decorated_image<I,D>::init_(I& ima, const D& deco)
{
- mln_precondition(exact(ima).has_data());
+ mln_precondition(exact(ima).is_valid());
this->data_ = new internal::data<decorated_image<I,D> >(ima, deco);
}
diff --git a/milena/mln/core/image/extended.hh b/milena/mln/core/image/extended.hh
index bd5f142..c6451a0 100644
--- a/milena/mln/core/image/extended.hh
+++ b/milena/mln/core/image/extended.hh
@@ -179,7 +179,7 @@ namespace mln
void
extended<I>::init_(I& ima, const box<mln_site(I)>& b)
{
- mln_precondition(! this->has_data());
+ mln_precondition(! this->is_valid());
this->data_ = new internal::data< extended<I> >(ima, b);
}
@@ -200,7 +200,7 @@ namespace mln
{
mlc_not_equal(mln_trait_image_ext_domain(I),
trait::image::ext_domain::none)::check();
- mln_precondition(exact(ima).has_data());
+ mln_precondition(exact(ima).is_valid());
extended<const I> tmp(exact(ima), exact(b));
return tmp;
}
@@ -211,7 +211,7 @@ namespace mln
{
mlc_not_equal(mln_trait_image_ext_domain(I),
trait::image::ext_domain::none)::check();
- mln_precondition(exact(ima).has_data());
+ mln_precondition(exact(ima).is_valid());
extended<I> tmp(exact(ima), exact(b));
return tmp;
}
diff --git a/milena/mln/core/image/extension_fun.hh b/milena/mln/core/image/extension_fun.hh
index 202a256..c140283 100644
--- a/milena/mln/core/image/extension_fun.hh
+++ b/milena/mln/core/image/extension_fun.hh
@@ -209,7 +209,7 @@ namespace mln
mln_value(I)
extension_fun<I, F>::operator()(const mln_psite(I)& p) const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
// if-else is preferred to the ternary op to allow for the
// function result to convert towards the expected return type.
if (this->data_->ima_.domain().has(p))
@@ -224,7 +224,7 @@ namespace mln
extension_fun<I, F>::operator()(const mln_psite(I)& p)
{
static mln_value(I) cpy;
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
// See the above comment about if-else v. ternary.
if (this->data_->ima_.domain().has(p))
return this->data_->ima_(p);
@@ -243,7 +243,7 @@ namespace mln
const F&
extension_fun<I, F>::extension() const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return this->data_->fun_;
}
diff --git a/milena/mln/core/image/extension_ima.hh b/milena/mln/core/image/extension_ima.hh
index c092187..bb11b8a 100644
--- a/milena/mln/core/image/extension_ima.hh
+++ b/milena/mln/core/image/extension_ima.hh
@@ -210,8 +210,8 @@ namespace mln
bool
extension_ima<I, J>::has(const P& p) const
{
- mln_precondition(this->has_data());
- mln_precondition(this->data_->ext_.has_data());
+ mln_precondition(this->is_valid());
+ mln_precondition(this->data_->ext_.is_valid());
return
this->data_->ima_.domain().has(p)
|| this->data_->ext_.has(p);
@@ -222,7 +222,7 @@ namespace mln
mln_value(I)
extension_ima<I, J>::operator()(const mln_psite(I)& p) const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
mln_precondition(has(p));
// if-else is preferred to the ternary op to allow for the
// function result to convert towards the expected return type.
@@ -238,7 +238,7 @@ namespace mln
extension_ima<I, J>::operator()(const mln_psite(I)& p)
{
static mln_value(I) cpy;
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
mln_precondition(has(p));
// See the above comment about if-else v. ternary.
if (this->data_->ima_.domain().has(p))
@@ -258,7 +258,7 @@ namespace mln
mlc_const(J)&
extension_ima<I, J>::extension() const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return this->data_->ext_;
}
@@ -267,7 +267,7 @@ namespace mln
J&
extension_ima<I, J>::extension()
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return this->data_->ext_;
}
diff --git a/milena/mln/core/image/extension_val.hh b/milena/mln/core/image/extension_val.hh
index 3605df6..63dbeb7 100644
--- a/milena/mln/core/image/extension_val.hh
+++ b/milena/mln/core/image/extension_val.hh
@@ -204,7 +204,7 @@ namespace mln
mln_value(I)
extension_val<I>::operator()(const mln_psite(I)& p) const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
// if-else is preferred to the ternary op to allow conversions.
if (this->data_->ima_.domain().has(p))
return this->data_->ima_(p);
@@ -218,7 +218,7 @@ namespace mln
extension_val<I>::operator()(const mln_psite(I)& p)
{
static mln_value(I) cpy;
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
// See the above comment about if-else v. ternary.
if (this->data_->ima_.domain().has(p))
return this->data_->ima_(p);
@@ -235,7 +235,7 @@ namespace mln
const mln_value(I)&
extension_val<I>::extension() const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return this->data_->val_;
}
@@ -244,7 +244,7 @@ namespace mln
void
extension_val<I>::change_extension(const mln_value(I)& val)
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
this->data_->val_ = val;
}
diff --git a/milena/mln/core/image/flat_image.hh b/milena/mln/core/image/flat_image.hh
index 77f7f4b..3cff361 100644
--- a/milena/mln/core/image/flat_image.hh
+++ b/milena/mln/core/image/flat_image.hh
@@ -207,7 +207,7 @@ namespace mln
void
flat_image<T,S>::init_(const T& val, const S& pset)
{
- mln_precondition(! this->has_data());
+ mln_precondition(! this->is_valid());
this->data_ = new internal::data< flat_image<T,S> >(val, pset);
}
@@ -232,7 +232,7 @@ namespace mln
const T&
flat_image<T,S>::operator()(const mln_psite(S)&) const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return this->data_->val_;
}
@@ -241,7 +241,7 @@ namespace mln
const T&
flat_image<T,S>::operator()(const mln_psite(S)&)
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return this->data_->val_;
}
@@ -250,7 +250,7 @@ namespace mln
void
flat_image<T,S>::change_value(const T& old_val, const T& new_val)
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
mln_precondition(old_val == this->data_->val_);
this->data_->val_ = new_val;
@@ -263,7 +263,7 @@ namespace mln
const T&
flat_image<T,S>::val() const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return this->data_->val_;
}
@@ -272,7 +272,7 @@ namespace mln
T&
flat_image<T,S>::val()
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return this->data_->val_;
}
diff --git a/milena/mln/core/image/fun_image.hh b/milena/mln/core/image/fun_image.hh
index f338d08..acf2716 100644
--- a/milena/mln/core/image/fun_image.hh
+++ b/milena/mln/core/image/fun_image.hh
@@ -147,7 +147,7 @@ namespace mln
inline
fun_image<F,I>::fun_image(Image<I>& ima)
{
- mln_precondition(exact(ima).has_data());
+ mln_precondition(exact(ima).is_valid());
this->data_ = new internal::data< fun_image<F,I> >(exact(ima));
}
@@ -157,7 +157,7 @@ namespace mln
void
fun_image<F,I>::init_(Image<I>& ima)
{
- mln_precondition(exact(ima).has_data());
+ mln_precondition(exact(ima).is_valid());
this->data_ = new internal::data<fun_image<F,I> >(exact(ima));
}
diff --git a/milena/mln/core/image/hexa.hh b/milena/mln/core/image/hexa.hh
index 433907b..66ccdb1 100644
--- a/milena/mln/core/image/hexa.hh
+++ b/milena/mln/core/image/hexa.hh
@@ -205,7 +205,7 @@ namespace mln
void
hexa<I>::init_(I& ima)
{
- mln_precondition(! this->has_data());
+ mln_precondition(! this->is_valid());
box2d b_in = ima.bbox();
box2d_h b = make::box2d_h(b_in.pmin()[0] * 2, b_in.pmin()[1],
b_in.pmax()[0] * 2, (b_in.pmax()[1] + 1) * 2 - 1);
@@ -232,7 +232,7 @@ namespace mln
typename hexa<I>::rvalue
hexa<I>::operator()(const point2d_h& p) const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
mln_precondition(this->has(p));
return this->data_->ima_(point2d(p[0] / 2, p[1] / 2));
}
@@ -242,7 +242,7 @@ namespace mln
typename hexa<I>::lvalue
hexa<I>::operator()(const point2d_h& p)
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
mln_precondition(this->has(p));
return this->data_->ima_(point2d(p[0] / 2, p[1] / 2));
}
@@ -252,7 +252,7 @@ namespace mln
const box2d_h&
hexa<I>::domain() const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return this->data_->b_;
}
@@ -261,7 +261,7 @@ namespace mln
bool
hexa<I>::has(const psite& p) const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return this->data_->ima_.has(point2d(p[0] / 2, p[1] / 2));
}
diff --git a/milena/mln/core/image/image1d.hh b/milena/mln/core/image/image1d.hh
index 28c8953..d86bc53 100644
--- a/milena/mln/core/image/image1d.hh
+++ b/milena/mln/core/image/image1d.hh
@@ -356,7 +356,7 @@ namespace mln
void
image1d<T>::init_(const box1d& b, unsigned bdr)
{
- mln_precondition(! this->has_data());
+ mln_precondition(! this->is_valid());
this->data_ = new internal::data< image1d<T> >(b, bdr);
}
@@ -365,7 +365,7 @@ namespace mln
const box1d&
image1d<T>::domain() const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return this->data_->b_;
}
@@ -374,7 +374,7 @@ namespace mln
const box1d&
image1d<T>::bbox() const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return this->data_->b_;
}
@@ -383,7 +383,7 @@ namespace mln
unsigned
image1d<T>::border() const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return this->data_->bdr_;
}
@@ -392,7 +392,7 @@ namespace mln
unsigned
image1d<T>::nelements() const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return this->data_->vb_.nsites();
}
@@ -401,7 +401,7 @@ namespace mln
bool
image1d<T>::has(const point1d& p) const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return this->data_->vb_.has(p);
}
@@ -465,7 +465,7 @@ namespace mln
const T*
image1d<T>::buffer() const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return this->data_->buffer_;
}
@@ -474,7 +474,7 @@ namespace mln
T*
image1d<T>::buffer()
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return this->data_->buffer_;
}
@@ -483,7 +483,7 @@ namespace mln
int
image1d<T>::delta_index(const dpoint1d& dp) const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
int o = dp[0];
return o;
}
diff --git a/milena/mln/core/image/image2d.hh b/milena/mln/core/image/image2d.hh
index a9b8df6..3146b14 100644
--- a/milena/mln/core/image/image2d.hh
+++ b/milena/mln/core/image/image2d.hh
@@ -408,7 +408,7 @@ namespace mln
void
image2d<T>::init_(const box2d& b, unsigned bdr)
{
- mln_precondition(! this->has_data());
+ mln_precondition(! this->is_valid());
this->data_ = new internal::data< image2d<T> >(b, bdr);
}
@@ -417,7 +417,7 @@ namespace mln
const box2d&
image2d<T>::domain() const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return this->data_->b_;
}
@@ -426,7 +426,7 @@ namespace mln
const box2d&
image2d<T>::bbox() const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return this->data_->b_;
}
@@ -435,7 +435,7 @@ namespace mln
bool
image2d<T>::has(const point2d& p) const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return this->data_->vb_.has(p);
}
@@ -483,7 +483,7 @@ namespace mln
unsigned
image2d<T>::nrows() const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return this->data_->b_.len(0);
}
@@ -492,7 +492,7 @@ namespace mln
unsigned
image2d<T>::ncols() const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return this->data_->b_.len(1);
}
@@ -504,7 +504,7 @@ namespace mln
unsigned
image2d<T>::border() const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return this->data_->bdr_;
}
@@ -513,7 +513,7 @@ namespace mln
unsigned
image2d<T>::nelements() const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return this->data_->vb_.nsites();
}
@@ -540,7 +540,7 @@ namespace mln
const T*
image2d<T>::buffer() const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return this->data_->buffer_;
}
@@ -549,7 +549,7 @@ namespace mln
T*
image2d<T>::buffer()
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return this->data_->buffer_;
}
@@ -558,7 +558,7 @@ namespace mln
int
image2d<T>::delta_index(const dpoint2d& dp) const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
int o = dp[0] * this->data_->vb_.len(1) + dp[1];
return o;
}
@@ -584,7 +584,7 @@ namespace mln
void
image2d<T>::resize_(unsigned new_border)
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
this->data_->reallocate_(new_border);
}
diff --git a/milena/mln/core/image/image3d.hh b/milena/mln/core/image/image3d.hh
index eebe251..839f8d4 100644
--- a/milena/mln/core/image/image3d.hh
+++ b/milena/mln/core/image/image3d.hh
@@ -396,7 +396,7 @@ namespace mln
void
image3d<T>::init_(const box3d& b, unsigned bdr)
{
- mln_precondition(! this->has_data());
+ mln_precondition(! this->is_valid());
this->data_ = new internal::data< image3d<T> >(b, bdr);
}
@@ -405,7 +405,7 @@ namespace mln
const box3d&
image3d<T>::domain() const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return data_->b_;
}
@@ -414,7 +414,7 @@ namespace mln
const box3d&
image3d<T>::bbox() const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return data_->b_;
}
@@ -423,7 +423,7 @@ namespace mln
unsigned
image3d<T>::border() const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return data_->bdr_;
}
@@ -432,7 +432,7 @@ namespace mln
unsigned
image3d<T>::nelements() const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return data_->vb_.nsites();
}
@@ -441,7 +441,7 @@ namespace mln
bool
image3d<T>::has(const point3d& p) const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return data_->vb_.has(p);
}
@@ -504,7 +504,7 @@ namespace mln
const T*
image3d<T>::buffer() const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return data_->buffer_;
}
@@ -513,7 +513,7 @@ namespace mln
T*
image3d<T>::buffer()
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return data_->buffer_;
}
@@ -522,7 +522,7 @@ namespace mln
int
image3d<T>::delta_index(const dpoint3d& dp) const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
int o = dp[0];
return o;
}
diff --git a/milena/mln/core/image/image_if.hh b/milena/mln/core/image/image_if.hh
index ce07f35..a867c3d 100644
--- a/milena/mln/core/image/image_if.hh
+++ b/milena/mln/core/image/image_if.hh
@@ -199,7 +199,7 @@ namespace mln
void
image_if<I,F>::init_(I& ima, const F& f)
{
- mln_precondition(! this->has_data());
+ mln_precondition(! this->is_valid());
this->data_ = new internal::data< image_if<I,F> >(ima, f);
}
@@ -208,7 +208,7 @@ namespace mln
const p_if<mln_pset(I), F>&
image_if<I,F>::domain() const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return this->data_->pset_;
}
@@ -216,7 +216,7 @@ namespace mln
inline
image_if<I,F>::operator image_if<const I,F>() const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
image_if<const I,F> tmp(this->data_->ima_,
this->data_->pset_.predicate());
return tmp;
diff --git a/milena/mln/core/image/interpolated.hh b/milena/mln/core/image/interpolated.hh
index 1d6dff1..5b37eb5 100644
--- a/milena/mln/core/image/interpolated.hh
+++ b/milena/mln/core/image/interpolated.hh
@@ -113,7 +113,7 @@ namespace mln
/// Test if this image has been initialized.
- bool has_data() const;
+ bool is_valid() const;
/// Test if a pixel value is accessible at \p p.
using super_::has;
@@ -154,7 +154,7 @@ namespace mln
interpolated<I,F>::interpolated(I& ima)
: fun_(ima)
{
- mln_precondition(ima.has_data());
+ mln_precondition(ima.is_valid());
init_(ima);
}
@@ -169,15 +169,15 @@ namespace mln
void
interpolated<I, F >::init_(I& ima)
{
- mln_precondition(ima.has_data());
+ mln_precondition(ima.is_valid());
this->data_ = new internal::data< interpolated<I,F> >(ima);
}
template <typename I, template <class> class F>
inline
- bool interpolated<I,F>::has_data() const
+ bool interpolated<I,F>::is_valid() const
{
- mln_invariant(this->data_->ima_.has_data());
+ mln_invariant(this->data_->ima_.is_valid());
return true;
}
diff --git a/milena/mln/core/image/lazy_image.hh b/milena/mln/core/image/lazy_image.hh
index 965b15f..0c6aa5f 100644
--- a/milena/mln/core/image/lazy_image.hh
+++ b/milena/mln/core/image/lazy_image.hh
@@ -108,7 +108,7 @@ namespace mln
typedef lazy_image< tag::image_<I>, F, B > skeleton;
/// Test if a pixel value is accessible at \p p.
- using super_::has_data;
+ using super_::is_valid;
/// Constructors.
lazy_image();
diff --git a/milena/mln/core/image/mono_obased_rle_image.hh b/milena/mln/core/image/mono_obased_rle_image.hh
index 7fcb95c..caad8ed 100644
--- a/milena/mln/core/image/mono_obased_rle_image.hh
+++ b/milena/mln/core/image/mono_obased_rle_image.hh
@@ -138,7 +138,7 @@ namespace mln
T& operator()(const mln_psite(pset)& site);
/// Test if this image has been initialized.
- bool has_data() const;
+ bool is_valid() const;
/// Give the definition domain.
const pset& domain() const;
@@ -202,7 +202,7 @@ namespace mln
template <typename P, typename T>
inline
bool
- mono_obased_rle_image<P, T>::has_data() const
+ mono_obased_rle_image<P, T>::is_valid() const
{
return this->data_->ima_.size() != 0;
}
diff --git a/milena/mln/core/image/mono_rle_image.hh b/milena/mln/core/image/mono_rle_image.hh
index 0a0f491..d322948 100644
--- a/milena/mln/core/image/mono_rle_image.hh
+++ b/milena/mln/core/image/mono_rle_image.hh
@@ -137,7 +137,7 @@ namespace mln
lvalue operator() (const mln_psite(pset)& site);
/// Test if this image has been initialized.
- bool has_data() const;
+ bool is_valid() const;
/// Give the uniq value of the image.
rvalue get_value() const;
@@ -198,7 +198,7 @@ namespace mln
template <typename P, typename T>
inline
bool
- mono_rle_image<P, T>::has_data() const
+ mono_rle_image<P, T>::is_valid() const
{
return true;
}
diff --git a/milena/mln/core/image/obased_rle_image.hh b/milena/mln/core/image/obased_rle_image.hh
index 624c181..43868cd 100644
--- a/milena/mln/core/image/obased_rle_image.hh
+++ b/milena/mln/core/image/obased_rle_image.hh
@@ -143,7 +143,7 @@ namespace mln
lvalue operator() (const mln_psite(pset)& site);
/// Test if this image has been initialized.
- bool has_data() const;
+ bool is_valid() const;
/// Give the definition domain.
const pset& domain() const;
@@ -212,7 +212,7 @@ namespace mln
template <typename P, typename T>
inline
bool
- obased_rle_image<P, T>::has_data() const
+ obased_rle_image<P, T>::is_valid() const
{
return this->data_->values_.size() != 0;
}
diff --git a/milena/mln/core/image/plain.hh b/milena/mln/core/image/plain.hh
index 5d39ce0..cd184ba 100644
--- a/milena/mln/core/image/plain.hh
+++ b/milena/mln/core/image/plain.hh
@@ -146,7 +146,7 @@ namespace mln
plain<I>::plain(const plain<I>& rhs)
: super_()
{
- mln_precondition(rhs.has_data());
+ mln_precondition(rhs.is_valid());
init_(rhs.data_->ima_);
}
@@ -154,7 +154,7 @@ namespace mln
inline
plain<I>::plain(const I& ima)
{
- mln_precondition(ima.has_data());
+ mln_precondition(ima.is_valid());
init_(ima);
}
@@ -163,7 +163,7 @@ namespace mln
void
plain<I>::init_(const I& ima)
{
- mln_precondition(ima.has_data());
+ mln_precondition(ima.is_valid());
this->data_ = new internal::data< plain<I> >(ima);
}
@@ -172,7 +172,7 @@ namespace mln
plain<I>&
plain<I>::operator=(const plain<I>& rhs)
{
- mln_precondition(rhs.has_data());
+ mln_precondition(rhs.is_valid());
if (&rhs == this)
return *this;
this->destroy();
@@ -185,7 +185,7 @@ namespace mln
plain<I>&
plain<I>::operator=(const I& ima)
{
- mln_precondition(ima.has_data());
+ mln_precondition(ima.is_valid());
this->destroy();
init_(ima);
return *this;
@@ -195,7 +195,7 @@ namespace mln
inline
plain<I>::operator I () const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return duplicate(this->data_->ima_);
}
diff --git a/milena/mln/core/image/rle_image.hh b/milena/mln/core/image/rle_image.hh
index 91a4b66..8c5e21d 100644
--- a/milena/mln/core/image/rle_image.hh
+++ b/milena/mln/core/image/rle_image.hh
@@ -129,7 +129,7 @@ namespace mln
lvalue operator() (const mln_psite(pset)& site);
/// Test if this image has been initialized.
- bool has_data() const;
+ bool is_valid() const;
/// Give the definition domain.
const pset& domain() const;
@@ -178,7 +178,7 @@ namespace mln
template <typename P, typename T>
inline
bool
- rle_image<P, T>::has_data() const
+ rle_image<P, T>::is_valid() const
{
return this->data_->values_.size() != 0;
}
@@ -188,7 +188,7 @@ namespace mln
void
rle_image<P, T>::insert(const p_run<P>& pr, T value)
{
- if (!this->has_data())
+ if (!this->is_valid())
this->data_ = new internal::data< rle_image<P,T> >();
mln_assertion(this->data_->values_.size() == 0 ||
pr[0] > this->data_->domain_[this->data_->domain_.nsites() - 1].start());
diff --git a/milena/mln/core/image/safe.hh b/milena/mln/core/image/safe.hh
index 92815e2..69fd854 100644
--- a/milena/mln/core/image/safe.hh
+++ b/milena/mln/core/image/safe.hh
@@ -145,7 +145,7 @@ namespace mln
inline
safe_image<I>::safe_image(I& ima, const mln_value(I)& default_value)
{
- mln_precondition(ima.has_data());
+ mln_precondition(ima.is_valid());
init_(ima, default_value);
}
@@ -153,7 +153,7 @@ namespace mln
inline
safe_image<I>::safe_image(I& ima)
{
- mln_precondition(ima.has_data());
+ mln_precondition(ima.is_valid());
init_(ima, mln_value(I)());
}
@@ -162,8 +162,8 @@ namespace mln
void
safe_image<I>::init_(I& ima, const mln_value(I)& default_value)
{
- mln_precondition(! this->has_data());
- mln_precondition(ima.has_data());
+ mln_precondition(! this->is_valid());
+ mln_precondition(ima.is_valid());
this->data_ = new internal::data< safe_image<I> >(ima, default_value);
}
@@ -172,7 +172,7 @@ namespace mln
mln_rvalue(I)
safe_image<I>::operator()(const mln_psite(I)& p) const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
if (! this->has(p))
return this->data_->default_value_;
return this->data_->ima_(p);
@@ -183,7 +183,7 @@ namespace mln
mln_morpher_lvalue(I)
safe_image<I>::operator()(const mln_psite(I)& p)
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
static mln_value(I) forget_it_;
if (this->has(p))
return this->data_->ima_(p);
diff --git a/milena/mln/core/image/sparse_image.hh b/milena/mln/core/image/sparse_image.hh
index e38529e..02da185 100644
--- a/milena/mln/core/image/sparse_image.hh
+++ b/milena/mln/core/image/sparse_image.hh
@@ -212,7 +212,7 @@ namespace mln
sparse_image<P,T>::insert(const p_run<P>& r, const std::vector<T>& vals)
{
mln_precondition(r.nsites() == vals.size());
- if (! this->has_data())
+ if (! this->is_valid())
this->data_ = new internal::data< sparse_image<P,T> >();
this->data_->domain_.insert(r);
this->data_->values_.push_back(vals);
@@ -223,7 +223,7 @@ namespace mln
bool
sparse_image<P,T>::has(const psite& p) const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return this->data_->domain_.has(p);
}
@@ -250,7 +250,7 @@ namespace mln
const p_set_of< p_run<P> >&
sparse_image<P,T>::domain() const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return this->data_->domain_;
}
diff --git a/milena/mln/core/image/sub_image.hh b/milena/mln/core/image/sub_image.hh
index 507983c..025d9d9 100644
--- a/milena/mln/core/image/sub_image.hh
+++ b/milena/mln/core/image/sub_image.hh
@@ -195,7 +195,7 @@ namespace mln
void
sub_image<I,S>::init_(I& ima, const S& pset)
{
- mln_precondition(! this->has_data());
+ mln_precondition(! this->is_valid());
this->data_ = new internal::data< sub_image<I,S> >(ima, pset);
}
diff --git a/milena/mln/core/image/sub_image_if.hh b/milena/mln/core/image/sub_image_if.hh
index 4de0425..773e268 100644
--- a/milena/mln/core/image/sub_image_if.hh
+++ b/milena/mln/core/image/sub_image_if.hh
@@ -194,7 +194,7 @@ namespace mln
void
sub_image_if<I,S>::init_(I& ima, const S& s)
{
- mln_precondition(! this->has_data());
+ mln_precondition(! this->is_valid());
this->data_ = new internal::data< sub_image_if<I,S> >(ima, s);
}
diff --git a/milena/mln/core/image/t_image.hh b/milena/mln/core/image/t_image.hh
index 75b03fd..7fcc449 100644
--- a/milena/mln/core/image/t_image.hh
+++ b/milena/mln/core/image/t_image.hh
@@ -125,7 +125,7 @@ namespace mln
/// Test if this image has been initialized.
- bool has_data() const;
+ bool is_valid() const;
/// Test if a pixel value is accessible at \p p.
bool has(const mln_psite(I)& p) const;
@@ -195,7 +195,7 @@ namespace mln
void
t_image<I>::init_(I& ima, unsigned dim1, unsigned dim2)
{
- mln_precondition(ima.has_data());
+ mln_precondition(ima.is_valid());
/* FIXME: Add a precondition on the fact that the domain of ima is
a box. */
// We don't use mln::t_image::transpose here, since one its
@@ -209,9 +209,9 @@ namespace mln
template <typename I>
inline
- bool t_image<I>::has_data() const
+ bool t_image<I>::is_valid() const
{
- mln_invariant(this->delegatee_()->has_data());
+ mln_invariant(this->delegatee_()->is_valid());
return true;
}
@@ -220,7 +220,7 @@ namespace mln
bool
t_image<I>::has(const mln_psite(I)& p) const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return this->delegatee_()->has(transpose_(p));
}
@@ -229,7 +229,7 @@ namespace mln
mln_psite(I)
t_image<I>::transpose_(const mln_psite(I)& p) const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return exchange_coords_(p, this->data_->dim1_, this->data_->dim2_);
}
@@ -250,7 +250,7 @@ namespace mln
const box<mln_psite(I)>&
t_image<I>::domain() const
{
- mln_precondition(this->has_data());
+ mln_precondition(this->is_valid());
return this->data_->box_;
}
diff --git a/milena/mln/core/image/tr_image.hh b/milena/mln/core/image/tr_image.hh
index 6459750..2ace346 100644
--- a/milena/mln/core/image/tr_image.hh
+++ b/milena/mln/core/image/tr_image.hh
@@ -121,7 +121,7 @@ namespace mln
void init_(const S& s, I& ima, const T& tr);
/// Test if this image has been initialized.
- bool has_data() const;
+ bool is_valid() const;
/// Test if a pixel value is accessible at \p p.
using super_::has;
@@ -171,16 +171,16 @@ namespace mln
void
tr_image<S,I,T>::init_(const S& s, I& ima, const T& tr)
{
- mln_precondition(ima.has_data());
+ mln_precondition(ima.is_valid());
this->data_ = new internal::data< tr_image<S,I,T> >(s, ima, tr);
}
template <typename S, typename I, typename T>
inline
bool
- tr_image<S,I,T>::has_data() const
+ tr_image<S,I,T>::is_valid() const
{
- mln_invariant(this->delegatee_()->has_data());
+ mln_invariant(this->delegatee_()->is_valid());
return true;
}
diff --git a/milena/mln/core/image/value_enc_image.hh b/milena/mln/core/image/value_enc_image.hh
index d0a5a54..205e28d 100644
--- a/milena/mln/core/image/value_enc_image.hh
+++ b/milena/mln/core/image/value_enc_image.hh
@@ -134,7 +134,7 @@ namespace mln
lvalue operator() (const psite& site);
/// Test if this image has been initialized.
- bool has_data() const;
+ bool is_valid() const;
/// Give the definition domain.
const pset& domain() const;
@@ -167,7 +167,7 @@ namespace mln
template <typename P, typename T>
inline
bool
- value_enc_image<P, T>::has_data() const
+ value_enc_image<P, T>::is_valid() const
{
return this->data_->values_.size() != 0;
}
@@ -177,7 +177,7 @@ namespace mln
void
value_enc_image<P, T>::insert(const p_set_of<p_run<P> >& ps, T value)
{
- if (!this->has_data())
+ if (!this->is_valid())
this->data_ = new internal::data< value_enc_image<P,T> >();
this->data_->domain_.insert(ps);
diff --git a/milena/mln/core/image/violent_cast_image.hh b/milena/mln/core/image/violent_cast_image.hh
index a992a36..b9808f0 100644
--- a/milena/mln/core/image/violent_cast_image.hh
+++ b/milena/mln/core/image/violent_cast_image.hh
@@ -145,7 +145,7 @@ namespace mln
violent_cast_image<T,I>
violent_cast_image_(const Image<I>& ima)
{
- mln_precondition(exact(ima).has_data());
+ mln_precondition(exact(ima).is_valid());
violent_cast_image<T,I> tmp(ima);
return tmp;
}
@@ -175,7 +175,7 @@ namespace mln
violent_cast_image<T,I>::violent_cast_image(const Image<I>& ima)
{
metal::bool_<sizeof(T) == sizeof(typename I::value)>::check();
- mln_precondition(exact(ima).has_data());
+ mln_precondition(exact(ima).is_valid());
this->data_ = new internal::data< violent_cast_image<T,I> >(exact(ima));
}
@@ -184,7 +184,7 @@ namespace mln
void
violent_cast_image<T,I>::init_(const Image<I>& ima)
{
- mln_precondition(exact(ima).has_data());
+ mln_precondition(exact(ima).is_valid());
this->data_ = new internal::data<violent_cast_image<T,I> >(exact(ima));
}
diff --git a/milena/mln/core/internal/check/image_fastest.hh b/milena/mln/core/internal/check/image_fastest.hh
index f225c1e..d668575 100644
--- a/milena/mln/core/internal/check/image_fastest.hh
+++ b/milena/mln/core/internal/check/image_fastest.hh
@@ -134,7 +134,7 @@ namespace mln
image_fastest_<E,B>::index_of_point(const P& p) const
{
const E* this_ = & internal::force_exact<E>(*this);
- mln_precondition(this_->has_data());
+ mln_precondition(this_->is_valid());
mln_precondition(this_->has(p));
unsigned i = & this_->operator()(p) - this_->buffer();
diff --git a/milena/mln/core/internal/image_base.hh b/milena/mln/core/internal/image_base.hh
index d940291..74be188 100644
--- a/milena/mln/core/internal/image_base.hh
+++ b/milena/mln/core/internal/image_base.hh
@@ -131,7 +131,7 @@ namespace mln
std::size_t nsites() const;
/// Test if this image has been initialized; default impl.
- bool has_data() const;
+ bool is_valid() const;
// FIXME: Add void init_data(..);
@@ -178,7 +178,7 @@ namespace mln
image_base<T, S, E>::image_base(const image_base& rhs)
: image_checked_<E>()
{
- mln_precondition(exact(rhs).has_data()); // FIXME: Is-it too restrictive?
+ mln_precondition(exact(rhs).is_valid()); // FIXME: Is-it too restrictive?
this->data_ = rhs.data_;
}
@@ -187,8 +187,8 @@ namespace mln
image_base<T, S, E>&
image_base<T, S, E>::operator=(const image_base<T, S, E>& rhs)
{
- mln_precondition(exact(rhs).has_data()); // FIXME: Is-it too restrictive?
- if (& rhs == this) // || ! exact(rhs).has_data())
+ mln_precondition(exact(rhs).is_valid()); // FIXME: Is-it too restrictive?
+ if (& rhs == this) // || ! exact(rhs).is_valid())
return *this;
this->data_ = rhs.data_;
return *this;
@@ -205,7 +205,7 @@ namespace mln
template <typename T, typename S, typename E>
inline
bool
- image_base<T, S, E>::has_data() const
+ image_base<T, S, E>::is_valid() const
{
return data_ != 0;
}
@@ -215,7 +215,7 @@ namespace mln
bool
image_base<T, S, E>::has(const psite& p) const
{
- mln_precondition(exact(this)->has_data());
+ mln_precondition(exact(this)->is_valid());
return exact(this)->domain().has(p);
}
@@ -226,7 +226,7 @@ namespace mln
{
mlc_equal(mln_trait_site_set_nsites(S),
mln::trait::site_set::nsites::known)::check();
- mln_precondition(exact(this)->has_data());
+ mln_precondition(exact(this)->is_valid());
return exact(this)->domain().nsites();
}
diff --git a/milena/mln/core/internal/image_morpher.hh b/milena/mln/core/internal/image_morpher.hh
index 66ab68d..ab50ea8 100644
--- a/milena/mln/core/internal/image_morpher.hh
+++ b/milena/mln/core/internal/image_morpher.hh
@@ -78,7 +78,7 @@ namespace mln
* image_base because it also tests that the morphed image is
* also initialized.
*/
- bool has_data() const;
+ bool is_valid() const;
/// Conversion to the underlying (morphed) image.
operator I() const; // FIXME: Very dangerous? Remove?
@@ -170,19 +170,19 @@ namespace mln
inline
image_morpher<I, T, S, E>::operator I() const
{
- mln_precondition(exact(this)->has_data());
+ mln_precondition(exact(this)->is_valid());
return * this->delegatee_();
}
template <typename I, typename T, typename S, typename E>
inline
bool
- image_morpher<I, T, S, E>::has_data() const
+ image_morpher<I, T, S, E>::is_valid() const
{
return
this->data_ != 0 &&
this->delegatee_() != 0 &&
- this->delegatee_()->has_data();
+ this->delegatee_()->is_valid();
}
template <typename I, typename T, typename S, typename E>
diff --git a/milena/mln/core/internal/pixel_iterator_base.hh b/milena/mln/core/internal/pixel_iterator_base.hh
index 6995bdf..951a134 100644
--- a/milena/mln/core/internal/pixel_iterator_base.hh
+++ b/milena/mln/core/internal/pixel_iterator_base.hh
@@ -130,7 +130,7 @@ namespace mln
pixel_iterator_base_<I, E>::pixel_iterator_base_(I& image)
: super_(image)
{
- mln_precondition(image.has_data());
+ mln_precondition(image.is_valid());
I& ima = this->image_;
boi_ = & ima( ima.domain().pmin() ) - 1;
eoi_ = & ima( ima.domain().pmax() ) + 1;
diff --git a/milena/mln/core/internal/run_image.hh b/milena/mln/core/internal/run_image.hh
index ff36bd9..adbd45f 100644
--- a/milena/mln/core/internal/run_image.hh
+++ b/milena/mln/core/internal/run_image.hh
@@ -130,7 +130,7 @@ namespace mln
run_image_<T, P, E>::has(const mln_psite(p_set_of< p_run<P> >)& ps) const
{
const E* ima = exact(this);
- if (!ima->has_data())
+ if (!ima->is_valid())
return false;
else
return (ps.index() < ima->data_->domain_.nsites()
diff --git a/milena/mln/core/pixel.hh b/milena/mln/core/pixel.hh
index 54598c8..bc4df1a 100644
--- a/milena/mln/core/pixel.hh
+++ b/milena/mln/core/pixel.hh
@@ -99,7 +99,7 @@ namespace mln
bool
pixel<I>::is_valid() const
{
- if (this->value_ptr_ == 0 || ! this->image_.has_data())
+ if (this->value_ptr_ == 0 || ! this->image_.is_valid())
return false;
int o = this->value_ptr_ - this->image_.buffer();
mln_psite(I) p = this->image_.point_at_index(o);
diff --git a/milena/mln/core/pixter1d.hh b/milena/mln/core/pixter1d.hh
index eaf169b..2993e67 100644
--- a/milena/mln/core/pixter1d.hh
+++ b/milena/mln/core/pixter1d.hh
@@ -99,7 +99,7 @@ namespace mln
fwd_pixter1d<I>::fwd_pixter1d(I& image)
: super_(image)
{
- mln_precondition(image.has_data());
+ mln_precondition(image.is_valid());
}
template <typename I>
@@ -120,7 +120,7 @@ namespace mln
bkd_pixter1d<I>::bkd_pixter1d(I& image)
: super_(image)
{
- mln_precondition(image.has_data());
+ mln_precondition(image.is_valid());
}
template <typename I>
diff --git a/milena/mln/core/pixter2d.hh b/milena/mln/core/pixter2d.hh
index ce84316..344a212 100644
--- a/milena/mln/core/pixter2d.hh
+++ b/milena/mln/core/pixter2d.hh
@@ -120,7 +120,7 @@ namespace mln
row_offset_(image.bbox().ncols() + border_x2_),
eor_(& opt::at(image, geom::min_row(image), geom::max_col(image)) + 1)
{
- mln_precondition(image.has_data());
+ mln_precondition(image.is_valid());
}
template <typename I>
@@ -149,7 +149,7 @@ namespace mln
row_offset_(image.bbox().ncols() + border_x2_),
bor_(& opt::at(image, geom::max_row(image), geom::min_col(image)) - 1)
{
- mln_precondition(image.has_data());
+ mln_precondition(image.is_valid());
}
template <typename I>
diff --git a/milena/mln/core/pixter3d.hh b/milena/mln/core/pixter3d.hh
index e66693c..f81d76c 100644
--- a/milena/mln/core/pixter3d.hh
+++ b/milena/mln/core/pixter3d.hh
@@ -145,7 +145,7 @@ namespace mln
geom::max_row(image),
geom::max_col(image)) + 1)
{
- mln_precondition(image.has_data());
+ mln_precondition(image.is_valid());
}
template <typename I>
@@ -189,7 +189,7 @@ namespace mln
geom::min_row(image),
geom::min_col(image)) - 1)
{
- mln_precondition(image.has_data());
+ mln_precondition(image.is_valid());
}
template <typename I>
diff --git a/milena/mln/core/routine/duplicate.hh b/milena/mln/core/routine/duplicate.hh
index 579cf1e..54e556a 100644
--- a/milena/mln/core/routine/duplicate.hh
+++ b/milena/mln/core/routine/duplicate.hh
@@ -47,7 +47,7 @@ namespace mln
/// \param[in] model The image to be duplicated.
/// \result The duplicate.
///
- /// \pre model.has_data
+ /// \pre model.is_valid
template <typename I>
mln_concrete(I) duplicate(const Image<I>& model);
diff --git a/milena/mln/core/routine/initialize.hh b/milena/mln/core/routine/initialize.hh
index 37d6d58..9bc51c6 100644
--- a/milena/mln/core/routine/initialize.hh
+++ b/milena/mln/core/routine/initialize.hh
@@ -44,7 +44,7 @@ namespace mln
* \param[in, out] target The image to be initialized.
* \param[in] model The image to provide data for the initialization.
*
- * \pre (not target.has_data) and model.has_data
+ * \pre (not target.is_valid) and model.is_valid
*/
template <typename I, typename J>
void initialize(Image<I>& target, const Image<J>& model);
@@ -58,14 +58,14 @@ namespace mln
void initialize(Image<I>& target, const Image<J>& model)
{
trace::entering("core::initialize");
- mln_precondition(! exact(target).has_data());
- mln_precondition(exact(model).has_data());
+ mln_precondition(! exact(target).is_valid());
+ mln_precondition(exact(model).is_valid());
trace::stop();
init_(tag::image, exact(target), exact(model));
trace::resume();
- mln_postcondition(exact(target).has_data());
+ mln_postcondition(exact(target).is_valid());
trace::exiting("core::initialize");
}
diff --git a/milena/mln/core/routine/primary.hh b/milena/mln/core/routine/primary.hh
index 89279fe..340a92b 100644
--- a/milena/mln/core/routine/primary.hh
+++ b/milena/mln/core/routine/primary.hh
@@ -130,7 +130,7 @@ namespace mln
const typename internal::primary_type<I>::ret&
primary(const Image<I>& input)
{
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
return internal::primary_(input);
}
diff --git a/milena/mln/core/site_set/p_image.hh b/milena/mln/core/site_set/p_image.hh
index 630c40c..dff9ae5 100644
--- a/milena/mln/core/site_set/p_image.hh
+++ b/milena/mln/core/site_set/p_image.hh
@@ -174,7 +174,7 @@ namespace mln
inline
p_image<I>::p_image(const I& ima)
{
- mln_precondition(ima.has_data());
+ mln_precondition(ima.is_valid());
ima_ = ima;
clear();
}
@@ -193,7 +193,7 @@ namespace mln
bool
p_image<I>::is_valid() const
{
- return ima_.has_data();
+ return ima_.is_valid();
}
template <typename I>
diff --git a/milena/mln/core/w_window.hh b/milena/mln/core/w_window.hh
index 5a3c364..ac55e2a 100644
--- a/milena/mln/core/w_window.hh
+++ b/milena/mln/core/w_window.hh
@@ -347,7 +347,7 @@ namespace mln
mlc_converts_to(W, mln_value(I))::check();
I& ima = exact(ima_);
- mln_precondition(! ima.has_data());
+ mln_precondition(! ima.is_valid());
// mln_precondition(w_win.is_valid());
ima.init_(geom::bbox(w_win));
diff --git a/milena/mln/data/fill.hh b/milena/mln/data/fill.hh
index cefdbe8..c868b4a 100644
--- a/milena/mln/data/fill.hh
+++ b/milena/mln/data/fill.hh
@@ -77,7 +77,7 @@ namespace mln
(void) ima;
mlc_is(mln_trait_image_value_io(I), trait::image::value_io::read_write)::check();
- mln_precondition(exact(ima).has_data());
+ mln_precondition(exact(ima).is_valid());
// FIXME: check for ambiguities...
}
diff --git a/milena/mln/data/fill_with_image.hh b/milena/mln/data/fill_with_image.hh
index 1c1d4e7..3b79e72 100644
--- a/milena/mln/data/fill_with_image.hh
+++ b/milena/mln/data/fill_with_image.hh
@@ -81,8 +81,8 @@ namespace mln
mlc_is(mln_trait_image_pw_io(I),
mln::trait::image::pw_io::read_write)::check();
mlc_converts_to(mln_value(J), mln_value(I))::check();
- mln_precondition(exact(ima).has_data());
- mln_precondition(exact(data).has_data());
+ mln_precondition(exact(ima).is_valid());
+ mln_precondition(exact(data).is_valid());
mln_precondition(exact(ima).domain() <= exact(data).domain());
}
diff --git a/milena/mln/data/fill_with_value.hh b/milena/mln/data/fill_with_value.hh
index 4a3442c..f6d0597 100644
--- a/milena/mln/data/fill_with_value.hh
+++ b/milena/mln/data/fill_with_value.hh
@@ -78,7 +78,7 @@ namespace mln
void fill_with_value_tests(Image<I>& ima, const V&)
{
mlc_converts_to(mln_exact(V), mln_value(I))::check();
- mln_precondition(exact(ima).has_data());
+ mln_precondition(exact(ima).is_valid());
// Avoid a warning about an undefined variable when NDEBUG
(void) ima;
diff --git a/milena/mln/data/memcpy_.hh b/milena/mln/data/memcpy_.hh
index 1c3b7ad..56b7d58 100644
--- a/milena/mln/data/memcpy_.hh
+++ b/milena/mln/data/memcpy_.hh
@@ -123,8 +123,8 @@ namespace mln
Ps& src = mln::internal::force_exact<Ps>(src_);
mln_precondition(sizeof(mln_value(Id)) == sizeof(mln_value(Is)));
- mln_precondition(dest.ima().has_data());
- mln_precondition(src.ima().has_data());
+ mln_precondition(dest.ima().is_valid());
+ mln_precondition(src.ima().is_valid());
mln_precondition(&dest.val() >= &dest.ima().element(0));
mln_precondition(&dest.val() < &dest.ima().element(0) +
diff --git a/milena/mln/data/memset_.hh b/milena/mln/data/memset_.hh
index 838f0d9..ef6ca5e 100644
--- a/milena/mln/data/memset_.hh
+++ b/milena/mln/data/memset_.hh
@@ -130,7 +130,7 @@ namespace mln
metal::is_not_const<I>::check();
P& pix = mln::internal::force_exact<P>(pix_);
- mln_precondition(pix.ima().has_data());
+ mln_precondition(pix.ima().is_valid());
mln_precondition(& pix.val() >= & pix.ima()[0]);
mln_precondition(& pix.val() < & pix.ima()[0] + pix.ima().nelements());
mln_precondition(& pix.val() + n <= & pix.ima()[0] + pix.ima().nelements());
@@ -149,7 +149,7 @@ namespace mln
mlc_is(mln_trait_image_speed(I), trait::image::speed::fastest)::check();
- mln_precondition(input.has_data());
+ mln_precondition(input.is_valid());
mln_precondition(input.has(p));
mln_precondition(input.index_of_point(p) + n <= input.nelements());
diff --git a/milena/mln/data/paste.hh b/milena/mln/data/paste.hh
index a9c72e0..9cd5954 100644
--- a/milena/mln/data/paste.hh
+++ b/milena/mln/data/paste.hh
@@ -80,7 +80,7 @@ namespace mln
check();
mlc_converts_to(mln_value(I), mln_value(J))::check();
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
mln_precondition(exact(input).domain() <= exact(output).domain());
// Avoid warning when compiling with NDEBUG
diff --git a/milena/mln/debug/colorize.hh b/milena/mln/debug/colorize.hh
index a015f9b..544a755 100644
--- a/milena/mln/debug/colorize.hh
+++ b/milena/mln/debug/colorize.hh
@@ -105,7 +105,7 @@ namespace mln
const mln_value(L)& nlabels)
{
trace::entering("debug::colorize");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
// FIXME: check that V is a color type.
// FIXME: we want to be sure that this is a label.
mlc_is_a(mln_value(L), mln::value::Symbolic)::check();
diff --git a/milena/mln/debug/iota.hh b/milena/mln/debug/iota.hh
index e6c7e4b..83bdcdc 100644
--- a/milena/mln/debug/iota.hh
+++ b/milena/mln/debug/iota.hh
@@ -79,7 +79,7 @@ namespace mln
iota(Image<I>& input)
{
trace::entering("debug::iota");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
impl::iota(mln_trait_image_speed(I)(), exact(input));
trace::exiting("debug::iota");
}
diff --git a/milena/mln/draw/box.hh b/milena/mln/draw/box.hh
index 3788801..877fdce 100644
--- a/milena/mln/draw/box.hh
+++ b/milena/mln/draw/box.hh
@@ -72,7 +72,7 @@ namespace mln
const Box<B>& b,
const mln_value(I)& v)
{
- mln_precondition(exact(ima).has_data());
+ mln_precondition(exact(ima).is_valid());
mln_psite(I) pmin = exact(b).pmin();
mln_psite(I) pmax = exact(b).pmax();
diff --git a/milena/mln/draw/line.hh b/milena/mln/draw/line.hh
index e28e88b..096b041 100644
--- a/milena/mln/draw/line.hh
+++ b/milena/mln/draw/line.hh
@@ -75,7 +75,7 @@ namespace mln
const mln_value(I)& v)
{
I& ima = exact(ima_);
- mln_precondition(ima.has_data());
+ mln_precondition(ima.is_valid());
// if (! ima.has(beg) || ! ima.has(end)) trace::warning("out");
data::paste(pw::cst(v) | p_line2d(beg, end),
safe(ima).rw());
diff --git a/milena/mln/draw/plot.hh b/milena/mln/draw/plot.hh
index d1d2131..33e9f3f 100644
--- a/milena/mln/draw/plot.hh
+++ b/milena/mln/draw/plot.hh
@@ -70,7 +70,7 @@ namespace mln
const mln_psite(I)& p,
const mln_value(I)& v)
{
- mln_precondition(exact(ima).has_data());
+ mln_precondition(exact(ima).is_valid());
mln_precondition(exact(ima).has(p));
for (unsigned i = 0; i < I::point::dim; i++)
diff --git a/milena/mln/estim/mean.hh b/milena/mln/estim/mean.hh
index 25457f8..6abc4c3 100644
--- a/milena/mln/estim/mean.hh
+++ b/milena/mln/estim/mean.hh
@@ -70,7 +70,7 @@ namespace mln
inline
mln_sum(mln_value(I)) mean(const Image<I>& input)
{
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
return level::compute(accu::meta::mean(), input);
}
@@ -78,7 +78,7 @@ namespace mln
inline
void mean(const Image<I>& input, M& result)
{
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
accu::mean<mln_value(I), S, M> a;
result = level::compute(a, input);
}
diff --git a/milena/mln/estim/min_max.hh b/milena/mln/estim/min_max.hh
index 14e1581..15397f0 100644
--- a/milena/mln/estim/min_max.hh
+++ b/milena/mln/estim/min_max.hh
@@ -63,7 +63,7 @@ namespace mln
void min_max(const Image<I>& input,
mln_value(I)& min, mln_value(I)& max)
{
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
typedef mln_value(I) V;
std::pair<V, V> mm = level::compute(accu::meta::min_max(), input);
min = mm.first;
diff --git a/milena/mln/estim/sum.hh b/milena/mln/estim/sum.hh
index 1df276d..5e1eb1c 100644
--- a/milena/mln/estim/sum.hh
+++ b/milena/mln/estim/sum.hh
@@ -69,7 +69,7 @@ namespace mln
inline
mln_sum(mln_value(I)) sum(const Image<I>& input)
{
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
return level::compute(accu::meta::sum(), input);
}
@@ -77,7 +77,7 @@ namespace mln
inline
void sum(const Image<I>& input, S& result)
{
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
accu::sum<mln_value(I), S> a;
result = level::compute(a, input);
}
diff --git a/milena/mln/extension/adjust.hh b/milena/mln/extension/adjust.hh
index c81a0fe..6c86d0a 100644
--- a/milena/mln/extension/adjust.hh
+++ b/milena/mln/extension/adjust.hh
@@ -77,7 +77,7 @@ namespace mln
template <typename I>
void adjust(const I& ima, unsigned delta)
{
- mln_precondition(exact(ima).has_data());
+ mln_precondition(exact(ima).is_valid());
// FIXME: Is-it right?
border::adjust(ima, delta);
}
diff --git a/milena/mln/extension/fill.hh b/milena/mln/extension/fill.hh
index 98f95ac..345ea4a 100644
--- a/milena/mln/extension/fill.hh
+++ b/milena/mln/extension/fill.hh
@@ -177,7 +177,7 @@ namespace mln
{
trace::entering("extension::fill");
- mln_precondition(exact(ima).has_data());
+ mln_precondition(exact(ima).is_valid());
internal::fill_dispatch(ima, val);
trace::exiting("extension::fill");
diff --git a/milena/mln/geom/bbox.hh b/milena/mln/geom/bbox.hh
index 12624dc..9a7d5bc 100644
--- a/milena/mln/geom/bbox.hh
+++ b/milena/mln/geom/bbox.hh
@@ -136,7 +136,7 @@ namespace mln
box<mln_site(I)> bbox(const Image<I>& ima_)
{
const I& ima = exact(ima_);
- mln_precondition(ima.has_data());
+ mln_precondition(ima.is_valid());
return geom::bbox(ima.domain());
}
diff --git a/milena/mln/geom/max_col.hh b/milena/mln/geom/max_col.hh
index ca7c305..6152e5d 100644
--- a/milena/mln/geom/max_col.hh
+++ b/milena/mln/geom/max_col.hh
@@ -57,7 +57,7 @@ namespace mln
inline
mln_deduce(I, site, coord) max_col(const Image<I>& ima)
{
- mln_precondition(exact(ima).has_data());
+ mln_precondition(exact(ima).is_valid());
return geom::bbox(ima).pmax().col();
}
diff --git a/milena/mln/geom/max_ind.hh b/milena/mln/geom/max_ind.hh
index 9a794e0..6d5baf0 100644
--- a/milena/mln/geom/max_ind.hh
+++ b/milena/mln/geom/max_ind.hh
@@ -53,7 +53,7 @@ namespace mln
inline
mln_deduce(I, site, coord) max_ind(const Image<I>& ima)
{
- mln_precondition(exact(ima).has_data());
+ mln_precondition(exact(ima).is_valid());
return exact(ima).bbox().pmax().ind();
}
diff --git a/milena/mln/geom/max_row.hh b/milena/mln/geom/max_row.hh
index ba6bc00..cf33984 100644
--- a/milena/mln/geom/max_row.hh
+++ b/milena/mln/geom/max_row.hh
@@ -58,7 +58,7 @@ namespace mln
inline
mln_deduce(I, site, coord) max_row(const Image<I>& ima)
{
- mln_precondition(exact(ima).has_data());
+ mln_precondition(exact(ima).is_valid());
return geom::bbox(ima).pmax().row();
}
diff --git a/milena/mln/geom/max_sli.hh b/milena/mln/geom/max_sli.hh
index 2556d78..07920d6 100644
--- a/milena/mln/geom/max_sli.hh
+++ b/milena/mln/geom/max_sli.hh
@@ -53,7 +53,7 @@ namespace mln
inline
mln_deduce(I, site, coord) max_sli(const Image<I>& ima)
{
- mln_precondition(exact(ima).has_data());
+ mln_precondition(exact(ima).is_valid());
return exact(ima).bbox().pmax().sli();
}
diff --git a/milena/mln/geom/min_col.hh b/milena/mln/geom/min_col.hh
index 1e01a93..cf66a3d 100644
--- a/milena/mln/geom/min_col.hh
+++ b/milena/mln/geom/min_col.hh
@@ -58,7 +58,7 @@ namespace mln
inline
mln_deduce(I, site, coord) min_col(const Image<I>& ima)
{
- mln_precondition(exact(ima).has_data());
+ mln_precondition(exact(ima).is_valid());
return geom::bbox(ima).pmin().col();
}
diff --git a/milena/mln/geom/min_ind.hh b/milena/mln/geom/min_ind.hh
index abf4ecd..892b2fc 100644
--- a/milena/mln/geom/min_ind.hh
+++ b/milena/mln/geom/min_ind.hh
@@ -53,7 +53,7 @@ namespace mln
inline
mln_deduce(I, site, coord) min_ind(const Image<I>& ima)
{
- mln_precondition(exact(ima).has_data());
+ mln_precondition(exact(ima).is_valid());
return exact(ima).bbox().pmin().ind();
}
diff --git a/milena/mln/geom/min_row.hh b/milena/mln/geom/min_row.hh
index e0878de..0d991ca 100644
--- a/milena/mln/geom/min_row.hh
+++ b/milena/mln/geom/min_row.hh
@@ -61,7 +61,7 @@ namespace mln
inline
mln_deduce(I, site, coord) min_row(const Image<I>& ima)
{
- mln_precondition(exact(ima).has_data());
+ mln_precondition(exact(ima).is_valid());
return geom::bbox(ima).pmin().row();
}
diff --git a/milena/mln/geom/min_sli.hh b/milena/mln/geom/min_sli.hh
index a01de7d..9d186fe 100644
--- a/milena/mln/geom/min_sli.hh
+++ b/milena/mln/geom/min_sli.hh
@@ -53,7 +53,7 @@ namespace mln
inline
mln_deduce(I, site, coord) min_sli(const Image<I>& ima)
{
- mln_precondition(exact(ima).has_data());
+ mln_precondition(exact(ima).is_valid());
return exact(ima).bbox().pmin().sli();
}
diff --git a/milena/mln/geom/ncols.hh b/milena/mln/geom/ncols.hh
index 577cb7d..76c2d5a 100644
--- a/milena/mln/geom/ncols.hh
+++ b/milena/mln/geom/ncols.hh
@@ -58,7 +58,7 @@ namespace mln
inline
unsigned ncols(const Image<I>& ima)
{
- mln_precondition(exact(ima).has_data());
+ mln_precondition(exact(ima).is_valid());
return geom::max_col(ima) - geom::min_col(ima) + 1;
}
diff --git a/milena/mln/geom/ninds.hh b/milena/mln/geom/ninds.hh
index 12fd520..a331748 100644
--- a/milena/mln/geom/ninds.hh
+++ b/milena/mln/geom/ninds.hh
@@ -54,7 +54,7 @@ namespace mln
inline
unsigned ninds(const Image<I>& ima)
{
- mln_precondition(exact(ima).has_data());
+ mln_precondition(exact(ima).is_valid());
return geom::max_ind(ima) - geom::min_ind(ima) + 1;
}
diff --git a/milena/mln/geom/nrows.hh b/milena/mln/geom/nrows.hh
index 39e750d..c7f3e9a 100644
--- a/milena/mln/geom/nrows.hh
+++ b/milena/mln/geom/nrows.hh
@@ -58,7 +58,7 @@ namespace mln
inline
unsigned nrows(const Image<I>& ima)
{
- mln_precondition(exact(ima).has_data());
+ mln_precondition(exact(ima).is_valid());
return geom::max_row(ima) - geom::min_row(ima) + 1;
}
diff --git a/milena/mln/geom/nsites.hh b/milena/mln/geom/nsites.hh
index f161910..2996f26 100644
--- a/milena/mln/geom/nsites.hh
+++ b/milena/mln/geom/nsites.hh
@@ -56,7 +56,7 @@ namespace mln
trace::entering("geom::nsites");
const I& input = exact(input_);
- mln_precondition(input.has_data());
+ mln_precondition(input.is_valid());
mln_precondition(input.domain().is_valid());
// Relies on the card routine on a site set.
diff --git a/milena/mln/geom/nslis.hh b/milena/mln/geom/nslis.hh
index 7d90865..3e6aa77 100644
--- a/milena/mln/geom/nslis.hh
+++ b/milena/mln/geom/nslis.hh
@@ -54,7 +54,7 @@ namespace mln
inline
unsigned nslis(const Image<I>& ima)
{
- mln_precondition(exact(ima).has_data());
+ mln_precondition(exact(ima).is_valid());
return geom::max_sli(ima) - geom::min_sli(ima) + 1;
}
diff --git a/milena/mln/geom/seeds2tiling.hh b/milena/mln/geom/seeds2tiling.hh
index 4844c26..0dc8eef 100644
--- a/milena/mln/geom/seeds2tiling.hh
+++ b/milena/mln/geom/seeds2tiling.hh
@@ -128,7 +128,7 @@ namespace mln
{
trace::entering("geom::seed2tiling");
- mln_precondition(exact(ima_).has_data());
+ mln_precondition(exact(ima_).is_valid());
I output = impl::seeds2tiling(ima_, nbh);
trace::exiting("geom::seed2tiling");
diff --git a/milena/mln/geom/seeds2tiling_roundness.hh b/milena/mln/geom/seeds2tiling_roundness.hh
index a5c1f68..865198b 100644
--- a/milena/mln/geom/seeds2tiling_roundness.hh
+++ b/milena/mln/geom/seeds2tiling_roundness.hh
@@ -132,7 +132,7 @@ namespace mln
{
trace::entering("geom::seed2tiling_roundness");
- mln_precondition(exact(ima_).has_data());
+ mln_precondition(exact(ima_).is_valid());
I output = impl::seeds2tiling_roundness(ima_, w_win, max, nbh);
trace::exiting("geom::seed2tiling_roundness");
diff --git a/milena/mln/histo/compute.hh b/milena/mln/histo/compute.hh
index af5b8c4..14bf3a3 100644
--- a/milena/mln/histo/compute.hh
+++ b/milena/mln/histo/compute.hh
@@ -82,7 +82,7 @@ namespace mln
{
trace::entering("histo::compute");
mlc_equal(mln_trait_image_quant(I), mln::trait::image::quant::low)::check();
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
data<mln_value(I)> h = impl::compute_(mln_trait_image_speed(I)(),
exact(input));
diff --git a/milena/mln/io/txt/save.hh b/milena/mln/io/txt/save.hh
index 597e07c..4cc4e39 100644
--- a/milena/mln/io/txt/save.hh
+++ b/milena/mln/io/txt/save.hh
@@ -66,7 +66,7 @@ namespace mln
{
trace::entering("mln::io::txt::save");
- mln_precondition(ima.has_data());
+ mln_precondition(ima.is_valid());
std::ofstream ostr(filename.c_str());
unsigned col = 0;
typedef image2d<char> I;
diff --git a/milena/mln/labeling/background.hh b/milena/mln/labeling/background.hh
index c6f1905..30187bd 100644
--- a/milena/mln/labeling/background.hh
+++ b/milena/mln/labeling/background.hh
@@ -76,7 +76,7 @@ namespace mln
mlc_equal(mln_trait_image_kind(I),
mln::trait::image::kind::binary)::check();
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
// mln_precondition(exact(nbh).is_valid());
mln_ch_value(I, L) output = labeling::level(input, false, nbh, nlabels);
diff --git a/milena/mln/labeling/blobs.hh b/milena/mln/labeling/blobs.hh
index c7175f1..789eec4 100644
--- a/milena/mln/labeling/blobs.hh
+++ b/milena/mln/labeling/blobs.hh
@@ -153,7 +153,7 @@ namespace mln
mln::trait::image::kind::binary)::check();
const I& input = exact(input_);
const N& nbh = exact(nbh_);
- mln_precondition(input.has_data());
+ mln_precondition(input.is_valid());
mln_ch_value(I, L) output = impl::blobs_(input, nbh, nlabels);
diff --git a/milena/mln/labeling/compute.hh b/milena/mln/labeling/compute.hh
index ececa18..439a7b0 100644
--- a/milena/mln/labeling/compute.hh
+++ b/milena/mln/labeling/compute.hh
@@ -126,7 +126,7 @@ namespace mln
const Image<L>& label,
const mln_value(L)& nlabels)
{
- mln_precondition(exact(label).has_data());
+ mln_precondition(exact(label).is_valid());
mlc_is_a(mln_value(L), mln::value::Symbolic)::check();
(void) a;
(void) label;
@@ -142,8 +142,8 @@ namespace mln
const Image<L>& label,
const mln_value(L)& nlabels)
{
- mln_precondition(exact(input).has_data());
- mln_precondition(exact(label).has_data());
+ mln_precondition(exact(input).is_valid());
+ mln_precondition(exact(label).is_valid());
mlc_is_a(mln_value(L), mln::value::Symbolic)::check();
(void) a;
(void) input;
diff --git a/milena/mln/labeling/flat_zones.hh b/milena/mln/labeling/flat_zones.hh
index 7b90278..0f6a49c 100644
--- a/milena/mln/labeling/flat_zones.hh
+++ b/milena/mln/labeling/flat_zones.hh
@@ -137,7 +137,7 @@ namespace mln
const I& input = exact(input_);
const N& nbh = exact(nbh_);
- mln_precondition(input.has_data());
+ mln_precondition(input.is_valid());
// Calls the only (generic) impl.
mln_ch_value(I, L) output = impl::generic::flat_zones(input, nbh, nlabels);
diff --git a/milena/mln/labeling/foreground.hh b/milena/mln/labeling/foreground.hh
index d001be4..b5a28e4 100644
--- a/milena/mln/labeling/foreground.hh
+++ b/milena/mln/labeling/foreground.hh
@@ -76,7 +76,7 @@ namespace mln
mlc_equal(mln_trait_image_kind(I),
mln::trait::image::kind::binary)::check();
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
// mln_precondition(exact(nbh).is_valid());
mln_ch_value(I, L) output = labeling::level(input, true, nbh, nlabels);
diff --git a/milena/mln/labeling/level.hh b/milena/mln/labeling/level.hh
index 3bcd41e..8e373ea 100644
--- a/milena/mln/labeling/level.hh
+++ b/milena/mln/labeling/level.hh
@@ -78,7 +78,7 @@ namespace mln
level_tests(const Image<I>& input, const mln_value(I)& val, const Neighborhood<N>& nbh,
L& nlabels)
{
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
// mln_precondition(exact(nbh).is_valid());
(void) input;
diff --git a/milena/mln/labeling/regional_maxima.hh b/milena/mln/labeling/regional_maxima.hh
index c61dc89..40ed488 100644
--- a/milena/mln/labeling/regional_maxima.hh
+++ b/milena/mln/labeling/regional_maxima.hh
@@ -152,7 +152,7 @@ namespace mln
const I& input = exact(input_);
const N& nbh = exact(nbh_);
- mln_precondition(input.has_data());
+ mln_precondition(input.is_valid());
// Calls the only (generic) impl.
mln_ch_value(I, L) output = impl::generic::regional_maxima(input, nbh, nlabels);
diff --git a/milena/mln/labeling/regional_minima.hh b/milena/mln/labeling/regional_minima.hh
index b941130..3812471 100644
--- a/milena/mln/labeling/regional_minima.hh
+++ b/milena/mln/labeling/regional_minima.hh
@@ -157,7 +157,7 @@ namespace mln
const I& input = exact(input_);
const N& nbh = exact(nbh_);
- mln_precondition(input.has_data());
+ mln_precondition(input.is_valid());
// Calls the only (generic) impl.
mln_ch_value(I, L) output = impl::generic::regional_minima(input, nbh, nlabels);
diff --git a/milena/mln/labeling/relabel.hh b/milena/mln/labeling/relabel.hh
index 660e25b..71e4d05 100644
--- a/milena/mln/labeling/relabel.hh
+++ b/milena/mln/labeling/relabel.hh
@@ -116,7 +116,7 @@ namespace mln
{
// FIXME: we may want to check that it is exactly a label.
mlc_is_a(mln_value(I), mln::value::Symbolic)::check();
- mln_precondition(exact(label).has_data());
+ mln_precondition(exact(label).is_valid());
(void) label;
(void) nlabels;
(void) new_nlabels;
@@ -132,7 +132,7 @@ namespace mln
{
// FIXME: we may want to check that it is exactly a label.
mlc_is_a(mln_value(I), mln::value::Symbolic)::check();
- mln_precondition(exact(label).has_data());
+ mln_precondition(exact(label).is_valid());
(void) label;
(void) nlabels;
(void) f;
diff --git a/milena/mln/level/abs.hh b/milena/mln/level/abs.hh
index 9a544d7..d2b48b4 100644
--- a/milena/mln/level/abs.hh
+++ b/milena/mln/level/abs.hh
@@ -83,7 +83,7 @@ namespace mln
{
trace::entering("level::abs_inplace");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
level::apply(input, fun::v2v::abs<mln_value(I)>());
trace::exiting("level::abs_inplace");
diff --git a/milena/mln/level/apply.hh b/milena/mln/level/apply.hh
index 22aa880..c5189c4 100644
--- a/milena/mln/level/apply.hh
+++ b/milena/mln/level/apply.hh
@@ -98,7 +98,7 @@ namespace mln
{
trace::entering("level::apply");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
impl::apply_(mln_trait_image_speed(I)(), exact(input),
exact(f));
diff --git a/milena/mln/level/convert.hh b/milena/mln/level/convert.hh
index 68d900d..3c7a827 100644
--- a/milena/mln/level/convert.hh
+++ b/milena/mln/level/convert.hh
@@ -67,7 +67,7 @@ namespace mln
{
trace::entering("level::convert");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
fun::v2v::convert<V> f;
mln_ch_value(I, V) output = level::transform(input, f);
diff --git a/milena/mln/level/fast_median.hh b/milena/mln/level/fast_median.hh
index bf1b9d0..4321da3 100644
--- a/milena/mln/level/fast_median.hh
+++ b/milena/mln/level/fast_median.hh
@@ -80,8 +80,8 @@ namespace mln
const W& win,
O& output)
{
- mln_precondition(input.has_data());
- mln_precondition(output.has_data());
+ mln_precondition(input.is_valid());
+ mln_precondition(output.is_valid());
def::coord
min_row = geom::min_row(input), max_row = geom::max_row(input),
diff --git a/milena/mln/level/replace.hh b/milena/mln/level/replace.hh
index efa9d50..fdb7352 100644
--- a/milena/mln/level/replace.hh
+++ b/milena/mln/level/replace.hh
@@ -93,7 +93,7 @@ namespace mln
{
trace::entering("level::replace");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
impl::generic::replace_<I>(exact(input), old_value, new_value);
diff --git a/milena/mln/level/saturate.hh b/milena/mln/level/saturate.hh
index c3a01e2..320aa65 100644
--- a/milena/mln/level/saturate.hh
+++ b/milena/mln/level/saturate.hh
@@ -91,7 +91,7 @@ namespace mln
{
trace::entering("level::saturate");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
fun::v2v::saturate<V> f;
mln_ch_value(I, V) output = level::transform(input, f);
@@ -108,7 +108,7 @@ namespace mln
{
trace::entering("level::saturate");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
fun::v2v::saturate<V> f(min, max);
mln_ch_value(I, V) output = level::transform(input, f);
@@ -124,7 +124,7 @@ namespace mln
{
trace::entering("level::saturate_inplace");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
fun::v2v::saturate<mln_value(I)> f(min, max);
level::apply(input, f);
diff --git a/milena/mln/level/sort_psites.hh b/milena/mln/level/sort_psites.hh
index 41deb80..ef920cd 100644
--- a/milena/mln/level/sort_psites.hh
+++ b/milena/mln/level/sort_psites.hh
@@ -54,7 +54,7 @@ namespace mln
*
* \param[in] input The input image.
*
- * \pre \p input.has_data
+ * \pre \p input.is_valid
*/
template <typename I>
p_array<mln_psite(I)> sort_psites_increasing(const Image<I>& input);
@@ -64,7 +64,7 @@ namespace mln
*
* \param[in] input The input image.
*
- * \pre \p input.has_data
+ * \pre \p input.is_valid
*/
template <typename I>
p_array<mln_psite(I)> sort_psites_decreasing(const Image<I>& input);
@@ -220,7 +220,7 @@ namespace mln
p_array<mln_psite(I)>
sort_psites_increasing(const Image<I>& input)
{
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
return impl::sort_psites_increasing_(mln_trait_image_quant(I)(),
exact(input));
}
@@ -230,7 +230,7 @@ namespace mln
p_array<mln_psite(I)>
sort_psites_decreasing(const Image<I>& input)
{
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
return impl::sort_psites_decreasing_(mln_trait_image_quant(I)(),
exact(input));
}
diff --git a/milena/mln/level/stretch.hh b/milena/mln/level/stretch.hh
index 9be600c..e91dbe7 100644
--- a/milena/mln/level/stretch.hh
+++ b/milena/mln/level/stretch.hh
@@ -57,7 +57,7 @@ namespace mln
* \param[in] input The input image.
* \param[out] output The result image.
*
- * \pre input.has_data
+ * \pre input.is_valid
*/
template <typename V, typename I>
mln_ch_value(I, V)
@@ -115,7 +115,7 @@ namespace mln
{
trace::entering("level::stretch");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
mln_ch_value(I, V) output = impl::stretch(V(), input);
diff --git a/milena/mln/level/transform.hh b/milena/mln/level/transform.hh
index 67e06b5..07ed377 100644
--- a/milena/mln/level/transform.hh
+++ b/milena/mln/level/transform.hh
@@ -92,7 +92,7 @@ namespace mln
const Function_v2v<F>& f)
{
// Dynamic test.
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
// Avoid a warning about an undefined variable when NDEBUG
// is not defined.
@@ -105,8 +105,8 @@ namespace mln
const Function_vv2v<F>& f)
{
// Dynamic tests.
- mln_precondition(exact(input1).has_data());
- mln_precondition(exact(input2).has_data());
+ mln_precondition(exact(input1).is_valid());
+ mln_precondition(exact(input2).is_valid());
mln_precondition(exact(input2).domain() == exact(input1).domain());
// Avoid a warning about an undefined variable when NDEBUG
diff --git a/milena/mln/level/transform_inplace.hh b/milena/mln/level/transform_inplace.hh
index ea211d6..2a848aa 100644
--- a/milena/mln/level/transform_inplace.hh
+++ b/milena/mln/level/transform_inplace.hh
@@ -98,7 +98,7 @@ namespace mln
mlc_converts_to(mln_result(F), mln_value(I))::check();
// Dynamic test.
- mln_precondition(exact(ima).has_data());
+ mln_precondition(exact(ima).is_valid());
// Avoid a warning.
(void) ima;
@@ -119,8 +119,8 @@ namespace mln
mlc_converts_to(mln_result(F), mln_value(I1))::check();
// Dynamic test.
- mln_precondition(exact(ima).has_data());
- mln_precondition(exact(aux).has_data());
+ mln_precondition(exact(ima).is_valid());
+ mln_precondition(exact(aux).is_valid());
mln_precondition(exact(aux).domain() == exact(ima).domain());
// Avoid warnings.
diff --git a/milena/mln/level/update.hh b/milena/mln/level/update.hh
index bc52d58..10632a5 100644
--- a/milena/mln/level/update.hh
+++ b/milena/mln/level/update.hh
@@ -71,7 +71,7 @@ namespace mln
{
A& a = exact(a_);
const I& input = exact(input_);
- mln_precondition(input.has_data());
+ mln_precondition(input.is_valid());
// sizeof(a.take(mln_value(I)()));
(void) a;
diff --git a/milena/mln/level/was.median.hh b/milena/mln/level/was.median.hh
index 0d19ed1..0579ce6 100644
--- a/milena/mln/level/was.median.hh
+++ b/milena/mln/level/was.median.hh
@@ -66,8 +66,8 @@ namespace mln
const W& win,
O& output)
{
- mln_precondition(input.has_data());
- mln_precondition(output.has_data());
+ mln_precondition(input.is_valid());
+ mln_precondition(output.is_valid());
int
min_row = geom::min_row(input), max_row = geom::max_row(input),
diff --git a/milena/mln/linear/convolve.hh b/milena/mln/linear/convolve.hh
index 7be8140..1996f76 100644
--- a/milena/mln/linear/convolve.hh
+++ b/milena/mln/linear/convolve.hh
@@ -54,7 +54,7 @@ namespace mln
* \warning The weighted window is used as-is, considering that
* its symmetrization is handled by the client.
*
- * \pre input.has_data
+ * \pre input.is_valid
*/
template <typename I, typename W>
mln_ch_convolve(I, W)
@@ -74,7 +74,7 @@ namespace mln
convolve_tests(const Image<I>& input,
const Weighted_Window<W>& w_win)
{
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
// mln_precondition(exact(w_win).is_valid());
(void) input;
(void) w_win;
diff --git a/milena/mln/linear/convolve_2x1d.hh b/milena/mln/linear/convolve_2x1d.hh
index 0d0b96c..94f3797 100644
--- a/milena/mln/linear/convolve_2x1d.hh
+++ b/milena/mln/linear/convolve_2x1d.hh
@@ -51,7 +51,7 @@ namespace mln
* \warning The weighted window is used as-is, considering that
* its symmetrization is handled by the client.
*
- * \pre input.has_data
+ * \pre input.is_valid
*/
template <typename I,
typename W, unsigned Sh, unsigned Sv>
@@ -75,7 +75,7 @@ namespace mln
mlc_bool(Sh % 2 == 1)::check();
mlc_bool(Sv % 2 == 1)::check();
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
extension::adjust(input, util::max(Sh / 2, Sv / 2));
diff --git a/milena/mln/linear/convolve_directional.hh b/milena/mln/linear/convolve_directional.hh
index ca7af6b..1f241d2 100644
--- a/milena/mln/linear/convolve_directional.hh
+++ b/milena/mln/linear/convolve_directional.hh
@@ -55,7 +55,7 @@ namespace mln
* \warning The weighted window is used as-is, considering that
* its symmetrization is handled by the client.
*
- * \pre input.has_data
+ * \pre input.is_valid
*/
template <typename I, typename W, unsigned S>
mln_ch_convolve(I, W)
@@ -73,7 +73,7 @@ namespace mln
mlc_bool(S % 2 == 1)::check();
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
typedef mln_site(I) P;
mln_precondition(dir < P::dim);
diff --git a/milena/mln/linear/gaussian.hh b/milena/mln/linear/gaussian.hh
index 4b5be0c..0181e61 100644
--- a/milena/mln/linear/gaussian.hh
+++ b/milena/mln/linear/gaussian.hh
@@ -634,7 +634,7 @@ namespace mln
* if \p dir = 1, the filter is applied on the second image dimension.
* And so on...
*
- * \pre input.has_data
+ * \pre input.is_valid
* \pre dir < dimension(input)
*/
template <class I>
@@ -642,7 +642,7 @@ namespace mln
mln_concrete(I)
gaussian(const Image<I>& input, float sigma, int dir)
{
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
mln_precondition(dir < I::site::dim);
mln_concrete(I) output;
@@ -666,7 +666,7 @@ namespace mln
* if \p dir = 1, the filter is applied on the second image dimension.
* And so on...
*
- * \pre input.has_data
+ * \pre input.is_valid
* \pre dir < dimension(input)
*/
template <class I>
@@ -674,7 +674,7 @@ namespace mln
mln_concrete(I)
gaussian_1st_derivative(const Image<I>& input, float sigma, int dir)
{
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
mln_precondition(dir < I::site::dim);
mln_concrete(I) output;
@@ -699,7 +699,7 @@ namespace mln
* if \p dir = 1, the filter is applied on the second image dimension.
* And so on...
*
- * \pre input.has_data
+ * \pre input.is_valid
* \pre dir < dimension(input)
*/
template <class I>
@@ -707,7 +707,7 @@ namespace mln
mln_concrete(I)
gaussian_2nd_derivative(const Image<I>& input, float sigma, int dir)
{
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
mln_precondition(dir < I::site::dim);
mln_concrete(I) output;
@@ -732,14 +732,14 @@ namespace mln
/*! Apply an approximated gaussian filter of \p sigma on \p input.
* This filter is applied in all the input image direction.
*
- * \pre input.has_data
+ * \pre input.is_valid
*/
template <class I>
inline
mln_concrete(I)
gaussian(const Image<I>& input, float sigma)
{
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
mln_concrete(I) output;
initialize(output, input);
@@ -761,14 +761,14 @@ namespace mln
* \p input
* This filter is applied in all the input image direction.
*
- * \pre input.has_data
+ * \pre input.is_valid
*/
template <class I>
inline
mln_concrete(I)
gaussian_1st_derivative(const Image<I>& input, float sigma)
{
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
mln_concrete(I) output;
initialize(output, input);
@@ -789,14 +789,14 @@ namespace mln
* \p input
* This filter is applied in all the input image direction.
*
- * \pre input.has_data
+ * \pre input.is_valid
*/
template <class I>
inline
mln_concrete(I)
gaussian_2nd_derivative(const Image<I>& input, float sigma)
{
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
mln_concrete(I) output;
initialize(output, input);
diff --git a/milena/mln/linear/lap.hh b/milena/mln/linear/lap.hh
index 746b7ea..327096f 100644
--- a/milena/mln/linear/lap.hh
+++ b/milena/mln/linear/lap.hh
@@ -74,7 +74,7 @@ namespace mln
lap_4(const Image<I>& input)
{
trace::entering("linear::lap_4");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
int ws[] = { 0, 1, 0,
1, -4, 1,
0, 1, 0 };
@@ -89,7 +89,7 @@ namespace mln
lap_8(const Image<I>& input)
{
trace::entering("linear::lap_8");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
int ws[] = { 1, 1, 1,
1, -8, 1,
1, 1, 1 };
@@ -104,7 +104,7 @@ namespace mln
lap_x(const Image<I>& input)
{
trace::entering("linear::lap_x");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
int ws[] = { +2, -1, +2,
-1, -4, -1,
+2, -1, +2 };
@@ -119,7 +119,7 @@ namespace mln
lap_o(const Image<I>& input)
{
trace::entering("linear::lap_o");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
int ws[] = { -1, +2, -1,
+2, -4, +2,
-1, +2, -1 };
diff --git a/milena/mln/linear/local/convolve.hh b/milena/mln/linear/local/convolve.hh
index 522800a..ccb2be0 100644
--- a/milena/mln/linear/local/convolve.hh
+++ b/milena/mln/linear/local/convolve.hh
@@ -154,7 +154,7 @@ namespace mln
const Weighted_Window<W>& w_win,
R& result)
{
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
impl::convolve(mln_trait_image_speed(I)(), exact(input),
p, exact(w_win), result);
}
diff --git a/milena/mln/linear/log.hh b/milena/mln/linear/log.hh
index 51594aa..e975aba 100644
--- a/milena/mln/linear/log.hh
+++ b/milena/mln/linear/log.hh
@@ -72,7 +72,7 @@ namespace mln
LoG_5x5(const Image<I>& input)
{
trace::entering("linear::LoG_5x5");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
int ws[] = { +0, 0, -1, 0, 0,
+0, -1, -2, -1, 0,
-1, -2, 16, -2, -1,
@@ -91,7 +91,7 @@ namespace mln
LoG_7x7(const Image<I>& input)
{
trace::entering("linear::LoG_7x7");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
int ws[] = { +0, 0, -1, -1, -1, 0, 0,
+0, -1, -3, -3, -3, -1, 0,
-1, -3, 0, 7, 0, -3, -1,
@@ -112,7 +112,7 @@ namespace mln
LoG_13x13(const Image<I>& input)
{
trace::entering("linear::LoG_13x13");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
int ws[] = { +0, 0, 0, 0, 0, -1, -1, -1, 0, 0, 0, 0, 0,
+0, 0, 0, -1, -1, -2, -2, -2, -1, -1, 0, 0, 0,
+0, 0, -2, -2, -3, -3, -4, -3, -3, -2, -2, 0, 0,
@@ -139,7 +139,7 @@ namespace mln
LoG_17x17(const Image<I>& input)
{
trace::entering("linear::LoG_17x17");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
int ws[] = { +0, 0, 0, 0, 0, 0,-1,-1,-1,-1,-1, 0, 0, 0, 0, 0, 0,
+0, 0, 0, 0,-1,-1,-1,-1,-1,-1,-1,-1,-1, 0, 0, 0, 0,
+0, 0,-1,-1,-1,-2,-3,-3,-3,-3,-3,-2,-1,-1,-1, 0, 0,
diff --git a/milena/mln/linear/sobel_2d.hh b/milena/mln/linear/sobel_2d.hh
index b4cb1ff..1e74e98 100644
--- a/milena/mln/linear/sobel_2d.hh
+++ b/milena/mln/linear/sobel_2d.hh
@@ -91,7 +91,7 @@ namespace mln
sobel_2d_h(const Image<I>& input)
{
trace::entering("linear::sobel_2d_h");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
int wh[] = { -1, 0, 1 };
int wv[] = { 1,
@@ -110,7 +110,7 @@ namespace mln
sobel_2d_v(const Image<I>& input)
{
trace::entering("linear::sobel_2d_v");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
int wh[] = { 1, 2, 1 };
int wv[] = { -1,
@@ -128,7 +128,7 @@ namespace mln
sobel_2d(const Image<I>& input)
{
trace::entering("linear::sobel_2d");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
typedef mln_ch_convolve(I, int) J;
J h = sobel_2d_h(input),
@@ -146,7 +146,7 @@ namespace mln
sobel_2d_l1_norm(const Image<I>& input)
{
trace::entering("linear::sobel_2d_norm_l1");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
typedef mln_ch_convolve_grad(I, int) G;
G grad = sobel_2d(input);
diff --git a/milena/mln/logical/includes.hh b/milena/mln/logical/includes.hh
index edc336e..7ee1bda 100644
--- a/milena/mln/logical/includes.hh
+++ b/milena/mln/logical/includes.hh
@@ -57,8 +57,8 @@ namespace mln
const L& lhs = exact(lhs_);
const R& rhs = exact(rhs_);
- mln_precondition(lhs.has_data());
- mln_precondition(rhs.has_data());
+ mln_precondition(lhs.is_valid());
+ mln_precondition(rhs.is_valid());
mln_precondition(rhs.domain() == lhs.domain());
(void) lhs;
diff --git a/milena/mln/logical/not.hh b/milena/mln/logical/not.hh
index 6925c4d..2e15949 100644
--- a/milena/mln/logical/not.hh
+++ b/milena/mln/logical/not.hh
@@ -48,7 +48,7 @@ namespace mln
* \param[in] input the input image.
* \result The result image.
*
- * \pre \p input.has_data
+ * \pre \p input.is_valid
*/
template <typename I>
mln_concrete(I) not_(const Image<I>& input);
@@ -62,7 +62,7 @@ namespace mln
* for all p of input.domain \n
* input(p) = not input(p)
*
- * \pre \p input.has_data
+ * \pre \p input.is_valid
*/
template <typename I>
void not_inplace(Image<I>& input);
@@ -77,7 +77,7 @@ namespace mln
{
trace::entering("logical::not_");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
fun::v2b::lnot<mln_value(I)> f;
mln_concrete(I) output = level::transform(input, f);
@@ -92,7 +92,7 @@ namespace mln
{
trace::entering("logical::not_inplace");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
fun::v2b::lnot<mln_value(I)> f;
level::transform_inplace(input, f);
diff --git a/milena/mln/make/dual_neighb.hh b/milena/mln/make/dual_neighb.hh
index 99490d3..5f4e66f 100644
--- a/milena/mln/make/dual_neighb.hh
+++ b/milena/mln/make/dual_neighb.hh
@@ -70,7 +70,7 @@ namespace mln
const I& ima = exact(ima_);
const N& nbh_true = exact(nbh_true_);
const N& nbh_false = exact(nbh_false_);
- mln_precondition(ima.has_data());
+ mln_precondition(ima.is_valid());
typedef win::multiple_size< 2, mln_window(N), pw::value_<I> > W;
W win(pw::value(ima));
diff --git a/milena/mln/make/graph.hh b/milena/mln/make/graph.hh
index ac232e8..df76416 100644
--- a/milena/mln/make/graph.hh
+++ b/milena/mln/make/graph.hh
@@ -63,7 +63,7 @@ namespace mln
void
graph_tests(const Image<I>& iz, mln_value(I))
{
- mln_precondition(exact(iz).has_data());
+ mln_precondition(exact(iz).is_valid());
(void) iz;
}
diff --git a/milena/mln/morpho/closing.hh b/milena/mln/morpho/closing.hh
index e275760..6b9e843 100644
--- a/milena/mln/morpho/closing.hh
+++ b/milena/mln/morpho/closing.hh
@@ -57,7 +57,7 @@ namespace mln
mln_concrete(I) closing(const Image<I>& input, const Window<W>& win)
{
trace::entering("morpho::closing");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
mln_precondition(! exact(win).is_empty());
mln_concrete(I) output = erosion(dilation(input, win), win::sym(win));
diff --git a/milena/mln/morpho/closing_area.hh b/milena/mln/morpho/closing_area.hh
index cf140d1..bdd231f 100644
--- a/milena/mln/morpho/closing_area.hh
+++ b/milena/mln/morpho/closing_area.hh
@@ -61,7 +61,7 @@ namespace mln
trace::entering("morpho::closing_area");
typedef util::pix<I> pix_t;
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
mln_concrete(I) output;
output = closing_attribute< accu::count<pix_t> >(input, nbh, lambda);
diff --git a/milena/mln/morpho/closing_area_on_vertices.hh b/milena/mln/morpho/closing_area_on_vertices.hh
index f05067c..f0655e0 100644
--- a/milena/mln/morpho/closing_area_on_vertices.hh
+++ b/milena/mln/morpho/closing_area_on_vertices.hh
@@ -65,7 +65,7 @@ namespace mln
unsigned lambda)
{
trace::entering("morpho::closing_area_on_vertices");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
typedef p_edges<G, V2P> pe_t;
typedef accu::count_adjacent_vertices<P2V, pe_t> attribute_t;
diff --git a/milena/mln/morpho/closing_attribute.hh b/milena/mln/morpho/closing_attribute.hh
index f991e26..6cee789 100644
--- a/milena/mln/morpho/closing_attribute.hh
+++ b/milena/mln/morpho/closing_attribute.hh
@@ -108,7 +108,7 @@ namespace mln
{
trace::entering("morpho::closing_attribute");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
mln_concrete(I) output;
initialize(output, input);
diff --git a/milena/mln/morpho/closing_height.hh b/milena/mln/morpho/closing_height.hh
index e699a94..0a6e55f 100644
--- a/milena/mln/morpho/closing_height.hh
+++ b/milena/mln/morpho/closing_height.hh
@@ -62,7 +62,7 @@ namespace mln
{
trace::entering("morpho::closing_height");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
mln_concrete(I) output;
output = closing_attribute< accu::height<I> >(input, nbh, lambda);
diff --git a/milena/mln/morpho/closing_volume.hh b/milena/mln/morpho/closing_volume.hh
index 27993a1..61a4e50 100644
--- a/milena/mln/morpho/closing_volume.hh
+++ b/milena/mln/morpho/closing_volume.hh
@@ -60,7 +60,7 @@ namespace mln
{
trace::entering("morpho::closing_volume");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
mln_concrete(I) output;
output = closing_attribute< accu::volume<I> >(input, nbh, lambda);
diff --git a/milena/mln/morpho/complementation.hh b/milena/mln/morpho/complementation.hh
index 2bb63e3..3e3e1df 100644
--- a/milena/mln/morpho/complementation.hh
+++ b/milena/mln/morpho/complementation.hh
@@ -118,7 +118,7 @@ namespace mln
mln_concrete(I) complementation(const Image<I>& input)
{
trace::entering("morpho::complementation");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
mln_concrete(I) output = impl::complementation_(mln_trait_image_kind(I)(),
input);
@@ -132,7 +132,7 @@ namespace mln
void complementation_inplace(Image<I>& input)
{
trace::entering("morpho::complementation_inplace");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
impl::complementation_inplace_(mln_trait_image_kind(I)(),
input);
diff --git a/milena/mln/morpho/contrast.hh b/milena/mln/morpho/contrast.hh
index e3dc90f..7065aca 100644
--- a/milena/mln/morpho/contrast.hh
+++ b/milena/mln/morpho/contrast.hh
@@ -59,7 +59,7 @@ namespace mln
mln_concrete(I) contrast(const Image<I>& input, const Window<W>& win)
{
trace::entering("morpho::contrast");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
mln_precondition(! exact(win).is_empty());
mln_concrete(I) output =
diff --git a/milena/mln/morpho/dilation.hh b/milena/mln/morpho/dilation.hh
index 5d0b325..75cf97a 100644
--- a/milena/mln/morpho/dilation.hh
+++ b/milena/mln/morpho/dilation.hh
@@ -165,7 +165,7 @@ namespace mln
dilation(const Image<I>& input, const Window<W>& win)
{
trace::entering("morpho::dilation");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
mln_precondition(! exact(win).is_empty());
mln_concrete(I) output = general(dilation_op(), input, win);
diff --git a/milena/mln/morpho/elementary/closing.hh b/milena/mln/morpho/elementary/closing.hh
index 44f565f..fef94c5 100644
--- a/milena/mln/morpho/elementary/closing.hh
+++ b/milena/mln/morpho/elementary/closing.hh
@@ -61,7 +61,7 @@ namespace mln
{
trace::entering("morpho::elementary::closing");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
// mln_precondition(exact(nbh).is_valid());
mln_concrete(I) output = erosion(dilation(input, nbh), nbh);
diff --git a/milena/mln/morpho/elementary/dilation.hh b/milena/mln/morpho/elementary/dilation.hh
index c68442e..8488100 100644
--- a/milena/mln/morpho/elementary/dilation.hh
+++ b/milena/mln/morpho/elementary/dilation.hh
@@ -99,7 +99,7 @@ namespace mln
{
trace::entering("morpho::elementary::dilation");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
// mln_precondition(exact(nbh).is_valid());
mln_concrete(I) output = internal::dilation_dispatch(input, nbh);
diff --git a/milena/mln/morpho/elementary/erosion.hh b/milena/mln/morpho/elementary/erosion.hh
index 1993d8f..765dabe 100644
--- a/milena/mln/morpho/elementary/erosion.hh
+++ b/milena/mln/morpho/elementary/erosion.hh
@@ -99,7 +99,7 @@ namespace mln
{
trace::entering("morpho::elementary::erosion");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
// mln_precondition(exact(nbh).is_valid());
mln_concrete(I) output = internal::erosion_dispatch(input, nbh);
diff --git a/milena/mln/morpho/elementary/gradient.hh b/milena/mln/morpho/elementary/gradient.hh
index 9ec7126..9939f6d 100644
--- a/milena/mln/morpho/elementary/gradient.hh
+++ b/milena/mln/morpho/elementary/gradient.hh
@@ -61,7 +61,7 @@ namespace mln
void
gradient_tests(const Image<I>& input, const Neighborhood<N>& nbh)
{
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
// mln_precondition(exact(nbh).is_valid());
(void) input;
(void) nbh;
diff --git a/milena/mln/morpho/elementary/gradient_external.hh b/milena/mln/morpho/elementary/gradient_external.hh
index 0e9906e..6403845 100644
--- a/milena/mln/morpho/elementary/gradient_external.hh
+++ b/milena/mln/morpho/elementary/gradient_external.hh
@@ -110,7 +110,7 @@ namespace mln
{
trace::entering("morpho::elementary::gradient_external");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
// mln_precondition(exact(nbh).is_valid());
mln_concrete(I) output = internal::gradient_external_dispatch(input, nbh);
diff --git a/milena/mln/morpho/elementary/gradient_internal.hh b/milena/mln/morpho/elementary/gradient_internal.hh
index c3d9b4a..5bc3f3e 100644
--- a/milena/mln/morpho/elementary/gradient_internal.hh
+++ b/milena/mln/morpho/elementary/gradient_internal.hh
@@ -110,7 +110,7 @@ namespace mln
{
trace::entering("morpho::elementary::gradient_internal");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
// mln_precondition(exact(nbh).is_valid());
mln_concrete(I) output = internal::gradient_internal_dispatch(input, nbh);
diff --git a/milena/mln/morpho/elementary/laplacian.hh b/milena/mln/morpho/elementary/laplacian.hh
index 4882d22..87b0d92 100644
--- a/milena/mln/morpho/elementary/laplacian.hh
+++ b/milena/mln/morpho/elementary/laplacian.hh
@@ -65,7 +65,7 @@ namespace mln
{
trace::entering("morpho::elementary::laplacian");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
// mln_precondition(exact(nbh).is_valid());
mln_trait_op_minus_twice(mln_concrete(I)) output;
diff --git a/milena/mln/morpho/elementary/opening.hh b/milena/mln/morpho/elementary/opening.hh
index f778fa2..9b19087 100644
--- a/milena/mln/morpho/elementary/opening.hh
+++ b/milena/mln/morpho/elementary/opening.hh
@@ -61,7 +61,7 @@ namespace mln
{
trace::entering("morpho::elementary::opening");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
// mln_precondition(exact(nbh).is_valid());
mln_concrete(I) output = dilation(erosion(input, nbh), nbh);
diff --git a/milena/mln/morpho/elementary/top_hat.hh b/milena/mln/morpho/elementary/top_hat.hh
index 70e75c7..4bce465 100644
--- a/milena/mln/morpho/elementary/top_hat.hh
+++ b/milena/mln/morpho/elementary/top_hat.hh
@@ -88,7 +88,7 @@ namespace mln
const Neighborhood<N>& nbh)
{
trace::entering("morpho::elementary::top_hat_white");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
// mln_precondition(exact(nbh).is_valid());
mln_concrete(I) output = morpho::minus(input,
@@ -106,7 +106,7 @@ namespace mln
const Neighborhood<N>& nbh)
{
trace::entering("morpho::elementary::top_hat_black");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
// mln_precondition(exact(nbh).is_valid());
mln_concrete(I) output = morpho::minus(closing(input, nbh),
@@ -124,7 +124,7 @@ namespace mln
const Neighborhood<N>& nbh)
{
trace::entering("morpho::elementary::top_hat_self_complementary");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
// mln_precondition(exact(nbh).is_valid());
mln_concrete(I) output = morpho::minus(closing(input, nbh),
diff --git a/milena/mln/morpho/erosion.hh b/milena/mln/morpho/erosion.hh
index 2ec8d50..bc9aa64 100644
--- a/milena/mln/morpho/erosion.hh
+++ b/milena/mln/morpho/erosion.hh
@@ -165,7 +165,7 @@ namespace mln
erosion(const Image<I>& input, const Window<W>& win)
{
trace::entering("morpho::erosion");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
mln_precondition(! exact(win).is_empty());
mln_concrete(I) output = general(erosion_op(), input, win);
diff --git a/milena/mln/morpho/general.hh b/milena/mln/morpho/general.hh
index 31905f0..5ece056 100644
--- a/milena/mln/morpho/general.hh
+++ b/milena/mln/morpho/general.hh
@@ -80,7 +80,7 @@ namespace mln
const I& input = exact(input_);
const W& win = exact(win_);
- mln_precondition(input.has_data());
+ mln_precondition(input.is_valid());
mln_precondition(! win.is_empty());
// mln_precondition(win.is_valid());
@@ -171,7 +171,7 @@ namespace mln
general(const Op& op, const Image<I>& input, const Window<W>& win)
{
trace::entering("morpho::general");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
mln_precondition(! exact(win).is_empty());
internal::general_tests(op, input, win);
diff --git a/milena/mln/morpho/gradient.hh b/milena/mln/morpho/gradient.hh
index 824da06..aec9f40 100644
--- a/milena/mln/morpho/gradient.hh
+++ b/milena/mln/morpho/gradient.hh
@@ -79,7 +79,7 @@ namespace mln
mln_concrete(I) gradient(const Image<I>& input, const Window<W>& win)
{
trace::entering("morpho::gradient");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
mln_precondition(! exact(win).is_empty());
mln_concrete(I) output = morpho::minus(dilation(input, win),
@@ -96,7 +96,7 @@ namespace mln
mln_concrete(I) gradient_internal(const Image<I>& input, const Window<W>& win)
{
trace::entering("morpho::gradient_internal");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
mln_precondition(! exact(win).is_empty());
mln_concrete(I) output = morpho::minus(input,
@@ -113,7 +113,7 @@ namespace mln
mln_concrete(I) gradient_external(const Image<I>& input, const Window<W>& win)
{
trace::entering("morpho::gradient_external");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
mln_precondition(! exact(win).is_empty());
mln_concrete(I) output = morpho::minus(dilation(input, win),
diff --git a/milena/mln/morpho/hit_or_miss.hh b/milena/mln/morpho/hit_or_miss.hh
index 3b74d8b..044db91 100644
--- a/milena/mln/morpho/hit_or_miss.hh
+++ b/milena/mln/morpho/hit_or_miss.hh
@@ -122,7 +122,7 @@ namespace mln
const Wm& win_miss = exact(win_miss_);
// Tests.
- mln_precondition(input.has_data());
+ mln_precondition(input.is_valid());
mln_precondition((win_hit && win_miss).is_empty());
// Avoid warnings.
diff --git a/milena/mln/morpho/laplacian.hh b/milena/mln/morpho/laplacian.hh
index 6a3e83c..ae6898c 100644
--- a/milena/mln/morpho/laplacian.hh
+++ b/milena/mln/morpho/laplacian.hh
@@ -82,7 +82,7 @@ namespace mln
laplacian(const Image<I>& input, const Window<W>& win)
{
trace::entering("morpho::laplacian");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
mln_precondition(! exact(win).is_empty());
mln_trait_op_minus_twice(mln_concrete(I)) output;
diff --git a/milena/mln/morpho/opening.hh b/milena/mln/morpho/opening.hh
index 7691f4a..20d68f7 100644
--- a/milena/mln/morpho/opening.hh
+++ b/milena/mln/morpho/opening.hh
@@ -56,7 +56,7 @@ namespace mln
mln_concrete(I) opening(const Image<I>& input, const Window<W>& win)
{
trace::entering("morpho::opening");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
mln_precondition(! exact(win).is_empty());
mln_concrete(I) output = dilation(erosion(input, win), win::sym(win));
diff --git a/milena/mln/morpho/opening_area.hh b/milena/mln/morpho/opening_area.hh
index 211af4c..3bdd76d 100644
--- a/milena/mln/morpho/opening_area.hh
+++ b/milena/mln/morpho/opening_area.hh
@@ -61,7 +61,7 @@ namespace mln
trace::entering("morpho::opening_area");
typedef util::pix<I> pix_t;
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
mln_concrete(I) output;
output= opening_attribute< accu::count<pix_t> >(input, nbh, lambda);
diff --git a/milena/mln/morpho/opening_area_on_vertices.hh b/milena/mln/morpho/opening_area_on_vertices.hh
index a1d3b72..3dd1e12 100644
--- a/milena/mln/morpho/opening_area_on_vertices.hh
+++ b/milena/mln/morpho/opening_area_on_vertices.hh
@@ -65,7 +65,7 @@ namespace mln
{
trace::entering("morpho::opening_area_on_vertices");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
typedef p_edges<G, V2P> pe_t;
typedef accu::count_adjacent_vertices<P2V, pe_t> attribute_t;
diff --git a/milena/mln/morpho/opening_attribute.hh b/milena/mln/morpho/opening_attribute.hh
index 97dc514..f3cc148 100644
--- a/milena/mln/morpho/opening_attribute.hh
+++ b/milena/mln/morpho/opening_attribute.hh
@@ -110,7 +110,7 @@ namespace mln
{
trace::entering("morpho::opening_attribute");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
mln_concrete(I) output;
initialize(output, input);
diff --git a/milena/mln/morpho/opening_height.hh b/milena/mln/morpho/opening_height.hh
index 36ace8f..a51ec00 100644
--- a/milena/mln/morpho/opening_height.hh
+++ b/milena/mln/morpho/opening_height.hh
@@ -59,7 +59,7 @@ namespace mln
unsigned lambda)
{
trace::entering("morpho::opening_height");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
mln_concrete(I) output;
output = opening_attribute< accu::height<I> >(input, nbh, lambda);
diff --git a/milena/mln/morpho/opening_volume.hh b/milena/mln/morpho/opening_volume.hh
index 127ae2c..ff61be1 100644
--- a/milena/mln/morpho/opening_volume.hh
+++ b/milena/mln/morpho/opening_volume.hh
@@ -59,7 +59,7 @@ namespace mln
unsigned lambda)
{
trace::entering("morpho::opening_volume");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
mln_concrete(I) output;
output = opening_attribute< accu::volume<I> >(input, nbh, lambda);
diff --git a/milena/mln/morpho/rank_filter.hh b/milena/mln/morpho/rank_filter.hh
index eb24567..fe99eb9 100644
--- a/milena/mln/morpho/rank_filter.hh
+++ b/milena/mln/morpho/rank_filter.hh
@@ -62,7 +62,7 @@ namespace mln
const I& input = exact(input_);
const W& win = exact(win_);
- mln_precondition(input.has_data());
+ mln_precondition(input.is_valid());
mln_precondition(! win.is_empty());
(void) input;
(void) win;
@@ -168,7 +168,7 @@ namespace mln
rank_filter(const Image<I>& input, const Window<W>& win, unsigned k)
{
trace::entering("morpho::rank_filter");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
mln_precondition(! exact(win).is_empty());
mln_concrete(I) output = internal::rank_filter_dispatch(exact(input), exact(win), k);
diff --git a/milena/mln/morpho/thickening.hh b/milena/mln/morpho/thickening.hh
index 13d7877..31a8791 100644
--- a/milena/mln/morpho/thickening.hh
+++ b/milena/mln/morpho/thickening.hh
@@ -70,7 +70,7 @@ namespace mln
const Wbg& win_bg = exact(win_bg_);
// Tests.
- mln_precondition(input.has_data());
+ mln_precondition(input.is_valid());
mln_precondition(win_bg.is_centered());
mln_precondition(! win_fg.is_empty());
mln_precondition((win_fg && win_bg).is_empty());
diff --git a/milena/mln/morpho/thin_fit.hh b/milena/mln/morpho/thin_fit.hh
index cc83e50..52ed0f8 100644
--- a/milena/mln/morpho/thin_fit.hh
+++ b/milena/mln/morpho/thin_fit.hh
@@ -70,7 +70,7 @@ namespace mln
const Wbg& win_bg = exact(win_bg_);
// Tests.
- mln_precondition(input.has_data());
+ mln_precondition(input.is_valid());
mln_precondition(win_fg.is_centered());
mln_precondition((win_fg && win_bg).is_empty());
diff --git a/milena/mln/morpho/thinning.hh b/milena/mln/morpho/thinning.hh
index 94c550c..a8b862d 100644
--- a/milena/mln/morpho/thinning.hh
+++ b/milena/mln/morpho/thinning.hh
@@ -73,7 +73,7 @@ namespace mln
const Wbg& win_bg = exact(win_bg_);
// Tests.
- mln_precondition(input.has_data());
+ mln_precondition(input.is_valid());
mln_precondition(win_bg.is_centered());
mln_precondition(! win_bg.is_empty());
mln_precondition((win_fg && win_bg).is_empty());
diff --git a/milena/mln/morpho/top_hat.hh b/milena/mln/morpho/top_hat.hh
index 4f789ba..f76897a 100644
--- a/milena/mln/morpho/top_hat.hh
+++ b/milena/mln/morpho/top_hat.hh
@@ -82,7 +82,7 @@ namespace mln
mln_concrete(I) top_hat_white(const Image<I>& input, const Window<W>& win)
{
trace::entering("morpho::top_hat_white");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
mln_precondition(! exact(win).is_empty());
mln_concrete(I) output = morpho::minus(input,
@@ -98,7 +98,7 @@ namespace mln
mln_concrete(I) top_hat_black(const Image<I>& input, const Window<W>& win)
{
trace::entering("morpho::top_hat_black");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
mln_precondition(! exact(win).is_empty());
mln_concrete(I) output = morpho::minus(closing(input, win),
@@ -114,7 +114,7 @@ namespace mln
mln_concrete(I) top_hat_self_complementary(const Image<I>& input, const Window<W>& win)
{
trace::entering("morpho::top_hat_self_complementary");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
mln_precondition(! exact(win).is_empty());
mln_concrete(I) output = morpho::minus(closing(input, win),
diff --git a/milena/mln/morpho/tree/compute_parent.hh b/milena/mln/morpho/tree/compute_parent.hh
index b2d42aa..7cfc1d6 100644
--- a/milena/mln/morpho/tree/compute_parent.hh
+++ b/milena/mln/morpho/tree/compute_parent.hh
@@ -91,7 +91,7 @@ namespace mln
const N& nbh = exact(nbh_);
const S& s = exact(s_);
- mln_precondition(f.has_data());
+ mln_precondition(f.is_valid());
// mln_precondition(nbh.is_valid());
mln_precondition(s == f.domain());
diff --git a/milena/mln/morpho/tree/data.hh b/milena/mln/morpho/tree/data.hh
index dd23160..c7c7f86 100644
--- a/milena/mln/morpho/tree/data.hh
+++ b/milena/mln/morpho/tree/data.hh
@@ -88,7 +88,7 @@ namespace mln
bool is_valid() const
{
- return parent_.has_data(); // FIXME: and... (?)
+ return parent_.is_valid(); // FIXME: and... (?)
}
bool is_root(const mln_psite(I)& p) const
diff --git a/milena/mln/morpho/tree/max.hh b/milena/mln/morpho/tree/max.hh
index 708375c..b904fff 100644
--- a/milena/mln/morpho/tree/max.hh
+++ b/milena/mln/morpho/tree/max.hh
@@ -68,7 +68,7 @@ namespace mln
const I& f = exact(f_);
const N& nbh = exact(nbh_);
- mln_precondition(f.has_data());
+ mln_precondition(f.is_valid());
// mln_precondition(nbh.is_valid());
// For the max-tree, childhood maps "increasing level":
diff --git a/milena/mln/morpho/tree/utils.hh b/milena/mln/morpho/tree/utils.hh
index 8bc37ff..f9f09a0 100644
--- a/milena/mln/morpho/tree/utils.hh
+++ b/milena/mln/morpho/tree/utils.hh
@@ -79,8 +79,8 @@ namespace mln
const T& parent = exact(parent_);
const I& f = exact(f_);
- mln_precondition(parent.has_data());
- mln_precondition(f.has_data());
+ mln_precondition(parent.is_valid());
+ mln_precondition(f.is_valid());
mln_precondition(parent.domain() == f.domain());
return parent(p) == p;
@@ -98,8 +98,8 @@ namespace mln
const T& parent = exact(parent_);
const I& f = exact(f_);
- mln_precondition(parent.has_data());
- mln_precondition(f.has_data());
+ mln_precondition(parent.is_valid());
+ mln_precondition(f.is_valid());
mln_precondition(parent.domain() == f.domain());
return parent(p) == p || f(parent(p)) != f(p);
@@ -117,8 +117,8 @@ namespace mln
const I& f = exact(f_);
const S& s = exact(s_);
- mln_precondition(parent.has_data());
- mln_precondition(f.has_data());
+ mln_precondition(parent.is_valid());
+ mln_precondition(f.is_valid());
mln_precondition(f.domain() == parent.domain());
mln_precondition(s == f.domain());
diff --git a/milena/mln/pw/value.hh b/milena/mln/pw/value.hh
index c237653..82238dc 100644
--- a/milena/mln/pw/value.hh
+++ b/milena/mln/pw/value.hh
@@ -107,7 +107,7 @@ namespace mln
value_<I>
value(const Image<I>& ima)
{
- mln_precondition(exact(ima).has_data());
+ mln_precondition(exact(ima).is_valid());
value_<I> tmp(exact(ima));
return tmp;
}
diff --git a/milena/mln/subsampling/gaussian_subsampling.hh b/milena/mln/subsampling/gaussian_subsampling.hh
index 4e20a1b..41e966e 100644
--- a/milena/mln/subsampling/gaussian_subsampling.hh
+++ b/milena/mln/subsampling/gaussian_subsampling.hh
@@ -67,7 +67,7 @@ namespace mln
const mln_deduce(I, site, coord)& gap)
{
trace::entering("subsampling::gaussian_subsampling");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
mln_concrete(I) temp(exact(input).domain());
mln_concrete(I) output(geom::nrows(input) / gap,
diff --git a/milena/mln/subsampling/subsampling.hh b/milena/mln/subsampling/subsampling.hh
index 11a5944..fee6f97 100644
--- a/milena/mln/subsampling/subsampling.hh
+++ b/milena/mln/subsampling/subsampling.hh
@@ -92,7 +92,7 @@ namespace mln
const mln_deduce(I, site, coord)& gap)
{
trace::entering("subsampling::subsampling");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
mln_concrete(I) output(geom::nrows(input) / gap,
geom::ncols(input) / gap); // FIXME: only 2d here
diff --git a/milena/mln/test/positive.hh b/milena/mln/test/positive.hh
index e796952..641d728 100644
--- a/milena/mln/test/positive.hh
+++ b/milena/mln/test/positive.hh
@@ -57,7 +57,7 @@ namespace mln
bool positive(const Image<I>& input_)
{
const I& input = exact(input_);
- mln_precondition(input.has_data());
+ mln_precondition(input.is_valid());
// FIXME: Below the '>=' op should properly work with signed/unsigned without
// FIXME: warnings; so we really need to overload ops for functions when literals
// FIXME: are involved.
diff --git a/milena/mln/test/predicate.hh b/milena/mln/test/predicate.hh
index 5dd110e..25db39e 100644
--- a/milena/mln/test/predicate.hh
+++ b/milena/mln/test/predicate.hh
@@ -148,7 +148,7 @@ namespace mln
inline
bool predicate(const Image<I>& ima, const Function_v2b<F>& f)
{
- mln_precondition(exact(ima).has_data());
+ mln_precondition(exact(ima).is_valid());
return impl::predicate_(mln_trait_image_speed(I)(), exact(ima),
exact(f));
}
@@ -161,8 +161,8 @@ namespace mln
const I& lhs = exact(lhs_);
const J& rhs = exact(rhs_);
- mln_precondition(lhs.has_data());
- mln_precondition(rhs.has_data());
+ mln_precondition(lhs.is_valid());
+ mln_precondition(rhs.is_valid());
mln_precondition(lhs.domain() == rhs.domain());
return impl::predicate_(mln_trait_image_speed(I)(),
diff --git a/milena/mln/transform/distance_front.hh b/milena/mln/transform/distance_front.hh
index 817082e..4e9feb9 100644
--- a/milena/mln/transform/distance_front.hh
+++ b/milena/mln/transform/distance_front.hh
@@ -60,7 +60,7 @@ namespace mln
{
trace::entering("transform::distance_front");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
// mln_precondition(exact(nbh).is_valid());
// mln_precondition(exact(w_win).is_valid());
diff --git a/milena/mln/transform/distance_geodesic.hh b/milena/mln/transform/distance_geodesic.hh
index 1564911..e076309 100644
--- a/milena/mln/transform/distance_geodesic.hh
+++ b/milena/mln/transform/distance_geodesic.hh
@@ -58,7 +58,7 @@ namespace mln
{
trace::entering("transform::distance_geodesic");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
// mln_precondition(exact(nbh).is_valid());
mln_ch_value(I, D) output;
diff --git a/milena/mln/transform/influence_zone_front.hh b/milena/mln/transform/influence_zone_front.hh
index f25b463..014f5d6 100644
--- a/milena/mln/transform/influence_zone_front.hh
+++ b/milena/mln/transform/influence_zone_front.hh
@@ -64,7 +64,7 @@ namespace mln
{
trace::entering("transform::influence_zone_front");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
// mln_precondition(exact(nbh).is_valid());
// mln_precondition(exact(w_win).is_valid());
diff --git a/milena/mln/transform/influence_zone_geodesic.hh b/milena/mln/transform/influence_zone_geodesic.hh
index 2f73139..ca8e56b 100644
--- a/milena/mln/transform/influence_zone_geodesic.hh
+++ b/milena/mln/transform/influence_zone_geodesic.hh
@@ -65,7 +65,7 @@ namespace mln
{
trace::entering("transform::influence_zone_geodesic");
- mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).is_valid());
// mln_precondition(exact(nbh).is_valid());
internal::influence_zone_functor<I> f;
diff --git a/milena/mln/value/stack.hh b/milena/mln/value/stack.hh
index 877f74c..c1df060 100644
--- a/milena/mln/value/stack.hh
+++ b/milena/mln/value/stack.hh
@@ -182,7 +182,7 @@ namespace mln
void init_(const algebra::vec<n,I>& imas);
/// Test if this image has been initialized.
- bool has_data() const;
+ bool is_valid() const;
/// Read-only access of pixel value at point site \p p.
rvalue operator()(const psite& p) const;
@@ -248,16 +248,16 @@ namespace mln
this->data_ = new mln::internal::data< stack_image<n, I> >(imas);
for (unsigned i = 0; i < n; ++i)
{
- mln_precondition(imas[i].has_data());
+ mln_precondition(imas[i].is_valid());
}
}
template <unsigned n, typename I>
inline
- bool stack_image<n,I>::has_data() const
+ bool stack_image<n,I>::is_valid() const
{
for (unsigned i = 0; i < n; ++i)
- mln_invariant(this->data_->imas_[i].has_data());
+ mln_invariant(this->data_->imas_[i].is_valid());
return true;
}
--
1.5.6.5
1
0
* mln/core/image/complex_image.hh: update comments.
* mln/core/image/complex_neighborhood_piter.hh: avoid a warning.
* mln/core/internal/site_relative_iterator_base.hh: call center_at_()
earlier.
* mln/core/site_set/p_vertices.hh: call the proper graph() method.
* mln/fun/v2v/ch_function_value.hh,
* mln/trait/ch_function_value.hh: fix a recursive inclusion.
* tests/core/image/graph_image.cc: fix layout.
* tests/core/image/line_graph_image.cc: cleanup includes.
* tests/level/paste_full.cc: move to...
* tests/data/paste_full.cc: ... this file.
* tests/level/Makefile.am: remove obsolete entries.
* tests/histo/to_image1d.cc: Fix compilation issue. An incorrect image
type was expected.
* tools/area_flooding.cc: fix a warning.
* tests/core/site_set/p_vertices.cc: The function mapping vertices to
sites was not large enough to hold all the values.
* mln/fun/x2v/bilinear.hh: avoid warnings using static_cast.
---
milena/ChangeLog | 35 ++++++++++++++++++++
milena/mln/core/image/complex_image.hh | 7 ++--
.../mln/core/image/complex_neighborhood_piter.hh | 2 +-
.../core/internal/site_relative_iterator_base.hh | 2 +-
milena/mln/core/site_set/p_vertices.hh | 2 +-
milena/mln/fun/v2v/ch_function_value.hh | 4 ++-
milena/mln/fun/x2v/bilinear.hh | 8 ++--
milena/mln/trait/ch_function_value.hh | 9 +++--
milena/tests/core/image/graph_image.cc | 6 ++--
milena/tests/core/image/line_graph_image.cc | 11 ++----
milena/tests/core/site_set/p_vertices.cc | 4 +-
milena/tests/{level => data}/paste_full.cc | 0
milena/tests/histo/to_image1d.cc | 10 +++---
milena/tests/level/Makefile.am | 8 ----
milena/tools/area_flooding.cc | 4 +--
15 files changed, 69 insertions(+), 43 deletions(-)
rename milena/tests/{level => data}/paste_full.cc (100%)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 8952f82..d5c4ca8 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,40 @@
2008-12-31 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Various small fixes (again).
+
+ * mln/core/image/complex_image.hh: update comments.
+
+ * mln/core/image/complex_neighborhood_piter.hh: avoid a warning.
+
+ * mln/core/internal/site_relative_iterator_base.hh: call center_at_()
+ earlier.
+
+ * mln/core/site_set/p_vertices.hh: call the proper graph() method.
+
+ * mln/fun/v2v/ch_function_value.hh,
+ * mln/trait/ch_function_value.hh: fix a recursive inclusion.
+
+ * tests/core/image/graph_image.cc: fix layout.
+
+ * tests/core/image/line_graph_image.cc: cleanup includes.
+
+ * tests/level/paste_full.cc: move to...
+ * tests/data/paste_full.cc: ... this file.
+
+ * tests/level/Makefile.am: remove obsolete entries.
+
+ * tests/histo/to_image1d.cc: Fix compilation issue. An incorrect image
+ type was expected.
+
+ * tools/area_flooding.cc: fix a warning.
+
+ * tests/core/site_set/p_vertices.cc: The function mapping vertices to
+ sites was not large enough to hold all the values.
+
+ * mln/fun/x2v/bilinear.hh: avoid warnings using static_cast.
+
+2008-12-31 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Re-enable tests in morpho and make them work again.
* tests/morpho/Makefile.am: re-enable all tests.
diff --git a/milena/mln/core/image/complex_image.hh b/milena/mln/core/image/complex_image.hh
index 1d37cea..0e98c4e 100644
--- a/milena/mln/core/image/complex_image.hh
+++ b/milena/mln/core/image/complex_image.hh
@@ -29,7 +29,8 @@
# define MLN_CORE_IMAGE_COMPLEX_IMAGE_HH
/// \file mln/core/image/complex_image.hh
-/// \brief Definition of a line complex-based image.
+///
+/// Definition of a line complex-based image.
# include <vector>
@@ -113,7 +114,7 @@ namespace mln
} // end of namespace mln::trait
- /// \brief Image based on a complex.
+ /// Image based on a complex.
///
/// Values attached to each face of the complex.
///
@@ -133,7 +134,7 @@ namespace mln
/// Value associated type.
typedef V value;
- /// \brief Return type of read-write access.
+ /// Return type of read-write access.
///
/// We use the associated type \c reference instead of a plain
/// reference on th value type (\tparam V), because it's the only way
diff --git a/milena/mln/core/image/complex_neighborhood_piter.hh b/milena/mln/core/image/complex_neighborhood_piter.hh
index f57588b..0a91f30 100644
--- a/milena/mln/core/image/complex_neighborhood_piter.hh
+++ b/milena/mln/core/image/complex_neighborhood_piter.hh
@@ -240,7 +240,7 @@ namespace mln
template <typename Pref>
inline
void
- complex_neighborhood_fwd_piter<I, G, N>::center_at_(const Pref& c)
+ complex_neighborhood_fwd_piter<I, G, N>::center_at_(const Pref&)
{
iter_.center_at(this->center().face());
}
diff --git a/milena/mln/core/internal/site_relative_iterator_base.hh b/milena/mln/core/internal/site_relative_iterator_base.hh
index c65503f..7a662b6 100644
--- a/milena/mln/core/internal/site_relative_iterator_base.hh
+++ b/milena/mln/core/internal/site_relative_iterator_base.hh
@@ -141,8 +141,8 @@ namespace mln
{
mlc_converts_to(P, const mln_psite(S)&)::check();
c_ = & static_cast< const mln_psite(S)& >(c);
- this->invalidate();
exact(this)->center_at_(c);
+ this->invalidate();
}
template <typename S, typename E>
diff --git a/milena/mln/core/site_set/p_vertices.hh b/milena/mln/core/site_set/p_vertices.hh
index 0ebab63..cf78f0a 100644
--- a/milena/mln/core/site_set/p_vertices.hh
+++ b/milena/mln/core/site_set/p_vertices.hh
@@ -320,7 +320,7 @@ namespace mln
bool
operator==(const p_vertices<G,F>& lhs, const p_vertices<G,F>& rhs)
{
- return (lhs.g_) == (rhs.g_);
+ return (lhs.graph()) == (rhs.graph());
}
template <typename G, typename F>
diff --git a/milena/mln/fun/v2v/ch_function_value.hh b/milena/mln/fun/v2v/ch_function_value.hh
index a4c7ca4..e1f97f8 100644
--- a/milena/mln/fun/v2v/ch_function_value.hh
+++ b/milena/mln/fun/v2v/ch_function_value.hh
@@ -34,7 +34,6 @@
/// Wrap a function v2v and convert its result to another type.
# include <mln/core/concept/function.hh>
-# include <mln/convert/to.hh>
# include <mln/fun/internal/ch_function_value_impl.hh>
@@ -42,6 +41,9 @@
namespace mln
{
+ // Forward declaration.
+ namespace convert { template <typename T, typename O> T to(const O& from); }
+
namespace fun
{
diff --git a/milena/mln/fun/x2v/bilinear.hh b/milena/mln/fun/x2v/bilinear.hh
index b997da2..1b7578d 100644
--- a/milena/mln/fun/x2v/bilinear.hh
+++ b/milena/mln/fun/x2v/bilinear.hh
@@ -98,10 +98,10 @@ namespace mln
double y2 = std::floor(v[1]) + 1;
//if (not ima.has(point2d(x1, y1))) return mln_value(I)();
- vsum q11 = ima(point2d(x1, y1));
- vsum q12 = ima(point2d(x1, y2));
- vsum q21 = ima(point2d(x2, y1));
- vsum q22 = ima(point2d(x2, y2));
+ vsum q11 = ima(point2d(static_cast<unsigned>(x1), static_cast<unsigned>(y1)));
+ vsum q12 = ima(point2d(static_cast<unsigned>(x1), static_cast<unsigned>(y2)));
+ vsum q21 = ima(point2d(static_cast<unsigned>(x2), static_cast<unsigned>(y1)));
+ vsum q22 = ima(point2d(static_cast<unsigned>(x2), static_cast<unsigned>(y2)));
double x2_x1 = x2 - x1;
double y2_y1 = y2 - y1;
diff --git a/milena/mln/trait/ch_function_value.hh b/milena/mln/trait/ch_function_value.hh
index 6ed1e47..ddb499d 100644
--- a/milena/mln/trait/ch_function_value.hh
+++ b/milena/mln/trait/ch_function_value.hh
@@ -44,12 +44,13 @@ mln::trait::ch_functionvalue< I, V >::ret
namespace mln
{
- namespace trait
- {
+ // Forward declarations.
+ namespace trait { template <typename F, typename V> struct ch_function_value; }
+ namespace fun { namespace i2v { template <typename T> class array; } }
- // Forward declaration.
- template <typename F, typename V> struct ch_function_value;
+ namespace trait
+ {
namespace impl
{
diff --git a/milena/tests/core/image/graph_image.cc b/milena/tests/core/image/graph_image.cc
index 20e0961..2e88446 100644
--- a/milena/tests/core/image/graph_image.cc
+++ b/milena/tests/core/image/graph_image.cc
@@ -95,7 +95,7 @@ int main()
// Edges.
util::graph g;
// Populate the graph with vertices.
- for(unsigned i = 0; i < sites.size(); ++i)
+ for (unsigned i = 0; i < sites.size(); ++i)
g.add_vertex();
// Populate the graph with edges.
g.add_edge(0, 1);
@@ -120,11 +120,11 @@ int main()
// Graph values.
typedef fun::i2v::array<unsigned> viota_t;
viota_t iota(pv.nsites());
- for(unsigned i = 0; i < iota.size(); ++i)
+ for (unsigned i = 0; i < iota.size(); ++i)
iota(i) = 10 + i;
// Create graph image.
- mln_const_VAR(ima,(iota | pv));
+ mln_const_VAR(ima, (iota | pv));
{
// FIXME: Move this part to a special test case.
diff --git a/milena/tests/core/image/line_graph_image.cc b/milena/tests/core/image/line_graph_image.cc
index e7008e7..981a09a 100644
--- a/milena/tests/core/image/line_graph_image.cc
+++ b/milena/tests/core/image/line_graph_image.cc
@@ -29,20 +29,17 @@
///
/// Tests on mln::graph_image.
-#include <vector>
-
#include <mln/core/alias/point2d.hh>
-#include <mln/pw/all.hh>
-#include <mln/core/image/line_graph_elt_window.hh>
+/// Required for line graph images.
#include <mln/core/site_set/p_edges.hh>
+#include <mln/core/image/line_graph_elt_window.hh>
#include <mln/core/neighb.hh>
-
+#include <mln/core/var.hh>
+#include <mln/pw/all.hh>
#include <mln/fun/i2v/array.hh>
-
#include <mln/util/graph.hh>
-#include <mln/core/var.hh>
/* The graph and its corresponding line graph are as follows:
diff --git a/milena/tests/core/site_set/p_vertices.cc b/milena/tests/core/site_set/p_vertices.cc
index e74d9c5..bcce18a 100644
--- a/milena/tests/core/site_set/p_vertices.cc
+++ b/milena/tests/core/site_set/p_vertices.cc
@@ -57,8 +57,8 @@ int main()
// Map vertices to sites.
typedef fun::i2v::array<point2d> F;
- F f(5);
- for (unsigned i = 0; i < 5; ++i)
+ F f(6);
+ for (unsigned i = 0; i < 6; ++i)
f(i) = point2d(i, 0);
typedef p_vertices<util::graph, F> p_vertices;
diff --git a/milena/tests/level/paste_full.cc b/milena/tests/data/paste_full.cc
similarity index 100%
rename from milena/tests/level/paste_full.cc
rename to milena/tests/data/paste_full.cc
diff --git a/milena/tests/histo/to_image1d.cc b/milena/tests/histo/to_image1d.cc
index cc6ba46..ee09b85 100644
--- a/milena/tests/histo/to_image1d.cc
+++ b/milena/tests/histo/to_image1d.cc
@@ -1,4 +1,5 @@
// 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
@@ -25,10 +26,9 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/histo/to_image1d.cc
- *
- * \brief Tests on mln::accu::histo and mln::histo::data.
- */
+/// \file tests/histo/to_image1d.cc
+///
+/// Tests on mln::accu::histo and mln::histo::data.
#include <iterator>
@@ -71,7 +71,7 @@ int main()
histo::data<int_u8> h = histo::compute(ima);
std::cout << h << std::endl;
- image1d<std::size_t> ima2 = convert::to_image(h);
+ image1d<unsigned> ima2 = convert::to_image(h);
debug::println(ima2);
}
}
diff --git a/milena/tests/level/Makefile.am b/milena/tests/level/Makefile.am
index 8da9ef0..8e62b6b 100644
--- a/milena/tests/level/Makefile.am
+++ b/milena/tests/level/Makefile.am
@@ -11,15 +11,11 @@ check_PROGRAMS = \
compare \
compute \
convert \
- fill \
- fill_with_value \
- fill_with_image \
median \
median_ \
median_dir \
median_fast \
median_hline2d \
- paste \
saturate \
sort_psites \
stretch \
@@ -33,15 +29,11 @@ apply_SOURCES = apply.cc
compare_SOURCES = compare.cc
compute_SOURCES = compute.cc
convert_SOURCES = convert.cc
-fill_SOURCES = fill.cc
-fill_with_value_SOURCES = fill_with_value.cc
-fill_with_image_SOURCES = fill_with_image.cc
median_SOURCES = median.cc
median__SOURCES = median_.cc
median_dir_SOURCES = median_dir.cc
median_fast_SOURCES = median_fast.cc
median_hline2d_SOURCES = median_hline2d.cc
-paste_SOURCES = paste.cc
saturate_SOURCES = saturate.cc
sort_psites_SOURCES = sort_psites.cc
stretch_SOURCES = stretch.cc
diff --git a/milena/tools/area_flooding.cc b/milena/tools/area_flooding.cc
index 0157f9c..10abdb7 100644
--- a/milena/tools/area_flooding.cc
+++ b/milena/tools/area_flooding.cc
@@ -164,8 +164,6 @@ int main(int argc, char* argv[])
for_all(p)
if (wshed(p) != wshed_label)
{
- // FIXME: Equip the iterator with first() and second()
- // accessors?
wshed2d(p.first()) = wshed(p);
wshed2d(p.second()) = wshed(p);
}
@@ -186,7 +184,7 @@ int main(int argc, char* argv[])
// Create an output image using the average gray levels of the basins.
orig_ima_t output(input.domain());
for_all(q)
- output(q) = average[wshed2d(q)];
+ output(q) = convert::to<mln_value_(orig_ima_t)>(average[wshed2d(q)]);
std::cout << "area = " << area << " \t"
<< "nregions = " << nregions << std::endl;
--
1.5.6.5
1
0
31 Dec '08
* tests/morpho/Makefile.am: re-enable all tests.
* tests/morpho/artificial_line_graph_image_wst.cc,
* tests/morpho/graph_image_morpho.cc,
* tests/morpho/graph_image_wst.cc,
* tests/morpho/lena_line_graph_image_wst1.cc,
* tests/morpho/lena_line_graph_image_wst2.cc,
* tests/morpho/line_graph_image_morpho.cc,
* tests/morpho/line_graph_image_wst.cc: update according the new graph
structures.
---
milena/ChangeLog | 15 +++
milena/tests/morpho/Makefile.am | 35 +++---
.../morpho/artificial_line_graph_image_wst.cc | 40 ++++----
milena/tests/morpho/graph_image_morpho.cc | 99 ++++++++----------
milena/tests/morpho/graph_image_wst.cc | 78 ++++++++------
milena/tests/morpho/lena_line_graph_image_wst1.cc | 89 ++++++++--------
milena/tests/morpho/lena_line_graph_image_wst2.cc | 37 +++----
milena/tests/morpho/line_graph_image_morpho.cc | 91 ++++++++--------
milena/tests/morpho/line_graph_image_wst.cc | 115 +++++++++++---------
9 files changed, 311 insertions(+), 288 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index c42010f..8952f82 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,20 @@
2008-12-31 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Re-enable tests in morpho and make them work again.
+
+ * tests/morpho/Makefile.am: re-enable all tests.
+
+ * tests/morpho/artificial_line_graph_image_wst.cc,
+ * tests/morpho/graph_image_morpho.cc,
+ * tests/morpho/graph_image_wst.cc,
+ * tests/morpho/lena_line_graph_image_wst1.cc,
+ * tests/morpho/lena_line_graph_image_wst2.cc,
+ * tests/morpho/line_graph_image_morpho.cc,
+ * tests/morpho/line_graph_image_wst.cc: update according the new graph
+ structures.
+
+2008-12-31 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Re-enable tools/area_flooding.
* tools/Makefile.am: enable the target.
diff --git a/milena/tests/morpho/Makefile.am b/milena/tests/morpho/Makefile.am
index a8f12ab..003ba6f 100644
--- a/milena/tests/morpho/Makefile.am
+++ b/milena/tests/morpho/Makefile.am
@@ -2,13 +2,12 @@
include $(top_srcdir)/milena/tests/tests.mk
-##FIXME: re-enable all tests
SUBDIRS = \
elementary \
tree
check_PROGRAMS = \
-## artificial_line_graph_image_wst \
+ artificial_line_graph_image_wst \
closing_area \
closing_height \
closing_volume \
@@ -20,14 +19,14 @@ check_PROGRAMS = \
erosion \
general \
gradient \
-## graph_image_morpho \
-## graph_image_wst \
+ graph_image_morpho \
+ graph_image_wst \
hit_or_miss \
laplacian \
-## lena_line_graph_image_wst1 \
-## lena_line_graph_image_wst2 \
-## line_graph_image_wst \
-## line_graph_image_morpho \
+ lena_line_graph_image_wst1 \
+ lena_line_graph_image_wst2 \
+ line_graph_image_wst \
+ line_graph_image_morpho \
meyer_wst \
meyer_wst_long \
opening_area \
@@ -58,11 +57,11 @@ hit_or_miss_SOURCES = hit_or_miss.cc
laplacian_SOURCES = laplacian.cc
thinning_SOURCES = thinning.cc
-##graph_image_morpho_SOURCES = graph_image_morpho.cc
-##graph_image_wst_SOURCES = graph_image_wst.cc
+graph_image_morpho_SOURCES = graph_image_morpho.cc
+graph_image_wst_SOURCES = graph_image_wst.cc
-##line_graph_image_morpho_SOURCES = line_graph_image_morpho.cc
-##line_graph_image_wst_SOURCES = line_graph_image_wst.cc
+line_graph_image_morpho_SOURCES = line_graph_image_morpho.cc
+line_graph_image_wst_SOURCES = line_graph_image_wst.cc
complex_image_morpho_SOURCES = complex_image_morpho.cc
complex_image_wst_SOURCES = complex_image_wst.cc
@@ -79,17 +78,17 @@ combined_SOURCES = combined.cc
# Complex tests. #
# --------------- #
-##artificial_line_graph_image_wst_SOURCES = artificial_line_graph_image_wst.cc
-##artificial_line_graph_image_wst_CXXFLAGS = $(TESTS_CXXFLAGS_SPEED)
+artificial_line_graph_image_wst_SOURCES = artificial_line_graph_image_wst.cc
+artificial_line_graph_image_wst_CXXFLAGS = $(TESTS_CXXFLAGS_SPEED)
dilation_SOURCES = dilation.cc
dilation_CXXFLAGS = $(TESTS_CXXFLAGS_SPEED)
-##lena_line_graph_image_wst1_SOURCES = lena_line_graph_image_wst1.cc
-##lena_line_graph_image_wst1_CXXFLAGS = $(TESTS_CXXFLAGS_SPEED)
+lena_line_graph_image_wst1_SOURCES = lena_line_graph_image_wst1.cc
+lena_line_graph_image_wst1_CXXFLAGS = $(TESTS_CXXFLAGS_SPEED)
-##lena_line_graph_image_wst2_SOURCES = lena_line_graph_image_wst2.cc
-##lena_line_graph_image_wst2_CXXFLAGS = $(TESTS_CXXFLAGS_SPEED)
+lena_line_graph_image_wst2_SOURCES = lena_line_graph_image_wst2.cc
+lena_line_graph_image_wst2_CXXFLAGS = $(TESTS_CXXFLAGS_SPEED)
meyer_wst_long_SOURCES = meyer_wst_long.cc
meyer_wst_long_CXXFLAGS = $(TESTS_CXXFLAGS_SPEED)
diff --git a/milena/tests/morpho/artificial_line_graph_image_wst.cc b/milena/tests/morpho/artificial_line_graph_image_wst.cc
index ebdfaa1..c88ac15 100644
--- a/milena/tests/morpho/artificial_line_graph_image_wst.cc
+++ b/milena/tests/morpho/artificial_line_graph_image_wst.cc
@@ -47,16 +47,18 @@
in it, interpolating inter-pixel points;
\li print the watershed on lines into that same image, and save it. */
-#include <vector>
-
#include <mln/core/image/image2d.hh>
#include <mln/core/alias/point2d.hh>
#include <mln/core/alias/window2d.hh>
#include <mln/core/alias/neighb2d.hh>
-#include <mln/core/image/line_graph_image.hh>
-#include <mln/core/image/line_graph_elt_neighborhood.hh>
-#include <mln/core/image/line_graph_neighborhood_piter.hh>
+/// Required for line graph images.
+#include <mln/core/site_set/p_edges.hh>
+#include <mln/core/image/line_graph_elt_window.hh>
+#include <mln/core/var.hh>
+#include <mln/pw/all.hh>
+#include <mln/fun/i2v/array.hh>
+#include <mln/util/graph.hh>
#include <mln/morpho/line_gradient.hh>
#include <mln/morpho/closing_area_on_vertices.hh>
@@ -114,27 +116,25 @@ int main()
`----------------*/
// Line graph image.
- typedef line_graph_image<point2d, input_val_t> ima_t;
- ima_t lg_ima = morpho::line_gradient(input);
+ mln_VAR(lg_ima, morpho::line_gradient(input));
/*------.
| WST. |
`------*/
- typedef line_graph_elt_neighborhood<point2d> nbh_t;
- nbh_t nbh;
+ typedef line_graph_elt_window<util::graph, lg_ima_t::pset::fun_t> win_t;
+ win_t win;
+ neighb<win_t> nbh(win);
// Perform a Watershed Transform.
- typedef unsigned wst_val_t;
- wst_val_t nbasins;
- typedef line_graph_image<point2d, wst_val_t> wst_ima_t;
- wst_ima_t wshed = morpho::meyer_wst(lg_ima, nbh, nbasins);
+ unsigned nbasins;
+ mln_VAR(wshed, morpho::meyer_wst(lg_ima, nbh, nbasins));
std::cout << "nbasins = " << nbasins << std::endl;
/*---------.
| Output. |
`---------*/
-
+
// FIXME: Inlined conversion, to be reifed into a routine.
// Save the result in gray levels (data) + color (wshed).
@@ -179,12 +179,12 @@ int main()
/* FIXME: We should draw the watershed on another image and
superimpose it on OUTPUT instead of drawing it directly into
OUTPUT. */
- mln_piter_(wst_ima_t) pw(wshed.domain());
+ mln_piter_(wshed_t) pw(wshed.domain());
for_all(pw)
{
if (wshed(pw) == 0)
{
- mln_psite_(wst_ima_t) pp(pw);
+ mln_psite_(lg_ima_t) pp(pw);
// Equivalent of the line (edge) PP in OUTPUT.
int row1 = pp.first()[0] * 2;
int col1 = pp.first()[1] * 2;
@@ -192,7 +192,7 @@ int main()
int col2 = pp.second()[1] * 2;
point2d q((row1 + row2) / 2, (col1 + col2) / 2);
// Print the watershed in red.
- output(q) = literal::red;
+ output(q) = literal::red;
}
}
// Fill the holes, so that the watershed looks connected.
@@ -212,13 +212,13 @@ int main()
// two or more, consider, create a watershed point.
/* FIXME: Iterating over a c4 window would be more elegant, of
course. */
- unsigned nwsheds =
- (output.has(p_out + up ) && output(p_out + up ) == literal::red) +
+ unsigned nwsheds =
+ (output.has(p_out + up ) && output(p_out + up ) == literal::red) +
(output.has(p_out + down ) && output(p_out + down ) == literal::red) +
(output.has(p_out + left ) && output(p_out + right) == literal::red) +
(output.has(p_out + right) && output(p_out + left ) == literal::red);
if (nwsheds >= 2)
- output(p_out) = literal::red;
+ output(p_out) = literal::red;
}
io::ppm::save(output, "out.ppm");
}
diff --git a/milena/tests/morpho/graph_image_morpho.cc b/milena/tests/morpho/graph_image_morpho.cc
index 664533c..8552061 100644
--- a/milena/tests/morpho/graph_image_morpho.cc
+++ b/milena/tests/morpho/graph_image_morpho.cc
@@ -26,45 +26,29 @@
// Public License.
/// \file tests/morpho/graph_image_morpho.cc
-/// \brief Tests on mln::graph_image with morphological filters.
-
-#include <vector>
+///
+/// Tests on mln::graph_image with morphological filters.
#include <mln/accu/bbox.hh>
#include <mln/core/alias/box2d.hh>
#include <mln/core/alias/point2d.hh>
-#include <mln/core/image/graph_elt_window.hh>
-#include <mln/core/image/graph_window_piter.hh>
-#include <mln/core/var.hh>
#include <mln/morpho/dilation.hh>
#include <mln/morpho/erosion.hh>
-#include <mln/util/graph.hh>
-
+/// Required for graph images.
+#include <mln/core/site_set/p_vertices.hh>
+#include <mln/core/image/graph_elt_window.hh>
+#include <mln/core/var.hh>
#include <mln/pw/all.hh>
+#include <mln/fun/i2v/array.hh>
+#include <mln/util/graph.hh>
#include <mln/debug/draw_graph.hh>
#include <mln/debug/iota.hh>
#include <mln/debug/println.hh>
-template <typename S>
-struct vertex_site_value_t : public mln::Function_p2v< vertex_site_value_t<S> >
-{
- typedef unsigned result;
-
- unsigned
- operator()(const mln_psite(S)& p) const
- {
- return v_[p.v().id()];
- }
-
- protected:
- std::vector<result> v_;
-};
-
-
int main()
{
using namespace mln;
@@ -87,20 +71,21 @@ int main()
*/
// Points associated to vertices.
- typedef fun::i2v::array<point2d> F;
- F points(5);
- points(0) = point2d(0,0); // Point associated to vertex 0.
- points(1) = point2d(2,2); // Point associated to vertex 1.
- points(2) = point2d(0,4); // Point associated to vertex 2.
- points(3) = point2d(4,3); // Point associated to vertex 3.
- points(4) = point2d(4,4); // Point associated to vertex 4.
-
- // Edges.
- typedef mln::util::graph G;
- G g;
+ typedef fun::i2v::array<point2d> fsite_t;
+ fsite_t sites(5);
+ sites(0) = point2d(0,0); // Point associated to vertex 0.
+ sites(1) = point2d(2,2); // Point associated to vertex 1.
+ sites(2) = point2d(0,4); // Point associated to vertex 2.
+ sites(3) = point2d(4,3); // Point associated to vertex 3.
+ sites(4) = point2d(4,4); // Point associated to vertex 4.
+
+ // Graph.
+ util::graph g;
+
// Populate the graph with vertices.
- for (unsigned i = 0; i < points.size(); ++i)
- g.add_vertex ();
+ for (unsigned i = 0; i < sites.size(); ++i)
+ g.add_vertex();
+
// Populate the graph with edges.
g.add_edge(0, 1);
g.add_edge(1, 2);
@@ -108,21 +93,26 @@ int main()
g.add_edge(3, 4);
g.add_edge(4, 2);
+
/*----------------------.
| Graph image support. |
`----------------------*/
- p_vertices<G, F> pg(g, points);
+ typedef p_vertices<util::graph, fsite_t> pv_t;
+ pv_t pv(g, sites);
/*--------------.
| Graph image. |
`--------------*/
- vertex_site_value_t< p_vertices<G, F> > values;
- // Graph image.
- mln_VAR(ima, (values | pg));
- // Initialize values.
- debug::iota(ima);
+ // Graph values.
+ typedef fun::i2v::array<unsigned> viota_t;
+ viota_t iota(pv.nsites());
+ for (unsigned i = 0; i < iota.size(); ++i)
+ iota(i) = 10 + i;
+
+ // Create graph image.
+ mln_const_VAR(ima, (iota | pv));
/*-------------------------------------.
| Image representation/visualization. |
@@ -132,12 +122,12 @@ int main()
/* FIXME: mln::graph_image should automatically feature a bbox when
its parameter P is akin to a point. */
accu::bbox<point2d> a;
- for (unsigned i = 0; i < points.size(); ++i)
- a.take(points(i));
+ for (unsigned i = 0; i < sites.size(); ++i)
+ a.take(sites(i));
box2d bbox = a.to_result();
// Print the image.
/* FIXME: Unfortunately, displaying graph images is not easy right
- now (2008-02-05). We could use
+ now (2008-02-05). We could use
debug::println(ima);
@@ -146,7 +136,7 @@ int main()
interface of graph_image to work with points (not psites).
Moreover, this implementation only shows *values*, not the graph
itslef.
-
+
An alternative is to use draw::graph (which, again, is misnamed),
but it doesn't show the values, only the vertices and edges of the
graph.
@@ -159,14 +149,13 @@ int main()
| Processing graph images. |
`--------------------------*/
- typedef graph_elt_window<G, F> win_t;
- win_t win;
+ graph_elt_window<util::graph, fsite_t> win;
- image2d<unsigned> ima_dil = morpho::dilation(ima, win);
-// debug::draw_graph(ima_rep, ima_dil, 9);
-// debug::println(ima_rep);
+ mln_const_VAR(ima_dil, morpho::dilation(ima, win));
+ debug::draw_graph(ima_rep, ima_dil.domain(), pw::cst(9), pw::cst(2));
+ debug::println(ima_rep);
- image2d<unsigned> ima_ero = morpho::erosion(ima, win);
-// draw::graph(ima_rep, ima_ero, 9);
-// debug::println(ima_rep);
+ mln_const_VAR(ima_ero, morpho::erosion(ima, win));
+ debug::draw_graph(ima_rep, ima_ero.domain(), pw::cst(9), pw::cst(2));
+ debug::println(ima_rep);
}
diff --git a/milena/tests/morpho/graph_image_wst.cc b/milena/tests/morpho/graph_image_wst.cc
index 41dcd5e..53f78cd 100644
--- a/milena/tests/morpho/graph_image_wst.cc
+++ b/milena/tests/morpho/graph_image_wst.cc
@@ -31,9 +31,15 @@
#include <vector>
#include <mln/core/alias/point2d.hh>
-#include <mln/core/image/graph_image.hh>
-#include <mln/core/image/graph_elt_neighborhood.hh>
-#include <mln/core/image/graph_neighborhood_piter.hh>
+
+/// Required for graph images.
+#include <mln/core/site_set/p_vertices.hh>
+#include <mln/core/image/graph_elt_window.hh>
+#include <mln/core/neighb.hh>
+#include <mln/core/var.hh>
+#include <mln/pw/all.hh>
+#include <mln/fun/i2v/array.hh>
+#include <mln/util/graph.hh>
#include <mln/morpho/meyer_wst.hh>
@@ -60,18 +66,21 @@ int main()
*/
// Points associated to vertices.
- std::vector<point2d> points;
- points.push_back(point2d(0,0)); // Point associated to vertex 0.
- points.push_back(point2d(2,2)); // Point associated to vertex 1.
- points.push_back(point2d(0,4)); // Point associated to vertex 2.
- points.push_back(point2d(4,3)); // Point associated to vertex 3.
- points.push_back(point2d(4,4)); // Point associated to vertex 4.
-
- // Edges.
- util::graph<point2d> g;
+ typedef fun::i2v::array<point2d> fsite_t;
+ fsite_t sites(5);
+ sites(0) = point2d(0,0); // Point associated to vertex 0.
+ sites(1) = point2d(2,2); // Point associated to vertex 1.
+ sites(2) = point2d(0,4); // Point associated to vertex 2.
+ sites(3) = point2d(4,3); // Point associated to vertex 3.
+ sites(4) = point2d(4,4); // Point associated to vertex 4.
+
+ // Graph.
+ util::graph g;
+
// Populate the graph with vertices.
- for (unsigned i = 0; i < points.size(); ++i)
- g.add_vertex (points[i]);
+ for (unsigned i = 0; i < sites.size(); ++i)
+ g.add_vertex();
+
// Populate the graph with edges.
g.add_edge(0, 1);
g.add_edge(1, 2);
@@ -79,42 +88,41 @@ int main()
g.add_edge(3, 4);
g.add_edge(4, 2);
- /*-------.
- | Graph. |
- `-------*/
- p_graph<point2d> pg(g);
+ /*----------------------.
+ | Graph image support. |
+ `----------------------*/
+
+ typedef p_vertices<util::graph, fsite_t> pv_t;
+ pv_t pv(g, sites);
/*-------------.
| Graph image. |
`-------------*/
- // Values.
- std::vector<int> values(5);
- values[0] = 0; // Value associated to vertex 0.
- values[1] = 1; // Value associated to vertex 1.
- values[2] = 2; // Value associated to vertex 2.
- values[3] = 3; // Value associated to vertex 3.
- values[4] = 0; // Value associated to vertex 4.
- // Graph image.
- typedef graph_image<point2d, int> ima_t;
- ima_t ima(pg, values);
+ // Graph values.
+ typedef fun::i2v::array<unsigned> viota_t;
+ viota_t iota(pv.nsites());
+ for (unsigned i = 0; i < iota.size(); ++i)
+ iota(i) = 10 + i;
+
+ // Create graph image.
+ mln_const_VAR(ima, (iota | pv));
/*------.
| WST. |
`------*/
- typedef graph_elt_neighborhood<point2d> nbh_t;
- nbh_t nbh;
+ typedef graph_elt_window<util::graph, fsite_t> win_t;
+ win_t win;
+ neighb<win_t> nbh(win);
- typedef unsigned wst_val_t;
- wst_val_t nbasins;
- typedef graph_image<point2d, wst_val_t> wst_ima_t;
- wst_ima_t wshed = morpho::meyer_wst(ima, nbh, nbasins);
+ unsigned nbasins;
+ mln_const_VAR(wshed, morpho::meyer_wst(ima, nbh, nbasins));
std::cout << "nbasins = " << nbasins << std::endl;
// Manual iteration over the domain of WSHED.
- mln_piter_(wst_ima_t) pw(wshed.domain());
+ mln_piter_(wshed_t) pw(wshed.domain());
for_all (pw)
std::cout << "wshed (" << pw << ") = " << wshed(pw) << std::endl;
}
diff --git a/milena/tests/morpho/lena_line_graph_image_wst1.cc b/milena/tests/morpho/lena_line_graph_image_wst1.cc
index 95a6c07..d897d96 100644
--- a/milena/tests/morpho/lena_line_graph_image_wst1.cc
+++ b/milena/tests/morpho/lena_line_graph_image_wst1.cc
@@ -56,9 +56,15 @@
#include <mln/core/alias/window2d.hh>
#include <mln/core/alias/neighb2d.hh>
-#include <mln/core/image/line_graph_image.hh>
-#include <mln/core/image/line_graph_elt_neighborhood.hh>
-#include <mln/core/image/line_graph_neighborhood_piter.hh>
+#include <mln/convert/to_window.hh>
+
+/// Required for line graph images.
+#include <mln/core/site_set/p_edges.hh>
+#include <mln/core/image/line_graph_elt_window.hh>
+#include <mln/core/var.hh>
+#include <mln/pw/all.hh>
+#include <mln/fun/i2v/array.hh>
+#include <mln/util/graph.hh>
#include <mln/morpho/gradient.hh>
#include <mln/morpho/closing_area.hh>
@@ -75,6 +81,8 @@
#include <mln/math/max.hh>
#include <mln/math/abs.hh>
+#include <mln/util/site_pair.hh>
+
#include "tests/data.hh"
@@ -100,7 +108,7 @@ int main()
// Simplify the input image.
image2d<input_val_t> work(input.domain());
- morpho::closing_area(gradient, c4(), 10, work);
+ work = morpho::closing_area(gradient, c4(), 10);
/*-------------.
| Line graph. |
@@ -108,70 +116,61 @@ int main()
// FIXME: Inlined conversion, to be reifed into a routine.
- util::graph<point2d> g;
+ util::graph g;
// Points.
- /* FIXME: The need for such a structure during the conversion
- exhibits the lack of a service from util::graph (or a another,
- missing tool) regarding the retrieval of vertex ids from
- points. */
- std::map<point2d, util::vertex_id, util::ord<point2d> > points;
- util::vertex_id id = 0;
+ image2d<unsigned> equiv_vertex;
+ initialize(equiv_vertex, work);
// Vertices.
- std::vector<int> vertex_values;
mln_fwd_piter_(image2d<input_val_t>) p(work.domain());
- for_all (p)
- {
- g.add_vertex (p);
- vertex_values.push_back (work(p));
- /* FIXME: ``Guessing'' the id of the point just being inserted
- is bad. util:graph<N,E>::add_vertex should return this
- id. */
- points[p] = id;
- ++id.to_equiv();
- }
+ for_all(p)
+ equiv_vertex(p) = g.add_vertex();
// Edges.
window2d next_c4_win;
next_c4_win.insert(0, 1).insert(1, 0);
- std::vector<int> edge_values;
- mln_fwd_qiter_(window2d) q(next_c4_win, p);
+ typedef fun::i2v::array<int> edge_values_t;
+ typedef fun::i2v::array< util::site_pair<point2d> > edge_sites_t;
+ edge_values_t edge_values;
+ edge_sites_t edge_sites;
+ mln_fwd_qiter_(window2d) q(next_c4_win, p);
for_all (p)
- for_all (q)
- if (work.domain().has(q))
+ for_all(q)
+ if (work.domain().has(q))
{
- g.add_edge(points[p], points[q]);
- edge_values.push_back(math::max(work(p), work(q)));
+ unsigned edge_id = g.add_edge(equiv_vertex(p), equiv_vertex(q));
+ edge_values.resize(edge_values.size() + 1);
+ edge_sites.resize(edge_sites.size() + 1);
+ edge_values(edge_id) = math::max(work(p), work(q));
+ edge_sites(edge_id) = util::site_pair<point2d>(p, q);
}
// Line graph point set.
- p_line_graph<point2d> plg(g);
-
- // Line graph image.
- /* FIXME: Shouldn't we use `input_val_t' instead of plain `int' as value
- type here? */
- typedef line_graph_image<point2d, int> ima_t;
- ima_t lg_ima(plg, vertex_values, edge_values);
+ typedef p_edges<util::graph, edge_sites_t> pe_t;
+ pe_t pe(g, edge_sites);
+
+ // Line graph image
+ typedef pw::image<edge_values_t, pe_t> ima_t;
+ mln_VAR(lg_ima, (edge_values | pe));
/*------.
| WST. |
`------*/
- typedef line_graph_elt_neighborhood<point2d> nbh_t;
- nbh_t nbh;
+ typedef line_graph_elt_window<util::graph, edge_sites_t> win_t;
+ win_t win;
+ neighb<win_t> nbh;
// Perform a Watershed Transform.
- typedef int_u8 wst_val_t;
- wst_val_t nbasins;
- typedef line_graph_image<point2d, wst_val_t> wst_ima_t;
- wst_ima_t wshed = morpho::meyer_wst(lg_ima, nbh, nbasins);
+ int_u8 nbasins;
+ mln_VAR(wshed, morpho::meyer_wst(lg_ima, nbh, nbasins));
std::cout << "nbasins = " << nbasins << std::endl;
/*---------.
| Output. |
`---------*/
-
+
// FIXME: Inlined conversion, to be reifed into a routine.
// Save the result in gray levels (data) + color (wshed).
@@ -216,12 +215,12 @@ int main()
/* FIXME: We should draw the watershed on another image and
superimpose it on OUTPUT instead of drawing it directly into
OUTPUT. */
- mln_piter_(wst_ima_t) pw(wshed.domain());
+ mln_piter_(wshed_t) pw(wshed.domain());
for_all(pw)
{
- if (wshed(pw) == 0)
+ if (wshed(pw) == 0u)
{
- mln_psite_(wst_ima_t) pp(pw);
+ mln_psite_(lg_ima_t) pp(pw);
// Equivalent of the line (edge) PP in OUTPUT.
int row1 = pp.first()[0] * 2;
int col1 = pp.first()[1] * 2;
diff --git a/milena/tests/morpho/lena_line_graph_image_wst2.cc b/milena/tests/morpho/lena_line_graph_image_wst2.cc
index 7283796..de48d35 100644
--- a/milena/tests/morpho/lena_line_graph_image_wst2.cc
+++ b/milena/tests/morpho/lena_line_graph_image_wst2.cc
@@ -33,7 +33,7 @@
/** \file tests/morpho/lena_line_graph_image_wst2.cc
\brief More tests on the Watershed Transform (WST) on a
mln::line_graph_image.
-
+
The scenario is as follows:
\li load a 2-D, gray-level image from a PGM file;
\li convert this 2-D image into a line graph-based one, where values
@@ -49,16 +49,18 @@
in it, interpolating inter-pixel points;
\li print the watershed on lines into that same image, and save it. */
-#include <vector>
-
#include <mln/core/image/image2d.hh>
#include <mln/core/alias/point2d.hh>
#include <mln/core/alias/window2d.hh>
#include <mln/core/alias/neighb2d.hh>
-#include <mln/core/image/line_graph_image.hh>
-#include <mln/core/image/line_graph_elt_neighborhood.hh>
-#include <mln/core/image/line_graph_neighborhood_piter.hh>
+/// Required for line graph images.
+#include <mln/core/site_set/p_edges.hh>
+#include <mln/core/image/line_graph_elt_window.hh>
+#include <mln/core/var.hh>
+#include <mln/pw/all.hh>
+#include <mln/fun/i2v/array.hh>
+#include <mln/util/graph.hh>
#include <mln/morpho/line_gradient.hh>
#include <mln/morpho/closing_area_on_vertices.hh>
@@ -101,34 +103,31 @@ int main()
`----------------*/
// Line graph image.
- typedef line_graph_image<point2d, input_val_t> ima_t;
- ima_t lg_ima = morpho::line_gradient(input);
+ mln_VAR(lg_ima, morpho::line_gradient(input));
/*-----------------.
| Simplification. |
`-----------------*/
- typedef line_graph_elt_neighborhood<point2d> nbh_t;
- nbh_t nbh;
+ typedef line_graph_elt_window<util::graph, lg_ima_t::pset::fun_t> win_t;
+ win_t win;
+ neighb<win_t> nbh(win);
- ima_t closed_lg_ima (lg_ima.domain());
- morpho::closing_area_on_vertices(lg_ima, nbh, 20, closed_lg_ima);
+ mln_VAR(closed_lg_ima, morpho::closing_area_on_vertices(lg_ima, nbh, 20));
/*------.
| WST. |
`------*/
// Perform a Watershed Transform.
- typedef unsigned wst_val_t;
- wst_val_t nbasins;
- typedef line_graph_image<point2d, wst_val_t> wst_ima_t;
- wst_ima_t wshed = morpho::meyer_wst(closed_lg_ima, nbh, nbasins);
+ unsigned nbasins;
+ mln_VAR(wshed, morpho::meyer_wst(closed_lg_ima, nbh, nbasins));
std::cout << "nbasins = " << nbasins << std::endl;
/*---------.
| Output. |
`---------*/
-
+
// FIXME: Inlined conversion, to be reifed into a routine.
// Save the result in gray levels (data) + color (wshed).
@@ -173,12 +172,12 @@ int main()
/* FIXME: We should draw the watershed on another image and
superimpose it on OUTPUT instead of drawing it directly into
OUTPUT. */
- mln_piter_(wst_ima_t) pw(wshed.domain());
+ mln_piter_(wshed_t) pw(wshed.domain());
for_all(pw)
{
if (wshed(pw) == 0)
{
- mln_psite_(wst_ima_t) pp(pw);
+ mln_psite_(lg_ima_t) pp(pw);
// Equivalent of the line (edge) PP in OUTPUT.
int row1 = pp.first()[0] * 2;
int col1 = pp.first()[1] * 2;
diff --git a/milena/tests/morpho/line_graph_image_morpho.cc b/milena/tests/morpho/line_graph_image_morpho.cc
index 43bf66b..ce32528 100644
--- a/milena/tests/morpho/line_graph_image_morpho.cc
+++ b/milena/tests/morpho/line_graph_image_morpho.cc
@@ -26,14 +26,18 @@
// Public License.
/// \file tests/morpho/line_graph_image_morpho.cc
-/// \brief Tests on mln::line_graph_image with morphological filters.
-
-#include <vector>
+///
+/// Tests on mln::line_graph_image with morphological filters.
#include <mln/core/alias/point2d.hh>
-#include <mln/core/image/line_graph_image.hh>
+
+/// Required for line graph images.
+#include <mln/core/site_set/p_edges.hh>
#include <mln/core/image/line_graph_elt_window.hh>
-#include <mln/core/image/line_graph_window_piter.hh>
+#include <mln/core/var.hh>
+#include <mln/pw/all.hh>
+#include <mln/fun/i2v/array.hh>
+#include <mln/util/graph.hh>
#include <mln/morpho/erosion.hh>
#include <mln/morpho/dilation.hh>
@@ -51,7 +55,7 @@ int main()
0 1 2 3 4 0 1 2 3 4
.----------- .-----------
- | |
+ | |
0 | 0 2 0 | * *
1 | \ / | 1 | 0 1 |
2 | 1 | 2 | * 4
@@ -60,19 +64,22 @@ int main()
*/
+ // Graph.
+ util::graph g;
+
// Points associated to vertices.
- std::vector<point2d> points;
- points.push_back(point2d(0,0)); // Point associated to vertex 0.
- points.push_back(point2d(2,2)); // Point associated to vertex 1.
- points.push_back(point2d(0,4)); // Point associated to vertex 2.
- points.push_back(point2d(4,3)); // Point associated to vertex 3.
- points.push_back(point2d(4,4)); // Point associated to vertex 4.
-
- // Edges.
- util::graph<point2d> g;
+ typedef fun::i2v::array<point2d> fsite_t;
+ fsite_t sites(5);
+ sites(0) = point2d(0,0); // Point associated to vertex 0.
+ sites(1) = point2d(2,2); // Point associated to vertex 1.
+ sites(2) = point2d(0,4); // Point associated to vertex 2.
+ sites(3) = point2d(4,3); // Point associated to vertex 3.
+ sites(4) = point2d(4,4); // Point associated to vertex 4.
+
// Populate the graph with vertices.
- for (unsigned i = 0; i < points.size(); ++i)
- g.add_vertex (points[i]);
+ for (unsigned i = 0; i < sites.size(); ++i)
+ g.add_vertex();
+
// Populate the graph with edges.
g.add_edge(0, 1);
g.add_edge(1, 2);
@@ -80,48 +87,44 @@ int main()
g.add_edge(3, 4);
g.add_edge(4, 2);
+
/*---------------------------.
| Line graph image support. |
`---------------------------*/
- p_line_graph<point2d> plg(g);
+ typedef p_edges<util::graph, fsite_t> pe_t;
+ pe_t pe(g, sites);
/*-------------------.
| Line graph image. |
`-------------------*/
- // Values ("empty" vectors).
- std::vector<int> vertex_values(5);
- std::vector<int> edge_values(5);
- // FIXME: hand-made iota's.
- for (unsigned i = 0; i < vertex_values.size(); ++i)
- vertex_values[i] = i;
- for (unsigned i = 0; i < edge_values.size(); ++i)
- edge_values[i] = i;
-
- // Line graph image.
- /* FIXME: We probably don't want to build line_graph_images by hand;
- provide helpers and/or conversion functions. */
- typedef line_graph_image<point2d, int> ima_t;
- ima_t ima(plg, vertex_values, edge_values);
-
- /*--------------------------.
- | Processing graph images. |
- `--------------------------*/
-
- typedef line_graph_elt_window<point2d> win_t;
- win_t win;
-
- line_graph_image<point2d, int> ima_dil = morpho::dilation(ima, win);
+ // Line graph values.
+ typedef fun::i2v::array<unsigned> viota_t;
+ viota_t iota(pe.nsites());
+ for (unsigned i = 0; i < iota.size(); ++i)
+ iota(i) = 10 + i;
+
+ // Create line graph image.
+ mln_const_VAR(ima, (iota | pe));
+
+
+ /*-------------------------------.
+ | Processing line graph images. |
+ `-------------------------------*/
+
+ line_graph_elt_window<util::graph, fsite_t> win;
+
+ mln_const_VAR(ima_dil, morpho::dilation(ima, win));
// Manual iteration over the domain of IMA_DIL.
- mln_piter_(ima_t) p_dil(ima_dil.domain());
+ mln_piter_(ima_dil_t) p_dil(ima_dil.domain());
for_all (p_dil)
std::cout << "ima_dil (" << p_dil << ") = " << ima_dil(p_dil) << std::endl;
std::cout << std::endl;
- line_graph_image<point2d, int> ima_ero = morpho::erosion(ima, win);
+ mln_const_VAR(ima_ero, morpho::erosion(ima, win));
// Manual iteration over the domain of IMA_ERO.
- mln_piter_(ima_t) p_ero(ima_ero.domain());
+ mln_piter_(ima_ero_t) p_ero(ima_ero.domain());
for_all (p_ero)
std::cout << "ima_ero (" << p_ero << ") = " << ima_ero(p_ero) << std::endl;
}
diff --git a/milena/tests/morpho/line_graph_image_wst.cc b/milena/tests/morpho/line_graph_image_wst.cc
index ce6514f..a700d16 100644
--- a/milena/tests/morpho/line_graph_image_wst.cc
+++ b/milena/tests/morpho/line_graph_image_wst.cc
@@ -26,14 +26,19 @@
// Public License.
/// \file tests/morpho/line_graph_image_wst.cc
-/// \brief Tests on the Watershed Transform on a mln::line_graph_image.
-
-#include <vector>
+///
+/// Tests on the Watershed Transform on a mln::line_graph_image.
#include <mln/core/alias/point2d.hh>
-#include <mln/core/image/line_graph_image.hh>
-#include <mln/core/image/line_graph_elt_neighborhood.hh>
-#include <mln/core/image/line_graph_neighborhood_piter.hh>
+
+/// Required for line graph images.
+#include <mln/core/site_set/p_edges.hh>
+#include <mln/core/image/line_graph_elt_window.hh>
+#include <mln/core/neighb.hh>
+#include <mln/core/var.hh>
+#include <mln/pw/all.hh>
+#include <mln/fun/i2v/array.hh>
+#include <mln/util/graph.hh>
#include <mln/morpho/meyer_wst.hh>
@@ -61,45 +66,52 @@ int main()
In G, vertices and egdes are numbered following in the classical
foward order. */
- util::graph<point2d> g;
-
- // Vertices.
- std::vector<int> vertex_values;
- // We don't really care about values on vertices, because the algorithm
- // won't see them. So all are set to 0.
- g.add_vertex (point2d(0, 0)); vertex_values.push_back (0); // Vertex 0.
- g.add_vertex (point2d(0, 1)); vertex_values.push_back (0); // Vertex 1.
- g.add_vertex (point2d(0, 2)); vertex_values.push_back (0); // Vertex 2.
- g.add_vertex (point2d(0, 3)); vertex_values.push_back (0); // Vertex 3.
-
- g.add_vertex (point2d(1, 0)); vertex_values.push_back (0); // Vertex 4.
- g.add_vertex (point2d(1, 1)); vertex_values.push_back (0); // Vertex 5.
- g.add_vertex (point2d(1, 2)); vertex_values.push_back (0); // Vertex 6.
- g.add_vertex (point2d(1, 3)); vertex_values.push_back (0); // Vertex 7.
-
- // Edges.
- std::vector<int> edge_values;
- g.add_edge (0, 1); edge_values.push_back (0);
- g.add_edge (1, 2); edge_values.push_back (10);
- g.add_edge (2, 3); edge_values.push_back (5);
-
- g.add_edge (0, 4); edge_values.push_back (2);
- g.add_edge (1, 5); edge_values.push_back (4);
- g.add_edge (2, 6); edge_values.push_back (6);
- g.add_edge (3, 7); edge_values.push_back (0);
-
- g.add_edge (4, 5); edge_values.push_back (3);
- g.add_edge (5, 6); edge_values.push_back (5);
- g.add_edge (6, 7); edge_values.push_back (2);
-
- // Line graph point set.
- p_line_graph<point2d> plg(g);
-
- // Line graph image.
- /* FIXME: We probably don't want to build line_graph_images by hand;
- provide helpers and/or conversion functions. */
- typedef line_graph_image<point2d, int> ima_t;
- ima_t ima(plg, vertex_values, edge_values);
+ util::graph g;
+
+ // Sites associated to vertices.
+ typedef fun::i2v::array<point2d> fsite_t;
+ fsite_t sites(5);
+ sites(0) = point2d(0,0); // Point associated to vertex 0.
+ sites(1) = point2d(0,1); // Point associated to vertex 1.
+ sites(2) = point2d(0,2); // Point associated to vertex 2.
+ sites(3) = point2d(0,3); // Point associated to vertex 3.
+ sites(4) = point2d(1,0); // Point associated to vertex 4.
+ sites(5) = point2d(1,1); // Point associated to vertex 5.
+ sites(6) = point2d(1,2); // Point associated to vertex 6.
+ sites(7) = point2d(1,3); // Point associated to vertex 7.
+
+ // Populate the graph with vertices.
+ for(unsigned i = 0; i < sites.size(); ++i)
+ g.add_vertex();
+
+ // Populate the graph with edges.
+ g.add_edge(0, 1);
+ g.add_edge(1, 2);
+ g.add_edge(2, 3);
+
+ g.add_edge(0, 4);
+ g.add_edge(1, 5);
+ g.add_edge(2, 6);
+ g.add_edge(3, 7);
+
+ g.add_edge(4, 5);
+ g.add_edge(5, 6);
+ g.add_edge(6, 7);
+
+ typedef p_edges<util::graph, fsite_t> pe_t;
+ pe_t pe(g, sites);
+
+ // Edge values.
+ typedef fun::i2v::array<int> edge_values_t;
+ edge_values_t edge_values(pe.nsites());
+
+ static const int values[] = { 0, 10, 5, 2, 4, 6, 0, 3, 5, 2 };
+ for (unsigned i = 0; i < edge_values.size(); ++i)
+ edge_values(i) = values[i];
+
+ // Create line graph image.
+ mln_const_VAR(ima,(edge_values | pe));
+
/*------------.
| Iterators. |
@@ -111,17 +123,16 @@ int main()
std::cout << "ima (" << p << ") = " << ima(p) << std::endl;
std::cout << std::endl;
- typedef line_graph_elt_neighborhood<point2d> nbh_t;
- nbh_t nbh;
+ typedef line_graph_elt_window<util::graph, fsite_t> win_t;
+ win_t win;
+ neighb<win_t> nbh(win);
- typedef unsigned wst_val_t;
- wst_val_t nbasins;
- typedef line_graph_image<point2d, wst_val_t> wst_ima_t;
- wst_ima_t wshed = morpho::meyer_wst(ima, nbh, nbasins);
+ unsigned nbasins;
+ mln_const_VAR(wshed, morpho::meyer_wst(ima, nbh, nbasins));
std::cout << "nbasins = " << nbasins << std::endl;
// Manual iteration over the domain of WSHED.
- mln_piter_(wst_ima_t) pw(wshed.domain());
+ mln_piter_(wshed_t) pw(wshed.domain());
for_all (pw)
std::cout << "wshed (" << pw << ") = " << wshed(pw) << std::endl;
}
--
1.5.6.5
1
0
* tools/Makefile.am: enable the target.
* tools/area_flooding.cc: update according the new graph structure.
---
milena/ChangeLog | 8 ++++++
milena/tools/Makefile.am | 6 ++--
milena/tools/area_flooding.cc | 57 +++++++++++++++++++++--------------------
3 files changed, 40 insertions(+), 31 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 0973adf..c42010f 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,13 @@
2008-12-31 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Re-enable tools/area_flooding.
+
+ * tools/Makefile.am: enable the target.
+
+ * tools/area_flooding.cc: update according the new graph structure.
+
+2008-12-31 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Fix line_gradient.
* morpho/line_gradient.hh: update according the new graph structure.
diff --git a/milena/tools/Makefile.am b/milena/tools/Makefile.am
index 1d6347c..335f622 100644
--- a/milena/tools/Makefile.am
+++ b/milena/tools/Makefile.am
@@ -3,10 +3,10 @@
include $(top_srcdir)/milena/tools/tools.mk
bin_PROGRAMS = \
- seed2tiling
-#area_flooding
+ seed2tiling \
+ area_flooding
-#area_flooding_SOURCES = area_flooding.cc
+area_flooding_SOURCES = area_flooding.cc
seed2tiling_SOURCES = seed2tiling.cc
# FIXME: Add some tests for these tools.
diff --git a/milena/tools/area_flooding.cc b/milena/tools/area_flooding.cc
index 5d34af0..0157f9c 100644
--- a/milena/tools/area_flooding.cc
+++ b/milena/tools/area_flooding.cc
@@ -25,10 +25,11 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/** \file tests/morpho/lena_line_graph_image_wst2.cc
- \brief More tests on the Watershed Transform (WST) on a
- mln::line_graph_image.
-
+/// \file tests/morpho/lena_line_graph_image_wst2.cc
+///
+/// More tests on the Watershed Transform (WST) on a
+/// an image base on a p_edges (line_graph_image).
+/*!
The scenario is as follows:
\li load a 2-D, gray-level image from a PGM file;
\li convert this 2-D image into a line graph-based one, where values
@@ -42,6 +43,8 @@
\li create a 2D image of this watershed image, where each basin has
an average grey level of the corresponding region in the input
image.
+
+ FIXME: do not use mln_VAR.
*/
#include <cstdlib>
@@ -55,10 +58,8 @@
#include <mln/core/image/image2d.hh>
#include <mln/core/alias/neighb2d.hh>
-
-#include <mln/core/image/line_graph_image.hh>
-#include <mln/core/image/line_graph_elt_neighborhood.hh>
-#include <mln/core/image/line_graph_neighborhood_piter.hh>
+#include <mln/core/image/line_graph_elt_window.hh>
+#include <mln/core/var.hh>
#include <mln/morpho/line_gradient.hh>
#include <mln/morpho/closing_area_on_vertices.hh>
@@ -92,18 +93,19 @@ int main(int argc, char* argv[])
orig_ima_t input;
io::pgm::load(input, argv[2]);
if (!input.has_data())
- {
- std::cerr << "Error reading input " << argv[2] << std::endl;
- std::exit(2);
- }
+ {
+ std::cerr << "Error reading input " << argv[2] << std::endl;
+ std::exit(2);
+ }
/*----------------.
| Line gradient. |
`----------------*/
// Line graph image.
- typedef line_graph_image<point2d, val_t> ima_t;
- ima_t lg_ima = morpho::line_gradient(input);
+ typedef fun::i2v::array<val_t> fval_t;
+ fval_t values;
+ mln_VAR(lg_ima, morpho::line_gradient(input));
/*-----------.
| Flooding. |
@@ -112,7 +114,7 @@ int main(int argc, char* argv[])
/* FIXME: I'm not sure this is the way it should be done. Anyway,
we should implement this as a canvas. */
- typedef line_graph_elt_neighborhood<point2d> nbh_t;
+ typedef neighb< line_graph_elt_window<util::graph, lg_ima_t::pset::fun_t> > nbh_t;
nbh_t nbh;
unsigned area = 0;
@@ -120,15 +122,15 @@ int main(int argc, char* argv[])
unsigned nregions = mln_max(unsigned);
unsigned max_nregions = atoi(argv[1]);
- ima_t result = duplicate(lg_ima);
+ lg_ima_t result = duplicate(lg_ima);
while (area < max_area && nregions > max_nregions)
{
++area;
std::cerr << "area = " << area << " \t"
<< "nregions = " << nregions << std::endl;
- ima_t work = duplicate(result);
+ lg_ima_t work = duplicate(result);
// Compute the closing.
- morpho::closing_area_on_vertices(work, nbh, area, result);
+ result = morpho::closing_area_on_vertices(work, nbh, area);
// Compute the number of local minima (but get rid of the image,
// as we don't need it).
labeling::regional_minima(result, nbh, nregions);
@@ -141,8 +143,7 @@ int main(int argc, char* argv[])
// Perform a Watershed Transform.
typedef int_u16 wst_val_t;
wst_val_t nbasins;
- typedef line_graph_image<point2d, wst_val_t> wst_ima_t;
- wst_ima_t wshed = morpho::meyer_wst(result, nbh, nbasins);
+ mln_VAR(wshed, morpho::meyer_wst(result, nbh, nbasins));
std::cout << "nbasins = " << nbasins << std::endl;
/*---------.
@@ -153,21 +154,21 @@ int main(int argc, char* argv[])
// Create a 2D-equivalent of WSHED.
image2d<wst_val_t> wshed2d(input.domain());
-
+
/* FIXME: It'd better if we could iterate over the *vertices* of a
line graph image. We could avoid all this lengthy code. */
// Iterate over each edge of the watershed image, and propagate the
// label of an edge to its adjacent vertices when this edge is not
// part of the watershed.
- mln_piter_(wst_ima_t) p(wshed.domain());
+ mln_piter_(wshed_t) p(wshed.domain());
for_all(p)
if (wshed(p) != wshed_label)
- {
- // FIXME: Equip the iterator with first() and second()
- // accessors?
- wshed2d(p.unproxy_().first()) = wshed(p);
- wshed2d(p.unproxy_().second()) = wshed(p);
- }
+ {
+ // FIXME: Equip the iterator with first() and second()
+ // accessors?
+ wshed2d(p.first()) = wshed(p);
+ wshed2d(p.second()) = wshed(p);
+ }
// For each basin, compute the average gray level.
std::vector<mln_sum_(val_t)> sum(nbasins + 1, 0);
--
1.5.6.5
1
0
* morpho/line_gradient.hh: update according the new graph structure.
---
milena/ChangeLog | 6 ++++++
milena/mln/morpho/line_gradient.hh | 26 +++++++++++++-------------
2 files changed, 19 insertions(+), 13 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 6c23d7b..0973adf 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,11 @@
2008-12-31 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Fix line_gradient.
+
+ * morpho/line_gradient.hh: update according the new graph structure.
+
+2008-12-31 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Handle ch_value on graph images and introduce ch_function_value.
* mln/fun/v2v/ch_function_value.hh: new. Wrap a function and
diff --git a/milena/mln/morpho/line_gradient.hh b/milena/mln/morpho/line_gradient.hh
index 1d0128a..bc49df9 100644
--- a/milena/mln/morpho/line_gradient.hh
+++ b/milena/mln/morpho/line_gradient.hh
@@ -50,6 +50,7 @@
# include <mln/util/graph.hh>
# include <mln/util/site_pair.hh>
+
// FIXME: Generalize to other (input) images as well (image1d,
// image3d, etc.).
@@ -63,33 +64,31 @@ namespace mln
/// norm of a mln::image2d.
/* FIXME: Currently, the adjacency is set to 4-c and cannot be
changed. */
- template <typename F, typename S>
- mln::pw::image<F, S>
- line_gradient(const mln::image2d<mln_result(F)>& ima);
+ template <typename V>
+ pw::image<fun::i2v::array<V>, p_edges<util::graph, fun::i2v::array< util::site_pair<point2d> > > >
+ line_gradient(const mln::image2d<V>& ima);
# ifndef MLN_INCLUDE_ONLY
- template <typename F, typename S>
- mln::pw::image<F, S>
- line_gradient(const mln::image2d<mln_result(F)>& ima)
+ template <typename V>
+ pw::image<fun::i2v::array<V>, p_edges<util::graph, fun::i2v::array< util::site_pair<point2d> > > >
+ line_gradient(const mln::image2d<V>& ima)
{
// FIXME: Precondition: Ensure the image is scalar.
- typedef mln_result(F) value_t;
-
util::graph g;
// Vertices.
image2d<unsigned> vpsite(ima.domain());
fun::i2v::array<mln::point2d> fv2p(ima.domain().nsites());
- fun::i2v::array<value_t> vertex_values(ima.domain().nsites());
+ fun::i2v::array<V> vertex_values(ima.domain().nsites());
- mln_fwd_piter(image2d<value_t>) p(ima.domain());
+ mln_fwd_piter(image2d<V>) p(ima.domain());
for_all (p)
{
g.add_vertex();
unsigned id = g.v_nmax() - 1;
- vpsite[p] = id;
+ vpsite(p) = id;
fv2p(id) = p;
}
@@ -97,7 +96,7 @@ namespace mln
// FIXME: The creation of this window should be generic.
window2d next_c4_win;
next_c4_win.insert(0, 1).insert(1, 0);
- typedef fun::i2v::array<value_t> edge_values_t;
+ typedef fun::i2v::array<V> edge_values_t;
typedef fun::i2v::array< util::site_pair<point2d> > edge_sites_t;
edge_values_t edge_values;
edge_sites_t edge_sites;
@@ -110,13 +109,14 @@ namespace mln
// The computed value is a norm of the gradient between P and Q.
unsigned edge_id = edge_values.size();
edge_values.resize(edge_values.size() + 1);
+ edge_sites.resize(edge_sites.size() + 1);
edge_values(edge_id) = math::abs(ima(p) - ima(q));
+ edge_sites(edge_id) = util::site_pair<point2d>(p, q);
}
// Line graph point set.
typedef p_edges<util::graph, edge_sites_t> pe_t;
pe_t plg(g, edge_sites);
-
// Line graph image.
typedef pw::image<edge_values_t, pe_t> ima_t;
ima_t lg_ima = (edge_values | plg);
--
1.5.6.5
1
0