Olena-patches
Threads by month
- ----- 2025 -----
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- 9625 discussions
https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Make logical and use level transform.
* mln/level/transform.spe.hh: Layout.
(transform_tests): Fix sig.
(transform_fastest): New impl.
(transform_dispatch): Move out of impl and augment.
* mln/level/transform.hh: Call dispatch.
* mln/level/transform_inplace.hh (todo): New.
(transform_inplace_fastest): New impl.
(transform_inplace_dispatch): New.
* tests/level/transform_inplace.cc: Fix warning.
* mln/fun/vv2v/min.hh: Add second parm with default.
* mln/fun/vv2v/macros.hh: New.
* mln/fun/vv2v/land.hh: New.
* mln/fun/vv2v/all.hh: Update.
* mln/logical/and.hh: Fix return type in sig.
(and__): Remove.
Use level transform.
* mln/logical/and.spe.hh: Remove.
* mln/logical/includes.hh: New.
* mln/logical/all.hh: Update.
mln/fun/vv2v/all.hh | 3
mln/fun/vv2v/land.hh | 76 ++++++++++++++++++
mln/fun/vv2v/macros.hh | 48 +++++++++++
mln/fun/vv2v/min.hh | 20 ++--
mln/level/transform.hh | 17 +---
mln/level/transform.spe.hh | 164 ++++++++++++++++++++++++---------------
mln/level/transform_inplace.hh | 134 +++++++++++++++++++++++++++++--
mln/logical/all.hh | 13 +--
mln/logical/and.hh | 70 +++++-----------
mln/logical/includes.hh | 77 ++++++++++++++++++
tests/level/transform_inplace.cc | 2
11 files changed, 478 insertions(+), 146 deletions(-)
Index: tests/level/transform_inplace.cc
--- tests/level/transform_inplace.cc (revision 2862)
+++ tests/level/transform_inplace.cc (working copy)
@@ -45,7 +45,7 @@
using namespace mln;
const unsigned size = 50;
- image2d<int> ref(3, 3);
+ image2d<int> ref(size, size);
debug::iota(ref);
image2d<int> ima = clone(ref);
Index: mln/level/transform.spe.hh
--- mln/level/transform.spe.hh (revision 2862)
+++ mln/level/transform.spe.hh (working copy)
@@ -55,41 +55,42 @@
namespace level
{
+ // Forward declarations.
+
namespace internal
{
template <typename I, typename F>
- inline
void transform_tests(const Image<I>& input,
const Function_v2v<F>& f);
template <typename I1, typename I2, typename F>
- inline
void transform_tests(const Image<I1>& input1, const Image<I2>& input2,
- const Function_v2v<F>& f);
+ const Function_vv2v<F>& f);
}
- // Implementation
- // --------------
+ // Implementations.
+
+
namespace impl
{
namespace generic
{
+ // Forward declaration.
+
template <typename I, typename F>
mln_ch_value(I, mln_result(F))
- transform(const Image<I>& input_,
- const Function_v2v<F>& f_);
+ transform(const Image<I>& input_, const Function_v2v<F>& f_);
}
template <typename I, typename F>
mln_ch_value(I, mln_result(F))
- transform_lowq(const Image<I>& input_,
- const Function_v2v<F>& f_)
+ transform_lowq(const Image<I>& input_, const Function_v2v<F>& f_)
{
trace::entering("level::impl::transform_lowq");
@@ -111,14 +112,13 @@
output(p) = lut(input(p));
trace::exiting("level::impl::transform_lowq");
-
return output;
}
+
template <typename I, typename F>
mln_ch_value(I, mln_result(F))
- transform_taken(const Image<I>& input_,
- const Function_v2v<F>& f_)
+ transform_taken(const Image<I>& input_, const Function_v2v<F>& f_)
{
trace::entering("level::impl::transform_taken");
@@ -140,15 +140,13 @@
output(p) = lut(input(p));
trace::exiting("level::impl::transform_taken");
-
return output;
}
template <typename I, typename F>
mln_ch_value(I, mln_result(F))
- transform_singleton(const Image<I>& input_,
- const Function_v2v<F>& f_)
+ transform_singleton(const Image<I>& input_, const Function_v2v<F>& f_)
{
trace::entering("level::impl::transform_singleton");
@@ -163,14 +161,13 @@
fill_with_value(output, val);
trace::exiting("level::impl::transform_singleton");
-
return output;
}
+
template <typename I, typename F>
mln_ch_value(I, mln_result(F))
- transform_fast(const Image<I>& input_,
- const Function_v2v<F>& f_)
+ transform_fast(const Image<I>& input_, const Function_v2v<F>& f_)
{
trace::entering("level::impl::transform_fast");
@@ -193,16 +190,13 @@
}
trace::exiting("level::impl::transform_fast");
-
return output;
}
-
template <typename I, typename F>
mln_ch_value(I, mln_result(F))
- transform_fast_lowq(const Image<I>& input_,
- const Function_v2v<F>& f_)
+ transform_fast_lowq(const Image<I>& input_, const Function_v2v<F>& f_)
{
trace::entering("level::impl::transform_fast_lowq");
@@ -219,23 +213,48 @@
mln_pixter(const I) pi(input);
mln_pixter(O) po(output);
-
- po.start();
- for_all(pi)
- {
+ for_all_2(pi, po)
po.val() = lut(pi.val());
- po.next();
- }
trace::exiting("level::impl::transform_fast_lowq");
+ return output;
+ }
+
+
+ template <typename I1, typename I2, typename F>
+ mln_ch_value(I1, mln_result(F))
+ transform_fastest(const Image<I1>& input1_, const Image<I2>& input2_,
+ const Function_vv2v<F>& f_)
+ {
+ trace::entering("level::impl::transform_fastest");
+ const I1& input1 = exact(input1_);
+ const I2& input2 = exact(input2_);
+ const F& f = exact(f_);
+ level::internal::transform_tests(input1, input2, f);
+
+ typedef mln_ch_value(I1, mln_result(F)) O;
+ O output;
+ initialize(output, input1);
+ mln_pixter(O) po(output);
+
+ mln_pixter(const I1) pi1(input1);
+ mln_pixter(const I2) pi2(input2);
+ for_all_3(pi1, pi2, po)
+ po.val() = f(pi1.val(), pi2.val());
+
+ trace::exiting("level::impl::transform_fastest");
return output;
}
- // Dispatch
- // --------
+ } // end of namespace mln::level::impl
+
+
+
+ // Dispatch.
+
namespace internal
{
@@ -245,10 +264,9 @@
mln_ch_value(I, mln_result(F))
transform_dispatch(mln::trait::undef,
mln::trait::image::quant::any,
- const Image<I>& input,
- const Function_v2v<F>& f)
+ const Image<I>& input, const Function_v2v<F>& f)
{
- return impl::generic::transform(input, f);
+ return level::impl::generic::transform(input, f);
}
template <typename I, typename F>
@@ -256,10 +274,9 @@
mln_ch_value(I, mln_result(F))
transform_dispatch(mln::trait::image::vw_set::any,
mln::trait::image::quant::any,
- const Image<I>& input,
- const Function_v2v<F>& f)
+ const Image<I>& input, const Function_v2v<F>& f)
{
- return impl::generic::transform(input, f);
+ return level::impl::generic::transform(input, f);
}
template <typename I, typename F>
@@ -267,10 +284,9 @@
mln_ch_value(I, mln_result(F))
transform_dispatch(mln::trait::image::vw_set::uni,
mln::trait::image::quant::any,
- const Image<I>& input,
- const Function_v2v<F>& f)
+ const Image<I>& input, const Function_v2v<F>& f)
{
- return impl::transform_taken(input, f);
+ return level::impl::transform_taken(input, f);
}
@@ -279,10 +295,9 @@
mln_ch_value(I, mln_result(F))
transform_dispatch(mln::trait::image::vw_set::any,
mln::trait::image::quant::low,
- const Image<I>& input,
- const Function_v2v<F>& f)
+ const Image<I>& input, const Function_v2v<F>& f)
{
- return impl::transform_lowq(input, f);
+ return level::impl::transform_lowq(input, f);
}
@@ -292,10 +307,9 @@
mln_ch_value(I, mln_result(F))
transform_dispatch(mln::trait::image::quant::any,
mln::trait::image::value_access::direct,
- const Image<I>& input,
- const Function_v2v<F>& f)
+ const Image<I>& input, const Function_v2v<F>& f)
{
- return transform_fast(input, f);
+ return level::impl::transform_fast(input, f);
}
/// FIXME check that is right
@@ -304,10 +318,9 @@
mln_ch_value(I, mln_result(F))
transform_dispatch(mln::trait::image::quant::low,
mln::trait::image::value_access::direct,
- const Image<I>& input,
- const Function_v2v<F>& f)
+ const Image<I>& input, const Function_v2v<F>& f)
{
- return transform_fast_lowq(input, f);
+ return level::impl::transform_fast_lowq(input, f);
}
@@ -317,8 +330,7 @@
mln_ch_value(I, mln_result(F))
transform_dispatch(mln::trait::image::quant::any,
mln::trait::image::value_access::any,
- const Image<I>& input,
- const Function_v2v<F>& f)
+ const Image<I>& input, const Function_v2v<F>& f)
{
return transform_dispatch(mln_trait_image_vw_set(I)(),
mln_trait_image_quant(I)(),
@@ -330,8 +342,7 @@
inline
mln_ch_value(I, mln_result(F))
transform_dispatch(mln::trait::image::value_storage::any,
- const Image<I>& input,
- const Function_v2v<F>& f)
+ const Image<I>& input, const Function_v2v<F>& f)
{
return transform_dispatch(mln_trait_image_vw_set(I)(),
mln_trait_image_quant(I)(),
@@ -342,18 +353,16 @@
inline
mln_ch_value(I, mln_result(F))
transform_dispatch(mln::trait::image::value_storage::singleton,
- const Image<I>& input,
- const Function_v2v<F>& f)
+ const Image<I>& input, const Function_v2v<F>& f)
{
- return transform_singleton(input, f);
+ return level::impl::transform_singleton(input, f);
}
template <typename I, typename F>
inline
mln_ch_value(I, mln_result(F))
transform_dispatch(mln::trait::image::value_storage::one_block,
- const Image<I>& input_,
- const Function_v2v<F>& f_)
+ const Image<I>& input_, const Function_v2v<F>& f_)
{
const I& input = exact(input_);
@@ -371,20 +380,55 @@
+ // Dispatch for transformation from a couple of images.
+
+ template <typename I1, typename I2, typename F>
+ mln_ch_value(I1, mln_result(F))
+ transform_dispatch_2(trait::image::speed::any,
+ trait::image::speed::any,
+ const Image<I1>& input1, const Image<I2>& input2,
+ const Function_vv2v<F>& f)
+ {
+ return level::impl::generic::transform(input1, input2, f);
+ }
+
+ template <typename I1, typename I2, typename F>
+ mln_ch_value(I1, mln_result(F))
+ transform_dispatch_2(trait::image::speed::fastest,
+ trait::image::speed::fastest,
+ const Image<I1>& input1, const Image<I2>& input2,
+ const Function_vv2v<F>& f)
+ {
+ return level::impl::transform_fastest(input1, input2, f);
+ }
+
+ // end of Dispatch for transformation from a couple of images.
+
+
+
+ // Dispatch entry points.
+
template <typename I, typename F>
mln_ch_value(I, mln_result(F))
- transform_dispatch(const Image<I>& input,
- const Function_v2v<F>& f)
+ transform_dispatch(const Image<I>& input, const Function_v2v<F>& f)
{
return transform_dispatch(mln_trait_image_value_storage(I)(),
input, f);
}
+ template <typename I1, typename I2, typename F>
+ mln_ch_value(I1, mln_result(F))
+ transform_dispatch(const Image<I1>& input1, const Image<I2>& input2,
+ const Function_vv2v<F>& f)
+ {
+ return transform_dispatch_2(mln_trait_image_speed(I1)(),
+ mln_trait_image_speed(I2)(),
+ input1, input2, f);
}
+ } // end of namespace mln::level::internal
- } // end of namespace mln::level::impl
} // end of namespace mln::level
Index: mln/level/transform.hh
--- mln/level/transform.hh (revision 2862)
+++ mln/level/transform.hh (working copy)
@@ -89,7 +89,6 @@
{
template <typename I, typename F>
- inline
void transform_tests(const Image<I>& input,
const Function_v2v<F>& f)
{
@@ -103,9 +102,7 @@
}
template <typename I1, typename I2, typename F>
- inline
- void transform_tests(const Image<I1>& input1,
- const Image<I2>& input2,
+ void transform_tests(const Image<I1>& input1, const Image<I2>& input2,
const Function_vv2v<F>& f)
{
// Dynamic tests.
@@ -135,7 +132,6 @@
{
template <typename I, typename F>
- inline
mln_ch_value(I, mln_result(F))
transform(const Image<I>& input_, const Function_v2v<F>& f_)
{
@@ -162,7 +158,6 @@
template <typename I1, typename I2, typename F>
- inline
mln_ch_value(I1, mln_result(F))
transform(const Image<I1>& input1_,
const Image<I2>& input2_,
@@ -193,8 +188,10 @@
} // end of namespace mln::level::impl
+
// Facades.
+
template <typename I, typename F>
inline
mln_ch_value(I, mln_result(F))
@@ -205,17 +202,17 @@
internal::transform_tests(input, f);
mln_ch_value(I, mln_result(F)) output;
- output = impl::internal::transform_dispatch(exact(input), exact(f));
+ output = internal::transform_dispatch(input, f);
trace::exiting("level::transform");
return output;
}
+
template <typename I1, typename I2, typename F>
inline
mln_ch_value(I1, mln_result(F))
- transform(const Image<I1>& input1,
- const Image<I2>& input2,
+ transform(const Image<I1>& input1, const Image<I2>& input2,
const Function_vv2v<F>& f)
{
trace::entering("level::transform");
@@ -223,7 +220,7 @@
internal::transform_tests(input1, input2, f);
mln_ch_value(I1, mln_result(F)) output;
- output = impl::generic::transform(input1, input2, f);
+ output = internal::transform_dispatch(input1, input2, f);
trace::exiting("level::transform");
return output;
Index: mln/level/transform_inplace.hh
--- mln/level/transform_inplace.hh (revision 2862)
+++ mln/level/transform_inplace.hh (working copy)
@@ -31,6 +31,8 @@
/// \file mln/level/transform_inplace.hh
///
/// Transform inplace the contents of an image through a function.
+///
+/// \todo Take into account more properties; see level/transform.hh.
# include <mln/core/concept/image.hh>
# include <mln/core/concept/function.hh>
@@ -75,6 +77,9 @@
# ifndef MLN_INCLUDE_ONLY
+
+ // Tests.
+
namespace internal
{
@@ -116,7 +121,7 @@
mln_precondition(exact(aux).has_data());
mln_precondition(exact(aux).domain() == exact(ima).domain());
- // Avoid a warning.
+ // Avoid warnings.
(void) ima;
(void) aux;
(void) f;
@@ -128,13 +133,12 @@
namespace impl
{
+ // Generic implementations.
namespace generic
{
- // Generic implementation.
template <typename I, typename F>
- inline
void
transform_inplace(Image<I>& ima_, const Function_v2v<F>& f_)
{
@@ -155,10 +159,7 @@
trace::exiting("level::impl::generic::transform_inplace");
}
-
- // Generic implementation.
template <typename I1, typename I2, typename F>
- inline
void
transform_inplace(Image<I1>& ima_, const Image<I2>& aux_,
const Function_vv2v<F>& f_)
@@ -184,20 +185,131 @@
} // end of namespace mln::level::impl::generic
+ template <typename I, typename F>
+ void
+ transform_inplace_fastest(Image<I>& ima_, const Function_v2v<F>& f_)
+ {
+ trace::entering("level::impl::transform_inplace_fastest");
+
+ mlc_is(mln_trait_image_pw_io(I),
+ trait::image::pw_io::read_write)::check();
+
+ I& ima = exact(ima_);
+ const F& f = exact(f_);
+
+ level::internal::transform_inplace_tests(ima, f);
+
+ mln_pixter(I) p(ima);
+ for_all(p)
+ p.val() = f(p.val());
+
+ trace::exiting("level::impl::transform_inplace_fastest");
+ }
+
+
+ template <typename I1, typename I2, typename F>
+ void
+ transform_inplace_fastest(Image<I1>& ima_, const Image<I2>& aux_,
+ const Function_vv2v<F>& f_)
+ {
+ trace::entering("level::impl::transform_inplace_fastest");
+
+ mlc_is(mln_trait_image_pw_io(I1),
+ trait::image::pw_io::read_write)::check();
+
+ I1& ima = exact(ima_);
+ const I2& aux = exact(aux_);
+ const F& f = exact(f_);
+
+ level::internal::transform_inplace_tests(ima, aux, f);
+
+ mln_pixter(I1) pi(ima);
+ mln_pixter(const I2) pa(aux);
+ for_all_2(pi, pa)
+ pi.val() = f(pi.val(), pa.val());
+
+ trace::exiting("level::impl::transform_inplace_fastest");
+ }
+
+
} // end of namespace mln::level::impl
+
+ // Dispatch.
+
+ namespace internal
+ {
+
+ // (ima, f) version.
+
+ template <typename I, typename F>
+ void
+ transform_inplace_dispatch(trait::image::speed::any,
+ Image<I>& ima, const Function_v2v<F>& f)
+ {
+ level::impl::generic::transform_inplace(ima, f);
+ }
+
+ template <typename I, typename F>
+ void
+ transform_inplace_dispatch(trait::image::speed::fastest,
+ Image<I>& ima, const Function_v2v<F>& f)
+ {
+ level::impl::transform_inplace_fastest(ima, f);
+ }
+
+ template <typename I, typename F>
+ void
+ transform_inplace_dispatch(Image<I>& ima, const Function_v2v<F>& f)
+ {
+ transform_inplace_dispatch(mln_trait_image_speed(I)(),
+ ima, f);
+ }
+
+ // (ima, aux, f) version.
+
+ template <typename I1, typename I2, typename F>
+ void
+ transform_inplace_dispatch(trait::image::speed::any,
+ trait::image::speed::any,
+ Image<I1>& ima, const Image<I2>& aux, const Function_vv2v<F>& f)
+ {
+ level::impl::generic::transform_inplace(ima, aux, f);
+ }
+
+ template <typename I1, typename I2, typename F>
+ void
+ transform_inplace_dispatch(trait::image::speed::fastest,
+ trait::image::speed::fastest,
+ Image<I1>& ima, const Image<I2>& aux, const Function_vv2v<F>& f)
+ {
+ level::impl::transform_inplace_fastest(ima, aux, f);
+ }
+
+ template <typename I1, typename I2, typename F>
+ void
+ transform_inplace_dispatch(Image<I1>& ima, const Image<I2>& aux, const Function_vv2v<F>& f)
+ {
+ transform_inplace_dispatch(mln_trait_image_speed(I1)(),
+ mln_trait_image_speed(I2)(),
+ ima, aux, f);
+ }
+
+ } // end of namespace mln::level::internal
+
+
+
// Facades.
template <typename I, typename F>
- inline
void
transform_inplace(Image<I>& ima, const Function_v2v<F>& f)
{
trace::entering("level::transform_inplace");
- level::internal::transform_inplace_tests(ima, f);
- impl::generic::transform_inplace(ima, f);
+ internal::transform_inplace_tests(ima, f);
+ internal::transform_inplace_dispatch(ima, f);
trace::exiting("level::transform_inplace");
}
@@ -209,8 +321,8 @@
{
trace::entering("level::transform_inplace");
- level::internal::transform_inplace_tests(ima, aux, f);
- impl::generic::transform_inplace(ima, aux, f);
+ internal::transform_inplace_tests(ima, aux, f);
+ internal::transform_inplace_dispatch(ima, aux, f);
trace::exiting("level::transform_inplace");
}
Index: mln/fun/vv2v/min.hh
--- mln/fun/vv2v/min.hh (revision 2862)
+++ mln/fun/vv2v/min.hh (working copy)
@@ -29,7 +29,8 @@
# define MLN_FUN_VV2V_MIN_HH
/// \file mln/fun/vv2v/min.hh
-/// \brief computing the minimum of two values using a functor.
+///
+/// Functor that computes the minimum of two values.
# include <mln/core/concept/function.hh>
# include <mln/math/min.hh>
@@ -47,22 +48,23 @@
// FIXME: Doc.
/// \brief A functor computing the minimum of two values.
- template <typename V>
- struct min : public Function_vv2v< min<V> >
+ template <typename L, typename R = L>
+ struct min : public Function_vv2v< min<L,R> >,
+ private mlc_converts_to(R,L)::check_t
{
- typedef V result;
- V operator()(const V& v1, const V& v2) const;
+ typedef L result;
+ L operator()(const L& v1, const R& v2) const;
};
# ifndef MLN_INCLUDE_ONLY
- template <typename V>
+ template <typename L, typename R>
inline
- V
- min<V>::operator()(const V& v1, const V& v2) const
+ L
+ min<L,R>::operator()(const L& v1, const R& v2) const
{
- return mln::math::min(v1, v2);
+ return mln::math::min(v1, L(v2));
}
# endif // ! MLN_INCLUDE_ONLY
Index: mln/fun/vv2v/macros.hh
--- mln/fun/vv2v/macros.hh (revision 0)
+++ mln/fun/vv2v/macros.hh (revision 0)
@@ -0,0 +1,48 @@
+// 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.
+
+#ifndef MLN_FUN_VV2V_MACROS_HH
+# define MLN_FUN_VV2V_MACROS_HH
+
+/// \file mln/fun/vv2v/macros.hh
+///
+/// Define a bunch of macros related to a binary function and a couple
+/// of images.
+
+
+#define mln_fun_vv2v(F, L, R) mln::fun::vv2v::F< mln_value(L), mln_value(R) >
+
+
+#define mln_fun_vv2v_result(F, L, R) typename mln_fun_vv2v(F, L, R)::result
+
+
+#define mln_ch_fun_vv2v(F, L, R) \
+ typename mln::trait::ch_value< L, \
+ typename mln_fun_vv2v(F, L, R)::result >::ret
+
+
+#endif // ! MLN_FUN_VV2V_MACROS_HH
Index: mln/fun/vv2v/all.hh
--- mln/fun/vv2v/all.hh (revision 2862)
+++ mln/fun/vv2v/all.hh (working copy)
@@ -48,6 +48,9 @@
}
+# include <mln/fun/vv2v/macros.hh>
+
+# include <mln/fun/vv2v/land.hh>
# include <mln/fun/vv2v/max.hh>
# include <mln/fun/vv2v/min.hh>
# include <mln/fun/vv2v/vec.hh>
Index: mln/fun/vv2v/land.hh
--- mln/fun/vv2v/land.hh (revision 0)
+++ mln/fun/vv2v/land.hh (revision 0)
@@ -0,0 +1,76 @@
+// 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.
+
+#ifndef MLN_FUN_VV2V_LAND_HH
+# define MLN_FUN_VV2V_LAND_HH
+
+/// \file mln/fun/vv2v/land.hh
+///
+/// Functor that computes "logical and" between two values.
+
+# include <mln/core/concept/function.hh>
+# include <mln/trait/op/and.hh>
+
+
+namespace mln
+{
+
+ namespace fun
+ {
+
+ namespace vv2v
+ {
+
+ /// Functor computing logical-and between two values.
+ template <typename L, typename R = L>
+ struct land : public Function_vv2v< land<L,R> >
+ {
+ typedef mln_trait_op_and(L, R) result;
+ result operator()(const L& v1, const R& v2) const;
+ };
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ template <typename L, typename R>
+ inline
+ typename land<L,R>::result
+ land<L,R>::operator()(const L& v1, const R& v2) const
+ {
+ return v1 && v2;
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::fun::vv2v
+
+ } // end of namespace mln::fun
+
+} // end of namespace mln
+
+
+#endif // ! MLN_FUN_VV2V_LAND_HH
Index: mln/logical/and.hh
--- mln/logical/and.hh (revision 2862)
+++ mln/logical/and.hh (working copy)
@@ -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,18 +29,14 @@
#ifndef MLN_LOGICAL_AND_HH
# define MLN_LOGICAL_AND_HH
-/*! \file mln/logical/and.hh
- *
- * \brief Point-wise "logical and" between binary images.
- *
- * \todo Add static assertion and save one iterator in in-place version.
- */
-
-# include <mln/core/concept/image.hh>
-
+/// \file mln/logical/and.hh
+///
+/// Point-wise "logical and" between binary images.
+///
+/// \todo Add static assertion and save one iterator in in-place version.
-// Specializations are in:
-# include <mln/logical/and.spe.hh>
+# include <mln/logical/includes.hh>
+# include <mln/fun/vv2v/land.hh>
namespace mln
@@ -57,7 +54,8 @@
* \pre \p lhs.domain == \p rhs.domain
*/
template <typename L, typename R>
- mln_concrete(L) and_(const Image<L>& lhs, const Image<R>& rhs);
+ mln_ch_fun_vv2v(land, L, R)
+ and_(const Image<L>& lhs, const Image<R>& rhs);
/*! Point-wise in-place "logical and" of image \p rhs in image \p lhs.
@@ -77,44 +75,17 @@
# ifndef MLN_INCLUDE_ONLY
- namespace impl
- {
-
- namespace generic
- {
-
- template <typename L, typename R, typename O>
- inline
- void and__(const L& lhs, const R& rhs, O& output)
- {
- trace::entering("logical::impl::generic::and__");
-
- mln_piter(L) p(lhs.domain());
- for_all(p)
- output(p) = lhs(p) && rhs(p);
-
- trace::exiting("logical::impl::generic::and__");
- }
-
- } // end of namespace mln::logical::impl::generic
-
- } // end of namespace mln::logical::impl
-
-
- // Facades.
-
template <typename L, typename R>
inline
- mln_concrete(L) and_(const Image<L>& lhs, const Image<R>& rhs)
+ mln_ch_fun_vv2v(land, L, R)
+ and_(const Image<L>& lhs, const Image<R>& rhs)
{
trace::entering("logical::and_");
- mln_precondition(exact(rhs).domain() == exact(lhs).domain());
+ internal::tests(lhs, rhs);
- mln_concrete(L) output;
- initialize(output, lhs);
- impl::and__(mln_trait_image_speed(L)(), exact(lhs),
- mln_trait_image_speed(R)(), exact(rhs), output);
+ mln_fun_vv2v(land, L, R) f;
+ mln_ch_fun_vv2v(land, L, R) output = level::transform(lhs, rhs, f);
trace::exiting("logical::and_");
return output;
@@ -126,10 +97,13 @@
{
trace::entering("logical::and_inplace");
- mln_precondition(exact(rhs).domain() >= exact(lhs).domain());
+ mlc_converts_to(mln_fun_vv2v_result(land, L, R),
+ mln_value(L))::check();
+
+ internal::tests(lhs, rhs);
- impl::and__(mln_trait_image_speed(L)(), exact(lhs),
- mln_trait_image_speed(R)(), exact(rhs), exact(lhs));
+ mln_fun_vv2v(land, L, R) f;
+ level::transform_inplace(lhs, rhs, f);
trace::exiting("logical::and_inplace");
}
Index: mln/logical/includes.hh
--- mln/logical/includes.hh (revision 0)
+++ mln/logical/includes.hh (revision 0)
@@ -0,0 +1,77 @@
+// 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.
+
+#ifndef MLN_LOGICAL_INCLUDES_HH
+# define MLN_LOGICAL_INCLUDES_HH
+
+/// \file mln/logical/includes.hh
+
+
+# include <mln/core/concept/image.hh>
+# include <mln/level/transform.hh>
+# include <mln/level/transform_inplace.hh>
+# include <mln/fun/vv2v/macros.hh>
+
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+namespace mln
+{
+
+ namespace logical
+ {
+
+ namespace internal
+ {
+
+ template <typename L, typename R>
+ inline
+ void
+ tests(const Image<L>& lhs_, const Image<R>& rhs_)
+ {
+ const L& lhs = exact(lhs_);
+ const R& rhs = exact(rhs_);
+
+ mln_precondition(lhs.has_data());
+ mln_precondition(rhs.has_data());
+ mln_precondition(rhs.domain() == lhs.domain());
+
+ (void) lhs;
+ (void) rhs;
+ }
+
+ } // end of namespace mln::logical::internal
+
+ } // end of namespace mln::logical
+
+} // end of namespace mln
+
+# endif // ! MLN_INCLUDE_ONLY
+
+
+#endif // ! MLN_LOGICAL_INCLUDES_HH
Index: mln/logical/all.hh
--- mln/logical/all.hh (revision 2862)
+++ mln/logical/all.hh (working copy)
@@ -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_LOGICAL_ALL_HH
# define MLN_LOGICAL_ALL_HH
-/*! \file mln/logical/all.hh
- *
- * \brief File that includes all logical operators.
- */
+/// \file mln/logical/all.hh
+///
+/// File that includes all logical operators.
namespace mln
@@ -47,11 +47,10 @@
namespace generic {}
}
-
}
-
}
+# include <mln/logical/includes.hh>
# include <mln/logical/and.hh>
# include <mln/logical/and_not.hh>
# include <mln/logical/not.hh>
1
0
13 Nov '08
https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Specialize accu tranform for fastest images.
* mln/accu/snake_2d.hh (todo): New.
* mln/accu/transform.hh (transform_fastest): New.
(transform_dispatch): New overload.
(todo): Remove; obsolete.
* mln/canvas/browsing/snake_generic.hh: Upgrade doc style.
(include): Remove useless 'stack'.
accu/snake_2d.hh | 2 +
accu/transform.hh | 77 ++++++++++++++++++++++++++++++++-------
canvas/browsing/snake_generic.hh | 12 +++---
3 files changed, 72 insertions(+), 19 deletions(-)
Index: mln/accu/snake_2d.hh
--- mln/accu/snake_2d.hh (revision 2861)
+++ mln/accu/snake_2d.hh (working copy)
@@ -31,6 +31,8 @@
/// \file mln/accu/snake_2d.hh
///
/// Run an accumulator in a snake-like browsing.
+///
+/// \todo Make it n-D.
#include <mln/core/concept/image.hh>
#include <mln/core/concept/meta_accumulator.hh>
Index: mln/accu/transform.hh
--- mln/accu/transform.hh (revision 2861)
+++ mln/accu/transform.hh (working copy)
@@ -32,8 +32,6 @@
///
/// Transform an image by applying locally an accumulator on its
/// values.
-///
-/// \todo Specialize for fastest images.
# include <mln/core/concept/meta_accumulator.hh>
# include <mln/core/concept/image.hh>
@@ -67,6 +65,8 @@
namespace impl
{
+ // Generic version.
+
namespace generic
{
@@ -79,8 +79,8 @@
trace::entering("accu::impl::generic::transform");
const I& input = exact(input_);
- A a = exact(a_);
const W& win = exact(win_);
+ A a = exact(a_);
mln_precondition(input.has_data());
// mln_precondition(win.is_valid());
@@ -106,32 +106,85 @@
} // end of namespace mln::accu::impl::generic
+
+ // Fastest version.
+
+ template <typename I, typename A, typename W>
+ mln_ch_value(I, mln_result(A))
+ transform_fastest(const Image<I>& input_, const Accumulator<A>& a_, const Window<W>& win_)
+ {
+ trace::entering("accu::impl::transform_fastest");
+
+ const I& input = exact(input_);
+ const W& win = exact(win_);
+ A a = exact(a_);
+
+ mln_precondition(input.has_data());
+ // mln_precondition(win.is_valid());
+
+ extension::adjust(input, win);
+
+ typedef mln_ch_value(I, mln_result(A)) O;
+ O output;
+ initialize(output, input);
+ mln_pixter(O) o(output);
+
+ mln_pixter(const I) p(input);
+ mln_qixter(const I, W) q(p, win);
+ for_all_2(p, o)
+ {
+ a.init();
+ for_all(q)
+ a.take(q.val());
+ o.val() = a.to_result();
+ }
+
+ trace::exiting("accu::impl::transform_fastest");
+ return output;
+ }
+
+
} // end of namespace mln::accu::impl
+ // Dispatch.
+
namespace internal
{
template <typename I, typename A, typename W>
- inline
mln_ch_value(I, mln_result(A))
- transform_dispatch(const Image<I>& input,
- const Accumulator<A>& a,
- const Window<W>& win)
+ transform_dispatch(trait::image::speed::any,
+ const Image<I>& input, const Accumulator<A>& a, const Window<W>& win)
{
return impl::generic::transform(input, a, win);
}
+ template <typename I, typename A, typename W>
+ mln_ch_value(I, mln_result(A))
+ transform_dispatch(trait::image::speed::fastest,
+ const Image<I>& input, const Accumulator<A>& a, const Window<W>& win)
+ {
+ return impl::transform_fastest(input, a, win);
+ }
+
+ template <typename I, typename A, typename W>
+ mln_ch_value(I, mln_result(A))
+ transform_dispatch(const Image<I>& input, const Accumulator<A>& a, const Window<W>& win)
+ {
+ return transform_dispatch(mln_trait_image_speed(I)(),
+ input, a, win);
+ }
+
} // end of namespace mln::accu::internal
+ // Facades.
template <typename I, typename A, typename W>
inline
mln_ch_value(I, mln_result(A))
- transform(const Image<I>& input,
- const Accumulator<A>& a,
- const Window<W>& win)
+ transform(const Image<I>& input, const Accumulator<A>& a, const Window<W>& win)
{
trace::entering("accu::transform");
@@ -147,9 +200,7 @@
template <typename I, typename A, typename W>
mln_ch_value(I, mln_accu_with(A, mln_value(I))::result)
- transform(const Image<I>& input,
- const Meta_Accumulator<A>& a,
- const Window<W>& win)
+ transform(const Image<I>& input, const Meta_Accumulator<A>& a, const Window<W>& win)
{
trace::entering("accu::transform");
Index: mln/canvas/browsing/snake_generic.hh
--- mln/canvas/browsing/snake_generic.hh (revision 2861)
+++ mln/canvas/browsing/snake_generic.hh (working copy)
@@ -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,14 +29,13 @@
#ifndef MLN_CANVAS_BROWSING_SNAKE_GENERIC_HH
# define MLN_CANVAS_BROWSING_SNAKE_GENERIC_HH
-/*! \file mln/canvas/browsing/snake_generic.hh
- *
- * \brief Browsing in a snake-way, forward.
- */
+/// \file mln/canvas/browsing/snake_generic.hh
+///
+/// Browsing in a snake-way, forward.
-# include <stack>
# include <mln/core/concept/browsing.hh>
+
namespace mln
{
1
0
* mln/accu/all.hh,
* mln/accu/bbox.hh,
* mln/accu/compute.hh,
* mln/accu/convolve.hh,
* mln/accu/count.hh,
* mln/accu/count_adjacent_vertices.hh,
* mln/accu/essential.hh,
* mln/accu/height.hh,
* mln/accu/histo.hh,
* mln/accu/internal/base.hh,
* mln/accu/land.hh,
* mln/accu/line.hh,
* mln/accu/maj_h.hh,
* mln/accu/max.hh,
* mln/accu/max_h.hh,
* mln/accu/mean.hh,
* mln/accu/median_alt.hh,
* mln/accu/median_h.hh,
* mln/accu/min.hh,
* mln/accu/min_h.hh,
* mln/accu/min_max.hh,
* mln/accu/nil.hh,
* mln/accu/p.hh,
* mln/accu/pair.hh,
* mln/accu/rank.hh,
* mln/accu/rank_bool.hh,
* mln/accu/rank_high_quant.hh,
* mln/accu/snake_2d.hh,
* mln/accu/sum.hh,
* mln/accu/take.hh,
* mln/accu/transform.hh,
* mln/accu/tuple.hh,
* mln/accu/v.hh,
* mln/accu/volume.hh: Update comments and add missing unmeta.
* mln/morpho/elementary/like_ero_fun.hh,
* mln/algebra/quat.hh: Fix warnings.
* mln/geom/essential.hh,
* mln/value/essential.hh: Fix includes.
* tests/accu/rank.cc: Use a new constructor for accu::meta::rank.
---
milena/ChangeLog | 47 ++++++++++++++++++++++++++
milena/mln/accu/all.hh | 19 +++++-----
milena/mln/accu/bbox.hh | 13 +++----
milena/mln/accu/compute.hh | 8 ++--
milena/mln/accu/convolve.hh | 17 ++++-----
milena/mln/accu/count.hh | 6 ++--
milena/mln/accu/count_adjacent_vertices.hh | 6 ++--
milena/mln/accu/essential.hh | 10 ++---
milena/mln/accu/height.hh | 17 +++++----
milena/mln/accu/histo.hh | 20 +++++-----
milena/mln/accu/internal/base.hh | 15 ++++----
milena/mln/accu/land.hh | 10 +++---
milena/mln/accu/line.hh | 2 +-
milena/mln/accu/maj_h.hh | 14 ++++----
milena/mln/accu/max.hh | 16 ++++-----
milena/mln/accu/max_h.hh | 14 +++----
milena/mln/accu/mean.hh | 17 ++++-----
milena/mln/accu/median_alt.hh | 26 ++++++++++----
milena/mln/accu/median_h.hh | 20 +++++------
milena/mln/accu/min.hh | 4 +-
milena/mln/accu/min_h.hh | 18 ++++------
milena/mln/accu/min_max.hh | 17 ++++-----
milena/mln/accu/nil.hh | 16 ++++-----
milena/mln/accu/p.hh | 16 ++++-----
milena/mln/accu/pair.hh | 22 ++++++------
milena/mln/accu/rank.hh | 12 ++++--
milena/mln/accu/rank_bool.hh | 22 +++++------
milena/mln/accu/rank_high_quant.hh | 25 ++++++++++---
milena/mln/accu/snake_2d.hh | 2 +-
milena/mln/accu/sum.hh | 12 +++---
milena/mln/accu/take.hh | 14 ++++----
milena/mln/accu/transform.hh | 10 +++---
milena/mln/accu/tuple.hh | 14 ++++----
milena/mln/accu/v.hh | 19 +++++-----
milena/mln/accu/volume.hh | 15 ++++----
milena/mln/algebra/quat.hh | 1 +
milena/mln/geom/essential.hh | 10 +++++
milena/mln/morpho/elementary/like_ero_fun.hh | 2 +-
milena/mln/value/essential.hh | 4 +-
milena/tests/accu/rank.cc | 4 +--
40 files changed, 309 insertions(+), 247 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 7b16037..2e64654 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,52 @@
2008-11-12 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Various small fixes.
+
+ * mln/accu/all.hh,
+ * mln/accu/bbox.hh,
+ * mln/accu/compute.hh,
+ * mln/accu/convolve.hh,
+ * mln/accu/count.hh,
+ * mln/accu/count_adjacent_vertices.hh,
+ * mln/accu/essential.hh,
+ * mln/accu/height.hh,
+ * mln/accu/histo.hh,
+ * mln/accu/internal/base.hh,
+ * mln/accu/land.hh,
+ * mln/accu/line.hh,
+ * mln/accu/maj_h.hh,
+ * mln/accu/max.hh,
+ * mln/accu/max_h.hh,
+ * mln/accu/mean.hh,
+ * mln/accu/median_alt.hh,
+ * mln/accu/median_h.hh,
+ * mln/accu/min.hh,
+ * mln/accu/min_h.hh,
+ * mln/accu/min_max.hh,
+ * mln/accu/nil.hh,
+ * mln/accu/p.hh,
+ * mln/accu/pair.hh,
+ * mln/accu/rank.hh,
+ * mln/accu/rank_bool.hh,
+ * mln/accu/rank_high_quant.hh,
+ * mln/accu/snake_2d.hh,
+ * mln/accu/sum.hh,
+ * mln/accu/take.hh,
+ * mln/accu/transform.hh,
+ * mln/accu/tuple.hh,
+ * mln/accu/v.hh,
+ * mln/accu/volume.hh: Update comments and add missing unmeta.
+
+ * mln/morpho/elementary/like_ero_fun.hh,
+ * mln/algebra/quat.hh: Fix warnings.
+
+ * mln/geom/essential.hh,
+ * mln/value/essential.hh: Fix includes.
+
+ * tests/accu/rank.cc: Use a new constructor for accu::meta::rank.
+
+2008-11-12 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Update tutorial.
* doc/Doxyfile.in: Add new example/include paths.
diff --git a/milena/mln/accu/all.hh b/milena/mln/accu/all.hh
index 76b09d9..6f9e7a5 100644
--- a/milena/mln/accu/all.hh
+++ b/milena/mln/accu/all.hh
@@ -29,16 +29,15 @@
#ifndef MLN_ACCU_ALL_HH
# define MLN_ACCU_ALL_HH
-/*! \file mln/accu/all.hh
- *
- * \brief File that includes all accumulator types.
- *
- * \todo Update accumulators s.a. count so that they are like min_/min.
- *
- * \todo Propagate those updates to mln/estim/.
- *
- * \todo Update the include list...
- */
+/// \file mln/accu/all.hh
+///
+/// File that includes all accumulator types.
+///
+/// \todo Update accumulators s.a. count so that they are like min_/min.
+///
+/// \todo Propagate those updates to mln/estim/.
+///
+/// \todo Update the include list...
namespace mln
diff --git a/milena/mln/accu/bbox.hh b/milena/mln/accu/bbox.hh
index 4066428..90c2e5d 100644
--- a/milena/mln/accu/bbox.hh
+++ b/milena/mln/accu/bbox.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,10 +28,9 @@
#ifndef MLN_ACCU_BBOX_HH
# define MLN_ACCU_BBOX_HH
-/*! \file mln/accu/bbox.hh
- *
- * \brief Define an accumulator that computes a bbox.
- */
+/// \file mln/accu/bbox.hh
+///
+/// Define an accumulator that computes a bbox.
# include <mln/core/site_set/box.hh>
# include <mln/core/concept/meta_accumulator.hh>
@@ -45,8 +44,8 @@ namespace mln
{
- /*! \brief Generic bbox accumulator class.
- *
+ /// Generic bbox accumulator class.
+ /*!
* The parameter \c P is the type of points.
*/
template <typename P>
diff --git a/milena/mln/accu/compute.hh b/milena/mln/accu/compute.hh
index ad40de3..3da8d5f 100644
--- a/milena/mln/accu/compute.hh
+++ b/milena/mln/accu/compute.hh
@@ -47,8 +47,8 @@ namespace mln
namespace accu
{
- /*! \brief Make an accumulator compute the pixels of the image \p input.
- *
+ /// Make an accumulator compute the pixels of the image \p input.
+ /*!
* \param[in] input The input image.
*
* This routine runs: \n
@@ -62,8 +62,8 @@ namespace mln
compute(const Accumulator<A>& a, const Image<I>& input);
- /*! \brief Make an accumulator compute the pixels of the image \p input.
- *
+ /// Make an accumulator compute the pixels of the image \p input.
+ /*!
* \param[in] input The input image.
*
* This routine runs: \n
diff --git a/milena/mln/accu/convolve.hh b/milena/mln/accu/convolve.hh
index bad43c7..91db932 100644
--- a/milena/mln/accu/convolve.hh
+++ b/milena/mln/accu/convolve.hh
@@ -28,10 +28,9 @@
#ifndef MLN_ACCU_CONVOLVE_HH
# define MLN_ACCU_CONVOLVE_HH
-/*! \file mln/accu/convolve.hh
- *
- * \brief Define an accumulator that computes a convolution.
- */
+/// \file mln/accu/convolve.hh
+///
+/// Define an accumulator that computes a convolution.
# include <mln/accu/internal/base.hh>
# include <mln/value/ops.hh>
@@ -45,11 +44,11 @@ namespace mln
{
- /*! \brief Generic convolution accumulator class.
- *
- * Parameters \c T1 and \c T2 are the type of values to be
- * convolved. Parameter \c R is the result type.
- */
+ /// Generic convolution accumulator class.
+ ///
+ /// Parameters \c T1 and \c T2 are the type of values to be
+ /// convolved. Parameter \c R is the result type.
+ ///
template <typename T1, typename T2,
typename R = mln_sum_x(T1, T2)>
struct convolve : public mln::accu::internal::base< R, convolve<T1,T2,R> >,
diff --git a/milena/mln/accu/count.hh b/milena/mln/accu/count.hh
index da5fd21..9d68fec 100644
--- a/milena/mln/accu/count.hh
+++ b/milena/mln/accu/count.hh
@@ -31,7 +31,7 @@
/// \file mln/accu/count.hh
///
-/// \brief Define an accumulator that counts.
+/// Define an accumulator that counts.
# include <mln/accu/internal/base.hh>
# include <mln/core/concept/meta_accumulator.hh>
@@ -43,7 +43,7 @@ namespace mln
namespace accu
{
- /// \brief Generic counter accumulator class.
+ /// Generic counter accumulator class.
/// The parameter \a T is the type to be count.
template <typename T>
struct count : public mln::accu::internal::base< unsigned , count<T> >
@@ -81,7 +81,7 @@ namespace mln
namespace meta
{
- /// \brief Meta accumulator for count.
+ /// Meta accumulator for count.
struct count : public Meta_Accumulator< count >
{
template <typename T>
diff --git a/milena/mln/accu/count_adjacent_vertices.hh b/milena/mln/accu/count_adjacent_vertices.hh
index 69e8530..6d32509 100644
--- a/milena/mln/accu/count_adjacent_vertices.hh
+++ b/milena/mln/accu/count_adjacent_vertices.hh
@@ -30,7 +30,7 @@
# define MLN_ACCU_COUNT_ADJACENT_VERTICES_HH
/// \file mln/accu/count_adjacent_vertices.hh
-/// \brief Define an accumulator that counts the vertices adjacent to a
+/// Define an accumulator that counts the vertices adjacent to a
/// set of line graph psite.
# include <mln/accu/internal/base.hh>
@@ -44,7 +44,7 @@ namespace mln
namespace accu
{
- /// \brief Accumulator class counting the number of vertices
+ /// Accumulator class counting the number of vertices
/// adjacent to a set of mln::line_graph_psite (i.e., a set of
/// edges).
///
@@ -90,7 +90,7 @@ namespace mln
namespace meta
{
- /// \brief Meta accumulator for count_adjacent_vertices.
+ /// Meta accumulator for count_adjacent_vertices.
struct count_adjacent_vertices
: public Meta_Accumulator< count_adjacent_vertices >
{
diff --git a/milena/mln/accu/essential.hh b/milena/mln/accu/essential.hh
index 34124ba..18498f2 100644
--- a/milena/mln/accu/essential.hh
+++ b/milena/mln/accu/essential.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,11 +28,9 @@
#ifndef MLN_ACCU_ESSENTIAL_HH_
# define MLN_ACCU_ESSENTIAL_HH_
-/*! \file mln/accu/essential.hh
- *
- * \brief File that includes the most useful accumulator types.
- *
- */
+/// \file mln/accu/essential.hh
+///
+/// File that includes the most useful accumulator types.
# include <mln/accu/bbox.hh>
# include <mln/accu/count.hh>
diff --git a/milena/mln/accu/height.hh b/milena/mln/accu/height.hh
index f3dc59b..90eead5 100644
--- a/milena/mln/accu/height.hh
+++ b/milena/mln/accu/height.hh
@@ -29,17 +29,18 @@
#ifndef MLN_ACCU_HEIGHT_HH
# define MLN_ACCU_HEIGHT_HH
-/** \file mln/accu/height.hh
- \brief Define an accumulator that computes the height of a
- component through one of its pixels.
-
+/// \file mln/accu/height.hh
+/// Define an accumulator that computes the height of a
+/// component through one of its pixels.
+/*
This accumulator uses an mln::util::pix (pixel) to update the
height information of the component.
The class mln/accu/height is not a general-purpose accumulator;
it is used to implement height-based connected filters.
\see mln::morpho::closing_height
- \see mln::morpho::opening_height */
+ \see mln::morpho::opening_height
+*/
# include <mln/accu/internal/base.hh>
# include <mln/core/concept/meta_accumulator.hh>
@@ -54,7 +55,7 @@ namespace mln
namespace accu
{
- /// \brief Height accumulator class.
+ /// Height accumulator class.
///
/// The parameter \p I is the image type on which the accumulator
/// of pixels is built.
@@ -62,7 +63,7 @@ namespace mln
struct height
: public mln::accu::internal::base< unsigned , height<I> >
{
- /// \brief The accumulated data type.
+ /// The accumulated data type.
///
/// The height of component is represented by the height of its
/// root pixel. See mln::morpho::closing_height and
@@ -104,7 +105,7 @@ namespace mln
namespace meta
{
- /// \brief Meta accumulator for height.
+ /// Meta accumulator for height.
struct height : public Meta_Accumulator< height >
{
template <typename I>
diff --git a/milena/mln/accu/histo.hh b/milena/mln/accu/histo.hh
index 8468e4e..d4cc29a 100644
--- a/milena/mln/accu/histo.hh
+++ b/milena/mln/accu/histo.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,12 +28,12 @@
#ifndef MLN_ACCU_HISTO_HH
# define MLN_ACCU_HISTO_HH
-/*! \file mln/accu/histo.hh
- *
- * \brief Define a generic histogram accumulator class.
- *
- * \todo Use histo::data instead of std::vector!
- */
+/// \file mln/accu/histo.hh
+///
+/// Define a generic histogram accumulator class.
+///
+/// \todo Use histo::data instead of std::vector!
+
# include <vector>
# include <algorithm>
@@ -51,9 +51,9 @@ namespace mln
{
- /*!
- * \brief Generic histogram class over a value set with type \c V.
- */
+ ///
+ /// Generic histogram class over a value set with type \c V.
+ ///
template <typename V>
struct histo :
public mln::accu::internal::base<const std::vector<unsigned>& ,
diff --git a/milena/mln/accu/internal/base.hh b/milena/mln/accu/internal/base.hh
index ed9528f..50d38c4 100644
--- a/milena/mln/accu/internal/base.hh
+++ b/milena/mln/accu/internal/base.hh
@@ -1,4 +1,5 @@
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,11 +29,10 @@
#ifndef MLN_ACCU_INTERNAL_BASE_HH
# define MLN_ACCU_INTERNAL_BASE_HH
-/*! \file mln/accu/internal/base.hh
- *
- * \brief Define a base class for implementation of accumulator
- * classes.
- */
+/// \file mln/accu/internal/base.hh
+///
+/// Define a base class for implementation of accumulator
+/// classes.
# include <mln/core/concept/accumulator.hh>
@@ -46,9 +46,8 @@ namespace mln
namespace internal
{
- /*! Generic min accumulator class.
- * Base class for implementation of accumulator classes.
- */
+ /// Generic min accumulator class.
+ /// Base class for implementation of accumulator classes.
template <typename R, typename E>
class base : public Accumulator<E>,
public mln::internal::proxy_impl< R, E >
diff --git a/milena/mln/accu/land.hh b/milena/mln/accu/land.hh
index be7bb4d..c0b0171 100644
--- a/milena/mln/accu/land.hh
+++ b/milena/mln/accu/land.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,10 +28,10 @@
#ifndef MLN_ACCU_LAND_HH
# define MLN_ACCU_LAND_HH
-/*! \file mln/accu/land.hh
- *
- * \brief Define a 'logical-and' accumulator.
- */
+/// \file mln/accu/land.hh
+///
+/// Define a 'logical-and' accumulator.
+///
# include <mln/accu/internal/base.hh>
diff --git a/milena/mln/accu/line.hh b/milena/mln/accu/line.hh
index cb484d7..f7a3da3 100644
--- a/milena/mln/accu/line.hh
+++ b/milena/mln/accu/line.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
diff --git a/milena/mln/accu/maj_h.hh b/milena/mln/accu/maj_h.hh
index ffd545d..f73b216 100644
--- a/milena/mln/accu/maj_h.hh
+++ b/milena/mln/accu/maj_h.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,10 +28,10 @@
#ifndef MLN_ACCU_MAJ_H_HH
# define MLN_ACCU_MAJ_H_HH
-/*! \file mln/accu/maj_h.hh
- *
- * \brief Define an accumulator that computes a maj_h.
- */
+/// \file mln/accu/maj_h.hh
+///
+/// Define an accumulator that computes a maj_h.
+
# include <mln/core/concept/meta_accumulator.hh>
# include <mln/accu/internal/base.hh>
@@ -48,8 +48,8 @@ namespace mln
{
- /*! \brief Generic maj_h accumulator class.
- *
+ /// Generic maj_h accumulator class.
+ /*!
* The parameter \c T is the type of values.
*/
template <typename T>
diff --git a/milena/mln/accu/max.hh b/milena/mln/accu/max.hh
index 0cacbed..99de2e4 100644
--- a/milena/mln/accu/max.hh
+++ b/milena/mln/accu/max.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,10 +28,9 @@
#ifndef MLN_ACCU_MAX_HH
# define MLN_ACCU_MAX_HH
-/*! \file mln/accu/max.hh
- *
- * \brief Define an accumulator that computes a max.
- */
+/// \file mln/accu/max.hh
+///
+/// Define an accumulator that computes a max.
# include <mln/core/concept/meta_accumulator.hh>
# include <mln/accu/internal/base.hh>
@@ -46,10 +45,9 @@ namespace mln
{
- /*! \brief Generic max accumulator class.
- *
- * The parameter \c T is the type of values.
- */
+ /// Generic max accumulator class.
+ ///
+ /// The parameter \c T is the type of values.
template <typename T>
struct max : public mln::accu::internal::base< const T& , max<T> >
{
diff --git a/milena/mln/accu/max_h.hh b/milena/mln/accu/max_h.hh
index ece814a..dd3a3dc 100644
--- a/milena/mln/accu/max_h.hh
+++ b/milena/mln/accu/max_h.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,10 +28,9 @@
#ifndef MLN_ACCU_MAX_H_HH
# define MLN_ACCU_MAX_H_HH
-/*! \file mln/accu/max_h.hh
- *
- * \brief Define a generic max accumulator class based on histogram.
- */
+/// \file mln/accu/max_h.hh
+///
+/// Define a generic max accumulator class based on histogram.
# include <mln/accu/internal/base.hh>
# include <mln/accu/histo.hh>
@@ -45,9 +44,8 @@ namespace mln
{
- /*! \brief Generic max function based on histogram over a value set with
- * type \c V.
- */
+ /// Generic max function based on histogram over a value set with
+ /// type \c V.
template <typename V>
struct max_h : public mln::accu::internal::base< const V&, max_h<V> >
{
diff --git a/milena/mln/accu/mean.hh b/milena/mln/accu/mean.hh
index b58c100..c508ce1 100644
--- a/milena/mln/accu/mean.hh
+++ b/milena/mln/accu/mean.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,12 +28,11 @@
#ifndef MLN_ACCU_MEAN_HH
# define MLN_ACCU_MEAN_HH
-/*! \file mln/accu/mean.hh
- *
- * \brief Define an accumulator that computes a mean.
- *
- * \todo Use accu::pair just like in accu::min_max.
- */
+/// \file mln/accu/mean.hh
+///
+/// Define an accumulator that computes a mean.
+///
+/// \todo Use accu::pair just like in accu::min_max.
# include <mln/accu/internal/base.hh>
# include <mln/accu/count.hh>
@@ -47,8 +46,8 @@ namespace mln
{
- /*! \brief Generic mean accumulator class.
- *
+ /// Generic mean accumulator class.
+ /*!
* Parameter \c T is the type of values that we sum. Parameter \c
* S is the type to store the sum of values; the default type of
* \c S is the summation type (property) of \c T. Parameter \c M
diff --git a/milena/mln/accu/median_alt.hh b/milena/mln/accu/median_alt.hh
index 66bc5c5..98d0cac 100644
--- a/milena/mln/accu/median_alt.hh
+++ b/milena/mln/accu/median_alt.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,10 +28,9 @@
#ifndef MLN_ACCU_MEDIAN_ALT_HH
# define MLN_ACCU_MEDIAN_ALT_HH
-/*! \file mln/accu/median_alt.hh
- *
- * \brief Define alternative generic median accumulator class.
- */
+/// \file mln/accu/median_alt.hh
+///
+/// Define alternative generic median accumulator class.
# include <mln/accu/internal/base.hh>
# include <mln/accu/histo.hh>
@@ -44,9 +43,8 @@ namespace mln
{
- /*! \brief Generic median_alt function based on histogram over a
- * value set with type \c S.
- */
+ /// Generic median_alt function based on histogram over a
+ /// value set with type \c S.
template <typename S>
struct median_alt : public mln::accu::internal::base< const mln_value(S)&, median_alt<S> >
{
@@ -103,17 +101,29 @@ namespace mln
struct median_alt : public Meta_Accumulator< median_alt >
{
+ median_alt(const Value_Set<S>& s_) : s(s_) {}
+
template <typename V>
struct with
{
typedef accu::median_alt<V> ret;
};
+
+ Value_Set<S> s;
};
} // end of namespace mln::accu::meta
template <typename T>
+ median_alt<T> unmeta(const meta::median_alt& m, T)
+ {
+ median_alt<T> a(m.s);
+ return a;
+ }
+
+
+ template <typename T>
struct median_alt_on : public median_alt< value::set<T> >
{
median_alt_on()
diff --git a/milena/mln/accu/median_h.hh b/milena/mln/accu/median_h.hh
index 0c04e24..c7ea0e8 100644
--- a/milena/mln/accu/median_h.hh
+++ b/milena/mln/accu/median_h.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,10 +28,9 @@
#ifndef MLN_ACCU_MEDIAN_H_HH
# define MLN_ACCU_MEDIAN_H_HH
-/*! \file mln/accu/median_h.hh
- *
- * \brief Define a generic median accumulator class.
- */
+/// \file mln/accu/median_h.hh
+///
+/// Define a generic median accumulator class.
# include <mln/accu/internal/base.hh>
# include <mln/accu/histo.hh>
@@ -45,9 +44,8 @@ namespace mln
{
- /*! \brief Generic median function based on histogram over a value
- * set with type \c V.
- */
+ /// Generic median function based on histogram over a value
+ /// set with type \c V.
template <typename V>
struct median_h : public mln::accu::internal::base< const V&, median_h<V> >
{
@@ -77,13 +75,13 @@ namespace mln
protected:
mutable accu::histo<V> h_;
- const value::set<V>& s_; // derived from h_
+ const value::set<V>& s_; // derived from h_
mutable unsigned sum_minus_, sum_plus_;
mutable bool valid_;
- mutable unsigned i_; // the median_h index
- mutable argument t_; // the median_h value
+ mutable unsigned i_; // the median_h index
+ mutable argument t_; // the median_h value
// Auxiliary methods
void update_() const;
diff --git a/milena/mln/accu/min.hh b/milena/mln/accu/min.hh
index 83e6804..1825c7f 100644
--- a/milena/mln/accu/min.hh
+++ b/milena/mln/accu/min.hh
@@ -46,8 +46,8 @@ namespace mln
{
- /*! \brief Generic min accumulator class.
- *
+ /// Generic min accumulator class.
+ /*!
* The parameter \c T is the type of values.
*/
template <typename T>
diff --git a/milena/mln/accu/min_h.hh b/milena/mln/accu/min_h.hh
index fd3706e..e4e8fee 100644
--- a/milena/mln/accu/min_h.hh
+++ b/milena/mln/accu/min_h.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,10 +28,9 @@
#ifndef MLN_ACCU_MIN_H_HH
# define MLN_ACCU_MIN_H_HH
-/*! \file mln/accu/min_h.hh
- *
- * \brief Define a generic min accumulator class based on histogram.
- */
+/// \file mln/accu/min_h.hh
+///
+/// Define a generic min accumulator class based on histogram.
# include <mln/accu/internal/base.hh>
# include <mln/accu/histo.hh>
@@ -46,9 +45,8 @@ namespace mln
{
- /*! \brief Generic min function based on histogram over a value
- * set with type \c V.
- */
+ /// Generic min function based on histogram over a value
+ /// set with type \c V.
template <typename V>
struct min_h : public mln::accu::internal::base< const V& , min_h<V> >
{
@@ -102,9 +100,7 @@ namespace mln
namespace meta
{
- /*!
- * \brief Meta accumulator for min.
- */
+ /// Meta accumulator for min.
struct min_h : public Meta_Accumulator< min_h >
{
template <typename T>
diff --git a/milena/mln/accu/min_max.hh b/milena/mln/accu/min_max.hh
index 11b1a33..6f90560 100644
--- a/milena/mln/accu/min_max.hh
+++ b/milena/mln/accu/min_max.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,12 +28,11 @@
#ifndef MLN_ACCU_MIN_MAX_HH
# define MLN_ACCU_MIN_MAX_HH
-/*! \file mln/accu/min_max.hh
- *
- * \brief Define an accumulator that computes a min and a max.
- *
- * \todo A macro to create such accumulators.
- */
+/// \file mln/accu/min_max.hh
+///
+/// Define an accumulator that computes a min and a max.
+///
+/// \todo A macro to create such accumulators.
# include <utility>
@@ -50,8 +49,8 @@ namespace mln
namespace accu
{
- /*! \brief Generic min and max accumulator class.
- *
+ /// Generic min and max accumulator class.
+ /*!
* The parameter \c V is the type of values.
*/
template <typename V>
diff --git a/milena/mln/accu/nil.hh b/milena/mln/accu/nil.hh
index 0887715..e085deb 100644
--- a/milena/mln/accu/nil.hh
+++ b/milena/mln/accu/nil.hh
@@ -1,4 +1,5 @@
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,12 +29,11 @@
#ifndef MLN_ACCU_NIL_HH
# define MLN_ACCU_NIL_HH
-/*! \file mln/accu/nil.hh
- *
- * \brief Define an accumulator that does nothing.
- *
- * \todo A macro to generate the meta version.
- */
+/// \file mln/accu/nil.hh
+///
+/// Define an accumulator that does nothing.
+///
+/// \todo A macro to generate the meta version.
# include <mln/core/concept/meta_accumulator.hh>
# include <mln/accu/internal/base.hh>
@@ -47,9 +47,7 @@ namespace mln
namespace accu
{
- /*!
- * \brief Define an accumulator that does nothing.
- */
+ /// Define an accumulator that does nothing.
template <typename T>
struct nil : public mln::accu::internal::base< util::ignore , nil<T> >
{
diff --git a/milena/mln/accu/p.hh b/milena/mln/accu/p.hh
index bcb36c2..dc3f41f 100644
--- a/milena/mln/accu/p.hh
+++ b/milena/mln/accu/p.hh
@@ -1,4 +1,5 @@
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,10 +29,9 @@
#ifndef MLN_ACCU_P_HH
# define MLN_ACCU_P_HH
-/*! \file mln/accu/p.hh
- *
- * \brief Define an accumulator that computes a min and a max.
- */
+/// \file mln/accu/p.hh
+///
+/// Define an accumulator that computes a min and a max.
# include <mln/core/concept/meta_accumulator.hh>
@@ -46,11 +46,9 @@ namespace mln
{
- /*!
- * \brief Generic p of accumulators.
- *
- * The parameter \c V is the type of values.
- */
+ ///Generic p of accumulators.
+ ///
+ /// The parameter \c V is the type of values.
template <typename A>
struct p : public mln::accu::internal::base< const mln_result(A)& , p<A> >
{
diff --git a/milena/mln/accu/pair.hh b/milena/mln/accu/pair.hh
index b431742..a1bdbd7 100644
--- a/milena/mln/accu/pair.hh
+++ b/milena/mln/accu/pair.hh
@@ -1,4 +1,5 @@
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,10 +29,9 @@
#ifndef MLN_ACCU_PAIR_HH
# define MLN_ACCU_PAIR_HH
-/*! \file mln/accu/pair.hh
- *
- * \brief Define a pair of accumulators.
- */
+/// \file mln/accu/pair.hh
+///
+/// Define a pair of accumulators.
# include <utility>
@@ -49,12 +49,11 @@ namespace mln
{
- /*! \brief Generic pair of accumulators.
- *
- * The parameter \c T is the type of values.
- *
- * \todo Check that, when T is not provided, A1 and A2 have the same value.
- */
+ /// Generic pair of accumulators.
+ ///
+ /// The parameter \c T is the type of values.
+ ///
+ /// \todo Check that, when T is not provided, A1 and A2 have the same value.
template <typename A1, typename A2, typename T = mln_argument(A1)>
struct pair : public mln::accu::internal::base< std::pair<mln_result(A1), mln_result(A2)>,
pair<A1,A2,T> >
@@ -65,7 +64,8 @@ namespace mln
typedef mln_result(A2) result_2;
pair();
- pair(const A1& a1, const A2& a2);
+// FIXME: not implemented. Do we want it?
+// pair(const A1& a1, const A2& a2);
/// Manipulators.
/// \{
diff --git a/milena/mln/accu/rank.hh b/milena/mln/accu/rank.hh
index 7d7ce17..bdd4df0 100644
--- a/milena/mln/accu/rank.hh
+++ b/milena/mln/accu/rank.hh
@@ -50,8 +50,8 @@ namespace mln
{
- /*! \brief Generic rank accumulator class.
- *
+ /// Generic rank accumulator class.
+ /*!
* The parameter \c T is the type of values.
*/
template <typename T>
@@ -82,7 +82,7 @@ namespace mln
/// Give the rank.
unsigned k() const;
- /// Give the total number of elements.
+ /// Give the total number of elements.
unsigned n() const;
protected:
@@ -116,12 +116,16 @@ namespace mln
struct rank : public Meta_Accumulator< rank >
{
+ rank(unsigned k_, unsigned n_) : k(k_), n(n_) {}
+
template <typename T>
struct with
{
typedef accu::rank<T> ret;
};
- unsigned k, n;
+
+ unsigned k;
+ unsigned n;
};
} // end of namespace mln::accu::meta
diff --git a/milena/mln/accu/rank_bool.hh b/milena/mln/accu/rank_bool.hh
index 6fec53a..f5e9b07 100644
--- a/milena/mln/accu/rank_bool.hh
+++ b/milena/mln/accu/rank_bool.hh
@@ -1,4 +1,5 @@
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,15 +29,14 @@
#ifndef MLN_ACCU_RANK_BOOL_HH
# define MLN_ACCU_RANK_BOOL_HH
-/*! \file mln/accu/rank_bool.hh
- *
- * \brief Define an rank accumulator.
- *
- * \todo There is no-arg-ctor so this accumulator does not support
- * deferred initialization!
- *
- * \todo Add untake routines...
- */
+/// \file mln/accu/rank_bool.hh
+///
+/// Define an rank accumulator.
+///
+/// \todo There is no-arg-ctor so this accumulator does not support
+/// deferred initialization!
+///
+/// \todo Add untake routines...
# include <mln/accu/internal/base.hh>
@@ -50,9 +50,7 @@ namespace mln
// Fwd declaration.
template <typename T> struct rank;
- /*! \brief rank accumulator class for Boolean.
- *
- */
+ /// rank accumulator class for Boolean.
template <>
struct rank<bool> : public mln::accu::internal::base< bool, rank<bool> >
{
diff --git a/milena/mln/accu/rank_high_quant.hh b/milena/mln/accu/rank_high_quant.hh
index b4d69a1..0f002cd 100644
--- a/milena/mln/accu/rank_high_quant.hh
+++ b/milena/mln/accu/rank_high_quant.hh
@@ -1,4 +1,5 @@
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,10 +29,9 @@
#ifndef MLN_ACCU_RANK_HH
# define MLN_ACCU_RANK_HH
-/*! \file mln/accu/rank.hh
- *
- * \brief Define an rank accumulator.
- */
+/// \file mln/accu/rank.hh
+///
+/// Define an rank accumulator.
# include <vector>
# include <mln/accu/internal/base.hh>
@@ -47,8 +47,8 @@ namespace mln
{
- /*! \brief Generic rank accumulator class.
- *
+ /// Generic rank accumulator class.
+ /*!
* The parameter \c T is the type of values.
*/
template <typename T>
@@ -93,16 +93,29 @@ namespace mln
struct rank : public Meta_Accumulator< rank >
{
+ rank(unsigned k_, unsigned n_) : k(k_), n(n_) {}
+
template <typename T>
struct with
{
typedef accu::rank<T> ret;
};
+
+ unsigned k;
+ unsigned n;
};
}
+ template <typename T>
+ rank<T> unmeta(const meta::rank& m, T)
+ {
+ rank<T> a(m.k, m.n);
+ return a;
+ }
+
+
# ifndef MLN_INCLUDE_ONLY
template <typename T>
diff --git a/milena/mln/accu/snake_2d.hh b/milena/mln/accu/snake_2d.hh
index 27e4d5f..c055a90 100644
--- a/milena/mln/accu/snake_2d.hh
+++ b/milena/mln/accu/snake_2d.hh
@@ -75,7 +75,7 @@ namespace mln
mln_precondition(input.has_data());
mln_precondition(! win.is_empty());
// mln_precondition(! win.is_valid());
-
+
(void) input;
(void) win;
}
diff --git a/milena/mln/accu/sum.hh b/milena/mln/accu/sum.hh
index fcfc3ba..d330590 100644
--- a/milena/mln/accu/sum.hh
+++ b/milena/mln/accu/sum.hh
@@ -1,4 +1,5 @@
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,10 +29,9 @@
#ifndef MLN_ACCU_SUM_HH
# define MLN_ACCU_SUM_HH
-/*! \file mln/accu/sum.hh
- *
- * \brief Define an accumulator that computes a sum.
- */
+/// \file mln/accu/sum.hh
+///
+/// Define an accumulator that computes a sum.
# include <mln/core/concept/meta_accumulator.hh>
# include <mln/accu/internal/base.hh>
@@ -50,8 +50,8 @@ namespace mln
{
- /*! \brief Generic sum accumulator class.
- *
+ /// Generic sum accumulator class.
+ /*!
* Parameter \c T is the type of values that we sum. Parameter \c
* S is the type to store the value sum; the default type of
* \c S is the summation type (property) of \c T.
diff --git a/milena/mln/accu/take.hh b/milena/mln/accu/take.hh
index deadcaf..5b7f3e8 100644
--- a/milena/mln/accu/take.hh
+++ b/milena/mln/accu/take.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,10 +29,9 @@
#ifndef MLN_ACCU_TAKE_HH
# define MLN_ACCU_TAKE_HH
-/*! \file mln/accu/take.hh
- *
- * \brief Define an accumulator that takes image pixels.
- */
+/// \file mln/accu/take.hh
+///
+/// Define an accumulator that takes image pixels.
# include <mln/core/concept/accumulator.hh>
# include <mln/core/concept/image.hh>
@@ -44,8 +44,8 @@ namespace mln
namespace accu
{
- /*! \brief Make an accumulator take the pixels of the image \p input.
- *
+ /// Make an accumulator take the pixels of the image \p input.
+ /*!
* \param[in] input The input image.
* \param[in,out] a The accumulator.
*
diff --git a/milena/mln/accu/transform.hh b/milena/mln/accu/transform.hh
index 275ac21..3829432 100644
--- a/milena/mln/accu/transform.hh
+++ b/milena/mln/accu/transform.hh
@@ -49,13 +49,13 @@ namespace mln
template <typename I, typename A, typename W>
mln_ch_value(I, mln_result(A))
- transform(const Image<I>& input,
+ transform(const Image<I>& input,
const Accumulator<A>& a,
const Window<W>& win);
template <typename I, typename A, typename W>
mln_ch_value(I, mln_accu_with(A, mln_value(I))::result)
- transform(const Image<I>& input,
+ transform(const Image<I>& input,
const Meta_Accumulator<A>& a,
const Window<W>& win);
@@ -69,7 +69,7 @@ namespace mln
namespace generic
{
-
+
template <typename I, typename A, typename W>
mln_ch_value(I, mln_result(A))
transform(const Image<I>& input_,
@@ -86,7 +86,7 @@ namespace mln
// mln_precondition(win.is_valid());
extension::adjust(input, win);
-
+
mln_ch_value(I, mln_result(A)) output;
initialize(output, input);
@@ -105,7 +105,7 @@ namespace mln
}
} // end of namespace mln::accu::impl::generic
-
+
} // end of namespace mln::accu::impl
diff --git a/milena/mln/accu/tuple.hh b/milena/mln/accu/tuple.hh
index f70882b..3ad7be2 100644
--- a/milena/mln/accu/tuple.hh
+++ b/milena/mln/accu/tuple.hh
@@ -1,4 +1,5 @@
// Copyright (C) 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,10 +29,10 @@
#ifndef MLN_ACCU_TUPLE_HH
# define MLN_ACCU_TUPLE_HH
-/*! \file mln/accu/tuple.hh
- *
- * \brief Define a tuple of accumulators.
- */
+/// \file mln/accu/tuple.hh
+///
+/// Define a tuple of accumulators.
+
# include <utility>
@@ -65,10 +66,9 @@ namespace mln
template <unsigned n, typename T> struct tuplehelper;
}
- /*! \brief Generic tuple of accumulators.
- *
+ /// Generic tuple of accumulators.
+ /*!
* The parameter \c T is the type of values.
- *
*/
template <typename A, unsigned n, BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(10, typename T, boost::tuples::null_type)>
struct tuple
diff --git a/milena/mln/accu/v.hh b/milena/mln/accu/v.hh
index a7f4cdf..bb522b7 100644
--- a/milena/mln/accu/v.hh
+++ b/milena/mln/accu/v.hh
@@ -1,4 +1,5 @@
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,10 +29,10 @@
#ifndef MLN_ACCU_V_HH
# define MLN_ACCU_V_HH
-/*! \file mln/accu/v.hh
- *
- * \brief Define an accumulator that computes a min and a max.
- */
+/// \file mln/accu/v.hh
+///
+/// Define an accumulator that computes a min and a max.
+
# include <mln/core/concept/meta_accumulator.hh>
# include <mln/accu/internal/base.hh>
@@ -89,11 +90,11 @@ namespace mln
struct val : public Meta_Accumulator< val<mA> >
{
template <typename V>
- struct with
- {
- typedef mln_accu_with(mA, mln_value(V)) A;
- typedef val<A> ret;
- };
+ struct with
+ {
+ typedef mln_accu_with(mA, mln_value(V)) A;
+ typedef val<A> ret;
+ };
};
}
diff --git a/milena/mln/accu/volume.hh b/milena/mln/accu/volume.hh
index 705434b..9ace873 100644
--- a/milena/mln/accu/volume.hh
+++ b/milena/mln/accu/volume.hh
@@ -28,17 +28,18 @@
#ifndef MLN_ACCU_VOLUME_HH
# define MLN_ACCU_VOLUME_HH
-/** \file mln/accu/volume.hh
- \brief Define an accumulator that computes the volume of a
- component through one of its pixels.
-
+/// \file mln/accu/volume.hh
+/// Define an accumulator that computes the volume of a
+/// component through one of its pixels.
+/*!
This accumulator uses an mln::util::pix (pixel) to update the
reference level, area and volume information of the component.
The class mln/accu/volume is not a general-purpose accumulator;
it is used to implement volume-based connected filters.
\see mln::morpho::closing_volume
- \see mln::morpho::opening_volume */
+ \see mln::morpho::opening_volume
+*/
# include <mln/accu/internal/base.hh>
# include <mln/core/concept/meta_accumulator.hh>
@@ -53,7 +54,7 @@ namespace mln
namespace accu
{
- /// \brief Volume accumulator class.
+ /// Volume accumulator class.
///
/// The parameter \p I is the image type on which the accumulator
/// of pixels is built.
@@ -61,7 +62,7 @@ namespace mln
struct volume
: public mln::accu::internal::base< unsigned , volume<I> >
{
- /// \brief The accumulated data type.
+ /// The accumulated data type.
///
/// The volume of component is represented by the volume of its
/// root pixel. See mln::morpho::closing_volume and
diff --git a/milena/mln/algebra/quat.hh b/milena/mln/algebra/quat.hh
index 4e44e90..f786ac1 100644
--- a/milena/mln/algebra/quat.hh
+++ b/milena/mln/algebra/quat.hh
@@ -448,6 +448,7 @@ namespace mln
quat::quat(unsigned one, float theta, const algebra::vec<3,float>& uv)
{
mln_precondition(one == 1);
+ (void) one;
set_unit(theta, uv);
}
diff --git a/milena/mln/geom/essential.hh b/milena/mln/geom/essential.hh
index 41d1fd9..cd9297a 100644
--- a/milena/mln/geom/essential.hh
+++ b/milena/mln/geom/essential.hh
@@ -54,4 +54,14 @@ namespace mln
# include <mln/geom/size3d.hh>
# include <mln/geom/nsites.hh>
+# include <mln/geom/max_col.hh>
+# include <mln/geom/max_ind.hh>
+# include <mln/geom/max_row.hh>
+# include <mln/geom/max_sli.hh>
+
+# include <mln/geom/min_col.hh>
+# include <mln/geom/min_ind.hh>
+# include <mln/geom/min_row.hh>
+# include <mln/geom/min_sli.hh>
+
#endif // ! MLN_GEOM_ESSENTIAL_HH
diff --git a/milena/mln/morpho/elementary/like_ero_fun.hh b/milena/mln/morpho/elementary/like_ero_fun.hh
index 39399d8..772259f 100644
--- a/milena/mln/morpho/elementary/like_ero_fun.hh
+++ b/milena/mln/morpho/elementary/like_ero_fun.hh
@@ -61,7 +61,7 @@ namespace mln
struct f_accu
{
template <typename V, typename A>
- V operator()(const V& input_p, const A& a) const
+ V operator()(const V& /*input_p*/, const A& a) const
{
return a.to_result();
}
diff --git a/milena/mln/value/essential.hh b/milena/mln/value/essential.hh
index 7ba742a..e537eff 100644
--- a/milena/mln/value/essential.hh
+++ b/milena/mln/value/essential.hh
@@ -39,8 +39,8 @@
# include <mln/value/float01_8.hh>
# include <mln/value/float01_16.hh>
-# include <mln/value/gl8.hh>
-# include <mln/value/gl16.hh>
+//# include <mln/value/gl8.hh>
+//# include <mln/value/gl16.hh>
# include <mln/value/int_s8.hh>
# include <mln/value/int_s16.hh>
diff --git a/milena/tests/accu/rank.cc b/milena/tests/accu/rank.cc
index 2f4061c..9c334a9 100644
--- a/milena/tests/accu/rank.cc
+++ b/milena/tests/accu/rank.cc
@@ -55,9 +55,7 @@ int main()
using value::int_u8;
{
- accu::meta::rank r;
- r.k = 4;
- r.n = 9;
+ accu::meta::rank r(4, 9);
accu::rank<int_u8> a = accu::unmeta(r, int_u8());
mln_assertion(a.k() == 4 && a.n() == 9);
// Meta_Accumulator<accu::meta::rank>& R = r;
--
1.5.6.5
1
0
* configure.ac: Add tutorial/samples Makefiles.
---
ChangeLog | 6 ++++++
configure.ac | 2 ++
2 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 36248ed..fabc2f3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-11-06 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Update configure.ac for the tutorial.
+
+ * configure.ac: Add tutorial/samples Makefiles.
+
2008-11-10 Matthieu Garrigues <garrigues(a)lrde.epita.fr>
Put Licence to 70 cols.
diff --git a/configure.ac b/configure.ac
index 0e00ce4..0a407d2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -144,6 +144,8 @@ AC_CONFIG_FILES([
external/Makefile
milena/Makefile
milena/doc/Makefile
+ milena/doc/tutorial/Makefile
+ milena/doc/tutorial/samples/Makefile
milena/tools/Makefile
])
--
1.5.6.5
1
0
* doc/Doxyfile.in: Add new example/include paths.
* doc/tutorial/Makefile.am,
* doc/Makefile.am: Add a new target for the tutorial.
Rename target "internal" to "complete.
* doc/tutorial/todoxygen.sh: script to convert .tex files to .html
files. It uses Hevea.
* doc/tutorial/samples/borderthickness.cc,
* doc/tutorial/samples/extension-ignore2.cc,
* doc/tutorial/samples/ima-size.cc,
* doc/tutorial/samples/ima2d-1.cc,
* doc/tutorial/samples/ima2d-decl-2-blobs-full.cc,
* doc/tutorial/samples/ima2d-rot.cc,
* doc/tutorial/samples/labeling-compute-full.cc,
* doc/tutorial/samples/logical-not.cc,
* doc/tutorial/samples/paste-call-1.cc,
* doc/tutorial/samples/plop.ppm,
* doc/tutorial/samples/win-create-3.cc: Fix sample code.
* doc/tutorial/samples/Makefile.am: add new target for sample
programs.
* doc/tutorial/tutorial.tex: Include images.
* mln/core/internal/complex_window_p_base.hh,
* mln/core/routine/extend.hh,
* mln/core/site_set/p_complex.hh,
* mln/debug/graph.hh,
* mln/debug/println_with_border.hh,
* mln/fun/x2v/bilinear.hh,
* mln/fun/x2v/linear.hh,
* mln/fun/x2v/nneighbor.hh,
* mln/geom/nsites.hh,
* mln/topo/n_face.hh,
* mln/util/internal/graph_nbh_iter.hh,
* tests/core/site_set/p_complex.cc,
* tests/morpho/complex_image_wst.cc: Fix doxygen warnings.
* doc/doc.mk: Add shared variables for doc generation.
* doc/tutorial/samples/borderthickness-output.tex,
* doc/tutorial/samples/dpoint-1-output.tex,
* doc/tutorial/samples/graph-output-1.tex,
* doc/tutorial/samples/ima-size-output.tex,
* doc/tutorial/samples/ima2d-1-output.tex,
* doc/tutorial/samples/ima2d-3-output.tex,
* doc/tutorial/samples/ima2d-decl-2-blobs-output.tex,
* doc/tutorial/samples/ima2d-display-output-1.tex,
* doc/tutorial/samples/ima2d-display-output-2.tex,
* doc/tutorial/samples/labeling-compute-result-output.tex,
* doc/tutorial/samples/logical-not-output.tex,
* doc/tutorial/samples/paste-call-1-output.tex,
* doc/tutorial/samples/point-1-output.tex: removed since they will be
generated.
* doc/tutorial/samples/accu-right-instanciation.tex,
* doc/tutorial/samples/accu-right-instanciation.cc,
* doc/tutorial/samples/accu-wrong-instanciation.tex,
* doc/tutorial/samples/accu-wrong-instanciation.cc,
* doc/tutorial/samples/borderthickness.tex,
* doc/tutorial/samples/borderthickness.cc,
* doc/tutorial/samples/box2d-1.tex,
* doc/tutorial/samples/box2d-1.cc,
* doc/tutorial/samples/box2d-2.tex,
* doc/tutorial/samples/box2d-2.cc,
* doc/tutorial/samples/domain-display-1.tex,
* doc/tutorial/samples/domain-display-1.cc,
* doc/tutorial/samples/domain-display-out-1.tex,
* doc/tutorial/samples/domain-display-out-1.cc,
* doc/tutorial/samples/dpoint-1.tex,
* doc/tutorial/samples/dpoint-1.cc,
* doc/tutorial/samples/estim-sites.tex,
* doc/tutorial/samples/estim-sites.cc,
* doc/tutorial/samples/extension-ignore.tex,
* doc/tutorial/samples/extension-ignore.cc,
* doc/tutorial/samples/extension-ignore2.tex,
* doc/tutorial/samples/extension-ignore2.cc,
* doc/tutorial/samples/fill-call-1.tex,
* doc/tutorial/samples/fill-call-1.cc,
* doc/tutorial/samples/fill-part-1.tex,
* doc/tutorial/samples/fill-part-1.cc,
* doc/tutorial/samples/fill-part-2.tex,
* doc/tutorial/samples/fill-part-2.cc,
* doc/tutorial/samples/fill-part-3.tex,
* doc/tutorial/samples/fill-part-3.cc,
* doc/tutorial/samples/fill.tex,
* doc/tutorial/samples/fill.cc,
* doc/tutorial/samples/forall-piter-1.tex,
* doc/tutorial/samples/forall-piter-1.cc,
* doc/tutorial/samples/fun-p2b-1.tex,
* doc/tutorial/samples/fun-p2b-1.cc,
* doc/tutorial/samples/fun-p2v-1.tex,
* doc/tutorial/samples/fun-p2v-1.cc,
* doc/tutorial/samples/graph-add-edges.tex,
* doc/tutorial/samples/graph-add-edges.cc,
* doc/tutorial/samples/graph-add-vertex.tex,
* doc/tutorial/samples/graph-add-vertex.cc,
* doc/tutorial/samples/graph-data.tex,
* doc/tutorial/samples/graph-data.cc,
* doc/tutorial/samples/graph-i2v-vertex.tex,
* doc/tutorial/samples/graph-i2v-vertex.cc,
* doc/tutorial/samples/graph-iter-edge-nbh-edge.tex,
* doc/tutorial/samples/graph-iter-edge-nbh-edge.cc,
* doc/tutorial/samples/graph-iter-vertex-nbh-vertex.tex,
* doc/tutorial/samples/graph-iter-vertex-nbh-vertex.cc,
* doc/tutorial/samples/graph-iter-vertex.tex,
* doc/tutorial/samples/graph-iter-vertex.cc,
* doc/tutorial/samples/graph-iter.tex,
* doc/tutorial/samples/graph-iter.cc,
* doc/tutorial/samples/graph-p-vertices.tex,
* doc/tutorial/samples/graph-p-vertices.cc,
* doc/tutorial/samples/ima-has.cc,
* doc/tutorial/samples/ima-load.tex,
* doc/tutorial/samples/ima-load.cc,
* doc/tutorial/samples/ima-save.tex,
* doc/tutorial/samples/ima-save.cc,
* doc/tutorial/samples/ima-size.tex,
* doc/tutorial/samples/ima-size.cc,
* doc/tutorial/samples/ima2d-1.tex,
* doc/tutorial/samples/ima2d-2.tex,
* doc/tutorial/samples/ima2d-3.tex,
* doc/tutorial/samples/ima2d-4.tex,
* doc/tutorial/samples/ima2d-5.tex,
* doc/tutorial/samples/ima2d-1.cc,
* doc/tutorial/samples/ima2d-2.cc,
* doc/tutorial/samples/ima2d-3.cc,
* doc/tutorial/samples/ima2d-4.cc,
* doc/tutorial/samples/ima2d-5.cc,
* doc/tutorial/samples/ima2d-6-clone.tex,
* doc/tutorial/samples/ima2d-6-clone.cc,
* doc/tutorial/samples/ima2d-7.tex,
* doc/tutorial/samples/ima2d-7.cc,
* doc/tutorial/samples/ima2d-decl-1.tex,
* doc/tutorial/samples/ima2d-decl-1.cc,
* doc/tutorial/samples/ima2d-decl-2-blobs.tex,
* doc/tutorial/samples/ima2d-decl-2-blobs.cc,
* doc/tutorial/samples/ima2d-decl-2.tex,
* doc/tutorial/samples/ima2d-decl-2.cc,
* doc/tutorial/samples/ima2d-display-1.tex,
* doc/tutorial/samples/ima2d-display-1.cc,
* doc/tutorial/samples/ima2d-display-2.tex,
* doc/tutorial/samples/ima2d-display-2.cc,
* doc/tutorial/samples/ima2d-restricted-1.tex,
* doc/tutorial/samples/ima2d-restricted-2.tex,
* doc/tutorial/samples/ima2d-restricted-3.tex,
* doc/tutorial/samples/ima2d-restricted-1.cc,
* doc/tutorial/samples/ima2d-restricted-2.cc,
* doc/tutorial/samples/ima2d-restricted-3.cc,
* doc/tutorial/samples/ima2d-restricted-display-1.tex,
* doc/tutorial/samples/ima2d-restricted-display-1.cc,
* doc/tutorial/samples/ima2d-rot.cc,
* doc/tutorial/samples/labeling-compute-call.tex,
* doc/tutorial/samples/labeling-compute-call.cc,
* doc/tutorial/samples/labeling-compute-result.tex,
* doc/tutorial/samples/labeling-compute-result.cc,
* doc/tutorial/samples/logical-not.tex,
* doc/tutorial/samples/logical-not.cc,
* doc/tutorial/samples/mln_var-1.tex,
* doc/tutorial/samples/mln_var-1.cc,
* doc/tutorial/samples/mln_var-2.tex,
* doc/tutorial/samples/mln_var-2.cc,
* doc/tutorial/samples/mln_var-3.tex,
* doc/tutorial/samples/mln_var-3.cc,
* doc/tutorial/samples/parray-append.tex,
* doc/tutorial/samples/parray-append.cc,
* doc/tutorial/samples/parray-display-1.tex,
* doc/tutorial/samples/parray-display-1.cc,
* doc/tutorial/samples/paste-call-1.tex,
* doc/tutorial/samples/paste-call-1.cc,
* doc/tutorial/samples/paste.tex,
* doc/tutorial/samples/paste.cc,
* doc/tutorial/samples/point-1.tex,
* doc/tutorial/samples/point-1.cc,
* doc/tutorial/samples/predicate-1.tex,
* doc/tutorial/samples/predicate-1.cc,
* doc/tutorial/samples/win-create-1-display.tex,
* doc/tutorial/samples/win-create-1-display.cc,
* doc/tutorial/samples/win-create-1.tex,
* doc/tutorial/samples/win-create-1.cc,
* doc/tutorial/samples/win-create-2.tex,
* doc/tutorial/samples/win-create-2.cc: rename *.tex to *.cc.
* doc/tutorial/tutorial.tex: update.
plop
---
milena/ChangeLog | 190 +++++++++++++++++++
milena/doc/Doxyfile.in | 22 ++-
milena/doc/Makefile.am | 59 ++++---
milena/doc/doc.mk | 7 +
milena/doc/tutorial/Makefile.am | 18 ++
.../graph-output-1.txt} | 0
.../ima2d-3-output.txt} | 0
.../ima2d-display-output-1.txt} | 0
.../ima2d-display-output-2.txt} | 0
milena/doc/tutorial/samples/Makefile.am | 41 ++++
...stanciation.tex => accu-right-instanciation.cc} | 0
...stanciation.tex => accu-wrong-instanciation.cc} | 0
.../tutorial/samples/borderthickness-output.tex | 13 --
milena/doc/tutorial/samples/borderthickness.cc | 18 ++
milena/doc/tutorial/samples/borderthickness.tex | 17 --
.../tutorial/samples/{box2d-1.tex => box2d-1.cc} | 0
.../tutorial/samples/{box2d-2.tex => box2d-2.cc} | 0
.../{domain-display-1.tex => domain-display-1.cc} | 0
...n-display-out-1.tex => domain-display-out-1.cc} | 0
milena/doc/tutorial/samples/dpoint-1-output.tex | 1 -
.../tutorial/samples/{dpoint-1.tex => dpoint-1.cc} | 0
.../samples/{estim-sites.tex => estim-sites.cc} | 0
.../{extension-ignore.tex => extension-ignore.cc} | 0
milena/doc/tutorial/samples/extension-ignore2.tex | 1 -
.../samples/{fill-call-1.tex => fill-call-1.cc} | 0
.../samples/{fill-part-1.tex => fill-part-1.cc} | 0
.../samples/{fill-part-2.tex => fill-part-2.cc} | 0
.../samples/{fill-part-3.tex => fill-part-3.cc} | 0
milena/doc/tutorial/samples/{fill.tex => fill.cc} | 0
.../{forall-piter-1.tex => forall-piter-1.cc} | 0
.../samples/{fun-p2b-1.tex => fun-p2b-1.cc} | 0
.../samples/{fun-p2v-1.tex => fun-p2v-1.cc} | 0
.../{graph-add-edges.tex => graph-add-edges.cc} | 0
.../{graph-add-vertex.tex => graph-add-vertex.cc} | 0
.../samples/{graph-data.tex => graph-data.cc} | 0
.../{graph-i2v-vertex.tex => graph-i2v-vertex.cc} | 0
...ge-nbh-edge.tex => graph-iter-edge-nbh-edge.cc} | 0
...-vertex.tex => graph-iter-vertex-nbh-vertex.cc} | 0
...{graph-iter-vertex.tex => graph-iter-vertex.cc} | 0
.../samples/{graph-iter.tex => graph-iter.cc} | 0
.../{graph-p-vertices.tex => graph-p-vertices.cc} | 0
milena/doc/tutorial/samples/ima-has.cc | 38 ++++
.../tutorial/samples/{ima-load.tex => ima-load.cc} | 0
.../tutorial/samples/{ima-save.tex => ima-save.cc} | 0
milena/doc/tutorial/samples/ima-size-output.tex | 1 -
.../tutorial/samples/{ima-size.tex => ima-size.cc} | 7 +-
milena/doc/tutorial/samples/ima2d-1-output.tex | 2 -
milena/doc/tutorial/samples/ima2d-1.cc | 13 ++
milena/doc/tutorial/samples/ima2d-1.tex | 12 --
.../tutorial/samples/{ima2d-2.tex => ima2d-2.cc} | 0
.../tutorial/samples/{ima2d-3.tex => ima2d-3.cc} | 0
.../tutorial/samples/{ima2d-4.tex => ima2d-4.cc} | 0
.../tutorial/samples/{ima2d-5.tex => ima2d-5.cc} | 0
.../{ima2d-6-clone.tex => ima2d-6-clone.cc} | 0
.../tutorial/samples/{ima2d-7.tex => ima2d-7.cc} | 0
.../samples/{ima2d-decl-1.tex => ima2d-decl-1.cc} | 0
.../tutorial/samples/ima2d-decl-2-blobs-full.cc | 21 ++
.../tutorial/samples/ima2d-decl-2-blobs-output.tex | 7 -
...ma2d-decl-2-blobs.tex => ima2d-decl-2-blobs.cc} | 0
.../samples/{ima2d-decl-2.tex => ima2d-decl-2.cc} | 0
.../{ima2d-display-1.tex => ima2d-display-1.cc} | 0
.../{ima2d-display-2.tex => ima2d-display-2.cc} | 0
...ma2d-restricted-1.tex => ima2d-restricted-1.cc} | 0
...ma2d-restricted-2.tex => ima2d-restricted-2.cc} | 0
...ma2d-restricted-3.tex => ima2d-restricted-3.cc} | 0
...display-1.tex => ima2d-restricted-display-1.cc} | 0
milena/doc/tutorial/samples/ima2d-rot.cc | 42 +++++
...g-compute-call.tex => labeling-compute-call.cc} | 0
.../doc/tutorial/samples/labeling-compute-full.cc | 27 +++
.../samples/labeling-compute-result-output.tex | 3 -
...mpute-result.tex => labeling-compute-result.cc} | 0
milena/doc/tutorial/samples/logical-not-output.tex | 17 --
.../samples/{logical-not.tex => logical-not.cc} | 6 +-
.../samples/{mln_var-1.tex => mln_var-1.cc} | 0
.../samples/{mln_var-2.tex => mln_var-2.cc} | 0
.../samples/{mln_var-3.tex => mln_var-3.cc} | 0
milena/doc/tutorial/samples/out.ppm | Bin 0 -> 145320 bytes
.../{parray-append.tex => parray-append.cc} | 0
.../{parray-display-1.tex => parray-display-1.cc} | 0
.../doc/tutorial/samples/paste-call-1-output.tex | 3 -
.../samples/{paste-call-1.tex => paste-call-1.cc} | 6 +-
.../doc/tutorial/samples/{paste.tex => paste.cc} | 0
milena/doc/tutorial/samples/point-1-output.tex | 2 -
.../tutorial/samples/{point-1.tex => point-1.cc} | 0
.../samples/{predicate-1.tex => predicate-1.cc} | 0
...reate-1-display.tex => win-create-1-display.cc} | 0
.../samples/{win-create-1.tex => win-create-1.cc} | 0
.../samples/{win-create-2.tex => win-create-2.cc} | 0
milena/doc/tutorial/samples/win-create-3.cc | 7 +
milena/doc/tutorial/todoxygen.sh | 35 ++++
milena/doc/tutorial/tutorial.tex | 192 ++++++++++++++++----
milena/mln/core/internal/complex_window_p_base.hh | 2 +-
milena/mln/core/routine/extend.hh | 2 +-
milena/mln/core/site_set/p_complex.hh | 2 +-
milena/mln/debug/graph.hh | 2 +-
milena/mln/debug/println_with_border.hh | 2 +-
milena/mln/fun/x2v/bilinear.hh | 2 +-
milena/mln/fun/x2v/linear.hh | 2 +-
milena/mln/fun/x2v/nneighbor.hh | 2 +-
milena/mln/geom/nsites.hh | 19 +-
milena/mln/topo/n_face.hh | 2 +-
milena/mln/util/internal/graph_nbh_iter.hh | 2 +-
milena/tests/core/site_set/p_complex.cc | 2 +-
milena/tests/morpho/complex_image_wst.cc | 2 +-
104 files changed, 686 insertions(+), 185 deletions(-)
create mode 100644 milena/doc/doc.mk
create mode 100644 milena/doc/tutorial/Makefile.am
rename milena/doc/tutorial/{samples/graph-output-1.tex => outputs/graph-output-1.txt} (100%)
rename milena/doc/tutorial/{samples/ima2d-3-output.tex => outputs/ima2d-3-output.txt} (100%)
rename milena/doc/tutorial/{samples/ima2d-display-output-1.tex => outputs/ima2d-display-output-1.txt} (100%)
rename milena/doc/tutorial/{samples/ima2d-display-output-2.tex => outputs/ima2d-display-output-2.txt} (100%)
create mode 100644 milena/doc/tutorial/samples/Makefile.am
rename milena/doc/tutorial/samples/{accu-right-instanciation.tex => accu-right-instanciation.cc} (100%)
rename milena/doc/tutorial/samples/{accu-wrong-instanciation.tex => accu-wrong-instanciation.cc} (100%)
delete mode 100644 milena/doc/tutorial/samples/borderthickness-output.tex
create mode 100644 milena/doc/tutorial/samples/borderthickness.cc
delete mode 100644 milena/doc/tutorial/samples/borderthickness.tex
rename milena/doc/tutorial/samples/{box2d-1.tex => box2d-1.cc} (100%)
rename milena/doc/tutorial/samples/{box2d-2.tex => box2d-2.cc} (100%)
rename milena/doc/tutorial/samples/{domain-display-1.tex => domain-display-1.cc} (100%)
rename milena/doc/tutorial/samples/{domain-display-out-1.tex => domain-display-out-1.cc} (100%)
delete mode 100644 milena/doc/tutorial/samples/dpoint-1-output.tex
rename milena/doc/tutorial/samples/{dpoint-1.tex => dpoint-1.cc} (100%)
rename milena/doc/tutorial/samples/{estim-sites.tex => estim-sites.cc} (100%)
rename milena/doc/tutorial/samples/{extension-ignore.tex => extension-ignore.cc} (100%)
delete mode 100644 milena/doc/tutorial/samples/extension-ignore2.tex
rename milena/doc/tutorial/samples/{fill-call-1.tex => fill-call-1.cc} (100%)
rename milena/doc/tutorial/samples/{fill-part-1.tex => fill-part-1.cc} (100%)
rename milena/doc/tutorial/samples/{fill-part-2.tex => fill-part-2.cc} (100%)
rename milena/doc/tutorial/samples/{fill-part-3.tex => fill-part-3.cc} (100%)
rename milena/doc/tutorial/samples/{fill.tex => fill.cc} (100%)
rename milena/doc/tutorial/samples/{forall-piter-1.tex => forall-piter-1.cc} (100%)
rename milena/doc/tutorial/samples/{fun-p2b-1.tex => fun-p2b-1.cc} (100%)
rename milena/doc/tutorial/samples/{fun-p2v-1.tex => fun-p2v-1.cc} (100%)
rename milena/doc/tutorial/samples/{graph-add-edges.tex => graph-add-edges.cc} (100%)
rename milena/doc/tutorial/samples/{graph-add-vertex.tex => graph-add-vertex.cc} (100%)
rename milena/doc/tutorial/samples/{graph-data.tex => graph-data.cc} (100%)
rename milena/doc/tutorial/samples/{graph-i2v-vertex.tex => graph-i2v-vertex.cc} (100%)
rename milena/doc/tutorial/samples/{graph-iter-edge-nbh-edge.tex => graph-iter-edge-nbh-edge.cc} (100%)
rename milena/doc/tutorial/samples/{graph-iter-vertex-nbh-vertex.tex => graph-iter-vertex-nbh-vertex.cc} (100%)
rename milena/doc/tutorial/samples/{graph-iter-vertex.tex => graph-iter-vertex.cc} (100%)
rename milena/doc/tutorial/samples/{graph-iter.tex => graph-iter.cc} (100%)
rename milena/doc/tutorial/samples/{graph-p-vertices.tex => graph-p-vertices.cc} (100%)
create mode 100644 milena/doc/tutorial/samples/ima-has.cc
rename milena/doc/tutorial/samples/{ima-load.tex => ima-load.cc} (100%)
rename milena/doc/tutorial/samples/{ima-save.tex => ima-save.cc} (100%)
delete mode 100644 milena/doc/tutorial/samples/ima-size-output.tex
rename milena/doc/tutorial/samples/{ima-size.tex => ima-size.cc} (52%)
delete mode 100644 milena/doc/tutorial/samples/ima2d-1-output.tex
create mode 100644 milena/doc/tutorial/samples/ima2d-1.cc
delete mode 100644 milena/doc/tutorial/samples/ima2d-1.tex
rename milena/doc/tutorial/samples/{ima2d-2.tex => ima2d-2.cc} (100%)
rename milena/doc/tutorial/samples/{ima2d-3.tex => ima2d-3.cc} (100%)
rename milena/doc/tutorial/samples/{ima2d-4.tex => ima2d-4.cc} (100%)
rename milena/doc/tutorial/samples/{ima2d-5.tex => ima2d-5.cc} (100%)
rename milena/doc/tutorial/samples/{ima2d-6-clone.tex => ima2d-6-clone.cc} (100%)
rename milena/doc/tutorial/samples/{ima2d-7.tex => ima2d-7.cc} (100%)
rename milena/doc/tutorial/samples/{ima2d-decl-1.tex => ima2d-decl-1.cc} (100%)
create mode 100644 milena/doc/tutorial/samples/ima2d-decl-2-blobs-full.cc
delete mode 100644 milena/doc/tutorial/samples/ima2d-decl-2-blobs-output.tex
rename milena/doc/tutorial/samples/{ima2d-decl-2-blobs.tex => ima2d-decl-2-blobs.cc} (100%)
rename milena/doc/tutorial/samples/{ima2d-decl-2.tex => ima2d-decl-2.cc} (100%)
rename milena/doc/tutorial/samples/{ima2d-display-1.tex => ima2d-display-1.cc} (100%)
rename milena/doc/tutorial/samples/{ima2d-display-2.tex => ima2d-display-2.cc} (100%)
rename milena/doc/tutorial/samples/{ima2d-restricted-1.tex => ima2d-restricted-1.cc} (100%)
rename milena/doc/tutorial/samples/{ima2d-restricted-2.tex => ima2d-restricted-2.cc} (100%)
rename milena/doc/tutorial/samples/{ima2d-restricted-3.tex => ima2d-restricted-3.cc} (100%)
rename milena/doc/tutorial/samples/{ima2d-restricted-display-1.tex => ima2d-restricted-display-1.cc} (100%)
create mode 100644 milena/doc/tutorial/samples/ima2d-rot.cc
rename milena/doc/tutorial/samples/{labeling-compute-call.tex => labeling-compute-call.cc} (100%)
create mode 100644 milena/doc/tutorial/samples/labeling-compute-full.cc
delete mode 100644 milena/doc/tutorial/samples/labeling-compute-result-output.tex
rename milena/doc/tutorial/samples/{labeling-compute-result.tex => labeling-compute-result.cc} (100%)
delete mode 100644 milena/doc/tutorial/samples/logical-not-output.tex
rename milena/doc/tutorial/samples/{logical-not.tex => logical-not.cc} (77%)
rename milena/doc/tutorial/samples/{mln_var-1.tex => mln_var-1.cc} (100%)
rename milena/doc/tutorial/samples/{mln_var-2.tex => mln_var-2.cc} (100%)
rename milena/doc/tutorial/samples/{mln_var-3.tex => mln_var-3.cc} (100%)
create mode 100644 milena/doc/tutorial/samples/out.ppm
rename milena/doc/tutorial/samples/{parray-append.tex => parray-append.cc} (100%)
rename milena/doc/tutorial/samples/{parray-display-1.tex => parray-display-1.cc} (100%)
delete mode 100644 milena/doc/tutorial/samples/paste-call-1-output.tex
rename milena/doc/tutorial/samples/{paste-call-1.tex => paste-call-1.cc} (67%)
rename milena/doc/tutorial/samples/{paste.tex => paste.cc} (100%)
delete mode 100644 milena/doc/tutorial/samples/point-1-output.tex
rename milena/doc/tutorial/samples/{point-1.tex => point-1.cc} (100%)
rename milena/doc/tutorial/samples/{predicate-1.tex => predicate-1.cc} (100%)
rename milena/doc/tutorial/samples/{win-create-1-display.tex => win-create-1-display.cc} (100%)
rename milena/doc/tutorial/samples/{win-create-1.tex => win-create-1.cc} (100%)
rename milena/doc/tutorial/samples/{win-create-2.tex => win-create-2.cc} (100%)
create mode 100644 milena/doc/tutorial/samples/win-create-3.cc
create mode 100755 milena/doc/tutorial/todoxygen.sh
diff --git a/milena/ChangeLog b/milena/ChangeLog
index f58f2a6..7b16037 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,3 +1,193 @@
+2008-11-12 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Update tutorial.
+
+ * doc/Doxyfile.in: Add new example/include paths.
+
+ * doc/tutorial/Makefile.am,
+ * doc/Makefile.am: Add a new target for the tutorial.
+ Rename target "internal" to "complete.
+
+ * doc/tutorial/todoxygen.sh: script to convert .tex files to .html
+ files. It uses Hevea.
+
+ * doc/tutorial/samples/borderthickness.cc,
+ * doc/tutorial/samples/extension-ignore2.cc,
+ * doc/tutorial/samples/ima-size.cc,
+ * doc/tutorial/samples/ima2d-1.cc,
+ * doc/tutorial/samples/ima2d-decl-2-blobs-full.cc,
+ * doc/tutorial/samples/ima2d-rot.cc,
+ * doc/tutorial/samples/labeling-compute-full.cc,
+ * doc/tutorial/samples/logical-not.cc,
+ * doc/tutorial/samples/paste-call-1.cc,
+ * doc/tutorial/samples/plop.ppm,
+ * doc/tutorial/samples/win-create-3.cc: Fix sample code.
+
+ * doc/tutorial/samples/Makefile.am: add new target for sample
+ programs.
+
+ * doc/tutorial/tutorial.tex: Include images.
+
+ * mln/core/internal/complex_window_p_base.hh,
+ * mln/core/routine/extend.hh,
+ * mln/core/site_set/p_complex.hh,
+ * mln/debug/graph.hh,
+ * mln/debug/println_with_border.hh,
+ * mln/fun/x2v/bilinear.hh,
+ * mln/fun/x2v/linear.hh,
+ * mln/fun/x2v/nneighbor.hh,
+ * mln/geom/nsites.hh,
+ * mln/topo/n_face.hh,
+ * mln/util/internal/graph_nbh_iter.hh,
+ * tests/core/site_set/p_complex.cc,
+ * tests/morpho/complex_image_wst.cc: Fix doxygen warnings.
+
+ * doc/doc.mk: Add shared variables for doc generation.
+
+ * doc/tutorial/samples/borderthickness-output.tex,
+ * doc/tutorial/samples/dpoint-1-output.tex,
+ * doc/tutorial/samples/graph-output-1.tex,
+ * doc/tutorial/samples/ima-size-output.tex,
+ * doc/tutorial/samples/ima2d-1-output.tex,
+ * doc/tutorial/samples/ima2d-3-output.tex,
+ * doc/tutorial/samples/ima2d-decl-2-blobs-output.tex,
+ * doc/tutorial/samples/ima2d-display-output-1.tex,
+ * doc/tutorial/samples/ima2d-display-output-2.tex,
+ * doc/tutorial/samples/labeling-compute-result-output.tex,
+ * doc/tutorial/samples/logical-not-output.tex,
+ * doc/tutorial/samples/paste-call-1-output.tex,
+ * doc/tutorial/samples/point-1-output.tex: removed since they will be
+ generated.
+
+ * doc/tutorial/samples/accu-right-instanciation.tex,
+ * doc/tutorial/samples/accu-right-instanciation.cc,
+ * doc/tutorial/samples/accu-wrong-instanciation.tex,
+ * doc/tutorial/samples/accu-wrong-instanciation.cc,
+ * doc/tutorial/samples/borderthickness.tex,
+ * doc/tutorial/samples/borderthickness.cc,
+ * doc/tutorial/samples/box2d-1.tex,
+ * doc/tutorial/samples/box2d-1.cc,
+ * doc/tutorial/samples/box2d-2.tex,
+ * doc/tutorial/samples/box2d-2.cc,
+ * doc/tutorial/samples/domain-display-1.tex,
+ * doc/tutorial/samples/domain-display-1.cc,
+ * doc/tutorial/samples/domain-display-out-1.tex,
+ * doc/tutorial/samples/domain-display-out-1.cc,
+ * doc/tutorial/samples/dpoint-1.tex,
+ * doc/tutorial/samples/dpoint-1.cc,
+ * doc/tutorial/samples/estim-sites.tex,
+ * doc/tutorial/samples/estim-sites.cc,
+ * doc/tutorial/samples/extension-ignore.tex,
+ * doc/tutorial/samples/extension-ignore.cc,
+ * doc/tutorial/samples/extension-ignore2.tex,
+ * doc/tutorial/samples/extension-ignore2.cc,
+ * doc/tutorial/samples/fill-call-1.tex,
+ * doc/tutorial/samples/fill-call-1.cc,
+ * doc/tutorial/samples/fill-part-1.tex,
+ * doc/tutorial/samples/fill-part-1.cc,
+ * doc/tutorial/samples/fill-part-2.tex,
+ * doc/tutorial/samples/fill-part-2.cc,
+ * doc/tutorial/samples/fill-part-3.tex,
+ * doc/tutorial/samples/fill-part-3.cc,
+ * doc/tutorial/samples/fill.tex,
+ * doc/tutorial/samples/fill.cc,
+ * doc/tutorial/samples/forall-piter-1.tex,
+ * doc/tutorial/samples/forall-piter-1.cc,
+ * doc/tutorial/samples/fun-p2b-1.tex,
+ * doc/tutorial/samples/fun-p2b-1.cc,
+ * doc/tutorial/samples/fun-p2v-1.tex,
+ * doc/tutorial/samples/fun-p2v-1.cc,
+ * doc/tutorial/samples/graph-add-edges.tex,
+ * doc/tutorial/samples/graph-add-edges.cc,
+ * doc/tutorial/samples/graph-add-vertex.tex,
+ * doc/tutorial/samples/graph-add-vertex.cc,
+ * doc/tutorial/samples/graph-data.tex,
+ * doc/tutorial/samples/graph-data.cc,
+ * doc/tutorial/samples/graph-i2v-vertex.tex,
+ * doc/tutorial/samples/graph-i2v-vertex.cc,
+ * doc/tutorial/samples/graph-iter-edge-nbh-edge.tex,
+ * doc/tutorial/samples/graph-iter-edge-nbh-edge.cc,
+ * doc/tutorial/samples/graph-iter-vertex-nbh-vertex.tex,
+ * doc/tutorial/samples/graph-iter-vertex-nbh-vertex.cc,
+ * doc/tutorial/samples/graph-iter-vertex.tex,
+ * doc/tutorial/samples/graph-iter-vertex.cc,
+ * doc/tutorial/samples/graph-iter.tex,
+ * doc/tutorial/samples/graph-iter.cc,
+ * doc/tutorial/samples/graph-p-vertices.tex,
+ * doc/tutorial/samples/graph-p-vertices.cc,
+ * doc/tutorial/samples/ima-has.cc,
+ * doc/tutorial/samples/ima-load.tex,
+ * doc/tutorial/samples/ima-load.cc,
+ * doc/tutorial/samples/ima-save.tex,
+ * doc/tutorial/samples/ima-save.cc,
+ * doc/tutorial/samples/ima-size.tex,
+ * doc/tutorial/samples/ima-size.cc,
+ * doc/tutorial/samples/ima2d-1.tex,
+ * doc/tutorial/samples/ima2d-2.tex,
+ * doc/tutorial/samples/ima2d-3.tex,
+ * doc/tutorial/samples/ima2d-4.tex,
+ * doc/tutorial/samples/ima2d-5.tex,
+ * doc/tutorial/samples/ima2d-1.cc,
+ * doc/tutorial/samples/ima2d-2.cc,
+ * doc/tutorial/samples/ima2d-3.cc,
+ * doc/tutorial/samples/ima2d-4.cc,
+ * doc/tutorial/samples/ima2d-5.cc,
+ * doc/tutorial/samples/ima2d-6-clone.tex,
+ * doc/tutorial/samples/ima2d-6-clone.cc,
+ * doc/tutorial/samples/ima2d-7.tex,
+ * doc/tutorial/samples/ima2d-7.cc,
+ * doc/tutorial/samples/ima2d-decl-1.tex,
+ * doc/tutorial/samples/ima2d-decl-1.cc,
+ * doc/tutorial/samples/ima2d-decl-2-blobs.tex,
+ * doc/tutorial/samples/ima2d-decl-2-blobs.cc,
+ * doc/tutorial/samples/ima2d-decl-2.tex,
+ * doc/tutorial/samples/ima2d-decl-2.cc,
+ * doc/tutorial/samples/ima2d-display-1.tex,
+ * doc/tutorial/samples/ima2d-display-1.cc,
+ * doc/tutorial/samples/ima2d-display-2.tex,
+ * doc/tutorial/samples/ima2d-display-2.cc,
+ * doc/tutorial/samples/ima2d-restricted-1.tex,
+ * doc/tutorial/samples/ima2d-restricted-2.tex,
+ * doc/tutorial/samples/ima2d-restricted-3.tex,
+ * doc/tutorial/samples/ima2d-restricted-1.cc,
+ * doc/tutorial/samples/ima2d-restricted-2.cc,
+ * doc/tutorial/samples/ima2d-restricted-3.cc,
+ * doc/tutorial/samples/ima2d-restricted-display-1.tex,
+ * doc/tutorial/samples/ima2d-restricted-display-1.cc,
+ * doc/tutorial/samples/ima2d-rot.cc,
+ * doc/tutorial/samples/labeling-compute-call.tex,
+ * doc/tutorial/samples/labeling-compute-call.cc,
+ * doc/tutorial/samples/labeling-compute-result.tex,
+ * doc/tutorial/samples/labeling-compute-result.cc,
+ * doc/tutorial/samples/logical-not.tex,
+ * doc/tutorial/samples/logical-not.cc,
+ * doc/tutorial/samples/mln_var-1.tex,
+ * doc/tutorial/samples/mln_var-1.cc,
+ * doc/tutorial/samples/mln_var-2.tex,
+ * doc/tutorial/samples/mln_var-2.cc,
+ * doc/tutorial/samples/mln_var-3.tex,
+ * doc/tutorial/samples/mln_var-3.cc,
+ * doc/tutorial/samples/parray-append.tex,
+ * doc/tutorial/samples/parray-append.cc,
+ * doc/tutorial/samples/parray-display-1.tex,
+ * doc/tutorial/samples/parray-display-1.cc,
+ * doc/tutorial/samples/paste-call-1.tex,
+ * doc/tutorial/samples/paste-call-1.cc,
+ * doc/tutorial/samples/paste.tex,
+ * doc/tutorial/samples/paste.cc,
+ * doc/tutorial/samples/point-1.tex,
+ * doc/tutorial/samples/point-1.cc,
+ * doc/tutorial/samples/predicate-1.tex,
+ * doc/tutorial/samples/predicate-1.cc,
+ * doc/tutorial/samples/win-create-1-display.tex,
+ * doc/tutorial/samples/win-create-1-display.cc,
+ * doc/tutorial/samples/win-create-1.tex,
+ * doc/tutorial/samples/win-create-1.cc,
+ * doc/tutorial/samples/win-create-2.tex,
+ * doc/tutorial/samples/win-create-2.cc: rename *.tex to *.cc.
+
+ * doc/tutorial/tutorial.tex: update.
+
2008-11-06 Guillaume Lazzara <z(a)lrde.epita.fr>
Fix wrong includes and missing namespaces.
diff --git a/milena/doc/Doxyfile.in b/milena/doc/Doxyfile.in
index b583d66..144d23a 100644
--- a/milena/doc/Doxyfile.in
+++ b/milena/doc/Doxyfile.in
@@ -5,7 +5,7 @@
#---------------------------------------------------------------------------
PROJECT_NAME = "Milena (@PACKAGE_NAME@)"
PROJECT_NUMBER = "@PACKAGE_VERSION@ @ID@"
-OUTPUT_DIRECTORY = ./internal/
+OUTPUT_DIRECTORY = ./complete/
CREATE_SUBDIRS = YES
OUTPUT_LANGUAGE = English
BRIEF_MEMBER_DESC = YES
@@ -72,22 +72,26 @@ WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
-INPUT = @top_srcdir@/milena \
+INPUT = @top_srcdir@/milena \
@top_builddir@/milena
-FILE_PATTERNS = *.cc \
- *.hh \
- *.hxx \
+FILE_PATTERNS = *.cc \
+ *.hh \
+ *.hxx \
*.hcc
RECURSIVE = YES
-EXCLUDE = @top_srcdir@/milena/sandbox \
- @top_srcdir@/milena/mln/core/concept/proxy.hxx
+EXCLUDE = @top_srcdir@/milena/sandbox \
+ @top_srcdir@/milena/mln/core/concept/proxy.hxx \
+ @top_srcdir@/milena/doc/tutorial/samples
EXCLUDE_SYMLINKS = YES
EXCLUDE_PATTERNS = *spe.hh
EXCLUDE_SYMBOLS =
-EXAMPLE_PATH =
+EXAMPLE_PATH = @top_srcdir@/milena/doc/tutorial/samples \
+ @top_builddir@/milena/doc/tutorial/outputs \
+ @top_srcdir@/milena/doc/tutorial/outputs
EXAMPLE_PATTERNS =
EXAMPLE_RECURSIVE = NO
-IMAGE_PATH =
+IMAGE_PATH = @top_srcdir@/milena/doc/tutorial/figures \
+ @top_builddir@/milena/doc/tutorial/figures
INPUT_FILTER =
FILTER_PATTERNS =
FILTER_SOURCE_FILES = NO
diff --git a/milena/doc/Makefile.am b/milena/doc/Makefile.am
index b49d7dc..039f5dc 100644
--- a/milena/doc/Makefile.am
+++ b/milena/doc/Makefile.am
@@ -1,23 +1,38 @@
# FIXME: To be overhauled! (See ticket #134).
-# FIXME: Rename `internal' as `all' or `complete'.
-DOXYGEN = doxygen
+include $(top_srcdir)/milena/doc/doc.mk
+
+SUBDIRS = tutorial
-.PHONY: doc user-doc internal-doc html html_user
+DOXYGEN = doxygen
-doc: html
+.PHONY: doc user-doc complete-doc html_complete html_user
-internal-doc: html
+doc: complete-doc
-user-doc: html_user
+complete-doc: html_complete
+user-doc: html_user tutorial
-html-local: Doxyfile
- $(DOXYGEN) Doxyfile_internal
+html_complete: tuto_html figures Doxyfile
+ $(DOXYGEN) Doxyfile_complete
-html_user: Doxyfile
+html_user: tuto_html figures Doxyfile
$(DOXYGEN) Doxyfile_user
+figures: all
+ @failcom='exit 1'; \
+ list='${wildcard $(FIGURES_DIR)/*.p*m}'; for img in $$list; do \
+ echo "Converting $$img to png"; \
+ convert $$img $(FIGURES_DIR)/`basename $$img .ppm`.png \
+ || eval $$failcom; \
+ done;
+
+tuto_html:
+ $(MAKE) -C tutorial tuto_html
+
+tuto: all
+ $(MAKE) -C tutorial tuto
edit = sed -e "s|@ID@|$$Id|" \
-e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' \
@@ -26,28 +41,28 @@ edit = sed -e "s|@ID@|$$Id|" \
-e 's,@top_srcdir\@,$(top_srcdir),g'
# FIXME: This is not good. We should set these parameters for both
-# documentation (internal and user) using @VARIABLES@. Don't generate
-# Doxyfile_user from Doxyfile_internal! Both should be a product
+# documentation (complete and user) using @VARIABLES@. Don't generate
+# Doxyfile_user from Doxyfile_complete! Both should be a product
# derived from a single source, Doxyfile.in.
-edit_user = sed -e 's,OUTPUT_DIRECTORY = ./internal/,OUTPUT_DIRECTORY = ./user/,g' \
+edit_user = sed -e 's,OUTPUT_DIRECTORY = ./complete/,OUTPUT_DIRECTORY = ./user/,g' \
-e 's,EXTRACT_ALL = YES,EXTRACT_ALL = NO,g' \
-e 's,EXTRACT_PRIVATE = YES,EXTRACT_PRIVATE = NO,g' \
-e 's,EXTRACT_STATIC = YES,EXTRACT_STATIC = NO,g' \
-e 's,EXTRACT_LOCAL_CLASSES = YES,EXTRACT_LOCAL_CLASSES = NO,g' \
- -e 's,HIDE_UNDOC_MEMBERS = NO,HIDE_UNDOC_MEMBERS = YES,g' \
- -e 's,HIDE_UNDOC_CLASSES = NO,HIDE_UNDOC_CLASSES = YES,g' \
- -e 's,HIDE_FRIEND_COMPOUNDS = NO,HIDE_FRIEND_COMPOUNDS = YES,g' \
- -e 's,HIDE_IN_BODY_DOCS = NO,HIDE_IN_BODY_DOCS = YES,g' \
+ -e 's,HIDE_UNDOC_MEMBERS = NO,HIDE_UNDOC_MEMBERS = YES,g' \
+ -e 's,HIDE_UNDOC_CLASSES = NO,HIDE_UNDOC_CLASSES = YES,g' \
+ -e 's,HIDE_FRIEND_COMPOUNDS = NO,HIDE_FRIEND_COMPOUNDS = YES,g' \
+ -e 's,HIDE_IN_BODY_DOCS = NO,HIDE_IN_BODY_DOCS = YES,g' \
-e 's,INTERNAL_DOCS = YES,INTERNAL_DOCS = NO,g' \
-e 's,GENERATE_TODOLIST = YES,GENERATE_TODOLIST = NO,g' \
- -e 's,PROJECT_NUMBER = \",PROJECT_NUMBER = \"User documentation ,g' \
- -e 's,EXCLUDE_SYMBOLS =,EXCLUDE_SYMBOLS = *::internal*,g'
+ -e 's,PROJECT_NUMBER = \",PROJECT_NUMBER = \"User documentation ,g' \
+ -e 's,EXCLUDE_SYMBOLS =,EXCLUDE_SYMBOLS = *::internal*,g'
EXTRA_DIST = Doxyfile.in
-CLEANFILES = Doxyfile_internal \
+CLEANFILES = Doxyfile_complete \
Doxyfile_user
# Sed is used to generate Doxyfile from Doxyfile.in instead of
@@ -56,9 +71,9 @@ CLEANFILES = Doxyfile_internal \
# sed instead of configure saves us a lot of time.
Doxyfile: $(top_srcdir)/milena/ChangeLog $(srcdir)/Doxyfile.in
Id=`grep '^\$$Id' $(top_srcdir)/milena/ChangeLog`; \
- $(edit) $(srcdir)/Doxyfile.in >Doxyfile_internal && \
- $(edit_user) Doxyfile_internal >Doxyfile_user
+ $(edit) $(srcdir)/Doxyfile.in >Doxyfile_complete && \
+ $(edit_user) Doxyfile_complete >Doxyfile_user
clean-local:
- rm -rf internal user
+ rm -rf complete user
diff --git a/milena/doc/doc.mk b/milena/doc/doc.mk
new file mode 100644
index 0000000..d911d86
--- /dev/null
+++ b/milena/doc/doc.mk
@@ -0,0 +1,7 @@
+## FIXME: Revamp (see Olena 0.11's test suite). -*- Automake -*-
+
+include $(top_srcdir)/milena/tests/tests.mk
+
+OUTPUTS_DIR = $(top_builddir)/milena/doc/tutorial/outputs
+FIGURES_DIR = $(top_builddir)/milena/doc/tutorial/figures
+
diff --git a/milena/doc/tutorial/Makefile.am b/milena/doc/tutorial/Makefile.am
new file mode 100644
index 0000000..0b70c3e
--- /dev/null
+++ b/milena/doc/tutorial/Makefile.am
@@ -0,0 +1,18 @@
+SUBDIRS = samples
+
+.PHONY: tuto
+
+TUTO_DIR = "milena/doc/tutorial"
+TEXINPUTS = $(top_srcdir)/$(TUTO_DIR):$(top_builddir)/$(TUTO_DIR):
+
+tuto:
+ TEXINPUTS=$(TEXINPUTS) pdflatex $(top_srcdir)/$(TUTO_DIR)/tutorial.tex
+
+tuto_html:
+ chmod u+x $(top_srcdir)/$(TUTO_DIR)/todoxygen.sh
+ $(top_srcdir)/$(TUTO_DIR)/todoxygen.sh $(top_srcdir)/$(TUTO_DIR)/tutorial.tex $(top_builddir)/$(TUTO_DIR)
+
+clean-local:
+ rm -f *.aux *.toc *.log *.bbl *blg *.lot *.out *~
+ rm -f tutorial.pdf
+ rm *.haux *.hh *.html *.htoc
diff --git a/milena/doc/tutorial/samples/graph-output-1.tex b/milena/doc/tutorial/outputs/graph-output-1.txt
similarity index 100%
rename from milena/doc/tutorial/samples/graph-output-1.tex
rename to milena/doc/tutorial/outputs/graph-output-1.txt
diff --git a/milena/doc/tutorial/samples/ima2d-3-output.tex b/milena/doc/tutorial/outputs/ima2d-3-output.txt
similarity index 100%
rename from milena/doc/tutorial/samples/ima2d-3-output.tex
rename to milena/doc/tutorial/outputs/ima2d-3-output.txt
diff --git a/milena/doc/tutorial/samples/ima2d-display-output-1.tex b/milena/doc/tutorial/outputs/ima2d-display-output-1.txt
similarity index 100%
rename from milena/doc/tutorial/samples/ima2d-display-output-1.tex
rename to milena/doc/tutorial/outputs/ima2d-display-output-1.txt
diff --git a/milena/doc/tutorial/samples/ima2d-display-output-2.tex b/milena/doc/tutorial/outputs/ima2d-display-output-2.txt
similarity index 100%
rename from milena/doc/tutorial/samples/ima2d-display-output-2.tex
rename to milena/doc/tutorial/outputs/ima2d-display-output-2.txt
diff --git a/milena/doc/tutorial/samples/Makefile.am b/milena/doc/tutorial/samples/Makefile.am
new file mode 100644
index 0000000..dcbf13c
--- /dev/null
+++ b/milena/doc/tutorial/samples/Makefile.am
@@ -0,0 +1,41 @@
+## Process this file through Automake to create Makefile.in -*- Makefile -*-
+
+include $(top_srcdir)/milena/doc/doc.mk
+
+bin_PROGRAMS = \
+ borderthickness \
+ dpoint-1 \
+ ima-has \
+ ima-size \
+ ima2d-1 \
+ ima2d-decl-2-blobs-full \
+ ima2d-rot \
+ labeling-compute-full \
+ logical-not \
+ paste-call-1 \
+ point-1
+
+borderthickness_SOURCES = borderthickness.cc
+dpoint_1_SOURCES = dpoint-1.cc
+ima_has_SOURCES = ima-has.cc
+ima_size_SOURCES = ima-size.cc
+ima2d_1_SOURCES = ima2d-1.cc
+ima2d_decl_2_blobs_full_SOURCES = ima2d-decl-2-blobs-full.cc
+ima2d_rot_SOURCES = ima2d-rot.cc
+labeling_compute_full_SOURCES = labeling-compute-full.cc
+logical_not_SOURCES = logical-not.cc
+paste_call_1_SOURCES = paste-call-1.cc
+point_1_SOURCES = point-1.cc
+
+all:
+ mkdir -p $(OUTPUTS_DIR)
+ mkdir -p $(FIGURES_DIR)
+ @failcom='exit 1'; \
+ list='$(bin_PROGRAMS)'; for bin in $$list; do \
+ echo "Running $$bin"; \
+ ./$$bin > $(OUTPUTS_DIR)/$$bin.txt || eval $$failcom; \
+ done;
+
+clean-local:
+ rm -Rf $(OUTPUTS_DIR) $(FIGURES_DIR)
+
diff --git a/milena/doc/tutorial/samples/accu-right-instanciation.tex b/milena/doc/tutorial/samples/accu-right-instanciation.cc
similarity index 100%
rename from milena/doc/tutorial/samples/accu-right-instanciation.tex
rename to milena/doc/tutorial/samples/accu-right-instanciation.cc
diff --git a/milena/doc/tutorial/samples/accu-wrong-instanciation.tex b/milena/doc/tutorial/samples/accu-wrong-instanciation.cc
similarity index 100%
rename from milena/doc/tutorial/samples/accu-wrong-instanciation.tex
rename to milena/doc/tutorial/samples/accu-wrong-instanciation.cc
diff --git a/milena/doc/tutorial/samples/borderthickness-output.tex b/milena/doc/tutorial/samples/borderthickness-output.tex
deleted file mode 100644
index 201aedb..0000000
--- a/milena/doc/tutorial/samples/borderthickness-output.tex
+++ /dev/null
@@ -1,13 +0,0 @@
-- - - - - - - -
-- - - - - - - -
-- - - - - - - -
-- - - - | - - -
-- - - | - - - -
-- - - - - - - -
-- - - - - - - -
-- - - - - - - -
-
-===========
-
-- |
-| -
diff --git a/milena/doc/tutorial/samples/borderthickness.cc b/milena/doc/tutorial/samples/borderthickness.cc
new file mode 100644
index 0000000..1e59076
--- /dev/null
+++ b/milena/doc/tutorial/samples/borderthickness.cc
@@ -0,0 +1,18 @@
+#include <mln/essential/2d.hh>
+int main()
+{
+ using namespace mln;
+
+ bool vals[3][3] = { { 0, 1, 1 },
+ { 1, 0, 0 },
+ { 1, 1, 0 } };
+
+ image2d<bool> ima_def = make::image(vals);
+ debug::println_with_border(ima_def);
+
+ std::cout << "===========" << std::endl << std::endl;
+
+ border::thickness = 0;
+ image2d<bool> ima_bt0 = make::image(vals);
+ debug::println_with_border(ima_bt0);
+}
diff --git a/milena/doc/tutorial/samples/borderthickness.tex b/milena/doc/tutorial/samples/borderthickness.tex
deleted file mode 100644
index a059ba3..0000000
--- a/milena/doc/tutorial/samples/borderthickness.tex
+++ /dev/null
@@ -1,17 +0,0 @@
-#include <mln/core/image/image2d.hh>
-#include <mln/debug/println_with_border.hh>
-int main()
-{
- using namespace mln;
-
- bool vals[2][2] = { {0, 1},
- {1, 0} };
- image2d<bool> ima_def = make::image2d(vals);
- debug::println_with_border(ima_def);
-
- std::cout << "===========" << std::endl << std::endl;
-
- border::thickness = 0;
- image2d<bool> ima_bt0 = make::image2d(vals);
- debug::println_with_border(ima_bt0);
-}
diff --git a/milena/doc/tutorial/samples/box2d-1.tex b/milena/doc/tutorial/samples/box2d-1.cc
similarity index 100%
rename from milena/doc/tutorial/samples/box2d-1.tex
rename to milena/doc/tutorial/samples/box2d-1.cc
diff --git a/milena/doc/tutorial/samples/box2d-2.tex b/milena/doc/tutorial/samples/box2d-2.cc
similarity index 100%
rename from milena/doc/tutorial/samples/box2d-2.tex
rename to milena/doc/tutorial/samples/box2d-2.cc
diff --git a/milena/doc/tutorial/samples/domain-display-1.tex b/milena/doc/tutorial/samples/domain-display-1.cc
similarity index 100%
rename from milena/doc/tutorial/samples/domain-display-1.tex
rename to milena/doc/tutorial/samples/domain-display-1.cc
diff --git a/milena/doc/tutorial/samples/domain-display-out-1.tex b/milena/doc/tutorial/samples/domain-display-out-1.cc
similarity index 100%
rename from milena/doc/tutorial/samples/domain-display-out-1.tex
rename to milena/doc/tutorial/samples/domain-display-out-1.cc
diff --git a/milena/doc/tutorial/samples/dpoint-1-output.tex b/milena/doc/tutorial/samples/dpoint-1-output.tex
deleted file mode 100644
index 8982f0f..0000000
--- a/milena/doc/tutorial/samples/dpoint-1-output.tex
+++ /dev/null
@@ -1 +0,0 @@
-(0, 1)
diff --git a/milena/doc/tutorial/samples/dpoint-1.tex b/milena/doc/tutorial/samples/dpoint-1.cc
similarity index 100%
rename from milena/doc/tutorial/samples/dpoint-1.tex
rename to milena/doc/tutorial/samples/dpoint-1.cc
diff --git a/milena/doc/tutorial/samples/estim-sites.tex b/milena/doc/tutorial/samples/estim-sites.cc
similarity index 100%
rename from milena/doc/tutorial/samples/estim-sites.tex
rename to milena/doc/tutorial/samples/estim-sites.cc
diff --git a/milena/doc/tutorial/samples/extension-ignore.tex b/milena/doc/tutorial/samples/extension-ignore.cc
similarity index 100%
rename from milena/doc/tutorial/samples/extension-ignore.tex
rename to milena/doc/tutorial/samples/extension-ignore.cc
diff --git a/milena/doc/tutorial/samples/extension-ignore2.tex b/milena/doc/tutorial/samples/extension-ignore2.tex
deleted file mode 100644
index 7e7ef54..0000000
--- a/milena/doc/tutorial/samples/extension-ignore2.tex
+++ /dev/null
@@ -1 +0,0 @@
-my_routine(ima.domain());
diff --git a/milena/doc/tutorial/samples/fill-call-1.tex b/milena/doc/tutorial/samples/fill-call-1.cc
similarity index 100%
rename from milena/doc/tutorial/samples/fill-call-1.tex
rename to milena/doc/tutorial/samples/fill-call-1.cc
diff --git a/milena/doc/tutorial/samples/fill-part-1.tex b/milena/doc/tutorial/samples/fill-part-1.cc
similarity index 100%
rename from milena/doc/tutorial/samples/fill-part-1.tex
rename to milena/doc/tutorial/samples/fill-part-1.cc
diff --git a/milena/doc/tutorial/samples/fill-part-2.tex b/milena/doc/tutorial/samples/fill-part-2.cc
similarity index 100%
rename from milena/doc/tutorial/samples/fill-part-2.tex
rename to milena/doc/tutorial/samples/fill-part-2.cc
diff --git a/milena/doc/tutorial/samples/fill-part-3.tex b/milena/doc/tutorial/samples/fill-part-3.cc
similarity index 100%
rename from milena/doc/tutorial/samples/fill-part-3.tex
rename to milena/doc/tutorial/samples/fill-part-3.cc
diff --git a/milena/doc/tutorial/samples/fill.tex b/milena/doc/tutorial/samples/fill.cc
similarity index 100%
rename from milena/doc/tutorial/samples/fill.tex
rename to milena/doc/tutorial/samples/fill.cc
diff --git a/milena/doc/tutorial/samples/forall-piter-1.tex b/milena/doc/tutorial/samples/forall-piter-1.cc
similarity index 100%
rename from milena/doc/tutorial/samples/forall-piter-1.tex
rename to milena/doc/tutorial/samples/forall-piter-1.cc
diff --git a/milena/doc/tutorial/samples/fun-p2b-1.tex b/milena/doc/tutorial/samples/fun-p2b-1.cc
similarity index 100%
rename from milena/doc/tutorial/samples/fun-p2b-1.tex
rename to milena/doc/tutorial/samples/fun-p2b-1.cc
diff --git a/milena/doc/tutorial/samples/fun-p2v-1.tex b/milena/doc/tutorial/samples/fun-p2v-1.cc
similarity index 100%
rename from milena/doc/tutorial/samples/fun-p2v-1.tex
rename to milena/doc/tutorial/samples/fun-p2v-1.cc
diff --git a/milena/doc/tutorial/samples/graph-add-edges.tex b/milena/doc/tutorial/samples/graph-add-edges.cc
similarity index 100%
rename from milena/doc/tutorial/samples/graph-add-edges.tex
rename to milena/doc/tutorial/samples/graph-add-edges.cc
diff --git a/milena/doc/tutorial/samples/graph-add-vertex.tex b/milena/doc/tutorial/samples/graph-add-vertex.cc
similarity index 100%
rename from milena/doc/tutorial/samples/graph-add-vertex.tex
rename to milena/doc/tutorial/samples/graph-add-vertex.cc
diff --git a/milena/doc/tutorial/samples/graph-data.tex b/milena/doc/tutorial/samples/graph-data.cc
similarity index 100%
rename from milena/doc/tutorial/samples/graph-data.tex
rename to milena/doc/tutorial/samples/graph-data.cc
diff --git a/milena/doc/tutorial/samples/graph-i2v-vertex.tex b/milena/doc/tutorial/samples/graph-i2v-vertex.cc
similarity index 100%
rename from milena/doc/tutorial/samples/graph-i2v-vertex.tex
rename to milena/doc/tutorial/samples/graph-i2v-vertex.cc
diff --git a/milena/doc/tutorial/samples/graph-iter-edge-nbh-edge.tex b/milena/doc/tutorial/samples/graph-iter-edge-nbh-edge.cc
similarity index 100%
rename from milena/doc/tutorial/samples/graph-iter-edge-nbh-edge.tex
rename to milena/doc/tutorial/samples/graph-iter-edge-nbh-edge.cc
diff --git a/milena/doc/tutorial/samples/graph-iter-vertex-nbh-vertex.tex b/milena/doc/tutorial/samples/graph-iter-vertex-nbh-vertex.cc
similarity index 100%
rename from milena/doc/tutorial/samples/graph-iter-vertex-nbh-vertex.tex
rename to milena/doc/tutorial/samples/graph-iter-vertex-nbh-vertex.cc
diff --git a/milena/doc/tutorial/samples/graph-iter-vertex.tex b/milena/doc/tutorial/samples/graph-iter-vertex.cc
similarity index 100%
rename from milena/doc/tutorial/samples/graph-iter-vertex.tex
rename to milena/doc/tutorial/samples/graph-iter-vertex.cc
diff --git a/milena/doc/tutorial/samples/graph-iter.tex b/milena/doc/tutorial/samples/graph-iter.cc
similarity index 100%
rename from milena/doc/tutorial/samples/graph-iter.tex
rename to milena/doc/tutorial/samples/graph-iter.cc
diff --git a/milena/doc/tutorial/samples/graph-p-vertices.tex b/milena/doc/tutorial/samples/graph-p-vertices.cc
similarity index 100%
rename from milena/doc/tutorial/samples/graph-p-vertices.tex
rename to milena/doc/tutorial/samples/graph-p-vertices.cc
diff --git a/milena/doc/tutorial/samples/ima-has.cc b/milena/doc/tutorial/samples/ima-has.cc
new file mode 100644
index 0000000..9513541
--- /dev/null
+++ b/milena/doc/tutorial/samples/ima-has.cc
@@ -0,0 +1,38 @@
+#include <mln/essential/2d.hh>
+int main()
+{
+ using namespace mln;
+
+ // Default border size is set to 0.
+
+ // Image defined on a box2d from
+ // (0, 0) to (2, 2)
+ image2d<int> ima1(2, 3);
+
+ std::cout << "ima1.has(0, 0) : "
+ << ima1.has(point2d(0, 0)) << std::endl;
+
+ std::cout << "ima1.has(-3, 0) : "
+ << ima1.has(point2d(-3, 0)) << std::endl;
+
+ std::cout << "ima1.has(2, 5) : "
+ << ima1.has(point2d(2, 5)) << std::endl;
+
+ std::cout << "=========" << std::endl;
+
+ // Set default border size to 0.
+ border::thickness = 0;
+
+ // Image defined on a box2d from
+ // (0, 0) to (2, 2)
+ image2d<int> ima2(2, 3);
+
+ std::cout << "ima2.has(0, 0) : "
+ << ima2.has(point2d(0, 0)) << std::endl;
+
+ std::cout << "ima2.has(-3, 0) : "
+ << ima2.has(point2d(-3, 0)) << std::endl;
+
+ std::cout << "ima2.has(2, 5) : "
+ << ima2.has(point2d(2, 5)) << std::endl;
+}
diff --git a/milena/doc/tutorial/samples/ima-load.tex b/milena/doc/tutorial/samples/ima-load.cc
similarity index 100%
rename from milena/doc/tutorial/samples/ima-load.tex
rename to milena/doc/tutorial/samples/ima-load.cc
diff --git a/milena/doc/tutorial/samples/ima-save.tex b/milena/doc/tutorial/samples/ima-save.cc
similarity index 100%
rename from milena/doc/tutorial/samples/ima-save.tex
rename to milena/doc/tutorial/samples/ima-save.cc
diff --git a/milena/doc/tutorial/samples/ima-size-output.tex b/milena/doc/tutorial/samples/ima-size-output.tex
deleted file mode 100644
index 6be445f..0000000
--- a/milena/doc/tutorial/samples/ima-size-output.tex
+++ /dev/null
@@ -1 +0,0 @@
-nrows = 10 - ncols = 12
diff --git a/milena/doc/tutorial/samples/ima-size.tex b/milena/doc/tutorial/samples/ima-size.cc
similarity index 52%
rename from milena/doc/tutorial/samples/ima-size.tex
rename to milena/doc/tutorial/samples/ima-size.cc
index 46d5a08..9fa845d 100644
--- a/milena/doc/tutorial/samples/ima-size.tex
+++ b/milena/doc/tutorial/samples/ima-size.cc
@@ -1,8 +1,9 @@
-#include <core/image/image2d.hh>
-#include <core/site_set/box2d.hh>
+#include <mln/essential/2d.hh>
int main()
{
- mln::image2d<int> ima(box2d(0,0, 10,12));
+ using namespace mln;
+
+ image2d<int> ima(make::box2d(0,0, 10,12));
std::cout << "nrows = " << ima.nrows()
<< " - "
diff --git a/milena/doc/tutorial/samples/ima2d-1-output.tex b/milena/doc/tutorial/samples/ima2d-1-output.tex
deleted file mode 100644
index e689fa5..0000000
--- a/milena/doc/tutorial/samples/ima2d-1-output.tex
+++ /dev/null
@@ -1,2 +0,0 @@
-b = [(-2,3)...(3,-5)]
-domain = [(-2,3)...(3,-5)]
diff --git a/milena/doc/tutorial/samples/ima2d-1.cc b/milena/doc/tutorial/samples/ima2d-1.cc
new file mode 100644
index 0000000..bc0da47
--- /dev/null
+++ b/milena/doc/tutorial/samples/ima2d-1.cc
@@ -0,0 +1,13 @@
+#include <mln/essential/2d.hh>
+int main()
+{
+ using namespace mln;
+
+ // Define a box2d from (-2,-3) to (3,5).
+ box2d b = make::box2d(-2,-3, 3,5);
+ // Initialize an image with b as domain.
+ image2d<int> ima(b);
+
+ std::cout << "b = " << b << std::endl;
+ std::cout << "domain = " << ima.domain() << std::endl;
+}
diff --git a/milena/doc/tutorial/samples/ima2d-1.tex b/milena/doc/tutorial/samples/ima2d-1.tex
deleted file mode 100644
index f792182..0000000
--- a/milena/doc/tutorial/samples/ima2d-1.tex
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <mln/core/alias/box2d.hh>
-#include <mln/core/image/image2d.hh>
-int main()
-{
- // Define a box2d from (-2,3) to (3,-5).
- box2d b(-2,3, 3,-5);
- // Initialize an image with b as domain.
- image2d<int> ima(b);
-
- cout << "b = " << b << std::endl;
- cout << "domain = " << ima.domain() << std::endl;
-}
diff --git a/milena/doc/tutorial/samples/ima2d-2.tex b/milena/doc/tutorial/samples/ima2d-2.cc
similarity index 100%
rename from milena/doc/tutorial/samples/ima2d-2.tex
rename to milena/doc/tutorial/samples/ima2d-2.cc
diff --git a/milena/doc/tutorial/samples/ima2d-3.tex b/milena/doc/tutorial/samples/ima2d-3.cc
similarity index 100%
rename from milena/doc/tutorial/samples/ima2d-3.tex
rename to milena/doc/tutorial/samples/ima2d-3.cc
diff --git a/milena/doc/tutorial/samples/ima2d-4.tex b/milena/doc/tutorial/samples/ima2d-4.cc
similarity index 100%
rename from milena/doc/tutorial/samples/ima2d-4.tex
rename to milena/doc/tutorial/samples/ima2d-4.cc
diff --git a/milena/doc/tutorial/samples/ima2d-5.tex b/milena/doc/tutorial/samples/ima2d-5.cc
similarity index 100%
rename from milena/doc/tutorial/samples/ima2d-5.tex
rename to milena/doc/tutorial/samples/ima2d-5.cc
diff --git a/milena/doc/tutorial/samples/ima2d-6-clone.tex b/milena/doc/tutorial/samples/ima2d-6-clone.cc
similarity index 100%
rename from milena/doc/tutorial/samples/ima2d-6-clone.tex
rename to milena/doc/tutorial/samples/ima2d-6-clone.cc
diff --git a/milena/doc/tutorial/samples/ima2d-7.tex b/milena/doc/tutorial/samples/ima2d-7.cc
similarity index 100%
rename from milena/doc/tutorial/samples/ima2d-7.tex
rename to milena/doc/tutorial/samples/ima2d-7.cc
diff --git a/milena/doc/tutorial/samples/ima2d-decl-1.tex b/milena/doc/tutorial/samples/ima2d-decl-1.cc
similarity index 100%
rename from milena/doc/tutorial/samples/ima2d-decl-1.tex
rename to milena/doc/tutorial/samples/ima2d-decl-1.cc
diff --git a/milena/doc/tutorial/samples/ima2d-decl-2-blobs-full.cc b/milena/doc/tutorial/samples/ima2d-decl-2-blobs-full.cc
new file mode 100644
index 0000000..9728ac7
--- /dev/null
+++ b/milena/doc/tutorial/samples/ima2d-decl-2-blobs-full.cc
@@ -0,0 +1,21 @@
+#include <mln/essential/2d.hh>
+int main()
+{
+ using namespace mln;
+ using value::int_u8;
+
+ bool vals[6][5] = {
+ {0, 1, 1, 0, 0},
+ {0, 1, 1, 0, 0},
+ {0, 0, 0, 0, 0},
+ {1, 1, 0, 1, 0},
+ {1, 0, 1, 1, 1},
+ {1, 0, 0, 0, 0}
+ };
+ image2d<bool> ima = make::image(vals);
+
+ int_u8 nlabels;
+ image2d<int_u8> lbl = labeling::blobs(ima, c4(), nlabels);
+
+ debug::println(lbl);
+}
diff --git a/milena/doc/tutorial/samples/ima2d-decl-2-blobs-output.tex b/milena/doc/tutorial/samples/ima2d-decl-2-blobs-output.tex
deleted file mode 100644
index 0e08731..0000000
--- a/milena/doc/tutorial/samples/ima2d-decl-2-blobs-output.tex
+++ /dev/null
@@ -1,7 +0,0 @@
-0 1 1 0 0
-0 1 1 0 0
-0 0 0 0 0
-2 2 0 3 0
-2 0 3 3 3
-2 0 0 0 0
-
diff --git a/milena/doc/tutorial/samples/ima2d-decl-2-blobs.tex b/milena/doc/tutorial/samples/ima2d-decl-2-blobs.cc
similarity index 100%
rename from milena/doc/tutorial/samples/ima2d-decl-2-blobs.tex
rename to milena/doc/tutorial/samples/ima2d-decl-2-blobs.cc
diff --git a/milena/doc/tutorial/samples/ima2d-decl-2.tex b/milena/doc/tutorial/samples/ima2d-decl-2.cc
similarity index 100%
rename from milena/doc/tutorial/samples/ima2d-decl-2.tex
rename to milena/doc/tutorial/samples/ima2d-decl-2.cc
diff --git a/milena/doc/tutorial/samples/ima2d-display-1.tex b/milena/doc/tutorial/samples/ima2d-display-1.cc
similarity index 100%
rename from milena/doc/tutorial/samples/ima2d-display-1.tex
rename to milena/doc/tutorial/samples/ima2d-display-1.cc
diff --git a/milena/doc/tutorial/samples/ima2d-display-2.tex b/milena/doc/tutorial/samples/ima2d-display-2.cc
similarity index 100%
rename from milena/doc/tutorial/samples/ima2d-display-2.tex
rename to milena/doc/tutorial/samples/ima2d-display-2.cc
diff --git a/milena/doc/tutorial/samples/ima2d-restricted-1.tex b/milena/doc/tutorial/samples/ima2d-restricted-1.cc
similarity index 100%
rename from milena/doc/tutorial/samples/ima2d-restricted-1.tex
rename to milena/doc/tutorial/samples/ima2d-restricted-1.cc
diff --git a/milena/doc/tutorial/samples/ima2d-restricted-2.tex b/milena/doc/tutorial/samples/ima2d-restricted-2.cc
similarity index 100%
rename from milena/doc/tutorial/samples/ima2d-restricted-2.tex
rename to milena/doc/tutorial/samples/ima2d-restricted-2.cc
diff --git a/milena/doc/tutorial/samples/ima2d-restricted-3.tex b/milena/doc/tutorial/samples/ima2d-restricted-3.cc
similarity index 100%
rename from milena/doc/tutorial/samples/ima2d-restricted-3.tex
rename to milena/doc/tutorial/samples/ima2d-restricted-3.cc
diff --git a/milena/doc/tutorial/samples/ima2d-restricted-display-1.tex b/milena/doc/tutorial/samples/ima2d-restricted-display-1.cc
similarity index 100%
rename from milena/doc/tutorial/samples/ima2d-restricted-display-1.tex
rename to milena/doc/tutorial/samples/ima2d-restricted-display-1.cc
diff --git a/milena/doc/tutorial/samples/ima2d-rot.cc b/milena/doc/tutorial/samples/ima2d-rot.cc
new file mode 100644
index 0000000..4832045
--- /dev/null
+++ b/milena/doc/tutorial/samples/ima2d-rot.cc
@@ -0,0 +1,42 @@
+#include <mln/essential/2d.hh>
+int main()
+{
+ using namespace mln;
+
+ border::thickness = 30;
+
+ // Declare the image to be rotated.
+ image2d<value::rgb8> ima1_(220, 220);
+ level::fill(ima1_, literal::cyan);
+ border::fill(ima1_, literal::yellow);
+ // Set an infinite extension.
+ mln_VAR(ima1, extend(ima1_, pw::cst(literal::yellow)));
+
+ // Declare the output image.
+ image2d<value::rgb8> ima2(220, 220);
+ level::fill(ima2, literal::cyan);
+ border::fill(ima2, literal::yellow);
+
+ box2d extended_domain= ima1.domain();
+ extended_domain.enlarge(border::thickness);
+
+ // Draw the domain bounding box
+ draw::box(ima1, geom::bbox(ima1_), literal::red);
+ // Save the image, including its border.
+ io::ppm::save(ima1 | extended_domain,
+ "../figures/ima2d-rot-1.ppm");
+
+ // Define and apply a point-wise rotation
+ fun::x2x::rotation<2,float> rot1(0.5, literal::zero);
+ image2d<value::rgb8>::fwd_piter p(ima1.domain());
+ for_all(p)
+ {
+ algebra::vec<2,float> pv = p.to_site().to_vec();
+ algebra::vec<2,float> v = rot1.inv()(pv);
+ ima2(p) = ima1(v);
+ }
+
+ draw::box(ima2, ima2.bbox(), literal::red);
+ io::ppm::save(ima2 | extended_domain,
+ "../figures/ima2d-rot-2.ppm");
+}
diff --git a/milena/doc/tutorial/samples/labeling-compute-call.tex b/milena/doc/tutorial/samples/labeling-compute-call.cc
similarity index 100%
rename from milena/doc/tutorial/samples/labeling-compute-call.tex
rename to milena/doc/tutorial/samples/labeling-compute-call.cc
diff --git a/milena/doc/tutorial/samples/labeling-compute-full.cc b/milena/doc/tutorial/samples/labeling-compute-full.cc
new file mode 100644
index 0000000..fa378ca
--- /dev/null
+++ b/milena/doc/tutorial/samples/labeling-compute-full.cc
@@ -0,0 +1,27 @@
+#include <mln/essential/2d.hh>
+int main()
+{
+ using namespace mln;
+ using value::int_u8;
+
+ bool vals[6][5] = {
+ {0, 1, 1, 0, 0},
+ {0, 1, 1, 0, 0},
+ {0, 0, 0, 0, 0},
+ {1, 1, 0, 1, 0},
+ {1, 0, 1, 1, 1},
+ {1, 0, 0, 0, 0}
+ };
+ image2d<bool> ima = make::image(vals);
+
+ int_u8 nlabels;
+ image2d<int_u8> lbl = labeling::blobs(ima, c4(), nlabels);
+
+ util::array<box2d> boxes =
+ labeling::compute(accu::meta::bbox(),
+ lbl,
+ nlabels);
+
+ for (unsigned i = 1; i <= nlabels; ++i)
+ std::cout << boxes[i] << std::endl;
+}
diff --git a/milena/doc/tutorial/samples/labeling-compute-result-output.tex b/milena/doc/tutorial/samples/labeling-compute-result-output.tex
deleted file mode 100644
index d7fbc06..0000000
--- a/milena/doc/tutorial/samples/labeling-compute-result-output.tex
+++ /dev/null
@@ -1,3 +0,0 @@
-[(1,2)...(2,3)]
-[(4,1)...(6,2)]
-[(4,3)...(5,5)]
diff --git a/milena/doc/tutorial/samples/labeling-compute-result.tex b/milena/doc/tutorial/samples/labeling-compute-result.cc
similarity index 100%
rename from milena/doc/tutorial/samples/labeling-compute-result.tex
rename to milena/doc/tutorial/samples/labeling-compute-result.cc
diff --git a/milena/doc/tutorial/samples/logical-not-output.tex b/milena/doc/tutorial/samples/logical-not-output.tex
deleted file mode 100644
index 27c6ceb..0000000
--- a/milena/doc/tutorial/samples/logical-not-output.tex
+++ /dev/null
@@ -1,17 +0,0 @@
-ima:
-| -
-- |
-
-----
-ima_neg:
-- |
-| -
-
-ima:
-| -
-- |
-
-----
-not_inplace(ima)
-- |
-| -
diff --git a/milena/doc/tutorial/samples/logical-not.tex b/milena/doc/tutorial/samples/logical-not.cc
similarity index 77%
rename from milena/doc/tutorial/samples/logical-not.tex
rename to milena/doc/tutorial/samples/logical-not.cc
index ecb7748..ede62ca 100644
--- a/milena/doc/tutorial/samples/logical-not.tex
+++ b/milena/doc/tutorial/samples/logical-not.cc
@@ -1,6 +1,4 @@
-#include <mln/core/image/image2d.hh>
-#include <mln/logical/not.hh>
-#include <mln/debug/println.hh>
+#include <mln/essential/2d.hh>
int main()
{
using namespace mln;
@@ -9,7 +7,7 @@ int main()
{1, 0},
{0, 1}
};
- image2d<bool> ima = make::image2d(vals);
+ image2d<bool> ima = make::image(vals);
std::cout << "ima:" << std::endl;
debug::println(ima);
diff --git a/milena/doc/tutorial/samples/mln_var-1.tex b/milena/doc/tutorial/samples/mln_var-1.cc
similarity index 100%
rename from milena/doc/tutorial/samples/mln_var-1.tex
rename to milena/doc/tutorial/samples/mln_var-1.cc
diff --git a/milena/doc/tutorial/samples/mln_var-2.tex b/milena/doc/tutorial/samples/mln_var-2.cc
similarity index 100%
rename from milena/doc/tutorial/samples/mln_var-2.tex
rename to milena/doc/tutorial/samples/mln_var-2.cc
diff --git a/milena/doc/tutorial/samples/mln_var-3.tex b/milena/doc/tutorial/samples/mln_var-3.cc
similarity index 100%
rename from milena/doc/tutorial/samples/mln_var-3.tex
rename to milena/doc/tutorial/samples/mln_var-3.cc
diff --git a/milena/doc/tutorial/samples/out.ppm b/milena/doc/tutorial/samples/out.ppm
new file mode 100644
index 0000000000000000000000000000000000000000..7a33c29f788c3048de656608515af2b838ac61da
GIT binary patch
literal 145320
zcmeI1L2DdG5Jr90uUN<>xyX*eIph|w2>}O;$sds84KX;9QAEJMUMcVFN-OPXX1b@k
zx~lsvwpovMx~so>^Lj@6?x(ZwHotB!x7Qap+mD+MUpK#h`n<io*!+0@Vzc@C=H|=K
z&!1m?J97T{`s4O|`{mQk#ra>?a@L!7zy0yc=Kc2H?Zx$<e{U`>KW<)c|J#1P`tr~A
z@@Dh);=`2;dUgGE^ZncRuiyM|_VVS6jr=`(`Rdi#?Xze6ApwU8JiEQ+4+(fk;P~qB
zP!Bbb08GMww*>Y~%D%n3tMpbL^>mm3Om^6G=S#k45>@h)=OY1_bS{k!%X`2is`Md>
z4mmtt@+gyX@c1*lCjrX@9y5t5QDyA}o?;SJTAG2mjuRMR5>?g~#c_i=d_Tb?s_c*l
z4@(|r5>=wgdI>zqBv{sKiU(O$tN|t~hR@Wa2~07GDp6&P1YmOXQsrR91ZJ2-l{G|B
zkp~Y`FJw|a=Al|@=pli5CQ&7-v`t_+lc=%>M|oJ|A|_F#ttdQzQL%<3CQ)U@PW3bO
zQYKL)s<cWVfl08mYDzy!99=0)j>f{liV37Ki7HWL`2=9Hq7ayRG=XF$QDu2ijCQJ@
zgV{{ViT$L+N-Yz}VG>oM%907JVG>nZ+M}PjGMPk`B}LH>exoa0$t0>AO_hUd63Ax~
zRier=39MogEXy=yjbs`)7bY8MVq;5K%Ot8qmD&lwWMh(PU^xm*qDpO1G{DuGB`7i}
zL#?TVb4g%GK!-_Gi7NFH&}9-;;=1(-s4<Bu^+d70t)WLyXA)J0=D|bpnoOcfRH>1G
zGLvAb(G(A|s#pU|Rt%r1M-$Lz5>=wgbqSPXQbr!V3OGmt(+Lz|5>>7f#dOP>|7lSs
zQDyV|lvrRXCQ&7-%uS#)lc=(UN!lK>Ad{#vR}^g{H@i9mCQ;>V7x=(&0%e&*m8dd3
zf#OVpWqMPNrP1MgnC!6W&X;V#B&tM}DG69IDRVi$LMhKf0!B=t$`ny}0Hb0J#!RBh
zioK39wH=eF5>+lsz@AA|8O2w%>O3%cyA0vgWy(_yPdY|f%gz+?k2RC*;4wL|#QTUz
zR2kALmbBQ+Re?!Vi7F=(c*rEGM3wauIAIbj>o>(_i*!3nT_$CAx5-dgtpvuHM3tzr
zW&+ijM3uF4<aXXCm_(H|Md6kfo5DOWi7IV+9c7lMnM9SSvQ7f^nUr<&CHUm;kfZob
ztIkO#QDq%bXf-$JI4+n(m3Z<ffjK5oC91SeU;&e0Y2B2dd#+a5-k6knw3fy=K@(WU
zB&tM}b_qCS5>*EEn^xJ2nM9R#qR?t?&~bb+i7JEQq*8VYlc*9^S|s3+Nm)1FHXi*B
zSw%j921#TRRa%H55I-eKb;=~F#FOH`gjb1+<77;>?_RM?_vFCt2|^|IG_dRvOaDwt
zg(eq3iHnLca}vm9Qfz5L3aT^;+NPb0W(mP0sx-O&7Xf2X$qFV>rI#ieaAG+{6edxn
zB^7n&TE`@+M3wpp#9&g^&BIPN4?C-wM3wrYsJnGmpFIqds1i?#{}Ns%*B0A%A6RO5
za$pxM*~E1ch{&YWY;pnUBuuHP3Ft8?woIKo>+|g3MnT)Ob7YpFOrpxH>v;qKhvTR+
zi7I0>-64m^CB<bDRUY@TrT5xQqDoY`Hi4*2%DQ>jY4l;I0F$V4tteXBh%?p_m`PNL
zC&hmWuZ-&>{S>zE7O^bj$${N;#xgcNuxt*?Hkg!Em|OrE*9@m5Cs2|}v84$qsM08C
zn|8`#cE40fxKT{{s2!82(j;pOEDJM<DlMAW42{D=T4EAawgG2(CQ&7-OiQ30CS~0`
z>@@MPW5Oh=OcO;LTX6O&nqm@F;>o063)!fG?K?h}R-PR2&DMF!iC`HV%T}3`b)|4@
zBXMR~lz=UhJnSrLO6ONo!%U*eplq8ni7HX$R04Y-zukFRzDzFP-IETgG|763vE>CE
z^tk`-!;;9|T+1t6@kt)QgFJxW(>TyQ_{18@6{ICylwj!_%f~d<WKymH6D(oUDCp#N
zj?>r!ld?vzbcW>=jg^^1mC0@~*;>k0H4o%LBi6T*_w$*=j4B<dauJR7J!z^+$;9LW
zDC?PsOGu#61(T*&Mr>&4nv-elk4aQ%MtCNTUYJCcO>Ot9XzY?nR9RG&3P1{$yJyn-
z=iqAZibi!9oCok?58wxo4pFahe^*Q%u0f69)`Z^FxtcT%!FXYkyUKW=>eJXKld@`d
z@YOqbDH`1|i7ErAvMh}rnFLGMSXuxn0XVv!9G>}2o<D|F^KIkeP5i)#VRr@`y!>mo
zaFdx_t8X>|QyQJ_-KN{O1U}o8Za+|gM!!s&V%aTn6AQ0KBTRBvd2&BlnMT)4qROE?
zrvJJCQdaElx%=)xYhrIv{n0J~)e%iWQmOoafy!X32l2}!s<dF+7mdS;Ve+t9tiHT0
z5K=7CBaH!=G*zYaNU`Idhw@8f3?@yn^bC?pZF?G>Uwp3j?%{byr5kgD3^_EdO7D8S
zyY~seB&xjYR_2>9G=|x`O_`MT%_%h#j4HzhqcIYbrdU>iM}5+eG{WSl@OC#d>V#Mh
z7?{RjOrpxsOX$JDJ&m#NKIA+2-PeoK@Bl9>*~C=kp_NuCJ-8ZFCOse+iAkwhW$kl=
zL}RiY8V4$aF$tCrF3b2diXTp1F!`X#2Zau?IR3p*n=}r1#$!_IK9E!N%`O>}nbMZg
zGL0}f&4NEw?rD_5rYm>-)03V0^gu{Y_NdDEdOU^ii6byMVHF>$?1;tz(x^;!q00C)
z%56sa3nnK#Is9lBk?}oTr!)@y24+$gU_y#5lU>sYlgp7d!E#Td%(c8Qcb`n(sZY;{
z?a6jj8DEd5Y~>ya&t!Nkq46=hFu8F18-h~(wlO}9S&!9^5j^>S3rxmSB{ZIZcys_J
z7kW}YrlCq`Jc93uw~a6<t223A-NltR(;d=Ar4|X~35s+N!(>wLa#a~$kGj}Rj@Ay7
zvdlbzC7zY2N@$$qZ|sLKnL+Y0EaTHCS8I(|Q%p*LiPFpa{2Y_exC&*MRK*e+SJ60}
z+!~WLRT&>h1)vm$XpqSYSVE%$ig!c6WZvE_XARNq12nmh%`SE3#5)>%ylIn3$<_oC
zNzZ1YQnUDg@KF^oS*qR6aec&rr~fv~q=f98idyA)!f&(|nCuAMQ3CuOY?(<(yOxW*
z&Fc@miHcydeQqb(@A5~DGbx#SQ<h~tE|Hrp3MSixcDC`3KhQpt627IHs?X&ZwuPm2
z!DJ^`E^N8`kHKUM7IlwVQh~iNDWO!~RSOl6)b9u%hRMLJMgT0M#*UbjbPAcue%Opo
z$2kQigMk_ct?WwsVp3wVcbe9W**%VSB1{ILG#XSZ>+Oz7$xBOIHsh>paKO`H(l4R`
zaZ)L{M<yjW8^vYMqSD&1gLKNITP(wZq*ypidU2*=Q-crHFO$-^?7da@#NY_2mk*Pb
p$yD!X`~kaWQrf3$yrj|M!&7JlFj)c1LcMHd*nvs@B>_(f{14b_By9iy
literal 0
HcmV?d00001
diff --git a/milena/doc/tutorial/samples/parray-append.tex b/milena/doc/tutorial/samples/parray-append.cc
similarity index 100%
rename from milena/doc/tutorial/samples/parray-append.tex
rename to milena/doc/tutorial/samples/parray-append.cc
diff --git a/milena/doc/tutorial/samples/parray-display-1.tex b/milena/doc/tutorial/samples/parray-display-1.cc
similarity index 100%
rename from milena/doc/tutorial/samples/parray-display-1.tex
rename to milena/doc/tutorial/samples/parray-display-1.cc
diff --git a/milena/doc/tutorial/samples/paste-call-1-output.tex b/milena/doc/tutorial/samples/paste-call-1-output.tex
deleted file mode 100644
index 987bf30..0000000
--- a/milena/doc/tutorial/samples/paste-call-1-output.tex
+++ /dev/null
@@ -1,3 +0,0 @@
-b b b b
-b b b b
-b b b b
diff --git a/milena/doc/tutorial/samples/paste-call-1.tex b/milena/doc/tutorial/samples/paste-call-1.cc
similarity index 67%
rename from milena/doc/tutorial/samples/paste-call-1.tex
rename to milena/doc/tutorial/samples/paste-call-1.cc
index 50e4885..e4bfec2 100644
--- a/milena/doc/tutorial/samples/paste-call-1.tex
+++ b/milena/doc/tutorial/samples/paste-call-1.cc
@@ -1,8 +1,4 @@
-#include <mln/core/image/image2d.hh>
-#include <mln/make/box2d.hh>
-#include <mln/level/fill.hh>
-#include <mln/level/paste.hh>
-#include <mln/debug/println.hh>
+#include <mln/essential/2d.hh>
int main()
{
using namespace mln;
diff --git a/milena/doc/tutorial/samples/paste.tex b/milena/doc/tutorial/samples/paste.cc
similarity index 100%
rename from milena/doc/tutorial/samples/paste.tex
rename to milena/doc/tutorial/samples/paste.cc
diff --git a/milena/doc/tutorial/samples/point-1-output.tex b/milena/doc/tutorial/samples/point-1-output.tex
deleted file mode 100644
index 39f77d0..0000000
--- a/milena/doc/tutorial/samples/point-1-output.tex
+++ /dev/null
@@ -1,2 +0,0 @@
-has(p1)? false
-has(p2)? true
diff --git a/milena/doc/tutorial/samples/point-1.tex b/milena/doc/tutorial/samples/point-1.cc
similarity index 100%
rename from milena/doc/tutorial/samples/point-1.tex
rename to milena/doc/tutorial/samples/point-1.cc
diff --git a/milena/doc/tutorial/samples/predicate-1.tex b/milena/doc/tutorial/samples/predicate-1.cc
similarity index 100%
rename from milena/doc/tutorial/samples/predicate-1.tex
rename to milena/doc/tutorial/samples/predicate-1.cc
diff --git a/milena/doc/tutorial/samples/win-create-1-display.tex b/milena/doc/tutorial/samples/win-create-1-display.cc
similarity index 100%
rename from milena/doc/tutorial/samples/win-create-1-display.tex
rename to milena/doc/tutorial/samples/win-create-1-display.cc
diff --git a/milena/doc/tutorial/samples/win-create-1.tex b/milena/doc/tutorial/samples/win-create-1.cc
similarity index 100%
rename from milena/doc/tutorial/samples/win-create-1.tex
rename to milena/doc/tutorial/samples/win-create-1.cc
diff --git a/milena/doc/tutorial/samples/win-create-2.tex b/milena/doc/tutorial/samples/win-create-2.cc
similarity index 100%
rename from milena/doc/tutorial/samples/win-create-2.tex
rename to milena/doc/tutorial/samples/win-create-2.cc
diff --git a/milena/doc/tutorial/samples/win-create-3.cc b/milena/doc/tutorial/samples/win-create-3.cc
new file mode 100644
index 0000000..8e4bf97
--- /dev/null
+++ b/milena/doc/tutorial/samples/win-create-3.cc
@@ -0,0 +1,7 @@
+bool b[25] = { 0, 0, 1, 0, 0,
+ 0, 1, 0, 1, 0,
+ 1, 0, 1, 0, 1,
+ 1, 1, 0, 1, 1,
+ 1, 0, 1, 0, 1 };
+window2d win = convert::to<window2d>(b)
+
diff --git a/milena/doc/tutorial/todoxygen.sh b/milena/doc/tutorial/todoxygen.sh
new file mode 100755
index 0000000..5442cc4
--- /dev/null
+++ b/milena/doc/tutorial/todoxygen.sh
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+if [ $# -ne 2 ]; then
+ echo "Usage: $0 <file.tex> <output dir>";
+ exit 1;
+fi
+
+out="$2/`basename $1 .tex`.hh"
+html="$2/`basename $1 .tex`.html"
+
+#Convert .tex to .html
+hevea -O -fix $1 -o $html
+
+bodyl=`grep -n "<BODY >" $html | cut -d ':' -f 1`
+nlines=`wc -l $html | cut -d ' ' -f 1`
+tail_line=$(($nlines - $bodyl))
+
+echo '/*! ' > $out
+echo '\htmlonly' >> $out
+tail -n $tail_line $html >> $out
+echo '\endhtmlonly */' >> $out
+
+sed -i -e 's/ /\ /g' $out
+sed -i -e 's/↦/\&map/g' $out
+sed -i -e 's/’/\&rsquo/g' $out
+sed -i -e 's/→/\&rarr/g' $out
+sed -i -e 's/“/\&ldquo/g' $out
+sed -i -e 's/”/\&rdquo/g' $out
+sed -i -e 's/≡/\&equiv/g' $out
+
+#Doxygen wants us to preserve '\n' after commands.
+sed -i -e 's/\\endhtmlonly/\\endhtmlonly\n/g' $out
+sed -i -e 's/\\htmlonly/\n\\htmlonly\n/g' $out
+sed -i -e 's/\\endhtmlonly/\\endhtmlonly\n/g' $out
+sed -i -e 's/\\htmlonly/\n\\htmlonly\n/g' $out
diff --git a/milena/doc/tutorial/tutorial.tex b/milena/doc/tutorial/tutorial.tex
index 4c0c052..f58c8d2 100644
--- a/milena/doc/tutorial/tutorial.tex
+++ b/milena/doc/tutorial/tutorial.tex
@@ -6,6 +6,7 @@
\usepackage{color}
\usepackage{html}
\usepackage{tikz}
+\usepackage{pgf}
\newcommand{\img}[4]{
\begin{figure}[ht!]
@@ -66,7 +67,19 @@ showstringspaces=false,linewidth=14cm}
\newcommand{\doxycode}[1]{
\backslash endhtmlonly%
-\backslash include #1.tex%
+\backslash include #1.cc%
+\backslash htmlonly%
+}
+
+\newcommand{\doxyoutput}[1]{
+\backslash endhtmlonly%
+\backslash include #1.txt%
+\backslash htmlonly%
+}
+
+\newcommand{\doxyfigure}[2]{
+\backslash endhtmlonly%
+\backslash image html #1.png%
\backslash htmlonly%
}
@@ -88,7 +101,12 @@ $$
\renewcommand{\doxychapter}[2]{\chapter{#2}\label{#1}}
\renewcommand{\doxysection}[2]{\section{#2}\label{#1}}
\renewcommand{\doxysubsection}[2]{\subsection{#2}\label{#1}}
-\renewcommand{\doxycode}[1]{\lstinputlisting[frame=single]{samples/#1}}
+\renewcommand{\doxycode}[1]{\lstinputlisting[frame=single]{samples/#1.cc}}
+\renewcommand{\doxyoutput}[1]{\lstinputlisting[frame=single]{outputs/#1.txt}}
+\renewcommand{\doxyfigure}[2]{%
+\pgfimage[width=#2]{figures/#1}%
+\label{#1}%
+}
\renewenvironment{doxymath}
{
$$
@@ -118,6 +136,14 @@ $$
\textit{#1}%
}
+\newcommand{\must}{%
+\textbf{must}
+}
+\newcommand{\should}{%
+\textbf{should}
+}
+
+
\usetikzlibrary{er}
\newcommand{\neighcfour}{%
@@ -211,9 +237,11 @@ $$
\begin{document}
+% Doxygen use only - Generate the left menu.
\begin{htmlonly}
\backslash endhtmlonly
\backslash page tutorial Tutorial
+- \backslash subpage installation
- \backslash subpage foreword
- \backslash subpage site
- \backslash subpage siteset
@@ -227,6 +255,7 @@ $$
- \backslash subpage arithmops
- \backslash subpage mathtools
- \backslash subpage globalvars
+- \backslash subpage macros
\backslash htmlonly
\end{htmlonly}
@@ -235,6 +264,20 @@ $$
\end{latexonly}
%====================================
+\doxychapter{installation}{Installation}
+
+%**************************
+\doxysection{requirements}{Requirements}
+
+%**************************
+\doxysection{getolena}{Getting Olena}
+
+%**************************
+\doxysection{buildingolena}{Building Olena}
+
+
+
+%====================================
\doxychapter{foreword}{Foreword}
%**************************
@@ -297,6 +340,24 @@ Olena's tarball is structured as follow:
\item swilena: Python bindings for Olena.
\end{itemize}
+\doxysection{compilehint}{Writing and compiling a program with Olena}
+
+Before writing your first program, please be ware of these hints:
+
+\begin{itemize}
+ \item By default, Olena enables a lot of internal pre and post conditions.
+ Usually, this is a useful feature and it \should be enabled. It can heavily
+ slow down a program though and these tests can be disabled by compiling
+ using \code{-DNDEBUG}.
+ \begin{verbatim}
+g++ -DNDEBUG -Ipath/to/mln my_program.cc
+ \end{verbatim}
+
+ \item If you decide to use optimization flags to compile for debugging,
+ prefer using \code{-O1}. It is much faster to compile and it gives good
+ performance results.
+
+\end{itemize}
%====================================
\clearpage
@@ -498,7 +559,7 @@ FIXME & FIXME \\
%**************************
\doxysection{imapossvalues}{Possible value types}
-Every image type must take its type of value as parameter.
+Every image type \must take its type of value as parameter.
The value type can be one of the builtins one:
\begin{itemize}
\item \type{bool}
@@ -537,7 +598,7 @@ Value type & underlying data type \\
All these types are available in mln/value and accessible in the
\namespace{mln::value} namespace.
-Most of the time, the name of the header which must be included to use one of these data
+Most of the time, the name of the header which \must be included to use one of these data
types is actually ``type\_name.hh". For instance, for \type{rgb8} the header will be
\header{rgb8.hh}.
@@ -595,14 +656,14 @@ exactly equivalent.
\doxycode{ima2d-1}
Output:
-\doxycode{ima2d-1-output}
+\doxyoutput{ima2d-1}
To know if a site belongs to an image domain or not, a method ``\code{has()}'' is
available.
\doxycode{point-1}
Output:
-\doxycode{point-1-output}
+\doxyoutput{point-1}
Since the notion of site is independent from the image it applies on, we can
form expressions where a site passed to several images:
@@ -626,7 +687,7 @@ as shown in the following example.
Output:
-\doxycode{borderthickness-output}
+\doxyoutput{borderthickness}
It is important to note that to display the border in the ouput, we use a
special debug function, \code{debug::println\_with\_border}. Indeed, the border and the
@@ -691,16 +752,39 @@ information.
in consideration the extension/border if it exists. The default border
thickness is set to 3 as shown by the following example.
-[FIXME: Add example has(p) when p is in the border and border::thickness
-modified.]
+\doxycode{ima-has}
+
+Output:
+
+\doxyoutput{ima-has}
-Most of the time, this is the good behavior. For instance, if a rotation of 20
-degrees is applied to an image, sites which were not previously in the domain
+Most of the time, this is the good behavior. For instance, if a rotation
+is applied to an image, sites which were not previously in the domain
will be part of it. Thanks to the extension/border, these sites will be
-associated to the value they had when they were part of the extension/border.
+associated to the value of the extension/border.
+
+In the following example, the extension is set to a constant color \var{yellow}.
+It means that whatever the new sites computed through the rotation, it will be
+part of the image and a value will be available. Site which were previously in
+the extension/border, will be associated to \var{yellow} in the output image.
+
+\doxycode{ima2d-rot}
+
+Output:
+
+\bigskip
+
+\begin{tabular}{c c}
+\doxyfigure{ima2d-rot-1}{4cm} & \doxyfigure{ima2d-rot-2}{4cm} \\
+\multicolumn{2}{c}{\var{ima1} and its border before rotation (left) and \var{ima2}
+ and its border after rotation} \\
+\end{tabular}
+
+\bigskip
[Image+bord rotation 20degres, avant, apres]
+
Sometimes taking the domain in consideration may not be the expected behavior.
If you do not want to use the extension/border for a specific routine, simply
restrict the image to its domain.
@@ -717,9 +801,6 @@ Note that:
\code{border::get(ima.domain())} == \code{border::get(ima | ima.domain())} == 0
\end{center}
-So it is also valid to write:
-\doxycode{extension-ignore2}
-
%================================================
\doxysection{imamorphed}{Morphed images}
@@ -817,7 +898,7 @@ Most of the time, images can be modified and these two methods can be used both
to read a value and modify it. Both methods are equivalent.
\doxycode{ima2d-3}
Output:
-\doxycode{ima2d-3-output}
+\doxyoutput{ima2d-3-output}
Usually, you will want to use the functional way, ``\code{ima(Site)}'', more
particularly while iterating over all the sites through an iterator. This use
@@ -847,7 +928,7 @@ provided in \hpath{mln/geom} in the following files:
\doxycode{ima-size}
Output:
-\doxycode{ima-size-output}
+\doxyoutput{ima-size}
%================================================
@@ -868,13 +949,14 @@ Voir les vset => attendre que ca soit ameliore?
In Olena, there are both the window and neighborhood concept. A window can be
defined on any sites around a central site which may also be included.
-A neighborhood is more restrictive and must not include the central site.
+A neighborhood is more restrictive and \must not include the central site.
Therefore these two concepts are really similar and are detailed together in
this section.
By default, structural elements are centered. The central site is located at the
-origin of the grid: ``\var{literal::origin}''. With image2d, the central site is
-(0,0).
+origin of the grid: ``\var{literal::origin}''. With \type{image2d}, the central site is
+(0,0). Centered structural elements \must have an odd size.
+
\doxysection{sedef}{Define an element}
@@ -968,11 +1050,15 @@ Another way to define the same window is to provide a bool array:
\doxycode{win-create-2}
\textbf{Note that despite the different ways of defining these windows,
- ``'var{win}'' == ``\var{win2}''}.
-The boolean array must always have an odd size.
+ ``var{win}'' == ``\var{win2}''}.
+The boolean array \must always have an odd size.
While creating a windows thanks to a bool array/matrix, the window's center is the
central site of the array/matrix.
+\textbf{This way of defining a window is very powerful since it enables the possibility
+of having non-square windows such as:}
+
+
\subsubsection{Neighborhood}
@@ -1094,11 +1180,11 @@ owns the method ``\code{coord row() const}'' which is defined as
\doxysection{sitesdpoint}{Dpoint}
Dpoints are relative sites. They are usually used in window and neighborhood
definitions. Since the central site is not constant, windows and neighborhoods
-must be recomputed and dpoints help in doing that.
+\must be recomputed and dpoints help in doing that.
\doxycode{dpoint-1}
Output:
-\doxycode{dpoint-1-output}
+\doxyoutput{dpoint-1}
@@ -1175,7 +1261,7 @@ use the \code{for\_all} loop: \code{level::fill()} and \code{level::paste()}.
Important note: macros for iterators exist in two versions:
``\code{mln\_*iter}'' and ``\code{mln\_*iter\_}''. The difference is that the
-first version must be used in templated function whereas the second one must be
+first version \must be used in templated function whereas the second one \must be
used in non templated functions.
If you want a list of all the macros available in Olena, please refert to
@@ -1286,7 +1372,7 @@ data for the sites (5, 5) to (14, 14) (so it has 100 sites).
\doxycode{paste-call-1}
Output:
-\doxycode{paste-call-1-output}
+\doxyoutput{paste-call-1}
Before pasting, the couple of images looked like:
@@ -1328,10 +1414,10 @@ Consider the following image:
Then label this image thanks to \code{labeling::blobs()}:
\doxycode{ima2d-decl-2-blobs}
Output:
-\doxycode{ima2d-decl-2-blobs-output}
+\doxyoutput{ima2d-decl-2-blobs-full}
Note that this routine returns the number of components in its third parameter.
-This parameter \textbf{must} be of the same type as the returned image value.
+This parameter \must be of the same type as the returned image value.
%**************************
@@ -1358,7 +1444,7 @@ algorithm a version which returns a new image and another which works in place.
Sample code:
\doxycode{logical-not}
Output:
-\doxycode{logical-not-output}
+\doxyoutput{logical-not}
%**************************
\doxysection{compute}{Compute}
@@ -1433,9 +1519,9 @@ It exists two versions of each accumulator.
\type{accu::meta::bbox}.
\end{itemize}
-Note that when an accumulator is passed to \code{*::compute()}, it must be instanciated.You cannot write:
+Note that when an accumulator is passed to \code{*::compute()}, it \must be instanciated.You cannot write:
\doxycode{accu-wrong-instanciation}
-Instead, you must write:
+Instead, you \must write:
\doxycode{accu-right-instanciation}
\doxysubsection{exlblcompute}{Example with labeling::compute()}
@@ -1449,7 +1535,7 @@ Consider the following image:
Then label this image thanks to \code{labeling::blobs()}:
\doxycode{ima2d-decl-2-blobs}
Output:
-\doxycode{ima2d-decl-2-blobs-output}
+\doxyoutput{ima2d-decl-2-blobs-full}
Then, use \code{labeling::compute()} with the bbox accumulator:
\doxycode{labeling-compute-call}
@@ -1462,7 +1548,7 @@ In this case, it returns an array of \type{box2d}.
set the background to 0, we will want to iterate from 1 to nlabels included.
\doxycode{labeling-compute-result}
Output:
-\doxycode{labeling-compute-result-output}
+\doxyoutput{labeling-compute-full}
\subsection{Routines based on accumulators and *::compute()}
@@ -1516,7 +1602,7 @@ You can easily get a \type{Function\_p2b} by comparing the value returned
by a \type{Function\_p2v} to another Value.
The following sample codes illustrate this feature.
-In order to use C functions as predicate, they must have one of the following
+In order to use C functions as predicate, they \must have one of the following
prototype if you work on 2D images:
\doxycode{predicate-1}
Of course, you just need to change the point type if you use another image
@@ -1553,15 +1639,15 @@ When writing:
\doxycode{ima2d-restricted-1}
-\var{sub\_D} must be included in \code{ima.domain()}.
+\var{sub\_D} \must be included in \code{ima.domain()}.
Let's have an image, \var{imab}, like this:
-\doxycode{ima2d-display-output-1}
+\doxyoutput{ima2d-display-output-1}
Extract a sub image from \var{imab} with sites having their value set to 1.
\doxycode{mln_var-2}
Then, \var{imab1} looks like:
-\doxycode{ima2d-display-output-2}
+\doxyoutput{ima2d-display-output-2}
Now, if we want to extract a sub image it may fail, depending on the site set
used:
@@ -1604,7 +1690,7 @@ Specific data can be associated to each vertex and/or edges.
First, create a graph which looks like the following:
-\doxycode{graph-output-1}
+\doxyoutput{graph-output-1}
First we need to add vertices:
@@ -1694,12 +1780,26 @@ trace::quiet & Enable trace printing & true/false \\
%====================================
\newpage
\clearpage
-\doxychapter{macros}{Useful Macros}
+\doxychapter{macros}{Useful macros}
+\renewcommand{\arraystretch}{2}
+
+\doxysection{vardeclmacros}{Variable declaration macros}
+\begin{tabular}{l|p{4cm}|p{6cm}}
+Name & Arguments & Description \\
+\hline
+mln\_VAR(N, V) & N : name of the variable. & \\
+ & V : value to assign to N. & Declare a variable N of type N\_t and
+ assign the value V. \\
+
+mln\_const\_VAR(N, V) & N : name of the variable. & \\
+ & V : value to assign to N. & Declare a const variable N of type N\_t
+ and assign the value V. \\
+\end{tabular}
+
\doxysection{macrositerators}{Iterator type macros}
\doxysubsection{macrosdefit}{Default iterator types}
-\renewcommand{\arraystretch}{2}
\begin{tabular}{l|p{4cm}|p{6cm}}
Name & Arguments & Description \\
\hline
@@ -1795,4 +1895,16 @@ mln\_bkd\_nixter(I, N) & I : image type, & \\
backward iterator of a neighborhood on an image of type I. \\
\end{tabular}
+
+\doxysubsection{macrosbkdit}{Graph iterators}
+\begin{tabular}{l|p{4cm}|p{6cm}}
+Name & Arguments & Description \\
+\hline
+mln\_vertex\_iter(G) & G : graph type & Iterator on vertices. \\
+mln\_edge\_iter(G) & G : graph type & Iterator on edges. \\
+mln\_vertex\_nbh\_edge\_iter(G) & G : graph type & Iterator on the edges adjacent to a vertex. \\
+mln\_vertex\_nbh\_vertex\_iter(G) & G : graph type & Iterator on the vertices adjacent to a vertex. \\
+mln\_edge\_nbh\_edge\_iter(G) & G : graph type & Iterator on the edges adjacent to an edge. \\
+\end{tabular}
+
\end{document}
diff --git a/milena/mln/core/internal/complex_window_p_base.hh b/milena/mln/core/internal/complex_window_p_base.hh
index 2362c54..c02ba4b 100644
--- a/milena/mln/core/internal/complex_window_p_base.hh
+++ b/milena/mln/core/internal/complex_window_p_base.hh
@@ -28,7 +28,7 @@
#ifndef MLN_CORE_IMAGE_COMPLEX_WINDOW_P_BASE_HH
# define MLN_CORE_IMAGE_COMPLEX_WINDOW_P_BASE_HH
-/// \file mln/core/image/complex_window_p_base.hh
+/// \file mln/core/internal/complex_window_p_base.hh
/// \brief Definition of a generic window centered on the face
/// of a complex, based on a pair of (forward and backward) complex
/// iterators. The center (site) is part of the window.
diff --git a/milena/mln/core/routine/extend.hh b/milena/mln/core/routine/extend.hh
index 984d9a0..6d447c1 100644
--- a/milena/mln/core/routine/extend.hh
+++ b/milena/mln/core/routine/extend.hh
@@ -31,7 +31,7 @@
/*!
* \file mln/core/routine/extend.hh
*
- * \brief Definition of a morpher that extends the domain of an image.
+ * \brief Definition of a morpher that extends the extended domain of an image.
*
* \todo Use the 'instant' mechanism.
* \todo Deal with ambiguities.
diff --git a/milena/mln/core/site_set/p_complex.hh b/milena/mln/core/site_set/p_complex.hh
index 3420519..3fcb7da 100644
--- a/milena/mln/core/site_set/p_complex.hh
+++ b/milena/mln/core/site_set/p_complex.hh
@@ -103,7 +103,7 @@ namespace mln
/* FIXME: Aggregate site data (location). */
- /** \brief A complex psite set based on a the \N-faces of a complex
+ /** \brief A complex psite set based on the N-faces of a complex
of dimension \tparam D (a \p D-complex).
\arg \p D The dimension of the complex.
diff --git a/milena/mln/debug/graph.hh b/milena/mln/debug/graph.hh
index a23d386..e92b802 100644
--- a/milena/mln/debug/graph.hh
+++ b/milena/mln/debug/graph.hh
@@ -29,7 +29,7 @@
#ifndef MLN_DEBUG_DRAW_GRAPH_HH
# define MLN_DEBUG_DRAW_GRAPH_HH
-/// \file mln/debug/draw_graph.hh
+/// \file mln/debug/graph.hh
/// \brief Draw an (classical) image from a mln::graph_image.
# include <mln/pw/image.hh>
diff --git a/milena/mln/debug/println_with_border.hh b/milena/mln/debug/println_with_border.hh
index 05971a0..52ff01b 100644
--- a/milena/mln/debug/println_with_border.hh
+++ b/milena/mln/debug/println_with_border.hh
@@ -81,7 +81,7 @@ namespace mln
{
mlc_is(mln_trait_image_speed(I), trait::image::speed::fastest)::check();
- impl::println_with_border(exact(input).bbox(), exact(input));
+ impl::println_with_border(geom::bbox(exact(input)), exact(input));
}
# endif // ! MLN_INCLUDE_ONLY
diff --git a/milena/mln/fun/x2v/bilinear.hh b/milena/mln/fun/x2v/bilinear.hh
index 8aa242f..e1e577b 100644
--- a/milena/mln/fun/x2v/bilinear.hh
+++ b/milena/mln/fun/x2v/bilinear.hh
@@ -34,7 +34,7 @@
# include <mln/convert/to.hh>
# include <mln/algebra/vec.hh>
-/*! \file mln/fun/x2x/bilinear.hh
+/*! \file mln/fun/x2v/bilinear.hh
*
* \brief Define a bilinear interpolation of values from an underlying image
*/
diff --git a/milena/mln/fun/x2v/linear.hh b/milena/mln/fun/x2v/linear.hh
index 7a2e329..8f62185 100644
--- a/milena/mln/fun/x2v/linear.hh
+++ b/milena/mln/fun/x2v/linear.hh
@@ -28,7 +28,7 @@
#ifndef MLN_FUN_X2X_LINEAR_HH
# define MLN_FUN_X2X_LINEAR_HH
-/*! \file mln/fun/x2x/linear.hh
+/*! \file mln/fun/x2v/linear.hh
*
* \brief Define a linear interpolation of values from an underlying image
*/
diff --git a/milena/mln/fun/x2v/nneighbor.hh b/milena/mln/fun/x2v/nneighbor.hh
index ae805a9..a2f9595 100644
--- a/milena/mln/fun/x2v/nneighbor.hh
+++ b/milena/mln/fun/x2v/nneighbor.hh
@@ -33,7 +33,7 @@
# include <mln/algebra/vec.hh>
# include <mln/convert/to.hh>
-/*! \file mln/fun/x2x/nneighbor.hh
+/*! \file mln/fun/x2v/nneighbor.hh
*
* \brief Define a nneighbor interpolation of values from an underlying image
*/
diff --git a/milena/mln/geom/nsites.hh b/milena/mln/geom/nsites.hh
index b8b790e..cf6ffa1 100644
--- a/milena/mln/geom/nsites.hh
+++ b/milena/mln/geom/nsites.hh
@@ -28,10 +28,8 @@
#ifndef MLN_GEOM_NSITES_HH
# define MLN_GEOM_NSITES_HH
-/*! \file mln/geom/nsites.hh
- *
- * \brief Compute the number of sites of an image or a site set.
- */
+/// \file mln/geom/nsites.hh
+/// Compute the number of sites of an image or a site set.
# include <mln/core/concept/site_set.hh>
# include <mln/core/concept/image.hh>
@@ -52,7 +50,6 @@ namespace mln
unsigned nsites(const Image<I>& input);
-
# ifndef MLN_INCLUDE_ONLY
@@ -72,7 +69,7 @@ namespace mln
trace::entering("geom::impl::generic::nsites");
const S& s = exact(s_);
mln_precondition(s.is_valid());
-
+
unsigned n = 0;
mln_piter(S) p(s);
for_all(p)
@@ -80,7 +77,7 @@ namespace mln
trace::exiting("geom::impl::generic::nsites");
return n;
- }
+ }
} // end of namespace mln::geom::impl::generic
@@ -112,7 +109,7 @@ namespace mln
const Site_Set<S>& s)
{
return impl::generic::nsites(s);
- }
+ }
template <typename S>
inline
@@ -120,7 +117,7 @@ namespace mln
const Site_Set<S>& s)
{
return impl::nsites_method(s);
- }
+ }
// Dispatch facade.
@@ -130,12 +127,12 @@ namespace mln
{
return nsites_dispatch(mln_trait_site_set_nsites(S)(),
s);
- }
+ }
} // end of namespace mln::geom::internal
-
+
// Facades.
template <typename S>
diff --git a/milena/mln/topo/n_face.hh b/milena/mln/topo/n_face.hh
index 2f8a7e0..ef1aad8 100644
--- a/milena/mln/topo/n_face.hh
+++ b/milena/mln/topo/n_face.hh
@@ -99,7 +99,7 @@ namespace mln
/* FIXME: We should not provide lower_dim_adj_faces() when N ==
0 nor higher_dim_adj_faces() when N == D. */
- /// \Return an array of face handles pointing to adjacent (n-1)-faces.
+ /// Return an array of face handles pointing to adjacent (n-1)-faces.
std::vector< algebraic_n_face<N - 1, D> > lower_dim_adj_faces() const;
/// Return an array of face handles pointing to adjacent (n+1)-faces.
std::vector< algebraic_n_face<N + 1, D> > higher_dim_adj_faces() const;
diff --git a/milena/mln/util/internal/graph_nbh_iter.hh b/milena/mln/util/internal/graph_nbh_iter.hh
index 9b7aa3a..e43c5ea 100644
--- a/milena/mln/util/internal/graph_nbh_iter.hh
+++ b/milena/mln/util/internal/graph_nbh_iter.hh
@@ -31,7 +31,7 @@
# include <mln/core/concept/proxy.hh>
# include <mln/util/internal/graph_nbh_iter_base.hh>
-/// \file mln/util/internal/graph_vertex_nbh_vertex_iter.hh
+/// \file mln/util/internal/graph_nbh_iter.hh
/// \brief Implementation for graph vertex iterators centered to a vertex.
namespace mln
diff --git a/milena/tests/core/site_set/p_complex.cc b/milena/tests/core/site_set/p_complex.cc
index 490d387..0f84118 100644
--- a/milena/tests/core/site_set/p_complex.cc
+++ b/milena/tests/core/site_set/p_complex.cc
@@ -25,7 +25,7 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/// \file tests/core/image/p_complex.cc
+/// \file tests/core/site_set/p_complex.cc
/// \brief Test of mln::p_complex and mln::geom::complex_geometry.
#include <algorithm>
diff --git a/milena/tests/morpho/complex_image_wst.cc b/milena/tests/morpho/complex_image_wst.cc
index 8060cee..f6aab30 100644
--- a/milena/tests/morpho/complex_image_wst.cc
+++ b/milena/tests/morpho/complex_image_wst.cc
@@ -25,7 +25,7 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/// \file tests/core/image/complex_image_swt.cc
+/// \file tests/morpho/complex_image_swt.cc
/// \brief Testing Meyer's Watershed Transform on mln::complex_image.
#include <iostream>
--
1.5.6.5
1
0
* mln/linear/all.hh,
* mln/make/essential.hh: Fix wrong includes.
* mln/make/win_chamfer.hh: fix missing namespaces.
---
milena/ChangeLog | 9 +++++++++
milena/mln/linear/all.hh | 3 ++-
milena/mln/make/essential.hh | 2 +-
milena/mln/make/win_chamfer.hh | 32 ++++++++++++++++----------------
4 files changed, 28 insertions(+), 18 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index c412779..f58f2a6 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,3 +1,12 @@
+2008-11-06 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Fix wrong includes and missing namespaces.
+
+ * mln/linear/all.hh,
+ * mln/make/essential.hh: Fix wrong includes.
+
+ * mln/make/win_chamfer.hh: fix missing namespaces.
+
2008-11-12 Roland Levillain <roland(a)lrde.epita.fr>
Add a saving routine for rgb8 (color) 2-complex images.
diff --git a/milena/mln/linear/all.hh b/milena/mln/linear/all.hh
index 881466e..d69c0b2 100644
--- a/milena/mln/linear/all.hh
+++ b/milena/mln/linear/all.hh
@@ -58,11 +58,12 @@ namespace mln
}
+# include <mln/linear/ch_convolve.hh>
# include <mln/linear/convolve.hh>
+# include <mln/linear/convolve_2x1d.hh>
# include <mln/linear/convolve_directional.hh>
# include <mln/linear/gaussian.hh>
# include <mln/linear/lap.hh>
-# include <mln/linear/line_x2_convolve.hh>
# include <mln/linear/log.hh>
//# include <mln/linear/sobel.hh>
//# include <mln/linear/local/convolve.hh>
diff --git a/milena/mln/make/essential.hh b/milena/mln/make/essential.hh
index c69e50b..d0e8f85 100644
--- a/milena/mln/make/essential.hh
+++ b/milena/mln/make/essential.hh
@@ -42,7 +42,7 @@
# include <mln/make/vec.hh>
//# include <mln/make/voronoi.hh>
# include <mln/make/w_window.hh>
-# include <mln/make/w_window_line.hh>
+# include <mln/make/w_window_directional.hh>
//# include <mln/make/win_chamfer.hh>
#endif // ! MLN_MAKE_ESSENTIAL_HH
diff --git a/milena/mln/make/win_chamfer.hh b/milena/mln/make/win_chamfer.hh
index cbe738b..9ba3791 100644
--- a/milena/mln/make/win_chamfer.hh
+++ b/milena/mln/make/win_chamfer.hh
@@ -48,18 +48,18 @@ namespace mln
{
template<int d10, int d11>
- const w_window2d_int
+ const mln::w_window2d_int
mk_chamfer_3x3_int()
{
int ws[] = { d11, d10, d11,
d10, 0, 0,
0, 0, 0 };
-
+
return (make::w_window2d(ws));
}
-
+
template<int d10, int d11, int d21>
- const w_window2d_int
+ const mln::w_window2d_int
mk_chamfer_5x5_int()
{
int ws[] = { 0, d21, 0, d21, 0,
@@ -67,21 +67,21 @@ namespace mln
0, d10, 0, 0, 0,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0 };
-
+
return (make::w_window2d(ws));
}
-
- const w_window2d_float
+
+ const mln::w_window2d_float
mk_chamfer_3x3_float(float d10, float d11)
{
float ws[] = { d11, d10, d11,
d10, 0, 0,
0, 0, 0 };
-
+
return (make::w_window2d(ws));
}
-
- const w_window2d_float
+
+ const mln::w_window2d_float
mk_chamfer_5x5_float(float d10, float d11, float d21)
{
float ws[] = { 0, d21, 0, d21, 0,
@@ -89,23 +89,23 @@ namespace mln
0, d10, 0, 0, 0,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0 };
-
+
return (make::w_window2d(ws));
}
-
- const w_window2d_float
+
+ const mln::w_window2d_float
mk_chamfer_exact()
{
float r2 = sqrt(2);
float ws[] = { r2, 1, r2,
1, 0, 0,
0, 0, 0 };
-
+
return (make::w_window2d(ws));
}
-
+
} // end of namespace mln::make
-
+
} // end of namespace mln
#endif // ! MLN_MAKE_WIN_CHAMFER_HH
--
1.5.6.5
1
0
12 Nov '08
* mln/io/off/save.hh
(io::off::save(const rgb8_2complex_image3df&, const std::string&)):
New function.
(io::off::internal::rgb8_off_saver): New functor.
---
milena/ChangeLog | 9 +++++++++
milena/mln/io/off/save.hh | 39 +++++++++++++++++++++++++++++++++++++++
2 files changed, 48 insertions(+), 0 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 3706c51..c412779 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,14 @@
2008-11-12 Roland Levillain <roland(a)lrde.epita.fr>
+ Add a saving routine for rgb8 (color) 2-complex images.
+
+ * mln/io/off/save.hh
+ (io::off::save(const rgb8_2complex_image3df&, const std::string&)):
+ New function.
+ (io::off::internal::rgb8_off_saver): New functor.
+
+2008-11-12 Roland Levillain <roland(a)lrde.epita.fr>
+
Add a saving routine for floating-point value 2-complex images.
* mln/io/off/save.hh
diff --git a/milena/mln/io/off/save.hh b/milena/mln/io/off/save.hh
index e6582cc..40f2e5a 100644
--- a/milena/mln/io/off/save.hh
+++ b/milena/mln/io/off/save.hh
@@ -87,6 +87,16 @@ namespace mln
void save(const float_2complex_image3df& ima,
const std::string& filename);
+ /** \brief Save a 3x8-bit RGB (color) OFF image into a complex image.
+
+ \param[in] ima The image to save.
+ \param[in] filename The name of the file where to save the image.
+
+ Only data is attached to 2-faces is saved; the OFF file
+ cannot store data attached to faces of other dimensions. */
+ void save(const rgb8_2complex_image3df& ima,
+ const std::string& filename);
+
namespace internal
{
@@ -136,6 +146,14 @@ namespace mln
void write_face_data(std::ostream& ostr, const value& v) const;
};
+
+ struct rgb8_off_saver
+ : public off_saver< rgb8_2complex_image3df, rgb8_off_saver >
+ {
+ /// \brief Save face data.
+ void write_face_data(std::ostream& ostr, const value& v) const;
+ };
+
} // end of namespace mln::io::off::internal
@@ -170,6 +188,14 @@ namespace mln
trace::exiting("mln::io::off::save");
}
+ void
+ save(const rgb8_2complex_image3df& ima, const std::string& filename)
+ {
+ trace::entering("mln::io::off::save");
+ internal::rgb8_off_saver()(ima, filename);
+ trace::exiting("mln::io::off::save");
+ }
+
/*-------------------------.
| Actual implementations. |
@@ -399,6 +425,19 @@ namespace mln
ostr << ' ' << v << ' ' << v << ' ' << v
<< ' ' << 1.0f << std::endl;
}
+
+ void
+ rgb8_off_saver::write_face_data(std::ostream& ostr,
+ const value& v) const
+ {
+ /* RGBA color.
+
+ Each channel (R, G, B) of the color V is an integer in
+ the range 0..255. A fourth channel, A, controls the
+ transparency. */
+ ostr << ' ' << v.red() << ' ' << v.green() << ' ' << v.blue()
+ << ' ' << 1.0f << std::endl;
+ }
/* \} */
} // end of namespace mln::io::off::internal
--
1.6.0.1
1
0
12 Nov '08
* mln/io/off/save.hh
(io::off::save(const float_2complex_image3df&, const std::string&)):
New function.
(io::off::internal::float_off_saver): New functor.
---
milena/ChangeLog | 9 ++++++++
milena/mln/io/off/save.hh | 51 +++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 60 insertions(+), 0 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 1a0b0a0..3706c51 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,14 @@
2008-11-12 Roland Levillain <roland(a)lrde.epita.fr>
+ Add a saving routine for floating-point value 2-complex images.
+
+ * mln/io/off/save.hh
+ (io::off::save(const float_2complex_image3df&, const std::string&)):
+ New function.
+ (io::off::internal::float_off_saver): New functor.
+
+2008-11-12 Roland Levillain <roland(a)lrde.epita.fr>
+
Add a saving routine for int_u8 2-complex images.
* mln/io/off/save.hh
diff --git a/milena/mln/io/off/save.hh b/milena/mln/io/off/save.hh
index 604281e..e6582cc 100644
--- a/milena/mln/io/off/save.hh
+++ b/milena/mln/io/off/save.hh
@@ -76,6 +76,17 @@ namespace mln
void save(const int_u8_2complex_image3df& ima,
const std::string& filename);
+ /** \brief Save a floating-point value grey-level OFF image into
+ a complex image.
+
+ \param[in] ima The image to save.
+ \param[in] filename The name of the file where to save the image.
+
+ Only data is attached to 2-faces is saved; the OFF file
+ cannot store data attached to faces of other dimensions. */
+ void save(const float_2complex_image3df& ima,
+ const std::string& filename);
+
namespace internal
{
@@ -114,6 +125,17 @@ namespace mln
void write_face_data(std::ostream& ostr, const value& v) const;
};
+
+ /* FIXME: We should turn float_off_saver into a
+ float01_off_saver (see FIXME/comment in implementation
+ below). */
+ struct float_off_saver
+ : public off_saver< float_2complex_image3df, float_off_saver >
+ {
+ /// \brief Save face data.
+ void write_face_data(std::ostream& ostr, const value& v) const;
+ };
+
} // end of namespace mln::io::off::internal
@@ -140,6 +162,14 @@ namespace mln
trace::exiting("mln::io::off::save");
}
+ void
+ save(const float_2complex_image3df& ima, const std::string& filename)
+ {
+ trace::entering("mln::io::off::save");
+ internal::float_off_saver()(ima, filename);
+ trace::exiting("mln::io::off::save");
+ }
+
/*-------------------------.
| Actual implementations. |
@@ -348,6 +378,27 @@ namespace mln
ostr << ' ' << v << ' ' << v << ' ' << v
<< ' ' << 1.0f << std::endl;
}
+
+ /* FIXME: We should turn float_off_saver into a
+ float01_off_saver to avoid the assertions below. */
+ void
+ float_off_saver::write_face_data(std::ostream& ostr,
+ const value& v) const
+ {
+ /* Using RGBA colors to represent a floating-point value.
+
+ Each channel (R, G, B) of the color V is a floating-point
+ number in the range 0..1. A fourth channel, A, controls
+ the transparency.
+
+ We just set the same value for each channel, as the OFF
+ file format does not support gray-level values as
+ such. */
+ mln_assertion(0.0f <= v);
+ mln_assertion(v <= 1.0f);
+ ostr << ' ' << v << ' ' << v << ' ' << v
+ << ' ' << 1.0f << std::endl;
+ }
/* \} */
} // end of namespace mln::io::off::internal
--
1.6.0.1
1
0
* mln/io/off/save.hh
(io::off::save(const int_u8_2complex_image3df&, const std::string&)):
New function.
(io::off::internal::int_u8_off_saver): New functor.
---
milena/ChangeLog | 9 +++++++++
milena/mln/io/off/save.hh | 42 ++++++++++++++++++++++++++++++++++++++++++
2 files changed, 51 insertions(+), 0 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 0fb9951..1a0b0a0 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,14 @@
2008-11-12 Roland Levillain <roland(a)lrde.epita.fr>
+ Add a saving routine for int_u8 2-complex images.
+
+ * mln/io/off/save.hh
+ (io::off::save(const int_u8_2complex_image3df&, const std::string&)):
+ New function.
+ (io::off::internal::int_u8_off_saver): New functor.
+
+2008-11-12 Roland Levillain <roland(a)lrde.epita.fr>
+
Introduce a factoring functor to save OFF image files.
* mln/io/off/save.hh (mln::io::off::internal::off_saver): New.
diff --git a/milena/mln/io/off/save.hh b/milena/mln/io/off/save.hh
index a3fde3a..604281e 100644
--- a/milena/mln/io/off/save.hh
+++ b/milena/mln/io/off/save.hh
@@ -66,6 +66,16 @@ namespace mln
void save(const bin_2complex_image3df& ima,
const std::string& filename);
+ /** \brief Save an 8-bit grey-level OFF image into a complex image.
+
+ \param[in] ima The image to save.
+ \param[in] filename The name of the file where to save the image.
+
+ Only data is attached to 2-faces is saved; the OFF file
+ cannot store data attached to faces of other dimensions. */
+ void save(const int_u8_2complex_image3df& ima,
+ const std::string& filename);
+
namespace internal
{
@@ -96,6 +106,14 @@ namespace mln
void write_face_data(std::ostream& ostr, const value& v) const;
};
+
+ struct int_u8_off_saver
+ : public off_saver< int_u8_2complex_image3df, int_u8_off_saver >
+ {
+ /// \brief Save face data.
+ void write_face_data(std::ostream& ostr, const value& v) const;
+ };
+
} // end of namespace mln::io::off::internal
@@ -114,6 +132,14 @@ namespace mln
trace::exiting("mln::io::off::save");
}
+ void
+ save(const int_u8_2complex_image3df& ima, const std::string& filename)
+ {
+ trace::entering("mln::io::off::save");
+ internal::int_u8_off_saver()(ima, filename);
+ trace::exiting("mln::io::off::save");
+ }
+
/*-------------------------.
| Actual implementations. |
@@ -306,6 +332,22 @@ namespace mln
{
// Do nothing (no data associated to faces).
}
+
+ void
+ int_u8_off_saver::write_face_data(std::ostream& ostr,
+ const value& v) const
+ {
+ /* Using RGBA colors to represent an 8-bit integer value.
+
+ Each channel (R, G, B) of the color V is an integer in
+ the range 0..255. A fourth channel, A, controls the
+ transparency.
+
+ We just set the same value for each channel, as the OFF
+ file format does not support gray-level values as-is. */
+ ostr << ' ' << v << ' ' << v << ' ' << v
+ << ' ' << 1.0f << std::endl;
+ }
/* \} */
} // end of namespace mln::io::off::internal
--
1.6.0.1
1
0
12 Nov '08
* mln/io/off/save.hh (mln::io::off::internal::off_saver): New.
Use it to factor...
(mln::io::off::save(const bin_2complex_image3df&, const std::string&)):
...this routine.
---
milena/ChangeLog | 9 ++
milena/mln/io/off/save.hh | 316 +++++++++++++++++++++++++++++++--------------
2 files changed, 228 insertions(+), 97 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 8c5e2ed..0fb9951 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,14 @@
2008-11-12 Roland Levillain <roland(a)lrde.epita.fr>
+ Introduce a factoring functor to save OFF image files.
+
+ * mln/io/off/save.hh (mln::io::off::internal::off_saver): New.
+ Use it to factor...
+ (mln::io::off::save(const bin_2complex_image3df&, const std::string&)):
+ ...this routine.
+
+2008-11-12 Roland Levillain <roland(a)lrde.epita.fr>
+
Aesthetic changes.
* mln/topo/adj_m_face_iter.hh
diff --git a/milena/mln/io/off/save.hh b/milena/mln/io/off/save.hh
index 4273821..a3fde3a 100644
--- a/milena/mln/io/off/save.hh
+++ b/milena/mln/io/off/save.hh
@@ -32,6 +32,7 @@
/// \brief Input saving function for OFF files.
///
/// \see http://shape.cs.princeton.edu/benchmark/documentation/off_format.html
+/// \see https://people.scs.fsu.edu/~burkardt/html/off_format.html
# include <cstdlib>
@@ -60,134 +61,255 @@ namespace mln
\param[in] ima The image to save.
\param[in] filename The name of the file where to save the image.
- The image is said binary since data only represent the
+ The image is said binary since data represent only the
existence of faces. */
- void save(const bin_2complex_image3df& ima, const std::string& filename);
+ void save(const bin_2complex_image3df& ima,
+ const std::string& filename);
+
+
+ namespace internal
+ {
+
+ template <typename I, typename E>
+ struct off_saver : public Object<E>
+ {
+ /// Type of the values.
+ typedef mln_value(I) value;
+
+ /// Dimension of the built complex.
+ static const unsigned D = 2;
+
+ /// \brief Constructor, with static checks.
+ off_saver();
+
+ /// Load an image from \a filename into \a ima.
+ void operator()(const I& ima, const std::string& filename) const;
+ };
+
+
+ struct bin_off_saver
+ : public off_saver< bin_2complex_image3df, bin_off_saver >
+ {
+ /// \brief Save face data.
+ ///
+ /// Dummy, does nothings (but required by the super class).
+ void write_face_data(std::ostream& ostr, const value& v) const;
+ };
+
+ } // end of namespace mln::io::off::internal
# ifndef MLN_INCLUDE_ONLY
- void save(const bin_2complex_image3df& ima, const std::string& filename)
+ /*----------.
+ | Facades. |
+ `----------*/
+
+ void
+ save(const bin_2complex_image3df& ima, const std::string& filename)
{
trace::entering("mln::io::off::save");
+ internal::bin_off_saver()(ima, filename);
+ trace::exiting("mln::io::off::save");
+ }
+
- const std::string me = "mln::io::off::save";
+ /*-------------------------.
+ | Actual implementations. |
+ `-------------------------*/
- std::ofstream ostr(filename.c_str());
- if (!ostr)
+ // -------- //
+ // Canvas. //
+ // -------- //
+
+ namespace internal
+ {
+
+ template <typename I, typename E>
+ off_saver<I, E>::off_saver()
{
- std::cerr << me << ": `" << filename << "' invalid file."
- << std::endl;
- /* FIXME: Too violent. We should allow the use of
- exceptions, at least to have Milena's code behave
- correctly in interpreted environments (std::exit() or
- std::abort() causes the termination of a Python
- interpreter, for instance!). */
- std::exit(1);
+ // Concept checking.
+ void (E::*m1)(std::ostream&, const value&) const =
+ &E::write_face_data;
+ m1 = 0;
}
- /*---------.
- | Header. |
- `---------*/
- /* ``The .off files in the Princeton Shape Benchmark conform
- to the following standard. */
+ template <typename I, typename E>
+ void
+ off_saver<I, E>::operator()(const I& ima,
+ const std::string& filename) const
+ {
+ const std::string me = "mln::io::off::save";
+
+ std::ofstream ostr(filename.c_str());
+ if (!ostr)
+ {
+ std::cerr << me << ": `" << filename << "' invalid file."
+ << std::endl;
+ /* FIXME: Too violent. We should allow the use of
+ exceptions, at least to have Milena's code behave
+ correctly in interpreted environments (std::exit() or
+ std::abort() causes the termination of a Python
+ interpreter, for instance!). */
+ std::exit(1);
+ }
+
+ /*---------.
+ | Header. |
+ `---------*/
+
+ /* ``The .off files in the Princeton Shape Benchmark conform
+ to the following standard.'' */
+
+ /* ``OFF files are all ASCII files beginning with the
+ keyword OFF. '' */
+ ostr << "OFF" << std::endl;
+
+ // A comment.
+ ostr << "# Generated by Milena 1.0 http://olena.lrde.epita.fr\n"
+ << "# EPITA Research and Development Laboratory (LRDE)"
+ << std::endl;
+
+ /* ``The next line states the number of vertices, the number
+ of faces, and the number of edges. The number of edges can
+ be safely ignored.'' */
+ /* FIXME: This is too long. We shall be able to write
+
+ ima.domain().template nfaces<0>()
+
+ or even
+
+ ima.template nfaces<0>().
+ */
+ ostr << ima.domain().cplx().template nfaces<0>() << ' '
+ << ima.domain().cplx().template nfaces<2>() << ' '
+ << ima.domain().cplx().template nfaces<1>() << std::endl;
+
+ /*-------.
+ | Data. |
+ `-------*/
+
+ // --------- //
+ // Complex. //
+ // --------- //
+
+ typedef mln_geom(I) G;
+
+ // ------------------------------------------ //
+ // Vertices & geometry (vertices locations). //
+ // ------------------------------------------ //
+
+ /* ``The vertices are listed with x, y, z coordinates, written
+ one per line.'' */
+
+ // Traverse the 0-faces (vertices).
+ p_n_faces_fwd_piter<D, G> v(ima.domain(), 0);
+ for_all(v)
+ {
+ mln_invariant(v.to_site().size() == 1);
+ ostr << v.to_site().front()[0] << ' '
+ << v.to_site().front()[1] << ' '
+ << v.to_site().front()[2] << std::endl;
+ }
- /* OFF files are all ASCII files beginning with the keyword
- OFF. '' */
- ostr << "OFF" << std::endl;
+ // --------------- //
+ // Faces & edges. //
+ // --------------- //
+
+ /* ``After the list of vertices, the faces are listed, with one
+ face per line. For each face, the number of vertices is
+ specified, followed by indices into the list of
+ vertices.'' */
+
+ // Traverse the 2-faces (polygons).
+ p_n_faces_fwd_piter<D, G> f(ima.domain(), 2);
+
+ typedef complex_m_face_neighborhood<D, G> nbh_t;
+ // A neighborhood where neighbors are the set of 0-faces
+ // transitively adjacent to the reference point.
+ nbh_t nbh;
+ mln_fwd_niter(nbh_t) u(nbh, f);
+ /* FIXME: We should be able to pas this value (m) either at
+ the construction of the neighborhood or at the construction
+ of the iterator. */
+ u.iter().set_m(0);
+
+ // For each (2-)face, iterate on (transitively) ajacent
+ // vertices (0-faces).
+ for_all(f)
+ {
+ unsigned nvertices = 0;
+ std::ostringstream vertices;
+ for_all(u)
+ {
+ // FIXME: Likewise, this is a bit too long...
+ vertices << ' ' << u.unproxy_().face().face_id();
+ ++nvertices;
+ }
+ ostr << nvertices << vertices.str();
+ // Possibly save a value (depends on the actual format).
+ exact(this)->write_face_data(ostr, ima(f));
+ ostr << std::endl;
+ }
- // A comment.
- ostr << "# Generated by Milena 1.0 http://olena.lrde.epita.fr\n"
- << "# EPITA Research and Development Laboratory (LRDE)"
- << std::endl;
+ ostr.close();
+ }
- /* ``The next line states the number of vertices, the number
- of faces, and the number of edges. The number of edges can
- be safely ignored.'' */
- /* FIXME: This is too long. We shall be able to write
+ // ---------------- //
+ // Specific parts. //
+ // ---------------- //
- ima.domain().nfaces<0>()
+ /** \brief Writing values.
- or even
+ From https://people.scs.fsu.edu/~burkardt/html/off_format.html:
- ima.nfaces<0>().
- */
- ostr << ima.domain().cplx().nfaces<0>() << ' '
- << ima.domain().cplx().nfaces<2>() << ' '
- << ima.domain().cplx().nfaces<1>() << std::endl;
+ ``Following these [coordinates] are the face descriptions,
+ typically written with one line per face. Each has the
+ form
- /*-------.
- | Data. |
- `-------*/
+ N Vert1 Vert2 ... VertN [color]
- // --------- //
- // Complex. //
- // --------- //
+ Here N is the number of vertices on this face, and Vert1
+ through VertN are indices into the list of vertices (in
+ the range 0..NVertices-1).
- typedef mln::bin_2complex_image3df I;
- const unsigned D = I::dim;
- typedef mln_geom_(I) G;
+ The optional color may take several forms. Line breaks
+ are significant here: the color description begins after
+ VertN and ends with the end of the line (or the next #
+ comment). A color may be:
- // ------------------------------------------ //
- // Vertices & geometry (vertices locations). //
- // ------------------------------------------ //
+ nothing
+ the default color
+ one integer
+ index into "the" colormap; see below
+ three or four integers
+ RGB and possibly alpha values in the range 0..255
+ three or four floating-point numbers
+ RGB and possibly alpha values in the range 0..1
- /* ``The vertices are listed with x, y, z coordinates, written
- one per line. */
+ For the one-integer case, the colormap is currently read
+ from the file `cmap.fmap' in Geomview's `data'
+ directory. Some better mechanism for supplying a colormap
+ is likely someday.
- // Traverse the 0-faces (vertices).
- p_n_faces_fwd_piter<D, G> v(ima.domain(), 0);
- for_all(v)
- {
- mln_invariant(v.to_site().size() == 1);
- ostr << v.to_site().front()[0] << ' '
- << v.to_site().front()[1] << ' '
- << v.to_site().front()[2] << std::endl;
- }
+ The meaning of "default color" varies. If no face of the
+ object has a color, all inherit the environment's default
+ material color. If some but not all faces have colors, the
+ default is gray (R,G,B,A=.666).''
- // --------------- //
- // Faces & edges. //
- // --------------- //
-
- /* After the list of vertices, the faces are listed, with one
- face per line. For each face, the number of vertices is
- specified, followed by indices into the list of
- vertices.'' */
-
- // Traverse the 2-faces (polygons).
- p_n_faces_fwd_piter<D, G> f(ima.domain(), 2);
-
- typedef complex_m_face_neighborhood<D, G> nbh_t;
- // A neighborhood where neighbors are the set of 0-faces
- // transitively adjacent to the reference point.
- nbh_t nbh;
- mln_fwd_niter_(nbh_t) u(nbh, f);
- /* FIXME: We should be able to pas this value (m) either at
- the construction of the neighborhood or at the construction
- of the iterator. */
- u.iter().set_m(0);
-
- // For each (2-)face, iterate on (transitively) ajacent
- // vertices (0-faces).
- for_all(f)
+ \{ */
+ void
+ bin_off_saver::write_face_data(std::ostream& /* ostr */,
+ const value& /* v */) const
{
- unsigned nvertices = 0;
- std::ostringstream vertices;
- for_all(u)
- {
- // FIXME: Likewise, this is a bit too long...
- vertices << ' ' << u.unproxy_().face().face_id();
- ++nvertices;
- }
- ostr << nvertices << vertices.str() << std::endl;
+ // Do nothing (no data associated to faces).
}
+ /* \} */
- ostr.close();
+ } // end of namespace mln::io::off::internal
- trace::exiting("mln::io::off::save");
- }
# endif // ! MLN_INCLUDE_ONLY
--
1.6.0.1
1
0