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
cleanup-2008 2872: Make morpho erosion generic impl rely on accu transform.
by Thierry Geraud 13 Nov '08
by Thierry Geraud 13 Nov '08
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>
Make morpho erosion generic impl rely on accu transform.
* mln/set/compute.hh (todo): New.
* mln/morpho/erosion.hh
(erosion_on_function): Rely on accu transform.
* mln/morpho/erosion.spe.hh
(erosion_on_function_fastest) Remove; useless since
accu::transform is specialized for fastest input.
(dispatch for the generic version): Remove; useless.
morpho/erosion.hh | 21 +++---------------
morpho/erosion.spe.hh | 58 --------------------------------------------------
set/compute.hh | 5 +++-
3 files changed, 8 insertions(+), 76 deletions(-)
Index: mln/set/compute.hh
--- mln/set/compute.hh (revision 2871)
+++ mln/set/compute.hh (working copy)
@@ -30,9 +30,12 @@
/// \file mln/set/compute.hh
///
-/// Compute an accumulator on a site set.
+/// Compute an accumulator on a site set or a binary image.
+///
+/// \todo Add a version with a binary image as input.
# include <mln/core/concept/meta_accumulator.hh>
+# include <mln/core/concept/image.hh>
# include <mln/core/concept/site_set.hh>
Index: mln/morpho/erosion.spe.hh
--- mln/morpho/erosion.spe.hh (revision 2871)
+++ mln/morpho/erosion.spe.hh (working copy)
@@ -97,38 +97,6 @@
template <typename I, typename W>
mln_concrete(I)
- erosion_on_function_fastest(const Image<I>& input_, const Window<W>& win_)
- {
- trace::entering("morpho::impl::erosion_on_function_fastest");
-
- typedef mln_concrete(I) O;
- const I& input = exact(input_);
- const W& win = exact(win_);
-
- extension::adjust_fill(input, win, mln_max(mln_value(I)));
-
- O output;
- initialize(output, input);
-
- mln_pixter(const I) p(input);
- mln_pixter(O) o(output);
- mln_qixter(const I, W) q(p, win);
- accu::min<mln_value(I)> min;
- for_all_2(p, o)
- {
- min.init();
- for_all(q)
- min.take(q.val());
- o.val() = min.to_result();
- }
-
- trace::exiting("morpho::impl::erosion_on_function_fastest");
-
- return output;
- }
-
- template <typename I, typename W>
- mln_concrete(I)
erosion_on_set_fastest(const Image<I>& input_, const Window<W>& win_)
{
trace::entering("morpho::impl::erosion_on_set_fastest");
@@ -1169,32 +1137,6 @@
namespace internal
{
- // dispatch for the generic version
-
- // FIXME: De-activate because when the window is multiple, the access
- // win.dp(i), used in dpoints_pixter, is impossible.
-
- // template <typename I, typename W>
- // mln_concrete(I)
- // erosion_dispatch_for_generic(trait::image::kind::logic, // On sets.
- // trait::image::speed::fastest,
- // const I& input, const W& win)
- // {
- // if (win.is_centered())
- // return impl::erosion_on_set_centered_fastest(input, win);
- // else
- // return impl::erosion_on_set_fastest(input, win);
- // }
-
- // template <typename I, typename W>
- // mln_concrete(I)
- // erosion_dispatch_for_generic(trait::image::kind::any, // On functions.
- // trait::image::speed::fastest,
- // const I& input, const W& win)
- // {
- // return impl::erosion_on_function_fastest(input, win);
- // }
-
template <typename I, typename W>
mln_concrete(I)
erosion_dispatch_for_generic(trait::image::kind::logic, // On sets.
Index: mln/morpho/erosion.hh
--- mln/morpho/erosion.hh (revision 2871)
+++ mln/morpho/erosion.hh (working copy)
@@ -34,6 +34,7 @@
/// \brief Morphological erosion.
# include <mln/morpho/includes.hh>
+# include <mln/accu/transform.hh>
// Specializations are in:
# include <mln/morpho/erosion.spe.hh>
@@ -83,35 +84,21 @@
namespace generic
{
+
// On function.
template <typename I, typename W>
inline
mln_concrete(I)
- erosion_on_function(const Image<I>& input_, const Window<W>& win_)
+ erosion_on_function(const Image<I>& input, const Window<W>& win)
{
trace::entering("morpho::impl::generic::erosion_on_function");
- const I& input = exact(input_);
- const W& win = exact(win_);
internal::erosion_tests(input, win);
extension::adjust_fill(input, win, mln_max(mln_value(I)));
-
mln_concrete(I) output;
- initialize(output, input);
-
- accu::min<mln_value(I)> min;
-
- mln_piter(I) p(input.domain());
- mln_qiter(W) q(win, p);
- for_all(p)
- {
- min.init();
- for_all(q) if (input.has(q))
- min.take(input(q));
- output(p) = min;
- }
+ output = accu::transform(input, accu::meta::min(), win);
trace::exiting("morpho::impl::generic::erosion_on_function");
return output;
1
0
cleanup-2008 2871: Update dispatch of level::transform_inplace routine.
by Nicolas Ballas 13 Nov '08
by Nicolas Ballas 13 Nov '08
13 Nov '08
https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena
Index: ChangeLog
from Nicolas Ballas <ballas(a)lrde.epita.fr>
Update dispatch of level::transform_inplace routine.
* tests/level/transform_inplace.cc: Add new tests.
* doc/technical/designs/properties/values.txt: Fix typos.
* mln/level/transform.spe.hh: Minor changes.
* mln/level/transform_inplace.hh: Update routine disptach.
doc/technical/designs/properties/values.txt | 3
mln/level/transform.spe.hh | 53 ++++---
mln/level/transform_inplace.hh | 195 ++++++++++++++++++++++++++--
tests/level/transform_inplace.cc | 106 +++++++++++++++
4 files changed, 325 insertions(+), 32 deletions(-)
Index: tests/level/transform_inplace.cc
--- tests/level/transform_inplace.cc (revision 2870)
+++ tests/level/transform_inplace.cc (working copy)
@@ -29,8 +29,19 @@
///
/// Tests on mln::level::transform_inplace
+
+#include <mln/core/image/image1d.hh>
#include <mln/core/image/image2d.hh>
+#include <mln/core/image/image3d.hh>
+#include <mln/core/image/flat_image.hh>
+#include <mln/core/image/image_if.hh>
+#include <mln/core/image/sub_image.hh>
+#include <mln/core/image/extension_val.hh>
+
+
#include <mln/core/routine/clone.hh>
+
+
#include <mln/fun/v2v/inc.hh>
#include <mln/fun/v2v/dec.hh>
#include <mln/debug/iota.hh>
@@ -38,6 +49,7 @@
#include <mln/level/transform_inplace.hh>
#include <mln/level/compare.hh>
+#include <mln/fun/p2b/chess.hh>
int main()
@@ -45,6 +57,9 @@
using namespace mln;
const unsigned size = 50;
+
+ // image 2d tests
+ {
image2d<int> ref(size, size);
debug::iota(ref);
@@ -54,3 +69,94 @@
mln_assertion(ima == ref);
}
+
+ /// image 1d test
+ {
+ image1d<unsigned short> ref(size);
+ debug::iota(ref);
+
+ image1d<unsigned short> ima = clone(ref);
+ level::transform_inplace(ima, fun::v2v::inc<int>());
+ level::transform_inplace(ima, fun::v2v::dec<int>());
+
+ mln_assertion(ima == ref);
+ }
+
+
+ /// image 3d test
+ {
+ image3d<unsigned short> ref(size, size, size);
+ debug::iota(ref);
+
+ image3d<unsigned short> ima = clone(ref);
+ level::transform_inplace(ima, fun::v2v::inc<int>());
+ level::transform_inplace(ima, fun::v2v::dec<int>());
+
+ mln_assertion(ima == ref);
+ }
+
+ // flat image test
+ {
+ flat_image<short, box2d> ref(5, make::box2d(size, size));
+
+ flat_image<short, box2d> ima(5, make::box2d(size, size));
+ level::transform_inplace(ima, fun::v2v::inc<int>());
+ level::transform_inplace(ima, fun::v2v::dec<int>());
+
+ mln_assertion(ima == ref);
+ }
+
+ // image if test
+ {
+ typedef image2d<unsigned short> I;
+ typedef image_if<I, fun::p2b::chess> II;
+
+ I ref(size, size);
+ debug::iota(ref);
+ II ref_if = ref | fun::p2b::chess();
+
+ I ima = clone(ref);
+ II ima_if = ima | fun::p2b::chess();
+
+ level::transform_inplace(ima_if, fun::v2v::inc<int>());
+ level::transform_inplace(ima_if, fun::v2v::dec<int>());
+
+ mln_assertion(ima_if == ref_if);
+ }
+
+ // sub_image test
+ {
+ typedef image2d<int> I;
+ typedef sub_image< image2d<int>, box2d > II;
+ typedef image2d<unsigned short> III;
+
+ I ref(size, size);
+ debug::iota(ref);
+ II sub_ref(ref, make::box2d(4,4, 10,10));
+
+ I ima = clone(ref);
+ II sub_ima(ima, make::box2d(4,4, 10,10));
+
+ level::transform_inplace(sub_ima, fun::v2v::inc<int>());
+ level::transform_inplace(sub_ima, fun::v2v::dec<int>());
+
+ mln_assertion(sub_ima == sub_ref);
+ }
+
+ // extended image test
+ {
+ typedef image2d<int> I;
+ typedef extension_val< image2d<int> > II;
+
+ I ref(size, size);
+
+ I ima = clone(ref);
+ II extend_ima(ima, 5);
+
+ level::transform_inplace(extend_ima, fun::v2v::inc<int>());
+ level::transform_inplace(extend_ima, fun::v2v::dec<int>());
+
+ mln_assertion(extend_ima == ref);
+
+ }
+}
Index: doc/technical/designs/properties/values.txt
--- doc/technical/designs/properties/values.txt (revision 2870)
+++ doc/technical/designs/properties/values.txt (working copy)
@@ -18,7 +18,8 @@
|
+ -- computed
-=> Definition: This property indicates if the image value are stored in memory.
+=> Definition: This property indicates if the image value. are stored in
+memory.
- direct: Images store all their values in memory, we can take a reference
of the values.
Index: mln/level/transform.spe.hh
--- mln/level/transform.spe.hh (revision 2870)
+++ mln/level/transform.spe.hh (working copy)
@@ -85,6 +85,13 @@
template <typename I, typename F>
mln_ch_value(I, mln_result(F))
transform(const Image<I>& input_, const Function_v2v<F>& f_);
+
+ template <typename I1, typename I2, typename F>
+ mln_ch_value(I1, mln_result(F))
+ transform(const Image<I1>& input1,
+ const Image<I2>& input2,
+ const Function_vv2v<F>& f);
+
}
@@ -262,8 +269,8 @@
template <typename I, typename F>
inline
mln_ch_value(I, mln_result(F))
- transform_dispatch(mln::trait::undef,
- mln::trait::image::quant::any,
+ transform_dispatch(trait::undef,
+ trait::image::quant::any,
const Image<I>& input, const Function_v2v<F>& f)
{
return level::impl::generic::transform(input, f);
@@ -272,8 +279,8 @@
template <typename I, typename F>
inline
mln_ch_value(I, mln_result(F))
- transform_dispatch(mln::trait::image::vw_set::any,
- mln::trait::image::quant::any,
+ transform_dispatch(trait::image::vw_set::any,
+ trait::image::quant::any,
const Image<I>& input, const Function_v2v<F>& f)
{
return level::impl::generic::transform(input, f);
@@ -282,8 +289,8 @@
template <typename I, typename F>
inline
mln_ch_value(I, mln_result(F))
- transform_dispatch(mln::trait::image::vw_set::uni,
- mln::trait::image::quant::any,
+ transform_dispatch(trait::image::vw_set::uni,
+ trait::image::quant::any,
const Image<I>& input, const Function_v2v<F>& f)
{
return level::impl::transform_taken(input, f);
@@ -293,8 +300,8 @@
template <typename I, typename F>
inline
mln_ch_value(I, mln_result(F))
- transform_dispatch(mln::trait::image::vw_set::any,
- mln::trait::image::quant::low,
+ transform_dispatch(trait::image::vw_set::any,
+ trait::image::quant::low,
const Image<I>& input, const Function_v2v<F>& f)
{
return level::impl::transform_lowq(input, f);
@@ -305,8 +312,8 @@
template <typename I, typename F>
inline
mln_ch_value(I, mln_result(F))
- transform_dispatch(mln::trait::image::quant::any,
- mln::trait::image::value_access::direct,
+ transform_dispatch(trait::image::quant::any,
+ trait::image::value_access::direct,
const Image<I>& input, const Function_v2v<F>& f)
{
return level::impl::transform_fast(input, f);
@@ -316,8 +323,8 @@
template <typename I, typename F>
inline
mln_ch_value(I, mln_result(F))
- transform_dispatch(mln::trait::image::quant::low,
- mln::trait::image::value_access::direct,
+ transform_dispatch(trait::image::quant::low,
+ trait::image::value_access::direct,
const Image<I>& input, const Function_v2v<F>& f)
{
return level::impl::transform_fast_lowq(input, f);
@@ -328,8 +335,8 @@
template <typename I, typename F>
inline
mln_ch_value(I, mln_result(F))
- transform_dispatch(mln::trait::image::quant::any,
- mln::trait::image::value_access::any,
+ transform_dispatch(trait::image::quant::any,
+ trait::image::value_access::any,
const Image<I>& input, const Function_v2v<F>& f)
{
return transform_dispatch(mln_trait_image_vw_set(I)(),
@@ -341,7 +348,7 @@
template <typename I, typename F>
inline
mln_ch_value(I, mln_result(F))
- transform_dispatch(mln::trait::image::value_storage::any,
+ transform_dispatch(trait::image::value_storage::any,
const Image<I>& input, const Function_v2v<F>& f)
{
return transform_dispatch(mln_trait_image_vw_set(I)(),
@@ -352,7 +359,7 @@
template <typename I, typename F>
inline
mln_ch_value(I, mln_result(F))
- transform_dispatch(mln::trait::image::value_storage::singleton,
+ transform_dispatch(trait::image::value_storage::singleton,
const Image<I>& input, const Function_v2v<F>& f)
{
return level::impl::transform_singleton(input, f);
@@ -361,7 +368,7 @@
template <typename I, typename F>
inline
mln_ch_value(I, mln_result(F))
- transform_dispatch(mln::trait::image::value_storage::one_block,
+ transform_dispatch(trait::image::value_storage::one_block,
const Image<I>& input_, const Function_v2v<F>& f_)
{
const I& input = exact(input_);
@@ -384,7 +391,9 @@
template <typename I1, typename I2, typename F>
mln_ch_value(I1, mln_result(F))
- transform_dispatch_2(trait::image::speed::any,
+ transform_dispatch_2(trait::image::value_alignement::any,
+ trait::image::value_alignement::any,
+ trait::image::speed::any,
trait::image::speed::any,
const Image<I1>& input1, const Image<I2>& input2,
const Function_vv2v<F>& f)
@@ -394,7 +403,9 @@
template <typename I1, typename I2, typename F>
mln_ch_value(I1, mln_result(F))
- transform_dispatch_2(trait::image::speed::fastest,
+ transform_dispatch_2(trait::image::value_alignement::with_grid,
+ trait::image::value_alignement::with_grid,
+ trait::image::speed::fastest,
trait::image::speed::fastest,
const Image<I1>& input1, const Image<I2>& input2,
const Function_vv2v<F>& f)
@@ -421,7 +432,9 @@
transform_dispatch(const Image<I1>& input1, const Image<I2>& input2,
const Function_vv2v<F>& f)
{
- return transform_dispatch_2(mln_trait_image_speed(I1)(),
+ return transform_dispatch_2(mln_trait_image_value_alignement(I1)(),
+ mln_trait_image_value_alignement(I2)(),
+ mln_trait_image_speed(I1)(),
mln_trait_image_speed(I2)(),
input1, input2, f);
}
Index: mln/level/transform_inplace.hh
--- mln/level/transform_inplace.hh (revision 2870)
+++ mln/level/transform_inplace.hh (working copy)
@@ -36,6 +36,8 @@
# include <mln/core/concept/image.hh>
# include <mln/core/concept/function.hh>
+# include <mln/value/set.hh>
+# include <mln/value/lut_vec.hh>
namespace mln
@@ -184,16 +186,82 @@
} // end of namespace mln::level::impl::generic
+ /// Specialized implementation
template <typename I, typename F>
void
- transform_inplace_fastest(Image<I>& ima_, const Function_v2v<F>& f_)
+ transform_inplace_lowq(Image<I>& input_,
+ const Function_v2v<F>& f_)
{
- trace::entering("level::impl::transform_inplace_fastest");
+ trace::entering("level::impl::transform_inplace_lowq");
mlc_is(mln_trait_image_pw_io(I),
trait::image::pw_io::read_write)::check();
+ I& input = exact(input_);
+ const F& f = exact(f_);
+
+ level::internal::transform_inplace_tests(input, f);
+
+ value::lut_vec<mln_vset(I), mln_result(F)>
+ lut(input.values_eligible(), f);
+
+ mln_piter(I) p(input.domain());
+ for_all(p)
+ input(p) = lut(input(p));
+
+ trace::exiting("level::impl::transform_inplace_lowq");
+ }
+
+ template <typename I, typename F>
+ void
+ transform_inplace_taken(Image<I>& input_,
+ const Function_v2v<F>& f_)
+ {
+ trace::entering("level::impl::transform_inplace_taken");
+
+ mlc_is(mln_trait_image_pw_io(I),
+ trait::image::pw_io::read_write)::check();
+
+ I& input = exact(input_);
+ const F& f = exact(f_);
+
+ level::internal::transform_inplace_tests(input, f);
+
+ value::lut_vec<mln_vset(I), mln_result(F)>
+ lut(input.taken_values(), f);
+
+ mln_piter(I) p(input.domain());
+ for_all(p)
+ input(p) = lut(input(p));
+
+ trace::exiting("level::impl::transform_inplace_taken");
+ }
+
+
+ template <typename I, typename F>
+ void
+ transform_inplace_singleton(Image<I>& input_,
+ const Function_v2v<F>& f_)
+ {
+ trace::entering("level::impl::transform_inplace_singleton");
+
+ I& input = exact(input_);
+ const F& f = exact(f_);
+
+ level::internal::transform_inplace_tests(input, f);
+
+ input.val() = f(input.val());
+
+ trace::exiting("level::impl::transform_inplace_singleton");
+ }
+
+ template <typename I, typename F>
+ void
+ transform_inplace_fastest(Image<I>& ima_, const Function_v2v<F>& f_)
+ {
+ trace::entering("level::impl::transform_inplace_fastest");
+
I& ima = exact(ima_);
const F& f = exact(f_);
@@ -207,6 +275,29 @@
}
+ template <typename I, typename F>
+ void
+ transform_inplace_fastest_lowq(Image<I>& input_,
+ const Function_v2v<F>& f_)
+ {
+ trace::entering("level::impl::transform_inplace_fastest_lowq");
+
+ I& input = exact(input_);
+ const F& f = exact(f_);
+
+ level::internal::transform_inplace_tests(input, f);
+
+ value::lut_vec<mln_vset(I), mln_result(F)>
+ lut(input.values_eligible(), f);
+
+ mln_pixter(I) pi(input);
+ for_all(pi)
+ pi.val() = lut(pi.val());
+
+ trace::exiting("level::impl::transform_inplace_fastest_lowq");
+ }
+
+
template <typename I1, typename I2, typename F>
void
transform_inplace_fastest(Image<I1>& ima_, const Image<I2>& aux_,
@@ -243,9 +334,11 @@
// (ima, f) version.
+ /// Dispatch on quantization
template <typename I, typename F>
void
- transform_inplace_dispatch(trait::image::speed::any,
+ transform_inplace_dispatch(trait::image::vw_set::any,
+ trait::image::quant::any,
Image<I>& ima, const Function_v2v<F>& f)
{
level::impl::generic::transform_inplace(ima, f);
@@ -253,7 +346,28 @@
template <typename I, typename F>
void
- transform_inplace_dispatch(trait::image::speed::fastest,
+ transform_inplace_dispatch(trait::image::vw_set::uni,
+ trait::image::quant::any,
+ Image<I>& ima, const Function_v2v<F>& f)
+ {
+ level::impl::transform_inplace_taken(ima, f);
+ }
+
+ template <typename I, typename F>
+ void
+ transform_inplace_dispatch(trait::image::vw_set::any,
+ trait::image::quant::low,
+ Image<I>& ima, const Function_v2v<F>& f)
+ {
+ level::impl::transform_inplace_lowq(ima, f);
+ }
+
+
+
+ /// Dispatch for fast image
+ template <typename I, typename F>
+ void
+ transform_inplace_dispatch_fast(trait::image::quant::any,
Image<I>& ima, const Function_v2v<F>& f)
{
level::impl::transform_inplace_fastest(ima, f);
@@ -261,37 +375,96 @@
template <typename I, typename F>
void
+ transform_inplace_dispatch_fast(trait::image::quant::low,
+ Image<I>& ima, const Function_v2v<F>& f)
+ {
+ level::impl::transform_inplace_fastest_lowq(ima, f);
+ }
+
+
+
+
+ /// Dispatch on value storage
+ template <typename I, typename F>
+ void
+ transform_inplace_dispatch(trait::image::value_storage::any,
+ trait::image::value_access::any,
+ Image<I>& ima, const Function_v2v<F>& f)
+ {
+ transform_inplace_dispatch(mln_trait_image_vw_set(I)(),
+ mln_trait_image_quant(I)(),
+ ima, f);
+ }
+
+ template <typename I, typename F>
+ void
+ transform_inplace_dispatch(trait::image::value_storage::singleton,
+ trait::image::value_access::any,
+ Image<I>& ima, const Function_v2v<F>& f)
+ {
+ level::impl::transform_inplace_singleton(ima, f);
+ }
+
+
+ template <typename I, typename F>
+ void
+ transform_inplace_dispatch(trait::image::value_storage::one_block,
+ trait::image::value_access::direct,
+ Image<I>& ima, const Function_v2v<F>& f)
+ {
+ transform_inplace_dispatch_fast(mln_trait_image_quant(I)(),
+ ima, f);
+ }
+
+
+
+
+ /// First dispatch
+ 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)(),
+ transform_inplace_dispatch(mln_trait_image_value_storage(I)(),
+ mln_trait_image_value_access(I)(),
ima, f);
}
+
+
// (ima, aux, f) version.
template <typename I1, typename I2, typename F>
void
- transform_inplace_dispatch(trait::image::speed::any,
+ transform_inplace_dispatch(trait::image::value_alignement::any,
+ trait::image::value_alignement::any,
+ trait::image::speed::any,
trait::image::speed::any,
- Image<I1>& ima, const Image<I2>& aux, const Function_vv2v<F>& f)
+ 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,
+ transform_inplace_dispatch(trait::image::value_alignement::with_grid,
+ trait::image::value_alignement::with_grid,
trait::image::speed::fastest,
- Image<I1>& ima, const Image<I2>& aux, const Function_vv2v<F>& f)
+ 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(Image<I1>& ima, const Image<I2>& aux,
+ const Function_vv2v<F>& f)
{
- transform_inplace_dispatch(mln_trait_image_speed(I1)(),
+ transform_inplace_dispatch(mln_trait_image_value_alignement(I1)(),
+ mln_trait_image_value_alignement(I2)(),
+ mln_trait_image_speed(I1)(),
mln_trait_image_speed(I2)(),
ima, aux, f);
}
1
0
https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Add set compute with an accumulator.
* tests/set/compute.cc: New.
* tests/set/Makefile.am: Update.
* tests/set/diff.cc: Upgrade doc style.
Fix clumsy include.
* mln/set/compute.hh: New.
* mln/set/all.hh: Update.
mln/set/all.hh | 11 +++-
mln/set/compute.hh | 112 ++++++++++++++++++++++++++++++++++++++++++++++++++
tests/set/Makefile.am | 2
tests/set/compute.cc | 44 +++++++++++++++++++
tests/set/diff.cc | 10 ++--
5 files changed, 170 insertions(+), 9 deletions(-)
Index: tests/set/compute.cc
--- tests/set/compute.cc (revision 0)
+++ tests/set/compute.cc (revision 0)
@@ -0,0 +1,44 @@
+// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License. This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+/// \file tests/set/compute.cc
+///
+/// Tests on mln::set::compute.
+
+#include <mln/core/site_set/p_set.hh>
+#include <mln/core/alias/point2d.hh>
+#include <mln/accu/count.hh>
+#include <mln/set/compute.hh>
+
+
+int main()
+{
+ using namespace mln;
+
+ p_set<point2d> s;
+ mln_assertion(set::compute(accu::meta::count(), s) == 0);
+}
Index: tests/set/Makefile.am
--- tests/set/Makefile.am (revision 2869)
+++ tests/set/Makefile.am (working copy)
@@ -3,12 +3,14 @@
include $(top_srcdir)/milena/tests/tests.mk
check_PROGRAMS = \
+ compute \
diff \
inter \
is_subset_of \
sym_diff \
uni
+compute_SOURCES = compute.cc
diff_SOURCES = diff.cc
inter_SOURCES = inter.cc
is_subset_of_SOURCES = is_subset_of.cc
Index: tests/set/diff.cc
--- tests/set/diff.cc (revision 2869)
+++ tests/set/diff.cc (working copy)
@@ -1,4 +1,5 @@
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -25,13 +26,12 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/set/diff.cc
- *
- * \brief Tests on mln::set::diff.
- */
+/// \file tests/set/diff.cc
+///
+/// Tests on mln::set::diff.
#include <mln/core/site_set/p_set.hh>
-#include <mln/core/alias/dpoint2d.hh>
+#include <mln/core/alias/point2d.hh>
#include <mln/set/diff.hh>
Index: mln/set/all.hh
--- mln/set/all.hh (revision 2869)
+++ mln/set/all.hh (working copy)
@@ -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_SET_ALL_HH
# define MLN_SET_ALL_HH
-/*! \file mln/set/all.hh
- *
- * \brief File that includes all set-related routines.
- */
+/// \file mln/set/all.hh
+///
+/// File that includes all set-related routines.
namespace mln
@@ -42,6 +42,8 @@
}
+
+# include <mln/set/compute.hh>
# include <mln/set/diff.hh>
# include <mln/set/inter.hh>
# include <mln/set/get.hh>
@@ -50,4 +52,5 @@
# include <mln/set/sym_diff.hh>
# include <mln/set/uni.hh>
+
#endif // ! MLN_SET_ALL_HH
Index: mln/set/compute.hh
--- mln/set/compute.hh (revision 0)
+++ mln/set/compute.hh (revision 0)
@@ -0,0 +1,112 @@
+// 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_SET_COMPUTE_HH
+# define MLN_SET_COMPUTE_HH
+
+/// \file mln/set/compute.hh
+///
+/// Compute an accumulator on a site set.
+
+# include <mln/core/concept/meta_accumulator.hh>
+# include <mln/core/concept/site_set.hh>
+
+
+namespace mln
+{
+
+ namespace set
+ {
+
+ /*! Compute an accumulator onto the sites of a site set.
+ *
+ * \param[in] a An accumulator.
+ * \param[in] s A site set.
+ * \return The accumulator result.
+ */
+ template <typename A, typename S>
+ mln_result(A)
+ compute(const Accumulator<A>& a, const Site_Set<S>& s);
+
+
+ /*! Compute an accumulator onto the sites of a site set.
+ *
+ * \param[in] a A meta-accumulator.
+ * \param[in] s A site set.
+ * \return The accumulator result.
+ */
+ template <typename A, typename S>
+ mln_accu_with(A, mln_site(S))::result
+ compute(const Meta_Accumulator<A>& a, const Site_Set<S>& s);
+
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ template <typename A, typename S>
+ inline
+ mln_result(A)
+ compute(const Accumulator<A>& a_, const Site_Set<S>& s_)
+ {
+ trace::entering("set::compute");
+
+ A a = exact(a_);
+ const S& s = exact(s_);
+
+ mln_piter(S) p(s);
+ for_all(p)
+ a.take(p);
+
+ trace::exiting("set::compute");
+ return a.to_result();
+ }
+
+ template <typename A, typename S>
+ mln_accu_with(A, mln_site(S))::result
+ compute(const Meta_Accumulator<A>& a_, const Site_Set<S>& s_)
+ {
+ trace::entering("set::compute");
+
+ mln_accu_with(A, mln_site(S)) a = accu::unmeta(exact(a_), mln_site(S)());
+ const S& s = exact(s_);
+
+ mln_piter(S) p(s);
+ for_all(p)
+ a.take(p);
+
+ trace::exiting("set::compute");
+ return a.to_result();
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::set
+
+} // end of namespace mln
+
+
+#endif // ! MLN_SET_COMPUTE_HH
1
0
Re: [Olena-patches] [Olena] #43: Fix the initialization of all global constants.
by Olena 13 Nov '08
by Olena 13 Nov '08
13 Nov '08
#43: Fix the initialization of all global constants.
------------------------+---------------------------------------------------
Reporter: garrigues | Owner: Olena Team
Type: defect | Status: closed
Priority: major | Milestone: Olena 1.0
Component: Milena | Version: 1.0
Resolution: fixed | Keywords:
------------------------+---------------------------------------------------
Comment (by lazzara):
Fixed in branches/cleanup-2008 with revision #2818 and #2865.
The associated test is named "global_vars" and is available in
milena/tests.
--
Ticket URL: <https://trac.lrde.org/olena/ticket/43#comment:4>
Olena <http://olena.lrde.epita.fr>
Olena, a generic and efficient C++ image processing library.
1
0
https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Update unary logical not.
* mln/fun/v2b/lnot.hh: New.
* mln/fun/v2b/all.hh: Update.
* mln/logical/not.hh: Rely on level transform.
fun/v2b/all.hh | 19 ++++++--------
fun/v2b/lnot.hh | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
logical/not.hh | 70 +++++++++++-----------------------------------------
3 files changed, 99 insertions(+), 65 deletions(-)
Index: mln/fun/v2b/all.hh
--- mln/fun/v2b/all.hh (revision 2868)
+++ mln/fun/v2b/all.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,10 +28,9 @@
#ifndef MLN_FUN_V2B_ALL_HH
# define MLN_FUN_V2B_ALL_HH
-/*! \file mln/fun/v2b/all.hh
- *
- * \brief File that includes all functions from point to value.
- */
+/// \file mln/fun/v2b/all.hh
+///
+/// File that includes all functions from value to logic value.
namespace mln
@@ -40,15 +39,15 @@
namespace fun
{
- /// Namespace of functions from point to value.
- namespace v2b
- {
- }
- }
+ /// Namespace of functions from value to logic value.
+ namespace v2b {}
}
+}
+# include <mln/fun/v2b/lnot.hh>
# include <mln/fun/v2b/threshold.hh>
+
#endif // ! MLN_FUN_V2B_ALL_HH
Index: mln/fun/v2b/lnot.hh
--- mln/fun/v2b/lnot.hh (revision 0)
+++ mln/fun/v2b/lnot.hh (revision 0)
@@ -0,0 +1,75 @@
+// 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_V2B_LNOT_HH
+# define MLN_FUN_V2B_LNOT_HH
+
+/// \file mln/fun/v2b/lnot.hh
+///
+/// Functor that computes "logical not" on a value.
+
+# include <mln/core/concept/function.hh>
+
+
+namespace mln
+{
+
+ namespace fun
+ {
+
+ namespace v2b
+ {
+
+ /// Functor computing logical-not on a value.
+ template <typename V>
+ struct lnot : public Function_v2b< lnot<V> >
+ {
+ typedef V result;
+ V operator()(const V& v) const;
+ };
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ template <typename V>
+ inline
+ V
+ lnot<V>::operator()(const V& v) const
+ {
+ return ! v;
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::fun::v2b
+
+ } // end of namespace mln::fun
+
+} // end of namespace mln
+
+
+#endif // ! MLN_FUN_V2B_LNOT_HH
Index: mln/logical/not.hh
--- mln/logical/not.hh (revision 2868)
+++ mln/logical/not.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,12 @@
#ifndef MLN_LOGICAL_NOT_HH
# define MLN_LOGICAL_NOT_HH
-/*! \file mln/logical/not.hh
- *
- * \brief Point-wise "logical not" of a binary image.
- *
- * \todo Add static assertion and save one iterator in in-place version.
- */
-
-# include <mln/core/concept/image.hh>
+/// \file mln/logical/not.hh
+///
+/// Point-wise "logical not" of a binary image.
-
-// Specializations are in:
-# include <mln/logical/not.spe.hh>
+# include <mln/logical/includes.hh>
+# include <mln/fun/v2b/lnot.hh>
namespace mln
@@ -73,58 +68,21 @@
void not_inplace(Image<I>& input);
-# ifndef MLN_INCLUDE_ONLY
-
- namespace impl
- {
-
- namespace generic
- {
- template <typename I, typename O>
- inline
- void not_(const I& input, O& output)
- {
- trace::entering("logical::impl::generic::not_");
-
- mln_piter(I) p(input.domain());
- for_all(p)
- output(p) = ! input(p);
- trace::exiting("logical::impl::generic::not_");
- }
-
- template <typename I>
- inline
- void not_inplace(I& inout)
- {
- trace::entering("logical::impl::generic::not_");
-
- mln_piter(I) p(inout.domain());
- for_all(p)
- inout(p) = ! inout(p);
-
- trace::exiting("logical::impl::generic::not_");
- }
- }
-
- } // end of namespace mln::logical::impl
-
-
- // Facades.
+# ifndef MLN_INCLUDE_ONLY
template <typename I>
inline
mln_concrete(I) not_(const Image<I>& input)
{
- trace::entering("logical::not");
+ trace::entering("logical::not_");
mln_precondition(exact(input).has_data());
- mln_concrete(I) output;
- initialize(output, input);
- impl::not_(mln_trait_image_speed(I)(), exact(input), output);
+ fun::v2b::lnot<mln_value(I)> f;
+ mln_concrete(I) output = level::transform(input, f);
- trace::exiting("logical::not");
+ trace::exiting("logical::not_");
return output;
}
@@ -135,7 +93,9 @@
trace::entering("logical::not_inplace");
mln_precondition(exact(input).has_data());
- impl::not_inplace(mln_trait_image_speed(I)(), exact(input));
+
+ fun::v2b::lnot<mln_value(I)> f;
+ level::transform_inplace(input, f);
trace::exiting("logical::not_inplace");
}
1
0
https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Update logical binary routines.
* mln/trait/op/all.hh (include): Remove duplicate.
* mln/fun/vv2v/lxor.hh: New.
* mln/fun/vv2v/lor.hh: New.
* mln/fun/vv2v/land_not.hh: New.
* mln/fun/vv2v/all.hh: Update.
* mln/logical/or.hh,
* mln/logical/and_not.hh,
* mln/logical/and.hh: Rely on level transform.
* mln/logical/or.spe.hh,
* mln/logical/and_not.spe.hh: Remove; obsolete.
* mln/logical/xor.hh: New.
* mln/logical/all.hh: Update.
* tests/logical/xor.cc: New.
* tests/logical/Makefile.am: Update.
mln/fun/vv2v/all.hh | 3 +
mln/fun/vv2v/land_not.hh | 23 ++++++-----
mln/fun/vv2v/lor.hh | 24 ++++++------
mln/fun/vv2v/lxor.hh | 26 +++++++------
mln/logical/all.hh | 1
mln/logical/and.hh | 2 -
mln/logical/and_not.hh | 70 +++++++++++------------------------
mln/logical/or.hh | 68 ++++++++++------------------------
mln/logical/xor.hh | 92 ++++++++++++++++------------------------------
mln/trait/op/all.hh | 1
tests/logical/Makefile.am | 4 +-
tests/logical/xor.cc | 24 ++++++------
12 files changed, 133 insertions(+), 205 deletions(-)
Index: tests/logical/Makefile.am
--- tests/logical/Makefile.am (revision 2867)
+++ tests/logical/Makefile.am (working copy)
@@ -7,12 +7,14 @@
and \
and_not \
not \
- or
+ or \
+ xor
all_headers_SOURCES = all_headers.cc
and_SOURCES = and.cc
and_not_SOURCES = and_not.cc
not_SOURCES = not.cc
or_SOURCES = or.cc
+xor_SOURCES = xor.cc
TESTS = $(check_PROGRAMS)
Index: tests/logical/xor.cc
--- tests/logical/xor.cc (revision 2864)
+++ tests/logical/xor.cc (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
@@ -25,13 +26,12 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/logical/or.cc
- *
- * \brief Tests on mln::logical::or.
- */
+/// \file tests/logical/xor.cc
+///
+/// Tests on mln::logical::xor.
#include <mln/core/image/image2d.hh>
-#include <mln/logical/or.hh>
+#include <mln/logical/xor.hh>
#include <mln/level/compare.hh>
@@ -52,14 +52,14 @@
};
bool ws[3][3] = {
- {1, 1, 1},
{0, 1, 0},
- {1, 1, 1}
+ {0, 0, 0},
+ {0, 1, 0}
};
- image2d<bool> ima1 (make::image(vs));
- image2d<bool> ima2 (make::image(us));
- image2d<bool> ref (make::image(ws));
+ image2d<bool> ima1 = make::image(vs);
+ image2d<bool> ima2 = make::image(us);
+ image2d<bool> ref = make::image(ws);
- mln_assertion (logical::or_(ima1, ima2) == ref);
+ mln_assertion (logical::xor_(ima1, ima2) == ref);
}
Property changes on: tests/logical/xor.cc
___________________________________________________________________
Added: svn:mergeinfo
Index: mln/trait/op/all.hh
--- mln/trait/op/all.hh (revision 2867)
+++ mln/trait/op/all.hh (working copy)
@@ -66,7 +66,6 @@
# include <mln/trait/op/less.hh>
# include <mln/trait/op/leq.hh>
-# include <mln/trait/op/lor.hh>
# include <mln/trait/op/geq.hh>
# include <mln/trait/op/greater.hh>
Index: mln/fun/vv2v/lxor.hh
--- mln/fun/vv2v/lxor.hh (revision 2864)
+++ mln/fun/vv2v/lxor.hh (working copy)
@@ -25,15 +25,15 @@
// 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
+#ifndef MLN_FUN_VV2V_LXOR_HH
+# define MLN_FUN_VV2V_LXOR_HH
-/// \file mln/fun/vv2v/land.hh
+/// \file mln/fun/vv2v/lxor.hh
///
-/// Functor that computes "logical and" between two values.
+/// Functor that computes "logical xor" between two values.
# include <mln/core/concept/function.hh>
-# include <mln/trait/op/and.hh>
+# include <mln/trait/op/xor.hh>
namespace mln
@@ -45,11 +45,11 @@
namespace vv2v
{
- /// Functor computing logical-and between two values.
+ /// Functor computing logical-xor between two values.
template <typename L, typename R = L>
- struct land : public Function_vv2v< land<L,R> >
+ struct lxor : public Function_vv2v< lxor<L,R> >
{
- typedef mln_trait_op_and(L, R) result;
+ typedef mln_trait_op_or(L, R) result;
result operator()(const L& v1, const R& v2) const;
};
@@ -58,10 +58,12 @@
template <typename L, typename R>
inline
- typename land<L,R>::result
- land<L,R>::operator()(const L& v1, const R& v2) const
+ typename lxor<L,R>::result
+ lxor<L,R>::operator()(const L& v1, const R& v2) const
{
- return v1 && v2;
+ // v1 xor v2 = (v1 and (not v2)) or ((not v1) and v2)
+ // = (not (v1 and v2)) and (v1 or v2)
+ return (! (v1 && v2)) && (v1 || v2);
}
# endif // ! MLN_INCLUDE_ONLY
@@ -73,4 +75,4 @@
} // end of namespace mln
-#endif // ! MLN_FUN_VV2V_LAND_HH
+#endif // ! MLN_FUN_VV2V_LXOR_HH
Property changes on: mln/fun/vv2v/lxor.hh
___________________________________________________________________
Added: svn:mergeinfo
Index: mln/fun/vv2v/all.hh
--- mln/fun/vv2v/all.hh (revision 2867)
+++ mln/fun/vv2v/all.hh (working copy)
@@ -51,6 +51,9 @@
# include <mln/fun/vv2v/macros.hh>
# include <mln/fun/vv2v/land.hh>
+# include <mln/fun/vv2v/land_not.hh>
+# include <mln/fun/vv2v/lor.hh>
+# include <mln/fun/vv2v/lxor.hh>
# include <mln/fun/vv2v/max.hh>
# include <mln/fun/vv2v/min.hh>
# include <mln/fun/vv2v/vec.hh>
Index: mln/fun/vv2v/lor.hh
--- mln/fun/vv2v/lor.hh (revision 2864)
+++ mln/fun/vv2v/lor.hh (working copy)
@@ -25,15 +25,15 @@
// 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
+#ifndef MLN_FUN_VV2V_LOR_HH
+# define MLN_FUN_VV2V_LOR_HH
-/// \file mln/fun/vv2v/land.hh
+/// \file mln/fun/vv2v/lor.hh
///
-/// Functor that computes "logical and" between two values.
+/// Functor that computes "logical or" between two values.
# include <mln/core/concept/function.hh>
-# include <mln/trait/op/and.hh>
+# include <mln/trait/op/or.hh>
namespace mln
@@ -45,11 +45,11 @@
namespace vv2v
{
- /// Functor computing logical-and between two values.
+ /// Functor computing logical-or between two values.
template <typename L, typename R = L>
- struct land : public Function_vv2v< land<L,R> >
+ struct lor : public Function_vv2v< lor<L,R> >
{
- typedef mln_trait_op_and(L, R) result;
+ typedef mln_trait_op_or(L, R) result;
result operator()(const L& v1, const R& v2) const;
};
@@ -58,10 +58,10 @@
template <typename L, typename R>
inline
- typename land<L,R>::result
- land<L,R>::operator()(const L& v1, const R& v2) const
+ typename lor<L,R>::result
+ lor<L,R>::operator()(const L& v1, const R& v2) const
{
- return v1 && v2;
+ return v1 || v2;
}
# endif // ! MLN_INCLUDE_ONLY
@@ -73,4 +73,4 @@
} // end of namespace mln
-#endif // ! MLN_FUN_VV2V_LAND_HH
+#endif // ! MLN_FUN_VV2V_LOR_HH
Property changes on: mln/fun/vv2v/lor.hh
___________________________________________________________________
Added: svn:mergeinfo
Index: mln/fun/vv2v/land_not.hh
--- mln/fun/vv2v/land_not.hh (revision 2864)
+++ mln/fun/vv2v/land_not.hh (working copy)
@@ -25,15 +25,16 @@
// 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
+#ifndef MLN_FUN_VV2V_LAND_NOT_HH
+# define MLN_FUN_VV2V_LAND_NOT_HH
-/// \file mln/fun/vv2v/land.hh
+/// \file mln/fun/vv2v/land_not.hh
///
-/// Functor that computes "logical and" between two values.
+/// Functor that computes "logical and-not" between two values.
# include <mln/core/concept/function.hh>
# include <mln/trait/op/and.hh>
+# include <mln/trait/op/not.hh>
namespace mln
@@ -45,11 +46,11 @@
namespace vv2v
{
- /// Functor computing logical-and between two values.
+ /// Functor computing logical and-not between two values.
template <typename L, typename R = L>
- struct land : public Function_vv2v< land<L,R> >
+ struct land_not : public Function_vv2v< land_not<L,R> >
{
- typedef mln_trait_op_and(L, R) result;
+ typedef mln_trait_op_and(L, mln_trait_op_not(R)) result;
result operator()(const L& v1, const R& v2) const;
};
@@ -58,10 +59,10 @@
template <typename L, typename R>
inline
- typename land<L,R>::result
- land<L,R>::operator()(const L& v1, const R& v2) const
+ typename land_not<L,R>::result
+ land_not<L,R>::operator()(const L& v1, const R& v2) const
{
- return v1 && v2;
+ return v1 && ! v2;
}
# endif // ! MLN_INCLUDE_ONLY
@@ -73,4 +74,4 @@
} // end of namespace mln
-#endif // ! MLN_FUN_VV2V_LAND_HH
+#endif // ! MLN_FUN_VV2V_LAND_NOT_HH
Property changes on: mln/fun/vv2v/land_not.hh
___________________________________________________________________
Added: svn:mergeinfo
Index: mln/logical/and_not.hh
--- mln/logical/and_not.hh (revision 2867)
+++ mln/logical/and_not.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,12 @@
#ifndef MLN_LOGICAL_AND_NOT_HH
# define MLN_LOGICAL_AND_NOT_HH
-/*! \file mln/logical/and_not.hh
- *
- * \brief Point-wise logical "and not" 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_not.hh
+///
+/// Point-wise "logical and-not" between binary images.
-// Specializations are in:
-# include <mln/logical/and_not.spe.hh>
+# include <mln/logical/includes.hh>
+# include <mln/fun/vv2v/land_not.hh>
namespace mln
@@ -48,7 +43,7 @@
namespace logical
{
- /*! Point-wise logical "and not" between images \p lhs and \p rhs.
+ /*! Point-wise "logical and-not" between images \p lhs and \p rhs.
*
* \param[in] lhs First operand image.
* \param[in] rhs Second operand image.
@@ -57,10 +52,11 @@
* \pre \p lhs.domain == \p rhs.domain
*/
template <typename L, typename R>
- mln_concrete(L) and_not(const Image<L>& lhs, const Image<R>& rhs);
+ mln_ch_fun_vv2v(land_not, L, R)
+ and_not(const Image<L>& lhs, const Image<R>& rhs);
- /*! Point-wise in-place logical "and not" of image \p rhs in image \p lhs.
+ /*! Point-wise in-place "logical and-not" of image \p rhs in image \p lhs.
*
* \param[in,out] lhs First operand image.
* \param[in] rhs Second operand image.
@@ -77,42 +73,17 @@
# ifndef MLN_INCLUDE_ONLY
- namespace impl
- {
-
- namespace generic
- {
- template <typename L, typename R, typename O>
- inline
- void and_not_(const L& lhs, const R& rhs, O& output)
- {
- trace::entering("logical::impl::generic::and_not_");
-
- mln_piter(L) p(lhs.domain());
- for_all(p)
- output(p) = lhs(p) && ! rhs(p);
-
- trace::exiting("logical::impl::generic::and_not_");
- }
- }
-
- } // end of namespace mln::logical::impl
-
-
- // Facades.
-
template <typename L, typename R>
inline
- mln_concrete(L) and_not(const Image<L>& lhs, const Image<R>& rhs)
+ mln_ch_fun_vv2v(land_not, L, R)
+ and_not(const Image<L>& lhs, const Image<R>& rhs)
{
trace::entering("logical::and_not");
- mln_precondition(exact(rhs).domain() == exact(lhs).domain());
+ internal::tests(lhs, rhs);
- mln_concrete(L) output;
- initialize(output, lhs);
- impl::and_not_(mln_trait_image_speed(L)(), exact(lhs),
- mln_trait_image_speed(R)(), exact(rhs), output);
+ mln_fun_vv2v(land_not, L, R) f;
+ mln_ch_fun_vv2v(land_not, L, R) output = level::transform(lhs, rhs, f);
trace::exiting("logical::and_not");
return output;
@@ -124,10 +95,13 @@
{
trace::entering("logical::and_not_inplace");
- mln_precondition(exact(rhs).domain() >= exact(lhs).domain());
+ mlc_converts_to(mln_fun_vv2v_result(land_not, L, R),
+ mln_value(L))::check();
+
+ internal::tests(lhs, rhs);
- impl::and_not_(mln_trait_image_speed(L)(), exact(lhs),
- mln_trait_image_speed(R)(), exact(rhs), exact(lhs));
+ mln_fun_vv2v(land_not, L, R) f;
+ level::transform_inplace(lhs, rhs, f);
trace::exiting("logical::and_not_inplace");
}
Index: mln/logical/and.hh
--- mln/logical/and.hh (revision 2867)
+++ mln/logical/and.hh (working copy)
@@ -32,8 +32,6 @@
/// \file mln/logical/and.hh
///
/// Point-wise "logical and" between binary images.
-///
-/// \todo Add static assertion and save one iterator in in-place version.
# include <mln/logical/includes.hh>
# include <mln/fun/vv2v/land.hh>
Index: mln/logical/all.hh
--- mln/logical/all.hh (revision 2867)
+++ mln/logical/all.hh (working copy)
@@ -55,6 +55,7 @@
# include <mln/logical/and_not.hh>
# include <mln/logical/not.hh>
# include <mln/logical/or.hh>
+# include <mln/logical/xor.hh>
#endif // ! MLN_LOGICAL_ALL_HH
Index: mln/logical/xor.hh
--- mln/logical/xor.hh (revision 2864)
+++ mln/logical/xor.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
@@ -25,21 +26,15 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_LOGICAL_OR_HH
-# define MLN_LOGICAL_OR_HH
-
-/*! \file mln/logical/or.hh
- *
- * \brief Point-wise "logical or" between binary images.
- *
- * \todo Add static assertion and save one iterator in in-place version.
- */
-
-# include <mln/core/concept/image.hh>
+#ifndef MLN_LOGICAL_XOR_HH
+# define MLN_LOGICAL_XOR_HH
+/// \file mln/logical/xor.hh
+///
+/// Point-wise "logical xor" between binary images.
-// Specializations are in:
-# include <mln/logical/or.spe.hh>
+# include <mln/logical/includes.hh>
+# include <mln/fun/vv2v/lxor.hh>
namespace mln
@@ -48,7 +43,7 @@
namespace logical
{
- /*! Point-wise "logical or" between images \p lhs and \p rhs.
+ /*! Point-wise "logical xor" between images \p lhs and \p rhs.
*
* \param[in] lhs First operand image.
* \param[in] rhs Second operand image.
@@ -57,79 +52,58 @@
* \pre \p lhs.domain == \p rhs.domain
*/
template <typename L, typename R>
- mln_concrete(L) or_(const Image<L>& lhs, const Image<R>& rhs);
+ mln_ch_fun_vv2v(lxor, L, R)
+ xor_(const Image<L>& lhs, const Image<R>& rhs);
- /*! Point-wise in-place "logical or" of image \p rhs in image \p lhs.
+ /*! Point-wise in-place "logical xor" of image \p rhs in image \p lhs.
*
* \param[in,out] lhs First operand image.
* \param[in] rhs Second operand image.
*
* It performs: \n
- * for all p of lhs.domain \n
- * lhs(p) = lhs(p) or rhs(p)
+ * for all p of rhs.domain \n
+ * lhs(p) = lhs(p) xor rhs(p)
*
* \pre \p rhs.domain >= \p lhs.domain
*/
template <typename L, typename R>
- void or_inplace(Image<L>& lhs, const Image<R>& rhs);
+ void xor_inplace(Image<L>& lhs, const Image<R>& rhs);
# ifndef MLN_INCLUDE_ONLY
- namespace impl
- {
-
- namespace generic
- {
- template <typename L, typename R, typename O>
- inline
- void or__(const L& lhs, const R& rhs, O& output)
- {
- trace::entering("logical::impl::generic::or__");
-
- mln_piter(L) p(lhs.domain());
- for_all(p)
- output(p) = lhs(p) || rhs(p);
-
- trace::exiting("logical::impl::generic::or__");
- }
- }
-
- } // end of namespace mln::logical::impl
-
-
- // Facades.
-
template <typename L, typename R>
inline
- mln_concrete(L) or_(const Image<L>& lhs, const Image<R>& rhs)
+ mln_ch_fun_vv2v(lxor, L, R)
+ xor_(const Image<L>& lhs, const Image<R>& rhs)
{
- trace::entering("logical::or_");
+ trace::entering("logical::xor_");
- mln_precondition(exact(rhs).domain() == exact(lhs).domain());
+ internal::tests(lhs, rhs);
- mln_concrete(L) output;
- initialize(output, lhs);
- impl::or__(mln_trait_image_speed(L)(), exact(lhs),
- mln_trait_image_speed(R)(), exact(rhs), output);
+ mln_fun_vv2v(lxor, L, R) f;
+ mln_ch_fun_vv2v(lxor, L, R) output = level::transform(lhs, rhs, f);
- trace::exiting("logical::or_");
+ trace::exiting("logical::xor_");
return output;
}
template <typename L, typename R>
inline
- void or_inplace(Image<L>& lhs, const Image<R>& rhs)
+ void xor_inplace(Image<L>& lhs, const Image<R>& rhs)
{
- trace::entering("logical::or_inplace");
+ trace::entering("logical::xor_inplace");
+
+ mlc_converts_to(mln_fun_vv2v_result(lxor, L, R),
+ mln_value(L))::check();
- mln_precondition(exact(rhs).domain() >= exact(lhs).domain());
+ internal::tests(lhs, rhs);
- impl::or__(mln_trait_image_speed(L)(), exact(lhs),
- mln_trait_image_speed(R)(), exact(rhs), exact(lhs));
+ mln_fun_vv2v(lxor, L, R) f;
+ level::transform_inplace(lhs, rhs, f);
- trace::exiting("logical::or_inplace");
+ trace::exiting("logical::xor_inplace");
}
# endif // ! MLN_INCLUDE_ONLY
@@ -139,4 +113,4 @@
} // end of namespace mln
-#endif // ! MLN_LOGICAL_OR_HH
+#endif // ! MLN_LOGICAL_XOR_HH
Property changes on: mln/logical/xor.hh
___________________________________________________________________
Added: svn:mergeinfo
Index: mln/logical/or.hh
--- mln/logical/or.hh (revision 2867)
+++ mln/logical/or.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,12 @@
#ifndef MLN_LOGICAL_OR_HH
# define MLN_LOGICAL_OR_HH
-/*! \file mln/logical/or.hh
- *
- * \brief Point-wise "logical or" between binary images.
- *
- * \todo Add static assertion and save one iterator in in-place version.
- */
-
-# include <mln/core/concept/image.hh>
-
+/// \file mln/logical/or.hh
+///
+/// Point-wise "logical or" between binary images.
-// Specializations are in:
-# include <mln/logical/or.spe.hh>
+# include <mln/logical/includes.hh>
+# include <mln/fun/vv2v/lor.hh>
namespace mln
@@ -57,7 +52,8 @@
* \pre \p lhs.domain == \p rhs.domain
*/
template <typename L, typename R>
- mln_concrete(L) or_(const Image<L>& lhs, const Image<R>& rhs);
+ mln_ch_fun_vv2v(lor, L, R)
+ or_(const Image<L>& lhs, const Image<R>& rhs);
/*! Point-wise in-place "logical or" of image \p rhs in image \p lhs.
@@ -66,7 +62,7 @@
* \param[in] rhs Second operand image.
*
* It performs: \n
- * for all p of lhs.domain \n
+ * for all p of rhs.domain \n
* lhs(p) = lhs(p) or rhs(p)
*
* \pre \p rhs.domain >= \p lhs.domain
@@ -77,42 +73,17 @@
# ifndef MLN_INCLUDE_ONLY
- namespace impl
- {
-
- namespace generic
- {
- template <typename L, typename R, typename O>
- inline
- void or__(const L& lhs, const R& rhs, O& output)
- {
- trace::entering("logical::impl::generic::or__");
-
- mln_piter(L) p(lhs.domain());
- for_all(p)
- output(p) = lhs(p) || rhs(p);
-
- trace::exiting("logical::impl::generic::or__");
- }
- }
-
- } // end of namespace mln::logical::impl
-
-
- // Facades.
-
template <typename L, typename R>
inline
- mln_concrete(L) or_(const Image<L>& lhs, const Image<R>& rhs)
+ mln_ch_fun_vv2v(lor, L, R)
+ or_(const Image<L>& lhs, const Image<R>& rhs)
{
trace::entering("logical::or_");
- mln_precondition(exact(rhs).domain() == exact(lhs).domain());
+ internal::tests(lhs, rhs);
- mln_concrete(L) output;
- initialize(output, lhs);
- impl::or__(mln_trait_image_speed(L)(), exact(lhs),
- mln_trait_image_speed(R)(), exact(rhs), output);
+ mln_fun_vv2v(lor, L, R) f;
+ mln_ch_fun_vv2v(lor, L, R) output = level::transform(lhs, rhs, f);
trace::exiting("logical::or_");
return output;
@@ -124,10 +95,13 @@
{
trace::entering("logical::or_inplace");
- mln_precondition(exact(rhs).domain() >= exact(lhs).domain());
+ mlc_converts_to(mln_fun_vv2v_result(lor, L, R),
+ mln_value(L))::check();
+
+ internal::tests(lhs, rhs);
- impl::or__(mln_trait_image_speed(L)(), exact(lhs),
- mln_trait_image_speed(R)(), exact(rhs), exact(lhs));
+ mln_fun_vv2v(lor, L, R) f;
+ level::transform_inplace(lhs, rhs, f);
trace::exiting("logical::or_inplace");
}
1
0
* scribo/demat.hh: update.
---
milena/sandbox/ChangeLog | 6 +
milena/sandbox/scribo/demat.hh | 379 ++++++++++++++++++++++++++++++++--------
2 files changed, 309 insertions(+), 76 deletions(-)
diff --git a/milena/sandbox/ChangeLog b/milena/sandbox/ChangeLog
index f2fd9a2..1ce3a0d 100644
--- a/milena/sandbox/ChangeLog
+++ b/milena/sandbox/ChangeLog
@@ -1,3 +1,9 @@
+2008-11-12 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Add support for table extraction.
+
+ * scribo/demat.hh: update.
+
2008-11-12 Alexandre Abraham <abraham(a)lrde.epita.fr>
Make topological watershed work.
diff --git a/milena/sandbox/scribo/demat.hh b/milena/sandbox/scribo/demat.hh
index 0867e49..59e8014 100644
--- a/milena/sandbox/scribo/demat.hh
+++ b/milena/sandbox/scribo/demat.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,24 @@
#ifndef DEMAT_HH_
# define DEMAT_HH_
+# define for_all_ncomponents(C, NCOMP) \
+ for (unsigned C = 1; C <= NCOMP; ++C)
+
+# define for_all_components(C, S) \
+ for (unsigned C = 1; C < S.nelements(); ++C)
+
+# define for_all_elements(E, S) \
+ for (unsigned E = 0; E < S.nelements(); ++E)
+
# include <libgen.h>
# include <sstream>
-# include <mln/core/image/image1d.hh>
+# include <mln/essential/1d.hh>
# include <mln/essential/2d.hh>
+# include <mln/morpho/elementary/dilation.hh>
+# include <mln/labeling/background.hh>
+
+# include <mln/transform/influence_zone_geodesic.hh>
#include <tesseract/baseapi.h>
@@ -46,14 +59,33 @@ namespace scribo
using value::int_u16;
using value::rgb8;
+ struct settings_t
+ {
+ settings_t()
+ {
+ bbox_enlarge = 1;
+ ero_line_width = 101;
+ bbox_distance = 25;
+ min_comp_size = 5;
+ }
+
+ unsigned bbox_enlarge;
+ unsigned ero_line_width;
+ unsigned bbox_distance;
+ unsigned min_comp_size;
+ };
+
+ settings_t settings;
char *input_file = 0;
- int dbg_file_id = 0;
- std::string output_file(const char *name, unsigned file_id)
+ /// Returns a formated output file name.
+ std::string output_file(const char *name)
{
+ static int file_id = 1;
+
std::ostringstream os;
os << "./"
- << file_id
+ << file_id++
<< "_"
<< input_file
<< "_"
@@ -61,9 +93,43 @@ namespace scribo
return os.str();
}
+
+ /// Returns the edge central sites of a box
+ ///
+ /// \param[in] b the bbbox
+ /// \param[in] dim the dimension used to compute the site.
+ /*!
+ **
+ ** If dim == 0, returns the left and right central sites.
+ **
+ ** |-------|
+ ** X X
+ ** |-------|
+ **
+ ** If dim == 1, returns the top and bottom central sites.
+ **
+ ** |---X---|
+ ** | |
+ ** |---X---|
+ **
+ */
+ std::pair<point2d, point2d>
+ central_sites(const box2d& b, unsigned dim)
+ {
+ unsigned n = b.pmax()[dim] - b.pmin()[dim];
+
+ point2d p1 = b.center();
+ p1[dim] -= n / 2;
+ point2d p2 = b.center();
+ p2[dim] += n / 2;
+
+ return std::make_pair(p1, p2);
+ }
+
+ /// Draw a list of bboxes and their center in a RGB8 image.
void draw_component_boxes(image2d<rgb8>& output, const util::array<box2d>& boxes)
{
- for (unsigned i = 1; i < boxes.nelements(); ++i)
+ for_all_components(i, boxes)
if (boxes[i].is_valid())
{
output(boxes[i].center()) = literal::red;
@@ -71,18 +137,26 @@ namespace scribo
}
}
+ /// Colorize and save a labeled image.
template <typename V>
void save_lbl_image(const image2d<V>& lbl, unsigned nlabels,
- const char *filename, unsigned file_id)
+ const char *filename)
{
image2d<rgb8> output = debug::colorize<image2d<rgb8>, image2d<V> >(lbl, nlabels);
- io::ppm::save(output, output_file(filename, file_id));
+ io::ppm::save(output, output_file(filename));
}
/// Functions related to Text Recognition.
/// \{
+ /// Passes the text bboxes to Tesseract and store the result an image of
+ /// char.
+ /// \param[in] in image from where the text bboxes are extracted.
+ /// \param[in] lbl labeled image.
+ /// \param[in] tboxes array of text bboxes.
+ ///
+ /// FIXME: For each text bbox, we create a new image. We may like to avoid that.
void
text_recognition(const image2d<bool>& in, const image2d<int_u16>& lbl,
const util::array<box2d>& tboxes)
@@ -94,11 +168,10 @@ namespace scribo
image2d<char> txt(in.domain());
level::fill(txt, ' ');
- for (unsigned i = 1; i < tboxes.nelements(); ++i)
+ for_all_components(i, tboxes)
{
if (tboxes[i].is_valid())
{
- // FIXME: do not create a new image.
image2d<bool> b(tboxes[i], 0);
level::fill(b, false);
level::fill(b, in | (tboxes[i] | (pw::value(lbl) == pw::cst(i))));
@@ -128,30 +201,166 @@ namespace scribo
/// Functions related to the matrix extraction
/// \{
- void draw_hline(image2d<rgb8>& ima,
- const box2d& box,
- const rgb8& v)
+ /// Align table lines bboxes according to a given dimension.
+ /*
+ **
+ ** FIXME: DOC!
+ **
+ ** 0 1 3 4 5 6
+ ** ------------ -------
+ ** 0 |- - - - - | | {0,1} |
+ ** 1 | - - | | {0,1} |
+ ** 2 | | | {1} |
+ ** 3 | | | |
+ ** 4 | | | {2} |
+ ** 5 |- - | | {2} |
+ ** 6 | | | {2} |
+ */
+ util::array<int>
+ align_lines(unsigned nsites,
+ int min_coord,
+ int max_coord,
+ util::array<box2d>& hboxes,
+ unsigned dim)
+ {
+ std::cout << "extracting table lines..." << std::endl;
+ util::array< util::set<unsigned> > lines;
+ lines.resize(nsites);
+
+ // Map components with actual lines.
+ for_all_components(i, hboxes)
+ {
+ int minline = hboxes[i].pmin()[dim] - 5;
+ minline = (minline < min_coord ? min_coord : minline);
+ int maxline = hboxes[i].pmax()[dim] + 5;
+ maxline = (maxline > max_coord ? max_coord : maxline);
+
+ for (int line = minline;
+ line <= maxline; ++line)
+ lines[line].insert(i);
+ }
+
+ // Init box2line
+ util::array<int> box2line;
+ box2line.resize(hboxes.nelements());
+ for_all_elements(i, box2line)
+ box2line[i] = -1;
+
+ // Find the line with the highest element count.
+ unsigned max_nelts = 0;
+ for_all_elements(i, lines)
+ if (max_nelts < lines[i].nelements())
+ max_nelts = lines[i].nelements();
+
+ // Aligning lines
+ util::array<int> newlines;
+ while (max_nelts > 0)
+ {
+ for_all_elements(i, lines)
+ if (lines[i].nelements() == max_nelts)
+ {
+ accu::mean<int_u16> mean;
+ for_all_elements(j, lines[i])
+ if (box2line[lines[i][j]] == -1)
+ mean.take(hboxes[lines[i][j]].center()[dim]);
+
+ if (mean.is_valid())
+ {
+ for_all_elements(j, lines[i])
+ if (box2line[lines[i][j]] == -1)
+ {
+ hboxes[lines[i][j]].pmin()[dim] = mean.to_result();
+ hboxes[lines[i][j]].pmax()[dim] = mean.to_result();
+ box2line[lines[i][j]] = mean.to_result();
+ }
+ newlines.append(mean.to_result());
+ }
+ }
+ --max_nelts;
+ }
+
+ return newlines;
+ }
+
+ image2d<bool>
+ rebuild_table(const image2d<bool>& in,
+ std::pair<util::array<box2d>,
+ util::array<box2d> >& tblboxes)
{
- unsigned ncols = box.pmax().col() - box.pmin().col();
- point2d p1 = box.center();
- p1.col() -= ncols / 2;
- point2d p2 = box.center();
- p2.col() += ncols / 2;
+ util::array<int> rows = align_lines(in.nrows(), geom::min_row(in),
+ geom::max_row(in), tblboxes.second,
+ 0);
+ util::array<int> cols = align_lines(in.ncols(), geom::min_col(in),
+ geom::max_col(in), tblboxes.first,
+ 1);
+
+ image1d<int> v(in.nrows());
+ image1d<int> h(in.ncols());
+ level::fill(v, -1);
+ level::fill(h, -1);
+
+ for_all_elements(i, rows)
+ v.at(rows[i]) = i;
+ for_all_elements(i, cols)
+ h.at(cols[i]) = i;
+
+ for (int i = 0; i < 10; ++i)
+ {
+ v = morpho::elementary::dilation(v, c2());
+ h = morpho::elementary::dilation(h, c2());
+ }
+
+ util::array<box2d>& vb = tblboxes.first;
+ for_all_components(i, vb)
+ {
+ std::pair<point2d, point2d> cp = central_sites(vb[i], 0);
+ if (v.at(cp.first.row()) != -1)
+ vb[i].pmin().row() = rows[v.at(cp.first.row())];
+ if (v.at(cp.second.row()) != -1)
+ vb[i].pmax().row() = rows[v.at(cp.second.row())];
+
+ cp = central_sites(vb[i], 0);
+ }
- draw::line(ima, p1, p2, v);
+ util::array<box2d>& hb = tblboxes.second;
+ for_all_components(i, hb)
+ {
+ std::pair<point2d, point2d> cp = central_sites(hb[i], 1);
+ if (h.at(cp.first.col()) != -1)
+ hb[i].pmin().col() = cols[h.at(cp.first.col())];
+ if (h.at(cp.second.col()) != -1)
+ hb[i].pmax().col() = cols[h.at(cp.second.col())];
+ }
+
+ image2d<bool> res;
+ initialize(res, in);
+ level::fill(res, false);
+ for_all_components(i, tblboxes.first)
+ draw::box(res, tblboxes.first[i], true);
+ for_all_components(i, tblboxes.second)
+ draw::box(res, tblboxes.second[i], true);
+
+# ifndef NOUT
+ image2d<rgb8> out(in.domain());
+ level::fill(out, literal::black);
+ for_all_components(i, tblboxes.first)
+ draw::box(out, tblboxes.first[i], literal::red);
+ for_all_components(i, tblboxes.second)
+ draw::box(out, tblboxes.second[i], literal::red);
+ io::ppm::save(out, output_file("table.ppm"));
+# endif
+ return res;
}
- void draw_vline(image2d<rgb8>& ima,
- const box2d& box,
- const rgb8& v)
+
+ void draw_line(image2d<rgb8>& ima,
+ unsigned dim,
+ const box2d& box,
+ const rgb8& v)
{
- unsigned nrows = box.pmax().row() - box.pmin().row();
- point2d p1 = box.center();
- p1.row() -= nrows / 2;
- point2d p2 = box.center();
- p2.row() += nrows / 2;
+ std::pair<point2d, point2d> cp = central_sites(box, dim);
- draw::line(ima, p1, p2, v);
+ draw::line(ima, cp.first, cp.second, v);
}
void draw_row(image2d<rgb8>& ima,
@@ -184,14 +393,14 @@ namespace scribo
level::fill(vend, 0);
level::fill(vcol, 0);
- for (unsigned i = 1; i < tboxes.first.nelements(); ++i)
+ for_all_components(i, tboxes.first)
{
++vend.at(tboxes.first[i].pmin().row());
++vend.at(tboxes.first[i].pmax().row());
++vcol.at(tboxes.first[i].center().col());
}
- for (unsigned i = 1; i < tboxes.second.nelements(); ++i)
+ for_all_components(i, tboxes.second)
{
++hend.at(tboxes.second[i].pmin().col());
++hend.at(tboxes.second[i].pmax().col());
@@ -218,13 +427,13 @@ namespace scribo
draw_row(tmp, i, literal::magenta);
}
- for (unsigned i = 1; i < tboxes.first.nelements(); ++i)
- draw_vline(tmp, tboxes.first[i], literal::green);
+ for_all_components(i, tboxes.first)
+ draw_line(tmp, 0, tboxes.first[i], literal::green);
- for (unsigned i = 1; i < tboxes.second.nelements(); ++i)
- draw_hline(tmp, tboxes.second[i], literal::red);
+ for_all_components(i, tboxes.second)
+ draw_line(tmp, 1, tboxes.second[i], literal::red);
- io::ppm::save(tmp, output_file("matrix.ppm", 4));
+ io::ppm::save(tmp, output_file("matrix.ppm"));
#endif
}
@@ -253,9 +462,9 @@ namespace scribo
util::array<box2d>& boxes,
unsigned bbox_enlarge, unsigned dim)
{
- for (unsigned i = 1; i < boxes.nelements(); ++i)
+ for_all_components(i, boxes)
{
- boxes[i].enlarge(dim, bbox_enlarge + 1);
+ boxes[i].enlarge(dim, bbox_enlarge + settings.bbox_enlarge);
boxes[i].crop_wrt(output.domain());
level::paste((pw::cst(false) | boxes[i] |
(pw::value(output) == pw::cst(true))), output);
@@ -267,8 +476,7 @@ namespace scribo
std::pair<util::array<box2d>,
util::array<box2d> >
extract_tables(image2d<bool>& in,
- image2d<rgb8>& output,
- unsigned l)
+ image2d<rgb8>& output)
{
typedef image2d<int_u16> I;
typedef accu::bbox<mln_psite_(I)> A;
@@ -277,35 +485,34 @@ namespace scribo
// Lignes verticales
std::cout << "Removing vertical lines" << std::endl;
- win::vline2d vline(l);
+ win::vline2d vline(settings.ero_line_width);
image2d<bool> vfilter = morpho::erosion(in, vline);
#ifndef NOUT
- io::pbm::save(vfilter, output_file("table-vfilter.pbm", 1));
+ io::pbm::save(vfilter, output_file("vertical-erosion.pbm"));
#endif
boxes_t vboxes = component_boxes(vfilter);
- erase_table_boxes(in, vboxes, (l / 2), 0);
-
+ erase_table_boxes(in, vboxes, (settings.ero_line_width / 2), 0);
// Lignes horizontales
std::cout << "Removing horizontal lines" << std::endl;
- win::hline2d hline(l);
+ win::hline2d hline(settings.ero_line_width);
image2d<bool> hfilter = morpho::erosion(in, hline);
#ifndef NOUT
- io::pbm::save(hfilter, output_file("table-hfilter.pbm", 2));
+ io::pbm::save(hfilter, output_file("horizontal-erosion.pbm"));
#endif
boxes_t hboxes = component_boxes(hfilter);
- erase_table_boxes(in, hboxes, (l / 2), 1);
+ erase_table_boxes(in, hboxes, (settings.ero_line_width / 2), 1);
#ifndef NOUT
image2d<rgb8> tmp = clone(output);
draw_component_boxes(tmp, vboxes);
draw_component_boxes(tmp, hboxes);
- io::ppm::save(tmp, output_file("table-filtered.ppm", 3));
+ io::ppm::save(tmp, output_file("vertical-and-horizontal-erosion.ppm"));
#endif
return std::make_pair(vboxes, hboxes);
@@ -339,11 +546,10 @@ namespace scribo
template <typename V>
void
remove_small_comps_i2v(image2d<V>& lbl,
- V& nlabels,
- unsigned min_comp_size)
+ V& nlabels)
{
std::cout << "Removing small components smaller than "
- << min_comp_size << " sites among " << nlabels
+ << settings.min_comp_size << " sites among " << nlabels
<< " components" << std::endl;
typedef accu::count<mln_psite(image2d<V>)> accu_count_t;
@@ -356,9 +562,9 @@ namespace scribo
fun::i2v::array<V> f(nsitecomp.nelements());
f(0) = 0;
- for (unsigned i = 1; i <= nlabels; ++i)
+ for_all_ncomponents(i, nlabels)
{
- if (nsitecomp[i] < min_comp_size)
+ if (nsitecomp[i] < settings.min_comp_size)
f(i) = 0;
else
f(i) = ++ncomp;
@@ -368,7 +574,7 @@ namespace scribo
nlabels = ncomp;
#ifndef NOUT
- save_lbl_image(lbl, nlabels, "lbl-small-comps-removed.pgm", 6);
+ save_lbl_image(lbl, nlabels, "lbl-small-comps-removed.pgm");
#endif
}
@@ -381,18 +587,18 @@ namespace scribo
// Currify left_link lookup table and compute text area bboxes.
util::array< accu::bbox<point2d> > tboxes;
tboxes.resize(ncomp + 1);
- for (unsigned i = 1; i <= ncomp; ++i)
+ for_all_ncomponents(i, ncomp)
tboxes[uncurri_left_link(left_link, i)].take(cboxes[i]);
//Update labels
lbl = level::transform(lbl, left_link);
#ifndef NOUT
- save_lbl_image(lbl, ncomp, "lbl-grouped-boxes.pgm", 7);
+ save_lbl_image(lbl, ncomp, "lbl-grouped-boxes.pgm");
#endif
util::array<box2d> result;
- for (unsigned i = 1; i <= ncomp; ++i)
+ for_all_ncomponents(i, ncomp)
if (tboxes[i].is_valid())
result.append(tboxes[i].to_result());
@@ -412,7 +618,7 @@ namespace scribo
if (left_link(lbl(p)) == lbl(p) && most_left(left_link, i) != lbl(p))
left_link(lbl(p)) = i;
// else
-// left_link(lbl(p)) = 0;//FIXME: should be uncommented?
+// left_link(lbl(p)) = 0;//FIXME: should be uncommented? VERY bad results otherwise.
}
}
@@ -423,8 +629,7 @@ namespace scribo
fun::i2v::array<int_u16>
link_character_bboxes(image2d<int_u16>& lbl,
const util::array<box2d>& cboxes,
- unsigned ncomp,
- unsigned bbox_distance)
+ unsigned ncomp)
{
fun::i2v::array<int_u16> left_link;
left_link.resize(ncomp + 1);
@@ -432,10 +637,10 @@ namespace scribo
for (unsigned i = 0; i <= ncomp; ++i)
left_link(i) = i;
- for (unsigned i = 1; i <= ncomp; ++i)
+ for_all_ncomponents(i, ncomp)
{
unsigned midcol = (cboxes[i].pmax().col() - cboxes[i].pmin().col()) / 2;
- int dmax = midcol + bbox_distance;
+ int dmax = midcol + settings.bbox_distance;
point2d c = cboxes[i].center();
/// First site on the right of the central site
point2d p(c.row(), c.col() + 1);
@@ -454,11 +659,8 @@ namespace scribo
util::array<box2d>
extract_text(image2d<bool>& in,
image2d<int_u16>& lbl,
- image2d<rgb8>& output,
- unsigned bbox_distance,
- unsigned min_comp_size)
+ image2d<rgb8>& output)
{
- std::cout << "extracting text..." << std::endl;
typedef int_u16 V;
typedef image2d<V> I;
@@ -469,21 +671,21 @@ namespace scribo
lbl = labeling::blobs(in, c8(), nlabels);
//Remove small components.
- remove_small_comps_i2v(lbl, nlabels, min_comp_size);
+ remove_small_comps_i2v(lbl, nlabels);
boxes_t cboxes = labeling::compute(accu::meta::bbox(), lbl, nlabels);
#ifndef NOUT
image2d<rgb8> tmp = clone(output);
draw_component_boxes(tmp, cboxes);
- io::ppm::save(tmp, output_file("character-bboxes.ppm", 5));
+ io::ppm::save(tmp, output_file("character-bboxes.ppm"));
#endif
//merge_bboxes(cboxes, lbl, nlabels);
//Link character bboxes to their left neighboor if possible.
fun::i2v::array<int_u16> left =
- link_character_bboxes(lbl, cboxes, nlabels, bbox_distance);
+ link_character_bboxes(lbl, cboxes, nlabels);
//Merge character bboxes according to their left neighbor.
util::array<box2d> tboxes = group_bboxes(left, lbl, cboxes, nlabels);
@@ -491,26 +693,45 @@ namespace scribo
return tboxes;
}
+ void maptext_to_cells(const image2d<bool>& in, const image2d<bool>& table, const util::array<box2d>& tboxes)
+ {
+ int_u16 nlabels;
+ image2d<int_u16> tblelbl = labeling::background(table, c8(), nlabels);
+ image2d<rgb8> color = debug::colorize<image2d<rgb8>, image2d<int_u16> >(tblelbl, nlabels);
+# ifndef NOUT
+ io::ppm::save(color, output_file("cells-labels.ppm"));
+# endif
+
+ image2d<rgb8> dbg = level::convert(rgb8(), logical::not_(table));
+
+ for_all_elements(i, tboxes)
+ if (tboxes[i].is_valid())
+ {
+ level::paste(pw::cst(color(tboxes[i].center())) | (tboxes[i] | pw::value(in) == pw::cst(true)),
+ dbg);
+ }
+# ifndef NOUT
+ io::ppm::save(dbg, output_file("text2cell.ppm"));
+# endif
+ }
+
/// \}
/// End of functions related to text extraction
} // end of namespace scribo::internal
-
// Facade
void demat(char *argv[], bool treat_tables)
{
using namespace mln;
using value::rgb8;
+ using value::int_u16;
border::thickness = 3;
trace::quiet = true;
//Useful debug variables
internal::input_file = basename(argv[1]);
- unsigned l = 101;
- unsigned bbox_distance = 25;
- unsigned min_comp_size = 5;
//Load image
image2d<bool> in;
@@ -521,18 +742,24 @@ namespace scribo
std::pair<util::array<box2d>,
util::array<box2d> > tblboxes;
+
+ image2d<bool> table;
if (treat_tables)
{
- tblboxes = internal::extract_tables(in, output, l);
- internal::extract_matrix(in, tblboxes);
+ tblboxes = internal::extract_tables(in, output);
+// internal::extract_matrix(in, tblboxes);
+ table = internal::rebuild_table(in, tblboxes);
}
image2d<value::int_u16> lbl;
util::array<box2d> tboxes =
- internal::extract_text(in, lbl, output, bbox_distance, min_comp_size);
+ internal::extract_text(in, lbl, output);
+
+ if (treat_tables)
+ internal::maptext_to_cells(in, table, tboxes);
internal::draw_component_boxes(output, tboxes);
- io::ppm::save(output, internal::output_file("out.ppm", 8));
+ io::ppm::save(output, internal::output_file("out.ppm"));
internal::text_recognition(in, lbl, tboxes);
}
--
1.5.6.5
1
0
* mln/canvas/browsing/dir_struct_elt_incr_update.hh: use def::coord.
* mln/level/naive/median.hh,
* mln/level/median.hh: update initialization of accu::median.
* mln/trace/entering.hh,
* mln/trace/exiting.hh,
* mln/util/timer.hh: Fix doc.
* tests/level/median_.cc: Fix test.
* doc/tutorial/samples/out.ppm: should not be there. Removed.
---
milena/ChangeLog | 17 +++++++++++++++++
milena/doc/tutorial/samples/out.ppm | Bin 145320 -> 0 bytes
.../canvas/browsing/dir_struct_elt_incr_update.hh | 3 +--
milena/mln/level/median.hh | 4 ++--
milena/mln/level/naive/median.hh | 18 +++++++++---------
milena/mln/trace/entering.hh | 8 ++++----
milena/mln/trace/exiting.hh | 8 ++++----
milena/mln/util/timer.hh | 15 ++++++---------
milena/tests/level/median_.cc | 2 +-
9 files changed, 44 insertions(+), 31 deletions(-)
delete mode 100644 milena/doc/tutorial/samples/out.ppm
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 5a6dbc7..67bfc63 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,3 +1,20 @@
+2008-11-13 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Make level/median* tests compile.
+
+ * mln/canvas/browsing/dir_struct_elt_incr_update.hh: use def::coord.
+
+ * mln/level/naive/median.hh,
+ * mln/level/median.hh: update initialization of accu::median.
+
+ * mln/trace/entering.hh,
+ * mln/trace/exiting.hh,
+ * mln/util/timer.hh: Fix doc.
+
+ * tests/level/median_.cc: Fix test.
+
+ * doc/tutorial/samples/out.ppm: should not be there. Removed.
+
2008-11-13 Nicolas Ballas <ballas(a)lrde.epita.fr>
Temporary fix in complex_image properties.
diff --git a/milena/doc/tutorial/samples/out.ppm b/milena/doc/tutorial/samples/out.ppm
deleted file mode 100644
index 7a33c29f788c3048de656608515af2b838ac61da..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
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
diff --git a/milena/mln/canvas/browsing/dir_struct_elt_incr_update.hh b/milena/mln/canvas/browsing/dir_struct_elt_incr_update.hh
index 164c060..a5cc7fd 100644
--- a/milena/mln/canvas/browsing/dir_struct_elt_incr_update.hh
+++ b/milena/mln/canvas/browsing/dir_struct_elt_incr_update.hh
@@ -118,8 +118,7 @@ namespace mln
mln_psite(I) pt, pu;
- typedef mln_coord(I)& coord_ref;
- coord_ref
+ def::coord&
ct = pt[f.dir],
cu = pu[f.dir],
p_dir = f.p[f.dir];
diff --git a/milena/mln/level/median.hh b/milena/mln/level/median.hh
index e224964..771c064 100644
--- a/milena/mln/level/median.hh
+++ b/milena/mln/level/median.hh
@@ -188,7 +188,7 @@ namespace mln
struct median_dir_t
{
typedef I_ I;
- enum { dim = I::point::dim };
+ enum { dim = I::site::dim };
// i/o
const I& input;
@@ -210,7 +210,7 @@ namespace mln
output(exact(output)),
// aux data
p(),
- med(input.values_eligible())
+ med()
{
}
diff --git a/milena/mln/level/naive/median.hh b/milena/mln/level/naive/median.hh
index e2034b9..f6a71b9 100644
--- a/milena/mln/level/naive/median.hh
+++ b/milena/mln/level/naive/median.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_LEVEL_NAIVE_MEDIAN_HH
# define MLN_LEVEL_NAIVE_MEDIAN_HH
-/*! \file mln/level/naive/median.hh
- *
- * \brief Naive version of median filtering.
- */
+/// \file mln/level/naive/median.hh
+///
+/// Naive version of median filtering.
# include <mln/core/concept/image.hh>
# include <mln/core/alias/window2d.hh>
@@ -47,9 +47,9 @@ namespace mln
namespace naive
{
- /*! Compute in \p output the median filter of image \p input by
- * the window \p win.
- *
+ /// Compute in \p output the median filter of image \p input by
+ /// the window \p win.
+ /*!
* \param[in] input The image to be filtered.
* \param[in] win The window.
* \param[in,out] output The output image.
@@ -79,7 +79,7 @@ namespace mln
{
mln_piter(I) p(input.domain());
mln_qiter(W) q(win, p);
- accu::median_h<mln_vset(I)> med(input.values());
+ accu::median_h<mln_value(I)> med;
for_all(p)
{
diff --git a/milena/mln/trace/entering.hh b/milena/mln/trace/entering.hh
index 20fc58d..dc8f707 100644
--- a/milena/mln/trace/entering.hh
+++ b/milena/mln/trace/entering.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_TRACE_ENTERING_HH
# define MLN_TRACE_ENTERING_HH
-/*! \file mln/trace/entering.hh
- *
- * \brief Definition of the trace entering procedure.
- */
+/// \file mln/trace/entering.hh
+///
+/// Definition of the trace entering procedure.
# include <string>
# include <iostream>
diff --git a/milena/mln/trace/exiting.hh b/milena/mln/trace/exiting.hh
index 9b7e9f5..ad342a3 100644
--- a/milena/mln/trace/exiting.hh
+++ b/milena/mln/trace/exiting.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_TRACE_EXITING_HH
# define MLN_TRACE_EXITING_HH
-/*! \file mln/trace/exiting.hh
- *
- * \brief Definition of the trace exiting procedure.
- */
+/// \file mln/trace/exiting.hh
+///
+/// Definition of the trace exiting procedure.
# include <string>
# include <iostream>
diff --git a/milena/mln/util/timer.hh b/milena/mln/util/timer.hh
index 23aabd8..49b0b2e 100644
--- a/milena/mln/util/timer.hh
+++ b/milena/mln/util/timer.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,10 +28,9 @@
#ifndef MLN_UTIL_TIMER_HH
# define MLN_UTIL_TIMER_HH
-/*! \file mln/util/timer.hh
- *
- * \brief Definition of a timer.
- */
+/// \file mln/util/timer.hh
+///
+/// Definition of a timer.
# include <mln/core/concept/proxy.hh>
# include <ctime>
@@ -43,9 +42,7 @@ namespace mln
namespace util
{
- /*! \brief Timer structure.
- *
- */
+ /// Timer structure.
class timer : public Proxy< timer >,
public internal::proxy_impl<float, timer>
{
@@ -162,7 +159,7 @@ namespace mln
time_ + float(std::clock()) / CLOCKS_PER_SEC - start_ :
time_;
}
-
+
inline
float
timer::subj_()
diff --git a/milena/tests/level/median_.cc b/milena/tests/level/median_.cc
index 0821a44..3d97c7c 100644
--- a/milena/tests/level/median_.cc
+++ b/milena/tests/level/median_.cc
@@ -34,7 +34,7 @@ int main()
{
- win::rectangle2d rect(20, 20);
+ win::rectangle2d rect(21, 21);
border::thickness = 6;
image2d<int_u8> lena;
--
1.5.6.5
1
0
2865: Make Olena compile with MLN_INCLUDE_ONLY and cleanup comments.
by Guillaume Lazzara 13 Nov '08
by Guillaume Lazzara 13 Nov '08
13 Nov '08
* mln/arith/diff_abs.hh: Fix bad namespace closure.
* mln/morpho/dilation_fast.hh,
* mln/trait/image/print.hh,
* mln/trait/op/ord.hh,
* mln/level/median.hh,
* mln/estim/mean.hh,
* mln/estim/min_max.hh,
* mln/estim/sum.hh,
* mln/estim/all.hh,
* mln/estim/essential.hh,
* mln/arith/diff_abs.hh,
* mln/arith/min.hh,
* mln/arith/min.spe.hh,
* mln/arith/minus.hh,
* mln/arith/plus.hh,
* mln/arith/revert.hh,
* mln/arith/revert.spe.hh,
* mln/arith/times.hh,
* mln/arith/times.spe.hh: Cleanup comments.
* mln/morpho/hit_or_miss.hh,
* mln/display/save.hh,
* mln/canvas/browsing/backdiagonal2d.hh,
* mln/canvas/browsing/diagonal2d.hh,
* mln/canvas/browsing/dir_struct_elt_incr_update.hh,
* mln/canvas/browsing/directional.hh,
* mln/canvas/browsing/essential.hh,
* mln/canvas/browsing/fwd.hh,
* mln/canvas/browsing/hyper_directional.hh,
* mln/canvas/browsing/snake_fwd.hh,
* mln/canvas/browsing/snake_generic.hh,
* mln/canvas/browsing/snake_vert.hh: Fix wrong declaration of global
variables.
* mln/value/float01.hh,
* mln/core/contract.hh: add missing inline.
* mln/fun/p2b/chess.hh,
* mln/fun/p2v/iota.hh: remove global variables.
* mln/fun/v2v/rgb_to_hsi.hh: Split interface and implementation.
* mln/geom/chamfer.hh: Fix compilation issue.
* mln/make/win_chamfer.hh: Move implementation between
MLN_INCLUDE_ONLY guards.
* tests/Makefile.am,
* tests/global_vars1.cc,
* tests/global_vars2.cc: Add a new test to check whether global
variables are declared correctly or not.
* tests/border/find_full.cc,
* tests/border/get_full.cc,
* tests/convert/to_image.cc,
* tests/core/image/cast_image.cc,
* tests/core/image/image_if.cc,
* tests/core/site_set/pset_if.cc,
* tests/level/fill_with_image.cc,
* tests/level/fill_with_value.cc,
* tests/level/paste.cc,
* tests/level/transform.cc,
* tests/trait/image/images.cc: update according the new use of
p2v::iota and p2b::chess.
* tests/pw/image.cc: Make it a real test.
* mln/level/compute.hh: Fix ambiguity.
* tests/border/get.cc,
* tests/border/resize_image_if.cc: Fix tests.
---
milena/ChangeLog | 77 ++++++++++
milena/mln/arith/diff_abs.hh | 22 ++--
milena/mln/arith/min.hh | 18 ++--
milena/mln/arith/min.spe.hh | 10 +-
milena/mln/arith/minus.hh | 42 +++---
milena/mln/arith/plus.hh | 46 +++---
milena/mln/arith/revert.hh | 22 ++--
milena/mln/arith/revert.spe.hh | 11 +-
milena/mln/arith/times.hh | 26 ++--
milena/mln/arith/times.spe.hh | 11 +-
milena/mln/canvas/browsing/backdiagonal2d.hh | 24 ++--
milena/mln/canvas/browsing/diagonal2d.hh | 24 ++--
.../canvas/browsing/dir_struct_elt_incr_update.hh | 61 ++------
milena/mln/canvas/browsing/directional.hh | 19 ++-
milena/mln/canvas/browsing/essential.hh | 1 +
milena/mln/canvas/browsing/fwd.hh | 20 ++--
milena/mln/canvas/browsing/hyper_directional.hh | 19 ++--
milena/mln/canvas/browsing/snake_fwd.hh | 29 ++---
milena/mln/canvas/browsing/snake_generic.hh | 16 +--
milena/mln/canvas/browsing/snake_vert.hh | 33 ++---
milena/mln/core/contract.hh | 1 +
milena/mln/display/save.hh | 30 ++--
milena/mln/estim/all.hh | 10 +-
milena/mln/estim/essential.hh | 9 +-
milena/mln/estim/mean.hh | 16 +-
milena/mln/estim/min_max.hh | 16 +-
milena/mln/estim/sum.hh | 20 ++--
milena/mln/fun/p2b/chess.hh | 8 +-
milena/mln/fun/p2v/iota.hh | 26 ++--
milena/mln/fun/v2v/rgb_to_hsi.hh | 148 +++++++++++--------
milena/mln/geom/chamfer.hh | 16 +--
milena/mln/level/compute.hh | 18 ++--
milena/mln/level/median.hh | 12 +-
milena/mln/make/win_chamfer.hh | 44 +++++-
milena/mln/morpho/dilation_fast.hh | 22 ++--
milena/mln/morpho/hit_or_miss.hh | 37 +++---
milena/mln/trait/image/print.hh | 8 +-
milena/mln/trait/op/ord.hh | 14 +-
milena/mln/value/float01.hh | 12 +-
milena/tests/Makefile.am | 4 +-
milena/tests/border/find_full.cc | 14 +-
milena/tests/border/get.cc | 12 +-
milena/tests/border/get_full.cc | 16 +-
milena/tests/border/resize_image_if.cc | 14 +-
milena/tests/convert/to_image.cc | 2 +-
milena/tests/core/image/cast_image.cc | 12 +-
milena/tests/core/image/image_if.cc | 18 ++--
milena/tests/core/site_set/pset_if.cc | 14 +-
milena/tests/global_vars1.cc | 101 +++++++++++++
milena/tests/global_vars2.cc | 101 +++++++++++++
milena/tests/level/fill_with_image.cc | 18 ++--
milena/tests/level/fill_with_value.cc | 12 +-
milena/tests/level/paste.cc | 14 +-
milena/tests/level/transform.cc | 13 +-
milena/tests/pw/image.cc | 25 +++-
milena/tests/trait/image/images.cc | 14 +-
56 files changed, 841 insertions(+), 561 deletions(-)
create mode 100644 milena/tests/global_vars1.cc
create mode 100644 milena/tests/global_vars2.cc
diff --git a/milena/ChangeLog b/milena/ChangeLog
index fc79c11..5a6dbc7 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -29,6 +29,83 @@
* mln/logical/includes.hh: New.
* mln/logical/all.hh: Update.
+2008-11-13 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Make Olena compile with MLN_INCLUDE_ONLY and cleanup comments.
+
+ * mln/arith/diff_abs.hh: Fix bad namespace closure.
+
+ * mln/morpho/dilation_fast.hh,
+ * mln/trait/image/print.hh,
+ * mln/trait/op/ord.hh,
+ * mln/level/median.hh,
+ * mln/estim/mean.hh,
+ * mln/estim/min_max.hh,
+ * mln/estim/sum.hh,
+ * mln/estim/all.hh,
+ * mln/estim/essential.hh,
+ * mln/arith/diff_abs.hh,
+ * mln/arith/min.hh,
+ * mln/arith/min.spe.hh,
+ * mln/arith/minus.hh,
+ * mln/arith/plus.hh,
+ * mln/arith/revert.hh,
+ * mln/arith/revert.spe.hh,
+ * mln/arith/times.hh,
+ * mln/arith/times.spe.hh: Cleanup comments.
+
+ * mln/morpho/hit_or_miss.hh,
+ * mln/display/save.hh,
+ * mln/canvas/browsing/backdiagonal2d.hh,
+ * mln/canvas/browsing/diagonal2d.hh,
+ * mln/canvas/browsing/dir_struct_elt_incr_update.hh,
+ * mln/canvas/browsing/directional.hh,
+ * mln/canvas/browsing/essential.hh,
+ * mln/canvas/browsing/fwd.hh,
+ * mln/canvas/browsing/hyper_directional.hh,
+ * mln/canvas/browsing/snake_fwd.hh,
+ * mln/canvas/browsing/snake_generic.hh,
+ * mln/canvas/browsing/snake_vert.hh: Fix wrong declaration of global
+ variables.
+
+ * mln/value/float01.hh,
+ * mln/core/contract.hh: add missing inline.
+
+ * mln/fun/p2b/chess.hh,
+ * mln/fun/p2v/iota.hh: remove global variables.
+
+ * mln/fun/v2v/rgb_to_hsi.hh: Split interface and implementation.
+
+ * mln/geom/chamfer.hh: Fix compilation issue.
+
+ * mln/make/win_chamfer.hh: Move implementation between
+ MLN_INCLUDE_ONLY guards.
+
+ * tests/Makefile.am,
+ * tests/global_vars1.cc,
+ * tests/global_vars2.cc: Add a new test to check whether global
+ variables are declared correctly or not.
+
+ * tests/border/find_full.cc,
+ * tests/border/get_full.cc,
+ * tests/convert/to_image.cc,
+ * tests/core/image/cast_image.cc,
+ * tests/core/image/image_if.cc,
+ * tests/core/site_set/pset_if.cc,
+ * tests/level/fill_with_image.cc,
+ * tests/level/fill_with_value.cc,
+ * tests/level/paste.cc,
+ * tests/level/transform.cc,
+ * tests/trait/image/images.cc: update according the new use of
+ p2v::iota and p2b::chess.
+
+ * tests/pw/image.cc: Make it a real test.
+
+ * mln/level/compute.hh: Fix ambiguity.
+
+ * tests/border/get.cc,
+ * tests/border/resize_image_if.cc: Fix tests.
+
2008-11-13 Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Specialize accu tranform for fastest images.
diff --git a/milena/mln/arith/diff_abs.hh b/milena/mln/arith/diff_abs.hh
index 141a38a..623a0b0 100644
--- a/milena/mln/arith/diff_abs.hh
+++ b/milena/mln/arith/diff_abs.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,12 +29,11 @@
#ifndef MLN_ARITH_DIFF_ABS_HH
# define MLN_ARITH_DIFF_ABS_HH
-/*! \file mln/arith/diff_abs.hh
- *
- * \brief Point-wise addition between images.
- *
- * \todo Speedup; some versions are not optimal.
- */
+/// \file mln/arith/diff_abs.hh
+///
+/// Point-wise addition between images.
+///
+/// \todo Speedup; some versions are not optimal.
# include <mln/arith/includes.hh>
# include <mln/fun/vv2v/diff_abs.hh>
@@ -45,8 +45,8 @@ namespace mln
namespace arith
{
- /*! Point-wise absolute difference of images \p lhs and \p rhs.
- *
+ /// Point-wise absolute difference of images \p lhs and \p rhs.
+ /*!
* \param[in] lhs First operand image.
* \param[in] rhs Second operand image.
* \result The result image.
@@ -76,10 +76,10 @@ namespace mln
return output;
}
- } // end of namespace mln::arith
-
# endif // ! MLN_INCLUDE_ONLY
+ } // end of namespace mln::arith
+
} // end of namespace mln
diff --git a/milena/mln/arith/min.hh b/milena/mln/arith/min.hh
index a8aaa10..67ae6c0 100644
--- a/milena/mln/arith/min.hh
+++ b/milena/mln/arith/min.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,10 +29,9 @@
#ifndef MLN_ARITH_MIN_HH
# define MLN_ARITH_MIN_HH
-/*! \file mln/arith/min.hh
- *
- * \brief Point-wise min between images.
- */
+/// \file mln/arith/min.hh
+///
+/// Point-wise min between images.
# include <mln/core/concept/image.hh>
@@ -45,8 +45,8 @@ namespace mln
namespace arith
{
- /*! Point-wise min of images \p lhs and \p rhs.
- *
+ /// Point-wise min of images \p lhs and \p rhs.
+ /*!
* \param[in] lhs First operand image.
* \param[in] rhs Second operand image.
* \result The result image.
@@ -58,8 +58,8 @@ namespace mln
min(const Image<L>& lhs, const Image<R>& rhs);
- /*! Point-wise min of image \p lhs in image \p rhs.
- *
+ /// Point-wise min of image \p lhs in image \p rhs.
+ /*!
* \param[in,out] lhs First operand image.
* \param[in] rhs Second operand image.
*
diff --git a/milena/mln/arith/min.spe.hh b/milena/mln/arith/min.spe.hh
index 25fca00..b31029b 100644
--- a/milena/mln/arith/min.spe.hh
+++ b/milena/mln/arith/min.spe.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,10 +29,9 @@
#ifndef MLN_ARITH_MIN_SPE_HH
# define MLN_ARITH_MIN_SPE_HH
-/*! \file mln/arith/min.spe.hh
- *
- * \brief Specializations for mln::arith::min.
- */
+/// \file mln/arith/min.spe.hh
+///
+/// Specializations for mln::arith::min.
# ifndef MLN_ARITH_MIN_HH
# error "Forbidden inclusion of *.spe.hh"
diff --git a/milena/mln/arith/minus.hh b/milena/mln/arith/minus.hh
index 6419e03..5a7db44 100644
--- a/milena/mln/arith/minus.hh
+++ b/milena/mln/arith/minus.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,12 +29,11 @@
#ifndef MLN_ARITH_MINUS_HH
# define MLN_ARITH_MINUS_HH
-/*! \file mln/arith/minus.hh
- *
- * \brief Point-wise substraction between images.
- *
- * \todo Speedup; some versions are not optimal.
- */
+/// \file mln/arith/minus.hh
+///
+/// Point-wise substraction between images.
+///
+/// \todo Speedup; some versions are not optimal.
# include <mln/arith/includes.hh>
@@ -87,8 +87,8 @@ namespace mln
namespace arith
{
- /*! Point-wise addition of images \p lhs and \p rhs.
- *
+ /// Point-wise addition of images \p lhs and \p rhs.
+ /*!
* \param[in] lhs First operand image.
* \param[in] rhs Second operand image.
* \result The result image.
@@ -100,8 +100,8 @@ namespace mln
minus(const Image<L>& lhs, const Image<R>& rhs);
- /*! Point-wise addition of images \p lhs and \p rhs.
- *
+ /// Point-wise addition of images \p lhs and \p rhs.
+ /*!
* \param[in] lhs First operand image.
* \param[in] rhs Second operand image.
* \param[in] f Function.
@@ -114,8 +114,8 @@ namespace mln
minus(const Image<L>& lhs, const Image<R>& rhs, const Function_v2v<F>& f);
- /*! Point-wise addition of images \p lhs and \p rhs.
- *
+ /// Point-wise addition of images \p lhs and \p rhs.
+ /*!
* \param[in] lhs First operand image.
* \param[in] rhs Second operand image.
* \result The result image.
@@ -129,8 +129,8 @@ namespace mln
minus(const Image<L>& lhs, const Image<R>& rhs);
- /*! Point-wise addition of image \p rhs in image \p lhs.
- *
+ /// Point-wise addition of image \p rhs in image \p lhs.
+ /*!
* \param[in,out] lhs First operand image (subject to addition).
* \param[in] rhs Second operand image (to be added to \p lhs).
*
@@ -145,8 +145,8 @@ namespace mln
minus_inplace(Image<L>& lhs, const Image<R>& rhs);
- /*! Point-wise addition of the value \p val to image \p input.
- *
+ /// Point-wise addition of the value \p val to image \p input.
+ /*!
* \param[in] input The image.
* \param[in] val The value.
* \result The result image.
@@ -158,8 +158,8 @@ namespace mln
minus_cst(const Image<I>& input, const V& val);
- /*! Point-wise addition of the value \p val to image \p input.
- *
+ /// Point-wise addition of the value \p val to image \p input.
+ /*!
* \param[in] input The image.
* \param[in] val The value.
* \param[in] f Function.
@@ -172,8 +172,8 @@ namespace mln
minus_cst(const Image<I>& input, const V& val, const Function_v2v<F>& f);
- /*! Point-wise addition of the value \p val to image \p input.
- *
+ /// Point-wise addition of the value \p val to image \p input.
+ /*!
* \param[in,out] input The image.
* \param[in] val The value.
*
diff --git a/milena/mln/arith/plus.hh b/milena/mln/arith/plus.hh
index a18026a..b4f7b2f 100644
--- a/milena/mln/arith/plus.hh
+++ b/milena/mln/arith/plus.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,12 +29,11 @@
#ifndef MLN_ARITH_PLUS_HH
# define MLN_ARITH_PLUS_HH
-/*! \file mln/arith/plus.hh
- *
- * \brief Point-wise addition between images.
- *
- * \todo Speedup; some versions are not optimal.
- */
+/// \file mln/arith/plus.hh
+///
+/// Point-wise addition between images.
+///
+/// \todo Speedup; some versions are not optimal.
# include <mln/arith/includes.hh>
@@ -87,8 +87,8 @@ namespace mln
namespace arith
{
- /*! Point-wise addition of images \p lhs and \p rhs.
- *
+ /// Point-wise addition of images \p lhs and \p rhs.
+ /*!
* \param[in] lhs First operand image.
* \param[in] rhs Second operand image.
* \result The result image.
@@ -100,8 +100,8 @@ namespace mln
plus(const Image<L>& lhs, const Image<R>& rhs);
- /*! Point-wise addition of images \p lhs and \p rhs.
- *
+ /// Point-wise addition of images \p lhs and \p rhs.
+ /*!
* \param[in] lhs First operand image.
* \param[in] rhs Second operand image.
* \param[in] f Function.
@@ -114,8 +114,8 @@ namespace mln
plus(const Image<L>& lhs, const Image<R>& rhs, const Function_v2v<F>& f);
- /*! Point-wise addition of images \p lhs and \p rhs.
- *
+ /// Point-wise addition of images \p lhs and \p rhs.
+ /*!
* \param[in] lhs First operand image.
* \param[in] rhs Second operand image.
* \result The result image.
@@ -129,8 +129,8 @@ namespace mln
plus(const Image<L>& lhs, const Image<R>& rhs);
- /*! Point-wise addition of image \p rhs in image \p lhs.
- *
+ /// Point-wise addition of image \p rhs in image \p lhs.
+ /*!
* \param[in,out] lhs First operand image (subject to addition).
* \param[in] rhs Second operand image (to be added to \p lhs).
*
@@ -145,8 +145,8 @@ namespace mln
plus_inplace(Image<L>& lhs, const Image<R>& rhs);
- /*! Point-wise addition of the value \p val to image \p input.
- *
+ /// Point-wise addition of the value \p val to image \p input.
+ /*!
* \param[in] input The image.
* \param[in] val The value.
* \result The result image.
@@ -158,8 +158,8 @@ namespace mln
plus_cst(const Image<I>& input, const V& val);
- /*! Point-wise addition of the value \p val to image \p input.
- *
+ /// Point-wise addition of the value \p val to image \p input.
+ /*!
* \param[in] input The image.
* \param[in] val The value.
* \param[in] f Function.
@@ -172,8 +172,8 @@ namespace mln
plus_cst(const Image<I>& input, const V& val, const Function_v2v<F>& f);
- /*! Point-wise addition of the value \p val to image \p input.
- *
+ /// Point-wise addition of the value \p val to image \p input.
+ /*!
* \param[in] input The image.
* \param[in] val The value.
* \result The result image.
@@ -185,8 +185,8 @@ namespace mln
plus_cst(const Image<I>& input, const V& val);
- /*! Point-wise addition of the value \p val to image \p input.
- *
+ /// Point-wise addition of the value \p val to image \p input.
+ /*!
* \param[in,out] input The image.
* \param[in] val The value.
*
diff --git a/milena/mln/arith/revert.hh b/milena/mln/arith/revert.hh
index c4d1044..ee0a386 100644
--- a/milena/mln/arith/revert.hh
+++ b/milena/mln/arith/revert.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,12 +29,11 @@
#ifndef MLN_ARITH_REVERT_HH
# define MLN_ARITH_REVERT_HH
-/*! \file mln/arith/revert.hh
- *
- * \brief Point-wise revert (min -> max and max -> min) of images.
- *
- * \todo Add static assertion and save one iterator in in-place version.
- */
+/// \file mln/arith/revert.hh
+///
+/// Point-wise revert (min -> max and max -> min) of images.
+///
+/// \todo Add static assertion and save one iterator in in-place version.
# include <mln/core/concept/image.hh>
# include <mln/trait/value_.hh>
@@ -52,8 +52,8 @@ namespace mln
namespace arith
{
- /*! Point-wise reversion of image \p input.
- *
+ /// Point-wise reversion of image \p input.
+ /*!
* \param[in] input the input image.
* \result The result image.
*
@@ -67,8 +67,8 @@ namespace mln
mln_concrete(I) revert(const Image<I>& input);
- /*! Point-wise in-place reversion of image \p input.
- *
+ /// Point-wise in-place reversion of image \p input.
+ /*!
* \param[in,out] input The target image.
*
* \pre \p input.has_data
diff --git a/milena/mln/arith/revert.spe.hh b/milena/mln/arith/revert.spe.hh
index 8a512b5..fcf8b74 100644
--- a/milena/mln/arith/revert.spe.hh
+++ b/milena/mln/arith/revert.spe.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,11 +29,9 @@
#ifndef MLN_ARITH_REVERT_SPE_HH
# define MLN_ARITH_REVERT_SPE_HH
-/*! \file mln/arith/revert.spe.hh
- *
- * \brief Specializations for mln::arith::revert.
- *
- */
+/// \file mln/arith/revert.spe.hh
+///
+/// Specializations for mln::arith::revert.
# ifndef MLN_ARITH_REVERT_HH
# error "Forbidden inclusion of *.spe.hh"
diff --git a/milena/mln/arith/times.hh b/milena/mln/arith/times.hh
index f0609c4..eedab41 100644
--- a/milena/mln/arith/times.hh
+++ b/milena/mln/arith/times.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,12 +29,11 @@
#ifndef MLN_ARITH_TIMES_HH
# define MLN_ARITH_TIMES_HH
-/*! \file mln/arith/times.hh
- *
- * \brief Point-wise multiplication between images.
- *
- * \todo Speedup; some versions are not optimal.
- */
+/// \file mln/arith/times.hh
+///
+/// Point-wise multiplication between images.
+///
+/// \todo Speedup; some versions are not optimal.
# include <mln/arith/includes.hh>
@@ -88,8 +88,8 @@ namespace mln
namespace arith
{
- /*! Point-wise addition of images \p lhs and \p rhs.
- *
+ /// Point-wise addition of images \p lhs and \p rhs.
+ /*!
* \param[in] lhs First operand image.
* \param[in] rhs Second operand image.
* \param[out] output The result image.
@@ -100,8 +100,8 @@ namespace mln
void times(const Image<L>& lhs, const Image<R>& rhs, Image<O>& output);
- /*! Point-wise addition of the value \p val to image \p input.
- *
+ /// Point-wise addition of the value \p val to image \p input.
+ /*!
* \param[in] input The image.
* \param[in] val The value.
* \param[out] output The result image.
@@ -112,8 +112,8 @@ namespace mln
void times_cst(const Image<I>& input, const V& val, Image<O>& output);
- /*! Point-wise addition of image \p rhs in image \p lhs.
- *
+ /// Point-wise addition of image \p rhs in image \p lhs.
+ /*!
* \param[in] lhs First operand image (subject to addition).
* \param[in,out] rhs Second operand image (to be added to \p lhs).
*
diff --git a/milena/mln/arith/times.spe.hh b/milena/mln/arith/times.spe.hh
index e88ae78..ef192bb 100644
--- a/milena/mln/arith/times.spe.hh
+++ b/milena/mln/arith/times.spe.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,11 +29,9 @@
#ifndef MLN_ARITH_TIMES_SPE_HH
# define MLN_ARITH_TIMES_SPE_HH
-/*! \file mln/arith/times.spe.hh
- *
- * \brief Specializations for mln::arith::times.
- *
- */
+/// \file mln/arith/times.spe.hh
+///
+/// Specializations for mln::arith::times.
# ifndef MLN_ARITH_TIMES_HH
# error "Forbidden inclusion of *.spe.hh"
diff --git a/milena/mln/canvas/browsing/backdiagonal2d.hh b/milena/mln/canvas/browsing/backdiagonal2d.hh
index ee07c80..0ad407e 100644
--- a/milena/mln/canvas/browsing/backdiagonal2d.hh
+++ b/milena/mln/canvas/browsing/backdiagonal2d.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,10 +29,9 @@
#ifndef MLN_CANVAS_BROWSING_BACKDIAGONAL2D_HH
# define MLN_CANVAS_BROWSING_BACKDIAGONAL2D_HH
-/*! \file mln/canvas/browsing/backdiagonal2d.hh
- *
- * \brief Backdiagonal2d browsing of an image.
- */
+/// \file mln/canvas/browsing/backdiagonal2d.hh
+///
+/// Backdiagonal2d browsing of an image.
# include <mln/core/concept/browsing.hh>
# include <mln/core/concept/image.hh>
@@ -45,9 +45,8 @@ namespace mln
namespace browsing
{
+ /// Browsing in a certain direction.
/*!
- * \brief Browsing in a certain direction.
- *
* This canvas browse all the point of an image 'input' of type
* 'I' and of dimension 'dim' in the direction 'dir'.
*
@@ -86,12 +85,14 @@ namespace mln
{
template <typename F>
void operator()(F& f) const;
- }
+ };
- backdiagonal2d;
+ extern const backdiagonal2d_t backdiagonal2d;
# ifndef MLN_INCLUDE_ONLY
+ const backdiagonal2d_t backdiagonal2d;
+
template <typename F>
inline
void
@@ -118,10 +119,7 @@ namespace mln
f.p[0] = pmax[0];
f.p[1] = pmin[1];
- trace::entering("canvas::browsing::backdiagonal2d::init");
f.init();
- trace::exiting("canvas::browsing::backdiagonal2d::init");
-
while (f.input.domain().has(f.p))
{
@@ -157,9 +155,7 @@ namespace mln
f.p = start_diag + dp_second;
}
- trace::entering("canvas::browsing::backdiagonal2d::final");
f.final();
- trace::exiting("canvas::browsing::backdiagonal2d::final");
trace::exiting("canvas::browsing::backdiagonal2d");
}
diff --git a/milena/mln/canvas/browsing/diagonal2d.hh b/milena/mln/canvas/browsing/diagonal2d.hh
index 1b825e8..87bdaa9 100644
--- a/milena/mln/canvas/browsing/diagonal2d.hh
+++ b/milena/mln/canvas/browsing/diagonal2d.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,10 +29,9 @@
#ifndef MLN_CANVAS_BROWSING_DIAGONAL2D_HH
# define MLN_CANVAS_BROWSING_DIAGONAL2D_HH
-/*! \file mln/canvas/browsing/diagonal2d.hh
- *
- * \brief Diagonal2d browsing of an image.
- */
+/// \file mln/canvas/browsing/diagonal2d.hh
+///
+/// Diagonal2d browsing of an image.
# include <mln/core/concept/browsing.hh>
# include <mln/core/concept/image.hh>
@@ -45,9 +45,8 @@ namespace mln
namespace browsing
{
+ /// Browsing in a certain direction.
/*!
- * \brief Browsing in a certain direction.
- *
* This canvas browse all the point of an image 'input' of type
* 'I' and of dimension 'dim' in the direction 'dir'.
*
@@ -86,12 +85,14 @@ namespace mln
{
template <typename F>
void operator()(F& f) const;
- }
+ };
- diagonal2d;
+ extern const diagonal2d_t diagonal2d;
# ifndef MLN_INCLUDE_ONLY
+ const diagonal2d_t diagonal2d;
+
template <typename F>
inline
void
@@ -116,10 +117,7 @@ namespace mln
f.p = pmin;
- trace::entering("canvas::browsing::diagonal2d::init");
f.init();
- trace::exiting("canvas::browsing::diagonal2d::init");
-
while (f.input.domain().has(f.p))
{
@@ -155,9 +153,7 @@ namespace mln
f.p = start_diag + dp_second;
}
- trace::entering("canvas::browsing::diagonal2d::final");
f.final();
- trace::exiting("canvas::browsing::diagonal2d::final");
trace::exiting("canvas::browsing::diagonal2d");
}
diff --git a/milena/mln/canvas/browsing/dir_struct_elt_incr_update.hh b/milena/mln/canvas/browsing/dir_struct_elt_incr_update.hh
index 2ea522f..164c060 100644
--- a/milena/mln/canvas/browsing/dir_struct_elt_incr_update.hh
+++ b/milena/mln/canvas/browsing/dir_struct_elt_incr_update.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,10 +29,9 @@
#ifndef MLN_CANVAS_BROWSING_DIR_STRUCT_ELT_INCR_UPDATE_HH
# define MLN_CANVAS_BROWSING_DIR_STRUCT_ELT_INCR_UPDATE_HH
-/*! \file mln/canvas/browsing/dir_struct_elt_incr_update.hh
- *
- * \brief Directional browsing of an image with structuring element.
- */
+/// \file mln/canvas/browsing/dir_struct_elt_incr_update.hh
+///
+/// Directional browsing of an image with structuring element.
# include <mln/core/concept/browsing.hh>
# include <mln/core/concept/image.hh>
@@ -44,10 +44,9 @@ namespace mln
namespace browsing
{
-
+
+ /// Browsing in a certain direction with a segment.
/*!
- * \brief Browsing in a certain direction with a segment.
- *
* This canvas browse all the point of an image 'input' of type
* 'I', of dimension 'dim' in the direction 'dir' with
* considering weigh the 'length' nearest points.
@@ -90,12 +89,14 @@ namespace mln
{
template <typename F>
void operator()(F& f) const;
- }
+ };
- dir_struct_elt_incr_update;
+ extern const dir_struct_elt_incr_update_t dir_struct_elt_incr_update;
# ifndef MLN_INCLUDE_ONLY
+ const dir_struct_elt_incr_update_t dir_struct_elt_incr_update;
+
template <typename F>
inline
void
@@ -116,7 +117,7 @@ namespace mln
pmax_dir_minus_half_length = pmax_dir - f.length / 2;
mln_psite(I) pt, pu;
-
+
typedef mln_coord(I)& coord_ref;
coord_ref
ct = pt[f.dir],
@@ -124,41 +125,27 @@ namespace mln
p_dir = f.p[f.dir];
f.p = pmin;
-
- trace::entering("canvas::browsing::dir_struct_elt_incr_update::init");
+
f.init();
- trace::exiting("canvas::browsing::dir_struct_elt_incr_update::init");
-
+
do
{
pt = f.p;
pu = f.p;
- trace::entering("canvas::browsing::dir_struct_elt_incr_update::init_line");
f.init_line();
- trace::exiting("canvas::browsing::dir_struct_elt_incr_update::init_line");
// initialization (before first point of the line)
for (ct = pmin_dir; ct < pmin_dir_plus_half_length; ++ ct)
if (f.input.has(pt))
- {
- trace::entering("canvas::browsing::dir_struct_elt_incr_update::add_point");
f.add_point(pt);
- trace::exiting("canvas::browsing::dir_struct_elt_incr_update::add_point");
- }
// left columns (just take new points)
for (p_dir = pmin_dir; p_dir <= pmin_dir_plus_half_length; ++p_dir, ++ct)
{
if (f.input.has(pt))
- {
- trace::entering("canvas::browsing::dir_struct_elt_incr_update::add_point");
f.add_point(pt);
- trace::exiting("canvas::browsing::dir_struct_elt_incr_update::add_point");
- }
- trace::entering("canvas::browsing::dir_struct_elt_incr_update::next");
f.next();
- trace::exiting("canvas::browsing::dir_struct_elt_incr_update::next");
}
// middle columns (both take and untake)
@@ -166,38 +153,22 @@ namespace mln
for (; p_dir <= pmax_dir_minus_half_length; ++cu, ++p_dir, ++ct)
{
if (f.input.has(pt))
- {
- trace::entering("canvas::browsing::dir_struct_elt_incr_update::add_point");
f.add_point(pt);
- trace::exiting("canvas::browsing::dir_struct_elt_incr_update::add_point");
- }
if (f.input.has(pu))
- {
- trace::entering("canvas::browsing::dir_struct_elt_incr_update::remove_point");
f.remove_point(pu);
- trace::exiting("canvas::browsing::dir_struct_elt_incr_update::remove_point");
- }
- trace::entering("canvas::browsing::dir_struct_elt_incr_update::next");
f.next();
- trace::exiting("canvas::browsing::dir_struct_elt_incr_update::next");
}
// right columns (now just untake old points)
for (; p_dir <= pmax_dir; ++cu, ++p_dir)
{
if (f.input.has(pu))
- {
- trace::entering("canvas::browsing::dir_struct_elt_incr_update::remove_point");
f.remove_point(pu);
- trace::exiting("canvas::browsing::dir_struct_elt_incr_update::remove_point");
- }
- trace::entering("canvas::browsing::dir_struct_elt_incr_update::next");
f.next();
- trace::exiting("canvas::browsing::dir_struct_elt_incr_update::next");
}
p_dir = pmin_dir;
-
+
for (int c = F::dim - 1; c >= 0; --c)
{
if (c == int(f.dir))
@@ -211,9 +182,7 @@ namespace mln
}
} while (f.p != pmin);
- trace::entering("canvas::browsing::dir_struct_elt_incr_update::final");
f.final();
- trace::exiting("canvas::browsing::dir_struct_elt_incr_update::final");
trace::exiting("canvas::browsing::dir_struct_elt_incr_update");
}
diff --git a/milena/mln/canvas/browsing/directional.hh b/milena/mln/canvas/browsing/directional.hh
index adab4fc..c9f7b58 100644
--- a/milena/mln/canvas/browsing/directional.hh
+++ b/milena/mln/canvas/browsing/directional.hh
@@ -1,4 +1,5 @@
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,10 +29,9 @@
#ifndef MLN_CANVAS_BROWSING_DIRECTIONAL_HH
# define MLN_CANVAS_BROWSING_DIRECTIONAL_HH
-/*! \file mln/canvas/browsing/directional.hh
- *
- * \brief Directional browsing of an image.
- */
+/// \file mln/canvas/browsing/directional.hh
+///
+/// Directional browsing of an image.
# include <mln/core/concept/browsing.hh>
# include <mln/core/concept/image.hh>
@@ -45,9 +45,8 @@ namespace mln
namespace browsing
{
+ /// Browsing in a certain direction.
/*!
- * \brief Browsing in a certain direction.
- *
* This canvas browse all the point of an image 'input' of type
* 'I' and of dimension 'dim' in the direction 'dir'.
*
@@ -94,17 +93,20 @@ namespace mln
{
template <typename F>
void operator()(F& f) const;
- }
+ };
- directional;
+ extern const directional_t directional;
# ifndef MLN_INCLUDE_ONLY
+ const directional_t directional;
+
template <typename F>
inline
void
directional_t::operator()(F& f) const
{
+ trace::entering("canvas::browsing::directional");
mln_precondition(f.dir < f.dim);
typedef typename F::I I;
@@ -145,6 +147,7 @@ namespace mln
} while (f.p != pmin);
f.final();
+ trace::exiting("canvas::browsing::directional");
}
# endif // ! MLN_INCLUDE_ONLY
diff --git a/milena/mln/canvas/browsing/essential.hh b/milena/mln/canvas/browsing/essential.hh
index 58447c6..db94973 100644
--- a/milena/mln/canvas/browsing/essential.hh
+++ b/milena/mln/canvas/browsing/essential.hh
@@ -1,4 +1,5 @@
// Copyright (C) 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
diff --git a/milena/mln/canvas/browsing/fwd.hh b/milena/mln/canvas/browsing/fwd.hh
index d4b1602..79a07d5 100644
--- a/milena/mln/canvas/browsing/fwd.hh
+++ b/milena/mln/canvas/browsing/fwd.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,10 +29,9 @@
#ifndef MLN_CANVAS_BROWSING_FWD_HH
# define MLN_CANVAS_BROWSING_FWD_HH
-/*! \file mln/canvas/browsing/fwd.hh
- *
- * \brief Canvas for forward browsing.
- */
+/// \file mln/canvas/browsing/fwd.hh
+///
+/// Canvas for forward browsing.
# include <mln/core/concept/browsing.hh>
# include <mln/core/concept/image.hh>
@@ -46,9 +46,8 @@ namespace mln
namespace browsing
{
+ /// Canvas for forward browsing
/*!
- * \brief Canvas for forward browsing
- *
* This canvas browse all the points of an image 'input' of type
* 'I' from left to right and from top to bottom
*
@@ -77,13 +76,14 @@ namespace mln
{
template <typename F>
void operator()(F& f) const;
- }
+ };
- fwd;
-
+ extern const fwd_t fwd;
# ifndef MLN_INCLUDE_ONLY
+ const fwd_t fwd;
+
template <typename F>
inline
void
diff --git a/milena/mln/canvas/browsing/hyper_directional.hh b/milena/mln/canvas/browsing/hyper_directional.hh
index 00afd5e..beba7a1 100644
--- a/milena/mln/canvas/browsing/hyper_directional.hh
+++ b/milena/mln/canvas/browsing/hyper_directional.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,10 +29,9 @@
#ifndef MLN_CANVAS_BROWSING_HYPER_DIRECTIONAL_HH
# define MLN_CANVAS_BROWSING_HYPER_DIRECTIONAL_HH
-/*! \file mln/canvas/browsing/hyper_directional.hh
- *
- * \brief Hyper_Directional browsing of an image.
- */
+/// \file mln/canvas/browsing/hyper_directional.hh
+///
+/// Hyper_Directional browsing of an image.
# include <mln/core/concept/browsing.hh>
# include <mln/core/concept/image.hh>
@@ -45,9 +45,8 @@ namespace mln
namespace browsing
{
+ /// Browsing in a certain direction.
/*!
- * \brief Browsing in a certain direction.
- *
* This canvas browse all the point of an image 'input' of type
* 'I' and of dimension 'dim' in the direction 'dir'.
*
@@ -79,12 +78,14 @@ namespace mln
{
template <typename F>
void operator()(F& f) const;
- }
+ };
- hyper_directional;
+ extern const hyper_directional_t hyper_directional;
# ifndef MLN_INCLUDE_ONLY
+ const hyper_directional_t hyper_directional;
+
template <typename F>
inline
void
diff --git a/milena/mln/canvas/browsing/snake_fwd.hh b/milena/mln/canvas/browsing/snake_fwd.hh
index 41e1bcd..52e39e9 100644
--- a/milena/mln/canvas/browsing/snake_fwd.hh
+++ b/milena/mln/canvas/browsing/snake_fwd.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,10 +29,9 @@
#ifndef MLN_CANVAS_BROWSING_SNAKE_FWD_HH
# define MLN_CANVAS_BROWSING_SNAKE_FWD_HH
-/*! \file mln/canvas/browsing/snake_fwd.hh
- *
- * \brief Browsing in a snake-way, forward.
- */
+/// \file mln/canvas/browsing/snake_fwd.hh
+///
+/// Browsing in a snake-way, forward.
# include <mln/core/concept/browsing.hh>
# include <mln/geom/size2d.hh>
@@ -46,9 +46,8 @@ namespace mln
namespace browsing
{
+ /// Browsing in a snake-way, forward.
/*!
- * \brief Browsing in a snake-way, forward.
- *
* This canvas browse all the point of an image 'input' like
* this :
*
@@ -88,14 +87,14 @@ namespace mln
{
template <typename F>
void operator()(F& f) const;
- }
-
- snake_fwd;
-
+ };
+ extern const snake_fwd_t snake_fwd;
# ifndef MLN_INCLUDE_ONLY
+ const snake_fwd_t snake_fwd;
+
template <typename F>
inline
void
@@ -116,36 +115,28 @@ namespace mln
def::coord& col = f.p.col();
// initialization
- trace::entering("canvas::browsing::snake_fwd::init");
f.init();
- trace::exiting("canvas::browsing::snake_fwd::init");
bool fwd = true;
for (row = min_row; row <= max_row; ++row)
// FIXME: Add "if (f.input.has(p))"?
{
// go down
- trace::entering("canvas::browsing::snake_fwd::init");
f.down();
- trace::exiting("canvas::browsing::snake_fwd::init");
if (fwd)
// browse line fwd
while (col < max_col)
{
++col;
- trace::entering("canvas::browsing::snake_fwd::fwd");
f.fwd();
- trace::exiting("canvas::browsing::snake_fwd::fwd");
}
else
// browse line bkd
while (col > min_col)
{
--col;
- trace::entering("canvas::browsing::snake_fwd::bkd");
f.bkd();
- trace::exiting("canvas::browsing::snake_fwd::bkd");
}
// change browsing
diff --git a/milena/mln/canvas/browsing/snake_generic.hh b/milena/mln/canvas/browsing/snake_generic.hh
index be275d9..540c2e4 100644
--- a/milena/mln/canvas/browsing/snake_generic.hh
+++ b/milena/mln/canvas/browsing/snake_generic.hh
@@ -45,9 +45,8 @@ namespace mln
namespace browsing
{
+ /// Multidimentional Browsing in a given-way.
/*!
- * \brief Multidimentional Browsing in a given-way.
- *
* F shall feature: \n
* { \n
* --- as attributes: \n
@@ -80,14 +79,15 @@ namespace mln
template <typename F>
void operator()(F& f) const;
- }
-
- snake_generic;
+ };
+ extern const snake_generic_t snake_generic;
# ifndef MLN_INCLUDE_ONLY
+ const snake_generic_t snake_generic;
+
template <typename F>
inline
void
@@ -97,16 +97,14 @@ namespace mln
mln_precondition(f.input.has_data());
// p init
- f.p = f.input.bbox().pmin();// - f.dps[0];
+ f.p = f.input.bbox().pmin();// - f.dps[0];
std::vector< int > directions(f.moves.size(), 0);
unsigned deph = 0;
unsigned total_deph = f.moves.size() / 2 + 1;
// initialization
- trace::entering("canvas::browsing::snake_generic::init");
f.init();
- trace::exiting("canvas::browsing::snake_generic::init");
bool first = true;
directions[deph] = 1;
@@ -124,7 +122,7 @@ namespace mln
{
// Go up the tree
deph--;
- if (deph >= 1)
+ if (deph >= 1)
// Change directions
directions[deph] = directions[deph] == 1 ? 0 : 1;
continue;
diff --git a/milena/mln/canvas/browsing/snake_vert.hh b/milena/mln/canvas/browsing/snake_vert.hh
index bfa2df0..36b1ceb 100644
--- a/milena/mln/canvas/browsing/snake_vert.hh
+++ b/milena/mln/canvas/browsing/snake_vert.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,10 +29,9 @@
#ifndef MLN_CANVAS_BROWSING_SNAKE_VERT_HH
# define MLN_CANVAS_BROWSING_SNAKE_VERT_HH
-/*! \file mln/canvas/browsing/snake_vert.hh
- *
- * \brief Browsing in a snake-way, forward.
- */
+/// \file mln/canvas/browsing/snake_vert.hh
+///
+/// Browsing in a snake-way, forward.
# include <mln/core/concept/browsing.hh>
# include <mln/geom/size2d.hh>
@@ -46,9 +46,8 @@ namespace mln
namespace browsing
{
+ /// Browsing in a snake-way, forward.
/*!
- * \brief Browsing in a snake-way, forward.
- *
* This canvas browse all the point of an image 'input' like
* this :
*
@@ -88,22 +87,22 @@ namespace mln
{
template <typename F>
void operator()(F& f) const;
- }
-
- snake_vert;
-
+ };
+ extern const snake_vert_t snake_vert;
# ifndef MLN_INCLUDE_ONLY
+ const snake_vert_t snake_vert;
+
template <typename F>
inline
void
snake_vert_t::operator()(F& f) const
{
// Fixme: check the dimension of the input
-// mlc_equal(mln_trait_image_dimension(I)(),
-// trait::image::dimension::two_d)::check();
+// mlc_equal(mln_trait_image_dimension(I)(),
+// trait::image::dimension::two_d)::check();
trace::entering("canvas::browsing::snake_vert");
mln_precondition(f.input.has_data());
int
@@ -116,36 +115,28 @@ namespace mln
def::coord& col = f.p.col();
// initialization
- trace::entering("canvas::browsing::snake_vert::init");
f.init();
- trace::exiting("canvas::browsing::snake_vert::init");
bool down = true;
for (col = min_col; col <= max_col; ++col)
// FIXME: Add "if (f.input.has(p))"?
{
// go fwd
- trace::entering("canvas::browsing::snake_vert::init");
f.fwd();
- trace::exiting("canvas::browsing::snake_vert::init");
if (down)
// browse col down.
while (row < max_row)
{
++row;
- trace::entering("canvas::browsing::snake_vert::down");
f.down();
- trace::exiting("canvas::browsing::snake_vert::down");
}
else
// browse col up.
while (row > min_row)
{
--row;
- trace::entering("canvas::browsing::snake_vert::up");
f.up();
- trace::exiting("canvas::browsing::snake_vert::up");
}
// change browsing
diff --git a/milena/mln/core/contract.hh b/milena/mln/core/contract.hh
index 5d03057..58e71cc 100644
--- a/milena/mln/core/contract.hh
+++ b/milena/mln/core/contract.hh
@@ -67,6 +67,7 @@ namespace mln
# ifndef MLN_INCLUDE_ONLY
+ inline
bool implies(bool lexpr, bool rexpr)
{
return ! (rexpr) || (lexpr);
diff --git a/milena/mln/display/save.hh b/milena/mln/display/save.hh
index 88b09f2..addd6b7 100644
--- a/milena/mln/display/save.hh
+++ b/milena/mln/display/save.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,11 +29,10 @@
#ifndef MLN_DISPLAY_SAVE_HH
# define MLN_DISPLAY_SAVE_HH
-/*! \file mln/display/save.hh
- *
- * \brief Definition of function which saves an image on a temporary
- * files.
- */
+/// \file mln/display/save.hh
+///
+/// Definition of function which saves an image on a temporary
+/// files.
# include <mln/trait/image_from_grid.hh>
# include <mln/core/image/image_if.hh>
@@ -49,23 +49,21 @@ namespace mln
namespace display
{
- /*! Map which stocks the location of the saved file by the id of
- * the image.
- *
- */
- std::map<void*, std::string> map_saved_image_tmp_;
+ /// Map which stocks the location of the saved file by the id of
+ /// the image.
+ extern std::map<void*, std::string> map_saved_image_tmp_;
- /*! Save an image in a temporary file in ppm format.
- *
- * \param[in] input_ the image to save.
- *
- */
+ /// Save an image in a temporary file in ppm format.
+ ///
+ /// \param[in] input_ the image to save.
template <typename I>
void
save(const Image<I>& input_);
# ifndef MLN_INCLUDE_ONLY
+ std::map<void*, std::string> map_saved_image_tmp_;
+
namespace impl
{
template <typename I>
diff --git a/milena/mln/estim/all.hh b/milena/mln/estim/all.hh
index 95649b8..4d35d3f 100644
--- a/milena/mln/estim/all.hh
+++ b/milena/mln/estim/all.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,10 +29,9 @@
#ifndef MLN_ESTIM_ALL_HH
# define MLN_ESTIM_ALL_HH
-/*! \file mln/estim/all.hh
- *
- * \brief File that includes all estimation materials.
- */
+/// \file mln/estim/all.hh
+///
+/// File that includes all estimation materials.
namespace mln
diff --git a/milena/mln/estim/essential.hh b/milena/mln/estim/essential.hh
index 4afe74d..3d807ad 100644
--- a/milena/mln/estim/essential.hh
+++ b/milena/mln/estim/essential.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,10 +28,9 @@
#ifndef MLN_ESTIM_ESSENTIAL_HH
# define MLN_ESTIM_ESSENTIAL_HH
-/*! \file mln/estim/essential.hh
- *
- * \brief File that includes essential estimation materials.
- */
+/// \file mln/estim/essential.hh
+///
+/// File that includes essential estimation materials.
# include <mln/estim/all.hh>
diff --git a/milena/mln/estim/mean.hh b/milena/mln/estim/mean.hh
index 0c6fbdb..25457f8 100644
--- a/milena/mln/estim/mean.hh
+++ b/milena/mln/estim/mean.hh
@@ -1,4 +1,5 @@
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,10 +29,9 @@
#ifndef MLN_ESTIM_MEAN_HH
# define MLN_ESTIM_MEAN_HH
-/*! \file mln/estim/mean.hh
- *
- * \brief Compute the mean pixel value.
- */
+/// \file mln/estim/mean.hh
+///
+/// Compute the mean pixel value.
# include <mln/accu/mean.hh>
# include <mln/level/compute.hh>
@@ -43,8 +43,8 @@ namespace mln
namespace estim
{
- /*! \brief Compute the mean value of the pixels of image \p input.
- *
+ /// Compute the mean value of the pixels of image \p input.
+ /*!
* \param[in] input The image.
* \return The mean value.
*/
@@ -52,8 +52,8 @@ namespace mln
mln_sum(mln_value(I)) mean(const Image<I>& input);
- /*! \brief Compute the mean value of the pixels of image \p input.
- *
+ /// Compute the mean value of the pixels of image \p input.
+ /*!
* \param[in] input The image.
* \param[out] result The mean value.
*
diff --git a/milena/mln/estim/min_max.hh b/milena/mln/estim/min_max.hh
index 64e6958..14e1581 100644
--- a/milena/mln/estim/min_max.hh
+++ b/milena/mln/estim/min_max.hh
@@ -1,4 +1,5 @@
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,12 +29,11 @@
#ifndef MLN_ESTIM_MIN_MAX_HH
# define MLN_ESTIM_MIN_MAX_HH
-/*! \file mln/estim/min_max.hh
- *
- * \brief Compute the min and max pixel values of an image.
- *
- * \todo Overload while returning an std::pair.
- */
+/// \file mln/estim/min_max.hh
+///
+/// Compute the min and max pixel values of an image.
+///
+/// \todo Overload while returning an std::pair.
# include <mln/accu/min_max.hh>
# include <mln/level/compute.hh>
@@ -45,8 +45,8 @@ namespace mln
namespace estim
{
- /*! \brief Compute the min and max values of the pixels of image \p input.
- *
+ /// Compute the min and max values of the pixels of image \p input.
+ /*!
* \param[in] input The image.
* \param[out] min The minimum pixel value of \p input.
* \param[out] max The maximum pixel value of \p input.
diff --git a/milena/mln/estim/sum.hh b/milena/mln/estim/sum.hh
index 2defc4f..1df276d 100644
--- a/milena/mln/estim/sum.hh
+++ b/milena/mln/estim/sum.hh
@@ -1,4 +1,5 @@
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,12 +29,11 @@
#ifndef MLN_ESTIM_SUM_HH
# define MLN_ESTIM_SUM_HH
-/*! \file mln/estim/sum.hh
- *
- * \brief Compute the sum pixel value.
- *
- * \todo Sum works on level so move into mln/level; otherwise on pix then ambiguous.
- */
+/// \file mln/estim/sum.hh
+///
+/// Compute the sum pixel value.
+///
+/// \todo Sum works on level so move into mln/level; otherwise on pix then ambiguous.
# include <mln/accu/sum.hh>
# include <mln/level/compute.hh>
@@ -45,8 +45,8 @@ namespace mln
namespace estim
{
- /*! \brief Compute the sum value of the pixels of image \p input.
- *
+ /// Compute the sum value of the pixels of image \p input.
+ /*!
* \param[in] input The image.
* \return The sum value.
*/
@@ -54,8 +54,8 @@ namespace mln
mln_sum(mln_value(I)) sum(const Image<I>& input);
- /*! \brief Compute the sum value of the pixels of image \p input.
- *
+ /// Compute the sum value of the pixels of image \p input.
+ /*!
* \param[in] input The image.
* \param[out] result The sum value.
*/
diff --git a/milena/mln/fun/p2b/chess.hh b/milena/mln/fun/p2b/chess.hh
index 163b566..2f73cf9 100644
--- a/milena/mln/fun/p2b/chess.hh
+++ b/milena/mln/fun/p2b/chess.hh
@@ -48,20 +48,18 @@ namespace mln
// FIXME: Doc!
- struct chess_t : public Function_p2b< chess_t >
+ struct chess : public Function_p2b< chess >
{
typedef bool result;
bool operator()(const point2d& p) const;
- }
-
- chess;
+ };
# ifndef MLN_INCLUDE_ONLY
inline
bool
- chess_t::operator()(const point2d& p) const
+ chess::operator()(const point2d& p) const
{
return (p.row() + p.col()) % 2 == 0;
}
diff --git a/milena/mln/fun/p2v/iota.hh b/milena/mln/fun/p2v/iota.hh
index ef58e90..233caa8 100644
--- a/milena/mln/fun/p2v/iota.hh
+++ b/milena/mln/fun/p2v/iota.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,10 +29,9 @@
#ifndef MLN_FUN_P2V_IOTA_HH
# define MLN_FUN_P2V_IOTA_HH
-/*! \file mln/fun/p2v/iota.hh
- *
- * \brief Iota function.
- */
+/// \file mln/fun/p2v/iota.hh
+///
+/// Iota function.
# include <mln/core/concept/function.hh>
@@ -45,11 +45,11 @@ namespace mln
namespace p2v
{
- struct iota_t : public Function_p2v< iota_t >
+ struct iota : public Function_p2v< iota >
{
typedef unsigned result;
- iota_t();
+ iota();
template <typename P>
unsigned operator()(const P&) const;
@@ -59,15 +59,13 @@ namespace mln
protected:
mutable unsigned i_;
- }
-
- iota;
+ };
# ifndef MLN_INCLUDE_ONLY
inline
- iota_t::iota_t()
+ iota::iota()
{
reset();
}
@@ -75,21 +73,21 @@ namespace mln
template <typename P>
inline
unsigned
- iota_t::operator()(const P&) const
+ iota::operator()(const P&) const
{
return ++i_;
}
inline
unsigned
- iota_t::value() const
+ iota::value() const
{
return i_;
}
inline
void
- iota_t::reset() const
+ iota::reset() const
{
i_ = 0;
}
diff --git a/milena/mln/fun/v2v/rgb_to_hsi.hh b/milena/mln/fun/v2v/rgb_to_hsi.hh
index 79d26fb..bf9bd5d 100644
--- a/milena/mln/fun/v2v/rgb_to_hsi.hh
+++ b/milena/mln/fun/v2v/rgb_to_hsi.hh
@@ -36,8 +36,6 @@
#include <mln/value/hsi.hh>
-// FIXME: Split interface and implementation.
-
namespace mln
{
@@ -54,40 +52,13 @@ namespace mln
typedef T_hsi result;
template <typename T_rgb>
- T_hsi operator()(const T_rgb& rgb) const
- {
- // Locals.
- static const double sqrt3_3 = std::sqrt(3) / 3;
- static const double inv_sqrt6 = 1 / std::sqrt(6);
- static const double inv_sqrt2 = 1 / std::sqrt(2);
-
- T_hsi hsi;
-
- double alpha = inv_sqrt2 * rgb.green() - inv_sqrt2 * rgb.blue();
- double beta =
- 2 * inv_sqrt6 * rgb.red() -
- inv_sqrt6 * rgb.green() -
- inv_sqrt6 * rgb.blue();
-
-
- hsi.hue() = atan2(beta, alpha) / 3.1415 * 180.0;
- if (hsi.hue() < 0)
- hsi.hue() = hsi.hue() + 360.0;
- mln_invariant(hsi.hue() >= 0);
- hsi.sat() = std::sqrt(alpha * alpha + beta * beta);
- hsi.inty() =
- sqrt3_3 * rgb.red() +
- sqrt3_3 * rgb.green() +
- sqrt3_3 * rgb.blue();
-
- return hsi;
- }
+ T_hsi operator()(const T_rgb& rgb) const;
+
};
typedef f_rgb_to_hsi_<value::hsi_f> f_rgb_to_hsi_f_t;
- // FIXME: Warning: global object.
- f_rgb_to_hsi_f_t f_rgb_to_hsi_f;
+ extern f_rgb_to_hsi_f_t f_rgb_to_hsi_f;
template <typename T_rgb>
@@ -96,43 +67,96 @@ namespace mln
typedef T_rgb result;
template <typename T_hsi>
- T_rgb operator()(const T_hsi& hsi) const
- {
- typedef typename T_rgb::red_t red_t;
- typedef typename T_rgb::green_t green_t;
- typedef typename T_rgb::blue_t blue_t;
-
- static math::round<red_t> to_r;
- static math::round<green_t> to_g;
- static math::round<blue_t> to_b;
-
- static const float
- sqrt3_3 = std::sqrt(3) / 3,
- inv_sqrt6 = 1 / std::sqrt(6),
- inv_sqrt2 = 1 / std::sqrt(2);
-
- float
- h = hsi.hue() / 180.0 * 3.1415,
- alpha = hsi.sat() * std::cos(h),
- beta = hsi.sat() * std::sin(h);
+ T_rgb operator()(const T_hsi& hsi) const;
+ };
- red_t r = to_r(sqrt3_3 * hsi.inty() + 2 * inv_sqrt6 * beta);
- green_t g =
- to_g(sqrt3_3 * hsi.inty() + inv_sqrt2 * alpha - inv_sqrt6 * beta);
- blue_t b =
- to_b(sqrt3_3 * hsi.inty() - inv_sqrt2 * alpha - inv_sqrt6 * beta);
+ typedef f_hsi_to_rgb_<value::rgb8> f_hsi_to_rgb_3x8_t;
- T_rgb rgb(r, g, b);
+ extern f_hsi_to_rgb_3x8_t f_hsi_to_rgb_3x8;
- return rgb;
- }
- };
- typedef f_hsi_to_rgb_<value::rgb8> f_hsi_to_rgb_3x8_t;
+# ifndef MLN_INCLUDE_ONLY
+
+ /// Global variables.
+ /// \{
+ f_rgb_to_hsi_f_t f_rgb_to_hsi_f;
- // FIXME: Warning: global object.
f_hsi_to_rgb_3x8_t f_hsi_to_rgb_3x8;
+ /// \}
+
+
+ template <typename T_hsi>
+ template <typename T_rgb>
+ inline
+ T_hsi
+ f_rgb_to_hsi_<T_hsi>::operator()(const T_rgb& rgb) const
+ {
+ // Locals.
+ static const double sqrt3_3 = std::sqrt(3) / 3;
+ static const double inv_sqrt6 = 1 / std::sqrt(6);
+ static const double inv_sqrt2 = 1 / std::sqrt(2);
+
+ T_hsi hsi;
+
+ double alpha = inv_sqrt2 * rgb.green() - inv_sqrt2 * rgb.blue();
+ double beta =
+ 2 * inv_sqrt6 * rgb.red() -
+ inv_sqrt6 * rgb.green() -
+ inv_sqrt6 * rgb.blue();
+
+
+ hsi.hue() = atan2(beta, alpha) / 3.1415 * 180.0;
+ if (hsi.hue() < 0)
+ hsi.hue() = hsi.hue() + 360.0;
+ mln_invariant(hsi.hue() >= 0);
+ hsi.sat() = std::sqrt(alpha * alpha + beta * beta);
+ hsi.inty() =
+ sqrt3_3 * rgb.red() +
+ sqrt3_3 * rgb.green() +
+ sqrt3_3 * rgb.blue();
+
+ return hsi;
+ }
+
+
+ template <typename T_rgb>
+ template <typename T_hsi>
+ inline
+ T_rgb
+ f_hsi_to_rgb_<T_rgb>::operator()(const T_hsi& hsi) const
+ {
+ typedef typename T_rgb::red_t red_t;
+ typedef typename T_rgb::green_t green_t;
+ typedef typename T_rgb::blue_t blue_t;
+
+ static math::round<red_t> to_r;
+ static math::round<green_t> to_g;
+ static math::round<blue_t> to_b;
+
+ static const float
+ sqrt3_3 = std::sqrt(3) / 3,
+ inv_sqrt6 = 1 / std::sqrt(6),
+ inv_sqrt2 = 1 / std::sqrt(2);
+
+ float
+ h = hsi.hue() / 180.0 * 3.1415,
+ alpha = hsi.sat() * std::cos(h),
+ beta = hsi.sat() * std::sin(h);
+
+
+ red_t r = to_r(sqrt3_3 * hsi.inty() + 2 * inv_sqrt6 * beta);
+ green_t g =
+ to_g(sqrt3_3 * hsi.inty() + inv_sqrt2 * alpha - inv_sqrt6 * beta);
+ blue_t b =
+ to_b(sqrt3_3 * hsi.inty() - inv_sqrt2 * alpha - inv_sqrt6 * beta);
+
+ T_rgb rgb(r, g, b);
+
+ return rgb;
+ }
+
+# endif // !MLN_INCLUDE_ONLY
} // end of namespace fun::v2v
diff --git a/milena/mln/geom/chamfer.hh b/milena/mln/geom/chamfer.hh
index 934e50a..df3b515 100644
--- a/milena/mln/geom/chamfer.hh
+++ b/milena/mln/geom/chamfer.hh
@@ -1,4 +1,5 @@
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,10 +29,9 @@
#ifndef MLN_GEOM_CHAMFER_HH
# define MLN_GEOM_CHAMFER_HH
-/*! \file mln/geom/chamfer.hh
- *
- * \brief Connected component chamfer of the image objects.
- */
+/// \file mln/geom/chamfer.hh
+///
+/// Connected component chamfer of the image objects.
# include <mln/level/fill.hh>
# include <mln/core/alias/w_window2d_int.hh>
@@ -53,7 +53,7 @@ namespace mln
/// Apply chamfer algorithm to a binary image.
template <typename I, typename W>
- mln_ch_value( I, unsigned )
+ mln_ch_value(I, unsigned)
chamfer(const Image<I>& input_, const W& w_win_,
unsigned max = mln_max(unsigned));
@@ -131,9 +131,6 @@ namespace mln
} // end of namespace mln::geom::impl
-#endif // !MLN_INCLUDE_ONLY
-
-
// Facade.
template <typename I, typename W>
@@ -141,9 +138,10 @@ namespace mln
chamfer(const Image<I>& input_, const W& w_win_,
unsigned max = mln_max(unsigned))
{
- return impl::chamfer_(exact (input_), exact(w_win_), max);
+ return impl::chamfer_t<I, W>(exact (input_), exact(w_win_), max);
}
+#endif // !MLN_INCLUDE_ONLY
} // end of namespace mln::geom
diff --git a/milena/mln/level/compute.hh b/milena/mln/level/compute.hh
index ef7c25a..83ea8ec 100644
--- a/milena/mln/level/compute.hh
+++ b/milena/mln/level/compute.hh
@@ -1,4 +1,5 @@
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,10 +29,9 @@
#ifndef MLN_LEVEL_COMPUTE_HH
# define MLN_LEVEL_COMPUTE_HH
-/*! \file mln/level/compute.hh
- *
- * \brief Compute an accumulator onto image pixel values.
- */
+/// \file mln/level/compute.hh
+///
+/// Compute an accumulator onto image pixel values.
# include <mln/level/update.hh>
# include <mln/core/concept/meta_accumulator.hh>
@@ -44,8 +44,8 @@ namespace mln
namespace level
{
- /*! Compute an accumulator onto the pixel values of the image \p input.
- *
+ /// Compute an accumulator onto the pixel values of the image \p input.
+ /*!
* \param[in] a An accumulator.
* \param[in] input The input image.
* \return The accumulator result.
@@ -57,8 +57,8 @@ namespace mln
compute(const Accumulator<A>& a, const Image<I>& input);
- /*! Compute an accumulator onto the pixel values of the image \p input.
- *
+ /// Compute an accumulator onto the pixel values of the image \p input.
+ /*!
* \param[in] a A meta-accumulator.
* \param[in] input The input image.
* \return The accumulator result.
@@ -97,7 +97,7 @@ namespace mln
compute(const Meta_Accumulator<A>&, const Image<I>& input)
{
mln_accu_with(A, mln_value(I)) accu;
- return compute(accu, input); // Call the previous version.
+ return level::compute(accu, input); // Call the previous version.
}
# endif // ! MLN_INCLUDE_ONLY
diff --git a/milena/mln/level/median.hh b/milena/mln/level/median.hh
index 6d847f8..e224964 100644
--- a/milena/mln/level/median.hh
+++ b/milena/mln/level/median.hh
@@ -1,4 +1,5 @@
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,12 +29,11 @@
#ifndef MLN_LEVEL_MEDIAN_HH
# define MLN_LEVEL_MEDIAN_HH
-/*! \file mln/level/median.hh
- *
- * \brief Median filtering of an image.
- *
- * \todo Add versions for fastest and semi-linear images.
- */
+/// \file mln/level/median.hh
+///
+/// Median filtering of an image.
+///
+/// \todo Add versions for fastest and semi-linear images.
# include <mln/core/concept/image.hh>
# include <mln/core/window.hh>
diff --git a/milena/mln/make/win_chamfer.hh b/milena/mln/make/win_chamfer.hh
index 9ba3791..a28d145 100644
--- a/milena/mln/make/win_chamfer.hh
+++ b/milena/mln/make/win_chamfer.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2006 EPITA Research and Development Laboratory
+// Copyright (C) 2006, 2008 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -29,12 +29,9 @@
#ifndef MLN_MAKE_WIN_CHAMFER_HH
# define MLN_MAKE_WIN_CHAMFER_HH\
-/*!
- * \file mln/make/win_chamfer.hh
- *
- * \brief Routine to create chamfer mln::w_window2d_int.
- *
- */
+/// \file mln/make/win_chamfer.hh
+///
+/// Routine to create chamfer mln::w_window2d_int.
# include <mln/core/alias/w_window2d_int.hh>
@@ -48,6 +45,33 @@ namespace mln
{
template<int d10, int d11>
+ const mln::w_window2d_int mk_chamfer_3x3_int();
+
+ template<int d10, int d11, int d21>
+ const mln::w_window2d_int mk_chamfer_5x5_int();
+
+ const mln::w_window2d_float mk_chamfer_3x3_float(float d10, float d11);
+
+ const mln::w_window2d_float
+ mk_chamfer_5x5_float(float d10, float d11, float d21);
+
+ const mln::w_window2d_float mk_chamfer_exact();
+
+ } // end of namespace mln::make
+
+} // end of namespace mln
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+namespace mln
+{
+
+ namespace make
+ {
+
+ template<int d10, int d11>
+ inline
const mln::w_window2d_int
mk_chamfer_3x3_int()
{
@@ -59,6 +83,7 @@ namespace mln
}
template<int d10, int d11, int d21>
+ inline
const mln::w_window2d_int
mk_chamfer_5x5_int()
{
@@ -71,6 +96,7 @@ namespace mln
return (make::w_window2d(ws));
}
+ inline
const mln::w_window2d_float
mk_chamfer_3x3_float(float d10, float d11)
{
@@ -81,6 +107,7 @@ namespace mln
return (make::w_window2d(ws));
}
+ inline
const mln::w_window2d_float
mk_chamfer_5x5_float(float d10, float d11, float d21)
{
@@ -93,6 +120,7 @@ namespace mln
return (make::w_window2d(ws));
}
+ inline
const mln::w_window2d_float
mk_chamfer_exact()
{
@@ -108,4 +136,6 @@ namespace mln
} // end of namespace mln
+# endif // !MLN_INCLUDE_ONLY
+
#endif // ! MLN_MAKE_WIN_CHAMFER_HH
diff --git a/milena/mln/morpho/dilation_fast.hh b/milena/mln/morpho/dilation_fast.hh
index e977253..482ca94 100644
--- a/milena/mln/morpho/dilation_fast.hh
+++ b/milena/mln/morpho/dilation_fast.hh
@@ -1,4 +1,5 @@
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,12 +29,11 @@
#ifndef MLN_MORPHO_DILATION_FAST_HH
# define MLN_MORPHO_DILATION_FAST_HH
-/*! \file mln/morpho/dilation_fast.hh
- *
- * \brief Dilation filtering of an image with arbitrary s.e.
- *
- * \todo Add fastest versions.
- */
+/// \file mln/morpho/dilation_fast.hh
+///
+/// Dilation filtering of an image with arbitrary s.e.
+///
+/// \todo Add fastest versions.
# include <mln/core/concept/image.hh>
# include <mln/core/window.hh>
@@ -52,9 +52,9 @@ namespace mln
namespace morpho
{
- /*! Compute in \p output the dilation filter of image \p input by
- * the window \p win.
- *
+ /// Compute in \p output the dilation filter of image \p input by
+ /// the window \p win.
+ /*!
* \param[in] input The image to be filtered.
* \param[in] win The window.
* \param[out] output The output image.
@@ -79,7 +79,7 @@ namespace mln
template <typename I, typename W, typename O>
struct dilation_fast_t
- {
+ {
typedef mln_psite(I) P;
typedef mln_dpsite(I) D;
@@ -186,7 +186,7 @@ namespace mln
Image<O>& output)
{
mln_assertion(exact(output).domain() == exact(input).domain());
- impl::dilation_fast_(exact(input), exact(win), exact(output));
+ impl::dilation_fast_(exact(input), exact(win), exact(output));
}
# endif // ! MLN_INCLUDE_ONLY
diff --git a/milena/mln/morpho/hit_or_miss.hh b/milena/mln/morpho/hit_or_miss.hh
index 3d0bf29..38bb1d5 100644
--- a/milena/mln/morpho/hit_or_miss.hh
+++ b/milena/mln/morpho/hit_or_miss.hh
@@ -1,4 +1,5 @@
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,12 +29,11 @@
#ifndef MLN_MORPHO_HIT_OR_MISS_HH
# define MLN_MORPHO_HIT_OR_MISS_HH
-/*! \file mln/morpho/hit_or_miss.hh
- *
- * \brief Morphological hit-or-miss.
- *
- * \todo Save memory.
- */
+/// \file mln/morpho/hit_or_miss.hh
+///
+/// Morphological hit-or-miss.
+///
+/// \todo Save memory.
# include <mln/morpho/includes.hh>
# include <mln/pw/all.hh>
@@ -49,12 +49,12 @@ namespace mln
{
- bool constrained_hit_or_miss = true;
+ extern bool constrained_hit_or_miss;
- /*! Morphological hit-or-miss.
- *
- * This operator is HMT_(Bh,Bm) = e_Bh /\ (e_Bm o C).
+ /// Morphological hit-or-miss.
+ /*!
+ * This operator is HMT_(Bh,Bm) = e_Bh /\ (e_Bm o C).
*/
template <typename I, typename Wh, typename Wm>
mln_concrete(I)
@@ -62,8 +62,8 @@ namespace mln
const Window<Wh>& win_hit, const Window<Wm>& win_miss);
- /*! Morphological hit-or-miss opening.
- *
+ /// Morphological hit-or-miss opening.
+ /*!
* This operator is HMTope_(Bh,Bm) = d_(-Bh) o HMT_(Bh,Bm).
*/
template <typename I, typename Wh, typename Wm>
@@ -72,8 +72,8 @@ namespace mln
const Window<Wh>& win_hit, const Window<Wm>& win_miss);
- /*! Morphological hit-or-miss opening of the background.
- *
+ /// Morphological hit-or-miss opening of the background.
+ /*!
* This operator is HMTopeBG = HMTope_(Bm,Bh) o C = d_(-Bm) o HMT_(Bh,Bm).
*/
template <typename I, typename Wh, typename Wm>
@@ -82,8 +82,8 @@ namespace mln
const Window<Wh>& win_hit, const Window<Wm>& win_miss);
- /*! Morphological hit-or-miss closing.
- *
+ /// Morphological hit-or-miss closing.
+ /*!
* This operator is C o HMTope o C.
*/
template <typename I, typename Wh, typename Wm>
@@ -92,8 +92,8 @@ namespace mln
const Window<Wh>& win_hit, const Window<Wm>& win_miss);
- /*! Morphological hit-or-miss closing of the background.
- *
+ /// Morphological hit-or-miss closing of the background.
+ /*!
* This operator is C o HMTopeBG o C.
*/
template <typename I, typename Wh, typename Wm>
@@ -105,6 +105,7 @@ namespace mln
# ifndef MLN_INCLUDE_ONLY
+ bool constrained_hit_or_miss = true;
namespace internal
{
diff --git a/milena/mln/trait/image/print.hh b/milena/mln/trait/image/print.hh
index 16d8de4..baef596 100644
--- a/milena/mln/trait/image/print.hh
+++ b/milena/mln/trait/image/print.hh
@@ -1,4 +1,5 @@
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,10 +29,9 @@
#ifndef MLN_TRAIT_IMAGE_PRINT_HH
# define MLN_TRAIT_IMAGE_PRINT_HH
-/*! \file mln/trait/image/print.hh
- *
- * \brief Print the collection of traits for an image type.
- */
+/// \file mln/trait/image/print.hh
+///
+/// Print the collection of traits for an image type.
# include <iostream>
# include <mln/trait/images.hh>
diff --git a/milena/mln/trait/op/ord.hh b/milena/mln/trait/op/ord.hh
index 0a4fa11..c1b49ee 100644
--- a/milena/mln/trait/op/ord.hh
+++ b/milena/mln/trait/op/ord.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,10 +28,9 @@
#ifndef MLN_TRAIT_OP_ORD_HH
# define MLN_TRAIT_OP_ORD_HH
-/*! \file mln/trait/op/ord.hh
- *
- * \brief Declaration of an ordering operator trait.
- */
+/// \file mln/trait/op/ord.hh
+///
+/// Declaration of an ordering operator trait.
# include <mln/trait/op/decl.hh>
@@ -62,7 +61,6 @@ namespace mln
};
} // end of namespace mln::trait::op
-
template <template <class> class Category, typename T>
@@ -77,14 +75,14 @@ namespace mln
namespace internal
{
-
+
template <typename T>
struct ord_less
{
bool strict(const T& lhs, const T& rhs) const;
bool weak(const T& lhs, const T& rhs) const;
};
-
+
template <typename T>
struct ord_vec
{
diff --git a/milena/mln/value/float01.hh b/milena/mln/value/float01.hh
index 3bb78ab..f5348b0 100644
--- a/milena/mln/value/float01.hh
+++ b/milena/mln/value/float01.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2006, 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2006, 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,10 +29,9 @@
#ifndef MLN_VALUE_FLOAT01_HH
# define MLN_VALUE_FLOAT01_HH
-/*! \file mln/value/float01.hh
- *
- * \brief Define a generic class for float.
- */
+/// \file mln/value/float01.hh
+///
+/// Define a generic class for float.
# include <iostream>
# include <utility>
@@ -151,7 +151,7 @@ namespace mln
// Float01.
-
+ inline
float01::float01()
: nbits_(0) // FIXME: Cost at run-time...
{
diff --git a/milena/tests/Makefile.am b/milena/tests/Makefile.am
index d311f76..b60fcd8 100644
--- a/milena/tests/Makefile.am
+++ b/milena/tests/Makefile.am
@@ -47,9 +47,11 @@ SUBDIRS = \
check_PROGRAMS = \
all_headers \
- essential_headers
+ essential_headers \
+ global_vars
all_headers_SOURCES = all_headers.cc
essential_headers_SOURCES = essential_headers.cc
+global_vars_SOURCES = global_vars1.cc global_vars2.cc
TESTS = $(check_PROGRAMS)
diff --git a/milena/tests/border/find_full.cc b/milena/tests/border/find_full.cc
index 890a005..74f8df5 100644
--- a/milena/tests/border/find_full.cc
+++ b/milena/tests/border/find_full.cc
@@ -1,4 +1,5 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -25,10 +26,9 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/border/find_full.cc
- *
- * \brief Tests on mln::border::find.
- */
+/// \file tests/border/find_full.cc
+///
+/// Tests on mln::border::find.
#include <mln/core/image/image1d.hh>
#include <mln/core/image/image2d.hh>
@@ -98,7 +98,7 @@ int main()
f_box1d_t f_b1(b1);
f_box2d_t f_b2(b2);
f_box3d_t f_b3(b3);
- mln::fun::p2b::chess_t c_b;
+ mln::fun::p2b::chess c_b;
{
typedef image1d<int> I;
@@ -129,7 +129,7 @@ int main()
image_if<I, f_box2d_t > imaif(ima, f_b2);
mln_assertion(border::find(imaif) == 42);
- image_if<I, fun::p2b::chess_t > imaif_chess(ima, c_b);
+ image_if<I, fun::p2b::chess > imaif_chess(ima, c_b);
mln_assertion(border::find(imaif_chess) == 42);
diff --git a/milena/tests/border/get.cc b/milena/tests/border/get.cc
index df9fae2..88d552a 100644
--- a/milena/tests/border/get.cc
+++ b/milena/tests/border/get.cc
@@ -1,4 +1,5 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -25,10 +26,9 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/border/get.cc
- *
- * \brief Tests on mln::border::get.
- */
+/// \file tests/border/get.cc
+///
+/// Tests on mln::border::get.
#include <mln/core/image/image2d.hh>
#include <mln/core/image/sub_image.hh>
@@ -75,7 +75,7 @@ int main()
image_if<I, f_box2d_t> imaif(ima, f_b);
mln_assertion( imaif.has (point2d(2,2)) == false &&
- imaif.has(point2d(2,2)) == true );
+ ima.has(point2d(2,2)) == true );
mln_assertion(border::get(imaif) == 51);
mln_assertion(border::get( (ima | b) | f_b ) == 0);
diff --git a/milena/tests/border/get_full.cc b/milena/tests/border/get_full.cc
index b67f25e..ef68eeb 100644
--- a/milena/tests/border/get_full.cc
+++ b/milena/tests/border/get_full.cc
@@ -1,4 +1,5 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -25,10 +26,9 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/border/get_full.cc
- *
- * \brief Tests on mln::border::get.
- */
+/// \file tests/border/get_full.cc
+///
+/// Tests on mln::border::get.
#include <mln/core/image/image2d.hh>
#include <mln/core/image/sub_image.hh>
@@ -62,7 +62,7 @@ int main()
box2d b(literal::origin, point2d(1,1));
f_box2d_t f_b(b);
- mln::fun::p2b::chess_t c_b;
+ mln::fun::p2b::chess c_b;
{
typedef image2d<int> I;
@@ -90,7 +90,7 @@ int main()
sub_image<I, box2d> sub(ima, b);
mln_assertion(border::get(sub) == 0);
- image_if<I, mln::fun::p2b::chess_t > imaif(ima, c_b);
+ image_if<I, mln::fun::p2b::chess > imaif(ima, c_b);
mln_assertion(border::get(imaif) == 42);
mln_assertion(border::get( (ima | b) ) == 0);
mln_assertion(border::get( (ima | b) | c_b ) == 0);
@@ -106,7 +106,7 @@ int main()
sub_image<I, box2d> sub(ima, b);
mln_assertion(border::get(sub) == 0);
- image_if<I, mln::fun::p2b::chess_t > imaif(ima, c_b);
+ image_if<I, mln::fun::p2b::chess > imaif(ima, c_b);
mln_assertion(border::get(imaif) == 36);
mln_assertion(border::get( (ima | b) ) == 0);
mln_assertion(border::get( (ima | b) | c_b ) == 0);
diff --git a/milena/tests/border/resize_image_if.cc b/milena/tests/border/resize_image_if.cc
index 7ca70a7..5b738d3 100644
--- a/milena/tests/border/resize_image_if.cc
+++ b/milena/tests/border/resize_image_if.cc
@@ -1,4 +1,5 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -25,10 +26,9 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/border/resize_image_if.cc
- *
- * \brief Tests on mln::border::resize.
- */
+/// \file tests/border/resize_image_if.cc
+///
+/// Tests on mln::border::resize.
#include <mln/core/image/image2d.hh>
#include <mln/core/image/sub_image.hh>
@@ -70,8 +70,8 @@ int main()
my_box2d f_b(b);
image_if<I, my_box2d> imaif(ima, f_b);
- mln_assertion( imaif.has (point2d(2,2)) == false &&
- imaif.has(point2d(2,2)) == true );
+ mln_assertion( imaif.has(point2d(2,2)) == false &&
+ ima.has(point2d(2,2)) == true );
mln_assertion(border::get(imaif) == border);
diff --git a/milena/tests/convert/to_image.cc b/milena/tests/convert/to_image.cc
index 4d21afd..7517c36 100644
--- a/milena/tests/convert/to_image.cc
+++ b/milena/tests/convert/to_image.cc
@@ -53,7 +53,7 @@ int main()
0, 1, 0, // < center point
1, 0, 1 };
- image2d<bool> ima_X = convert::to_image(box_3x3 | fun::p2b::chess, 0);
+ image2d<bool> ima_X = convert::to_image(box_3x3 | fun::p2b::chess(), 0);
window2d win_X = convert::to<window2d>(X);
mln_assertion(convert::to_image(win_X) == ima_X);
}
diff --git a/milena/tests/core/image/cast_image.cc b/milena/tests/core/image/cast_image.cc
index afce74f..6090492 100644
--- a/milena/tests/core/image/cast_image.cc
+++ b/milena/tests/core/image/cast_image.cc
@@ -1,4 +1,5 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -25,10 +26,9 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/core/image/cast_image.cc
- *
- * \brief Tests on mln::cast_image.
- */
+/// \file tests/core/image/cast_image.cc
+///
+/// Tests on mln::cast_image.
#include <mln/core/image/image2d.hh>
#include <mln/fun/p2b/chess.hh>
@@ -42,7 +42,7 @@ int main()
using namespace mln;
image2d<bool> ima(8, 8);
- level::fill(ima, fun::p2b::chess);
+ level::fill(ima, fun::p2b::chess());
debug::println(ima);
debug::println( cast_image<int>(ima) );
}
diff --git a/milena/tests/core/image/image_if.cc b/milena/tests/core/image/image_if.cc
index 4351a25..f646191 100644
--- a/milena/tests/core/image/image_if.cc
+++ b/milena/tests/core/image/image_if.cc
@@ -1,4 +1,5 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -25,10 +26,9 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/core/image/image_if.cc
- *
- * \brief Tests on mln::image_if.
- */
+/// \file tests/core/image/image_if.cc
+///
+/// Tests on mln::image_if.
#include <mln/core/image/image2d.hh>
#include <mln/core/image/image_if.hh>
@@ -42,13 +42,13 @@ int main()
typedef image2d<int> I;
I ima(8, 8);
- // debug::println(ima | fun::p2b::chess);
+ // debug::println(ima | fun::p2b::chess());
// FIXME: is this line corret?
- ///mln_assertion((ima | fun::p2b::chess).nsites() == 32);
+ ///mln_assertion((ima | fun::p2b::chess()).nsites() == 32);
{
- typedef image_if<I, fun::p2b::chess_t> II;
- II ima_ref = ima | fun::p2b::chess;
+ typedef image_if<I, fun::p2b::chess> II;
+ II ima_ref = ima | fun::p2b::chess();
debug::println(ima_ref);
{
II ima_ref_;
diff --git a/milena/tests/core/site_set/pset_if.cc b/milena/tests/core/site_set/pset_if.cc
index 9918f56..1319848 100644
--- a/milena/tests/core/site_set/pset_if.cc
+++ b/milena/tests/core/site_set/pset_if.cc
@@ -1,4 +1,5 @@
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -25,10 +26,9 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/core/site_set/pset_if.cc
- *
- * \brief Tests on mln::p_if.
- */
+/// \file tests/core/site_set/pset_if.cc
+///
+/// Tests on mln::p_if.
#include <mln/core/image/image2d.hh>
#include <mln/core/site_set/p_set.hh>
@@ -44,10 +44,10 @@ int main()
using namespace mln;
box2d box_8x8 = make::box2d(8, 8);
- mln_assertion(geom::nsites((box_8x8 | fun::p2b::chess)) == 32);
+ mln_assertion(geom::nsites((box_8x8 | fun::p2b::chess())) == 32);
{
- p_set<point2d> s = convert::to_p_set(box_8x8 | fun::p2b::chess);
- mln_precondition(s == (box_8x8 | fun::p2b::chess));
+ p_set<point2d> s = convert::to_p_set(box_8x8 | fun::p2b::chess());
+ mln_precondition(s == (box_8x8 | fun::p2b::chess()));
}
}
diff --git a/milena/tests/global_vars1.cc b/milena/tests/global_vars1.cc
new file mode 100644
index 0000000..f41407d
--- /dev/null
+++ b/milena/tests/global_vars1.cc
@@ -0,0 +1,101 @@
+// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License. This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+/// \file tests/global_vars1.cc
+///
+/// Tests proper global variable declarations
+
+#include <mln/util/all.hh>
+#include <mln/fun/p2v/all.hh>
+#include <mln/fun/x2x/all.hh>
+#include <mln/fun/v2v/all.hh>
+#include <mln/fun/i2v/all.hh>
+#include <mln/fun/all.hh>
+#include <mln/fun/x2v/all.hh>
+#include <mln/fun/p2b/all.hh>
+#include <mln/extension/all.hh>
+#include <mln/histo/all.hh>
+#include <mln/trait/op/all.hh>
+#include <mln/trait/all.hh>
+#include <mln/trait/value/all.hh>
+#include <mln/win/all.hh>
+#include <mln/core/routine/all.hh>
+#include <mln/core/trait/all.hh>
+#include <mln/core/def/all.hh>
+#include <mln/core/internal/check/image_all.hh>
+#include <mln/core/image/all.hh>
+#include <mln/core/site_set/all.hh>
+#include <mln/io/pbm/all.hh>
+#include <mln/io/pfm/all.hh>
+#include <mln/io/pgm/all.hh>
+#include <mln/io/all.hh>
+#include <mln/io/fits/all.hh>
+#include <mln/io/pnm/all.hh>
+#include <mln/io/ppm/all.hh>
+#include <mln/make/all.hh>
+#include <mln/canvas/morpho/all.hh>
+#include <mln/canvas/all.hh>
+#include <mln/canvas/browsing/all.hh>
+#include <mln/estim/all.hh>
+#include <mln/arith/all.hh>
+#include <mln/display/all.hh>
+#include <mln/test/all.hh>
+#include <mln/border/all.hh>
+#include <mln/trace/all.hh>
+#include <mln/debug/all.hh>
+#include <mln/morpho/elementary/all.hh>
+#include <mln/morpho/all.hh>
+#include <mln/accu/all.hh>
+#include <mln/pw/all.hh>
+#include <mln/linear/all.hh>
+#include <mln/metal/all.hh>
+#include <mln/metal/math/all.hh>
+#include <mln/set/all.hh>
+#include <mln/convert/impl/all.hh>
+#include <mln/convert/all.hh>
+#include <mln/geom/all.hh>
+#include <mln/literal/all.hh>
+#include <mln/level/approx/all.hh>
+#include <mln/level/all.hh>
+#include <mln/level/naive/all.hh>
+#include <mln/math/all.hh>
+#include <mln/norm/all.hh>
+#include <mln/logical/all.hh>
+#include <mln/draw/all.hh>
+#include <mln/value/builtin/all.hh>
+#include <mln/value/all.hh>
+#include <mln/value/internal/all.hh>
+#include <mln/value/concept/all.hh>
+#include <mln/tag/all.hh>
+#include <mln/labeling/all.hh>
+
+int f1();
+
+int main ()
+{
+ f1();
+}
diff --git a/milena/tests/global_vars2.cc b/milena/tests/global_vars2.cc
new file mode 100644
index 0000000..a3b93a6
--- /dev/null
+++ b/milena/tests/global_vars2.cc
@@ -0,0 +1,101 @@
+// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License. This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+/// \file tests/global_vars2.cc
+///
+/// Tests proper global variable declarations
+
+# define MLN_INCLUDE_ONLY
+
+#include <mln/util/all.hh>
+#include <mln/fun/p2v/all.hh>
+#include <mln/fun/x2x/all.hh>
+#include <mln/fun/v2v/all.hh>
+#include <mln/fun/i2v/all.hh>
+#include <mln/fun/all.hh>
+#include <mln/fun/x2v/all.hh>
+#include <mln/fun/p2b/all.hh>
+#include <mln/extension/all.hh>
+#include <mln/histo/all.hh>
+#include <mln/trait/op/all.hh>
+#include <mln/trait/all.hh>
+#include <mln/trait/value/all.hh>
+#include <mln/win/all.hh>
+#include <mln/core/routine/all.hh>
+#include <mln/core/trait/all.hh>
+#include <mln/core/def/all.hh>
+#include <mln/core/internal/check/image_all.hh>
+#include <mln/core/image/all.hh>
+#include <mln/core/site_set/all.hh>
+#include <mln/io/pbm/all.hh>
+#include <mln/io/pfm/all.hh>
+#include <mln/io/pgm/all.hh>
+#include <mln/io/all.hh>
+#include <mln/io/fits/all.hh>
+#include <mln/io/pnm/all.hh>
+#include <mln/io/ppm/all.hh>
+#include <mln/make/all.hh>
+#include <mln/canvas/morpho/all.hh>
+#include <mln/canvas/all.hh>
+#include <mln/canvas/browsing/all.hh>
+#include <mln/estim/all.hh>
+#include <mln/arith/all.hh>
+#include <mln/display/all.hh>
+#include <mln/test/all.hh>
+#include <mln/border/all.hh>
+#include <mln/trace/all.hh>
+#include <mln/debug/all.hh>
+#include <mln/morpho/elementary/all.hh>
+#include <mln/morpho/all.hh>
+#include <mln/accu/all.hh>
+#include <mln/pw/all.hh>
+#include <mln/linear/all.hh>
+#include <mln/metal/all.hh>
+#include <mln/metal/math/all.hh>
+#include <mln/set/all.hh>
+#include <mln/convert/impl/all.hh>
+#include <mln/convert/all.hh>
+#include <mln/geom/all.hh>
+#include <mln/literal/all.hh>
+#include <mln/level/approx/all.hh>
+#include <mln/level/all.hh>
+#include <mln/level/naive/all.hh>
+#include <mln/math/all.hh>
+#include <mln/norm/all.hh>
+#include <mln/logical/all.hh>
+#include <mln/draw/all.hh>
+#include <mln/value/builtin/all.hh>
+#include <mln/value/all.hh>
+#include <mln/value/internal/all.hh>
+#include <mln/value/concept/all.hh>
+#include <mln/tag/all.hh>
+#include <mln/labeling/all.hh>
+
+int f1 ()
+{
+ return 0;
+}
diff --git a/milena/tests/level/fill_with_image.cc b/milena/tests/level/fill_with_image.cc
index 2c6edf8..4b921d0 100644
--- a/milena/tests/level/fill_with_image.cc
+++ b/milena/tests/level/fill_with_image.cc
@@ -1,4 +1,5 @@
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -25,10 +26,9 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/level/fill_with_value.cc
- *
- * \brief Tests on mln::level::fill_with_value
- */
+/// \file tests/level/fill_with_value.cc
+///
+/// Tests on mln::level::fill_with_value
#include <mln/level/fill_with_value.hh>
#include <mln/level/fill_with_image.hh>
@@ -96,14 +96,14 @@ int main()
{
typedef image2d<unsigned char> I;
- typedef image_if<I, fun::p2b::chess_t> II;
+ typedef image_if<I, fun::p2b::chess> II;
I ima(size, size);
I ima2(size, size);
level::fill_with_value(ima, 51);
level::fill_with_value(ima2, 42);
- II ima_if = ima | fun::p2b::chess;
+ II ima_if = ima | fun::p2b::chess();
level::fill_with_image(ima_if, ima2);
II::piter p(ima_if.domain());
@@ -145,7 +145,7 @@ int main()
// pw image test
{
- const pw::image<fun::p2v::iota_t, box2d> ima(fun::p2v::iota,
+ const pw::image<fun::p2v::iota, box2d> ima(fun::p2v::iota(),
make::box2d(-2,-2, 15,15));
image2d<short unsigned int> out(8, 8);
@@ -167,11 +167,11 @@ int main()
// image if test
{
typedef image2d<unsigned short> I;
- typedef image_if<I, fun::p2b::chess_t> II;
+ typedef image_if<I, fun::p2b::chess> II;
I ima(size, size);
I out(size, size);
- II ima_if = ima | fun::p2b::chess;
+ II ima_if = ima | fun::p2b::chess();
level::fill_with_value(ima, 42);
level::fill_with_value(out, 0);
diff --git a/milena/tests/level/fill_with_value.cc b/milena/tests/level/fill_with_value.cc
index 5f8adb2..fa2eb55 100644
--- a/milena/tests/level/fill_with_value.cc
+++ b/milena/tests/level/fill_with_value.cc
@@ -1,4 +1,5 @@
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -25,10 +26,9 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/level/fill_with_value.cc
- *
- * \brief Tests on mln::level::fill_with_value
- */
+/// \file tests/level/fill_with_value.cc
+///
+/// Tests on mln::level::fill_with_value
#include <mln/level/fill_with_value.hh>
@@ -91,12 +91,12 @@ int main()
{
typedef image2d<unsigned char> I;
- typedef image_if<I, fun::p2b::chess_t> II;
+ typedef image_if<I, fun::p2b::chess> II;
I ima(size, size);
level::fill_with_value(ima, 51);
- II ima_if = ima | fun::p2b::chess;
+ II ima_if = ima | fun::p2b::chess();
level::fill_with_value(ima_if, 42);
II::piter p(ima_if.domain());
diff --git a/milena/tests/level/paste.cc b/milena/tests/level/paste.cc
index e748602..42f0ce6 100644
--- a/milena/tests/level/paste.cc
+++ b/milena/tests/level/paste.cc
@@ -1,4 +1,5 @@
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -25,10 +26,9 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/level/paste.cc
- *
- * \brief Tests on mln::level::paste.
- */
+/// \file tests/level/paste.cc
+///
+/// Tests on mln::level::paste.
#include <mln/core/image/image1d.hh>
#include <mln/core/image/image2d.hh>
@@ -109,7 +109,7 @@ int main()
/// pw image test
{
- const pw::image<fun::p2v::iota_t, box2d> ima(fun::p2v::iota,
+ const pw::image<fun::p2v::iota, box2d> ima(fun::p2v::iota(),
make::box2d(2,2, 5,5));
image2d<short unsigned int> out(8, 8);
@@ -131,11 +131,11 @@ int main()
// image if test
{
typedef image2d<unsigned short> I;
- typedef image_if<I, fun::p2b::chess_t> II;
+ typedef image_if<I, fun::p2b::chess> II;
I ima(size, size);
I out(size, size);
- II ima_if = ima | fun::p2b::chess;
+ II ima_if = ima | fun::p2b::chess();
level::fill_with_value(ima, 0);
debug::iota(ima);
diff --git a/milena/tests/level/transform.cc b/milena/tests/level/transform.cc
index e0b8ec9..c0d550b 100644
--- a/milena/tests/level/transform.cc
+++ b/milena/tests/level/transform.cc
@@ -25,10 +25,9 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/level/transform.cc
- *
- * \brief Tests on mln::level::transform
- */
+/// \file tests/level/transform.cc
+///
+/// Tests on mln::level::transform
#include <cmath>
@@ -123,7 +122,7 @@ int main()
/// pw image test
{
- const pw::image<fun::p2v::iota_t, box2d> ima(fun::p2v::iota,
+ const pw::image<fun::p2v::iota, box2d> ima(fun::p2v::iota(),
make::box2d(2,2, 5,5));
image2d<short unsigned int> out(8, 8);
@@ -147,11 +146,11 @@ int main()
// image if test
{
typedef image2d<unsigned short> I;
- typedef image_if<I, fun::p2b::chess_t> II;
+ typedef image_if<I, fun::p2b::chess> II;
I ima(size, size);
I out(size, size);
- II ima_if = ima | fun::p2b::chess;
+ II ima_if = ima | fun::p2b::chess();
level::fill_with_value(ima, 0);
debug::iota(ima);
diff --git a/milena/tests/pw/image.cc b/milena/tests/pw/image.cc
index dbddce9..cbd07cd 100644
--- a/milena/tests/pw/image.cc
+++ b/milena/tests/pw/image.cc
@@ -1,4 +1,5 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -25,20 +26,30 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/pw/image.cc
- *
- * \brief Tests on mln::pw::image.
- */
+/// \file tests/pw/image.cc
+///
+/// Tests on mln::pw::image.
#include <mln/fun/p2b/chess.hh>
#include <mln/core/alias/box2d.hh>
#include <mln/pw/image.hh>
-#include <mln/debug/println.hh>
+#include <mln/core/var.hh>
int main()
{
using namespace mln;
- debug::println( fun::p2b::chess | make::box2d(8, 8) );
+ mln_VAR(ima, fun::p2b::chess() | make::box2d(8, 8));
+ mln_piter_(ima_t) p(ima.domain());
+ unsigned i = 0;
+ for_all(p)
+ {
+ if (p.row() % 2)
+ mln_assertion(ima(p) == (p.col() % 2));
+ else
+ mln_assertion(ima(p) == !(p.col() % 2));
+ ++i;
+ }
+ mln_assertion(i == 64);
}
diff --git a/milena/tests/trait/image/images.cc b/milena/tests/trait/image/images.cc
index a596440..51dd710 100644
--- a/milena/tests/trait/image/images.cc
+++ b/milena/tests/trait/image/images.cc
@@ -1,4 +1,5 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -25,10 +26,9 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/trait/image/images.cc
- *
- * \brief Tests on mln::trait::images.
- */
+/// \file tests/trait/image/images.cc
+///
+/// \brief Tests on mln::trait::images.
#include <mln/core/image/image2d.hh>
@@ -53,10 +53,10 @@ int main()
std::cout << std::endl
<< "image_if< image2d >: ";
- mln::trait::image::print< image_if<I, fun::p2b::chess_t> >(std::cout);
+ mln::trait::image::print< image_if<I, fun::p2b::chess> >(std::cout);
std::cout << std::endl
<< "image_if< sub_image< image2d > >: ";
- mln::trait::image::print< image_if<Isub, fun::p2b::chess_t> >(std::cout);
+ mln::trait::image::print< image_if<Isub, fun::p2b::chess> >(std::cout);
}
--
1.5.6.5
1
0
13 Nov '08
https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena
Index: ChangeLog
from Nicolas Ballas <ballas(a)lrde.epita.fr>
Temporary fix in complex_image properties.
* doc/tutorial/design/include/imagetours.tex: Update documentation.
* mln/core/image/complex_image.hh: Fix properties.
doc/tutorial/design/include/imagetours.tex | 8 ++++----
mln/core/image/complex_image.hh | 8 +++++---
2 files changed, 9 insertions(+), 7 deletions(-)
Index: doc/tutorial/design/include/imagetours.tex
--- doc/tutorial/design/include/imagetours.tex (revision 2863)
+++ doc/tutorial/design/include/imagetours.tex (working copy)
@@ -39,7 +39,7 @@
%%However, the $site$ concept allows Milena to deal with complicated image type
%%(for instance see the \verb+graph_image+ type).
-An image is composed by a set of localized objects ($sites$): the definition domain of the image.
+An image is composed by a set of localized objects ($sites$), the definition domain of the image.
A value is associated to each site of the image. This is the destination domain
of the image.
To access to a value localized at the site p in an image named $ima$, we
@@ -75,10 +75,10 @@
%% Primary image definition
-Primary images are a major category of Milena image type.
+Primary images are a major category of the Milena image types.
Primary images are not based on another image type.
They are sufficient to define themselves.
-Thus, a primary image types directly holds in memory its data (values).
+Thus, a primary image types directly holds its data (values) in memory.
\begin{itemize}
@@ -145,7 +145,7 @@
will be transformed).
Since, it extends an image, an image morpher is also an image type.
-The Milena library provide different kinds of morphers.
+The Milena library provides different kinds of morphers.
Domain morphers only modify the domain (the set of points/sites composing the image) of the input image.
Value morphers only change the input image values (cast the values into another
type\ldots{})
Index: mln/core/image/complex_image.hh
--- mln/core/image/complex_image.hh (revision 2863)
+++ mln/core/image/complex_image.hh (working copy)
@@ -85,9 +85,11 @@
// Value.
typedef trait::image::value_access::direct value_access;
- // FIXME: Is that right?
- typedef trait::image::vw_io::read_write vw_io;
- typedef trait::image::vw_set::multi vw_set;
+ // FIXME: This image is value wise read_write, and provides
+ // an access to its values throught a multi-set,
+ // but we need to add the corresponding interface in the class.
+ typedef trait::image::vw_io::none vw_io;
+ typedef trait::image::vw_set::none vw_set;
typedef trait::image::value_storage::disrupted value_storage;
typedef trait::image::value_browsing::site_wise_only value_browsing;
typedef trait::image::value_alignement::irrelevant value_alignement;
1
0