* mln/fun/p2b/antilogy.hh,
* mln/fun/p2b/big_chess.hh,
* mln/fun/p2b/chess.hh,
* mln/fun/p2b/has.hh,
* mln/fun/p2b/tautology.hh,
* mln/fun/p2p/fold.hh,
* mln/fun/p2p/mirror.hh,
* mln/fun/p2p/translation.hh,
* mln/fun/p2v/elifs.hh,
* mln/fun/p2v/iota.hh,
* mln/fun/p2v/ternary.hh,
* mln/fun/x2v/bilinear.hh,
* mln/fun/x2v/l1_norm.hh,
* mln/fun/x2v/nneighbor.hh,
* mln/fun/x2v/trilinear.hh: Here.
---
milena/ChangeLog | 21 +++++++++++
milena/mln/fun/p2b/antilogy.hh | 16 ++++++---
milena/mln/fun/p2b/big_chess.hh | 30 +++++++++++++---
milena/mln/fun/p2b/chess.hh | 22 ++++++++++--
milena/mln/fun/p2b/has.hh | 14 +++++--
milena/mln/fun/p2b/tautology.hh | 15 +++++---
milena/mln/fun/p2p/fold.hh | 16 ++++----
milena/mln/fun/p2p/mirror.hh | 29 +++++++++++++++-
milena/mln/fun/p2p/translation.hh | 13 ++++++-
milena/mln/fun/p2v/elifs.hh | 16 ++++++---
milena/mln/fun/p2v/iota.hh | 23 ++++++++++++-
milena/mln/fun/p2v/ternary.hh | 23 ++++++++----
milena/mln/fun/x2v/bilinear.hh | 12 ++++--
milena/mln/fun/x2v/l1_norm.hh | 8 ++++-
milena/mln/fun/x2v/nneighbor.hh | 67 +++++++++++++++++++++----------------
milena/mln/fun/x2v/trilinear.hh | 11 ++++--
16 files changed, 250 insertions(+), 86 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 375d2e4..f55e2e2 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,26 @@
2013-04-29 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Improve documentation in fun::p2b, fun::p2p, fun::p2v and
+ fun::x2v.
+
+ * mln/fun/p2b/antilogy.hh,
+ * mln/fun/p2b/big_chess.hh,
+ * mln/fun/p2b/chess.hh,
+ * mln/fun/p2b/has.hh,
+ * mln/fun/p2b/tautology.hh,
+ * mln/fun/p2p/fold.hh,
+ * mln/fun/p2p/mirror.hh,
+ * mln/fun/p2p/translation.hh,
+ * mln/fun/p2v/elifs.hh,
+ * mln/fun/p2v/iota.hh,
+ * mln/fun/p2v/ternary.hh,
+ * mln/fun/x2v/bilinear.hh,
+ * mln/fun/x2v/l1_norm.hh,
+ * mln/fun/x2v/nneighbor.hh,
+ * mln/fun/x2v/trilinear.hh: Here.
+
+2013-04-29 Guillaume Lazzara <z(a)lrde.epita.fr>
+
* tests/fun/Makefile.am: Remove duplicate subdir entry for v2v.
2013-04-29 Guillaume Lazzara <z(a)lrde.epita.fr>
diff --git a/milena/mln/fun/p2b/antilogy.hh b/milena/mln/fun/p2b/antilogy.hh
index 8eaaf41..ac560aa 100644
--- a/milena/mln/fun/p2b/antilogy.hh
+++ b/milena/mln/fun/p2b/antilogy.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009, 2013 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -43,10 +44,15 @@ namespace mln
{
- /// \brief A p2b function always returning \c false.
- ///
- /// A simpler name would be `false', but this is not a valid C++
- /// identifier, as \c false is a keyword of the language.
+ /*!
+ \brief A function always returning \c false.
+
+ A simpler name would be `false', but this is not a valid C++
+ identifier, as \c false is a keyword of the language.
+
+ \sa data::transform
+ \ingroup funv2v
+ */
struct antilogy : public Function_v2b< antilogy >
{
typedef bool result;
diff --git a/milena/mln/fun/p2b/big_chess.hh b/milena/mln/fun/p2b/big_chess.hh
index 54ff484..06c5c62 100644
--- a/milena/mln/fun/p2b/big_chess.hh
+++ b/milena/mln/fun/p2b/big_chess.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009, 2013 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -26,10 +27,10 @@
#ifndef MLN_FUN_P2B_BIG_CHESS_HH
# define MLN_FUN_P2B_BIG_CHESS_HH
-/*! \file
- *
- * \brief FIXME.
- */
+/// \file
+///
+/// \brief Generates a boolean image looking like chess-boards
+/// (alternate True/False).
# include <mln/core/concept/function.hh>
# include <mln/core/alias/point2d.hh>
@@ -44,7 +45,24 @@ namespace mln
namespace p2b
{
- // FIXME: Doc!
+ /* \brief Generates a boolean image based on a chess-board
+ canvas (alternate True/False).
+
+ This function allows to specify how large are the square in
+ the chess-board canvas.
+
+ \verbatim
+ | | - - | |
+ | | - - | |
+ - - | | - -
+ - - | | - -
+ | | - - | |
+ | | - - | |
+ \endverbatim
+
+ \sa data::transform
+ \ingroup funv2v
+ */
template <typename B>
struct big_chess : public Function_v2b< big_chess<B> >
{
diff --git a/milena/mln/fun/p2b/chess.hh b/milena/mln/fun/p2b/chess.hh
index 53aae9c..4a10fcc 100644
--- a/milena/mln/fun/p2b/chess.hh
+++ b/milena/mln/fun/p2b/chess.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009, 2013 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -28,7 +29,9 @@
/// \file
///
-/// FIXME.
+/// \brief Generates a boolean image based on a chess-board canvas
+/// (alternate True/False).
+
# include <mln/core/concept/function.hh>
# include <mln/core/alias/point2d.hh>
@@ -43,8 +46,21 @@ namespace mln
namespace p2b
{
- // FIXME: Doc!
+ /* \brief Generates a boolean image based on a chess-board
+ canvas (alternate True/False).
+
+ This function allows to specify how large are the square in
+ the chess-board canvas.
+
+ \verbatim
+ | - | - | -
+ - | - | - |
+ | - | - | -
+ \endverbatim
+ \sa data::transform
+ \ingroup funv2v
+ */
struct chess : public Function_v2b< chess >
{
typedef bool result;
diff --git a/milena/mln/fun/p2b/has.hh b/milena/mln/fun/p2b/has.hh
index 0ab4ac8..79d061d 100644
--- a/milena/mln/fun/p2b/has.hh
+++ b/milena/mln/fun/p2b/has.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009, 2013 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -28,7 +29,7 @@
/// \file
///
-/// Function "psite-> bool" that maps the call "ima.has(p)".
+/// \brief Function "psite-> bool" that maps the call
"ima.has(p)".
# include <mln/core/concept/image.hh>
@@ -46,8 +47,13 @@ namespace mln
namespace p2b
{
- // FIXME: Doc!
+ /* \brief Function "psite-> bool" that maps the call
+ "ima.has(p)".
+
+ \sa data::transform
+ \ingroup funv2v
+ */
template <typename I>
struct has
@@ -76,7 +82,7 @@ namespace mln
private:
mlc_const(I) ima_;
- typedef Function_v2b< has<I> > super_;
+ typedef Function_p2b< has<I> > super_;
};
diff --git a/milena/mln/fun/p2b/tautology.hh b/milena/mln/fun/p2b/tautology.hh
index 7a1f8b9..2f1e089 100644
--- a/milena/mln/fun/p2b/tautology.hh
+++ b/milena/mln/fun/p2b/tautology.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009, 2013 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -43,10 +44,14 @@ namespace mln
{
- /// \brief A p2b function always returning \c true.
- ///
- /// A simpler name would be `true', but this is not a valid C++
- /// identifier, as \c true is a keyword of the language.
+ /*! \brief A function always returning \c true.
+
+ A simpler name would be `true', but this is not a valid C++
+ identifier, as \c true is a keyword of the language.
+
+ \sa data::transform
+ \ingroup funv2v
+ */
struct tautology : public Function_v2b< tautology >
{
typedef bool result;
diff --git a/milena/mln/fun/p2p/fold.hh b/milena/mln/fun/p2p/fold.hh
index 1cd445a..5f0e4f4 100644
--- a/milena/mln/fun/p2p/fold.hh
+++ b/milena/mln/fun/p2p/fold.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009, 2013 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -28,7 +29,7 @@
/// \file
///
-/// FIXME: Doc!
+/// \brief Fold a domain into one direction.
# include <mln/core/concept/function.hh>
# include <mln/core/site_set/box.hh>
@@ -43,13 +44,12 @@ namespace mln
namespace p2p
{
- // Forward declaration.
- namespace internal {
- template <typename F, typename P>
- P do_fold(const P& p, const box<P>& b);
- }
-
+ /*!
+ \brief Fold a domain into one direction.
+ \sa data::transform
+ \ingroup funv2v
+ */
template < typename P,
int dir_0 = -1,
int dir_1 = -1,
diff --git a/milena/mln/fun/p2p/mirror.hh b/milena/mln/fun/p2p/mirror.hh
index 8b231ff..7f307dc 100644
--- a/milena/mln/fun/p2p/mirror.hh
+++ b/milena/mln/fun/p2p/mirror.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009, 2013 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -28,7 +29,8 @@
/// \file
///
-/// FIXME: doc
+/// \brief For sites outside a given domain it returns the
+/// corresponding mirror site in the domain,
# include <mln/core/concept/function.hh>
@@ -41,6 +43,29 @@ namespace mln
namespace p2p
{
+ /*! \brief For sites outside a given domain it returns the
+ * corresponding mirror site in the domain,
+
+ Example:
+
+ \verbatim
+ (0,0)
+ x -------- x
+ | |
+ | |
+ x -------- x
+ (3,3)
+ \endverbatim
+
+ \code
+ fun::p2p::mirror<box2d> f_mirror(box2d(4,4));
+ point2d p = f_mirror(point2d(0, 6));
+ // p == (0, 1);
+ \endcode
+
+ \sa data::transform
+ \ingroup funv2v
+ */
template <typename B>
struct mirror : public Function_v2v< mirror<B> >
{
diff --git a/milena/mln/fun/p2p/translation.hh b/milena/mln/fun/p2p/translation.hh
index e4609eb..c122cfd 100644
--- a/milena/mln/fun/p2p/translation.hh
+++ b/milena/mln/fun/p2p/translation.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009, 2013 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -28,7 +29,8 @@
/// \file
///
-/// FIXME: doc
+/// \brief Computes the translation of a given point w.r.t a
+/// translation vector.
# include <mln/core/concept/function.hh>
# include <mln/core/concept/gdpoint.hh>
@@ -43,6 +45,13 @@ namespace mln
namespace p2p
{
+ /*!
+ \brief Computes the translation of a given point w.r.t a
+ translation vector.
+
+ \sa data::transform
+ \ingroup funv2v
+ */
template <typename P>
struct translation_t : public Function_v2v< translation_t<P> >
{
diff --git a/milena/mln/fun/p2v/elifs.hh b/milena/mln/fun/p2v/elifs.hh
index aca8817..5ca3aee 100644
--- a/milena/mln/fun/p2v/elifs.hh
+++ b/milena/mln/fun/p2v/elifs.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2009 EPITA Research and Development Laboratory (LRDE)
+<// Copyright (C) 2007, 2009, 2013 EPITA Research and Development
+ // Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -26,10 +27,9 @@
#ifndef MLN_FUN_P2V_ELIFS_HH
# define MLN_FUN_P2V_ELIFS_HH
-/*! \file
- *
- * \brief FIXME.
- */
+/// \file
+///
+/// \brief Construct a if-then-else canvas from functions.
# include <mln/fun/p2v/ternary.hh>
@@ -43,6 +43,12 @@ namespace mln
namespace p2v
{
+ /*!
+ \brief Construct a if-then-else canvas from functions.
+
+ \sa data::transform
+ \ingroup funv2v
+ */
template <typename T1, typename N1,
typename T2, typename N2,
typename O>
diff --git a/milena/mln/fun/p2v/iota.hh b/milena/mln/fun/p2v/iota.hh
index 2e0ab30..dbfe311 100644
--- a/milena/mln/fun/p2v/iota.hh
+++ b/milena/mln/fun/p2v/iota.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009, 2013 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -42,6 +43,26 @@ namespace mln
namespace p2v
{
+ /*!
+ \brief Iota function.
+
+ Example:
+
+ \code
+ image2d<int> ima(3,3);
+ data::transform(ima, fun::p2v::iota());
+ \endcode
+
+ \c ima values:
+ \verbatim
+ 1 2 3
+ 4 5 6
+ 7 8 9
+ \endverbatim
+
+ \sa data::transform
+ \ingroup funv2v
+ */
struct iota : public Function_v2v< iota >
{
typedef unsigned result;
diff --git a/milena/mln/fun/p2v/ternary.hh b/milena/mln/fun/p2v/ternary.hh
index f5f4aed..9cd610b 100644
--- a/milena/mln/fun/p2v/ternary.hh
+++ b/milena/mln/fun/p2v/ternary.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2009, 2013 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -26,10 +27,10 @@
#ifndef MLN_FUN_P2V_TERNARY_HH
# define MLN_FUN_P2V_TERNARY_HH
-/*! \file
- *
- * \brief FIXME.
- */
+/// \file
+///
+/// \brief Function representing a if-then-else canvas from
+/// functions.
# include <mln/fun/internal/selector.hh>
@@ -43,6 +44,12 @@ namespace mln
namespace p2v
{
+ /*! \brief Function representing a if-then-else canvas from
+ functions.
+
+ \sa data::transform
+ \ingroup funv2v
+ */
template <typename P, typename T, typename F>
struct ternary_
: fun::internal::selector_from_result_<mln_result(T), ternary_<P,T,F>
>::ret
@@ -61,14 +68,14 @@ namespace mln
const T f_true_;
const F f_false_;
};
-
-
+
+
template <typename P, typename T, typename F>
ternary_<P, T, F>
ternary(const Function_v2b<P>& f_pred,
const Function_v2v<T>& f_true,
const Function_v2v<F>& f_false);
-
+
# ifndef MLN_INCLUDE_ONLY
diff --git a/milena/mln/fun/x2v/bilinear.hh b/milena/mln/fun/x2v/bilinear.hh
index 313a369..d072d45 100644
--- a/milena/mln/fun/x2v/bilinear.hh
+++ b/milena/mln/fun/x2v/bilinear.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2008, 2009, 2013 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -46,8 +46,12 @@ namespace mln
namespace x2v
{
- /// Represent a bilinear interolation of values from an underlying image
- ///
+ /*! \brief Represent a bilinear interolation of values from an
+ underlying image
+
+ \sa data::transform
+ \ingroup funv2v
+ */
template < typename I >
struct bilinear
: public fun::internal::selector_<const algebra::vec<3,float>,
diff --git a/milena/mln/fun/x2v/l1_norm.hh b/milena/mln/fun/x2v/l1_norm.hh
index 3054c56..72f4475 100644
--- a/milena/mln/fun/x2v/l1_norm.hh
+++ b/milena/mln/fun/x2v/l1_norm.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009, 2013 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -44,6 +45,11 @@ namespace mln
namespace x2v
{
+ /*! \brief Define the L1-norm of an algebraic vector.
+
+ \sa data::transform
+ \ingroup funv2v
+ */
template <typename V>
struct l1_norm : public Function_v2v< l1_norm<V> >
{
diff --git a/milena/mln/fun/x2v/nneighbor.hh b/milena/mln/fun/x2v/nneighbor.hh
index 158b84f..95da0fc 100644
--- a/milena/mln/fun/x2v/nneighbor.hh
+++ b/milena/mln/fun/x2v/nneighbor.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009, 2013 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -33,7 +34,8 @@
/*! \file
*
- * \brief Define a nneighbor interpolation of values from an underlying image
+ * \brief Define a nneighbor interpolation of values from an
+ * underlying image
*/
namespace mln
@@ -42,47 +44,54 @@ namespace mln
namespace fun
{
- namespace x2x
+ namespace x2v
{
- template < typename I >
- struct nneighbor
- : public fun::internal::selector_<const algebra::vec<3,float>,
- // 3,float is a dummy parameter (real is
n,T)
- mln_value(I), nneighbor<I> >::ret
- {
- typedef mln_value(I) result;
+ /*!
+ \brief Define a nneighbor interpolation of values from an
+ underlying image
- nneighbor(const I& ima);
+ \sa data::transform
+ \ingroup funv2v
+ */
+ template < typename I >
+ struct nneighbor
+ : public fun::internal::selector_<const algebra::vec<3,float>,
+ // 3,float is a dummy parameter (real is n,T)
+ mln_value(I), nneighbor<I> >::ret
+ {
+ typedef mln_value(I) result;
- template < unsigned n, typename T >
- mln_value(I)
- operator()(const algebra::vec<n,T>& x) const;
+ nneighbor(const I& ima);
- const I& ima;
- };
+ template < unsigned n, typename T >
+ mln_value(I)
+ operator()(const algebra::vec<n,T>& x) const;
+
+ const I& ima;
+ };
# ifndef MLN_INCLUDE_ONLY
- template < typename I >
- nneighbor<I>::nneighbor(const I& ima) : ima(ima)
- {
- }
+ template < typename I >
+ nneighbor<I>::nneighbor(const I& ima) : ima(ima)
+ {
+ }
- template < typename I >
- template < unsigned n, typename T >
- mln_value(I)
- nneighbor<I>::operator()(const algebra::vec<n,T>& x) const
- {
- mln_psite(I) p = convert::to<mln_psite(I)>(x);
- return ima(p);
- }
+ template < typename I >
+ template < unsigned n, typename T >
+ mln_value(I)
+ nneighbor<I>::operator()(const algebra::vec<n,T>& x) const
+ {
+ mln_psite(I) p = convert::to<mln_psite(I)>(x);
+ return ima(p);
+ }
# endif // ! MLN_INCLUDE_ONLY
- } // end of namespace mln::fun::x2x
+ } // end of namespace mln::fun::x2v
} // end of namespace mln::fun
diff --git a/milena/mln/fun/x2v/trilinear.hh b/milena/mln/fun/x2v/trilinear.hh
index bb08274..6ffb98a 100644
--- a/milena/mln/fun/x2v/trilinear.hh
+++ b/milena/mln/fun/x2v/trilinear.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2008, 2009, 2012 EPITA Research and Development
+// Copyright (C) 2008, 2009, 2012, 2013 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
@@ -48,8 +48,13 @@ namespace mln
namespace x2v
{
- /// Represent a trilinear interolation of values from an underlying image
- ///
+ /*!
+ \brief Represent a trilinear interolation of values from an
+ underlying image
+
+ \sa data::transform
+ \ingroup funv2v
+ */
template < typename I >
struct trilinear
: public fun::internal::selector_<const algebra::vec<3,float>,
--
1.7.2.5