#122: [TRAITS] image_if_base
---------------------+------------------------------------------------------
Reporter: duhamel | Owner: Olena Team
Type: defect | Status: new
Priority: major | Milestone: Olena 1.0ß
Component: Milena | Version: 1.0
Keywords: |
---------------------+------------------------------------------------------
In source:trunk/milena/mln/core/internal/image_if_base.hh data trait is
suspect.
For example an image_if from an image1d has always data trait raw !
--
Ticket URL: <https://trac.lrde.org/olena/ticket/122>
Olena <http://olena.lrde.epita.fr>
Olena, a generic and efficient C++ image library.
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> >
{
On 2007-12-17, Guillaume Duhamel <guillaume.duhamel(a)lrde.epita.fr> wrote:
> Index: trunk/milena/mln/core/concept/object.hh
>===================================================================
> --- trunk/milena/mln/core/concept/object.hh (revision 1613)
> +++ trunk/milena/mln/core/concept/object.hh (revision 1614)
> @@ -46,6 +46,84 @@
> # include <mln/metal/ret.hh>
>
>
> +/*! \mainpage Documentation of milena
> + *
> + * \section intro_sec Introduction
> + *
> + * This is the documentation of milena.
> + *
> + * \section tools_subsec Tools required.
> + * FIXME.
> + *
> + * \section mln_sec Overview of milena.
> + *
> + * <UL>
> + * <LI> \ref mln
> + * <LI> \ref mln::accu
> + * <LI> \ref mln::arith
> + * <LI> \ref mln::border
> + * <LI> \ref mln::canvas
> + * <LI> \ref mln::convert
> + * <LI> \ref mln::debug
> + * <LI> \ref mln::display
> + * <LI> \ref mln::draw
> + * <LI> \ref mln::estim
> + * <LI> \ref mln::fun
> + * <LI> \ref mln::geom
> + * <LI> \ref mln::histo
> + * <LI> \ref mln::io
> + * <LI> \ref mln::labeling
> + * <LI> \ref mln::level
> + * <LI> \ref mln::linear
> + * <LI> \ref mln::literal
> + * <LI> \ref mln::logical
> + * <LI> \ref mln::make
> + * <LI> \ref mln::math
> + * <LI> \ref mln::metal
> + * <LI> \ref mln::morpho
> + * <LI> \ref mln::norm
> + * <LI> \ref mln::pw
> + * <LI> \ref mln::set
> + * <LI> \ref mln::tag
> + * <LI> \ref mln::test
> + * <LI> \ref mln::trace
> + * <LI> \ref mln::trait
> + * <LI> \ref mln::util
> + * <LI> \ref mln::value
> + * <LI> \ref mln::win
> + *
> + * \section copyright Copyright and License.
> + * 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.
> + *
Il est préférable de garder le copyright header plus haut.
> + * 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.
> + *
> + */
> +
Tiens j'avais jamais remarqué qu'Olena utilisait une exception
dans la licence GPL. Je vois pas l'intérêt de mettre tout le
code en GPL + exception et pas en LGPL.
--
SIGOURE Benoit aka Tsuna (SUSv3 compliant)
_____ "I think Git is definitely in the running
/EPITA\ Promo 2008.CSI/ACU/YAKA to be the dominate version control system."
-- Bob Proulx