* mln/accu/all.hh,
* mln/accu/bbox.hh,
* mln/accu/compute.hh,
* mln/accu/convolve.hh,
* mln/accu/count.hh,
* mln/accu/count_adjacent_vertices.hh,
* mln/accu/essential.hh,
* mln/accu/height.hh,
* mln/accu/histo.hh,
* mln/accu/internal/base.hh,
* mln/accu/land.hh,
* mln/accu/line.hh,
* mln/accu/maj_h.hh,
* mln/accu/max.hh,
* mln/accu/max_h.hh,
* mln/accu/mean.hh,
* mln/accu/median_alt.hh,
* mln/accu/median_h.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/rank.hh,
* mln/accu/rank_bool.hh,
* mln/accu/rank_high_quant.hh,
* mln/accu/snake_2d.hh,
* mln/accu/sum.hh,
* mln/accu/take.hh,
* mln/accu/transform.hh,
* mln/accu/tuple.hh,
* mln/accu/v.hh,
* mln/accu/volume.hh: Update comments and add missing unmeta.
* mln/morpho/elementary/like_ero_fun.hh,
* mln/algebra/quat.hh: Fix warnings.
* mln/geom/essential.hh,
* mln/value/essential.hh: Fix includes.
* tests/accu/rank.cc: Use a new constructor for accu::meta::rank.
---
milena/ChangeLog | 47 ++++++++++++++++++++++++++
milena/mln/accu/all.hh | 19 +++++-----
milena/mln/accu/bbox.hh | 13 +++----
milena/mln/accu/compute.hh | 8 ++--
milena/mln/accu/convolve.hh | 17 ++++-----
milena/mln/accu/count.hh | 6 ++--
milena/mln/accu/count_adjacent_vertices.hh | 6 ++--
milena/mln/accu/essential.hh | 10 ++---
milena/mln/accu/height.hh | 17 +++++----
milena/mln/accu/histo.hh | 20 +++++-----
milena/mln/accu/internal/base.hh | 15 ++++----
milena/mln/accu/land.hh | 10 +++---
milena/mln/accu/line.hh | 2 +-
milena/mln/accu/maj_h.hh | 14 ++++----
milena/mln/accu/max.hh | 16 ++++-----
milena/mln/accu/max_h.hh | 14 +++----
milena/mln/accu/mean.hh | 17 ++++-----
milena/mln/accu/median_alt.hh | 26 ++++++++++----
milena/mln/accu/median_h.hh | 20 +++++------
milena/mln/accu/min.hh | 4 +-
milena/mln/accu/min_h.hh | 18 ++++------
milena/mln/accu/min_max.hh | 17 ++++-----
milena/mln/accu/nil.hh | 16 ++++-----
milena/mln/accu/p.hh | 16 ++++-----
milena/mln/accu/pair.hh | 22 ++++++------
milena/mln/accu/rank.hh | 12 ++++--
milena/mln/accu/rank_bool.hh | 22 +++++------
milena/mln/accu/rank_high_quant.hh | 25 ++++++++++---
milena/mln/accu/snake_2d.hh | 2 +-
milena/mln/accu/sum.hh | 12 +++---
milena/mln/accu/take.hh | 14 ++++----
milena/mln/accu/transform.hh | 10 +++---
milena/mln/accu/tuple.hh | 14 ++++----
milena/mln/accu/v.hh | 19 +++++-----
milena/mln/accu/volume.hh | 15 ++++----
milena/mln/algebra/quat.hh | 1 +
milena/mln/geom/essential.hh | 10 +++++
milena/mln/morpho/elementary/like_ero_fun.hh | 2 +-
milena/mln/value/essential.hh | 4 +-
milena/tests/accu/rank.cc | 4 +--
40 files changed, 309 insertions(+), 247 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 7b16037..2e64654 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,52 @@
2008-11-12 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Various small fixes.
+
+ * mln/accu/all.hh,
+ * mln/accu/bbox.hh,
+ * mln/accu/compute.hh,
+ * mln/accu/convolve.hh,
+ * mln/accu/count.hh,
+ * mln/accu/count_adjacent_vertices.hh,
+ * mln/accu/essential.hh,
+ * mln/accu/height.hh,
+ * mln/accu/histo.hh,
+ * mln/accu/internal/base.hh,
+ * mln/accu/land.hh,
+ * mln/accu/line.hh,
+ * mln/accu/maj_h.hh,
+ * mln/accu/max.hh,
+ * mln/accu/max_h.hh,
+ * mln/accu/mean.hh,
+ * mln/accu/median_alt.hh,
+ * mln/accu/median_h.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/rank.hh,
+ * mln/accu/rank_bool.hh,
+ * mln/accu/rank_high_quant.hh,
+ * mln/accu/snake_2d.hh,
+ * mln/accu/sum.hh,
+ * mln/accu/take.hh,
+ * mln/accu/transform.hh,
+ * mln/accu/tuple.hh,
+ * mln/accu/v.hh,
+ * mln/accu/volume.hh: Update comments and add missing unmeta.
+
+ * mln/morpho/elementary/like_ero_fun.hh,
+ * mln/algebra/quat.hh: Fix warnings.
+
+ * mln/geom/essential.hh,
+ * mln/value/essential.hh: Fix includes.
+
+ * tests/accu/rank.cc: Use a new constructor for accu::meta::rank.
+
+2008-11-12 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Update tutorial.
* doc/Doxyfile.in: Add new example/include paths.
diff --git a/milena/mln/accu/all.hh b/milena/mln/accu/all.hh
index 76b09d9..6f9e7a5 100644
--- a/milena/mln/accu/all.hh
+++ b/milena/mln/accu/all.hh
@@ -29,16 +29,15 @@
#ifndef MLN_ACCU_ALL_HH
# define MLN_ACCU_ALL_HH
-/*! \file mln/accu/all.hh
- *
- * \brief File that includes all accumulator types.
- *
- * \todo Update accumulators s.a. count so that they are like min_/min.
- *
- * \todo Propagate those updates to mln/estim/.
- *
- * \todo Update the include list...
- */
+/// \file mln/accu/all.hh
+///
+/// File that includes all accumulator types.
+///
+/// \todo Update accumulators s.a. count so that they are like min_/min.
+///
+/// \todo Propagate those updates to mln/estim/.
+///
+/// \todo Update the include list...
namespace mln
diff --git a/milena/mln/accu/bbox.hh b/milena/mln/accu/bbox.hh
index 4066428..90c2e5d 100644
--- a/milena/mln/accu/bbox.hh
+++ b/milena/mln/accu/bbox.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2007, 2008 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
@@ -28,10 +28,9 @@
#ifndef MLN_ACCU_BBOX_HH
# define MLN_ACCU_BBOX_HH
-/*! \file mln/accu/bbox.hh
- *
- * \brief Define an accumulator that computes a bbox.
- */
+/// \file mln/accu/bbox.hh
+///
+/// Define an accumulator that computes a bbox.
# include <mln/core/site_set/box.hh>
# include <mln/core/concept/meta_accumulator.hh>
@@ -45,8 +44,8 @@ namespace mln
{
- /*! \brief Generic bbox accumulator class.
- *
+ /// Generic bbox accumulator class.
+ /*!
* The parameter \c P is the type of points.
*/
template <typename P>
diff --git a/milena/mln/accu/compute.hh b/milena/mln/accu/compute.hh
index ad40de3..3da8d5f 100644
--- a/milena/mln/accu/compute.hh
+++ b/milena/mln/accu/compute.hh
@@ -47,8 +47,8 @@ namespace mln
namespace accu
{
- /*! \brief Make an accumulator compute the pixels of the image \p input.
- *
+ /// Make an accumulator compute the pixels of the image \p input.
+ /*!
* \param[in] input The input image.
*
* This routine runs: \n
@@ -62,8 +62,8 @@ namespace mln
compute(const Accumulator<A>& a, const Image<I>& input);
- /*! \brief Make an accumulator compute the pixels of the image \p input.
- *
+ /// Make an accumulator compute the pixels of the image \p input.
+ /*!
* \param[in] input The input image.
*
* This routine runs: \n
diff --git a/milena/mln/accu/convolve.hh b/milena/mln/accu/convolve.hh
index bad43c7..91db932 100644
--- a/milena/mln/accu/convolve.hh
+++ b/milena/mln/accu/convolve.hh
@@ -28,10 +28,9 @@
#ifndef MLN_ACCU_CONVOLVE_HH
# define MLN_ACCU_CONVOLVE_HH
-/*! \file mln/accu/convolve.hh
- *
- * \brief Define an accumulator that computes a convolution.
- */
+/// \file mln/accu/convolve.hh
+///
+/// Define an accumulator that computes a convolution.
# include <mln/accu/internal/base.hh>
# include <mln/value/ops.hh>
@@ -45,11 +44,11 @@ namespace mln
{
- /*! \brief Generic convolution accumulator class.
- *
- * Parameters \c T1 and \c T2 are the type of values to be
- * convolved. Parameter \c R is the result type.
- */
+ /// Generic convolution accumulator class.
+ ///
+ /// Parameters \c T1 and \c T2 are the type of values to be
+ /// convolved. Parameter \c R is the result type.
+ ///
template <typename T1, typename T2,
typename R = mln_sum_x(T1, T2)>
struct convolve : public mln::accu::internal::base< R, convolve<T1,T2,R> >,
diff --git a/milena/mln/accu/count.hh b/milena/mln/accu/count.hh
index da5fd21..9d68fec 100644
--- a/milena/mln/accu/count.hh
+++ b/milena/mln/accu/count.hh
@@ -31,7 +31,7 @@
/// \file mln/accu/count.hh
///
-/// \brief Define an accumulator that counts.
+/// Define an accumulator that counts.
# include <mln/accu/internal/base.hh>
# include <mln/core/concept/meta_accumulator.hh>
@@ -43,7 +43,7 @@ namespace mln
namespace accu
{
- /// \brief Generic counter accumulator class.
+ /// Generic counter accumulator class.
/// The parameter \a T is the type to be count.
template <typename T>
struct count : public mln::accu::internal::base< unsigned , count<T> >
@@ -81,7 +81,7 @@ namespace mln
namespace meta
{
- /// \brief Meta accumulator for count.
+ /// Meta accumulator for count.
struct count : public Meta_Accumulator< count >
{
template <typename T>
diff --git a/milena/mln/accu/count_adjacent_vertices.hh b/milena/mln/accu/count_adjacent_vertices.hh
index 69e8530..6d32509 100644
--- a/milena/mln/accu/count_adjacent_vertices.hh
+++ b/milena/mln/accu/count_adjacent_vertices.hh
@@ -30,7 +30,7 @@
# define MLN_ACCU_COUNT_ADJACENT_VERTICES_HH
/// \file mln/accu/count_adjacent_vertices.hh
-/// \brief Define an accumulator that counts the vertices adjacent to a
+/// Define an accumulator that counts the vertices adjacent to a
/// set of line graph psite.
# include <mln/accu/internal/base.hh>
@@ -44,7 +44,7 @@ namespace mln
namespace accu
{
- /// \brief Accumulator class counting the number of vertices
+ /// Accumulator class counting the number of vertices
/// adjacent to a set of mln::line_graph_psite (i.e., a set of
/// edges).
///
@@ -90,7 +90,7 @@ namespace mln
namespace meta
{
- /// \brief Meta accumulator for count_adjacent_vertices.
+ /// Meta accumulator for count_adjacent_vertices.
struct count_adjacent_vertices
: public Meta_Accumulator< count_adjacent_vertices >
{
diff --git a/milena/mln/accu/essential.hh b/milena/mln/accu/essential.hh
index 34124ba..18498f2 100644
--- a/milena/mln/accu/essential.hh
+++ b/milena/mln/accu/essential.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory
+// Copyright (C) 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,11 +28,9 @@
#ifndef MLN_ACCU_ESSENTIAL_HH_
# define MLN_ACCU_ESSENTIAL_HH_
-/*! \file mln/accu/essential.hh
- *
- * \brief File that includes the most useful accumulator types.
- *
- */
+/// \file mln/accu/essential.hh
+///
+/// File that includes the most useful accumulator types.
# include <mln/accu/bbox.hh>
# include <mln/accu/count.hh>
diff --git a/milena/mln/accu/height.hh b/milena/mln/accu/height.hh
index f3dc59b..90eead5 100644
--- a/milena/mln/accu/height.hh
+++ b/milena/mln/accu/height.hh
@@ -29,17 +29,18 @@
#ifndef MLN_ACCU_HEIGHT_HH
# define MLN_ACCU_HEIGHT_HH
-/** \file mln/accu/height.hh
- \brief Define an accumulator that computes the height of a
- component through one of its pixels.
-
+/// \file mln/accu/height.hh
+/// Define an accumulator that computes the height of a
+/// component through one of its pixels.
+/*
This accumulator uses an mln::util::pix (pixel) to update the
height information of the component.
The class mln/accu/height is not a general-purpose accumulator;
it is used to implement height-based connected filters.
\see mln::morpho::closing_height
- \see mln::morpho::opening_height */
+ \see mln::morpho::opening_height
+*/
# include <mln/accu/internal/base.hh>
# include <mln/core/concept/meta_accumulator.hh>
@@ -54,7 +55,7 @@ namespace mln
namespace accu
{
- /// \brief Height accumulator class.
+ /// Height accumulator class.
///
/// The parameter \p I is the image type on which the accumulator
/// of pixels is built.
@@ -62,7 +63,7 @@ namespace mln
struct height
: public mln::accu::internal::base< unsigned , height<I> >
{
- /// \brief The accumulated data type.
+ /// The accumulated data type.
///
/// The height of component is represented by the height of its
/// root pixel. See mln::morpho::closing_height and
@@ -104,7 +105,7 @@ namespace mln
namespace meta
{
- /// \brief Meta accumulator for height.
+ /// Meta accumulator for height.
struct height : public Meta_Accumulator< height >
{
template <typename I>
diff --git a/milena/mln/accu/histo.hh b/milena/mln/accu/histo.hh
index 8468e4e..d4cc29a 100644
--- a/milena/mln/accu/histo.hh
+++ b/milena/mln/accu/histo.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2007, 2008 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
@@ -28,12 +28,12 @@
#ifndef MLN_ACCU_HISTO_HH
# define MLN_ACCU_HISTO_HH
-/*! \file mln/accu/histo.hh
- *
- * \brief Define a generic histogram accumulator class.
- *
- * \todo Use histo::data instead of std::vector!
- */
+/// \file mln/accu/histo.hh
+///
+/// Define a generic histogram accumulator class.
+///
+/// \todo Use histo::data instead of std::vector!
+
# include <vector>
# include <algorithm>
@@ -51,9 +51,9 @@ namespace mln
{
- /*!
- * \brief Generic histogram class over a value set with type \c V.
- */
+ ///
+ /// Generic histogram class over a value set with type \c V.
+ ///
template <typename V>
struct histo :
public mln::accu::internal::base<const std::vector<unsigned>& ,
diff --git a/milena/mln/accu/internal/base.hh b/milena/mln/accu/internal/base.hh
index ed9528f..50d38c4 100644
--- a/milena/mln/accu/internal/base.hh
+++ b/milena/mln/accu/internal/base.hh
@@ -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,11 +29,10 @@
#ifndef MLN_ACCU_INTERNAL_BASE_HH
# define MLN_ACCU_INTERNAL_BASE_HH
-/*! \file mln/accu/internal/base.hh
- *
- * \brief Define a base class for implementation of accumulator
- * classes.
- */
+/// \file mln/accu/internal/base.hh
+///
+/// Define a base class for implementation of accumulator
+/// classes.
# include <mln/core/concept/accumulator.hh>
@@ -46,9 +46,8 @@ namespace mln
namespace internal
{
- /*! Generic min accumulator class.
- * Base class for implementation of accumulator classes.
- */
+ /// Generic min accumulator class.
+ /// Base class for implementation of accumulator classes.
template <typename R, typename E>
class base : public Accumulator<E>,
public mln::internal::proxy_impl< R, E >
diff --git a/milena/mln/accu/land.hh b/milena/mln/accu/land.hh
index be7bb4d..c0b0171 100644
--- a/milena/mln/accu/land.hh
+++ b/milena/mln/accu/land.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2007, 2008 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
@@ -28,10 +28,10 @@
#ifndef MLN_ACCU_LAND_HH
# define MLN_ACCU_LAND_HH
-/*! \file mln/accu/land.hh
- *
- * \brief Define a 'logical-and' accumulator.
- */
+/// \file mln/accu/land.hh
+///
+/// Define a 'logical-and' accumulator.
+///
# include <mln/accu/internal/base.hh>
diff --git a/milena/mln/accu/line.hh b/milena/mln/accu/line.hh
index cb484d7..f7a3da3 100644
--- a/milena/mln/accu/line.hh
+++ b/milena/mln/accu/line.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2007, 2008 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
diff --git a/milena/mln/accu/maj_h.hh b/milena/mln/accu/maj_h.hh
index ffd545d..f73b216 100644
--- a/milena/mln/accu/maj_h.hh
+++ b/milena/mln/accu/maj_h.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2007, 2008 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
@@ -28,10 +28,10 @@
#ifndef MLN_ACCU_MAJ_H_HH
# define MLN_ACCU_MAJ_H_HH
-/*! \file mln/accu/maj_h.hh
- *
- * \brief Define an accumulator that computes a maj_h.
- */
+/// \file mln/accu/maj_h.hh
+///
+/// Define an accumulator that computes a maj_h.
+
# include <mln/core/concept/meta_accumulator.hh>
# include <mln/accu/internal/base.hh>
@@ -48,8 +48,8 @@ namespace mln
{
- /*! \brief Generic maj_h accumulator class.
- *
+ /// Generic maj_h accumulator class.
+ /*!
* The parameter \c T is the type of values.
*/
template <typename T>
diff --git a/milena/mln/accu/max.hh b/milena/mln/accu/max.hh
index 0cacbed..99de2e4 100644
--- a/milena/mln/accu/max.hh
+++ b/milena/mln/accu/max.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2007, 2008 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
@@ -28,10 +28,9 @@
#ifndef MLN_ACCU_MAX_HH
# define MLN_ACCU_MAX_HH
-/*! \file mln/accu/max.hh
- *
- * \brief Define an accumulator that computes a max.
- */
+/// \file mln/accu/max.hh
+///
+/// Define an accumulator that computes a max.
# include <mln/core/concept/meta_accumulator.hh>
# include <mln/accu/internal/base.hh>
@@ -46,10 +45,9 @@ namespace mln
{
- /*! \brief Generic max accumulator class.
- *
- * The parameter \c T is the type of values.
- */
+ /// Generic max accumulator class.
+ ///
+ /// The parameter \c T is the type of values.
template <typename T>
struct max : public mln::accu::internal::base< const T& , max<T> >
{
diff --git a/milena/mln/accu/max_h.hh b/milena/mln/accu/max_h.hh
index ece814a..dd3a3dc 100644
--- a/milena/mln/accu/max_h.hh
+++ b/milena/mln/accu/max_h.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2007, 2008 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
@@ -28,10 +28,9 @@
#ifndef MLN_ACCU_MAX_H_HH
# define MLN_ACCU_MAX_H_HH
-/*! \file mln/accu/max_h.hh
- *
- * \brief Define a generic max accumulator class based on histogram.
- */
+/// \file mln/accu/max_h.hh
+///
+/// Define a generic max accumulator class based on histogram.
# include <mln/accu/internal/base.hh>
# include <mln/accu/histo.hh>
@@ -45,9 +44,8 @@ namespace mln
{
- /*! \brief Generic max function based on histogram over a value set with
- * type \c V.
- */
+ /// Generic max function based on histogram over a value set with
+ /// type \c V.
template <typename V>
struct max_h : public mln::accu::internal::base< const V&, max_h<V> >
{
diff --git a/milena/mln/accu/mean.hh b/milena/mln/accu/mean.hh
index b58c100..c508ce1 100644
--- a/milena/mln/accu/mean.hh
+++ b/milena/mln/accu/mean.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2007, 2008 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
@@ -28,12 +28,11 @@
#ifndef MLN_ACCU_MEAN_HH
# define MLN_ACCU_MEAN_HH
-/*! \file mln/accu/mean.hh
- *
- * \brief Define an accumulator that computes a mean.
- *
- * \todo Use accu::pair just like in accu::min_max.
- */
+/// \file mln/accu/mean.hh
+///
+/// Define an accumulator that computes a mean.
+///
+/// \todo Use accu::pair just like in accu::min_max.
# include <mln/accu/internal/base.hh>
# include <mln/accu/count.hh>
@@ -47,8 +46,8 @@ namespace mln
{
- /*! \brief Generic mean accumulator class.
- *
+ /// 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
* \c S is the summation type (property) of \c T. Parameter \c M
diff --git a/milena/mln/accu/median_alt.hh b/milena/mln/accu/median_alt.hh
index 66bc5c5..98d0cac 100644
--- a/milena/mln/accu/median_alt.hh
+++ b/milena/mln/accu/median_alt.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2007, 2008 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
@@ -28,10 +28,9 @@
#ifndef MLN_ACCU_MEDIAN_ALT_HH
# define MLN_ACCU_MEDIAN_ALT_HH
-/*! \file mln/accu/median_alt.hh
- *
- * \brief Define alternative generic median accumulator class.
- */
+/// \file mln/accu/median_alt.hh
+///
+/// Define alternative generic median accumulator class.
# include <mln/accu/internal/base.hh>
# include <mln/accu/histo.hh>
@@ -44,9 +43,8 @@ namespace mln
{
- /*! \brief Generic median_alt function based on histogram over a
- * value set with type \c S.
- */
+ /// 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< const mln_value(S)&, median_alt<S> >
{
@@ -103,17 +101,29 @@ namespace mln
struct median_alt : public Meta_Accumulator< median_alt >
{
+ median_alt(const Value_Set<S>& s_) : s(s_) {}
+
template <typename V>
struct with
{
typedef accu::median_alt<V> ret;
};
+
+ Value_Set<S> s;
};
} // end of namespace mln::accu::meta
template <typename T>
+ median_alt<T> unmeta(const meta::median_alt& m, T)
+ {
+ median_alt<T> a(m.s);
+ return a;
+ }
+
+
+ template <typename T>
struct median_alt_on : public median_alt< value::set<T> >
{
median_alt_on()
diff --git a/milena/mln/accu/median_h.hh b/milena/mln/accu/median_h.hh
index 0c04e24..c7ea0e8 100644
--- a/milena/mln/accu/median_h.hh
+++ b/milena/mln/accu/median_h.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2007, 2008 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
@@ -28,10 +28,9 @@
#ifndef MLN_ACCU_MEDIAN_H_HH
# define MLN_ACCU_MEDIAN_H_HH
-/*! \file mln/accu/median_h.hh
- *
- * \brief Define a generic median accumulator class.
- */
+/// \file mln/accu/median_h.hh
+///
+/// Define a generic median accumulator class.
# include <mln/accu/internal/base.hh>
# include <mln/accu/histo.hh>
@@ -45,9 +44,8 @@ namespace mln
{
- /*! \brief Generic median function based on histogram over a value
- * set with type \c V.
- */
+ /// Generic median function based on histogram over a value
+ /// set with type \c V.
template <typename V>
struct median_h : public mln::accu::internal::base< const V&, median_h<V> >
{
@@ -77,13 +75,13 @@ namespace mln
protected:
mutable accu::histo<V> h_;
- const value::set<V>& s_; // derived from h_
+ const value::set<V>& s_; // derived from h_
mutable unsigned sum_minus_, sum_plus_;
mutable bool valid_;
- mutable unsigned i_; // the median_h index
- mutable argument t_; // the median_h value
+ mutable unsigned i_; // the median_h index
+ mutable argument t_; // the median_h value
// Auxiliary methods
void update_() const;
diff --git a/milena/mln/accu/min.hh b/milena/mln/accu/min.hh
index 83e6804..1825c7f 100644
--- a/milena/mln/accu/min.hh
+++ b/milena/mln/accu/min.hh
@@ -46,8 +46,8 @@ namespace mln
{
- /*! \brief Generic min accumulator class.
- *
+ /// Generic min accumulator class.
+ /*!
* The parameter \c T is the type of values.
*/
template <typename T>
diff --git a/milena/mln/accu/min_h.hh b/milena/mln/accu/min_h.hh
index fd3706e..e4e8fee 100644
--- a/milena/mln/accu/min_h.hh
+++ b/milena/mln/accu/min_h.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2007, 2008 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
@@ -28,10 +28,9 @@
#ifndef MLN_ACCU_MIN_H_HH
# define MLN_ACCU_MIN_H_HH
-/*! \file mln/accu/min_h.hh
- *
- * \brief Define a generic min accumulator class based on histogram.
- */
+/// \file mln/accu/min_h.hh
+///
+/// Define a generic min accumulator class based on histogram.
# include <mln/accu/internal/base.hh>
# include <mln/accu/histo.hh>
@@ -46,9 +45,8 @@ namespace mln
{
- /*! \brief Generic min function based on histogram over a value
- * set with type \c V.
- */
+ /// Generic min function based on histogram over a value
+ /// set with type \c V.
template <typename V>
struct min_h : public mln::accu::internal::base< const V& , min_h<V> >
{
@@ -102,9 +100,7 @@ namespace mln
namespace meta
{
- /*!
- * \brief Meta accumulator for min.
- */
+ /// Meta accumulator for min.
struct min_h : public Meta_Accumulator< min_h >
{
template <typename T>
diff --git a/milena/mln/accu/min_max.hh b/milena/mln/accu/min_max.hh
index 11b1a33..6f90560 100644
--- a/milena/mln/accu/min_max.hh
+++ b/milena/mln/accu/min_max.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2007, 2008 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
@@ -28,12 +28,11 @@
#ifndef MLN_ACCU_MIN_MAX_HH
# define MLN_ACCU_MIN_MAX_HH
-/*! \file mln/accu/min_max.hh
- *
- * \brief Define an accumulator that computes a min and a max.
- *
- * \todo A macro to create such accumulators.
- */
+/// \file mln/accu/min_max.hh
+///
+/// Define an accumulator that computes a min and a max.
+///
+/// \todo A macro to create such accumulators.
# include <utility>
@@ -50,8 +49,8 @@ namespace mln
namespace accu
{
- /*! \brief Generic min and max accumulator class.
- *
+ /// Generic min and max accumulator class.
+ /*!
* The parameter \c V is the type of values.
*/
template <typename V>
diff --git a/milena/mln/accu/nil.hh b/milena/mln/accu/nil.hh
index 0887715..e085deb 100644
--- a/milena/mln/accu/nil.hh
+++ b/milena/mln/accu/nil.hh
@@ -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,12 +29,11 @@
#ifndef MLN_ACCU_NIL_HH
# define MLN_ACCU_NIL_HH
-/*! \file mln/accu/nil.hh
- *
- * \brief Define an accumulator that does nothing.
- *
- * \todo A macro to generate the meta version.
- */
+/// \file mln/accu/nil.hh
+///
+/// Define an accumulator that does nothing.
+///
+/// \todo A macro to generate the meta version.
# include <mln/core/concept/meta_accumulator.hh>
# include <mln/accu/internal/base.hh>
@@ -47,9 +47,7 @@ namespace mln
namespace accu
{
- /*!
- * \brief Define an accumulator that does nothing.
- */
+ /// Define an accumulator that does nothing.
template <typename T>
struct nil : public mln::accu::internal::base< util::ignore , nil<T> >
{
diff --git a/milena/mln/accu/p.hh b/milena/mln/accu/p.hh
index bcb36c2..dc3f41f 100644
--- a/milena/mln/accu/p.hh
+++ b/milena/mln/accu/p.hh
@@ -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_ACCU_P_HH
# define MLN_ACCU_P_HH
-/*! \file mln/accu/p.hh
- *
- * \brief Define an accumulator that computes a min and a max.
- */
+/// \file mln/accu/p.hh
+///
+/// Define an accumulator that computes a min and a max.
# include <mln/core/concept/meta_accumulator.hh>
@@ -46,11 +46,9 @@ namespace mln
{
- /*!
- * \brief Generic p of accumulators.
- *
- * The parameter \c V is the type of values.
- */
+ ///Generic p of accumulators.
+ ///
+ /// The parameter \c V is the type of values.
template <typename A>
struct p : public mln::accu::internal::base< const mln_result(A)& , p<A> >
{
diff --git a/milena/mln/accu/pair.hh b/milena/mln/accu/pair.hh
index b431742..a1bdbd7 100644
--- a/milena/mln/accu/pair.hh
+++ b/milena/mln/accu/pair.hh
@@ -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_ACCU_PAIR_HH
# define MLN_ACCU_PAIR_HH
-/*! \file mln/accu/pair.hh
- *
- * \brief Define a pair of accumulators.
- */
+/// \file mln/accu/pair.hh
+///
+/// Define a pair of accumulators.
# include <utility>
@@ -49,12 +49,11 @@ namespace mln
{
- /*! \brief Generic pair of accumulators.
- *
- * The parameter \c T is the type of values.
- *
- * \todo Check that, when T is not provided, A1 and A2 have the same value.
- */
+ /// Generic pair of accumulators.
+ ///
+ /// The parameter \c T is the type of values.
+ ///
+ /// \todo Check that, when T is not provided, A1 and A2 have the same value.
template <typename A1, typename A2, typename T = mln_argument(A1)>
struct pair : public mln::accu::internal::base< std::pair<mln_result(A1), mln_result(A2)>,
pair<A1,A2,T> >
@@ -65,7 +64,8 @@ namespace mln
typedef mln_result(A2) result_2;
pair();
- pair(const A1& a1, const A2& a2);
+// FIXME: not implemented. Do we want it?
+// pair(const A1& a1, const A2& a2);
/// Manipulators.
/// \{
diff --git a/milena/mln/accu/rank.hh b/milena/mln/accu/rank.hh
index 7d7ce17..bdd4df0 100644
--- a/milena/mln/accu/rank.hh
+++ b/milena/mln/accu/rank.hh
@@ -50,8 +50,8 @@ namespace mln
{
- /*! \brief Generic rank accumulator class.
- *
+ /// Generic rank accumulator class.
+ /*!
* The parameter \c T is the type of values.
*/
template <typename T>
@@ -82,7 +82,7 @@ namespace mln
/// Give the rank.
unsigned k() const;
- /// Give the total number of elements.
+ /// Give the total number of elements.
unsigned n() const;
protected:
@@ -116,12 +116,16 @@ namespace mln
struct rank : public Meta_Accumulator< rank >
{
+ rank(unsigned k_, unsigned n_) : k(k_), n(n_) {}
+
template <typename T>
struct with
{
typedef accu::rank<T> ret;
};
- unsigned k, n;
+
+ unsigned k;
+ unsigned n;
};
} // end of namespace mln::accu::meta
diff --git a/milena/mln/accu/rank_bool.hh b/milena/mln/accu/rank_bool.hh
index 6fec53a..f5e9b07 100644
--- a/milena/mln/accu/rank_bool.hh
+++ b/milena/mln/accu/rank_bool.hh
@@ -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,15 +29,14 @@
#ifndef MLN_ACCU_RANK_BOOL_HH
# define MLN_ACCU_RANK_BOOL_HH
-/*! \file mln/accu/rank_bool.hh
- *
- * \brief Define an rank accumulator.
- *
- * \todo There is no-arg-ctor so this accumulator does not support
- * deferred initialization!
- *
- * \todo Add untake routines...
- */
+/// \file mln/accu/rank_bool.hh
+///
+/// Define an rank accumulator.
+///
+/// \todo There is no-arg-ctor so this accumulator does not support
+/// deferred initialization!
+///
+/// \todo Add untake routines...
# include <mln/accu/internal/base.hh>
@@ -50,9 +50,7 @@ namespace mln
// Fwd declaration.
template <typename T> struct rank;
- /*! \brief rank accumulator class for Boolean.
- *
- */
+ /// rank accumulator class for Boolean.
template <>
struct rank<bool> : public mln::accu::internal::base< bool, rank<bool> >
{
diff --git a/milena/mln/accu/rank_high_quant.hh b/milena/mln/accu/rank_high_quant.hh
index b4d69a1..0f002cd 100644
--- a/milena/mln/accu/rank_high_quant.hh
+++ b/milena/mln/accu/rank_high_quant.hh
@@ -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_ACCU_RANK_HH
# define MLN_ACCU_RANK_HH
-/*! \file mln/accu/rank.hh
- *
- * \brief Define an rank accumulator.
- */
+/// \file mln/accu/rank.hh
+///
+/// Define an rank accumulator.
# include <vector>
# include <mln/accu/internal/base.hh>
@@ -47,8 +47,8 @@ namespace mln
{
- /*! \brief Generic rank accumulator class.
- *
+ /// Generic rank accumulator class.
+ /*!
* The parameter \c T is the type of values.
*/
template <typename T>
@@ -93,16 +93,29 @@ namespace mln
struct rank : public Meta_Accumulator< rank >
{
+ rank(unsigned k_, unsigned n_) : k(k_), n(n_) {}
+
template <typename T>
struct with
{
typedef accu::rank<T> ret;
};
+
+ unsigned k;
+ unsigned n;
};
}
+ template <typename T>
+ rank<T> unmeta(const meta::rank& m, T)
+ {
+ rank<T> a(m.k, m.n);
+ return a;
+ }
+
+
# ifndef MLN_INCLUDE_ONLY
template <typename T>
diff --git a/milena/mln/accu/snake_2d.hh b/milena/mln/accu/snake_2d.hh
index 27e4d5f..c055a90 100644
--- a/milena/mln/accu/snake_2d.hh
+++ b/milena/mln/accu/snake_2d.hh
@@ -75,7 +75,7 @@ namespace mln
mln_precondition(input.has_data());
mln_precondition(! win.is_empty());
// mln_precondition(! win.is_valid());
-
+
(void) input;
(void) win;
}
diff --git a/milena/mln/accu/sum.hh b/milena/mln/accu/sum.hh
index fcfc3ba..d330590 100644
--- a/milena/mln/accu/sum.hh
+++ b/milena/mln/accu/sum.hh
@@ -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_ACCU_SUM_HH
# define MLN_ACCU_SUM_HH
-/*! \file mln/accu/sum.hh
- *
- * \brief Define an accumulator that computes a sum.
- */
+/// \file mln/accu/sum.hh
+///
+/// Define an accumulator that computes a sum.
# include <mln/core/concept/meta_accumulator.hh>
# include <mln/accu/internal/base.hh>
@@ -50,8 +50,8 @@ namespace mln
{
- /*! \brief Generic sum accumulator class.
- *
+ /// 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
* \c S is the summation type (property) of \c T.
diff --git a/milena/mln/accu/take.hh b/milena/mln/accu/take.hh
index deadcaf..5b7f3e8 100644
--- a/milena/mln/accu/take.hh
+++ b/milena/mln/accu/take.hh
@@ -1,4 +1,5 @@
-// 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
@@ -28,10 +29,9 @@
#ifndef MLN_ACCU_TAKE_HH
# define MLN_ACCU_TAKE_HH
-/*! \file mln/accu/take.hh
- *
- * \brief Define an accumulator that takes image pixels.
- */
+/// \file mln/accu/take.hh
+///
+/// Define an accumulator that takes image pixels.
# include <mln/core/concept/accumulator.hh>
# include <mln/core/concept/image.hh>
@@ -44,8 +44,8 @@ namespace mln
namespace accu
{
- /*! \brief Make an accumulator take the pixels of the image \p input.
- *
+ /// Make an accumulator take the pixels of the image \p input.
+ /*!
* \param[in] input The input image.
* \param[in,out] a The accumulator.
*
diff --git a/milena/mln/accu/transform.hh b/milena/mln/accu/transform.hh
index 275ac21..3829432 100644
--- a/milena/mln/accu/transform.hh
+++ b/milena/mln/accu/transform.hh
@@ -49,13 +49,13 @@ namespace mln
template <typename I, typename A, typename W>
mln_ch_value(I, mln_result(A))
- transform(const Image<I>& input,
+ transform(const Image<I>& input,
const Accumulator<A>& a,
const Window<W>& win);
template <typename I, typename A, typename W>
mln_ch_value(I, mln_accu_with(A, mln_value(I))::result)
- transform(const Image<I>& input,
+ transform(const Image<I>& input,
const Meta_Accumulator<A>& a,
const Window<W>& win);
@@ -69,7 +69,7 @@ namespace mln
namespace generic
{
-
+
template <typename I, typename A, typename W>
mln_ch_value(I, mln_result(A))
transform(const Image<I>& input_,
@@ -86,7 +86,7 @@ namespace mln
// mln_precondition(win.is_valid());
extension::adjust(input, win);
-
+
mln_ch_value(I, mln_result(A)) output;
initialize(output, input);
@@ -105,7 +105,7 @@ namespace mln
}
} // end of namespace mln::accu::impl::generic
-
+
} // end of namespace mln::accu::impl
diff --git a/milena/mln/accu/tuple.hh b/milena/mln/accu/tuple.hh
index f70882b..3ad7be2 100644
--- a/milena/mln/accu/tuple.hh
+++ b/milena/mln/accu/tuple.hh
@@ -1,4 +1,5 @@
// Copyright (C) 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,10 @@
#ifndef MLN_ACCU_TUPLE_HH
# define MLN_ACCU_TUPLE_HH
-/*! \file mln/accu/tuple.hh
- *
- * \brief Define a tuple of accumulators.
- */
+/// \file mln/accu/tuple.hh
+///
+/// Define a tuple of accumulators.
+
# include <utility>
@@ -65,10 +66,9 @@ namespace mln
template <unsigned n, typename T> struct tuplehelper;
}
- /*! \brief Generic tuple of accumulators.
- *
+ /// Generic tuple of accumulators.
+ /*!
* The parameter \c T is the type of values.
- *
*/
template <typename A, unsigned n, BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(10, typename T, boost::tuples::null_type)>
struct tuple
diff --git a/milena/mln/accu/v.hh b/milena/mln/accu/v.hh
index a7f4cdf..bb522b7 100644
--- a/milena/mln/accu/v.hh
+++ b/milena/mln/accu/v.hh
@@ -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,10 @@
#ifndef MLN_ACCU_V_HH
# define MLN_ACCU_V_HH
-/*! \file mln/accu/v.hh
- *
- * \brief Define an accumulator that computes a min and a max.
- */
+/// \file mln/accu/v.hh
+///
+/// Define an accumulator that computes a min and a max.
+
# include <mln/core/concept/meta_accumulator.hh>
# include <mln/accu/internal/base.hh>
@@ -89,11 +90,11 @@ namespace mln
struct val : public Meta_Accumulator< val<mA> >
{
template <typename V>
- struct with
- {
- typedef mln_accu_with(mA, mln_value(V)) A;
- typedef val<A> ret;
- };
+ struct with
+ {
+ typedef mln_accu_with(mA, mln_value(V)) A;
+ typedef val<A> ret;
+ };
};
}
diff --git a/milena/mln/accu/volume.hh b/milena/mln/accu/volume.hh
index 705434b..9ace873 100644
--- a/milena/mln/accu/volume.hh
+++ b/milena/mln/accu/volume.hh
@@ -28,17 +28,18 @@
#ifndef MLN_ACCU_VOLUME_HH
# define MLN_ACCU_VOLUME_HH
-/** \file mln/accu/volume.hh
- \brief Define an accumulator that computes the volume of a
- component through one of its pixels.
-
+/// \file mln/accu/volume.hh
+/// Define an accumulator that computes the volume of a
+/// component through one of its pixels.
+/*!
This accumulator uses an mln::util::pix (pixel) to update the
reference level, area and volume information of the component.
The class mln/accu/volume is not a general-purpose accumulator;
it is used to implement volume-based connected filters.
\see mln::morpho::closing_volume
- \see mln::morpho::opening_volume */
+ \see mln::morpho::opening_volume
+*/
# include <mln/accu/internal/base.hh>
# include <mln/core/concept/meta_accumulator.hh>
@@ -53,7 +54,7 @@ namespace mln
namespace accu
{
- /// \brief Volume accumulator class.
+ /// Volume accumulator class.
///
/// The parameter \p I is the image type on which the accumulator
/// of pixels is built.
@@ -61,7 +62,7 @@ namespace mln
struct volume
: public mln::accu::internal::base< unsigned , volume<I> >
{
- /// \brief The accumulated data type.
+ /// The accumulated data type.
///
/// The volume of component is represented by the volume of its
/// root pixel. See mln::morpho::closing_volume and
diff --git a/milena/mln/algebra/quat.hh b/milena/mln/algebra/quat.hh
index 4e44e90..f786ac1 100644
--- a/milena/mln/algebra/quat.hh
+++ b/milena/mln/algebra/quat.hh
@@ -448,6 +448,7 @@ namespace mln
quat::quat(unsigned one, float theta, const algebra::vec<3,float>& uv)
{
mln_precondition(one == 1);
+ (void) one;
set_unit(theta, uv);
}
diff --git a/milena/mln/geom/essential.hh b/milena/mln/geom/essential.hh
index 41d1fd9..cd9297a 100644
--- a/milena/mln/geom/essential.hh
+++ b/milena/mln/geom/essential.hh
@@ -54,4 +54,14 @@ namespace mln
# include <mln/geom/size3d.hh>
# include <mln/geom/nsites.hh>
+# include <mln/geom/max_col.hh>
+# include <mln/geom/max_ind.hh>
+# include <mln/geom/max_row.hh>
+# include <mln/geom/max_sli.hh>
+
+# include <mln/geom/min_col.hh>
+# include <mln/geom/min_ind.hh>
+# include <mln/geom/min_row.hh>
+# include <mln/geom/min_sli.hh>
+
#endif // ! MLN_GEOM_ESSENTIAL_HH
diff --git a/milena/mln/morpho/elementary/like_ero_fun.hh b/milena/mln/morpho/elementary/like_ero_fun.hh
index 39399d8..772259f 100644
--- a/milena/mln/morpho/elementary/like_ero_fun.hh
+++ b/milena/mln/morpho/elementary/like_ero_fun.hh
@@ -61,7 +61,7 @@ namespace mln
struct f_accu
{
template <typename V, typename A>
- V operator()(const V& input_p, const A& a) const
+ V operator()(const V& /*input_p*/, const A& a) const
{
return a.to_result();
}
diff --git a/milena/mln/value/essential.hh b/milena/mln/value/essential.hh
index 7ba742a..e537eff 100644
--- a/milena/mln/value/essential.hh
+++ b/milena/mln/value/essential.hh
@@ -39,8 +39,8 @@
# include <mln/value/float01_8.hh>
# include <mln/value/float01_16.hh>
-# include <mln/value/gl8.hh>
-# include <mln/value/gl16.hh>
+//# include <mln/value/gl8.hh>
+//# include <mln/value/gl16.hh>
# include <mln/value/int_s8.hh>
# include <mln/value/int_s16.hh>
diff --git a/milena/tests/accu/rank.cc b/milena/tests/accu/rank.cc
index 2f4061c..9c334a9 100644
--- a/milena/tests/accu/rank.cc
+++ b/milena/tests/accu/rank.cc
@@ -55,9 +55,7 @@ int main()
using value::int_u8;
{
- accu::meta::rank r;
- r.k = 4;
- r.n = 9;
+ accu::meta::rank r(4, 9);
accu::rank<int_u8> a = accu::unmeta(r, int_u8());
mln_assertion(a.k() == 4 && a.n() == 9);
// Meta_Accumulator<accu::meta::rank>& R = r;
--
1.5.6.5
* mln/io/off/save.hh
(io::off::save(const float_2complex_image3df&, const std::string&)):
New function.
(io::off::internal::float_off_saver): New functor.
---
milena/ChangeLog | 9 ++++++++
milena/mln/io/off/save.hh | 51 +++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 60 insertions(+), 0 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 1a0b0a0..3706c51 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,14 @@
2008-11-12 Roland Levillain <roland(a)lrde.epita.fr>
+ Add a saving routine for floating-point value 2-complex images.
+
+ * mln/io/off/save.hh
+ (io::off::save(const float_2complex_image3df&, const std::string&)):
+ New function.
+ (io::off::internal::float_off_saver): New functor.
+
+2008-11-12 Roland Levillain <roland(a)lrde.epita.fr>
+
Add a saving routine for int_u8 2-complex images.
* mln/io/off/save.hh
diff --git a/milena/mln/io/off/save.hh b/milena/mln/io/off/save.hh
index 604281e..e6582cc 100644
--- a/milena/mln/io/off/save.hh
+++ b/milena/mln/io/off/save.hh
@@ -76,6 +76,17 @@ namespace mln
void save(const int_u8_2complex_image3df& ima,
const std::string& filename);
+ /** \brief Save a floating-point value grey-level OFF image into
+ a complex image.
+
+ \param[in] ima The image to save.
+ \param[in] filename The name of the file where to save the image.
+
+ Only data is attached to 2-faces is saved; the OFF file
+ cannot store data attached to faces of other dimensions. */
+ void save(const float_2complex_image3df& ima,
+ const std::string& filename);
+
namespace internal
{
@@ -114,6 +125,17 @@ namespace mln
void write_face_data(std::ostream& ostr, const value& v) const;
};
+
+ /* FIXME: We should turn float_off_saver into a
+ float01_off_saver (see FIXME/comment in implementation
+ below). */
+ struct float_off_saver
+ : public off_saver< float_2complex_image3df, float_off_saver >
+ {
+ /// \brief Save face data.
+ void write_face_data(std::ostream& ostr, const value& v) const;
+ };
+
} // end of namespace mln::io::off::internal
@@ -140,6 +162,14 @@ namespace mln
trace::exiting("mln::io::off::save");
}
+ void
+ save(const float_2complex_image3df& ima, const std::string& filename)
+ {
+ trace::entering("mln::io::off::save");
+ internal::float_off_saver()(ima, filename);
+ trace::exiting("mln::io::off::save");
+ }
+
/*-------------------------.
| Actual implementations. |
@@ -348,6 +378,27 @@ namespace mln
ostr << ' ' << v << ' ' << v << ' ' << v
<< ' ' << 1.0f << std::endl;
}
+
+ /* FIXME: We should turn float_off_saver into a
+ float01_off_saver to avoid the assertions below. */
+ void
+ float_off_saver::write_face_data(std::ostream& ostr,
+ const value& v) const
+ {
+ /* Using RGBA colors to represent a floating-point value.
+
+ Each channel (R, G, B) of the color V is a floating-point
+ number in the range 0..1. A fourth channel, A, controls
+ the transparency.
+
+ We just set the same value for each channel, as the OFF
+ file format does not support gray-level values as
+ such. */
+ mln_assertion(0.0f <= v);
+ mln_assertion(v <= 1.0f);
+ ostr << ' ' << v << ' ' << v << ' ' << v
+ << ' ' << 1.0f << std::endl;
+ }
/* \} */
} // end of namespace mln::io::off::internal
--
1.6.0.1
* mln/io/off/save.hh
(io::off::save(const int_u8_2complex_image3df&, const std::string&)):
New function.
(io::off::internal::int_u8_off_saver): New functor.
---
milena/ChangeLog | 9 +++++++++
milena/mln/io/off/save.hh | 42 ++++++++++++++++++++++++++++++++++++++++++
2 files changed, 51 insertions(+), 0 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 0fb9951..1a0b0a0 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,14 @@
2008-11-12 Roland Levillain <roland(a)lrde.epita.fr>
+ Add a saving routine for int_u8 2-complex images.
+
+ * mln/io/off/save.hh
+ (io::off::save(const int_u8_2complex_image3df&, const std::string&)):
+ New function.
+ (io::off::internal::int_u8_off_saver): New functor.
+
+2008-11-12 Roland Levillain <roland(a)lrde.epita.fr>
+
Introduce a factoring functor to save OFF image files.
* mln/io/off/save.hh (mln::io::off::internal::off_saver): New.
diff --git a/milena/mln/io/off/save.hh b/milena/mln/io/off/save.hh
index a3fde3a..604281e 100644
--- a/milena/mln/io/off/save.hh
+++ b/milena/mln/io/off/save.hh
@@ -66,6 +66,16 @@ namespace mln
void save(const bin_2complex_image3df& ima,
const std::string& filename);
+ /** \brief Save an 8-bit grey-level OFF image into a complex image.
+
+ \param[in] ima The image to save.
+ \param[in] filename The name of the file where to save the image.
+
+ Only data is attached to 2-faces is saved; the OFF file
+ cannot store data attached to faces of other dimensions. */
+ void save(const int_u8_2complex_image3df& ima,
+ const std::string& filename);
+
namespace internal
{
@@ -96,6 +106,14 @@ namespace mln
void write_face_data(std::ostream& ostr, const value& v) const;
};
+
+ struct int_u8_off_saver
+ : public off_saver< int_u8_2complex_image3df, int_u8_off_saver >
+ {
+ /// \brief Save face data.
+ void write_face_data(std::ostream& ostr, const value& v) const;
+ };
+
} // end of namespace mln::io::off::internal
@@ -114,6 +132,14 @@ namespace mln
trace::exiting("mln::io::off::save");
}
+ void
+ save(const int_u8_2complex_image3df& ima, const std::string& filename)
+ {
+ trace::entering("mln::io::off::save");
+ internal::int_u8_off_saver()(ima, filename);
+ trace::exiting("mln::io::off::save");
+ }
+
/*-------------------------.
| Actual implementations. |
@@ -306,6 +332,22 @@ namespace mln
{
// Do nothing (no data associated to faces).
}
+
+ void
+ int_u8_off_saver::write_face_data(std::ostream& ostr,
+ const value& v) const
+ {
+ /* Using RGBA colors to represent an 8-bit integer value.
+
+ Each channel (R, G, B) of the color V is an integer in
+ the range 0..255. A fourth channel, A, controls the
+ transparency.
+
+ We just set the same value for each channel, as the OFF
+ file format does not support gray-level values as-is. */
+ ostr << ' ' << v << ' ' << v << ' ' << v
+ << ' ' << 1.0f << std::endl;
+ }
/* \} */
} // end of namespace mln::io::off::internal
--
1.6.0.1
* mln/io/off/save.hh (mln::io::off::internal::off_saver): New.
Use it to factor...
(mln::io::off::save(const bin_2complex_image3df&, const std::string&)):
...this routine.
---
milena/ChangeLog | 9 ++
milena/mln/io/off/save.hh | 316 +++++++++++++++++++++++++++++++--------------
2 files changed, 228 insertions(+), 97 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 8c5e2ed..0fb9951 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,14 @@
2008-11-12 Roland Levillain <roland(a)lrde.epita.fr>
+ Introduce a factoring functor to save OFF image files.
+
+ * mln/io/off/save.hh (mln::io::off::internal::off_saver): New.
+ Use it to factor...
+ (mln::io::off::save(const bin_2complex_image3df&, const std::string&)):
+ ...this routine.
+
+2008-11-12 Roland Levillain <roland(a)lrde.epita.fr>
+
Aesthetic changes.
* mln/topo/adj_m_face_iter.hh
diff --git a/milena/mln/io/off/save.hh b/milena/mln/io/off/save.hh
index 4273821..a3fde3a 100644
--- a/milena/mln/io/off/save.hh
+++ b/milena/mln/io/off/save.hh
@@ -32,6 +32,7 @@
/// \brief Input saving function for OFF files.
///
/// \see http://shape.cs.princeton.edu/benchmark/documentation/off_format.html
+/// \see https://people.scs.fsu.edu/~burkardt/html/off_format.html
# include <cstdlib>
@@ -60,134 +61,255 @@ namespace mln
\param[in] ima The image to save.
\param[in] filename The name of the file where to save the image.
- The image is said binary since data only represent the
+ The image is said binary since data represent only the
existence of faces. */
- void save(const bin_2complex_image3df& ima, const std::string& filename);
+ void save(const bin_2complex_image3df& ima,
+ const std::string& filename);
+
+
+ namespace internal
+ {
+
+ template <typename I, typename E>
+ struct off_saver : public Object<E>
+ {
+ /// Type of the values.
+ typedef mln_value(I) value;
+
+ /// Dimension of the built complex.
+ static const unsigned D = 2;
+
+ /// \brief Constructor, with static checks.
+ off_saver();
+
+ /// Load an image from \a filename into \a ima.
+ void operator()(const I& ima, const std::string& filename) const;
+ };
+
+
+ struct bin_off_saver
+ : public off_saver< bin_2complex_image3df, bin_off_saver >
+ {
+ /// \brief Save face data.
+ ///
+ /// Dummy, does nothings (but required by the super class).
+ void write_face_data(std::ostream& ostr, const value& v) const;
+ };
+
+ } // end of namespace mln::io::off::internal
# ifndef MLN_INCLUDE_ONLY
- void save(const bin_2complex_image3df& ima, const std::string& filename)
+ /*----------.
+ | Facades. |
+ `----------*/
+
+ void
+ save(const bin_2complex_image3df& ima, const std::string& filename)
{
trace::entering("mln::io::off::save");
+ internal::bin_off_saver()(ima, filename);
+ trace::exiting("mln::io::off::save");
+ }
+
- const std::string me = "mln::io::off::save";
+ /*-------------------------.
+ | Actual implementations. |
+ `-------------------------*/
- std::ofstream ostr(filename.c_str());
- if (!ostr)
+ // -------- //
+ // Canvas. //
+ // -------- //
+
+ namespace internal
+ {
+
+ template <typename I, typename E>
+ off_saver<I, E>::off_saver()
{
- std::cerr << me << ": `" << filename << "' invalid file."
- << std::endl;
- /* FIXME: Too violent. We should allow the use of
- exceptions, at least to have Milena's code behave
- correctly in interpreted environments (std::exit() or
- std::abort() causes the termination of a Python
- interpreter, for instance!). */
- std::exit(1);
+ // Concept checking.
+ void (E::*m1)(std::ostream&, const value&) const =
+ &E::write_face_data;
+ m1 = 0;
}
- /*---------.
- | Header. |
- `---------*/
- /* ``The .off files in the Princeton Shape Benchmark conform
- to the following standard. */
+ template <typename I, typename E>
+ void
+ off_saver<I, E>::operator()(const I& ima,
+ const std::string& filename) const
+ {
+ const std::string me = "mln::io::off::save";
+
+ std::ofstream ostr(filename.c_str());
+ if (!ostr)
+ {
+ std::cerr << me << ": `" << filename << "' invalid file."
+ << std::endl;
+ /* FIXME: Too violent. We should allow the use of
+ exceptions, at least to have Milena's code behave
+ correctly in interpreted environments (std::exit() or
+ std::abort() causes the termination of a Python
+ interpreter, for instance!). */
+ std::exit(1);
+ }
+
+ /*---------.
+ | Header. |
+ `---------*/
+
+ /* ``The .off files in the Princeton Shape Benchmark conform
+ to the following standard.'' */
+
+ /* ``OFF files are all ASCII files beginning with the
+ keyword OFF. '' */
+ ostr << "OFF" << std::endl;
+
+ // A comment.
+ ostr << "# Generated by Milena 1.0 http://olena.lrde.epita.fr\n"
+ << "# EPITA Research and Development Laboratory (LRDE)"
+ << std::endl;
+
+ /* ``The next line states the number of vertices, the number
+ of faces, and the number of edges. The number of edges can
+ be safely ignored.'' */
+ /* FIXME: This is too long. We shall be able to write
+
+ ima.domain().template nfaces<0>()
+
+ or even
+
+ ima.template nfaces<0>().
+ */
+ ostr << ima.domain().cplx().template nfaces<0>() << ' '
+ << ima.domain().cplx().template nfaces<2>() << ' '
+ << ima.domain().cplx().template nfaces<1>() << std::endl;
+
+ /*-------.
+ | Data. |
+ `-------*/
+
+ // --------- //
+ // Complex. //
+ // --------- //
+
+ typedef mln_geom(I) G;
+
+ // ------------------------------------------ //
+ // Vertices & geometry (vertices locations). //
+ // ------------------------------------------ //
+
+ /* ``The vertices are listed with x, y, z coordinates, written
+ one per line.'' */
+
+ // Traverse the 0-faces (vertices).
+ p_n_faces_fwd_piter<D, G> v(ima.domain(), 0);
+ for_all(v)
+ {
+ mln_invariant(v.to_site().size() == 1);
+ ostr << v.to_site().front()[0] << ' '
+ << v.to_site().front()[1] << ' '
+ << v.to_site().front()[2] << std::endl;
+ }
- /* OFF files are all ASCII files beginning with the keyword
- OFF. '' */
- ostr << "OFF" << std::endl;
+ // --------------- //
+ // Faces & edges. //
+ // --------------- //
+
+ /* ``After the list of vertices, the faces are listed, with one
+ face per line. For each face, the number of vertices is
+ specified, followed by indices into the list of
+ vertices.'' */
+
+ // Traverse the 2-faces (polygons).
+ p_n_faces_fwd_piter<D, G> f(ima.domain(), 2);
+
+ typedef complex_m_face_neighborhood<D, G> nbh_t;
+ // A neighborhood where neighbors are the set of 0-faces
+ // transitively adjacent to the reference point.
+ nbh_t nbh;
+ mln_fwd_niter(nbh_t) u(nbh, f);
+ /* FIXME: We should be able to pas this value (m) either at
+ the construction of the neighborhood or at the construction
+ of the iterator. */
+ u.iter().set_m(0);
+
+ // For each (2-)face, iterate on (transitively) ajacent
+ // vertices (0-faces).
+ for_all(f)
+ {
+ unsigned nvertices = 0;
+ std::ostringstream vertices;
+ for_all(u)
+ {
+ // FIXME: Likewise, this is a bit too long...
+ vertices << ' ' << u.unproxy_().face().face_id();
+ ++nvertices;
+ }
+ ostr << nvertices << vertices.str();
+ // Possibly save a value (depends on the actual format).
+ exact(this)->write_face_data(ostr, ima(f));
+ ostr << std::endl;
+ }
- // A comment.
- ostr << "# Generated by Milena 1.0 http://olena.lrde.epita.fr\n"
- << "# EPITA Research and Development Laboratory (LRDE)"
- << std::endl;
+ ostr.close();
+ }
- /* ``The next line states the number of vertices, the number
- of faces, and the number of edges. The number of edges can
- be safely ignored.'' */
- /* FIXME: This is too long. We shall be able to write
+ // ---------------- //
+ // Specific parts. //
+ // ---------------- //
- ima.domain().nfaces<0>()
+ /** \brief Writing values.
- or even
+ From https://people.scs.fsu.edu/~burkardt/html/off_format.html:
- ima.nfaces<0>().
- */
- ostr << ima.domain().cplx().nfaces<0>() << ' '
- << ima.domain().cplx().nfaces<2>() << ' '
- << ima.domain().cplx().nfaces<1>() << std::endl;
+ ``Following these [coordinates] are the face descriptions,
+ typically written with one line per face. Each has the
+ form
- /*-------.
- | Data. |
- `-------*/
+ N Vert1 Vert2 ... VertN [color]
- // --------- //
- // Complex. //
- // --------- //
+ Here N is the number of vertices on this face, and Vert1
+ through VertN are indices into the list of vertices (in
+ the range 0..NVertices-1).
- typedef mln::bin_2complex_image3df I;
- const unsigned D = I::dim;
- typedef mln_geom_(I) G;
+ The optional color may take several forms. Line breaks
+ are significant here: the color description begins after
+ VertN and ends with the end of the line (or the next #
+ comment). A color may be:
- // ------------------------------------------ //
- // Vertices & geometry (vertices locations). //
- // ------------------------------------------ //
+ nothing
+ the default color
+ one integer
+ index into "the" colormap; see below
+ three or four integers
+ RGB and possibly alpha values in the range 0..255
+ three or four floating-point numbers
+ RGB and possibly alpha values in the range 0..1
- /* ``The vertices are listed with x, y, z coordinates, written
- one per line. */
+ For the one-integer case, the colormap is currently read
+ from the file `cmap.fmap' in Geomview's `data'
+ directory. Some better mechanism for supplying a colormap
+ is likely someday.
- // Traverse the 0-faces (vertices).
- p_n_faces_fwd_piter<D, G> v(ima.domain(), 0);
- for_all(v)
- {
- mln_invariant(v.to_site().size() == 1);
- ostr << v.to_site().front()[0] << ' '
- << v.to_site().front()[1] << ' '
- << v.to_site().front()[2] << std::endl;
- }
+ The meaning of "default color" varies. If no face of the
+ object has a color, all inherit the environment's default
+ material color. If some but not all faces have colors, the
+ default is gray (R,G,B,A=.666).''
- // --------------- //
- // Faces & edges. //
- // --------------- //
-
- /* After the list of vertices, the faces are listed, with one
- face per line. For each face, the number of vertices is
- specified, followed by indices into the list of
- vertices.'' */
-
- // Traverse the 2-faces (polygons).
- p_n_faces_fwd_piter<D, G> f(ima.domain(), 2);
-
- typedef complex_m_face_neighborhood<D, G> nbh_t;
- // A neighborhood where neighbors are the set of 0-faces
- // transitively adjacent to the reference point.
- nbh_t nbh;
- mln_fwd_niter_(nbh_t) u(nbh, f);
- /* FIXME: We should be able to pas this value (m) either at
- the construction of the neighborhood or at the construction
- of the iterator. */
- u.iter().set_m(0);
-
- // For each (2-)face, iterate on (transitively) ajacent
- // vertices (0-faces).
- for_all(f)
+ \{ */
+ void
+ bin_off_saver::write_face_data(std::ostream& /* ostr */,
+ const value& /* v */) const
{
- unsigned nvertices = 0;
- std::ostringstream vertices;
- for_all(u)
- {
- // FIXME: Likewise, this is a bit too long...
- vertices << ' ' << u.unproxy_().face().face_id();
- ++nvertices;
- }
- ostr << nvertices << vertices.str() << std::endl;
+ // Do nothing (no data associated to faces).
}
+ /* \} */
- ostr.close();
+ } // end of namespace mln::io::off::internal
- trace::exiting("mln::io::off::save");
- }
# endif // ! MLN_INCLUDE_ONLY
--
1.6.0.1