https://svn.lrde.epita.fr/svn/oln/trunk
Index: ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
Fix the tests in tests/morpho.
* mln/morpho/erosion.spe.hh
(erosion_iterative_(kind::logic, speed::fastest, const I&, const W&)):
Fix the assignment of the out pixter in the case of a non-centered
window.
* mln/value/int_u_sat.hh (mln::value::props< int_u_sat<n> >):
Remove.
Superseded by...
(mln::trait::value_< mln::value::int_u_sat<n> >): ...this (new
specialization).
* mln/set/inter.hh (mln::set::inter): Fix uses of the tracing
mechanism.
* mln/value/int_u.hh: Don't use Doxygen comments to announce
forward declarations.
* tests/morpho/contrast.cc,
* tests/morpho/dilation.cc,
* tests/morpho/dilation_max_h.cc,
* tests/morpho/erosion.cc,
* tests/morpho/erosion_min_h.cc,
* tests/morpho/gradient.cc,
* tests/morpho/hit_or_miss.cc,
* tests/morpho/laplacian.cc,
* tests/morpho/opening_area.cc,
* tests/morpho/thinning.cc:
Catch up with the new I/O interface of Milena.
mln/morpho/erosion.spe.hh | 13 +++++++++-
mln/set/inter.hh | 6 ++--
mln/value/int_u.hh | 6 +---
mln/value/int_u_sat.hh | 50 +++++++++++++++++++++++++++--------------
tests/morpho/contrast.cc | 5 ++--
tests/morpho/dilation.cc | 5 ++--
tests/morpho/dilation_max_h.cc | 5 ++--
tests/morpho/erosion.cc | 5 ++--
tests/morpho/erosion_min_h.cc | 5 ++--
tests/morpho/gradient.cc | 5 ++--
tests/morpho/hit_or_miss.cc | 8 +++---
tests/morpho/laplacian.cc | 9 ++++---
tests/morpho/opening_area.cc | 8 +++---
tests/morpho/thinning.cc | 8 +++---
14 files changed, 86 insertions(+), 52 deletions(-)
Index: milena/tests/morpho/contrast.cc
--- milena/tests/morpho/contrast.cc (revision 1626)
+++ milena/tests/morpho/contrast.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// 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
@@ -50,7 +50,8 @@
win::rectangle2d rect(5, 5);
border::thickness = 2;
- image2d<int_u8> lena = io::pgm::load("../img/tiny.pgm");
+ image2d<int_u8> lena;
+ io::pgm::load(lena, "../img/lena.pgm");
image2d<int_u8> out = morpho::contrast(lena, rect);
io::pgm::save(out, "out.pgm");
Index: milena/tests/morpho/gradient.cc
--- milena/tests/morpho/gradient.cc (revision 1626)
+++ milena/tests/morpho/gradient.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// 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
@@ -49,7 +49,8 @@
win::rectangle2d rect(5, 5);
border::thickness = 2;
- image2d<int_u8> lena = io::pgm::load("../img/tiny.pgm");
+ image2d<int_u8> lena;
+ io::pgm::load(lena, "../img/tiny.pgm");
io::pgm::save( morpho::gradient(lena, rect),
"out.pgm" );
Index: milena/tests/morpho/erosion.cc
--- milena/tests/morpho/erosion.cc (revision 1626)
+++ milena/tests/morpho/erosion.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// 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
@@ -74,7 +74,8 @@
// 11 29 1
// 25 66 15
- image2d<int_u8> lena = io::pgm::load("../img/lena.pgm");
+ image2d<int_u8> lena;
+ io::pgm::load(lena, "../img/lena.pgm");
// trace::quiet = false;
Index: milena/tests/morpho/thinning.cc
--- milena/tests/morpho/thinning.cc (revision 1626)
+++ milena/tests/morpho/thinning.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// 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
@@ -62,9 +62,9 @@
border::thickness = 2;
{
- image2d<bool> pic = io::pbm::load("../img/picasso.pbm");
- io::pbm::save( morpho::thinning(pic, win_fg, win_bg),
- "out.pbm" );
+ image2d<bool> pic;
+ io::pbm::load(pic, "../img/picasso.pbm");
+ io::pbm::save(morpho::thinning(pic, win_fg, win_bg), "out.pbm" );
}
// {
// image2d<int_u8> pic = io::pgm::load("../img/picasso.pgm");
Index: milena/tests/morpho/dilation_max_h.cc
--- milena/tests/morpho/dilation_max_h.cc (revision 1626)
+++ milena/tests/morpho/dilation_max_h.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// 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
@@ -52,7 +52,8 @@
win::rectangle2d rec(21, 21);
border::thickness = 66;
- image2d<int_u8> lena = io::pgm::load("../img/lena.pgm");
+ image2d<int_u8> lena;
+ io::pgm::load(lena, "../img/lena.pgm");
{
p_array<point2d> vec = convert::to_p_array(rec, point2d::origin);
Index: milena/tests/morpho/hit_or_miss.cc
--- milena/tests/morpho/hit_or_miss.cc (revision 1626)
+++ milena/tests/morpho/hit_or_miss.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// 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
@@ -75,9 +75,9 @@
border::thickness = 2;
- image2d<bool>
- pic = io::pbm::load("../img/picasso.pbm"),
- out = morpho::hit_or_miss(pic, win_hit, win_miss);
+ image2d<bool> pic;
+ io::pbm::load(pic, "../img/picasso.pbm");
+ image2d<bool> out = morpho::hit_or_miss(pic, win_hit, win_miss);
io::pbm::save(out, "out.pbm");
mln_postcondition(morpho::hit_or_miss(morpho::complementation(pic),
Index: milena/tests/morpho/dilation.cc
--- milena/tests/morpho/dilation.cc (revision 1626)
+++ milena/tests/morpho/dilation.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// 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
@@ -60,7 +60,8 @@
win::rectangle2d rec(21, 21);
border::thickness = 66;
- image2d<int_u8> lena = io::pgm::load("../img/lena.pgm");
+ image2d<int_u8> lena;
+ io::pgm::load(lena, "../img/lena.pgm");
// {
// image2d<int_u8> out(lena.domain());
Index: milena/tests/morpho/laplacian.cc
--- milena/tests/morpho/laplacian.cc (revision 1626)
+++ milena/tests/morpho/laplacian.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// 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
@@ -53,9 +53,10 @@
win::rectangle2d rect(5, 5);
border::thickness = 2;
- image2d<int_u8> lena = io::pgm::load("../img/tiny.pgm");
- image2d<int> lap(lena.domain());
- morpho::laplacian(lena, rect, lap);
+ image2d<int_u8> tiny;
+ io::pgm::load(tiny, "../img/tiny.pgm");
+ image2d<int> lap(tiny.domain());
+ morpho::laplacian(tiny, rect, lap);
io::pgm::save( arith::plus_cst< value::int_u_sat<8> >(lap, 128),
"out.pgm" );
Index: milena/tests/morpho/opening_area.cc
--- milena/tests/morpho/opening_area.cc (revision 1626)
+++ milena/tests/morpho/opening_area.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// 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
@@ -46,9 +46,9 @@
using namespace mln;
using value::int_u8;
- image2d<int_u8>
- lena = io::pgm::load("../img/lena.pgm"),
- out(lena.domain());
+ image2d<int_u8> lena;
+ io::pgm::load(lena, "../img/lena.pgm");
+ image2d<int_u8> out(lena.domain());
morpho::opening_area(lena, c4(), 510, out);
io::pgm::save(out, "out.pgm");
Index: milena/tests/morpho/erosion_min_h.cc
--- milena/tests/morpho/erosion_min_h.cc (revision 1626)
+++ milena/tests/morpho/erosion_min_h.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// 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
@@ -52,7 +52,8 @@
win::rectangle2d rec(21, 21);
border::thickness = 66;
- image2d<int_u8> lena = io::pgm::load("../img/lena.pgm");
+ image2d<int_u8> lena;
+ io::pgm::load(lena, "../img/lena.pgm");
{
p_array<point2d> vec = convert::to_p_array(rec, point2d::origin);
Index: milena/mln/value/int_u.hh
--- milena/mln/value/int_u.hh (revision 1626)
+++ milena/mln/value/int_u.hh (working copy)
@@ -51,17 +51,15 @@
namespace value
{
- /// \{ Fwd decls.
+ // Fwd decls.
template <unsigned n> struct int_u;
- /// \}
}
namespace literal
{
- /// \{ Fwd decls.
+ // Fwd decls.
struct zero_t;
struct one_t;
- /// \}
}
Index: milena/mln/value/int_u_sat.hh
--- milena/mln/value/int_u_sat.hh (revision 1626)
+++ milena/mln/value/int_u_sat.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// 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
@@ -47,6 +47,35 @@
namespace value
{
+ // Fwd decls.
+ template <unsigned n> struct int_u_sat;
+ }
+
+ namespace trait
+ {
+
+ template <unsigned n>
+ struct value_< mln::value::int_u_sat<n> >
+ {
+ // FIXME: Overhaul these traits (see other value traits).
+ static const std::size_t card = metal::math::pow_int<2, n>::value;
+ static const mln::value::int_u_sat<n> min() { return 0; }
+ static const mln::value::int_u_sat<n> max() { return card - 1; }
+ static const unsigned nbits = n;
+
+ typedef trait::value::nature::integer nature;
+ typedef trait::value::kind::data kind;
+ // FIXME: Is that right?
+ typedef mln_value_quant_from_(card) quant;
+
+ typedef float sum;
+ };
+
+ } // end of namespace mln::trait
+
+
+ namespace value
+ {
/*! \brief Unsigned integer value class with saturation behavior.
@@ -90,24 +119,10 @@
// Safety.
+ // FIXME: We shouldn't have to do that.
template <> struct int_u_sat<0>;
template <> struct int_u_sat<1>;
-
-
- template <unsigned n>
- struct props< int_u_sat<n> >
- {
- static const std::size_t card_ = metal::math::pow_int<2, n>::value;
- static const int_u_sat<n> min() { return 0; }
- static const int_u_sat<n> max() { return card_ - 1; }
- static const unsigned nbits = n;
- typedef trait::value::kind::data kind;
- typedef float sum;
- };
-
-
-
/*! \brief Print a saturated unsigned integer \p i into the output
* stream \p ostr.
*
@@ -135,6 +150,9 @@
static const unsigned max_ = mln_max(int_u<n>);
if (i < 0)
this->v_ = 0;
+ // FIXME: This comparison triggers a warning between signed and
+ // unsigned values from the compiler. If it is valid, use a
+ // cast and leave a comment about it.
else if (i > max_)
this->v_ = max_;
else
Index: milena/mln/set/inter.hh
--- milena/mln/set/inter.hh (revision 1626)
+++ milena/mln/set/inter.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// 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
@@ -80,8 +80,8 @@
std::set_intersection(sl.begin(), sl.end(),
sr.begin(), sr.end(),
std::inserter(s, s.begin()));
- return convert::to_window(s);
trace::exiting("set::inter");
+ return convert::to_window(s);
}
template <typename Wl, typename Wr>
@@ -99,8 +99,8 @@
std::set_intersection(sl.begin(), sl.end(),
sr.begin(), sr.end(),
std::inserter(s, s.begin()));
- return convert::to_p_set(s);
trace::exiting("set::inter");
+ return convert::to_p_set(s);
}
# endif // ! MLN_INCLUDE_ONLY
Index: milena/mln/morpho/erosion.spe.hh
--- milena/mln/morpho/erosion.spe.hh (revision 1626)
+++ milena/mln/morpho/erosion.spe.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// 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
@@ -178,10 +178,14 @@
mln_pixter(O) p_out(output);
for_all_2(p, p_out)
+ // Consider P only if its value is `true' (the erosion
+ // is anti-extensive).
if (p.val())
for_all(q)
if (! q.val())
{
+ // Assign `false' to the value of P_OUT as soon
+ // as a `false' value is found in its vicinity.
p_out.val() = false;
break;
}
@@ -194,10 +198,17 @@
mln_pixter(O) p_out(output);
for_all_2(p, p_out)
for_all(q)
+ {
+ // Stop as soon as a `false' value is found the
+ // window.
if (! q.val())
break;
+ // If a `false' value was not found, then Q is now
+ // invalid (past the end of the window), and vice
+ // versa. Use this information to assign P_OUT.
p_out.val() = ! q.is_valid();
}
+ }
trace::exiting("morpho::impl::erosion_iterative_(kind::logic, speed::fastest)");
return output;
https://svn.lrde.epita.fr/svn/oln/trunk/milena
Index: ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
Fix mln::mesh_image.
* mln/core/mesh_image.hh
(internal::data_< mesh_image<P, V> >::mesh_): Turn this attribute
into a reference to mesh_p<P>.
(init_(tag::image_t, mesh_image<P, V>&, const mesh_image<P, V>&)):
New specialization for mesh_image.
(mesh_image<P, V>::init_): New method.
Use it...
(mesh_image<P, V>::mesh_image): ...in this ctor.
* mln/core/mesh_p_piter.hh (mesh_p_piter_<P>::to_point)
(mesh_p_piter_<P>::to_psite): Don't check the validity of the
iterator, as it is incompatible with the current convention on the
use of window/neighborhood iterators.
* mln/core/mesh_p.hh: Add a FIXME.
* mln/draw/mesh.hh
(draw::mesh(Image<I>&, const mesh_image<P, V>&, mln_value(I))):
Add a third argument to choose the value used to print edges.
* tests/core/mesh_image.cc: Adjust.
Perform dilation and erosion on graph-based images (i.e.,
mesh_image objects).
mln/core/mesh_image.hh | 59 ++++++++++++++++++++++++++++++++++++++++++++---
mln/core/mesh_p.hh | 3 ++
mln/core/mesh_p_piter.hh | 20 +++++++++++++++
mln/draw/mesh.hh | 18 +++++++++++---
tests/core/mesh_image.cc | 52 +++++++++++++++++++++++++++++++++++------
5 files changed, 137 insertions(+), 15 deletions(-)
Index: mln/core/mesh_image.hh
--- mln/core/mesh_image.hh (revision 1624)
+++ mln/core/mesh_image.hh (working copy)
@@ -58,7 +58,7 @@
data_(mesh_p<P>& mesh, std::vector<V>& val);
std::vector<V> val_;
- mesh_p<P> mesh_;
+ mesh_p<P>& mesh_;
};
} // end of namespace mln::internal
@@ -117,6 +117,9 @@
mesh_image(mesh_p<P>& mesh, std::vector<V>& val);
mesh_image();
+ /// Initialize an empty image.
+ void init_(mesh_p<P>& mesh, std::vector<V>& val);
+
/// Read-only access of pixel value at point site \p p.
const V& operator()(const mesh_psite<P>& p) const;
@@ -126,6 +129,7 @@
/// Give the set of values of the image.
const vset& values() const;
+ // FIXME: Keep this name?
const std::vector<V>& data_values () const;
const mesh_p<P>& domain() const;
@@ -137,11 +141,39 @@
const P& access_location_link_node2 (const unsigned& i) const;
};
-
+ // Fwd decl.
+ template <typename P, typename V>
+ void init_(tag::image_t,
+ mesh_image<P, V>& target, const mesh_image<P, V>& model);
# ifndef MLN_INCLUDE_ONLY
+ /*-----------------.
+ | Initialization. |
+ `-----------------*/
+
+ template <typename P, typename V>
+ inline
+ void init_(tag::image_t,
+ mesh_image<P, V>& target, const mesh_image<P, V>& model)
+ {
+ /* FIXME: Unfortunately, we cannot simply use
+
+ target.init_(model.domain(), model.data_values ());
+
+ here, since domain() and data_values() return const data, and
+ init_ expects non mutable data. These constness problems exist
+ also in mesh_psite (see uses of const_cast<>). Hence the
+ inelegant use of const_cast<>'s. */
+ target.init_(const_cast<mesh_p<P>&> (model.domain()),
+ const_cast<std::vector<V>&> (model.data_values ()));
+ }
+
+ /*-------.
+ | Data. |
+ `-------*/
+
namespace internal
{
template <typename P, typename V>
@@ -154,11 +186,15 @@
} // end of namespace mln::internal
+ /*---------------.
+ | Construction. |
+ `---------------*/
+
template <typename P, typename V>
inline
mesh_image<P, V>::mesh_image(mesh_p<P>& mesh, std::vector<V>& val)
{
- this->data_ = new internal::data_< mesh_image<P, V> > (mesh, val);
+ init_(mesh, val);
}
template <typename P, typename V>
@@ -169,6 +205,23 @@
template <typename P, typename V>
inline
+ void
+ mesh_image<P, V>::init_(mesh_p<P>& mesh, std::vector<V>& val)
+ {
+ /* FIXME: We leak memory here: calling init_ twice loses the
+ previous content pointed by data_.
+
+ We should definitely write down formal guidelines on
+ initializaion and memory management in general! */
+ this->data_ = new internal::data_< mesh_image<P, V> > (mesh, val);
+ }
+
+ /*---------------.
+ | Manipulation. |
+ `---------------*/
+
+ template <typename P, typename V>
+ inline
const V&
mesh_image<P, V>::operator()(const mesh_psite<P>& p) const
{
Index: mln/core/mesh_p_piter.hh
--- mln/core/mesh_p_piter.hh (revision 1624)
+++ mln/core/mesh_p_piter.hh (working copy)
@@ -174,7 +174,17 @@
const P&
mesh_p_piter_<P>::to_point() const
{
+ /* We don't check whether the iterator is valid before returning
+ the value using
+
mln_precondition(is_valid());
+
+ since this method may be called *before* the iterator is
+ actually initialized. This is the case for instance when this
+ point iterator (say, P) is used to initialize another iterator
+ on window or neighborhood (say, Q); most of the time, for_all()
+ is responsible for the initialization of P, but it takes place
+ *after* the creation of Q. */
return p_;
}
@@ -183,7 +193,17 @@
const mesh_psite<P>&
mesh_p_piter_<P>::to_psite() const
{
+ /* We don't check whether the iterator is valid before returning
+ the value using
+
mln_precondition(is_valid());
+
+ since this method may be called *before* the iterator is
+ actually initialized. This is the case for instance when this
+ point iterator (say, P) is used to initialize another iterator
+ on window or neighborhood (say, Q); most of the time, for_all()
+ is responsible for the initialization of P, but it takes place
+ *after* the creation of Q. */
return psite_;
}
Index: mln/core/mesh_p.hh
--- mln/core/mesh_p.hh (revision 1624)
+++ mln/core/mesh_p.hh (working copy)
@@ -75,6 +75,9 @@
graph gr_;
std::vector<P> loc_;
// FIXME: (Roland) Is it really useful/needed?
+ /* 2007-12-19: It seems so, since mesh_image must implement a method
+ named bbox(). Now the question is: should each image type have a
+ bounding box? */
box_<P> bb_;
};
Index: mln/draw/mesh.hh
--- mln/draw/mesh.hh (revision 1624)
+++ mln/draw/mesh.hh (working copy)
@@ -45,6 +45,10 @@
namespace draw
{
+ /* FIXME: `draw::mesh' is not a good name. These functions do not
+ actually draw the mesh/mesh_image; it *converts* it to a
+ printable image. These functions should be put elsewhere
+ (e.g., in debug::). */
/*! Draw an image \p ima from a mesh_p \p m, with value \p node_v
* for nodes, value \p link_v for links and 0 for the background.
@@ -67,15 +71,20 @@
* \param[in,out] ima The image to be drawn.
* \param[in] mesh The mesh_image which contains nodes, links
* positions and the values of it.
+ * \param[in] link_v The value to assign to pixels which contains links,
+ * defaulting to 1.
*
*/
+ // FIXME: The type of the last argument cannot always been
+ // constructed from `int'! We should remove this last argument.
template <typename I, typename P, typename V>
void
- mesh(Image<I>& ima, const mesh_image<P, V>& mesh);
+ mesh(Image<I>& ima, const mesh_image<P, V>& mesh,
+ mln_value(I) link_v = 1);
# ifndef MLN_INCLUDE_ONLY
- // FIXME: Add assertions on the size of the image: it must be big
+ // FIXME: Add assertions on the size of the image: it must be large
// enough to hold the reprensentation of the graph.
template <typename I, typename P>
@@ -100,7 +109,8 @@
template <typename I, typename P, typename V>
inline
void
- mesh(Image<I>& ima, const mesh_image<P, V>& mesh)
+ mesh(Image<I>& ima, const mesh_image<P, V>& mesh,
+ mln_value(I) link_v)
{
level::fill(ima, 0);
@@ -108,7 +118,7 @@
line (exact(ima),
mesh.access_location_link_node1 (i),
mesh.access_location_link_node2 (i),
- 1);
+ link_v);
for (unsigned i = 0; i < mesh.domain().gr_.nb_node_; ++i)
exact(ima)(mesh.domain().loc_[i]) = mesh.data_values ()[i];
Index: tests/core/mesh_image.cc
--- tests/core/mesh_image.cc (revision 1624)
+++ tests/core/mesh_image.cc (working copy)
@@ -25,10 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/core/mesh_image.cc
- *
- * \brief Tests on mln::mesh_image.
- */
+/// \file tests/core/mesh_image.cc
+/// \brief Tests on mln::mesh_image.
#include <vector>
@@ -37,6 +35,9 @@
#include <mln/core/mesh_elt_window.hh>
#include <mln/core/mesh_window_piter.hh>
+#include <mln/morpho/dilation.hh>
+
+#include <mln/draw/mesh.hh>
#include <mln/debug/iota.hh>
#include <mln/debug/println.hh>
@@ -86,9 +87,32 @@
ima_t ima(mesh, values);
// Initialize values.
debug::iota(ima);
- // The printed result does not show the graph, only the values.
+ // Print the image.
+ /* FIXME: Unfortunately, displaying mesh images is not easy right
+ now (2007-12-19). We could use
+
debug::println(ima);
+ but there's not specialization working for mesh_image; the one
+ selected by the compiler is based on a 2-D bbox, and expects the
+ interface of mesh_image to work with points (not psites).
+ Moreover, this iplementation only shows *values*, not the graph
+ itslef.
+
+ An alternative is to use draw::mesh (which, again, is misnamed),
+ but it doesn't show the values, only the nodes and edges of the
+ graph.
+
+ The current solution is a mix between draw::mesh and hand-made
+ iterations. */
+ image2d<int> ima_rep(ima.bbox());
+ // We use the value 9 in draw::mesh instead of the default (which is
+ // 1) to represent edges to distinguish it from nodes holding a
+ // value of 1.
+ draw::mesh (ima_rep, ima, 9);
+ debug::println (ima_rep);
+
+
/*------------.
| Iterators. |
`------------*/
@@ -99,11 +123,11 @@
std::cout << "ima (" << p << ") = " << ima(p) << std::endl;
// Manual iterations over the neighborhoods of each point site of IMA.
+ /* FIXME: In fact, this class should be named
+ `mesh_elt_neighborhood' (there's no such thing as an elementary
+ window on a mesh/graph!). */
typedef mesh_elt_window<point2d> win_t;
win_t win;
- // Reinitialize P, otherwise Q will trigger an assertion about P
- // being unable to convert to a valid mesh_piter object.
- p.start();
mln_qiter_(win_t) q(win, p);
for_all (p)
{
@@ -112,4 +136,16 @@
for_all (q)
std::cout << " " << q << " (level = " << ima(q) << ")" << std::endl;
}
+
+ /*-------------------------.
+ | Processing mesh images. |
+ `-------------------------*/
+
+ mesh_image<point2d, int> ima_dil = morpho::dilation(ima, win);
+ draw::mesh(ima_rep, ima_dil, 9);
+ debug::println(ima_rep);
+
+ mesh_image<point2d, int> ima_ero = morpho::erosion(ima, win);
+ draw::mesh(ima_rep, ima_ero, 9);
+ debug::println(ima_rep);
}
URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena
ChangeLog:
2007-12-21 Simon Nivault <simon.nivault(a)lrde.epita.fr>
Fix for unit tests and moving initialize.
* mln/accu/median_alt.hh,
* mln/core/image2d.hh,
* mln/core/internal/image_base.hh,
* mln/level/was.median.hh,
* mln/linear/gaussian.hh: Fix.
* mln/core/concept/image.hh: Move initialize...
* mln/core/initialize.hh: New. ...here.
---
accu/median_alt.hh | 2 -
core/concept/image.hh | 30 -----------------
core/image2d.hh | 1
core/initialize.hh | 74 ++++++++++++++++++++++++++++++++++++++++++++
core/internal/image_base.hh | 3 -
level/was.median.hh | 7 ++++
linear/gaussian.hh | 5 ++
7 files changed, 88 insertions(+), 34 deletions(-)
Index: trunk/milena/mln/core/initialize.hh
===================================================================
--- trunk/milena/mln/core/initialize.hh (revision 0)
+++ trunk/milena/mln/core/initialize.hh (revision 1624)
@@ -0,0 +1,74 @@
+// Copyright (C) 2007 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License. This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+#ifndef MLN_CORE_INITIALIZE_HH
+# define MLN_CORE_INITIALIZE_HH
+
+/*! \file mln/core/initialize.hh
+ *
+ * \brief Definition of function that initialize an image from another
+ * one.
+ */
+
+# include <mln/core/concept/image.hh>
+
+namespace mln
+{
+
+ /*! Initialize the image \p target with data extracted from image \p model.
+ *
+ * \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
+ */
+ template <typename I, typename J>
+ void initialize(Image<I>& target, const Image<J>& model);
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+
+ template <typename I, typename J>
+ inline
+ 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());
+
+ init_(tag::image, exact(target), exact(model));
+
+ mln_postcondition(exact(target).has_data());
+ trace::exiting("core::initialize");
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+} // end of namespace mln
+
+#endif // ! MLN_CORE_INITIALIZE_HH
Index: trunk/milena/mln/core/internal/image_base.hh
===================================================================
--- trunk/milena/mln/core/internal/image_base.hh (revision 1623)
+++ trunk/milena/mln/core/internal/image_base.hh (revision 1624)
@@ -252,7 +252,4 @@
} // end of namespace mln
-# include <mln/core/init.hh>
-
-
#endif // ! MLN_CORE_INTERNAL_IMAGE_BASE_HH
Index: trunk/milena/mln/core/concept/image.hh
===================================================================
--- trunk/milena/mln/core/concept/image.hh (revision 1623)
+++ trunk/milena/mln/core/concept/image.hh (revision 1624)
@@ -117,19 +117,6 @@
};
-
- /*! Initialize the image \p target with data extracted from image \p model.
- *
- * \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
- */
- template <typename I, typename J>
- void initialize(Image<I>& target, const Image<J>& model);
-
-
-
# ifndef MLN_INCLUDE_ONLY
template <typename E>
@@ -181,25 +168,10 @@
m8 = 0;
}
- template <typename I, typename J>
- inline
- 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());
-
- init_(tag::image, exact(target), exact(model));
-
- mln_postcondition(exact(target).has_data());
- trace::exiting("core::initialize");
- }
-
-
# endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln
-
+# include <mln/core/initialize.hh>
#endif // ! MLN_CORE_CONCEPT_IMAGE_HH
Index: trunk/milena/mln/core/image2d.hh
===================================================================
--- trunk/milena/mln/core/image2d.hh (revision 1623)
+++ trunk/milena/mln/core/image2d.hh (revision 1624)
@@ -36,6 +36,7 @@
# include <mln/core/internal/image_primary.hh>
# include <mln/core/internal/fixme.hh>
# include <mln/core/box2d.hh>
+# include <mln/core/init.hh>
# include <mln/border/thickness.hh>
# include <mln/value/set.hh>
Index: trunk/milena/mln/level/was.median.hh
===================================================================
--- trunk/milena/mln/level/was.median.hh (revision 1623)
+++ trunk/milena/mln/level/was.median.hh (revision 1624)
@@ -35,6 +35,13 @@
# include <mln/geom/shift.hh>
# include <mln/core/window2d.hh>
+# include <mln/geom/min_col.hh>
+# include <mln/geom/max_col.hh>
+# include <mln/geom/max_row.hh>
+# include <mln/geom/min_row.hh>
+# include <mln/set/diff.hh>
+# include <mln/accu/median.hh>
+# include <mln/win/hline2d.hh>
namespace mln
{
Index: trunk/milena/mln/linear/gaussian.hh
===================================================================
--- trunk/milena/mln/linear/gaussian.hh (revision 1623)
+++ trunk/milena/mln/linear/gaussian.hh (revision 1624)
@@ -35,10 +35,13 @@
*/
# include <mln/core/concept/image.hh>
+# include <mln/core/point2d.hh>
# include <mln/level/paste.hh>
+# include <mln/geom/ncols.hh>
+# include <mln/geom/nrows.hh>
# include <vector>
-
+# include <cmath>
namespace mln
{
Index: trunk/milena/mln/accu/median_alt.hh
===================================================================
--- trunk/milena/mln/accu/median_alt.hh (revision 1623)
+++ trunk/milena/mln/accu/median_alt.hh (revision 1624)
@@ -71,7 +71,7 @@
protected:
- histo_on_set<S> h_;
+ histo<S> h_;
const S& s_; // derived from h_
std::size_t sum_minus_, sum_plus_;
URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena
ChangeLog:
2007-12-19 Guillaume Duhamel <guillaume.duhamel(a)lrde.epita.fr>
Add briefs to fill out user documentation.
* mln/accu/bbox.hh,
* mln/accu/compute.hh,
* mln/accu/count.hh,
* mln/accu/histo.hh,
* mln/accu/max.hh,
* mln/accu/max_h.hh,
* mln/accu/mean.hh,
* mln/accu/median.hh,
* mln/accu/median_alt.hh,
* mln/accu/min.hh,
* mln/accu/min_h.hh,
* mln/accu/min_max.hh,
* mln/accu/nil.hh,
* mln/accu/p.hh,
* mln/accu/pair.hh,
* mln/accu/sum.hh,
* mln/accu/take.hh,
* mln/accu/v.hh,
* mln/core/concept/function.hh,
* mln/core/mesh_window_piter.hh,
* mln/fun/v2v/linear.hh,
* mln/trait/promote.hh,
* mln/util/ordpair.hh,
* mln/value/lut_vec.hh,
* mln/value/set.hh: Fix briefs of structures/classes of these files.
* doc/Makefile.am: Remove the generation of the TODO list in user
documentation.
---
doc/Makefile.am | 1
mln/accu/bbox.hh | 2 -
mln/accu/compute.hh | 13 +++++++-
mln/accu/count.hh | 9 ++++-
mln/accu/histo.hh | 4 +-
mln/accu/max.hh | 6 ++-
mln/accu/max_h.hh | 2 -
mln/accu/mean.hh | 7 ++--
mln/accu/median.hh | 4 +-
mln/accu/median_alt.hh | 4 +-
mln/accu/min.hh | 6 ++-
mln/accu/min_h.hh | 4 +-
mln/accu/min_max.hh | 2 -
mln/accu/nil.hh | 8 +++--
mln/accu/p.hh | 8 +++--
mln/accu/pair.hh | 8 ++---
mln/accu/sum.hh | 6 ++-
mln/accu/take.hh | 2 -
mln/accu/v.hh | 8 +++--
mln/core/concept/function.hh | 66 +++++++++++++++++++++++++++++++-----------
mln/core/mesh_window_piter.hh | 9 +++--
mln/fun/v2v/linear.hh | 5 +--
mln/trait/promote.hh | 8 +++--
mln/util/ordpair.hh | 9 +++--
mln/value/lut_vec.hh | 2 -
mln/value/set.hh | 4 +-
26 files changed, 139 insertions(+), 68 deletions(-)
Index: trunk/milena/doc/Makefile.am
===================================================================
--- trunk/milena/doc/Makefile.am (revision 1618)
+++ trunk/milena/doc/Makefile.am (revision 1619)
@@ -32,6 +32,7 @@
-e 's,HIDE_FRIEND_COMPOUNDS = NO,HIDE_FRIEND_COMPOUNDS = YES,g' \
-e 's,HIDE_IN_BODY_DOCS = NO,HIDE_IN_BODY_DOCS = YES,g' \
-e 's,INTERNAL_DOCS = YES,INTERNAL_DOCS = NO,g' \
+ -e 's,GENERATE_TODOLIST = YES,GENERATE_TODOLIST = NO,g' \
-e 's,PROJECT_NUMBER = \",PROJECT_NUMBER = \"User documentation ,g'
EXTRA_DIST = Doxyfile.in
Index: trunk/milena/mln/trait/promote.hh
===================================================================
--- trunk/milena/mln/trait/promote.hh (revision 1618)
+++ trunk/milena/mln/trait/promote.hh (revision 1619)
@@ -61,9 +61,11 @@
};
- /// Default case when one type is involved twice: the promotion
- /// type is the same as the input type (so actually there is no
- /// promotion).
+ /*!
+ * \brief Default case when one type is involved twice: the
+ * promotion type is the same as the input type (so actually there
+ * is no promotion).
+ */
template <typename T>
struct set_binary_< promote, Object, T, Object, T >
{
Index: trunk/milena/mln/core/mesh_window_piter.hh
===================================================================
--- trunk/milena/mln/core/mesh_window_piter.hh (revision 1618)
+++ trunk/milena/mln/core/mesh_window_piter.hh (revision 1619)
@@ -28,9 +28,12 @@
#ifndef MLN_CORE_MESH_WINDOW_PITER_HH
# define MLN_CORE_MESH_WINDOW_PITER_HH
-// FIXME: Doc.
-
-// FIXME: Shall we rename `piter' as `qiter'?
+/*!
+ * \file mln/core/mesh_window_piter.hh
+ *
+ * \brief Definition of point iterator of mesh window.
+ *
+ */
# include <mln/core/concept/point_iterator.hh>
# include <mln/core/mesh_p.hh>
Index: trunk/milena/mln/core/concept/function.hh
===================================================================
--- trunk/milena/mln/core/concept/function.hh (revision 1618)
+++ trunk/milena/mln/core/concept/function.hh (revision 1619)
@@ -41,6 +41,7 @@
/// \{
/// Fwd decls.
+
template <typename E> struct Function;
template <typename E> struct Function_v2v;
template <typename E> struct Function_i2v;
@@ -85,8 +86,12 @@
template <>
struct Function_v2v<void> { typedef Function<void> super; };
- /// Base class for implementation of function-objects from value to
- /// value.
+ /*!
+ * \brief Base class for implementation of function-objects from
+ * value to value.
+ *
+ * The parameter \a E is the exact type.
+ */
template <typename E>
struct Function_v2v : public Function<E>
{
@@ -102,8 +107,13 @@
template <>
struct Function_i2v<void> { typedef Function_v2v<void> super; };
- /// Base class for implementation of function-objects from index to
- /// value.
+
+ /*!
+ * \brief Base class for implementation of function-objects from
+ * index to value.
+ *
+ * The parameter \a E is the exact type.
+ */
template <typename E>
struct Function_i2v : public Function_v2v<E>
{
@@ -119,8 +129,12 @@
template <>
struct Function_p2v<void> { typedef Function_v2v<void> super; };
- /// Base class for implementation of function-objects from point to
- /// value.
+ /*!
+ * \brief Base class for implementation of function-objects from point to
+ * value.
+ *
+ * The parameter \a E is the exact type.
+ */
template <typename E>
struct Function_p2v : public virtual Function_v2v<E>
{
@@ -136,8 +150,12 @@
template <>
struct Function_v2b<void> { typedef Function_v2v<void> super; };
- /// Base class for implementation of function-objects from value to
- /// bool.
+ /*!
+ * \brief Base class for implementation of function-objects from value to
+ * bool.
+ *
+ * The parameter \a E is the exact type.
+ */
template <typename E>
struct Function_v2b : public virtual Function_v2v<E>
{
@@ -154,8 +172,12 @@
template <>
struct Function_p2b<void> { typedef Function_p2v<void> super; }; // FIXME
- /// Base class for implementation of function-objects from point to
- /// bool.
+ /*!
+ * \brief Base class for implementation of function-objects from point to
+ * bool.
+ *
+ * The parameter \a E is the exact type.
+ */
template <typename E>
struct Function_p2b : public Function_p2v<E>,
public Function_v2b<E>
@@ -173,8 +195,12 @@
template <>
struct Function_p2p<void> { typedef Function_p2v<void> super; }; // FIXME
- /// Base class for implementation of function-objects from point to
- /// point.
+ /*!
+ * \brief Base class for implementation of function-objects from point to
+ * point.
+ *
+ * The parameter \a E is the exact type.
+ */
template <typename E>
struct Function_p2p : public Function_p2v<E>
{
@@ -190,8 +216,12 @@
template <>
struct Function_x2x<void> { typedef Function_v2v<void> super; }; // FIXME
- /// Base class for implementation of function-objects from vector to
- /// vector.
+ /*!
+ * \brief Base class for implementation of function-objects from vector to
+ * vector.
+ *
+ * The parameter \a E is the exact type.
+ */
template <typename E>
struct Function_x2x : public Function_v2v<E>
{
@@ -203,8 +233,12 @@
// Vector <-> Vector.
- /// Base class for implementation of bijective function-objects from
- /// vector to vector.
+ /*!
+ * \brief Base class for implementation of bijective function-objects from
+ * vector to vector.
+ *
+ * The parameter \a E is the exact type.
+ */
template <typename E>
struct Bijection_x2x : public Function_x2x< E >
{
Index: trunk/milena/mln/accu/nil.hh
===================================================================
--- trunk/milena/mln/accu/nil.hh (revision 1618)
+++ trunk/milena/mln/accu/nil.hh (revision 1619)
@@ -47,7 +47,8 @@
namespace accu
{
- /*! Define an accumulator that does nothing.
+ /*!
+ * \brief Define an accumulator that does nothing.
*/
template <typename T>
struct nil_ : public mln::accu::internal::base_< util::ignore , nil_<T> >
@@ -66,8 +67,9 @@
};
-
- // FIXME: Doc!
+ /*!
+ * \brief Meta accumulator for nil.
+ */
struct nil : public Meta_Accumulator< nil >
{
template <typename V>
Index: trunk/milena/mln/accu/min.hh
===================================================================
--- trunk/milena/mln/accu/min.hh (revision 1618)
+++ trunk/milena/mln/accu/min.hh (revision 1619)
@@ -46,7 +46,7 @@
{
- /*! Generic min accumulator class.
+ /*! \brief Generic min accumulator class.
*
* The parameter \c T is the type of values.
*/
@@ -74,7 +74,9 @@
template <typename I> struct min_< util::pix<I> >;
- // FIXME: Doc!
+ /*!
+ * \brief Meta accumulator for min.
+ */
struct min : public Meta_Accumulator< min >
{
template <typename T>
Index: trunk/milena/mln/accu/take.hh
===================================================================
--- trunk/milena/mln/accu/take.hh (revision 1618)
+++ trunk/milena/mln/accu/take.hh (revision 1619)
@@ -44,7 +44,7 @@
namespace accu
{
- /*! Make an accumulator take the pixels of the image \p input.
+ /*! \brief Make an accumulator take the pixels of the image \p input.
*
* \param[in] input The input image.
* \param[in,out] a The accumulator.
Index: trunk/milena/mln/accu/max.hh
===================================================================
--- trunk/milena/mln/accu/max.hh (revision 1618)
+++ trunk/milena/mln/accu/max.hh (revision 1619)
@@ -46,7 +46,7 @@
{
- /*! Generic max accumulator class.
+ /*! \brief Generic max accumulator class.
*
* The parameter \c T is the type of values.
*/
@@ -74,7 +74,9 @@
template <typename I> struct max_< util::pix<I> >;
- // FIXME: Doc!
+ /*!
+ * \brief Meta accumulator for max.
+ */
struct max : public Meta_Accumulator< max >
{
template <typename T>
Index: trunk/milena/mln/accu/histo.hh
===================================================================
--- trunk/milena/mln/accu/histo.hh (revision 1618)
+++ trunk/milena/mln/accu/histo.hh (revision 1619)
@@ -50,7 +50,8 @@
{
- /*! Generic histogram class over a value set with type \c S.
+ /*!
+ * \brief Generic histogram class over a value set with type \c S.
*/
template <typename S>
struct histo : public mln::accu::internal::base_< const std::vector<std::size_t>& , histo<S> >
@@ -83,7 +84,6 @@
std::size_t sum_;
};
-
template <typename S>
std::ostream& operator<<(std::ostream& ostr, const histo<S>& h);
Index: trunk/milena/mln/accu/min_max.hh
===================================================================
--- trunk/milena/mln/accu/min_max.hh (revision 1618)
+++ trunk/milena/mln/accu/min_max.hh (revision 1619)
@@ -50,7 +50,7 @@
namespace accu
{
- /*! Generic min and max accumulator class.
+ /*! \brief Generic min and max accumulator class.
*
* The parameter \c V is the type of values.
*/
Index: trunk/milena/mln/accu/count.hh
===================================================================
--- trunk/milena/mln/accu/count.hh (revision 1618)
+++ trunk/milena/mln/accu/count.hh (revision 1619)
@@ -44,7 +44,10 @@
{
- /*! Generic counter accumulator class.
+ /*!
+ * \brief Generic counter accumulator class.
+ *
+ * The parameter \a T is the type to be count.
*/
template <typename T>
struct count_ : public mln::accu::internal::base_< std::size_t , count_<T> >
@@ -67,7 +70,9 @@
};
- // FIXME: Doc!
+ /*!
+ * \brief Meta accumulator for count.
+ */
struct count : public Meta_Accumulator< count >
{
template <typename T>
Index: trunk/milena/mln/accu/bbox.hh
===================================================================
--- trunk/milena/mln/accu/bbox.hh (revision 1618)
+++ trunk/milena/mln/accu/bbox.hh (revision 1619)
@@ -44,7 +44,7 @@
{
- /*! Generic bbox accumulator class.
+ /*! \brief Generic bbox accumulator class.
*
* The parameter \c P is the type of points.
*/
Index: trunk/milena/mln/accu/min_h.hh
===================================================================
--- trunk/milena/mln/accu/min_h.hh (revision 1618)
+++ trunk/milena/mln/accu/min_h.hh (revision 1619)
@@ -44,8 +44,8 @@
{
- /*! Generic min function based on histogram over a value set with
- * type \c S.
+ /*! \brief Generic min function based on histogram over a value
+ * set with type \c S.
*/
template <typename S>
struct min_h : public mln::accu::internal::base_< mln_value(S) , min_h<S> >
Index: trunk/milena/mln/accu/pair.hh
===================================================================
--- trunk/milena/mln/accu/pair.hh (revision 1618)
+++ trunk/milena/mln/accu/pair.hh (revision 1619)
@@ -49,7 +49,7 @@
{
- /*! Generic pair of accumulators.
+ /*! \brief Generic pair of accumulators.
*
* The parameter \c T is the type of values.
*
@@ -81,9 +81,9 @@
A2 a2_;
};
-
-
- // FIXME: Doc!
+ /*!
+ * \brief Meta accumulator for pair.
+ */
template <typename A1, typename A2>
struct pair : public Meta_Accumulator< pair<A1,A2> >
{
Index: trunk/milena/mln/accu/max_h.hh
===================================================================
--- trunk/milena/mln/accu/max_h.hh (revision 1618)
+++ trunk/milena/mln/accu/max_h.hh (revision 1619)
@@ -44,7 +44,7 @@
{
- /*! Generic max function based on histogram over a value set with
+ /*! \brief Generic max function based on histogram over a value set with
* type \c S.
*/
template <typename S>
Index: trunk/milena/mln/accu/median.hh
===================================================================
--- trunk/milena/mln/accu/median.hh (revision 1618)
+++ trunk/milena/mln/accu/median.hh (revision 1619)
@@ -44,8 +44,8 @@
{
- /*! Generic median function based on histogram over a value set
- * with type \c S.
+ /*! \brief Generic median function based on histogram over a value
+ * set with type \c S.
*/
template <typename S>
struct median : public mln::accu::internal::base_< mln_value(S), median<S> >
Index: trunk/milena/mln/accu/median_alt.hh
===================================================================
--- trunk/milena/mln/accu/median_alt.hh (revision 1618)
+++ trunk/milena/mln/accu/median_alt.hh (revision 1619)
@@ -44,8 +44,8 @@
{
- /*! Generic median_alt function based on histogram over a value set
- * with type \c S.
+ /*! \brief Generic median_alt function based on histogram over a
+ * value set with type \c S.
*/
template <typename S>
struct median_alt : : public mln::accu::internal::base_< mln_value(S), median_alt<S> >
Index: trunk/milena/mln/accu/p.hh
===================================================================
--- trunk/milena/mln/accu/p.hh (revision 1618)
+++ trunk/milena/mln/accu/p.hh (revision 1619)
@@ -46,7 +46,8 @@
{
- /*! Generic p of accumulators.
+ /*!
+ * \brief Generic p of accumulators.
*
* The parameter \c V is the type of values.
*/
@@ -72,8 +73,9 @@
};
-
- // FIXME: Doc!
+ /*!
+ * \brief Meta accumulator for p.
+ */
template <typename mA>
struct p : public Meta_Accumulator< p<mA> >
{
Index: trunk/milena/mln/accu/sum.hh
===================================================================
--- trunk/milena/mln/accu/sum.hh (revision 1618)
+++ trunk/milena/mln/accu/sum.hh (revision 1619)
@@ -48,7 +48,7 @@
{
- /*! Generic sum accumulator class.
+ /*! \brief Generic sum accumulator class.
*
* Parameter \c T is the type of values that we sum. Parameter \c
* S is the type to store the value sum; the default type of
@@ -78,7 +78,9 @@
struct sum_< util::pix<I>, S >;
- // FIXME: Doc!
+ /*!
+ * \brief Meta accumulator for sum.
+ */
struct sum : public Meta_Accumulator< sum >
{
template <typename T, typename S = mln_sum(T)>
Index: trunk/milena/mln/accu/v.hh
===================================================================
--- trunk/milena/mln/accu/v.hh (revision 1618)
+++ trunk/milena/mln/accu/v.hh (revision 1619)
@@ -45,7 +45,8 @@
{
- /*! Generic v of accumulators.
+ /*!
+ * \brief Generic val of accumulators.
*/
template <typename A>
struct val_ : public mln::accu::internal::base_< mln_result(A) , val_<A> >
@@ -80,8 +81,9 @@
};
-
- // FIXME: Doc!
+ /*!
+ * \brief Meta accumulator for val.
+ */
template <typename mA>
struct val : public Meta_Accumulator< val<mA> >
{
Index: trunk/milena/mln/accu/compute.hh
===================================================================
--- trunk/milena/mln/accu/compute.hh (revision 1618)
+++ trunk/milena/mln/accu/compute.hh (revision 1619)
@@ -46,7 +46,7 @@
namespace accu
{
- /*! Make an accumulator compute the pixels of the image \p input.
+ /*! \brief Make an accumulator compute the pixels of the image \p input.
*
* \param[in] input The input image.
*
@@ -61,7 +61,16 @@
compute(const Image<I>& input);
- // FIXME: Doc!
+ /*! \brief Make an accumulator compute the pixels of the image \p input.
+ *
+ * \param[in] input The input image.
+ *
+ * This routine runs: \n
+ * a.take(make::pix(input, p));
+ * on all pixels on the images.
+ *
+ * \warning This routine does not perform a.init().
+ */
template <typename A, typename I>
mln_accu_with(A, util::pix<I>)::result
compute(const Image<I>& input);
Index: trunk/milena/mln/accu/mean.hh
===================================================================
--- trunk/milena/mln/accu/mean.hh (revision 1618)
+++ trunk/milena/mln/accu/mean.hh (revision 1619)
@@ -47,7 +47,7 @@
{
- /*! Generic mean accumulator class.
+ /*! \brief Generic mean accumulator class.
*
* Parameter \c T is the type of values that we sum. Parameter \c
* S is the type to store the sum of values; the default type of
@@ -83,8 +83,9 @@
struct mean_< util::pix<I>, S,M >;
-
- // FIXME: Doc!
+ /*!
+ * \brief Meta accumulator for mean.
+ */
struct mean : public Meta_Accumulator< mean >
{
template < typename T,
Index: trunk/milena/mln/value/lut_vec.hh
===================================================================
--- trunk/milena/mln/value/lut_vec.hh (revision 1618)
+++ trunk/milena/mln/value/lut_vec.hh (revision 1619)
@@ -51,7 +51,7 @@
template <typename S> struct bkd_viter_;
- /*! Class that defines FIXME
+ /*! \brief Class that defines FIXME
*
* \warning This is a multi-set!!!
* FIXME
Index: trunk/milena/mln/value/set.hh
===================================================================
--- trunk/milena/mln/value/set.hh (revision 1618)
+++ trunk/milena/mln/value/set.hh (revision 1619)
@@ -46,10 +46,12 @@
namespace internal
{
+ /// \internal
template <typename T, typename E, bool is_lowq = false>
struct set_selector_ // no inheritance
{};
+ /// \internal
template <typename T, typename E>
struct set_selector_< T, E, true > // lowq so iterable
:
@@ -60,7 +62,7 @@
- /*! Class that defines the set of values of type \c T.
+ /*! \brief Class that defines the set of values of type \c T.
*
* This is the exhaustive set of values obtainable from type \c T.
*/
Index: trunk/milena/mln/fun/v2v/linear.hh
===================================================================
--- trunk/milena/mln/fun/v2v/linear.hh (revision 1618)
+++ trunk/milena/mln/fun/v2v/linear.hh (revision 1619)
@@ -45,10 +45,9 @@
namespace v2v
{
- /*! Linear function.
- *
+ /*!
+ *\brief Linear function.
* f(v) = a * v + b.
- *
* \c V is the type of input values; \c T is the type used to
* compute the result; \c R is the result type.
*
Index: trunk/milena/mln/util/ordpair.hh
===================================================================
--- trunk/milena/mln/util/ordpair.hh (revision 1618)
+++ trunk/milena/mln/util/ordpair.hh (revision 1619)
@@ -42,9 +42,12 @@
namespace util
{
- /// Ordered pair structure s.a. this->first <= this->second;
- /// ordered pairs are partially ordered using lexicographical
- /// ordering.
+ /*!
+ * \brief Ordered pair structure s.a. this->first <= this->second;
+ * ordered pairs are partially ordered using lexicographical
+ * ordering.
+ *
+ */
template <typename T>
struct ordpair_ : public mln::Object< ordpair_<T> >
{