* mln/arith/diff_abs.hh: Fix bad namespace closure. * mln/morpho/dilation_fast.hh, * mln/trait/image/print.hh, * mln/trait/op/ord.hh, * mln/level/median.hh, * mln/estim/mean.hh, * mln/estim/min_max.hh, * mln/estim/sum.hh, * mln/estim/all.hh, * mln/estim/essential.hh, * mln/arith/diff_abs.hh, * mln/arith/min.hh, * mln/arith/min.spe.hh, * mln/arith/minus.hh, * mln/arith/plus.hh, * mln/arith/revert.hh, * mln/arith/revert.spe.hh, * mln/arith/times.hh, * mln/arith/times.spe.hh: Cleanup comments. * mln/morpho/hit_or_miss.hh, * mln/display/save.hh, * mln/canvas/browsing/backdiagonal2d.hh, * mln/canvas/browsing/diagonal2d.hh, * mln/canvas/browsing/dir_struct_elt_incr_update.hh, * mln/canvas/browsing/directional.hh, * mln/canvas/browsing/essential.hh, * mln/canvas/browsing/fwd.hh, * mln/canvas/browsing/hyper_directional.hh, * mln/canvas/browsing/snake_fwd.hh, * mln/canvas/browsing/snake_generic.hh, * mln/canvas/browsing/snake_vert.hh: Fix wrong declaration of global variables. * mln/value/float01.hh, * mln/core/contract.hh: add missing inline. * mln/fun/p2b/chess.hh, * mln/fun/p2v/iota.hh: remove global variables. * mln/fun/v2v/rgb_to_hsi.hh: Split interface and implementation. * mln/geom/chamfer.hh: Fix compilation issue. * mln/make/win_chamfer.hh: Move implementation between MLN_INCLUDE_ONLY guards. * tests/Makefile.am, * tests/global_vars1.cc, * tests/global_vars2.cc: Add a new test to check whether global variables are declared correctly or not. * tests/border/find_full.cc, * tests/border/get_full.cc, * tests/convert/to_image.cc, * tests/core/image/cast_image.cc, * tests/core/image/image_if.cc, * tests/core/site_set/pset_if.cc, * tests/level/fill_with_image.cc, * tests/level/fill_with_value.cc, * tests/level/paste.cc, * tests/level/transform.cc, * tests/trait/image/images.cc: update according the new use of p2v::iota and p2b::chess. * tests/pw/image.cc: Make it a real test. * mln/level/compute.hh: Fix ambiguity. * tests/border/get.cc, * tests/border/resize_image_if.cc: Fix tests. --- milena/ChangeLog | 77 ++++++++++ milena/mln/arith/diff_abs.hh | 22 ++-- milena/mln/arith/min.hh | 18 ++-- milena/mln/arith/min.spe.hh | 10 +- milena/mln/arith/minus.hh | 42 +++--- milena/mln/arith/plus.hh | 46 +++--- milena/mln/arith/revert.hh | 22 ++-- milena/mln/arith/revert.spe.hh | 11 +- milena/mln/arith/times.hh | 26 ++-- milena/mln/arith/times.spe.hh | 11 +- milena/mln/canvas/browsing/backdiagonal2d.hh | 24 ++-- milena/mln/canvas/browsing/diagonal2d.hh | 24 ++-- .../canvas/browsing/dir_struct_elt_incr_update.hh | 61 ++------ milena/mln/canvas/browsing/directional.hh | 19 ++- milena/mln/canvas/browsing/essential.hh | 1 + milena/mln/canvas/browsing/fwd.hh | 20 ++-- milena/mln/canvas/browsing/hyper_directional.hh | 19 ++-- milena/mln/canvas/browsing/snake_fwd.hh | 29 ++--- milena/mln/canvas/browsing/snake_generic.hh | 16 +-- milena/mln/canvas/browsing/snake_vert.hh | 33 ++--- milena/mln/core/contract.hh | 1 + milena/mln/display/save.hh | 30 ++-- milena/mln/estim/all.hh | 10 +- milena/mln/estim/essential.hh | 9 +- milena/mln/estim/mean.hh | 16 +- milena/mln/estim/min_max.hh | 16 +- milena/mln/estim/sum.hh | 20 ++-- milena/mln/fun/p2b/chess.hh | 8 +- milena/mln/fun/p2v/iota.hh | 26 ++-- milena/mln/fun/v2v/rgb_to_hsi.hh | 148 +++++++++++-------- milena/mln/geom/chamfer.hh | 16 +-- milena/mln/level/compute.hh | 18 ++-- milena/mln/level/median.hh | 12 +- milena/mln/make/win_chamfer.hh | 44 +++++- milena/mln/morpho/dilation_fast.hh | 22 ++-- milena/mln/morpho/hit_or_miss.hh | 37 +++--- milena/mln/trait/image/print.hh | 8 +- milena/mln/trait/op/ord.hh | 14 +- milena/mln/value/float01.hh | 12 +- milena/tests/Makefile.am | 4 +- milena/tests/border/find_full.cc | 14 +- milena/tests/border/get.cc | 12 +- milena/tests/border/get_full.cc | 16 +- milena/tests/border/resize_image_if.cc | 14 +- milena/tests/convert/to_image.cc | 2 +- milena/tests/core/image/cast_image.cc | 12 +- milena/tests/core/image/image_if.cc | 18 ++-- milena/tests/core/site_set/pset_if.cc | 14 +- milena/tests/global_vars1.cc | 101 +++++++++++++ milena/tests/global_vars2.cc | 101 +++++++++++++ milena/tests/level/fill_with_image.cc | 18 ++-- milena/tests/level/fill_with_value.cc | 12 +- milena/tests/level/paste.cc | 14 +- milena/tests/level/transform.cc | 13 +- milena/tests/pw/image.cc | 25 +++- milena/tests/trait/image/images.cc | 14 +- 56 files changed, 841 insertions(+), 561 deletions(-) create mode 100644 milena/tests/global_vars1.cc create mode 100644 milena/tests/global_vars2.cc diff --git a/milena/ChangeLog b/milena/ChangeLog index fc79c11..5a6dbc7 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -29,6 +29,83 @@ * mln/logical/includes.hh: New. * mln/logical/all.hh: Update. +2008-11-13 Guillaume Lazzara <z@lrde.epita.fr> + + Make Olena compile with MLN_INCLUDE_ONLY and cleanup comments. + + * mln/arith/diff_abs.hh: Fix bad namespace closure. + + * mln/morpho/dilation_fast.hh, + * mln/trait/image/print.hh, + * mln/trait/op/ord.hh, + * mln/level/median.hh, + * mln/estim/mean.hh, + * mln/estim/min_max.hh, + * mln/estim/sum.hh, + * mln/estim/all.hh, + * mln/estim/essential.hh, + * mln/arith/diff_abs.hh, + * mln/arith/min.hh, + * mln/arith/min.spe.hh, + * mln/arith/minus.hh, + * mln/arith/plus.hh, + * mln/arith/revert.hh, + * mln/arith/revert.spe.hh, + * mln/arith/times.hh, + * mln/arith/times.spe.hh: Cleanup comments. + + * mln/morpho/hit_or_miss.hh, + * mln/display/save.hh, + * mln/canvas/browsing/backdiagonal2d.hh, + * mln/canvas/browsing/diagonal2d.hh, + * mln/canvas/browsing/dir_struct_elt_incr_update.hh, + * mln/canvas/browsing/directional.hh, + * mln/canvas/browsing/essential.hh, + * mln/canvas/browsing/fwd.hh, + * mln/canvas/browsing/hyper_directional.hh, + * mln/canvas/browsing/snake_fwd.hh, + * mln/canvas/browsing/snake_generic.hh, + * mln/canvas/browsing/snake_vert.hh: Fix wrong declaration of global + variables. + + * mln/value/float01.hh, + * mln/core/contract.hh: add missing inline. + + * mln/fun/p2b/chess.hh, + * mln/fun/p2v/iota.hh: remove global variables. + + * mln/fun/v2v/rgb_to_hsi.hh: Split interface and implementation. + + * mln/geom/chamfer.hh: Fix compilation issue. + + * mln/make/win_chamfer.hh: Move implementation between + MLN_INCLUDE_ONLY guards. + + * tests/Makefile.am, + * tests/global_vars1.cc, + * tests/global_vars2.cc: Add a new test to check whether global + variables are declared correctly or not. + + * tests/border/find_full.cc, + * tests/border/get_full.cc, + * tests/convert/to_image.cc, + * tests/core/image/cast_image.cc, + * tests/core/image/image_if.cc, + * tests/core/site_set/pset_if.cc, + * tests/level/fill_with_image.cc, + * tests/level/fill_with_value.cc, + * tests/level/paste.cc, + * tests/level/transform.cc, + * tests/trait/image/images.cc: update according the new use of + p2v::iota and p2b::chess. + + * tests/pw/image.cc: Make it a real test. + + * mln/level/compute.hh: Fix ambiguity. + + * tests/border/get.cc, + * tests/border/resize_image_if.cc: Fix tests. + 2008-11-13 Thierry Geraud <thierry.geraud@lrde.epita.fr> Specialize accu tranform for fastest images. diff --git a/milena/mln/arith/diff_abs.hh b/milena/mln/arith/diff_abs.hh index 141a38a..623a0b0 100644 --- a/milena/mln/arith/diff_abs.hh +++ b/milena/mln/arith/diff_abs.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,12 +29,11 @@ #ifndef MLN_ARITH_DIFF_ABS_HH # define MLN_ARITH_DIFF_ABS_HH -/*! \file mln/arith/diff_abs.hh - * - * \brief Point-wise addition between images. - * - * \todo Speedup; some versions are not optimal. - */ +/// \file mln/arith/diff_abs.hh +/// +/// Point-wise addition between images. +/// +/// \todo Speedup; some versions are not optimal. # include <mln/arith/includes.hh> # include <mln/fun/vv2v/diff_abs.hh> @@ -45,8 +45,8 @@ namespace mln namespace arith { - /*! Point-wise absolute difference of images \p lhs and \p rhs. - * + /// Point-wise absolute difference of images \p lhs and \p rhs. + /*! * \param[in] lhs First operand image. * \param[in] rhs Second operand image. * \result The result image. @@ -76,10 +76,10 @@ namespace mln return output; } - } // end of namespace mln::arith - # endif // ! MLN_INCLUDE_ONLY + } // end of namespace mln::arith + } // end of namespace mln diff --git a/milena/mln/arith/min.hh b/milena/mln/arith/min.hh index a8aaa10..67ae6c0 100644 --- a/milena/mln/arith/min.hh +++ b/milena/mln/arith/min.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_ARITH_MIN_HH # define MLN_ARITH_MIN_HH -/*! \file mln/arith/min.hh - * - * \brief Point-wise min between images. - */ +/// \file mln/arith/min.hh +/// +/// Point-wise min between images. # include <mln/core/concept/image.hh> @@ -45,8 +45,8 @@ namespace mln namespace arith { - /*! Point-wise min of images \p lhs and \p rhs. - * + /// Point-wise min of images \p lhs and \p rhs. + /*! * \param[in] lhs First operand image. * \param[in] rhs Second operand image. * \result The result image. @@ -58,8 +58,8 @@ namespace mln min(const Image<L>& lhs, const Image<R>& rhs); - /*! Point-wise min of image \p lhs in image \p rhs. - * + /// Point-wise min of image \p lhs in image \p rhs. + /*! * \param[in,out] lhs First operand image. * \param[in] rhs Second operand image. * diff --git a/milena/mln/arith/min.spe.hh b/milena/mln/arith/min.spe.hh index 25fca00..b31029b 100644 --- a/milena/mln/arith/min.spe.hh +++ b/milena/mln/arith/min.spe.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_ARITH_MIN_SPE_HH # define MLN_ARITH_MIN_SPE_HH -/*! \file mln/arith/min.spe.hh - * - * \brief Specializations for mln::arith::min. - */ +/// \file mln/arith/min.spe.hh +/// +/// Specializations for mln::arith::min. # ifndef MLN_ARITH_MIN_HH # error "Forbidden inclusion of *.spe.hh" diff --git a/milena/mln/arith/minus.hh b/milena/mln/arith/minus.hh index 6419e03..5a7db44 100644 --- a/milena/mln/arith/minus.hh +++ b/milena/mln/arith/minus.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,12 +29,11 @@ #ifndef MLN_ARITH_MINUS_HH # define MLN_ARITH_MINUS_HH -/*! \file mln/arith/minus.hh - * - * \brief Point-wise substraction between images. - * - * \todo Speedup; some versions are not optimal. - */ +/// \file mln/arith/minus.hh +/// +/// Point-wise substraction between images. +/// +/// \todo Speedup; some versions are not optimal. # include <mln/arith/includes.hh> @@ -87,8 +87,8 @@ namespace mln namespace arith { - /*! Point-wise addition of images \p lhs and \p rhs. - * + /// Point-wise addition of images \p lhs and \p rhs. + /*! * \param[in] lhs First operand image. * \param[in] rhs Second operand image. * \result The result image. @@ -100,8 +100,8 @@ namespace mln minus(const Image<L>& lhs, const Image<R>& rhs); - /*! Point-wise addition of images \p lhs and \p rhs. - * + /// Point-wise addition of images \p lhs and \p rhs. + /*! * \param[in] lhs First operand image. * \param[in] rhs Second operand image. * \param[in] f Function. @@ -114,8 +114,8 @@ namespace mln minus(const Image<L>& lhs, const Image<R>& rhs, const Function_v2v<F>& f); - /*! Point-wise addition of images \p lhs and \p rhs. - * + /// Point-wise addition of images \p lhs and \p rhs. + /*! * \param[in] lhs First operand image. * \param[in] rhs Second operand image. * \result The result image. @@ -129,8 +129,8 @@ namespace mln minus(const Image<L>& lhs, const Image<R>& rhs); - /*! Point-wise addition of image \p rhs in image \p lhs. - * + /// Point-wise addition of image \p rhs in image \p lhs. + /*! * \param[in,out] lhs First operand image (subject to addition). * \param[in] rhs Second operand image (to be added to \p lhs). * @@ -145,8 +145,8 @@ namespace mln minus_inplace(Image<L>& lhs, const Image<R>& rhs); - /*! Point-wise addition of the value \p val to image \p input. - * + /// Point-wise addition of the value \p val to image \p input. + /*! * \param[in] input The image. * \param[in] val The value. * \result The result image. @@ -158,8 +158,8 @@ namespace mln minus_cst(const Image<I>& input, const V& val); - /*! Point-wise addition of the value \p val to image \p input. - * + /// Point-wise addition of the value \p val to image \p input. + /*! * \param[in] input The image. * \param[in] val The value. * \param[in] f Function. @@ -172,8 +172,8 @@ namespace mln minus_cst(const Image<I>& input, const V& val, const Function_v2v<F>& f); - /*! Point-wise addition of the value \p val to image \p input. - * + /// Point-wise addition of the value \p val to image \p input. + /*! * \param[in,out] input The image. * \param[in] val The value. * diff --git a/milena/mln/arith/plus.hh b/milena/mln/arith/plus.hh index a18026a..b4f7b2f 100644 --- a/milena/mln/arith/plus.hh +++ b/milena/mln/arith/plus.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,12 +29,11 @@ #ifndef MLN_ARITH_PLUS_HH # define MLN_ARITH_PLUS_HH -/*! \file mln/arith/plus.hh - * - * \brief Point-wise addition between images. - * - * \todo Speedup; some versions are not optimal. - */ +/// \file mln/arith/plus.hh +/// +/// Point-wise addition between images. +/// +/// \todo Speedup; some versions are not optimal. # include <mln/arith/includes.hh> @@ -87,8 +87,8 @@ namespace mln namespace arith { - /*! Point-wise addition of images \p lhs and \p rhs. - * + /// Point-wise addition of images \p lhs and \p rhs. + /*! * \param[in] lhs First operand image. * \param[in] rhs Second operand image. * \result The result image. @@ -100,8 +100,8 @@ namespace mln plus(const Image<L>& lhs, const Image<R>& rhs); - /*! Point-wise addition of images \p lhs and \p rhs. - * + /// Point-wise addition of images \p lhs and \p rhs. + /*! * \param[in] lhs First operand image. * \param[in] rhs Second operand image. * \param[in] f Function. @@ -114,8 +114,8 @@ namespace mln plus(const Image<L>& lhs, const Image<R>& rhs, const Function_v2v<F>& f); - /*! Point-wise addition of images \p lhs and \p rhs. - * + /// Point-wise addition of images \p lhs and \p rhs. + /*! * \param[in] lhs First operand image. * \param[in] rhs Second operand image. * \result The result image. @@ -129,8 +129,8 @@ namespace mln plus(const Image<L>& lhs, const Image<R>& rhs); - /*! Point-wise addition of image \p rhs in image \p lhs. - * + /// Point-wise addition of image \p rhs in image \p lhs. + /*! * \param[in,out] lhs First operand image (subject to addition). * \param[in] rhs Second operand image (to be added to \p lhs). * @@ -145,8 +145,8 @@ namespace mln plus_inplace(Image<L>& lhs, const Image<R>& rhs); - /*! Point-wise addition of the value \p val to image \p input. - * + /// Point-wise addition of the value \p val to image \p input. + /*! * \param[in] input The image. * \param[in] val The value. * \result The result image. @@ -158,8 +158,8 @@ namespace mln plus_cst(const Image<I>& input, const V& val); - /*! Point-wise addition of the value \p val to image \p input. - * + /// Point-wise addition of the value \p val to image \p input. + /*! * \param[in] input The image. * \param[in] val The value. * \param[in] f Function. @@ -172,8 +172,8 @@ namespace mln plus_cst(const Image<I>& input, const V& val, const Function_v2v<F>& f); - /*! Point-wise addition of the value \p val to image \p input. - * + /// Point-wise addition of the value \p val to image \p input. + /*! * \param[in] input The image. * \param[in] val The value. * \result The result image. @@ -185,8 +185,8 @@ namespace mln plus_cst(const Image<I>& input, const V& val); - /*! Point-wise addition of the value \p val to image \p input. - * + /// Point-wise addition of the value \p val to image \p input. + /*! * \param[in,out] input The image. * \param[in] val The value. * diff --git a/milena/mln/arith/revert.hh b/milena/mln/arith/revert.hh index c4d1044..ee0a386 100644 --- a/milena/mln/arith/revert.hh +++ b/milena/mln/arith/revert.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,12 +29,11 @@ #ifndef MLN_ARITH_REVERT_HH # define MLN_ARITH_REVERT_HH -/*! \file mln/arith/revert.hh - * - * \brief Point-wise revert (min -> max and max -> min) of images. - * - * \todo Add static assertion and save one iterator in in-place version. - */ +/// \file mln/arith/revert.hh +/// +/// Point-wise revert (min -> max and max -> min) of images. +/// +/// \todo Add static assertion and save one iterator in in-place version. # include <mln/core/concept/image.hh> # include <mln/trait/value_.hh> @@ -52,8 +52,8 @@ namespace mln namespace arith { - /*! Point-wise reversion of image \p input. - * + /// Point-wise reversion of image \p input. + /*! * \param[in] input the input image. * \result The result image. * @@ -67,8 +67,8 @@ namespace mln mln_concrete(I) revert(const Image<I>& input); - /*! Point-wise in-place reversion of image \p input. - * + /// Point-wise in-place reversion of image \p input. + /*! * \param[in,out] input The target image. * * \pre \p input.has_data diff --git a/milena/mln/arith/revert.spe.hh b/milena/mln/arith/revert.spe.hh index 8a512b5..fcf8b74 100644 --- a/milena/mln/arith/revert.spe.hh +++ b/milena/mln/arith/revert.spe.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,11 +29,9 @@ #ifndef MLN_ARITH_REVERT_SPE_HH # define MLN_ARITH_REVERT_SPE_HH -/*! \file mln/arith/revert.spe.hh - * - * \brief Specializations for mln::arith::revert. - * - */ +/// \file mln/arith/revert.spe.hh +/// +/// Specializations for mln::arith::revert. # ifndef MLN_ARITH_REVERT_HH # error "Forbidden inclusion of *.spe.hh" diff --git a/milena/mln/arith/times.hh b/milena/mln/arith/times.hh index f0609c4..eedab41 100644 --- a/milena/mln/arith/times.hh +++ b/milena/mln/arith/times.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,12 +29,11 @@ #ifndef MLN_ARITH_TIMES_HH # define MLN_ARITH_TIMES_HH -/*! \file mln/arith/times.hh - * - * \brief Point-wise multiplication between images. - * - * \todo Speedup; some versions are not optimal. - */ +/// \file mln/arith/times.hh +/// +/// Point-wise multiplication between images. +/// +/// \todo Speedup; some versions are not optimal. # include <mln/arith/includes.hh> @@ -88,8 +88,8 @@ namespace mln namespace arith { - /*! Point-wise addition of images \p lhs and \p rhs. - * + /// Point-wise addition of images \p lhs and \p rhs. + /*! * \param[in] lhs First operand image. * \param[in] rhs Second operand image. * \param[out] output The result image. @@ -100,8 +100,8 @@ namespace mln void times(const Image<L>& lhs, const Image<R>& rhs, Image<O>& output); - /*! Point-wise addition of the value \p val to image \p input. - * + /// Point-wise addition of the value \p val to image \p input. + /*! * \param[in] input The image. * \param[in] val The value. * \param[out] output The result image. @@ -112,8 +112,8 @@ namespace mln void times_cst(const Image<I>& input, const V& val, Image<O>& output); - /*! Point-wise addition of image \p rhs in image \p lhs. - * + /// Point-wise addition of image \p rhs in image \p lhs. + /*! * \param[in] lhs First operand image (subject to addition). * \param[in,out] rhs Second operand image (to be added to \p lhs). * diff --git a/milena/mln/arith/times.spe.hh b/milena/mln/arith/times.spe.hh index e88ae78..ef192bb 100644 --- a/milena/mln/arith/times.spe.hh +++ b/milena/mln/arith/times.spe.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,11 +29,9 @@ #ifndef MLN_ARITH_TIMES_SPE_HH # define MLN_ARITH_TIMES_SPE_HH -/*! \file mln/arith/times.spe.hh - * - * \brief Specializations for mln::arith::times. - * - */ +/// \file mln/arith/times.spe.hh +/// +/// Specializations for mln::arith::times. # ifndef MLN_ARITH_TIMES_HH # error "Forbidden inclusion of *.spe.hh" diff --git a/milena/mln/canvas/browsing/backdiagonal2d.hh b/milena/mln/canvas/browsing/backdiagonal2d.hh index ee07c80..0ad407e 100644 --- a/milena/mln/canvas/browsing/backdiagonal2d.hh +++ b/milena/mln/canvas/browsing/backdiagonal2d.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_CANVAS_BROWSING_BACKDIAGONAL2D_HH # define MLN_CANVAS_BROWSING_BACKDIAGONAL2D_HH -/*! \file mln/canvas/browsing/backdiagonal2d.hh - * - * \brief Backdiagonal2d browsing of an image. - */ +/// \file mln/canvas/browsing/backdiagonal2d.hh +/// +/// Backdiagonal2d browsing of an image. # include <mln/core/concept/browsing.hh> # include <mln/core/concept/image.hh> @@ -45,9 +45,8 @@ namespace mln namespace browsing { + /// Browsing in a certain direction. /*! - * \brief Browsing in a certain direction. - * * This canvas browse all the point of an image 'input' of type * 'I' and of dimension 'dim' in the direction 'dir'. * @@ -86,12 +85,14 @@ namespace mln { template <typename F> void operator()(F& f) const; - } + }; - backdiagonal2d; + extern const backdiagonal2d_t backdiagonal2d; # ifndef MLN_INCLUDE_ONLY + const backdiagonal2d_t backdiagonal2d; + template <typename F> inline void @@ -118,10 +119,7 @@ namespace mln f.p[0] = pmax[0]; f.p[1] = pmin[1]; - trace::entering("canvas::browsing::backdiagonal2d::init"); f.init(); - trace::exiting("canvas::browsing::backdiagonal2d::init"); - while (f.input.domain().has(f.p)) { @@ -157,9 +155,7 @@ namespace mln f.p = start_diag + dp_second; } - trace::entering("canvas::browsing::backdiagonal2d::final"); f.final(); - trace::exiting("canvas::browsing::backdiagonal2d::final"); trace::exiting("canvas::browsing::backdiagonal2d"); } diff --git a/milena/mln/canvas/browsing/diagonal2d.hh b/milena/mln/canvas/browsing/diagonal2d.hh index 1b825e8..87bdaa9 100644 --- a/milena/mln/canvas/browsing/diagonal2d.hh +++ b/milena/mln/canvas/browsing/diagonal2d.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_CANVAS_BROWSING_DIAGONAL2D_HH # define MLN_CANVAS_BROWSING_DIAGONAL2D_HH -/*! \file mln/canvas/browsing/diagonal2d.hh - * - * \brief Diagonal2d browsing of an image. - */ +/// \file mln/canvas/browsing/diagonal2d.hh +/// +/// Diagonal2d browsing of an image. # include <mln/core/concept/browsing.hh> # include <mln/core/concept/image.hh> @@ -45,9 +45,8 @@ namespace mln namespace browsing { + /// Browsing in a certain direction. /*! - * \brief Browsing in a certain direction. - * * This canvas browse all the point of an image 'input' of type * 'I' and of dimension 'dim' in the direction 'dir'. * @@ -86,12 +85,14 @@ namespace mln { template <typename F> void operator()(F& f) const; - } + }; - diagonal2d; + extern const diagonal2d_t diagonal2d; # ifndef MLN_INCLUDE_ONLY + const diagonal2d_t diagonal2d; + template <typename F> inline void @@ -116,10 +117,7 @@ namespace mln f.p = pmin; - trace::entering("canvas::browsing::diagonal2d::init"); f.init(); - trace::exiting("canvas::browsing::diagonal2d::init"); - while (f.input.domain().has(f.p)) { @@ -155,9 +153,7 @@ namespace mln f.p = start_diag + dp_second; } - trace::entering("canvas::browsing::diagonal2d::final"); f.final(); - trace::exiting("canvas::browsing::diagonal2d::final"); trace::exiting("canvas::browsing::diagonal2d"); } diff --git a/milena/mln/canvas/browsing/dir_struct_elt_incr_update.hh b/milena/mln/canvas/browsing/dir_struct_elt_incr_update.hh index 2ea522f..164c060 100644 --- a/milena/mln/canvas/browsing/dir_struct_elt_incr_update.hh +++ b/milena/mln/canvas/browsing/dir_struct_elt_incr_update.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_CANVAS_BROWSING_DIR_STRUCT_ELT_INCR_UPDATE_HH # define MLN_CANVAS_BROWSING_DIR_STRUCT_ELT_INCR_UPDATE_HH -/*! \file mln/canvas/browsing/dir_struct_elt_incr_update.hh - * - * \brief Directional browsing of an image with structuring element. - */ +/// \file mln/canvas/browsing/dir_struct_elt_incr_update.hh +/// +/// Directional browsing of an image with structuring element. # include <mln/core/concept/browsing.hh> # include <mln/core/concept/image.hh> @@ -44,10 +44,9 @@ namespace mln namespace browsing { - + + /// Browsing in a certain direction with a segment. /*! - * \brief Browsing in a certain direction with a segment. - * * This canvas browse all the point of an image 'input' of type * 'I', of dimension 'dim' in the direction 'dir' with * considering weigh the 'length' nearest points. @@ -90,12 +89,14 @@ namespace mln { template <typename F> void operator()(F& f) const; - } + }; - dir_struct_elt_incr_update; + extern const dir_struct_elt_incr_update_t dir_struct_elt_incr_update; # ifndef MLN_INCLUDE_ONLY + const dir_struct_elt_incr_update_t dir_struct_elt_incr_update; + template <typename F> inline void @@ -116,7 +117,7 @@ namespace mln pmax_dir_minus_half_length = pmax_dir - f.length / 2; mln_psite(I) pt, pu; - + typedef mln_coord(I)& coord_ref; coord_ref ct = pt[f.dir], @@ -124,41 +125,27 @@ namespace mln p_dir = f.p[f.dir]; f.p = pmin; - - trace::entering("canvas::browsing::dir_struct_elt_incr_update::init"); + f.init(); - trace::exiting("canvas::browsing::dir_struct_elt_incr_update::init"); - + do { pt = f.p; pu = f.p; - trace::entering("canvas::browsing::dir_struct_elt_incr_update::init_line"); f.init_line(); - trace::exiting("canvas::browsing::dir_struct_elt_incr_update::init_line"); // initialization (before first point of the line) for (ct = pmin_dir; ct < pmin_dir_plus_half_length; ++ ct) if (f.input.has(pt)) - { - trace::entering("canvas::browsing::dir_struct_elt_incr_update::add_point"); f.add_point(pt); - trace::exiting("canvas::browsing::dir_struct_elt_incr_update::add_point"); - } // left columns (just take new points) for (p_dir = pmin_dir; p_dir <= pmin_dir_plus_half_length; ++p_dir, ++ct) { if (f.input.has(pt)) - { - trace::entering("canvas::browsing::dir_struct_elt_incr_update::add_point"); f.add_point(pt); - trace::exiting("canvas::browsing::dir_struct_elt_incr_update::add_point"); - } - trace::entering("canvas::browsing::dir_struct_elt_incr_update::next"); f.next(); - trace::exiting("canvas::browsing::dir_struct_elt_incr_update::next"); } // middle columns (both take and untake) @@ -166,38 +153,22 @@ namespace mln for (; p_dir <= pmax_dir_minus_half_length; ++cu, ++p_dir, ++ct) { if (f.input.has(pt)) - { - trace::entering("canvas::browsing::dir_struct_elt_incr_update::add_point"); f.add_point(pt); - trace::exiting("canvas::browsing::dir_struct_elt_incr_update::add_point"); - } if (f.input.has(pu)) - { - trace::entering("canvas::browsing::dir_struct_elt_incr_update::remove_point"); f.remove_point(pu); - trace::exiting("canvas::browsing::dir_struct_elt_incr_update::remove_point"); - } - trace::entering("canvas::browsing::dir_struct_elt_incr_update::next"); f.next(); - trace::exiting("canvas::browsing::dir_struct_elt_incr_update::next"); } // right columns (now just untake old points) for (; p_dir <= pmax_dir; ++cu, ++p_dir) { if (f.input.has(pu)) - { - trace::entering("canvas::browsing::dir_struct_elt_incr_update::remove_point"); f.remove_point(pu); - trace::exiting("canvas::browsing::dir_struct_elt_incr_update::remove_point"); - } - trace::entering("canvas::browsing::dir_struct_elt_incr_update::next"); f.next(); - trace::exiting("canvas::browsing::dir_struct_elt_incr_update::next"); } p_dir = pmin_dir; - + for (int c = F::dim - 1; c >= 0; --c) { if (c == int(f.dir)) @@ -211,9 +182,7 @@ namespace mln } } while (f.p != pmin); - trace::entering("canvas::browsing::dir_struct_elt_incr_update::final"); f.final(); - trace::exiting("canvas::browsing::dir_struct_elt_incr_update::final"); trace::exiting("canvas::browsing::dir_struct_elt_incr_update"); } diff --git a/milena/mln/canvas/browsing/directional.hh b/milena/mln/canvas/browsing/directional.hh index adab4fc..c9f7b58 100644 --- a/milena/mln/canvas/browsing/directional.hh +++ b/milena/mln/canvas/browsing/directional.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_CANVAS_BROWSING_DIRECTIONAL_HH # define MLN_CANVAS_BROWSING_DIRECTIONAL_HH -/*! \file mln/canvas/browsing/directional.hh - * - * \brief Directional browsing of an image. - */ +/// \file mln/canvas/browsing/directional.hh +/// +/// Directional browsing of an image. # include <mln/core/concept/browsing.hh> # include <mln/core/concept/image.hh> @@ -45,9 +45,8 @@ namespace mln namespace browsing { + /// Browsing in a certain direction. /*! - * \brief Browsing in a certain direction. - * * This canvas browse all the point of an image 'input' of type * 'I' and of dimension 'dim' in the direction 'dir'. * @@ -94,17 +93,20 @@ namespace mln { template <typename F> void operator()(F& f) const; - } + }; - directional; + extern const directional_t directional; # ifndef MLN_INCLUDE_ONLY + const directional_t directional; + template <typename F> inline void directional_t::operator()(F& f) const { + trace::entering("canvas::browsing::directional"); mln_precondition(f.dir < f.dim); typedef typename F::I I; @@ -145,6 +147,7 @@ namespace mln } while (f.p != pmin); f.final(); + trace::exiting("canvas::browsing::directional"); } # endif // ! MLN_INCLUDE_ONLY diff --git a/milena/mln/canvas/browsing/essential.hh b/milena/mln/canvas/browsing/essential.hh index 58447c6..db94973 100644 --- a/milena/mln/canvas/browsing/essential.hh +++ b/milena/mln/canvas/browsing/essential.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 diff --git a/milena/mln/canvas/browsing/fwd.hh b/milena/mln/canvas/browsing/fwd.hh index d4b1602..79a07d5 100644 --- a/milena/mln/canvas/browsing/fwd.hh +++ b/milena/mln/canvas/browsing/fwd.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_CANVAS_BROWSING_FWD_HH # define MLN_CANVAS_BROWSING_FWD_HH -/*! \file mln/canvas/browsing/fwd.hh - * - * \brief Canvas for forward browsing. - */ +/// \file mln/canvas/browsing/fwd.hh +/// +/// Canvas for forward browsing. # include <mln/core/concept/browsing.hh> # include <mln/core/concept/image.hh> @@ -46,9 +46,8 @@ namespace mln namespace browsing { + /// Canvas for forward browsing /*! - * \brief Canvas for forward browsing - * * This canvas browse all the points of an image 'input' of type * 'I' from left to right and from top to bottom * @@ -77,13 +76,14 @@ namespace mln { template <typename F> void operator()(F& f) const; - } + }; - fwd; - + extern const fwd_t fwd; # ifndef MLN_INCLUDE_ONLY + const fwd_t fwd; + template <typename F> inline void diff --git a/milena/mln/canvas/browsing/hyper_directional.hh b/milena/mln/canvas/browsing/hyper_directional.hh index 00afd5e..beba7a1 100644 --- a/milena/mln/canvas/browsing/hyper_directional.hh +++ b/milena/mln/canvas/browsing/hyper_directional.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_CANVAS_BROWSING_HYPER_DIRECTIONAL_HH # define MLN_CANVAS_BROWSING_HYPER_DIRECTIONAL_HH -/*! \file mln/canvas/browsing/hyper_directional.hh - * - * \brief Hyper_Directional browsing of an image. - */ +/// \file mln/canvas/browsing/hyper_directional.hh +/// +/// Hyper_Directional browsing of an image. # include <mln/core/concept/browsing.hh> # include <mln/core/concept/image.hh> @@ -45,9 +45,8 @@ namespace mln namespace browsing { + /// Browsing in a certain direction. /*! - * \brief Browsing in a certain direction. - * * This canvas browse all the point of an image 'input' of type * 'I' and of dimension 'dim' in the direction 'dir'. * @@ -79,12 +78,14 @@ namespace mln { template <typename F> void operator()(F& f) const; - } + }; - hyper_directional; + extern const hyper_directional_t hyper_directional; # ifndef MLN_INCLUDE_ONLY + const hyper_directional_t hyper_directional; + template <typename F> inline void diff --git a/milena/mln/canvas/browsing/snake_fwd.hh b/milena/mln/canvas/browsing/snake_fwd.hh index 41e1bcd..52e39e9 100644 --- a/milena/mln/canvas/browsing/snake_fwd.hh +++ b/milena/mln/canvas/browsing/snake_fwd.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_CANVAS_BROWSING_SNAKE_FWD_HH # define MLN_CANVAS_BROWSING_SNAKE_FWD_HH -/*! \file mln/canvas/browsing/snake_fwd.hh - * - * \brief Browsing in a snake-way, forward. - */ +/// \file mln/canvas/browsing/snake_fwd.hh +/// +/// Browsing in a snake-way, forward. # include <mln/core/concept/browsing.hh> # include <mln/geom/size2d.hh> @@ -46,9 +46,8 @@ namespace mln namespace browsing { + /// Browsing in a snake-way, forward. /*! - * \brief Browsing in a snake-way, forward. - * * This canvas browse all the point of an image 'input' like * this : * @@ -88,14 +87,14 @@ namespace mln { template <typename F> void operator()(F& f) const; - } - - snake_fwd; - + }; + extern const snake_fwd_t snake_fwd; # ifndef MLN_INCLUDE_ONLY + const snake_fwd_t snake_fwd; + template <typename F> inline void @@ -116,36 +115,28 @@ namespace mln def::coord& col = f.p.col(); // initialization - trace::entering("canvas::browsing::snake_fwd::init"); f.init(); - trace::exiting("canvas::browsing::snake_fwd::init"); bool fwd = true; for (row = min_row; row <= max_row; ++row) // FIXME: Add "if (f.input.has(p))"? { // go down - trace::entering("canvas::browsing::snake_fwd::init"); f.down(); - trace::exiting("canvas::browsing::snake_fwd::init"); if (fwd) // browse line fwd while (col < max_col) { ++col; - trace::entering("canvas::browsing::snake_fwd::fwd"); f.fwd(); - trace::exiting("canvas::browsing::snake_fwd::fwd"); } else // browse line bkd while (col > min_col) { --col; - trace::entering("canvas::browsing::snake_fwd::bkd"); f.bkd(); - trace::exiting("canvas::browsing::snake_fwd::bkd"); } // change browsing diff --git a/milena/mln/canvas/browsing/snake_generic.hh b/milena/mln/canvas/browsing/snake_generic.hh index be275d9..540c2e4 100644 --- a/milena/mln/canvas/browsing/snake_generic.hh +++ b/milena/mln/canvas/browsing/snake_generic.hh @@ -45,9 +45,8 @@ namespace mln namespace browsing { + /// Multidimentional Browsing in a given-way. /*! - * \brief Multidimentional Browsing in a given-way. - * * F shall feature: \n * { \n * --- as attributes: \n @@ -80,14 +79,15 @@ namespace mln template <typename F> void operator()(F& f) const; - } - - snake_generic; + }; + extern const snake_generic_t snake_generic; # ifndef MLN_INCLUDE_ONLY + const snake_generic_t snake_generic; + template <typename F> inline void @@ -97,16 +97,14 @@ namespace mln mln_precondition(f.input.has_data()); // p init - f.p = f.input.bbox().pmin();// - f.dps[0]; + f.p = f.input.bbox().pmin();// - f.dps[0]; std::vector< int > directions(f.moves.size(), 0); unsigned deph = 0; unsigned total_deph = f.moves.size() / 2 + 1; // initialization - trace::entering("canvas::browsing::snake_generic::init"); f.init(); - trace::exiting("canvas::browsing::snake_generic::init"); bool first = true; directions[deph] = 1; @@ -124,7 +122,7 @@ namespace mln { // Go up the tree deph--; - if (deph >= 1) + if (deph >= 1) // Change directions directions[deph] = directions[deph] == 1 ? 0 : 1; continue; diff --git a/milena/mln/canvas/browsing/snake_vert.hh b/milena/mln/canvas/browsing/snake_vert.hh index bfa2df0..36b1ceb 100644 --- a/milena/mln/canvas/browsing/snake_vert.hh +++ b/milena/mln/canvas/browsing/snake_vert.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_CANVAS_BROWSING_SNAKE_VERT_HH # define MLN_CANVAS_BROWSING_SNAKE_VERT_HH -/*! \file mln/canvas/browsing/snake_vert.hh - * - * \brief Browsing in a snake-way, forward. - */ +/// \file mln/canvas/browsing/snake_vert.hh +/// +/// Browsing in a snake-way, forward. # include <mln/core/concept/browsing.hh> # include <mln/geom/size2d.hh> @@ -46,9 +46,8 @@ namespace mln namespace browsing { + /// Browsing in a snake-way, forward. /*! - * \brief Browsing in a snake-way, forward. - * * This canvas browse all the point of an image 'input' like * this : * @@ -88,22 +87,22 @@ namespace mln { template <typename F> void operator()(F& f) const; - } - - snake_vert; - + }; + extern const snake_vert_t snake_vert; # ifndef MLN_INCLUDE_ONLY + const snake_vert_t snake_vert; + template <typename F> inline void snake_vert_t::operator()(F& f) const { // Fixme: check the dimension of the input -// mlc_equal(mln_trait_image_dimension(I)(), -// trait::image::dimension::two_d)::check(); +// mlc_equal(mln_trait_image_dimension(I)(), +// trait::image::dimension::two_d)::check(); trace::entering("canvas::browsing::snake_vert"); mln_precondition(f.input.has_data()); int @@ -116,36 +115,28 @@ namespace mln def::coord& col = f.p.col(); // initialization - trace::entering("canvas::browsing::snake_vert::init"); f.init(); - trace::exiting("canvas::browsing::snake_vert::init"); bool down = true; for (col = min_col; col <= max_col; ++col) // FIXME: Add "if (f.input.has(p))"? { // go fwd - trace::entering("canvas::browsing::snake_vert::init"); f.fwd(); - trace::exiting("canvas::browsing::snake_vert::init"); if (down) // browse col down. while (row < max_row) { ++row; - trace::entering("canvas::browsing::snake_vert::down"); f.down(); - trace::exiting("canvas::browsing::snake_vert::down"); } else // browse col up. while (row > min_row) { --row; - trace::entering("canvas::browsing::snake_vert::up"); f.up(); - trace::exiting("canvas::browsing::snake_vert::up"); } // change browsing diff --git a/milena/mln/core/contract.hh b/milena/mln/core/contract.hh index 5d03057..58e71cc 100644 --- a/milena/mln/core/contract.hh +++ b/milena/mln/core/contract.hh @@ -67,6 +67,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY + inline bool implies(bool lexpr, bool rexpr) { return ! (rexpr) || (lexpr); diff --git a/milena/mln/display/save.hh b/milena/mln/display/save.hh index 88b09f2..addd6b7 100644 --- a/milena/mln/display/save.hh +++ b/milena/mln/display/save.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,11 +29,10 @@ #ifndef MLN_DISPLAY_SAVE_HH # define MLN_DISPLAY_SAVE_HH -/*! \file mln/display/save.hh - * - * \brief Definition of function which saves an image on a temporary - * files. - */ +/// \file mln/display/save.hh +/// +/// Definition of function which saves an image on a temporary +/// files. # include <mln/trait/image_from_grid.hh> # include <mln/core/image/image_if.hh> @@ -49,23 +49,21 @@ namespace mln namespace display { - /*! Map which stocks the location of the saved file by the id of - * the image. - * - */ - std::map<void*, std::string> map_saved_image_tmp_; + /// Map which stocks the location of the saved file by the id of + /// the image. + extern std::map<void*, std::string> map_saved_image_tmp_; - /*! Save an image in a temporary file in ppm format. - * - * \param[in] input_ the image to save. - * - */ + /// Save an image in a temporary file in ppm format. + /// + /// \param[in] input_ the image to save. template <typename I> void save(const Image<I>& input_); # ifndef MLN_INCLUDE_ONLY + std::map<void*, std::string> map_saved_image_tmp_; + namespace impl { template <typename I> diff --git a/milena/mln/estim/all.hh b/milena/mln/estim/all.hh index 95649b8..4d35d3f 100644 --- a/milena/mln/estim/all.hh +++ b/milena/mln/estim/all.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_ESTIM_ALL_HH # define MLN_ESTIM_ALL_HH -/*! \file mln/estim/all.hh - * - * \brief File that includes all estimation materials. - */ +/// \file mln/estim/all.hh +/// +/// File that includes all estimation materials. namespace mln diff --git a/milena/mln/estim/essential.hh b/milena/mln/estim/essential.hh index 4afe74d..3d807ad 100644 --- a/milena/mln/estim/essential.hh +++ b/milena/mln/estim/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,10 +28,9 @@ #ifndef MLN_ESTIM_ESSENTIAL_HH # define MLN_ESTIM_ESSENTIAL_HH -/*! \file mln/estim/essential.hh - * - * \brief File that includes essential estimation materials. - */ +/// \file mln/estim/essential.hh +/// +/// File that includes essential estimation materials. # include <mln/estim/all.hh> diff --git a/milena/mln/estim/mean.hh b/milena/mln/estim/mean.hh index 0c6fbdb..25457f8 100644 --- a/milena/mln/estim/mean.hh +++ b/milena/mln/estim/mean.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_ESTIM_MEAN_HH # define MLN_ESTIM_MEAN_HH -/*! \file mln/estim/mean.hh - * - * \brief Compute the mean pixel value. - */ +/// \file mln/estim/mean.hh +/// +/// Compute the mean pixel value. # include <mln/accu/mean.hh> # include <mln/level/compute.hh> @@ -43,8 +43,8 @@ namespace mln namespace estim { - /*! \brief Compute the mean value of the pixels of image \p input. - * + /// Compute the mean value of the pixels of image \p input. + /*! * \param[in] input The image. * \return The mean value. */ @@ -52,8 +52,8 @@ namespace mln mln_sum(mln_value(I)) mean(const Image<I>& input); - /*! \brief Compute the mean value of the pixels of image \p input. - * + /// Compute the mean value of the pixels of image \p input. + /*! * \param[in] input The image. * \param[out] result The mean value. * diff --git a/milena/mln/estim/min_max.hh b/milena/mln/estim/min_max.hh index 64e6958..14e1581 100644 --- a/milena/mln/estim/min_max.hh +++ b/milena/mln/estim/min_max.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_ESTIM_MIN_MAX_HH # define MLN_ESTIM_MIN_MAX_HH -/*! \file mln/estim/min_max.hh - * - * \brief Compute the min and max pixel values of an image. - * - * \todo Overload while returning an std::pair. - */ +/// \file mln/estim/min_max.hh +/// +/// Compute the min and max pixel values of an image. +/// +/// \todo Overload while returning an std::pair. # include <mln/accu/min_max.hh> # include <mln/level/compute.hh> @@ -45,8 +45,8 @@ namespace mln namespace estim { - /*! \brief Compute the min and max values of the pixels of image \p input. - * + /// Compute the min and max values of the pixels of image \p input. + /*! * \param[in] input The image. * \param[out] min The minimum pixel value of \p input. * \param[out] max The maximum pixel value of \p input. diff --git a/milena/mln/estim/sum.hh b/milena/mln/estim/sum.hh index 2defc4f..1df276d 100644 --- a/milena/mln/estim/sum.hh +++ b/milena/mln/estim/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,12 +29,11 @@ #ifndef MLN_ESTIM_SUM_HH # define MLN_ESTIM_SUM_HH -/*! \file mln/estim/sum.hh - * - * \brief Compute the sum pixel value. - * - * \todo Sum works on level so move into mln/level; otherwise on pix then ambiguous. - */ +/// \file mln/estim/sum.hh +/// +/// Compute the sum pixel value. +/// +/// \todo Sum works on level so move into mln/level; otherwise on pix then ambiguous. # include <mln/accu/sum.hh> # include <mln/level/compute.hh> @@ -45,8 +45,8 @@ namespace mln namespace estim { - /*! \brief Compute the sum value of the pixels of image \p input. - * + /// Compute the sum value of the pixels of image \p input. + /*! * \param[in] input The image. * \return The sum value. */ @@ -54,8 +54,8 @@ namespace mln mln_sum(mln_value(I)) sum(const Image<I>& input); - /*! \brief Compute the sum value of the pixels of image \p input. - * + /// Compute the sum value of the pixels of image \p input. + /*! * \param[in] input The image. * \param[out] result The sum value. */ diff --git a/milena/mln/fun/p2b/chess.hh b/milena/mln/fun/p2b/chess.hh index 163b566..2f73cf9 100644 --- a/milena/mln/fun/p2b/chess.hh +++ b/milena/mln/fun/p2b/chess.hh @@ -48,20 +48,18 @@ namespace mln // FIXME: Doc! - struct chess_t : public Function_p2b< chess_t > + struct chess : public Function_p2b< chess > { typedef bool result; bool operator()(const point2d& p) const; - } - - chess; + }; # ifndef MLN_INCLUDE_ONLY inline bool - chess_t::operator()(const point2d& p) const + chess::operator()(const point2d& p) const { return (p.row() + p.col()) % 2 == 0; } diff --git a/milena/mln/fun/p2v/iota.hh b/milena/mln/fun/p2v/iota.hh index ef58e90..233caa8 100644 --- a/milena/mln/fun/p2v/iota.hh +++ b/milena/mln/fun/p2v/iota.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_FUN_P2V_IOTA_HH # define MLN_FUN_P2V_IOTA_HH -/*! \file mln/fun/p2v/iota.hh - * - * \brief Iota function. - */ +/// \file mln/fun/p2v/iota.hh +/// +/// Iota function. # include <mln/core/concept/function.hh> @@ -45,11 +45,11 @@ namespace mln namespace p2v { - struct iota_t : public Function_p2v< iota_t > + struct iota : public Function_p2v< iota > { typedef unsigned result; - iota_t(); + iota(); template <typename P> unsigned operator()(const P&) const; @@ -59,15 +59,13 @@ namespace mln protected: mutable unsigned i_; - } - - iota; + }; # ifndef MLN_INCLUDE_ONLY inline - iota_t::iota_t() + iota::iota() { reset(); } @@ -75,21 +73,21 @@ namespace mln template <typename P> inline unsigned - iota_t::operator()(const P&) const + iota::operator()(const P&) const { return ++i_; } inline unsigned - iota_t::value() const + iota::value() const { return i_; } inline void - iota_t::reset() const + iota::reset() const { i_ = 0; } diff --git a/milena/mln/fun/v2v/rgb_to_hsi.hh b/milena/mln/fun/v2v/rgb_to_hsi.hh index 79d26fb..bf9bd5d 100644 --- a/milena/mln/fun/v2v/rgb_to_hsi.hh +++ b/milena/mln/fun/v2v/rgb_to_hsi.hh @@ -36,8 +36,6 @@ #include <mln/value/hsi.hh> -// FIXME: Split interface and implementation. - namespace mln { @@ -54,40 +52,13 @@ namespace mln typedef T_hsi result; template <typename T_rgb> - T_hsi operator()(const T_rgb& rgb) const - { - // Locals. - static const double sqrt3_3 = std::sqrt(3) / 3; - static const double inv_sqrt6 = 1 / std::sqrt(6); - static const double inv_sqrt2 = 1 / std::sqrt(2); - - T_hsi hsi; - - double alpha = inv_sqrt2 * rgb.green() - inv_sqrt2 * rgb.blue(); - double beta = - 2 * inv_sqrt6 * rgb.red() - - inv_sqrt6 * rgb.green() - - inv_sqrt6 * rgb.blue(); - - - hsi.hue() = atan2(beta, alpha) / 3.1415 * 180.0; - if (hsi.hue() < 0) - hsi.hue() = hsi.hue() + 360.0; - mln_invariant(hsi.hue() >= 0); - hsi.sat() = std::sqrt(alpha * alpha + beta * beta); - hsi.inty() = - sqrt3_3 * rgb.red() + - sqrt3_3 * rgb.green() + - sqrt3_3 * rgb.blue(); - - return hsi; - } + T_hsi operator()(const T_rgb& rgb) const; + }; typedef f_rgb_to_hsi_<value::hsi_f> f_rgb_to_hsi_f_t; - // FIXME: Warning: global object. - f_rgb_to_hsi_f_t f_rgb_to_hsi_f; + extern f_rgb_to_hsi_f_t f_rgb_to_hsi_f; template <typename T_rgb> @@ -96,43 +67,96 @@ namespace mln typedef T_rgb result; template <typename T_hsi> - T_rgb operator()(const T_hsi& hsi) const - { - typedef typename T_rgb::red_t red_t; - typedef typename T_rgb::green_t green_t; - typedef typename T_rgb::blue_t blue_t; - - static math::round<red_t> to_r; - static math::round<green_t> to_g; - static math::round<blue_t> to_b; - - static const float - sqrt3_3 = std::sqrt(3) / 3, - inv_sqrt6 = 1 / std::sqrt(6), - inv_sqrt2 = 1 / std::sqrt(2); - - float - h = hsi.hue() / 180.0 * 3.1415, - alpha = hsi.sat() * std::cos(h), - beta = hsi.sat() * std::sin(h); + T_rgb operator()(const T_hsi& hsi) const; + }; - red_t r = to_r(sqrt3_3 * hsi.inty() + 2 * inv_sqrt6 * beta); - green_t g = - to_g(sqrt3_3 * hsi.inty() + inv_sqrt2 * alpha - inv_sqrt6 * beta); - blue_t b = - to_b(sqrt3_3 * hsi.inty() - inv_sqrt2 * alpha - inv_sqrt6 * beta); + typedef f_hsi_to_rgb_<value::rgb8> f_hsi_to_rgb_3x8_t; - T_rgb rgb(r, g, b); + extern f_hsi_to_rgb_3x8_t f_hsi_to_rgb_3x8; - return rgb; - } - }; - typedef f_hsi_to_rgb_<value::rgb8> f_hsi_to_rgb_3x8_t; +# ifndef MLN_INCLUDE_ONLY + + /// Global variables. + /// \{ + f_rgb_to_hsi_f_t f_rgb_to_hsi_f; - // FIXME: Warning: global object. f_hsi_to_rgb_3x8_t f_hsi_to_rgb_3x8; + /// \} + + + template <typename T_hsi> + template <typename T_rgb> + inline + T_hsi + f_rgb_to_hsi_<T_hsi>::operator()(const T_rgb& rgb) const + { + // Locals. + static const double sqrt3_3 = std::sqrt(3) / 3; + static const double inv_sqrt6 = 1 / std::sqrt(6); + static const double inv_sqrt2 = 1 / std::sqrt(2); + + T_hsi hsi; + + double alpha = inv_sqrt2 * rgb.green() - inv_sqrt2 * rgb.blue(); + double beta = + 2 * inv_sqrt6 * rgb.red() - + inv_sqrt6 * rgb.green() - + inv_sqrt6 * rgb.blue(); + + + hsi.hue() = atan2(beta, alpha) / 3.1415 * 180.0; + if (hsi.hue() < 0) + hsi.hue() = hsi.hue() + 360.0; + mln_invariant(hsi.hue() >= 0); + hsi.sat() = std::sqrt(alpha * alpha + beta * beta); + hsi.inty() = + sqrt3_3 * rgb.red() + + sqrt3_3 * rgb.green() + + sqrt3_3 * rgb.blue(); + + return hsi; + } + + + template <typename T_rgb> + template <typename T_hsi> + inline + T_rgb + f_hsi_to_rgb_<T_rgb>::operator()(const T_hsi& hsi) const + { + typedef typename T_rgb::red_t red_t; + typedef typename T_rgb::green_t green_t; + typedef typename T_rgb::blue_t blue_t; + + static math::round<red_t> to_r; + static math::round<green_t> to_g; + static math::round<blue_t> to_b; + + static const float + sqrt3_3 = std::sqrt(3) / 3, + inv_sqrt6 = 1 / std::sqrt(6), + inv_sqrt2 = 1 / std::sqrt(2); + + float + h = hsi.hue() / 180.0 * 3.1415, + alpha = hsi.sat() * std::cos(h), + beta = hsi.sat() * std::sin(h); + + + red_t r = to_r(sqrt3_3 * hsi.inty() + 2 * inv_sqrt6 * beta); + green_t g = + to_g(sqrt3_3 * hsi.inty() + inv_sqrt2 * alpha - inv_sqrt6 * beta); + blue_t b = + to_b(sqrt3_3 * hsi.inty() - inv_sqrt2 * alpha - inv_sqrt6 * beta); + + T_rgb rgb(r, g, b); + + return rgb; + } + +# endif // !MLN_INCLUDE_ONLY } // end of namespace fun::v2v diff --git a/milena/mln/geom/chamfer.hh b/milena/mln/geom/chamfer.hh index 934e50a..df3b515 100644 --- a/milena/mln/geom/chamfer.hh +++ b/milena/mln/geom/chamfer.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_GEOM_CHAMFER_HH # define MLN_GEOM_CHAMFER_HH -/*! \file mln/geom/chamfer.hh - * - * \brief Connected component chamfer of the image objects. - */ +/// \file mln/geom/chamfer.hh +/// +/// Connected component chamfer of the image objects. # include <mln/level/fill.hh> # include <mln/core/alias/w_window2d_int.hh> @@ -53,7 +53,7 @@ namespace mln /// Apply chamfer algorithm to a binary image. template <typename I, typename W> - mln_ch_value( I, unsigned ) + mln_ch_value(I, unsigned) chamfer(const Image<I>& input_, const W& w_win_, unsigned max = mln_max(unsigned)); @@ -131,9 +131,6 @@ namespace mln } // end of namespace mln::geom::impl -#endif // !MLN_INCLUDE_ONLY - - // Facade. template <typename I, typename W> @@ -141,9 +138,10 @@ namespace mln chamfer(const Image<I>& input_, const W& w_win_, unsigned max = mln_max(unsigned)) { - return impl::chamfer_(exact (input_), exact(w_win_), max); + return impl::chamfer_t<I, W>(exact (input_), exact(w_win_), max); } +#endif // !MLN_INCLUDE_ONLY } // end of namespace mln::geom diff --git a/milena/mln/level/compute.hh b/milena/mln/level/compute.hh index ef7c25a..83ea8ec 100644 --- a/milena/mln/level/compute.hh +++ b/milena/mln/level/compute.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_LEVEL_COMPUTE_HH # define MLN_LEVEL_COMPUTE_HH -/*! \file mln/level/compute.hh - * - * \brief Compute an accumulator onto image pixel values. - */ +/// \file mln/level/compute.hh +/// +/// Compute an accumulator onto image pixel values. # include <mln/level/update.hh> # include <mln/core/concept/meta_accumulator.hh> @@ -44,8 +44,8 @@ namespace mln namespace level { - /*! Compute an accumulator onto the pixel values of the image \p input. - * + /// Compute an accumulator onto the pixel values of the image \p input. + /*! * \param[in] a An accumulator. * \param[in] input The input image. * \return The accumulator result. @@ -57,8 +57,8 @@ namespace mln compute(const Accumulator<A>& a, const Image<I>& input); - /*! Compute an accumulator onto the pixel values of the image \p input. - * + /// Compute an accumulator onto the pixel values of the image \p input. + /*! * \param[in] a A meta-accumulator. * \param[in] input The input image. * \return The accumulator result. @@ -97,7 +97,7 @@ namespace mln compute(const Meta_Accumulator<A>&, const Image<I>& input) { mln_accu_with(A, mln_value(I)) accu; - return compute(accu, input); // Call the previous version. + return level::compute(accu, input); // Call the previous version. } # endif // ! MLN_INCLUDE_ONLY diff --git a/milena/mln/level/median.hh b/milena/mln/level/median.hh index 6d847f8..e224964 100644 --- a/milena/mln/level/median.hh +++ b/milena/mln/level/median.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_LEVEL_MEDIAN_HH # define MLN_LEVEL_MEDIAN_HH -/*! \file mln/level/median.hh - * - * \brief Median filtering of an image. - * - * \todo Add versions for fastest and semi-linear images. - */ +/// \file mln/level/median.hh +/// +/// Median filtering of an image. +/// +/// \todo Add versions for fastest and semi-linear images. # include <mln/core/concept/image.hh> # include <mln/core/window.hh> diff --git a/milena/mln/make/win_chamfer.hh b/milena/mln/make/win_chamfer.hh index 9ba3791..a28d145 100644 --- a/milena/mln/make/win_chamfer.hh +++ b/milena/mln/make/win_chamfer.hh @@ -1,4 +1,4 @@ -// Copyright (C) 2006 EPITA Research and Development Laboratory +// Copyright (C) 2006, 2008 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 @@ -29,12 +29,9 @@ #ifndef MLN_MAKE_WIN_CHAMFER_HH # define MLN_MAKE_WIN_CHAMFER_HH\ -/*! - * \file mln/make/win_chamfer.hh - * - * \brief Routine to create chamfer mln::w_window2d_int. - * - */ +/// \file mln/make/win_chamfer.hh +/// +/// Routine to create chamfer mln::w_window2d_int. # include <mln/core/alias/w_window2d_int.hh> @@ -48,6 +45,33 @@ namespace mln { template<int d10, int d11> + const mln::w_window2d_int mk_chamfer_3x3_int(); + + template<int d10, int d11, int d21> + const mln::w_window2d_int mk_chamfer_5x5_int(); + + const mln::w_window2d_float mk_chamfer_3x3_float(float d10, float d11); + + const mln::w_window2d_float + mk_chamfer_5x5_float(float d10, float d11, float d21); + + const mln::w_window2d_float mk_chamfer_exact(); + + } // end of namespace mln::make + +} // end of namespace mln + + +# ifndef MLN_INCLUDE_ONLY + +namespace mln +{ + + namespace make + { + + template<int d10, int d11> + inline const mln::w_window2d_int mk_chamfer_3x3_int() { @@ -59,6 +83,7 @@ namespace mln } template<int d10, int d11, int d21> + inline const mln::w_window2d_int mk_chamfer_5x5_int() { @@ -71,6 +96,7 @@ namespace mln return (make::w_window2d(ws)); } + inline const mln::w_window2d_float mk_chamfer_3x3_float(float d10, float d11) { @@ -81,6 +107,7 @@ namespace mln return (make::w_window2d(ws)); } + inline const mln::w_window2d_float mk_chamfer_5x5_float(float d10, float d11, float d21) { @@ -93,6 +120,7 @@ namespace mln return (make::w_window2d(ws)); } + inline const mln::w_window2d_float mk_chamfer_exact() { @@ -108,4 +136,6 @@ namespace mln } // end of namespace mln +# endif // !MLN_INCLUDE_ONLY + #endif // ! MLN_MAKE_WIN_CHAMFER_HH diff --git a/milena/mln/morpho/dilation_fast.hh b/milena/mln/morpho/dilation_fast.hh index e977253..482ca94 100644 --- a/milena/mln/morpho/dilation_fast.hh +++ b/milena/mln/morpho/dilation_fast.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_MORPHO_DILATION_FAST_HH # define MLN_MORPHO_DILATION_FAST_HH -/*! \file mln/morpho/dilation_fast.hh - * - * \brief Dilation filtering of an image with arbitrary s.e. - * - * \todo Add fastest versions. - */ +/// \file mln/morpho/dilation_fast.hh +/// +/// Dilation filtering of an image with arbitrary s.e. +/// +/// \todo Add fastest versions. # include <mln/core/concept/image.hh> # include <mln/core/window.hh> @@ -52,9 +52,9 @@ namespace mln namespace morpho { - /*! Compute in \p output the dilation filter of image \p input by - * the window \p win. - * + /// Compute in \p output the dilation filter of image \p input by + /// the window \p win. + /*! * \param[in] input The image to be filtered. * \param[in] win The window. * \param[out] output The output image. @@ -79,7 +79,7 @@ namespace mln template <typename I, typename W, typename O> struct dilation_fast_t - { + { typedef mln_psite(I) P; typedef mln_dpsite(I) D; @@ -186,7 +186,7 @@ namespace mln Image<O>& output) { mln_assertion(exact(output).domain() == exact(input).domain()); - impl::dilation_fast_(exact(input), exact(win), exact(output)); + impl::dilation_fast_(exact(input), exact(win), exact(output)); } # endif // ! MLN_INCLUDE_ONLY diff --git a/milena/mln/morpho/hit_or_miss.hh b/milena/mln/morpho/hit_or_miss.hh index 3d0bf29..38bb1d5 100644 --- a/milena/mln/morpho/hit_or_miss.hh +++ b/milena/mln/morpho/hit_or_miss.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_MORPHO_HIT_OR_MISS_HH # define MLN_MORPHO_HIT_OR_MISS_HH -/*! \file mln/morpho/hit_or_miss.hh - * - * \brief Morphological hit-or-miss. - * - * \todo Save memory. - */ +/// \file mln/morpho/hit_or_miss.hh +/// +/// Morphological hit-or-miss. +/// +/// \todo Save memory. # include <mln/morpho/includes.hh> # include <mln/pw/all.hh> @@ -49,12 +49,12 @@ namespace mln { - bool constrained_hit_or_miss = true; + extern bool constrained_hit_or_miss; - /*! Morphological hit-or-miss. - * - * This operator is HMT_(Bh,Bm) = e_Bh /\ (e_Bm o C). + /// Morphological hit-or-miss. + /*! + * This operator is HMT_(Bh,Bm) = e_Bh /\ (e_Bm o C). */ template <typename I, typename Wh, typename Wm> mln_concrete(I) @@ -62,8 +62,8 @@ namespace mln const Window<Wh>& win_hit, const Window<Wm>& win_miss); - /*! Morphological hit-or-miss opening. - * + /// Morphological hit-or-miss opening. + /*! * This operator is HMTope_(Bh,Bm) = d_(-Bh) o HMT_(Bh,Bm). */ template <typename I, typename Wh, typename Wm> @@ -72,8 +72,8 @@ namespace mln const Window<Wh>& win_hit, const Window<Wm>& win_miss); - /*! Morphological hit-or-miss opening of the background. - * + /// Morphological hit-or-miss opening of the background. + /*! * This operator is HMTopeBG = HMTope_(Bm,Bh) o C = d_(-Bm) o HMT_(Bh,Bm). */ template <typename I, typename Wh, typename Wm> @@ -82,8 +82,8 @@ namespace mln const Window<Wh>& win_hit, const Window<Wm>& win_miss); - /*! Morphological hit-or-miss closing. - * + /// Morphological hit-or-miss closing. + /*! * This operator is C o HMTope o C. */ template <typename I, typename Wh, typename Wm> @@ -92,8 +92,8 @@ namespace mln const Window<Wh>& win_hit, const Window<Wm>& win_miss); - /*! Morphological hit-or-miss closing of the background. - * + /// Morphological hit-or-miss closing of the background. + /*! * This operator is C o HMTopeBG o C. */ template <typename I, typename Wh, typename Wm> @@ -105,6 +105,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY + bool constrained_hit_or_miss = true; namespace internal { diff --git a/milena/mln/trait/image/print.hh b/milena/mln/trait/image/print.hh index 16d8de4..baef596 100644 --- a/milena/mln/trait/image/print.hh +++ b/milena/mln/trait/image/print.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_TRAIT_IMAGE_PRINT_HH # define MLN_TRAIT_IMAGE_PRINT_HH -/*! \file mln/trait/image/print.hh - * - * \brief Print the collection of traits for an image type. - */ +/// \file mln/trait/image/print.hh +/// +/// Print the collection of traits for an image type. # include <iostream> # include <mln/trait/images.hh> diff --git a/milena/mln/trait/op/ord.hh b/milena/mln/trait/op/ord.hh index 0a4fa11..c1b49ee 100644 --- a/milena/mln/trait/op/ord.hh +++ b/milena/mln/trait/op/ord.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,10 +28,9 @@ #ifndef MLN_TRAIT_OP_ORD_HH # define MLN_TRAIT_OP_ORD_HH -/*! \file mln/trait/op/ord.hh - * - * \brief Declaration of an ordering operator trait. - */ +/// \file mln/trait/op/ord.hh +/// +/// Declaration of an ordering operator trait. # include <mln/trait/op/decl.hh> @@ -62,7 +61,6 @@ namespace mln }; } // end of namespace mln::trait::op - template <template <class> class Category, typename T> @@ -77,14 +75,14 @@ namespace mln namespace internal { - + template <typename T> struct ord_less { bool strict(const T& lhs, const T& rhs) const; bool weak(const T& lhs, const T& rhs) const; }; - + template <typename T> struct ord_vec { diff --git a/milena/mln/value/float01.hh b/milena/mln/value/float01.hh index 3bb78ab..f5348b0 100644 --- a/milena/mln/value/float01.hh +++ b/milena/mln/value/float01.hh @@ -1,4 +1,5 @@ -// Copyright (C) 2006, 2007 EPITA Research and Development Laboratory +// Copyright (C) 2006, 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_VALUE_FLOAT01_HH # define MLN_VALUE_FLOAT01_HH -/*! \file mln/value/float01.hh - * - * \brief Define a generic class for float. - */ +/// \file mln/value/float01.hh +/// +/// Define a generic class for float. # include <iostream> # include <utility> @@ -151,7 +151,7 @@ namespace mln // Float01. - + inline float01::float01() : nbits_(0) // FIXME: Cost at run-time... { diff --git a/milena/tests/Makefile.am b/milena/tests/Makefile.am index d311f76..b60fcd8 100644 --- a/milena/tests/Makefile.am +++ b/milena/tests/Makefile.am @@ -47,9 +47,11 @@ SUBDIRS = \ check_PROGRAMS = \ all_headers \ - essential_headers + essential_headers \ + global_vars all_headers_SOURCES = all_headers.cc essential_headers_SOURCES = essential_headers.cc +global_vars_SOURCES = global_vars1.cc global_vars2.cc TESTS = $(check_PROGRAMS) diff --git a/milena/tests/border/find_full.cc b/milena/tests/border/find_full.cc index 890a005..74f8df5 100644 --- a/milena/tests/border/find_full.cc +++ b/milena/tests/border/find_full.cc @@ -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 @@ -25,10 +26,9 @@ // reasons why the executable file might be covered by the GNU General // Public License. -/*! \file tests/border/find_full.cc - * - * \brief Tests on mln::border::find. - */ +/// \file tests/border/find_full.cc +/// +/// Tests on mln::border::find. #include <mln/core/image/image1d.hh> #include <mln/core/image/image2d.hh> @@ -98,7 +98,7 @@ int main() f_box1d_t f_b1(b1); f_box2d_t f_b2(b2); f_box3d_t f_b3(b3); - mln::fun::p2b::chess_t c_b; + mln::fun::p2b::chess c_b; { typedef image1d<int> I; @@ -129,7 +129,7 @@ int main() image_if<I, f_box2d_t > imaif(ima, f_b2); mln_assertion(border::find(imaif) == 42); - image_if<I, fun::p2b::chess_t > imaif_chess(ima, c_b); + image_if<I, fun::p2b::chess > imaif_chess(ima, c_b); mln_assertion(border::find(imaif_chess) == 42); diff --git a/milena/tests/border/get.cc b/milena/tests/border/get.cc index df9fae2..88d552a 100644 --- a/milena/tests/border/get.cc +++ b/milena/tests/border/get.cc @@ -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 @@ -25,10 +26,9 @@ // reasons why the executable file might be covered by the GNU General // Public License. -/*! \file tests/border/get.cc - * - * \brief Tests on mln::border::get. - */ +/// \file tests/border/get.cc +/// +/// Tests on mln::border::get. #include <mln/core/image/image2d.hh> #include <mln/core/image/sub_image.hh> @@ -75,7 +75,7 @@ int main() image_if<I, f_box2d_t> imaif(ima, f_b); mln_assertion( imaif.has (point2d(2,2)) == false && - imaif.has(point2d(2,2)) == true ); + ima.has(point2d(2,2)) == true ); mln_assertion(border::get(imaif) == 51); mln_assertion(border::get( (ima | b) | f_b ) == 0); diff --git a/milena/tests/border/get_full.cc b/milena/tests/border/get_full.cc index b67f25e..ef68eeb 100644 --- a/milena/tests/border/get_full.cc +++ b/milena/tests/border/get_full.cc @@ -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 @@ -25,10 +26,9 @@ // reasons why the executable file might be covered by the GNU General // Public License. -/*! \file tests/border/get_full.cc - * - * \brief Tests on mln::border::get. - */ +/// \file tests/border/get_full.cc +/// +/// Tests on mln::border::get. #include <mln/core/image/image2d.hh> #include <mln/core/image/sub_image.hh> @@ -62,7 +62,7 @@ int main() box2d b(literal::origin, point2d(1,1)); f_box2d_t f_b(b); - mln::fun::p2b::chess_t c_b; + mln::fun::p2b::chess c_b; { typedef image2d<int> I; @@ -90,7 +90,7 @@ int main() sub_image<I, box2d> sub(ima, b); mln_assertion(border::get(sub) == 0); - image_if<I, mln::fun::p2b::chess_t > imaif(ima, c_b); + image_if<I, mln::fun::p2b::chess > imaif(ima, c_b); mln_assertion(border::get(imaif) == 42); mln_assertion(border::get( (ima | b) ) == 0); mln_assertion(border::get( (ima | b) | c_b ) == 0); @@ -106,7 +106,7 @@ int main() sub_image<I, box2d> sub(ima, b); mln_assertion(border::get(sub) == 0); - image_if<I, mln::fun::p2b::chess_t > imaif(ima, c_b); + image_if<I, mln::fun::p2b::chess > imaif(ima, c_b); mln_assertion(border::get(imaif) == 36); mln_assertion(border::get( (ima | b) ) == 0); mln_assertion(border::get( (ima | b) | c_b ) == 0); diff --git a/milena/tests/border/resize_image_if.cc b/milena/tests/border/resize_image_if.cc index 7ca70a7..5b738d3 100644 --- a/milena/tests/border/resize_image_if.cc +++ b/milena/tests/border/resize_image_if.cc @@ -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 @@ -25,10 +26,9 @@ // reasons why the executable file might be covered by the GNU General // Public License. -/*! \file tests/border/resize_image_if.cc - * - * \brief Tests on mln::border::resize. - */ +/// \file tests/border/resize_image_if.cc +/// +/// Tests on mln::border::resize. #include <mln/core/image/image2d.hh> #include <mln/core/image/sub_image.hh> @@ -70,8 +70,8 @@ int main() my_box2d f_b(b); image_if<I, my_box2d> imaif(ima, f_b); - mln_assertion( imaif.has (point2d(2,2)) == false && - imaif.has(point2d(2,2)) == true ); + mln_assertion( imaif.has(point2d(2,2)) == false && + ima.has(point2d(2,2)) == true ); mln_assertion(border::get(imaif) == border); diff --git a/milena/tests/convert/to_image.cc b/milena/tests/convert/to_image.cc index 4d21afd..7517c36 100644 --- a/milena/tests/convert/to_image.cc +++ b/milena/tests/convert/to_image.cc @@ -53,7 +53,7 @@ int main() 0, 1, 0, // < center point 1, 0, 1 }; - image2d<bool> ima_X = convert::to_image(box_3x3 | fun::p2b::chess, 0); + image2d<bool> ima_X = convert::to_image(box_3x3 | fun::p2b::chess(), 0); window2d win_X = convert::to<window2d>(X); mln_assertion(convert::to_image(win_X) == ima_X); } diff --git a/milena/tests/core/image/cast_image.cc b/milena/tests/core/image/cast_image.cc index afce74f..6090492 100644 --- a/milena/tests/core/image/cast_image.cc +++ b/milena/tests/core/image/cast_image.cc @@ -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 @@ -25,10 +26,9 @@ // reasons why the executable file might be covered by the GNU General // Public License. -/*! \file tests/core/image/cast_image.cc - * - * \brief Tests on mln::cast_image. - */ +/// \file tests/core/image/cast_image.cc +/// +/// Tests on mln::cast_image. #include <mln/core/image/image2d.hh> #include <mln/fun/p2b/chess.hh> @@ -42,7 +42,7 @@ int main() using namespace mln; image2d<bool> ima(8, 8); - level::fill(ima, fun::p2b::chess); + level::fill(ima, fun::p2b::chess()); debug::println(ima); debug::println( cast_image<int>(ima) ); } diff --git a/milena/tests/core/image/image_if.cc b/milena/tests/core/image/image_if.cc index 4351a25..f646191 100644 --- a/milena/tests/core/image/image_if.cc +++ b/milena/tests/core/image/image_if.cc @@ -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 @@ -25,10 +26,9 @@ // reasons why the executable file might be covered by the GNU General // Public License. -/*! \file tests/core/image/image_if.cc - * - * \brief Tests on mln::image_if. - */ +/// \file tests/core/image/image_if.cc +/// +/// Tests on mln::image_if. #include <mln/core/image/image2d.hh> #include <mln/core/image/image_if.hh> @@ -42,13 +42,13 @@ int main() typedef image2d<int> I; I ima(8, 8); - // debug::println(ima | fun::p2b::chess); + // debug::println(ima | fun::p2b::chess()); // FIXME: is this line corret? - ///mln_assertion((ima | fun::p2b::chess).nsites() == 32); + ///mln_assertion((ima | fun::p2b::chess()).nsites() == 32); { - typedef image_if<I, fun::p2b::chess_t> II; - II ima_ref = ima | fun::p2b::chess; + typedef image_if<I, fun::p2b::chess> II; + II ima_ref = ima | fun::p2b::chess(); debug::println(ima_ref); { II ima_ref_; diff --git a/milena/tests/core/site_set/pset_if.cc b/milena/tests/core/site_set/pset_if.cc index 9918f56..1319848 100644 --- a/milena/tests/core/site_set/pset_if.cc +++ b/milena/tests/core/site_set/pset_if.cc @@ -1,4 +1,5 @@ // Copyright (C) 2007, 2008 EPITA Research and Development Laboratory +// (LRDE) // // This file is part of the Olena Library. This library is free // software; you can redistribute it and/or modify it under the terms @@ -25,10 +26,9 @@ // reasons why the executable file might be covered by the GNU General // Public License. -/*! \file tests/core/site_set/pset_if.cc - * - * \brief Tests on mln::p_if. - */ +/// \file tests/core/site_set/pset_if.cc +/// +/// Tests on mln::p_if. #include <mln/core/image/image2d.hh> #include <mln/core/site_set/p_set.hh> @@ -44,10 +44,10 @@ int main() using namespace mln; box2d box_8x8 = make::box2d(8, 8); - mln_assertion(geom::nsites((box_8x8 | fun::p2b::chess)) == 32); + mln_assertion(geom::nsites((box_8x8 | fun::p2b::chess())) == 32); { - p_set<point2d> s = convert::to_p_set(box_8x8 | fun::p2b::chess); - mln_precondition(s == (box_8x8 | fun::p2b::chess)); + p_set<point2d> s = convert::to_p_set(box_8x8 | fun::p2b::chess()); + mln_precondition(s == (box_8x8 | fun::p2b::chess())); } } diff --git a/milena/tests/global_vars1.cc b/milena/tests/global_vars1.cc new file mode 100644 index 0000000..f41407d --- /dev/null +++ b/milena/tests/global_vars1.cc @@ -0,0 +1,101 @@ +// 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 +// 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. + +/// \file tests/global_vars1.cc +/// +/// Tests proper global variable declarations + +#include <mln/util/all.hh> +#include <mln/fun/p2v/all.hh> +#include <mln/fun/x2x/all.hh> +#include <mln/fun/v2v/all.hh> +#include <mln/fun/i2v/all.hh> +#include <mln/fun/all.hh> +#include <mln/fun/x2v/all.hh> +#include <mln/fun/p2b/all.hh> +#include <mln/extension/all.hh> +#include <mln/histo/all.hh> +#include <mln/trait/op/all.hh> +#include <mln/trait/all.hh> +#include <mln/trait/value/all.hh> +#include <mln/win/all.hh> +#include <mln/core/routine/all.hh> +#include <mln/core/trait/all.hh> +#include <mln/core/def/all.hh> +#include <mln/core/internal/check/image_all.hh> +#include <mln/core/image/all.hh> +#include <mln/core/site_set/all.hh> +#include <mln/io/pbm/all.hh> +#include <mln/io/pfm/all.hh> +#include <mln/io/pgm/all.hh> +#include <mln/io/all.hh> +#include <mln/io/fits/all.hh> +#include <mln/io/pnm/all.hh> +#include <mln/io/ppm/all.hh> +#include <mln/make/all.hh> +#include <mln/canvas/morpho/all.hh> +#include <mln/canvas/all.hh> +#include <mln/canvas/browsing/all.hh> +#include <mln/estim/all.hh> +#include <mln/arith/all.hh> +#include <mln/display/all.hh> +#include <mln/test/all.hh> +#include <mln/border/all.hh> +#include <mln/trace/all.hh> +#include <mln/debug/all.hh> +#include <mln/morpho/elementary/all.hh> +#include <mln/morpho/all.hh> +#include <mln/accu/all.hh> +#include <mln/pw/all.hh> +#include <mln/linear/all.hh> +#include <mln/metal/all.hh> +#include <mln/metal/math/all.hh> +#include <mln/set/all.hh> +#include <mln/convert/impl/all.hh> +#include <mln/convert/all.hh> +#include <mln/geom/all.hh> +#include <mln/literal/all.hh> +#include <mln/level/approx/all.hh> +#include <mln/level/all.hh> +#include <mln/level/naive/all.hh> +#include <mln/math/all.hh> +#include <mln/norm/all.hh> +#include <mln/logical/all.hh> +#include <mln/draw/all.hh> +#include <mln/value/builtin/all.hh> +#include <mln/value/all.hh> +#include <mln/value/internal/all.hh> +#include <mln/value/concept/all.hh> +#include <mln/tag/all.hh> +#include <mln/labeling/all.hh> + +int f1(); + +int main () +{ + f1(); +} diff --git a/milena/tests/global_vars2.cc b/milena/tests/global_vars2.cc new file mode 100644 index 0000000..a3b93a6 --- /dev/null +++ b/milena/tests/global_vars2.cc @@ -0,0 +1,101 @@ +// 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 +// 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. + +/// \file tests/global_vars2.cc +/// +/// Tests proper global variable declarations + +# define MLN_INCLUDE_ONLY + +#include <mln/util/all.hh> +#include <mln/fun/p2v/all.hh> +#include <mln/fun/x2x/all.hh> +#include <mln/fun/v2v/all.hh> +#include <mln/fun/i2v/all.hh> +#include <mln/fun/all.hh> +#include <mln/fun/x2v/all.hh> +#include <mln/fun/p2b/all.hh> +#include <mln/extension/all.hh> +#include <mln/histo/all.hh> +#include <mln/trait/op/all.hh> +#include <mln/trait/all.hh> +#include <mln/trait/value/all.hh> +#include <mln/win/all.hh> +#include <mln/core/routine/all.hh> +#include <mln/core/trait/all.hh> +#include <mln/core/def/all.hh> +#include <mln/core/internal/check/image_all.hh> +#include <mln/core/image/all.hh> +#include <mln/core/site_set/all.hh> +#include <mln/io/pbm/all.hh> +#include <mln/io/pfm/all.hh> +#include <mln/io/pgm/all.hh> +#include <mln/io/all.hh> +#include <mln/io/fits/all.hh> +#include <mln/io/pnm/all.hh> +#include <mln/io/ppm/all.hh> +#include <mln/make/all.hh> +#include <mln/canvas/morpho/all.hh> +#include <mln/canvas/all.hh> +#include <mln/canvas/browsing/all.hh> +#include <mln/estim/all.hh> +#include <mln/arith/all.hh> +#include <mln/display/all.hh> +#include <mln/test/all.hh> +#include <mln/border/all.hh> +#include <mln/trace/all.hh> +#include <mln/debug/all.hh> +#include <mln/morpho/elementary/all.hh> +#include <mln/morpho/all.hh> +#include <mln/accu/all.hh> +#include <mln/pw/all.hh> +#include <mln/linear/all.hh> +#include <mln/metal/all.hh> +#include <mln/metal/math/all.hh> +#include <mln/set/all.hh> +#include <mln/convert/impl/all.hh> +#include <mln/convert/all.hh> +#include <mln/geom/all.hh> +#include <mln/literal/all.hh> +#include <mln/level/approx/all.hh> +#include <mln/level/all.hh> +#include <mln/level/naive/all.hh> +#include <mln/math/all.hh> +#include <mln/norm/all.hh> +#include <mln/logical/all.hh> +#include <mln/draw/all.hh> +#include <mln/value/builtin/all.hh> +#include <mln/value/all.hh> +#include <mln/value/internal/all.hh> +#include <mln/value/concept/all.hh> +#include <mln/tag/all.hh> +#include <mln/labeling/all.hh> + +int f1 () +{ + return 0; +} diff --git a/milena/tests/level/fill_with_image.cc b/milena/tests/level/fill_with_image.cc index 2c6edf8..4b921d0 100644 --- a/milena/tests/level/fill_with_image.cc +++ b/milena/tests/level/fill_with_image.cc @@ -1,4 +1,5 @@ // Copyright (C) 2007, 2008 EPITA Research and Development Laboratory +// (LRDE) // // This file is part of the Olena Library. This library is free // software; you can redistribute it and/or modify it under the terms @@ -25,10 +26,9 @@ // reasons why the executable file might be covered by the GNU General // Public License. -/*! \file tests/level/fill_with_value.cc - * - * \brief Tests on mln::level::fill_with_value - */ +/// \file tests/level/fill_with_value.cc +/// +/// Tests on mln::level::fill_with_value #include <mln/level/fill_with_value.hh> #include <mln/level/fill_with_image.hh> @@ -96,14 +96,14 @@ int main() { typedef image2d<unsigned char> I; - typedef image_if<I, fun::p2b::chess_t> II; + typedef image_if<I, fun::p2b::chess> II; I ima(size, size); I ima2(size, size); level::fill_with_value(ima, 51); level::fill_with_value(ima2, 42); - II ima_if = ima | fun::p2b::chess; + II ima_if = ima | fun::p2b::chess(); level::fill_with_image(ima_if, ima2); II::piter p(ima_if.domain()); @@ -145,7 +145,7 @@ int main() // pw image test { - const pw::image<fun::p2v::iota_t, box2d> ima(fun::p2v::iota, + const pw::image<fun::p2v::iota, box2d> ima(fun::p2v::iota(), make::box2d(-2,-2, 15,15)); image2d<short unsigned int> out(8, 8); @@ -167,11 +167,11 @@ int main() // image if test { typedef image2d<unsigned short> I; - typedef image_if<I, fun::p2b::chess_t> II; + typedef image_if<I, fun::p2b::chess> II; I ima(size, size); I out(size, size); - II ima_if = ima | fun::p2b::chess; + II ima_if = ima | fun::p2b::chess(); level::fill_with_value(ima, 42); level::fill_with_value(out, 0); diff --git a/milena/tests/level/fill_with_value.cc b/milena/tests/level/fill_with_value.cc index 5f8adb2..fa2eb55 100644 --- a/milena/tests/level/fill_with_value.cc +++ b/milena/tests/level/fill_with_value.cc @@ -1,4 +1,5 @@ // Copyright (C) 2007, 2008 EPITA Research and Development Laboratory +// (LRDE) // // This file is part of the Olena Library. This library is free // software; you can redistribute it and/or modify it under the terms @@ -25,10 +26,9 @@ // reasons why the executable file might be covered by the GNU General // Public License. -/*! \file tests/level/fill_with_value.cc - * - * \brief Tests on mln::level::fill_with_value - */ +/// \file tests/level/fill_with_value.cc +/// +/// Tests on mln::level::fill_with_value #include <mln/level/fill_with_value.hh> @@ -91,12 +91,12 @@ int main() { typedef image2d<unsigned char> I; - typedef image_if<I, fun::p2b::chess_t> II; + typedef image_if<I, fun::p2b::chess> II; I ima(size, size); level::fill_with_value(ima, 51); - II ima_if = ima | fun::p2b::chess; + II ima_if = ima | fun::p2b::chess(); level::fill_with_value(ima_if, 42); II::piter p(ima_if.domain()); diff --git a/milena/tests/level/paste.cc b/milena/tests/level/paste.cc index e748602..42f0ce6 100644 --- a/milena/tests/level/paste.cc +++ b/milena/tests/level/paste.cc @@ -1,4 +1,5 @@ // Copyright (C) 2007, 2008 EPITA Research and Development Laboratory +// (LRDE) // // This file is part of the Olena Library. This library is free // software; you can redistribute it and/or modify it under the terms @@ -25,10 +26,9 @@ // reasons why the executable file might be covered by the GNU General // Public License. -/*! \file tests/level/paste.cc - * - * \brief Tests on mln::level::paste. - */ +/// \file tests/level/paste.cc +/// +/// Tests on mln::level::paste. #include <mln/core/image/image1d.hh> #include <mln/core/image/image2d.hh> @@ -109,7 +109,7 @@ int main() /// pw image test { - const pw::image<fun::p2v::iota_t, box2d> ima(fun::p2v::iota, + const pw::image<fun::p2v::iota, box2d> ima(fun::p2v::iota(), make::box2d(2,2, 5,5)); image2d<short unsigned int> out(8, 8); @@ -131,11 +131,11 @@ int main() // image if test { typedef image2d<unsigned short> I; - typedef image_if<I, fun::p2b::chess_t> II; + typedef image_if<I, fun::p2b::chess> II; I ima(size, size); I out(size, size); - II ima_if = ima | fun::p2b::chess; + II ima_if = ima | fun::p2b::chess(); level::fill_with_value(ima, 0); debug::iota(ima); diff --git a/milena/tests/level/transform.cc b/milena/tests/level/transform.cc index e0b8ec9..c0d550b 100644 --- a/milena/tests/level/transform.cc +++ b/milena/tests/level/transform.cc @@ -25,10 +25,9 @@ // reasons why the executable file might be covered by the GNU General // Public License. -/*! \file tests/level/transform.cc - * - * \brief Tests on mln::level::transform - */ +/// \file tests/level/transform.cc +/// +/// Tests on mln::level::transform #include <cmath> @@ -123,7 +122,7 @@ int main() /// pw image test { - const pw::image<fun::p2v::iota_t, box2d> ima(fun::p2v::iota, + const pw::image<fun::p2v::iota, box2d> ima(fun::p2v::iota(), make::box2d(2,2, 5,5)); image2d<short unsigned int> out(8, 8); @@ -147,11 +146,11 @@ int main() // image if test { typedef image2d<unsigned short> I; - typedef image_if<I, fun::p2b::chess_t> II; + typedef image_if<I, fun::p2b::chess> II; I ima(size, size); I out(size, size); - II ima_if = ima | fun::p2b::chess; + II ima_if = ima | fun::p2b::chess(); level::fill_with_value(ima, 0); debug::iota(ima); diff --git a/milena/tests/pw/image.cc b/milena/tests/pw/image.cc index dbddce9..cbd07cd 100644 --- a/milena/tests/pw/image.cc +++ b/milena/tests/pw/image.cc @@ -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 @@ -25,20 +26,30 @@ // reasons why the executable file might be covered by the GNU General // Public License. -/*! \file tests/pw/image.cc - * - * \brief Tests on mln::pw::image. - */ +/// \file tests/pw/image.cc +/// +/// Tests on mln::pw::image. #include <mln/fun/p2b/chess.hh> #include <mln/core/alias/box2d.hh> #include <mln/pw/image.hh> -#include <mln/debug/println.hh> +#include <mln/core/var.hh> int main() { using namespace mln; - debug::println( fun::p2b::chess | make::box2d(8, 8) ); + mln_VAR(ima, fun::p2b::chess() | make::box2d(8, 8)); + mln_piter_(ima_t) p(ima.domain()); + unsigned i = 0; + for_all(p) + { + if (p.row() % 2) + mln_assertion(ima(p) == (p.col() % 2)); + else + mln_assertion(ima(p) == !(p.col() % 2)); + ++i; + } + mln_assertion(i == 64); } diff --git a/milena/tests/trait/image/images.cc b/milena/tests/trait/image/images.cc index a596440..51dd710 100644 --- a/milena/tests/trait/image/images.cc +++ b/milena/tests/trait/image/images.cc @@ -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 @@ -25,10 +26,9 @@ // reasons why the executable file might be covered by the GNU General // Public License. -/*! \file tests/trait/image/images.cc - * - * \brief Tests on mln::trait::images. - */ +/// \file tests/trait/image/images.cc +/// +/// \brief Tests on mln::trait::images. #include <mln/core/image/image2d.hh> @@ -53,10 +53,10 @@ int main() std::cout << std::endl << "image_if< image2d >: "; - mln::trait::image::print< image_if<I, fun::p2b::chess_t> >(std::cout); + mln::trait::image::print< image_if<I, fun::p2b::chess> >(std::cout); std::cout << std::endl << "image_if< sub_image< image2d > >: "; - mln::trait::image::print< image_if<Isub, fun::p2b::chess_t> >(std::cout); + mln::trait::image::print< image_if<Isub, fun::p2b::chess> >(std::cout); } -- 1.5.6.5