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
November 2007
- 9 participants
- 147 discussions
milena r1494: Add tracing for level algorithm and split specialization of level::transform
by Guillaume Duhamel 16 Nov '07
by Guillaume Duhamel 16 Nov '07
16 Nov '07
URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena
ChangeLog:
2007-11-16 Guillaume Duhamel <guillaume.duhamel(a)lrde.epita.fr>
Add tracing for level algorithm and split specialization of level::transform.
* mln/level/compute.hh,
* mln/level/fill.hh,
* mln/level/median.hh,
* mln/level/paste.hh,
* mln/level/saturate.hh,
* mln/level/stretch.hh,
* mln/level/to_enc.hh,
* mln/level/was.median.hh: Add tracing for algorithm.
* mln/level/transform.hh: Remove specialization.
* mln/level/transform.spe.hh: New file for specialization for
transform.
---
compute.hh | 4 +
median.hh | 6 ++
saturate.hh | 12 +++++
stretch.hh | 8 +++
to_enc.hh | 4 +
transform.hh | 63 ++++++++++------------------
transform.spe.hh | 121 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
7 files changed, 178 insertions(+), 40 deletions(-)
Index: trunk/milena/mln/level/was.median.hh
===================================================================
Index: trunk/milena/mln/level/fill.hh
===================================================================
Index: trunk/milena/mln/level/saturate.hh
===================================================================
--- trunk/milena/mln/level/saturate.hh (revision 1493)
+++ trunk/milena/mln/level/saturate.hh (revision 1494)
@@ -87,9 +87,13 @@
template <typename I, typename O>
void saturate(const Image<I>& input, Image<O>& output)
{
+ trace::entering("level::saturate");
+
mln_precondition(exact(input).domain() == exact(output).domain());
fun::v2v::saturate<mln_value(O)> f;
level::transform(input, f, output);
+
+ trace::exiting("level::saturate");
}
template <typename I, typename O>
@@ -97,18 +101,26 @@
const mln_value(O)& min, const mln_value(O)& max,
Image<O>& output)
{
+ trace::entering("level::saturate");
+
mln_precondition(exact(input).domain() == exact(output).domain());
fun::v2v::saturate<mln_value(O)> f(min, max);
level::transform(input, f, output);
+
+ trace::exiting("level::saturate");
}
template <typename I>
void saturate_inplace(Image<I>& input,
const mln_value(I)& min, const mln_value(I)& max)
{
+ trace::entering("level::saturate_inplace");
+
mln_precondition(exact(input).has_data());
fun::v2v::saturate<mln_value(I)> f(min, max);
level::apply(input, f);
+
+ trace::exiting("level::saturate_inplace");
}
# endif // ! MLN_INCLUDE_ONLY
Index: trunk/milena/mln/level/median.hh
===================================================================
--- trunk/milena/mln/level/median.hh (revision 1493)
+++ trunk/milena/mln/level/median.hh (revision 1494)
@@ -261,7 +261,7 @@
{
median_dir(input, i, win.length(), output); // FIXME: Make 1 explicit!
}
-# endif
+# endif // ! MLN_CORE_WIN_LINE_HH
} // end of namespace mln::level::impl
@@ -273,8 +273,12 @@
void median(const Image<I>& input, const Window<W>& win,
Image<O>& output)
{
+ trace::entering("level::median");
+
mln_assertion(exact(output).domain() == exact(input).domain());
impl::median_(exact(input), exact(win), exact(output));
+
+ trace::exiting("level::median");
}
template <typename I, typename O>
Index: trunk/milena/mln/level/transform.spe.hh
===================================================================
--- trunk/milena/mln/level/transform.spe.hh (revision 0)
+++ trunk/milena/mln/level/transform.spe.hh (revision 1494)
@@ -0,0 +1,121 @@
+// Copyright (C) 2007 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
+// 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_LEVEL_TRANSFORM_SPE_HH
+# define MLN_LEVEL_TRANSFORM_SPE_HH
+
+/*! \file mln/level/transform.spe.hh
+ *
+ * \brief Specializations for mln::level::transform.
+ *
+ */
+
+# include <mln/core/concept/image.hh>
+# include <mln/core/concept/function.hh>
+
+# include <mln/value/set.hh>
+# include <mln/value/lut_vec.hh>
+
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+namespace mln
+{
+
+ namespace level
+ {
+
+
+ namespace impl
+ {
+
+
+ namespace generic
+ {
+ template <typename I, typename F, typename O>
+ void transform_(const Image<I>& input_, const Function_v2v<F>& f_, Image<O>& output_);
+ }
+
+ template <typename I, typename F, typename O>
+ void transform_(metal::false_, // general case
+ const Image<I>& input_, const Function_v2v<F>& f_, Image<O>& output_)
+ {
+ generic::transform_(input_, f_, output_);
+ }
+
+
+ template <typename I, typename F, typename O>
+ void transform_(metal::true_, // low quantization
+ const Image<I>& input_, const Function_v2v<F>& f_, Image<O>& output_)
+ {
+ trace::entering("level::impl::transform");
+
+ const I& input = exact(input_);
+ const F& f = exact(f_);
+ O& output = exact(output_);
+
+ value::lut_vec<mln_vset(I), mln_result(F)> lut(input.values(), f);
+ mln_piter(I) p(input.domain());
+ for_all(p)
+ output(p) = lut(input(p));
+
+ trace::exiting("level::impl::transform");
+ }
+
+
+ // FIXME: Handle the cases of fastest images.
+
+// template <typename I, typename F, typename O>
+// void transform(metal::true_, // low quantization
+// const Image<I>& input_, const Function_v2v<F>& f_, Image<O>& output_)
+// {
+// const I& input = exact(input_);
+// const F& f = exact(f_);
+// O& output = exact(output_);
+
+// value::lut_vec<mln_vset(I), mln_result(F)> lut(input.values(), f);
+// mln_pixter(const I) pi(input); // FIXME
+// mln_pixter(O) po(output);
+// po.start();
+// for_all(pi)
+// {
+// po.val() = lut(pi.val());
+// po.next();
+// }
+// }
+
+ } // end of namespace mln::level::impl
+
+ } // end of namespace mln::level
+
+} // end of namespace mln
+
+# endif // ! MLN_INCLUDE_ONLY
+
+
+#endif // ! MLN_LEVEL_TRANSFORM_SPE_HH
Index: trunk/milena/mln/level/to_enc.hh
===================================================================
--- trunk/milena/mln/level/to_enc.hh (revision 1493)
+++ trunk/milena/mln/level/to_enc.hh (revision 1494)
@@ -60,8 +60,12 @@
template <typename I, typename O>
void to_enc(const Image<I>& input, Image<O>& output)
{
+ trace::entering("level::to_enc");
+
mln_precondition(exact(output).domain() == exact(input).domain());
level::transform(input, fun::v2v::enc< mln_value(I) >(), output);
+
+ trace::exiting("level::to_enc");
}
# endif // ! MLN_INCLUDE_ONLY
Index: trunk/milena/mln/level/transform.hh
===================================================================
--- trunk/milena/mln/level/transform.hh (revision 1493)
+++ trunk/milena/mln/level/transform.hh (revision 1494)
@@ -42,6 +42,10 @@
# include <mln/value/lut_vec.hh>
+// Specializations are in:
+# include <mln/level/transform.spe.hh>
+
+
namespace mln
{
@@ -74,65 +78,42 @@
namespace impl
{
- template <typename I, typename F, typename O>
- void transform(metal::false_, // general case
- const Image<I>& input_, const Function_v2v<F>& f_, Image<O>& output_)
+ namespace generic
{
- const I& input = exact(input_);
- const F& f = exact(f_);
- O& output = exact(output_);
-
- mln_piter(I) p(input.domain());
- for_all(p)
- output(p) = f( input(p) );
- }
-
template <typename I, typename F, typename O>
- void transform(metal::true_, // low quantization
- const Image<I>& input_, const Function_v2v<F>& f_, Image<O>& output_)
+ void transform_(const Image<I>& input_, const Function_v2v<F>& f_, Image<O>& output_)
{
+ trace::entering("level::impl::generic::transform");
+
const I& input = exact(input_);
const F& f = exact(f_);
O& output = exact(output_);
- value::lut_vec<mln_vset(I), mln_result(F)> lut(input.values(), f);
mln_piter(I) p(input.domain());
for_all(p)
- output(p) = lut(input(p));
- }
-
+ output(p) = f( input(p) );
- // FIXME: Handle the cases of fastest images.
+ trace::exiting("level::impl::generic::transform");
+ }
-// template <typename I, typename F, typename O>
-// void transform(metal::true_, // low quantization
-// const Image<I>& input_, const Function_v2v<F>& f_, Image<O>& output_)
-// {
-// const I& input = exact(input_);
-// const F& f = exact(f_);
-// O& output = exact(output_);
-
-// value::lut_vec<mln_vset(I), mln_result(F)> lut(input.values(), f);
-// mln_pixter(const I) pi(input); // FIXME
-// mln_pixter(O) po(output);
-// po.start();
-// for_all(pi)
-// {
-// po.val() = lut(pi.val());
-// po.next();
-// }
-// }
+ } // end of namespace mln::level::impl::generic
} // end of namespace mln::level::impl
+ // Facade.
+
template <typename I, typename F, typename O>
void transform(const Image<I>& input, const Function_v2v<F>& f, Image<O>& output)
{
+ trace::entering("level::transform");
+
mln_precondition(exact(output).domain() >= exact(input).domain());
- impl::transform(mln_is_value_lowq(I)(),
+ impl::transform_(mln_is_value_lowq(I)(),
exact(input), exact(f), exact(output));
+
+ trace::exiting("level::transform");
}
@@ -140,10 +121,14 @@
mln_ch_value(I, mln_result(F))
transform(const Image<I>& input, const Function_v2v<F>& f)
{
+ trace::entering("level::transform");
+
mln_precondition(exact(input).has_data());
mln_ch_value(I, mln_result(F)) output;
initialize(output, input);
- transform(input, f, output);
+ transform_(input, f, output);
+
+ trace::exiting("level::transform");
return output;
}
Index: trunk/milena/mln/level/paste.hh
===================================================================
Index: trunk/milena/mln/level/stretch.hh
===================================================================
--- trunk/milena/mln/level/stretch.hh (revision 1493)
+++ trunk/milena/mln/level/stretch.hh (revision 1494)
@@ -66,6 +66,8 @@
void stretch(value::int_u<n>,
const Image<I>& input, Image<O>& output)
{
+ trace::entering("level::impl::stretch");
+
mln_value(I) min_, max_;
estim::min_max(input, min_, max_);
if (max_ == min_)
@@ -78,6 +80,8 @@
float b = (m * max - M * min) / (max - min);
fun::v2v::linear<float, float, int> f(a, b);
level::transform(input, f, output);
+
+ trace::exiting("level::impl::stretch");
}
} // end of namespace mln::level::impl
@@ -86,8 +90,12 @@
template <typename I, typename O>
void stretch(const Image<I>& input, Image<O>& output)
{
+ trace::entering("level::stretch");
+
mln_precondition(exact(output).domain() == exact(input).domain());
impl::stretch(mln_value(O)(), input, output);
+
+ trace::exiting("level::stretch");
}
# endif // ! MLN_INCLUDE_ONLY
Index: trunk/milena/mln/level/compute.hh
===================================================================
--- trunk/milena/mln/level/compute.hh (revision 1493)
+++ trunk/milena/mln/level/compute.hh (revision 1494)
@@ -72,10 +72,14 @@
mln_result(A)
compute(const Image<I>& input, const Accumulator<A>& a_)
{
+ trace::entering("level::compute");
+
mln_precondition(exact(input).has_data());
A a = exact(a_); // Cpy.
a.init();
level::take(input, a);
+
+ trace::exiting("level::compute");
return a.to_result();
}
1
0
URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena
ChangeLog:
2007-11-16 Guillaume Duhamel <guillaume.duhamel(a)lrde.epita.fr>
Fix Makefile for level test.
* tests/Makefile.am: Add subdir level.
* tests/level/Makefile.am: Remove one test.
---
Makefile.am | 3 ++-
level/Makefile.am | 2 --
2 files changed, 2 insertions(+), 3 deletions(-)
Index: trunk/milena/tests/level/Makefile.am
===================================================================
--- trunk/milena/tests/level/Makefile.am (revision 1492)
+++ trunk/milena/tests/level/Makefile.am (revision 1493)
@@ -20,7 +20,6 @@
sort_points \
stretch \
take \
- to_enc \
transform
abs_SOURCES = abs.cc
@@ -40,7 +39,6 @@
sort_points_SOURCES = sort_points.cc
stretch_SOURCES = stretch.cc
take_SOURCES = take.cc
-to_enc_SOURCES = to_enc.cc
transform_SOURCES = transform.cc
TESTS = $(check_PROGRAMS)
Index: trunk/milena/tests/Makefile.am
===================================================================
--- trunk/milena/tests/Makefile.am (revision 1492)
+++ trunk/milena/tests/Makefile.am (revision 1493)
@@ -2,7 +2,8 @@
include $(top_srcdir)/milena/tests/tests.mk
-SUBDIRS = norm
+SUBDIRS = norm \
+ level
check_PROGRAMS = \
accu_all \
1
0
URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena
ChangeLog:
2007-11-16 Guillaume Duhamel <guillaume.duhamel(a)lrde.epita.fr>
Add Makefile.am for level test.
* tests/level/Makefile.am: New Makefile for level test.
---
Makefile.am | 46 ++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 46 insertions(+)
Index: trunk/milena/tests/level/Makefile.am
===================================================================
--- trunk/milena/tests/level/Makefile.am (revision 0)
+++ trunk/milena/tests/level/Makefile.am (revision 1492)
@@ -0,0 +1,46 @@
+## Process this file through Automake to create Makefile.in -*- Makefile -*-
+
+include $(top_srcdir)/milena/tests/tests.mk
+
+check_PROGRAMS = \
+ abs \
+ apply \
+ assign \
+ compare \
+ compute \
+ fill \
+ median \
+ median_dir \
+ median_fast \
+ median_hline2d \
+ memcpy_ \
+ memset_ \
+ paste \
+ saturate \
+ sort_points \
+ stretch \
+ take \
+ to_enc \
+ transform
+
+abs_SOURCES = abs.cc
+apply_SOURCES = apply.cc
+assign_SOURCES = assign.cc
+compare_SOURCES = compare.cc
+compute_SOURCES = compute.cc
+fill_SOURCES = fill.cc
+median_SOURCES = median.cc
+median_dir_SOURCES = median_dir.cc
+median_fast_SOURCES = median_fast.cc
+median_hline2d_SOURCES = median_hline2d.cc
+memcpy__SOURCES = memcpy_.cc
+memset__SOURCES = memset_.cc
+paste_SOURCES = paste.cc
+saturate_SOURCES = saturate.cc
+sort_points_SOURCES = sort_points.cc
+stretch_SOURCES = stretch.cc
+take_SOURCES = take.cc
+to_enc_SOURCES = to_enc.cc
+transform_SOURCES = transform.cc
+
+TESTS = $(check_PROGRAMS)
1
0
URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena
ChangeLog:
2007-11-16 Guillaume Duhamel <guillaume.duhamel(a)lrde.epita.fr>
Add simple tests for level.
* tests/level/compare.cc,
* tests/level/compute.cc,
* tests/level/saturate.cc,
* tests/level/sort_points.cc,
* tests/level/stretch.cc: New test for level.
* tests/level/median.cc,
* tests/level/paste.cc,
* tests/level/transform.cc: Upadate test.
---
compare.cc | 98 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
compute.cc | 53 ++++++++++++++++++++++++++++++
median.cc | 2 -
paste.cc | 6 ---
saturate.cc | 57 +++++++++++++++++++++++++++++++++
sort_points.cc | 61 +++++++++++++++++++++++++++++++++++
stretch.cc | 65 +++++++++++++++++++++++++++++++++++++
transform.cc | 12 +++++-
8 files changed, 345 insertions(+), 9 deletions(-)
Index: trunk/milena/tests/level/median.cc
===================================================================
--- trunk/milena/tests/level/median.cc (revision 1490)
+++ trunk/milena/tests/level/median.cc (revision 1491)
@@ -51,7 +51,7 @@
border::thickness = 52;
image2d<int_u8>
- lena = io::pgm::load("../img/lena.pgm"),
+ lena = io::pgm::load("../../img/lena.pgm"),
out(lena.domain());
level::median(lena, rect, out);
Index: trunk/milena/tests/level/transform.cc
===================================================================
--- trunk/milena/tests/level/transform.cc (revision 1490)
+++ trunk/milena/tests/level/transform.cc (revision 1491)
@@ -52,15 +52,23 @@
{
using namespace mln;
- const unsigned size = 10000;
+ const unsigned size = 1000;
image2d<unsigned short>
ima(size, size);
+ image2d<unsigned short>
+ out(size, size);
(std::cout << "iota... ").flush();
debug::iota(ima);
std::cout << "done" << std::endl;
(std::cout << "transform... ").flush();
- level::transform(ima, mysqrt(), ima);
+ level::transform(ima, mysqrt(), out);
+ std::cout << "done" << std::endl;
+
+ (std::cout << "checking... ").flush();
+ box_fwd_piter_<point2d> p(out.domain());
+ for_all(p)
+ mln_assertion((unsigned short)std::sqrt(ima(p)) == out(p));
std::cout << "done" << std::endl;
}
Index: trunk/milena/tests/level/stretch.cc
===================================================================
--- trunk/milena/tests/level/stretch.cc (revision 0)
+++ trunk/milena/tests/level/stretch.cc (revision 1491)
@@ -0,0 +1,65 @@
+// Copyright (C) 2007 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
+// 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/level/stretch.cc
+ *
+ * \brief Tests on mln::level::stretch.
+ */
+
+
+#include <mln/core/image2d.hh>
+#include <mln/level/stretch.hh>
+#include <mln/debug/iota.hh>
+#include <mln/value/int_u8.hh>
+
+
+int main()
+{
+ using namespace mln;
+ using value::int_u8;
+
+ int vs[3][3] = {
+ { 1000, 2000, 3000 },
+ { 1000, 2000, 3000 },
+ { 1000, 2000, 3000 }
+ };
+ image2d<int> ima(make::image2d(vs));
+
+ image2d<int_u8> out(3, 3);
+
+ int_u8 ws[3][3] = {
+ { 0, 127, 255 },
+ { 0, 127, 255 },
+ { 0, 127, 255 }
+ };
+
+ image2d<int_u8> ref(make::image2d(ws));
+ level::stretch(ima, out);
+ box_fwd_piter_<point2d> p(out.domain());
+ for_all(p)
+ mln_assertion(out(p) == ref(p));
+}
Index: trunk/milena/tests/level/compute.cc
===================================================================
--- trunk/milena/tests/level/compute.cc (revision 0)
+++ trunk/milena/tests/level/compute.cc (revision 1491)
@@ -0,0 +1,53 @@
+// Copyright (C) 2007 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
+// 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/level/compute.cc
+ *
+ * \brief Tests on mln::level::compute.
+ */
+
+#include <mln/core/image2d.hh>
+#include <mln/level/compute.hh>
+#include <mln/debug/iota.hh>
+#include <mln/accu/min.hh>
+#include <mln/accu/max.hh>
+
+
+int main()
+{
+ using namespace mln;
+
+ const unsigned size = 200;
+ image2d<int> ima(size, size);
+ accu::min_<int> acu_min;
+ accu::max_<int> acu_max;
+ debug::iota(ima);
+ int min = level::compute(ima, acu_min);
+ int max = level::compute(ima, acu_max);
+ mln_assertion(min == 1);
+ mln_assertion(max == 40000);
+}
Index: trunk/milena/tests/level/paste.cc
===================================================================
--- trunk/milena/tests/level/paste.cc (revision 1490)
+++ trunk/milena/tests/level/paste.cc (revision 1491)
@@ -45,18 +45,12 @@
box2d b(make::point2d(1,2), make::point2d(2,4));
image2d<int> ima(b, 2);
debug::iota(ima);
- debug::println(ima);
-
box2d b2(make::point2d(-1,-2), make::point2d(3,6));
image2d<int> ima2(b2, 0);
debug::iota(ima2);
- debug::println(ima2);
-
- trace::quiet = false;
level::paste(ima, ima2); // Fast version.
- debug::println(ima2);
level::impl::generic::paste_(ima, ima2); // Not so fast version...
}
Index: trunk/milena/tests/level/sort_points.cc
===================================================================
--- trunk/milena/tests/level/sort_points.cc (revision 0)
+++ trunk/milena/tests/level/sort_points.cc (revision 1491)
@@ -0,0 +1,61 @@
+// Copyright (C) 2007 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
+// 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/level/sort_points.cc
+ *
+ * \brief Tests on mln::level::sort_points.
+ */
+
+#include <mln/core/image2d.hh>
+#include <mln/debug/iota.hh>
+#include <mln/level/sort_points.hh>
+#include <mln/core/p_array.hh>
+
+
+int main ()
+{
+ using namespace mln;
+
+ image2d<int> ima(3, 3);
+ debug::iota (ima);
+ p_array<point2d> array_inc = level::sort_points_increasing(ima);
+ p_array<point2d> array_dec = level::sort_points_decreasing(ima);
+
+ p_array<point2d> array_inc_ref;
+ p_array<point2d> array_dec_ref;
+
+ for (int i = 0; i < 3; ++i)
+ for (int j = 0; j < 3; ++j)
+ array_inc_ref.append(point2d(i, j));
+
+ for (int i = 2; i >= 0; --i)
+ for (int j = 2; j >= 0; --j)
+ array_dec_ref.append(point2d(i, j));
+
+ mln_assertion(array_inc == array_inc_ref);
+ mln_assertion(array_dec == array_dec_ref);
+}
Index: trunk/milena/tests/level/compare.cc
===================================================================
--- trunk/milena/tests/level/compare.cc (revision 0)
+++ trunk/milena/tests/level/compare.cc (revision 1491)
@@ -0,0 +1,98 @@
+// Copyright (C) 2007 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
+// 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/level/compare.cc
+ *
+ * \brief Tests on mln::level::compare.
+ */
+
+#include <mln/core/image2d.hh>
+#include <mln/level/compare.hh>
+#include <mln/debug/iota.hh>
+
+
+int main()
+{
+ using namespace mln;
+
+ const unsigned size = 3;
+ image2d<int> rhs(size, size), lhs(rhs.domain());
+ debug::iota(rhs);
+ debug::iota(lhs);
+ mln_assertion( (lhs == rhs));
+ mln_assertion( (lhs <= rhs));
+ mln_assertion(! (lhs < rhs));
+ mln_assertion( (lhs >= rhs));
+ mln_assertion(! (lhs > rhs));
+
+ int vs[3][3] = {
+
+ { 2, 3, 4 },
+ { 5, 6, 7 },
+ { 8, 9, 10 },
+
+ };
+
+ rhs = make::image2d(vs);
+
+ mln_assertion(! (lhs == rhs));
+ mln_assertion( (lhs <= rhs));
+ mln_assertion( (lhs < rhs));
+ mln_assertion(! (lhs >= rhs));
+ mln_assertion(! (lhs > rhs));
+
+ mln_assertion(! (rhs == lhs));
+ mln_assertion(! (rhs <= lhs));
+ mln_assertion(! (rhs < lhs));
+ mln_assertion( (rhs >= lhs));
+ mln_assertion( (rhs > lhs));
+
+
+ int ws[3][3] = {
+
+ { 1, 3, 4 },
+ { 4, 6, 7 },
+ { 7, 9, 10 },
+
+ };
+
+ rhs = make::image2d(ws);
+
+ mln_assertion(! (lhs == rhs));
+ mln_assertion( (lhs <= rhs));
+ mln_assertion(! (lhs < rhs));
+ mln_assertion(! (lhs >= rhs));
+ mln_assertion(! (lhs > rhs));
+
+ mln_assertion(! (rhs == lhs));
+ mln_assertion(! (rhs <= lhs));
+ mln_assertion(! (rhs < lhs));
+ mln_assertion( (rhs >= lhs));
+ mln_assertion(! (rhs > lhs));
+
+
+}
Index: trunk/milena/tests/level/saturate.cc
===================================================================
--- trunk/milena/tests/level/saturate.cc (revision 0)
+++ trunk/milena/tests/level/saturate.cc (revision 1491)
@@ -0,0 +1,57 @@
+// Copyright (C) 2007 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
+// 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/level/saturate.cc
+ *
+ * \brief Tests on mln::level::saturate.
+ */
+
+
+#include <mln/core/image2d.hh>
+#include <mln/level/saturate.hh>
+#include <mln/debug/iota.hh>
+
+
+int main()
+{
+ using namespace mln;
+
+ const unsigned size = 1000;
+ image2d<int> ima(3, 3);
+ int vs[3][3] = {
+ { 2, 2, 3 },
+ { 4, 5, 6 },
+ { 6, 6, 6 }
+ };
+
+ image2d<int> ref(make::image2d(vs));
+ debug::iota(ima);
+ level::saturate_inplace(ima, 2, 6);
+ box_fwd_piter_<point2d> p(ima.domain());
+ for_all(p)
+ mln_assertion(ima(p) == ref(p));
+}
1
0
URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena
ChangeLog:
2007-11-16 Matthieu Garrigues <garrigues(a)lrde.epita.fr>
Review the mln/geom directory.
* mln/geom/seeds2tiling.hh: Clean dead code, update doc. Fixme for
guillaume : Review the documentation.
* mln/geom/seeds2tiling_with_chamfer.hh: likewise.
Add unit tests.
* tests/geom/bbox.cc: New.
* tests/geom/max_col.cc: New.
* tests/geom/max_ind.cc: New.
* tests/geom/max_row.cc: New.
* tests/geom/max_sli.cc: New.
* tests/geom/min_col.cc: New.
* tests/geom/min_ind.cc: New.
* tests/geom/min_row.cc: New.
* tests/geom/min_sli.cc: New.
* tests/geom/ncols.cc: New.
* tests/geom/ninds.cc: New.
* tests/geom/nrows.cc: New.
* tests/geom/nslis.cc: New.
* tests/geom/pmin_pmax.cc: New.
* tests/geom/shift.cc: New.
* tests/geom/sym.cc: New.
* tests/geom: New.
---
mln/geom/seeds2tiling.hh | 23 +-------------
mln/geom/seeds2tiling_with_chamfer.hh | 2 -
tests/geom/bbox.cc | 45 ++++++++++++++++++++++++++++
tests/geom/max_col.cc | 39 ++++++++++++++++++++++++
tests/geom/max_ind.cc | 39 ++++++++++++++++++++++++
tests/geom/max_row.cc | 39 ++++++++++++++++++++++++
tests/geom/max_sli.cc | 39 ++++++++++++++++++++++++
tests/geom/min_col.cc | 39 ++++++++++++++++++++++++
tests/geom/min_ind.cc | 39 ++++++++++++++++++++++++
tests/geom/min_row.cc | 39 ++++++++++++++++++++++++
tests/geom/min_sli.cc | 39 ++++++++++++++++++++++++
tests/geom/ncols.cc | 39 ++++++++++++++++++++++++
tests/geom/ninds.cc | 39 ++++++++++++++++++++++++
tests/geom/nrows.cc | 39 ++++++++++++++++++++++++
tests/geom/nslis.cc | 39 ++++++++++++++++++++++++
tests/geom/pmin_pmax.cc | 50 +++++++++++++++++++++++++++++++
tests/geom/shift.cc | 54 ++++++++++++++++++++++++++++++++++
tests/geom/sym.cc | 54 ++++++++++++++++++++++++++++++++++
18 files changed, 674 insertions(+), 22 deletions(-)
Index: trunk/milena/tests/geom/max_sli.cc
===================================================================
--- trunk/milena/tests/geom/max_sli.cc (revision 0)
+++ trunk/milena/tests/geom/max_sli.cc (revision 1490)
@@ -0,0 +1,39 @@
+// Copyright (C) 2007 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
+// 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.
+
+#include <mln/core/image3d.hh>
+
+#include <mln/geom/max_sli.hh>
+
+int main()
+{
+ using namespace mln;
+
+ image3d<int> ima(3,4,5);
+
+ mln_assertion(geom::max_sli(ima) == 2);
+}
Index: trunk/milena/tests/geom/nrows.cc
===================================================================
--- trunk/milena/tests/geom/nrows.cc (revision 0)
+++ trunk/milena/tests/geom/nrows.cc (revision 1490)
@@ -0,0 +1,39 @@
+// Copyright (C) 2007 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
+// 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.
+
+#include <mln/core/image2d.hh>
+
+#include <mln/geom/nrows.hh>
+
+int main()
+{
+ using namespace mln;
+
+ image2d<int> ima(make::box2d(-1,-4,2,6));
+
+ mln_assertion(geom::nrows(ima) == 4);
+}
Index: trunk/milena/tests/geom/sym.cc
===================================================================
--- trunk/milena/tests/geom/sym.cc (revision 0)
+++ trunk/milena/tests/geom/sym.cc (revision 1490)
@@ -0,0 +1,54 @@
+// Copyright (C) 2007 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
+// 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.
+
+#include <mln/core/window2d.hh>
+#include <mln/core/dpoint2d.hh>
+
+#include <mln/geom/sym.hh>
+
+int main()
+{
+ using namespace mln;
+
+ dpoint2d dp(2, 2);
+
+ window2d win, win2;
+
+ win.insert(make::dpoint2d(0,0));
+ win.insert(make::dpoint2d(1,2));
+ win.insert(make::dpoint2d(3,4));
+ win.insert(make::dpoint2d(5,6));
+ win.insert(make::dpoint2d(7,8));
+
+ win2.insert(make::dpoint2d(0,0));
+ win2.insert(make::dpoint2d(-1,-2));
+ win2.insert(make::dpoint2d(-3,-4));
+ win2.insert(make::dpoint2d(-5,-6));
+ win2.insert(make::dpoint2d(-7,-8));
+
+ mln_assertion(geom::sym(win) == win2);
+}
Index: trunk/milena/tests/geom/min_row.cc
===================================================================
--- trunk/milena/tests/geom/min_row.cc (revision 0)
+++ trunk/milena/tests/geom/min_row.cc (revision 1490)
@@ -0,0 +1,39 @@
+// Copyright (C) 2007 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
+// 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.
+
+#include <mln/core/image2d.hh>
+
+#include <mln/geom/min_row.hh>
+
+int main()
+{
+ using namespace mln;
+
+ image2d<int> ima(make::box2d(-1,-4,2,6));
+
+ mln_assertion(geom::min_row(ima) == -1);
+}
Index: trunk/milena/tests/geom/ninds.cc
===================================================================
--- trunk/milena/tests/geom/ninds.cc (revision 0)
+++ trunk/milena/tests/geom/ninds.cc (revision 1490)
@@ -0,0 +1,39 @@
+// Copyright (C) 2007 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
+// 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.
+
+#include <mln/core/image1d.hh>
+
+#include <mln/geom/ninds.hh>
+
+int main()
+{
+ using namespace mln;
+
+ image1d<int> ima(make::box1d(-1,8));
+
+ mln_assertion(geom::ninds(ima) == 10);
+}
Index: trunk/milena/tests/geom/max_row.cc
===================================================================
--- trunk/milena/tests/geom/max_row.cc (revision 0)
+++ trunk/milena/tests/geom/max_row.cc (revision 1490)
@@ -0,0 +1,39 @@
+// Copyright (C) 2007 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
+// 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.
+
+#include <mln/core/image2d.hh>
+
+#include <mln/geom/max_row.hh>
+
+int main()
+{
+ using namespace mln;
+
+ image2d<int> ima(make::box2d(-1,-4,2,6));
+
+ mln_assertion(geom::max_row(ima) == 2);
+}
Index: trunk/milena/tests/geom/shift.cc
===================================================================
--- trunk/milena/tests/geom/shift.cc (revision 0)
+++ trunk/milena/tests/geom/shift.cc (revision 1490)
@@ -0,0 +1,54 @@
+// Copyright (C) 2007 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
+// 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.
+
+#include <mln/core/window2d.hh>
+#include <mln/core/dpoint2d.hh>
+
+#include <mln/geom/shift.hh>
+
+int main()
+{
+ using namespace mln;
+
+ dpoint2d dp(2, 2);
+
+ window2d win, win2;
+
+ win.insert(make::dpoint2d(0,0));
+ win.insert(make::dpoint2d(1,2));
+ win.insert(make::dpoint2d(3,4));
+ win.insert(make::dpoint2d(5,6));
+ win.insert(make::dpoint2d(7,8));
+
+ win2.insert(make::dpoint2d(2,2));
+ win2.insert(make::dpoint2d(3,4));
+ win2.insert(make::dpoint2d(5,6));
+ win2.insert(make::dpoint2d(7,8));
+ win2.insert(make::dpoint2d(9,10));
+
+ mln_assertion(geom::shift(win, dp) == win2);
+}
Index: trunk/milena/tests/geom/min_ind.cc
===================================================================
--- trunk/milena/tests/geom/min_ind.cc (revision 0)
+++ trunk/milena/tests/geom/min_ind.cc (revision 1490)
@@ -0,0 +1,39 @@
+// Copyright (C) 2007 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
+// 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.
+
+#include <mln/core/image1d.hh>
+
+#include <mln/geom/min_ind.hh>
+
+int main()
+{
+ using namespace mln;
+
+ image1d<int> ima(make::box1d(-1,8));
+
+ mln_assertion(geom::min_ind(ima) == -1);
+}
Index: trunk/milena/tests/geom/ncols.cc
===================================================================
--- trunk/milena/tests/geom/ncols.cc (revision 0)
+++ trunk/milena/tests/geom/ncols.cc (revision 1490)
@@ -0,0 +1,39 @@
+// Copyright (C) 2007 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
+// 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.
+
+#include <mln/core/image2d.hh>
+
+#include <mln/geom/ncols.hh>
+
+int main()
+{
+ using namespace mln;
+
+ image2d<int> ima(make::box2d(-1,-4,2,6));
+
+ mln_assertion(geom::ncols(ima) == 11);
+}
Index: trunk/milena/tests/geom/max_ind.cc
===================================================================
--- trunk/milena/tests/geom/max_ind.cc (revision 0)
+++ trunk/milena/tests/geom/max_ind.cc (revision 1490)
@@ -0,0 +1,39 @@
+// Copyright (C) 2007 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
+// 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.
+
+#include <mln/core/image1d.hh>
+
+#include <mln/geom/max_ind.hh>
+
+int main()
+{
+ using namespace mln;
+
+ image1d<int> ima(make::box1d(-1,8));
+
+ mln_assertion(geom::max_ind(ima) == 8);
+}
Index: trunk/milena/tests/geom/min_col.cc
===================================================================
--- trunk/milena/tests/geom/min_col.cc (revision 0)
+++ trunk/milena/tests/geom/min_col.cc (revision 1490)
@@ -0,0 +1,39 @@
+// Copyright (C) 2007 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
+// 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.
+
+#include <mln/core/image2d.hh>
+
+#include <mln/geom/min_col.hh>
+
+int main()
+{
+ using namespace mln;
+
+ image2d<int> ima(make::box2d(-1,-4,2,6));
+
+ mln_assertion(geom::min_col(ima) == -4);
+}
Index: trunk/milena/tests/geom/max_col.cc
===================================================================
--- trunk/milena/tests/geom/max_col.cc (revision 0)
+++ trunk/milena/tests/geom/max_col.cc (revision 1490)
@@ -0,0 +1,39 @@
+// Copyright (C) 2007 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
+// 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.
+
+#include <mln/core/image2d.hh>
+
+#include <mln/geom/max_col.hh>
+
+int main()
+{
+ using namespace mln;
+
+ image2d<int> ima(make::box2d(-1,-4,2,6));
+
+ mln_assertion(geom::max_col(ima) == 6);
+}
Index: trunk/milena/tests/geom/pmin_pmax.cc
===================================================================
--- trunk/milena/tests/geom/pmin_pmax.cc (revision 0)
+++ trunk/milena/tests/geom/pmin_pmax.cc (revision 1490)
@@ -0,0 +1,50 @@
+// Copyright (C) 2007 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
+// 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.
+
+#include <mln/core/point2d.hh>
+#include <mln/core/p_set.hh>
+
+#include <mln/geom/pmin_pmax.hh>
+
+int main()
+{
+ using namespace mln;
+
+ p_set<point2d> p;
+ point2d min, max;
+
+ p.insert(make::point2d(0,0));
+ p.insert(make::point2d(-1,2));
+ p.insert(make::point2d(-3,4));
+ p.insert(make::point2d(7,6));
+ p.insert(make::point2d(5,8));
+
+ geom::pmin_pmax(p, min, max);
+
+ mln_assertion(min == (make::point2d(-3 ,0)));
+ mln_assertion(max == (make::point2d( 7 ,8)));
+}
Index: trunk/milena/tests/geom/nslis.cc
===================================================================
--- trunk/milena/tests/geom/nslis.cc (revision 0)
+++ trunk/milena/tests/geom/nslis.cc (revision 1490)
@@ -0,0 +1,39 @@
+// Copyright (C) 2007 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
+// 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.
+
+#include <mln/core/image3d.hh>
+
+#include <mln/geom/nslis.hh>
+
+int main()
+{
+ using namespace mln;
+
+ image3d<int> ima(3,4,5);
+
+ mln_assertion(geom::nslis(ima) == 3);
+}
Index: trunk/milena/tests/geom/bbox.cc
===================================================================
--- trunk/milena/tests/geom/bbox.cc (revision 0)
+++ trunk/milena/tests/geom/bbox.cc (revision 1490)
@@ -0,0 +1,45 @@
+// Copyright (C) 2007 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
+// 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.
+
+#include <mln/core/p_set.hh>
+#include <mln/core/point2d.hh>
+#include <mln/core/box2d.hh>
+
+#include <mln/geom/bbox.hh>
+
+int main()
+{
+ using namespace mln;
+ p_set<point2d> s;
+
+ s.insert(make::point2d(0,0));
+ s.insert(make::point2d(0,5));
+ s.insert(make::point2d(5,0));
+ s.insert(make::point2d(5,5));
+
+ mln_assertion(geom::bbox(s) == make::box2d(0,0,5,5));
+}
Index: trunk/milena/tests/geom/min_sli.cc
===================================================================
--- trunk/milena/tests/geom/min_sli.cc (revision 0)
+++ trunk/milena/tests/geom/min_sli.cc (revision 1490)
@@ -0,0 +1,39 @@
+// Copyright (C) 2007 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
+// 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.
+
+#include <mln/core/image3d.hh>
+
+#include <mln/geom/min_sli.hh>
+
+int main()
+{
+ using namespace mln;
+
+ image3d<int> ima(3,4,5);
+
+ mln_assertion(geom::min_sli(ima) == 0);
+}
Index: trunk/milena/mln/geom/seeds2tiling.hh
===================================================================
--- trunk/milena/mln/geom/seeds2tiling.hh (revision 1489)
+++ trunk/milena/mln/geom/seeds2tiling.hh (revision 1490)
@@ -30,8 +30,7 @@
/*! \file mln/geom/seeds2tiling.hh
*
- * \brief Definition of a function which takes a labeled image and
- * returns an image which has blew up its labeled values.
+ * \brief Convert a binary image with seeds into a labeled image.
*/
# include <map>
@@ -76,25 +75,7 @@
}
}
-// // Body.
-// {
-// while (! q.is_empty())
-// {
-// mln_psite(I) p = q.front();
-// q.pop();
-// mln_invariant(ima(p) == 0);
-
-// mln_niter(N) n(nbh, p);
-// for_all(n) if (ima.has(n))
-// if (out(n) != 0)
-// out(p) = out(n);
-// else
-// if (! q.has(n))
-// q.push(n);
-// }
-// }
-
- // Body: alternative version.
+ // Body.
{
while (! q.is_empty())
{
Index: trunk/milena/mln/geom/seeds2tiling_with_chamfer.hh
===================================================================
--- trunk/milena/mln/geom/seeds2tiling_with_chamfer.hh (revision 1489)
+++ trunk/milena/mln/geom/seeds2tiling_with_chamfer.hh (revision 1490)
@@ -30,7 +30,7 @@
/*! \file mln/geom/seeds2tiling_with_chamfer.hh
*
- * \brief FIXME.
+ * \brief seeds2tiling with chamfer method.
*/
# include <map>
1
0
15 Nov '07
URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena
ChangeLog:
2007-11-15 Guillaume Duhamel <guillaume.duhamel(a)lrde.epita.fr>
Update level and add specialization for algorithm.
* mln/level/assign.hh,
* mln/level/fill.hh,
* mln/level/take.hh,
* mln/level/apply.hh: Remove specialization stuff and add
generic namespace.
Specialization files
* mln/level/assign.spe.hh,
* mln/level/fill.spe.hh,
* mln/level/take.spe.hh,
* mln/level/apply.spe.hh: New file for specialization.
Update
* mln/level/abs.hh,
* mln/level/all.hh,
* mln/level/compare.hh,
* mln/level/sort_points.hh: Update.
---
abs.hh | 4 ++
all.hh | 1
apply.hh | 24 +++++++++-----
apply.spe.hh | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
assign.hh | 32 ++++++++++++-------
assign.spe.hh | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
fill.hh | 38 ++++++++++++++++++-----
fill.spe.hh | 93 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
take.hh | 24 +++++++++-----
take.spe.hh | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++
10 files changed, 440 insertions(+), 39 deletions(-)
Index: trunk/milena/mln/level/sort_points.hh
===================================================================
Index: trunk/milena/mln/level/take.hh
===================================================================
--- trunk/milena/mln/level/take.hh (revision 1488)
+++ trunk/milena/mln/level/take.hh (revision 1489)
@@ -36,6 +36,8 @@
# include <mln/core/concept/accumulator.hh>
# include <mln/core/concept/image.hh>
+// Specializations are in:
+# include <mln/level/take.spe.hh>
namespace mln
{
@@ -62,22 +64,22 @@
namespace impl
{
+ namespace generic
+ {
template <typename A, typename I>
- void take(trait::image::speed::any, const I& input, A& a)
+ void take_(const I& input, A& a)
{
+ trace::entering("level::impl::generic::take");
+
mln_piter(I) p(input.domain());
for_all(p)
a.take(input(p));
- }
- template <typename A, typename I>
- void take(trait::image::speed::fastest, const I& input, A& a)
- {
- mln_pixter(const I) pxl(input);
- for_all(pxl)
- a.take(pxl.val());
+ trace::exiting("level::impl::generic::take");
}
+ } // end of namespace mln::level::impl::generic
+
} // end of namespace mln::level::impl
@@ -86,9 +88,13 @@
template <typename A, typename I>
void take(const Image<I>& input, Accumulator<A>& a)
{
+ trace::entering("level::take");
+
mln_precondition(exact(input).has_data());
- impl::take(mln_trait_image_speed(I)(), exact(input),
+ impl::take_(mln_trait_image_speed(I)(), exact(input),
exact(a));
+
+ trace::exiting("level::take");
}
# endif // ! MLN_INCLUDE_ONLY
Index: trunk/milena/mln/level/assign.hh
===================================================================
--- trunk/milena/mln/level/assign.hh (revision 1488)
+++ trunk/milena/mln/level/assign.hh (revision 1489)
@@ -38,6 +38,11 @@
# include <mln/core/concept/image.hh>
+// Specializations are in:
+# include <mln/level/assign.spe.hh>
+
+
+
namespace mln
{
@@ -64,34 +69,37 @@
namespace impl
{
+ namespace generic
+ {
template <typename L, typename R>
- void assign(trait::image::speed::any, L& target,
- trait::image::speed::any, const R& data)
+ void assign_(L& target, const R& data)
{
+ trace::entering("level::impl::generic::assign_");
+
mln_piter(L) p(target.domain());
for_all(p)
target(p) = data(p);
- }
- template <typename L, typename R>
- void assign(trait::image::speed::fastest, L& target,
- trait::image::speed::fastest, const R& data)
- {
- mln_pixter(L) lhs(target);
- mln_pixter(const R) rhs(data);
- for_all_2(lhs, rhs)
- lhs.val() = rhs.val();
+ trace::exiting("level::impl::generic::assign_");
}
+ } // end of namespace mln::level::impl::generic
+
} // end of namespace mln::level::impl
+ // Facade.
+
template <typename L, typename R>
void assign(Image<L>& target, const Image<R>& data)
{
+ trace::entering("level::assign");
+
mln_precondition(exact(data).domain() == exact(target).domain());
- impl::assign(mln_trait_image_speed(L)(), exact(target),
+ impl::assign_(mln_trait_image_speed(L)(), exact(target),
mln_trait_image_speed(R)(), exact(data));
+
+ trace::exiting("level::assign");
}
# endif // ! MLN_INCLUDE_ONLY
Index: trunk/milena/mln/level/apply.hh
===================================================================
--- trunk/milena/mln/level/apply.hh (revision 1488)
+++ trunk/milena/mln/level/apply.hh (revision 1489)
@@ -36,6 +36,9 @@
# include <mln/core/concept/image.hh>
# include <mln/core/concept/function.hh>
+// Specializations are in:
+# include <mln/level/apply.spe.hh>
+
namespace mln
{
@@ -66,22 +69,23 @@
namespace impl
{
+ namespace generic
+ {
+
template <typename I, typename F>
- void apply_(trait::image::speed::any, I& input, const F& f)
+ void apply_(I& input, const F& f)
{
+ trace::entering("level::impl::generic::apply_");
+
mln_piter(I) p(input.domain());
for_all(p)
input(p) = f(input(p));
- }
- template <typename I, typename F>
- void apply_(trait::image::speed::fastest, I& input, const F& f)
- {
- mln_pixter(I) pxl(input);
- for_all(pxl)
- pxl.val() = f(pxl.val());
+ trace::exiting("level::impl::generic::apply_");
}
+ } // end of namespace mln::level::impl::generic
+
} // end of namespace mln::level::impl
@@ -90,9 +94,13 @@
template <typename I, typename F>
void apply(Image<I>& input, const Function_v2v<F>& f)
{
+ trace::entering("level::apply");
+
mln_precondition(exact(input).has_data());
impl::apply_(mln_trait_image_speed(I)(), exact(input),
exact(f));
+
+ trace::exiting("level::apply");
}
# endif // ! MLN_INCLUDE_ONLY
Index: trunk/milena/mln/level/compare.hh
===================================================================
Index: trunk/milena/mln/level/fill.hh
===================================================================
--- trunk/milena/mln/level/fill.hh (revision 1488)
+++ trunk/milena/mln/level/fill.hh (revision 1489)
@@ -43,6 +43,9 @@
# include <mln/level/memset_.hh>
+// Specializations are in:
+# include <mln/level/fill.spe.hh>
+
namespace mln
{
@@ -132,25 +135,22 @@
namespace impl
{
-
- // fill_with_value
-
+ namespace generic
+ {
template <typename I>
void fill_with_value(trait::image::speed::any, I& ima,
const mln_value(I)& value)
{
+ trace::entering("level::impl::generic::fill_with_value");
+
mln_piter(I) p(ima.domain());
for_all(p)
ima(p) = value;
- }
- template <typename I>
- void fill_with_value(trait::image::speed::fastest, I& ima,
- const mln_value(I)& value)
- {
- level::memset_(ima, ima.point_at_offset(0), value, ima.ncells());
+ trace::exiting("level::impl::generic::fill_with_value");
}
+ } // end if namespace mln::level::impl::generic
} // end of namespace mln::level::impl
@@ -161,10 +161,14 @@
template <typename I>
void fill(Image<I>& ima, const mln_value(I)& value)
{
+ trace::entering("level::fill");
+
mlc_is(mln_trait_image_io(I), trait::image::io::write)::check(); // FIXME: Only the upcoming general facade!!!
mln_precondition(exact(ima).has_data());
impl::fill_with_value(mln_trait_image_speed(I)(), exact(ima),
value);
+
+ trace::exiting("level::fill");
}
@@ -173,12 +177,16 @@
template <typename I, typename F>
void fill(Image<I>& ima_, const Function_p2v<F>& f_)
{
+ trace::entering("level::fill");
+
I& ima = exact(ima_);
mln_precondition(ima.has_data());
const F& f = exact(f_);
mln_piter(I) p(ima.domain());
for_all(p)
ima(p) = f(p);
+
+ trace::exiting("level::fill");
}
@@ -188,12 +196,16 @@
void fill_f(Image<I>& ima_,
mln_value(I) (*f)(const mln_point(I)& p))
{
+ trace::entering("level::fill_f");
+
mln_precondition(f != 0);
I& ima = exact(ima_);
mln_precondition(ima.has_data());
mln_piter(I) p(ima.domain());
for_all(p)
ima(p) = f(p);
+
+ trace::exiting("level::fill_f");
}
@@ -202,6 +214,8 @@
template <typename I, unsigned N>
void fill(Image<I>& ima_, mln_value(I) (&arr)[N])
{
+ trace::entering("level::fill");
+
I& ima = exact(ima_);
mln_precondition(ima.has_data());
mln_precondition(N == ima.npoints());
@@ -209,6 +223,8 @@
unsigned i = 0;
for_all(p)
ima(p) = arr[i++];
+
+ trace::exiting("level::fill");
}
@@ -217,6 +233,8 @@
template <typename I, typename J>
void fill(Image<I>& ima_, const Image<J>& data_)
{
+ trace::entering("level::fill");
+
I& ima = exact(ima_);
const J& data = exact(data_);
mln_precondition(ima.domain() <= data.domain());
@@ -224,6 +242,8 @@
mln_piter(I) p(ima.domain());
for_all(p)
ima(p) = data(p);
+
+ trace::exiting("level::fill");
}
# endif // ! MLN_INCLUDE_ONLY
Index: trunk/milena/mln/level/abs.hh
===================================================================
--- trunk/milena/mln/level/abs.hh (revision 1488)
+++ trunk/milena/mln/level/abs.hh (revision 1489)
@@ -68,15 +68,19 @@
template <typename I, typename O>
void abs(const Image<I>& input, Image<O>& output)
{
+ trace::entering("level::abs");
mln_precondition(exact(input).domain() == exact(output).domain());
level::transform(input, fun::v2v::abs<mln_value(I)>(), output);
+ trace::exiting("level::abs");
}
template <typename I>
void abs_inplace(Image<I>& input)
{
+ trace::entering("level::abs_inplace");
mln_precondition(exact(input).has_data());
level::apply(input, fun::v2v::abs<mln_value(I)>());
+ trace::exiting("level::abs_inplace");
}
# endif // ! MLN_INCLUDE_ONLY
Index: trunk/milena/mln/level/all.hh
===================================================================
--- trunk/milena/mln/level/all.hh (revision 1488)
+++ trunk/milena/mln/level/all.hh (revision 1489)
@@ -47,7 +47,6 @@
}
# include <mln/level/abs.hh>
-# include <mln/level/all.hh>
# include <mln/level/apply.hh>
# include <mln/level/approx/all.hh>
# include <mln/level/assign.hh>
Index: trunk/milena/mln/level/assign.spe.hh
===================================================================
--- trunk/milena/mln/level/assign.spe.hh (revision 0)
+++ trunk/milena/mln/level/assign.spe.hh (revision 1489)
@@ -0,0 +1,92 @@
+// Copyright (C) 2007 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
+// 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_LEVEL_ASSIGN_SPE_HH
+# define MLN_LEVEL_ASSIGN_SPE_HH
+
+/*! \file mln/level/assign.spe.hh
+ *
+ * \brief Specializations for mln::level::assign.
+ *
+ */
+
+# include <mln/core/concept/image.hh>
+
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+namespace mln
+{
+
+ namespace level
+ {
+
+ namespace impl
+ {
+
+ namespace generic
+ {
+ template <typename L, typename R>
+ void assign_(L& target, const R& data);
+ }
+
+
+ // Disjunction.
+
+
+ template <typename L, typename R>
+ void assign_(trait::image::speed::any, L& target,
+ trait::image::speed::any, const R& data)
+ {
+ generic::assign_(target, data);
+ }
+
+ template <typename L, typename R>
+ void assign_(trait::image::speed::fastest, L& target,
+ trait::image::speed::fastest, const R& data)
+ {
+ trace::entering("level::impl::assign_");
+
+ mln_pixter(L) lhs(target);
+ mln_pixter(const R) rhs(data);
+ for_all_2(lhs, rhs)
+ lhs.val() = rhs.val();
+
+ trace::exiting("level::impl::assign_");
+ }
+
+
+ } // end of namespace mln::level::impl
+
+ } // end of namespace mln::level
+
+} // end of namespace mln
+
+# endif // ! MLN_INCLUDE_ONLY
+
+#endif // ! MLN_LEVEL_ASSIGN_SPE_HH
Index: trunk/milena/mln/level/take.spe.hh
===================================================================
--- trunk/milena/mln/level/take.spe.hh (revision 0)
+++ trunk/milena/mln/level/take.spe.hh (revision 1489)
@@ -0,0 +1,82 @@
+// Copyright (C) 2007 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
+// 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_LEVEL_TAKE_SPE_HH
+# define MLN_LEVEL_TAKE_SPE_HH
+
+/*! \file mln/level/take.spe.hh
+ *
+ * \brief Specializations for mln::level::take.
+ */
+
+# include <mln/core/concept/accumulator.hh>
+# include <mln/core/concept/image.hh>
+
+# ifndef MLN_INCLUDE_ONLY
+
+namespace mln
+{
+
+ namespace level
+ {
+
+ namespace impl
+ {
+
+ namespace generic
+ {
+ template <typename A, typename I>
+ void take_(const I& input, A& a);
+ }
+
+ template <typename A, typename I>
+ void take_(trait::image::speed::any, const I& input, A& a)
+ {
+ generic::take_(input, a);
+ }
+
+ template <typename A, typename I>
+ void take_(trait::image::speed::fastest, const I& input, A& a)
+ {
+ trace::entering("level::impl::take");
+
+ mln_pixter(const I) pxl(input);
+ for_all(pxl)
+ a.take(pxl.val());
+
+ trace::exiting("level::impl::take");
+ }
+
+ } // end of namespace mln::level::impl
+
+ } // end of namespace mln::level
+
+} // end of namespace mln
+
+# endif // ! MLN_INCLUDE_ONLY
+
+#endif // ! MLN_LEVEL_TAKE_HH
Index: trunk/milena/mln/level/apply.spe.hh
===================================================================
--- trunk/milena/mln/level/apply.spe.hh (revision 0)
+++ trunk/milena/mln/level/apply.spe.hh (revision 1489)
@@ -0,0 +1,89 @@
+// Copyright (C) 2007 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
+// 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_LEVEL_APPLY_SPE_HH
+# define MLN_LEVEL_APPLY_SPE_HH
+
+/*! \file mln/level/apply.spe.hh
+ *
+ * \brief Specializations for mln::level::apply.
+ */
+
+# include <mln/core/concept/image.hh>
+# include <mln/core/concept/function.hh>
+
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+namespace mln
+{
+
+ namespace level
+ {
+
+ namespace impl
+ {
+
+ namespace generic
+ {
+ template <typename I, typename F>
+ void apply_(I& input, const F& f);
+ }
+
+
+ // Disjunction.
+
+ template <typename I, typename F>
+ void apply_(trait::image::speed::any, I& input, const F& f)
+ {
+ generic::apply_(input, f);
+ }
+
+ template <typename I, typename F>
+ void apply_(trait::image::speed::fastest, I& input, const F& f)
+ {
+ trace::entering("level::impl::apply_");
+
+ mln_pixter(I) pxl(input);
+ for_all(pxl)
+ pxl.val() = f(pxl.val());
+
+ trace::exiting("level::impl::apply_");
+ }
+
+
+ } // end of namespace mln::level::impl
+
+ } // end of namespace mln::level
+
+} // end of namespace mln
+
+# endif // ! MLN_INCLUDE_ONLY
+
+
+#endif // ! MLN_LEVEL_APPLY_HH
Index: trunk/milena/mln/level/fill.spe.hh
===================================================================
--- trunk/milena/mln/level/fill.spe.hh (revision 0)
+++ trunk/milena/mln/level/fill.spe.hh (revision 1489)
@@ -0,0 +1,93 @@
+// Copyright (C) 2007 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
+// 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_LEVEL_FILL_SPE_HH
+# define MLN_LEVEL_FILL_SPE_HH
+
+/*! \file mln/level/fill.spe.hh
+ *
+ * \brief Specializations for mln::level::fill.
+ *
+ */
+
+# include <cstring>
+
+# include <mln/core/concept/image.hh>
+# include <mln/core/concept/function.hh>
+# include <mln/core/inplace.hh>
+# include <mln/level/memset_.hh>
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+namespace mln
+{
+
+ namespace level
+ {
+
+ namespace impl
+ {
+
+ namespace generic
+ {
+ template <typename I>
+ void fill_with_value(I& ima, const mln_value(I)& value);
+ }
+
+
+ // Disjunction.
+
+
+ template <typename I>
+ void fill_with_value(trait::image::speed::any, I& ima,
+ const mln_value(I)& value)
+ {
+ generic::fill_with_value(ima, value);
+ }
+
+ template <typename I>
+ void fill_with_value(trait::image::speed::fastest, I& ima,
+ const mln_value(I)& value)
+ {
+ trace::entering("level::impl::fill_with_value");
+
+ level::memset_(ima, ima.point_at_offset(0), value, ima.ncells());
+
+ trace::exiting("level::impl::fill_with_value");
+ }
+
+
+ } // end of namespace mln::level::impl
+
+ } // end of namespace mln::level
+
+} // end of namespace mln
+
+# endif // ! MLN_INCLUDE_ONLY
+
+#endif // ! MLN_LEVEL_FILL_SPE_HH
1
0
URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena
ChangeLog:
2007-11-15 Guillaume Duhamel <guillaume.duhamel(a)lrde.epita.fr>
Update tests/level.
* tests/level/fill.cc: Update.
* tests/level/take.cc: New simple test for level:take.
* tests/level/approx_median.cc: Rename this file into ...
* tests/level/approx/median.cc: ... this.
---
approx/median.cc | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
fill.cc | 28 +++++++++++++++---------
take.cc | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 136 insertions(+), 11 deletions(-)
Index: trunk/milena/tests/level/approx_median.cc (deleted)
===================================================================
Index: trunk/milena/tests/level/take.cc
===================================================================
--- trunk/milena/tests/level/take.cc (revision 0)
+++ trunk/milena/tests/level/take.cc (revision 1488)
@@ -0,0 +1,57 @@
+// Copyright (C) 2007 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
+// 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/level/take.cc
+ *
+ * \brief Tests on mln::level::take.
+ */
+
+#include <mln/core/image2d.hh>
+#include <mln/level/take.hh>
+#include <mln/level/compare.hh>
+#include <mln/debug/iota.hh>
+#include <mln/accu/min.hh>
+#include <mln/accu/max.hh>
+
+
+int main()
+{
+ using namespace mln;
+
+ const unsigned size = 200;
+ image2d<int> ima(size, size);
+ accu::min_<int> acu_min;
+ accu::max_<int> acu_max;
+
+ debug::iota(ima);
+ level::take(ima, acu_min);
+ level::take(ima, acu_max);
+
+ mln_assertion(acu_min.to_result() == 1);
+ mln_assertion(acu_max.to_result() == 40000);
+
+}
Index: trunk/milena/tests/level/approx/median.cc
===================================================================
--- trunk/milena/tests/level/approx/median.cc (revision 0)
+++ trunk/milena/tests/level/approx/median.cc (revision 1488)
@@ -0,0 +1,62 @@
+// Copyright (C) 2007 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
+// 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/level/approx/median.cc
+ *
+ * \brief Test on mln::level::approx::median.
+ */
+
+#include <mln/core/image2d.hh>
+#include <mln/win/rectangle2d.hh>
+#include <mln/win/octagon2d.hh>
+
+#include <mln/io/pgm/load.hh>
+#include <mln/io/pgm/save.hh>
+
+#include <mln/value/int_u8.hh>
+#include <mln/level/approx/median.hh>
+
+
+
+
+int main()
+{
+ using namespace mln;
+ using value::int_u8;
+
+ win::rectangle2d rect(51, 51);
+ win::octagon2d oct(13);
+ border::thickness = 52;
+
+ image2d<int_u8>
+ lena = io::pgm::load("../../../img/lena.pgm"),
+ out(lena.domain());
+
+// level::approx::median(lena, rect, out);
+ level::approx::median(lena, oct, out);
+ io::pgm::save(out, "out.pgm");
+}
Index: trunk/milena/tests/level/fill.cc
===================================================================
--- trunk/milena/tests/level/fill.cc (revision 1487)
+++ trunk/milena/tests/level/fill.cc (revision 1488)
@@ -47,21 +47,27 @@
unsigned char uc = u;
mln_assertion(uc == 44);
-// {
-// const unsigned size = 3;
-// image2d<unsigned> ima(size, size);
-// level::fill(ima, u);
-// debug::println(ima);
-// }
-
{
- const unsigned size = 10000;
- image2d<unsigned char> ima(size, size);
- for (unsigned i = 0; i < 5; ++i)
- level::fill(ima, uc);
+ const unsigned size = 3;
+ image2d<unsigned> ima(size, size);
+ level::fill(ima, u);
+ box_fwd_piter_<point2d> p(ima.domain());
+ for_all (p)
+ mln_assertion (ima(p) == u);
+
}
// {
+// const unsigned size = 10000;
+// image2d<unsigned char> ima(size, size);
+// for (unsigned i = 0; i < 5; ++i)
+// level::fill(ima, uc);
+// box_fwd_piter_<point2d> p(ima.domain());
+// for_all (p)
+// mln_assertion (ima(p) == uc);
+// }
+
+// {
// // do *not* compile so that's great since ima is not mutable
// sub_image< const image2d<int>, box2d > ima;
// level::fill(ima, 0);
1
0
URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena
ChangeLog:
2007-11-15 Matthieu Garrigues <garrigues(a)lrde.epita.fr>
Review the debug namespace.
* mln/debug/format.hh: Fix style.
* mln/debug/iota.hh: Move spezialisations to iota.spe.hh.
* mln/debug/iota.spe.hh: New, specializations of iota.
* mln/debug/println.hh: Move spezialisations to println.spe.hh.
* mln/debug/println.spe.hh: New, specializations of println.
* mln/debug/println_with_border.hh: Move spezialisations to
println_with_border.spe.hh.
* mln/debug/println_with_border.spe.hh: New, specializations of
println.
* tests/debug_iota.cc: New, add a test for iota.
---
mln/debug/format.hh | 12 +-
mln/debug/iota.hh | 30 +++---
mln/debug/iota.spe.hh | 71 +++++++++++++++
mln/debug/println.hh | 106 +----------------------
mln/debug/println.spe.hh | 160 +++++++++++++++++++++++++++++++++++
mln/debug/println_with_border.hh | 56 +-----------
mln/debug/println_with_border.spe.hh | 113 ++++++++++++++++++++++++
tests/debug_iota.cc | 49 ++++++++++
8 files changed, 434 insertions(+), 163 deletions(-)
Index: trunk/milena/tests/debug_iota.cc
===================================================================
--- trunk/milena/tests/debug_iota.cc (revision 0)
+++ trunk/milena/tests/debug_iota.cc (revision 1487)
@@ -0,0 +1,49 @@
+// Copyright (C) 2007 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
+// 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/debug_iota.cc
+ *
+ * \brief Tests on mln::debug::iota.
+ */
+
+#include <mln/core/image2d.hh>
+
+#include <mln/value/int_u8.hh>
+
+#include <mln/debug/iota.hh>
+#include <mln/debug/println.hh>
+
+int main()
+{
+ using namespace mln;
+ using value::int_u8;
+
+ image2d<int_u8> in(32, 32);
+
+ debug::iota(in);
+ debug::println(in);
+}
Index: trunk/milena/mln/debug/iota.spe.hh
===================================================================
--- trunk/milena/mln/debug/iota.spe.hh (revision 0)
+++ trunk/milena/mln/debug/iota.spe.hh (revision 1487)
@@ -0,0 +1,71 @@
+// Copyright (C) 2007 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
+// 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_DEBUG_IOTA_SPE_HH
+# define MLN_DEBUG_IOTA_SPE_HH
+
+/*! \file mln/debug/iota.spe.hh
+ *
+ * \brief Specializations for mln::debug::iota.
+ */
+
+# include <mln/core/concept/image.hh>
+
+
+namespace mln
+{
+
+ namespace debug
+ {
+
+# ifndef MLN_INCLUDE_ONLY
+
+ namespace impl
+ {
+
+ template <typename I>
+ void
+ iota(trait::image::speed::fastest, I& input)
+ {
+ unsigned i = 0;
+ mln_pixter(I) p(input);
+ for_all(p)
+ // FIXME : remove the convertion when the bug will be
+ // resolved.
+ p.val() = ++i % int(mln_max(mln_value(I)));
+ }
+
+ } // end of namespace mln::debug::impl
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::debug
+
+} // end of namespace mln
+
+
+#endif // ! MLN_DEBUG_IOTA_SPE_HH
Index: trunk/milena/mln/debug/println_with_border.spe.hh
===================================================================
--- trunk/milena/mln/debug/println_with_border.spe.hh (revision 0)
+++ trunk/milena/mln/debug/println_with_border.spe.hh (revision 1487)
@@ -0,0 +1,113 @@
+// Copyright (C) 2007 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
+// 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_DEBUG_PRINTLN_WITH_BORDER_SPE_HH
+# define MLN_DEBUG_PRINTLN_WITH_BORDER_SPE_HH
+
+/*! \file mln/debug/println_with_border_spe.hh
+ *
+ * \brief Specializations for mln::debug::println_with_border.
+ */
+
+# include <mln/core/concept/image.hh>
+# include <mln/core/concept/window.hh>
+# include <mln/debug/format.hh>
+
+namespace mln
+{
+
+ namespace debug
+ {
+
+# ifndef MLN_INCLUDE_ONLY
+
+ namespace impl
+ {
+
+# ifdef MLN_CORE_BOX2D_HH
+
+ // 2D version.
+ template <typename I>
+ void
+ println_with_border(const box2d& b, const I& input)
+ {
+ const std::size_t ncols = b.ncols() + 2 * input.border();
+ for (size_t i = 0; i < input.ncells(); i++)
+ {
+ std::cout << format(input.buffer()[i]) << ' ';
+ if (((i + 1) % ncols) == 0)
+ std::cout << std::endl;
+ }
+ std::cout << std::endl;
+ }
+# endif // MLN_CORE_BOX2D_HH
+
+
+# ifdef MLN_CORE_BOX3D_HH
+
+ // 3D version.
+ template <typename I>
+ void
+ println_with_border(const box3d& b, const I& input)
+ {
+ typedef mln_point(I) P;
+
+ std::size_t len_s = b.len(P::dim - 3);
+ std::size_t len_r = b.len(P::dim - 2);
+ std::size_t len_c = b.len(P::dim - 1);
+
+ std::size_t border = input.border();
+ std::size_t real_len_s = len_s + 2 * border;
+ std::size_t real_len_c = len_c + 2 * border;
+ std::size_t real_len_r = len_r + 2 * border;
+
+ for (std::size_t k = 0; k < real_len_s; ++k)
+ {
+ for (std::size_t j = 0; j < real_len_r; ++j)
+ {
+ for (std::size_t i = 0; i < real_len_c; ++i)
+ std::cout << format(input[k * (real_len_r * real_len_c) + j * real_len_c + i])
+ << ' ';
+ std::cout << std::endl;
+ }
+ std::cout << std::endl;
+ }
+ std::cout << std::endl;
+ }
+
+# endif // MLN_CORE_BOX3D_HH
+
+ } // end of namespace mln::debug::impl
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::debug
+
+} // end of namespace mln
+
+
+#endif // ! MLN_DEBUG_PRINTLN_WITH_BORDER_SPE_HH
Index: trunk/milena/mln/debug/println.hh
===================================================================
--- trunk/milena/mln/debug/println.hh (revision 1486)
+++ trunk/milena/mln/debug/println.hh (revision 1487)
@@ -37,6 +37,8 @@
# include <mln/core/concept/window.hh>
# include <mln/debug/format.hh>
+// Specializations are in:
+# include <mln/debug/println.spe.hh>
namespace mln
{
@@ -54,9 +56,10 @@
namespace impl
{
- // generic version
+ // Generic version.
template <typename S, typename I>
- void println(const S&, const Image<I>& input_)
+ void
+ println(const S&, const Image<I>& input_)
{
const I& input = exact(input_);
mln_piter(I) p(input.domain());
@@ -65,108 +68,13 @@
std::cout << std::endl;
}
-# ifdef MLN_CORE_BOX2D_HH
-
- // 2D version
- template <typename I>
- void println(const box2d& b, const I& input)
- {
- point2d p;
- int& row = p.row();
- int& col = p.col();
- const int
- max_row = b.max_row(),
- max_col = b.max_col();
-
- for (row = b.min_row(); row <= max_row; ++row)
- {
- for (col = b.min_col(); col <= max_col; ++col)
- if (input.has(p))
- std::cout << format( input(p) ) << ' ';
- else
- std::cout << " ";
- std::cout << std::endl;
- }
- std::cout << std::endl;
- }
-
-# endif // MLN_CORE_BOX2D_HH
-
-# ifdef MLN_CORE_IMAGE2D_H_HH
-
- // Hexa version
- template <typename I>
- void println(const box2d_h& b, const hexa<I>& input)
- {
- typename hexa<I>::fwd_piter p(input.domain());
-
- int c = 1;
- int r = 1;
- int row_len = 1 + (b.max_col() - b.min_col()) / 2;
-
- for_all(p)
- {
- if (input.has(p))
- std::cout << format(input(p)) << " ";
- else
- std::cout << " ";
-
- if (c >= row_len)
- {
- std::cout << std::endl;
- if (r % 2)
- std::cout << " ";
- c = 0;
- r++;
- }
- c++;
- }
- std::cout << std::endl;
- }
-
-# endif // MLN_CORE_IMAGE2D_H_HH
-
-
-# ifdef MLN_CORE_BOX3D_HH
-
- template <typename I>
- void println(const box3d& b, const I& input)
- {
- point3d p;
- int& sli = p.sli();
- int& row = p.row();
- int& col = p.col();
- const int
- max_row = b.max_row(),
- max_sli = b.max_sli(),
- max_col = b.max_col();
-
- for (sli = b.min_sli(); sli <= max_sli; ++sli)
- {
- for (row = b.min_row(); row <= max_row; ++row)
- {
- for (int i = max_row; i >= row; --i)
- std::cout << ' ';
- for (col = b.min_col(); col <= max_col; ++col)
- if (input.has(p))
- std::cout << format( input(p) ) << ' ';
- else
- std::cout << " ";
- std::cout << std::endl;
- }
- std::cout << std::endl;
- }
- }
-
-# endif // MLN_CORE_BOX3D_HH
-
} // end of namespace mln::debug::impl
// Facade.
-
template <typename I>
- void println(const Image<I>& input)
+ void
+ println(const Image<I>& input)
{
impl::println(exact(input).bbox(), exact(input));
}
Index: trunk/milena/mln/debug/format.hh
===================================================================
--- trunk/milena/mln/debug/format.hh (revision 1486)
+++ trunk/milena/mln/debug/format.hh (revision 1487)
@@ -61,22 +61,26 @@
# ifndef MLN_INCLUDE_ONLY
template <typename T>
- const T& format(const T& v)
+ const T&
+ format(const T& v)
{
return v;
}
- char format(bool v)
+ char
+ format(bool v)
{
return v ? '|' : '-';
}
- signed short format(signed char v)
+ signed short
+ format(signed char v)
{
return v;
}
- unsigned short format(unsigned char v)
+ unsigned short
+ format(unsigned char v)
{
return v;
}
Index: trunk/milena/mln/debug/iota.hh
===================================================================
--- trunk/milena/mln/debug/iota.hh (revision 1486)
+++ trunk/milena/mln/debug/iota.hh (revision 1487)
@@ -35,6 +35,9 @@
# include <mln/core/concept/image.hh>
+// Specializations are in:
+# include <mln/debug/iota.spe.hh>
+
namespace mln
{
@@ -42,7 +45,11 @@
namespace debug
{
- /// FIXME
+ /*! Fill the image \p input with successive values.
+ *
+ * \param[in,out] destination The image in which values are
+ * assigned.
+ */
template <typename I>
void iota(Image<I>& input);
@@ -53,31 +60,28 @@
{
template <typename I>
- void iota(trait::image::speed::any, I& input)
+ void
+ iota(trait::image::speed::any, I& input)
{
unsigned i = 0;
mln_piter(I) p(input.domain());
for_all(p)
- input(p) = ++i;
- }
-
- template <typename I>
- void iota(trait::image::speed::fastest, I& input)
- {
- unsigned i = 0;
- mln_pixter(I) p(input);
- for_all(p)
- p.val() = ++i;
+ // FIXME : remove the convertion when the bug will be
+ // resolved.
+ input(p) = ++i % int(mln_max(mln_value(I)));
}
} // end of namespace mln::debug::impl
template <typename I>
- void iota(Image<I>& input)
+ void
+ iota(Image<I>& input)
{
+ trace::entering("debug::iota");
mln_precondition(exact(input).has_data());
impl::iota(mln_trait_image_speed(I)(), exact(input));
+ trace::exiting("debug::iota");
}
# endif // ! MLN_INCLUDE_ONLY
Index: trunk/milena/mln/debug/println.spe.hh
===================================================================
--- trunk/milena/mln/debug/println.spe.hh (revision 0)
+++ trunk/milena/mln/debug/println.spe.hh (revision 1487)
@@ -0,0 +1,160 @@
+// Copyright (C) 2007 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
+// 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_DEBUG_PRINTLN_SPE_HH
+# define MLN_DEBUG_PRINTLN_SPE_HH
+
+/*! \file mln/debug/println.spe.hh
+ *
+ * \brief Specializations for mln::debug::println.
+ */
+
+# include <mln/core/concept/image.hh>
+# include <mln/core/concept/window.hh>
+# include <mln/debug/format.hh>
+
+
+namespace mln
+{
+
+ namespace debug
+ {
+
+# ifndef MLN_INCLUDE_ONLY
+
+ namespace impl
+ {
+
+# ifdef MLN_CORE_BOX2D_HH
+
+ // 2D version.
+ template <typename I>
+ void
+ println(const box2d& b, const I& input)
+ {
+ point2d p;
+ int& row = p.row();
+ int& col = p.col();
+ const int
+ max_row = b.max_row(),
+ max_col = b.max_col();
+
+ for (row = b.min_row(); row <= max_row; ++row)
+ {
+ for (col = b.min_col(); col <= max_col; ++col)
+ if (input.has(p))
+ std::cout << format(input(p)) << ' ';
+ else
+ std::cout << " ";
+ std::cout << std::endl;
+ }
+ std::cout << std::endl;
+ }
+
+# endif // MLN_CORE_BOX2D_HH
+
+# ifdef MLN_CORE_IMAGE2D_H_HH
+
+ // Hexa version.
+ template <typename I>
+ void
+ println(const box2d_h& b, const hexa<I>& input)
+ {
+ typename hexa<I>::fwd_piter p(input.domain());
+
+ int c = 1;
+ int r = 1;
+ int row_len = 1 + (b.max_col() - b.min_col()) / 2;
+
+ for_all(p)
+ {
+ if (input.has(p))
+ std::cout << format(input(p)) << " ";
+ else
+ std::cout << " ";
+
+ if (c >= row_len)
+ {
+ std::cout << std::endl;
+ if (r % 2)
+ std::cout << " ";
+ c = 0;
+ r++;
+ }
+ c++;
+ }
+ std::cout << std::endl;
+ }
+
+# endif // MLN_CORE_IMAGE2D_H_HH
+
+
+# ifdef MLN_CORE_BOX3D_HH
+
+ // 3D version.
+ template <typename I>
+ void
+ println(const box3d& b, const I& input)
+ {
+ point3d p;
+ int& sli = p.sli();
+ int& row = p.row();
+ int& col = p.col();
+ const int
+ max_row = b.max_row(),
+ max_sli = b.max_sli(),
+ max_col = b.max_col();
+
+ for (sli = b.min_sli(); sli <= max_sli; ++sli)
+ {
+ for (row = b.min_row(); row <= max_row; ++row)
+ {
+ for (int i = max_row; i >= row; --i)
+ std::cout << ' ';
+ for (col = b.min_col(); col <= max_col; ++col)
+ if (input.has(p))
+ std::cout << format(input(p)) << ' ';
+ else
+ std::cout << " ";
+ std::cout << std::endl;
+ }
+ std::cout << std::endl;
+ }
+ }
+
+# endif // MLN_CORE_BOX3D_HH
+
+ } // end of namespace mln::debug::impl
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::debug
+
+} // end of namespace mln
+
+
+#endif // ! MLN_DEBUG_PRINTLN_SPE_HH
Index: trunk/milena/mln/debug/println_with_border.hh
===================================================================
--- trunk/milena/mln/debug/println_with_border.hh (revision 1486)
+++ trunk/milena/mln/debug/println_with_border.hh (revision 1487)
@@ -40,6 +40,9 @@
# include <mln/core/box2d.hh>
# include <mln/core/box3d.hh>
+// Specializations are in:
+# include <mln/debug/println_with_border.spe.hh>
+
namespace mln
{
@@ -56,64 +59,23 @@
namespace impl
{
- // generic version
+ // Generic version.
template <typename S, typename I>
- void println_with_border(const S&, const I& input)
- {
- for (size_t i = 0; i < input.ncells(); i++)
- std::cout << format( input.buffer()[i] ) << ' ';
- std::cout << std::endl;
- }
-
- // 2D version
- template <typename I>
- void println_with_border(const box2d& b, const I& input)
+ void
+ println_with_border(const S&, const I& input)
{
- const std::size_t ncols = b.ncols() + 2 * input.border();
for (size_t i = 0; i < input.ncells(); i++)
- {
std::cout << format( input.buffer()[i] ) << ' ';
- if (((i+1) % ncols) == 0)
std::cout << std::endl;
}
- std::cout << std::endl;
- }
-
- // 3D version
- template <typename I>
- void println_with_border(const box3d& b, const I& input)
- {
- typedef mln_point(I) P;
-
- std::size_t len_s = b.len(P::dim - 3);
- std::size_t len_r = b.len(P::dim - 2);
- std::size_t len_c = b.len(P::dim - 1);
-
- std::size_t border = input.border ();
- std::size_t real_len_s = len_s + 2 * border;
- std::size_t real_len_c = len_c + 2 * border;
- std::size_t real_len_r = len_r + 2 * border;
- for (std::size_t k = 0; k < real_len_s; ++k)
- {
- for (std::size_t j = 0; j < real_len_r; ++j)
- {
- for (std::size_t i = 0; i < real_len_c; ++i)
- std::cout << format(input[k * (real_len_r * real_len_c) + j * real_len_c + i])
- << ' ';
- std::cout << std::endl;
- }
- std::cout << std::endl;
- }
- std::cout << std::endl;
- }
} // end of namespace mln::debug::impl
-
- // facade
+ // Facade.
template <typename I>
- void println_with_border(const Image<I>& input)
+ void
+ println_with_border(const Image<I>& input)
{
mlc_is(mln_trait_image_speed(I), trait::image::speed::fastest)::check();
1
0
URL: https://svn.lrde.org/svn/oln/trunk/milena
ChangeLog:
2007-11-15 Simon Nivault <simon.nivault(a)lrde.epita.fr>
Fix the guard oh all headers.
* mln/canvas/browsing/dir_ricard51.hh,
* mln/canvas/browsing/directional.hh,
* mln/convert/to_p_array.hh,
* mln/convert/to_p_set.hh,
* mln/core/concept/generalized_pixel.hh,
* mln/core/concept/point_iterator.hh,
* mln/core/concept/value_iterator.hh,
* mln/core/image1d.hh,
* mln/core/image2d.hh,
* mln/core/image3d.hh,
* mln/core/internal/image_if_base.hh,
* mln/core/mesh_p.hh,
* mln/core/mesh_psite.hh,
* mln/core/p_array.hh,
* mln/core/p_array_piter.hh,
* mln/core/p_priority_queue_fast.hh,
* mln/core/p_queue.hh,
* mln/core/p_queue_fast.hh,
* mln/core/p_set.hh,
* mln/core/pixter1d.hh,
* mln/core/pixter2d.hh,
* mln/core/pixter3d.hh,
* mln/core/trait/op_mult.hh,
* mln/fun/i2v/all_to.hh,
* mln/level/memcpy_.hh,
* mln/level/memset_.hh,
* mln/metal/converts_to.hh,
* mln/metal/goes_to.hh,
* mln/metal/if.hh,
* mln/metal/is.hh,
* mln/metal/is_a.hh,
* mln/metal/is_not.hh,
* mln/metal/none.hh,
* mln/win/backdiag2d.hh,
* mln/win/cube3d.hh,
* mln/win/diag2d.hh,
* mln/win/disk2d.hh,
* mln/win/hline2d.hh,
* mln/win/line.hh,
* mln/win/octagon2d.hh,
* mln/win/rectangle2d.hh,
* mln/win/segment1d.hh,
* mln/win/vline2d.hh: Fix.
---
canvas/browsing/dir_ricard51.hh | 6 +++---
canvas/browsing/directional.hh | 6 +++---
convert/to_p_array.hh | 6 +++---
convert/to_p_set.hh | 6 +++---
core/concept/generalized_pixel.hh | 6 +++---
core/concept/point_iterator.hh | 6 +++---
core/concept/value_iterator.hh | 6 +++---
core/image1d.hh | 6 +++---
core/image2d.hh | 6 +++---
core/image3d.hh | 6 +++---
core/internal/image_if_base.hh | 6 +++---
core/mesh_p.hh | 6 +++---
core/mesh_psite.hh | 6 +++---
core/p_array.hh | 6 +++---
core/p_array_piter.hh | 6 +++---
core/p_priority_queue_fast.hh | 6 +++---
core/p_queue.hh | 6 +++---
core/p_queue_fast.hh | 6 +++---
core/p_set.hh | 6 +++---
core/pixter1d.hh | 6 +++---
core/pixter2d.hh | 6 +++---
core/pixter3d.hh | 6 +++---
core/trait/op_mult.hh | 6 +++---
fun/i2v/all_to.hh | 6 +++---
level/memcpy_.hh | 6 +++---
level/memset_.hh | 6 +++---
metal/converts_to.hh | 6 +++---
metal/goes_to.hh | 6 +++---
metal/if.hh | 6 +++---
metal/is.hh | 6 +++---
metal/is_a.hh | 6 +++---
metal/is_not.hh | 6 +++---
metal/none.hh | 6 +++---
win/backdiag2d.hh | 6 +++---
win/cube3d.hh | 6 +++---
win/diag2d.hh | 6 +++---
win/disk2d.hh | 6 +++---
win/hline2d.hh | 6 +++---
win/line.hh | 6 +++---
win/octagon2d.hh | 6 +++---
win/rectangle2d.hh | 6 +++---
win/segment1d.hh | 6 +++---
win/vline2d.hh | 6 +++---
43 files changed, 129 insertions(+), 129 deletions(-)
Index: trunk/milena/mln/core/mesh_psite.hh
===================================================================
--- trunk/milena/mln/core/mesh_psite.hh (revision 1485)
+++ trunk/milena/mln/core/mesh_psite.hh (revision 1486)
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_MESH_PSITE_HH
-# define MLN_MESH_PSITE_HH
+#ifndef MLN_CORE_MESH_PSITE_HH
+# define MLN_CORE_MESH_PSITE_HH
/*! \file mln/core/mesh_psite.hh
*
@@ -100,4 +100,4 @@
} // end of mln
-#endif // MLN_MESH_PSITE_HH
+#endif // MLN_CORE_MESH_PSITE_HH
Index: trunk/milena/mln/core/p_queue.hh
===================================================================
--- trunk/milena/mln/core/p_queue.hh (revision 1485)
+++ trunk/milena/mln/core/p_queue.hh (revision 1486)
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_CORE_QUEUE_P_HH
-# define MLN_CORE_QUEUE_P_HH
+#ifndef MLN_CORE_P_QUEUE_HH
+# define MLN_CORE_P_QUEUE_HH
/*! \file mln/core/p_queue.hh
*
@@ -280,4 +280,4 @@
} // end of namespace mln
-#endif // ! MLN_CORE_QUEUE_P_HH
+#endif // ! MLN_CORE_P_QUEUE_HH
Index: trunk/milena/mln/core/mesh_p.hh
===================================================================
--- trunk/milena/mln/core/mesh_p.hh (revision 1485)
+++ trunk/milena/mln/core/mesh_p.hh (revision 1486)
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_MESH_P_HH
-# define MLN_MESH_P_HH
+#ifndef MLN_CORE_MESH_P_HH
+# define MLN_CORE_MESH_P_HH
# include <mln/core/concept/point_site.hh>
# include <mln/core/internal/point_set_base.hh>
@@ -116,4 +116,4 @@
} // end of mln
-#endif // MLN_MESH_P_HH
+#endif // MLN_CORE_MESH_P_HH
Index: trunk/milena/mln/core/internal/image_if_base.hh
===================================================================
--- trunk/milena/mln/core/internal/image_if_base.hh (revision 1485)
+++ trunk/milena/mln/core/internal/image_if_base.hh (revision 1486)
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_CORE_IMAGE_IF_BASE_HH
-# define MLN_CORE_IMAGE_IF_BASE_HH
+#ifndef MLN_CORE_INTERNAL_IMAGE_IF_BASE_HH
+# define MLN_CORE_INTERNAL_IMAGE_IF_BASE_HH
/*! \file mln/core/internal/image_if_base.hh
*
@@ -193,4 +193,4 @@
} // end of namespace mln
-#endif // ! MLN_CORE_IMAGE_IF_BASE_HH
+#endif // ! MLN_CORE_INTERNAL_IMAGE_IF_BASE_HH
Index: trunk/milena/mln/core/p_priority_queue_fast.hh
===================================================================
--- trunk/milena/mln/core/p_priority_queue_fast.hh (revision 1485)
+++ trunk/milena/mln/core/p_priority_queue_fast.hh (revision 1486)
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_CORE_QUEUE_P_FAST_PRIORITY_HH
-# define MLN_CORE_QUEUE_P_FAST_PRIORITY_HH
+#ifndef MLN_CORE_P_PRIORITY_QUEUE_FAST_HH
+# define MLN_CORE_P_PRIORITY_QUEUE_FAST_HH
/*! \file mln/core/p_priority_queue_fast.hh
*
@@ -334,4 +334,4 @@
} // end of namespace mln
-#endif // ! MLN_CORE_QUEUE_P_FAST_PRIORITY_HH
+#endif // ! MLN_CORE_P_PRIORITY_QUEUE_FAST_HH
Index: trunk/milena/mln/core/p_set.hh
===================================================================
--- trunk/milena/mln/core/p_set.hh (revision 1485)
+++ trunk/milena/mln/core/p_set.hh (revision 1486)
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_CORE_SET_P_HH
-# define MLN_CORE_SET_P_HH
+#ifndef MLN_CORE_P_SET_HH
+# define MLN_CORE_P_SET_HH
/*! \file mln/core/p_set.hh
*
@@ -169,4 +169,4 @@
} // end of namespace mln
-#endif // ! MLN_CORE_SET_P_HH
+#endif // ! MLN_CORE_P_SET_HH
Index: trunk/milena/mln/core/trait/op_mult.hh
===================================================================
--- trunk/milena/mln/core/trait/op_mult.hh (revision 1485)
+++ trunk/milena/mln/core/trait/op_mult.hh (revision 1486)
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_TRAIT_OP_MULT_HH
-# define MLN_TRAIT_OP_MULT_HH
+#ifndef MLN_CORE_TRAIT_OP_MULT_HH
+# define MLN_CORE_TRAIT_OP_MULT_HH
/*!
* \file mln/core/trait/op_mult.hh
@@ -145,4 +145,4 @@
} // end of namespace mln
-#endif // ! MLN_TRAIT_OP_MULT_HH
+#endif // ! MLN_CORE_TRAIT_OP_MULT_HH
Index: trunk/milena/mln/core/pixter1d.hh
===================================================================
--- trunk/milena/mln/core/pixter1d.hh (revision 1485)
+++ trunk/milena/mln/core/pixter1d.hh (revision 1486)
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_CORE_PIXTER1D_B_HH
-# define MLN_CORE_PIXTER1D_B_HH
+#ifndef MLN_CORE_PIXTER1D_HH
+# define MLN_CORE_PIXTER1D_HH
/*! \file mln/core/pixter1d.hh
*
@@ -87,4 +87,4 @@
} // end of namespace mln
-#endif // ! MLN_CORE_PIXTER1D_B_HH
+#endif // ! MLN_CORE_PIXTER1D_HH
Index: trunk/milena/mln/core/pixter2d.hh
===================================================================
--- trunk/milena/mln/core/pixter2d.hh (revision 1485)
+++ trunk/milena/mln/core/pixter2d.hh (revision 1486)
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_CORE_PIXTER2D_B_HH
-# define MLN_CORE_PIXTER2D_B_HH
+#ifndef MLN_CORE_PIXTER2D_HH
+# define MLN_CORE_PIXTER2D_HH
/*! \file mln/core/pixter2d.hh
*
@@ -172,4 +172,4 @@
} // end of namespace mln
-#endif // ! MLN_CORE_PIXTER2D_B_HH
+#endif // ! MLN_CORE_PIXTER2D_HH
Index: trunk/milena/mln/core/pixter3d.hh
===================================================================
--- trunk/milena/mln/core/pixter3d.hh (revision 1485)
+++ trunk/milena/mln/core/pixter3d.hh (revision 1486)
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_CORE_PIXTER3D_B_HH
-# define MLN_CORE_PIXTER3D_B_HH
+#ifndef MLN_CORE_PIXTER3D_HH
+# define MLN_CORE_PIXTER3D_HH
/*! \file mln/core/pixter3d.hh
*
@@ -127,4 +127,4 @@
} // end of namespace mln
-#endif // ! MLN_CORE_PIXTER3D_B_HH
+#endif // ! MLN_CORE_PIXTER3D_HH
Index: trunk/milena/mln/core/p_queue_fast.hh
===================================================================
--- trunk/milena/mln/core/p_queue_fast.hh (revision 1485)
+++ trunk/milena/mln/core/p_queue_fast.hh (revision 1486)
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_CORE_QUEUE_P_FAST_HH
-# define MLN_CORE_QUEUE_P_FAST_HH
+#ifndef MLN_CORE_P_QUEUE_FAST_HH
+# define MLN_CORE_P_QUEUE_FAST_HH
/*! \file mln/core/p_queue_fast.hh
*
@@ -289,4 +289,4 @@
} // end of namespace mln
-#endif // ! MLN_CORE_QUEUE_P_FAST_HH
+#endif // ! MLN_CORE_P_QUEUE_FAST_HH
Index: trunk/milena/mln/core/concept/value_iterator.hh
===================================================================
--- trunk/milena/mln/core/concept/value_iterator.hh (revision 1485)
+++ trunk/milena/mln/core/concept/value_iterator.hh (revision 1486)
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_CORE_CONCEPT_VITER_HH
-# define MLN_CORE_CONCEPT_VITER_HH
+#ifndef MLN_CORE_CONCEPT_VALUE_ITERATOR_HH
+# define MLN_CORE_CONCEPT_VALUE_ITERATOR_HH
/*! \file mln/core/concept/value_iterator.hh
*
@@ -101,4 +101,4 @@
} // end of namespace mln
-#endif // ! MLN_CORE_CONCEPT_VITER_HH
+#endif // ! MLN_CORE_CONCEPT_VALUE_ITERATOR_HH
Index: trunk/milena/mln/core/concept/generalized_pixel.hh
===================================================================
--- trunk/milena/mln/core/concept/generalized_pixel.hh (revision 1485)
+++ trunk/milena/mln/core/concept/generalized_pixel.hh (revision 1486)
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_CORE_CONCEPT_GENPIXEL_HH
-# define MLN_CORE_CONCEPT_GENPIXEL_HH
+#ifndef MLN_CORE_CONCEPT_GENERALIZED_PIXEL_HH
+# define MLN_CORE_CONCEPT_GENERALIZED_PIXEL_HH
/*! \file mln/core/concept/generalized_pixel.hh
*
@@ -101,4 +101,4 @@
} // end of namespace mln
-#endif // ! MLN_CORE_CONCEPT_GENPIXEL_HH
+#endif // ! MLN_CORE_CONCEPT_GENERALIZED_PIXEL_HH
Index: trunk/milena/mln/core/concept/point_iterator.hh
===================================================================
--- trunk/milena/mln/core/concept/point_iterator.hh (revision 1485)
+++ trunk/milena/mln/core/concept/point_iterator.hh (revision 1486)
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_CORE_CONCEPT_PITER_HH
-# define MLN_CORE_CONCEPT_PITER_HH
+#ifndef MLN_CORE_CONCEPT_POINT_ITERATOR_HH
+# define MLN_CORE_CONCEPT_POINT_ITERATOR_HH
/*! \file mln/core/concept/point_iterator.hh
*
@@ -113,4 +113,4 @@
} // end of namespace mln
-#endif // ! MLN_CORE_CONCEPT_PITER_HH
+#endif // ! MLN_CORE_CONCEPT_POINT_ITERATOR_HH
Index: trunk/milena/mln/core/p_array.hh
===================================================================
--- trunk/milena/mln/core/p_array.hh (revision 1485)
+++ trunk/milena/mln/core/p_array.hh (revision 1486)
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_CORE_VEC_P_HH
-# define MLN_CORE_VEC_P_HH
+#ifndef MLN_CORE_P_ARRAY_HH
+# define MLN_CORE_P_ARRAY_HH
/*! \file mln/core/p_array.hh
*
@@ -219,4 +219,4 @@
# include <mln/core/p_array_piter.hh>
-#endif // ! MLN_CORE_VEC_P_HH
+#endif // ! MLN_CORE_P_ARRAY_HH
Index: trunk/milena/mln/core/p_array_piter.hh
===================================================================
--- trunk/milena/mln/core/p_array_piter.hh (revision 1485)
+++ trunk/milena/mln/core/p_array_piter.hh (revision 1486)
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_CORE_VEC_P_PITER_HH
-# define MLN_CORE_VEC_P_PITER_HH
+#ifndef MLN_CORE_P_ARRAY_PITER_HH
+# define MLN_CORE_P_ARRAY_PITER_HH
/*! \file mln/core/p_array_piter.hh
*
@@ -269,4 +269,4 @@
} // end of namespace mln
-#endif // ! MLN_CORE_VEC_P_PITER_HH
+#endif // ! MLN_CORE_P_ARRAY_PITER_HH
Index: trunk/milena/mln/core/image1d.hh
===================================================================
--- trunk/milena/mln/core/image1d.hh (revision 1485)
+++ trunk/milena/mln/core/image1d.hh (revision 1486)
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_CORE_IMAGE1D_B_HH
-# define MLN_CORE_IMAGE1D_B_HH
+#ifndef MLN_CORE_IMAGE1D_HH
+# define MLN_CORE_IMAGE1D_HH
/*! \file mln/core/image1d.hh
*
@@ -532,4 +532,4 @@
} // end of namespace mln
-#endif // ! MLN_CORE_IMAGE1D_B_HH
+#endif // ! MLN_CORE_IMAGE1D_HH
Index: trunk/milena/mln/core/image2d.hh
===================================================================
--- trunk/milena/mln/core/image2d.hh (revision 1485)
+++ trunk/milena/mln/core/image2d.hh (revision 1486)
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_CORE_IMAGE2D_B_HH
-# define MLN_CORE_IMAGE2D_B_HH
+#ifndef MLN_CORE_IMAGE2D_HH
+# define MLN_CORE_IMAGE2D_HH
/*! \file mln/core/image2d.hh
*
@@ -579,4 +579,4 @@
# include <mln/make/image2d.hh>
-#endif // ! MLN_CORE_IMAGE2D_B_HH
+#endif // ! MLN_CORE_IMAGE2D_HH
Index: trunk/milena/mln/core/image3d.hh
===================================================================
--- trunk/milena/mln/core/image3d.hh (revision 1485)
+++ trunk/milena/mln/core/image3d.hh (revision 1486)
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_CORE_IMAGE3D_B_HH
-# define MLN_CORE_IMAGE3D_B_HH
+#ifndef MLN_CORE_IMAGE3D_HH
+# define MLN_CORE_IMAGE3D_HH
/*! \file mln/core/image3d.hh
*
@@ -571,4 +571,4 @@
} // end of namespace mln
-#endif // ! MLN_CORE_IMAGE3D_B_HH
+#endif // ! MLN_CORE_IMAGE3D_HH
Index: trunk/milena/mln/metal/is_not.hh
===================================================================
--- trunk/milena/mln/metal/is_not.hh (revision 1485)
+++ trunk/milena/mln/metal/is_not.hh (revision 1486)
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_CORE_METAL_IS_NOT_HH
-# define MLN_CORE_METAL_IS_NOT_HH
+#ifndef MLN_METAL_IS_NOT_HH
+# define MLN_METAL_IS_NOT_HH
/*! \file mln/metal/is_not.hh
*
@@ -60,4 +60,4 @@
} // end of namespace mln
-#endif // ! MLN_CORE_METAL_IS_NOT_HH
+#endif // ! MLN_METAL_IS_NOT_HH
Index: trunk/milena/mln/metal/if.hh
===================================================================
--- trunk/milena/mln/metal/if.hh (revision 1485)
+++ trunk/milena/mln/metal/if.hh (revision 1486)
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_CORE_METAL_IF_HH
-# define MLN_CORE_METAL_IF_HH
+#ifndef MLN_METAL_IF_HH
+# define MLN_METAL_IF_HH
/*! \file mln/metal/if.hh
*
@@ -82,4 +82,4 @@
} // end of namespace mln
-#endif // ! MLN_CORE_METAL_IF_HH
+#endif // ! MLN_METAL_IF_HH
Index: trunk/milena/mln/metal/goes_to.hh
===================================================================
--- trunk/milena/mln/metal/goes_to.hh (revision 1485)
+++ trunk/milena/mln/metal/goes_to.hh (revision 1486)
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_CORE_METAL_GOES_TO_HH
-# define MLN_CORE_METAL_GOES_TO_HH
+#ifndef MLN_METAL_GOES_TO_HH
+# define MLN_METAL_GOES_TO_HH
/*! \file mln/metal/goes_to.hh
*
@@ -61,4 +61,4 @@
} // end of namespace mln
-#endif // ! MLN_CORE_METAL_GOES_TO_HH
+#endif // ! MLN_METAL_GOES_TO_HH
Index: trunk/milena/mln/metal/none.hh
===================================================================
--- trunk/milena/mln/metal/none.hh (revision 1485)
+++ trunk/milena/mln/metal/none.hh (revision 1486)
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_CORE_METAL_NONE_HH
-# define MLN_CORE_METAL_NONE_HH
+#ifndef MLN_METAL_NONE_HH
+# define MLN_METAL_NONE_HH
/*! \file mln/metal/none.hh
*
@@ -54,4 +54,4 @@
} // end of namespace mln
-#endif // ! MLN_CORE_METAL_NONE_HH
+#endif // ! MLN_METAL_NONE_HH
Index: trunk/milena/mln/metal/converts_to.hh
===================================================================
--- trunk/milena/mln/metal/converts_to.hh (revision 1485)
+++ trunk/milena/mln/metal/converts_to.hh (revision 1486)
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_CORE_METAL_CONVERTS_TO_HH
-# define MLN_CORE_METAL_CONVERTS_TO_HH
+#ifndef MLN_METAL_CONVERTS_TO_HH
+# define MLN_METAL_CONVERTS_TO_HH
/*! \file mln/metal/converts_to.hh
*
@@ -76,4 +76,4 @@
} // end of namespace mln
-#endif // ! MLN_CORE_METAL_CONVERTS_TO_HH
+#endif // ! MLN_METAL_CONVERTS_TO_HH
Index: trunk/milena/mln/metal/is_a.hh
===================================================================
--- trunk/milena/mln/metal/is_a.hh (revision 1485)
+++ trunk/milena/mln/metal/is_a.hh (revision 1486)
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_CORE_METAL_IS_A_HH
-# define MLN_CORE_METAL_IS_A_HH
+#ifndef MLN_METAL_IS_A_HH
+# define MLN_METAL_IS_A_HH
/*! \file mln/metal/is_a.hh
*
@@ -91,4 +91,4 @@
} // end of namespace mln
-#endif // ! MLN_CORE_METAL_IS_A_HH
+#endif // ! MLN_METAL_IS_A_HH
Index: trunk/milena/mln/metal/is.hh
===================================================================
--- trunk/milena/mln/metal/is.hh (revision 1485)
+++ trunk/milena/mln/metal/is.hh (revision 1486)
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_CORE_METAL_IS_HH
-# define MLN_CORE_METAL_IS_HH
+#ifndef MLN_METAL_IS_HH
+# define MLN_METAL_IS_HH
/*! \file mln/metal/is.hh
*
@@ -88,4 +88,4 @@
} // end of namespace mln
-#endif // ! MLN_CORE_METAL_IS_HH
+#endif // ! MLN_METAL_IS_HH
Index: trunk/milena/mln/level/memset_.hh
===================================================================
--- trunk/milena/mln/level/memset_.hh (revision 1485)
+++ trunk/milena/mln/level/memset_.hh (revision 1486)
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_LEVEL_MEMSET_HH
-# define MLN_LEVEL_MEMSET_HH
+#ifndef MLN_LEVEL_MEMSET__HH
+# define MLN_LEVEL_MEMSET__HH
/*! \file mln/level/memset_.hh
*
@@ -131,4 +131,4 @@
} // end of namespace mln
-#endif // ! MLN_LEVEL_MEMSET_HH
+#endif // ! MLN_LEVEL_MEMSET__HH
Index: trunk/milena/mln/level/memcpy_.hh
===================================================================
--- trunk/milena/mln/level/memcpy_.hh (revision 1485)
+++ trunk/milena/mln/level/memcpy_.hh (revision 1486)
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_LEVEL_MEMCPY_HH
-# define MLN_LEVEL_MEMCPY_HH
+#ifndef MLN_LEVEL_MEMCPY__HH
+# define MLN_LEVEL_MEMCPY__HH
/*! \file mln/level/memcpy_.hh
*
@@ -109,4 +109,4 @@
} // end of namespace mln
-#endif // ! MLN_LEVEL_MEMCPY_HH
+#endif // ! MLN_LEVEL_MEMCPY__HH
Index: trunk/milena/mln/convert/to_p_set.hh
===================================================================
--- trunk/milena/mln/convert/to_p_set.hh (revision 1485)
+++ trunk/milena/mln/convert/to_p_set.hh (revision 1486)
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_CONVERT_TO_SET_P_HH
-# define MLN_CONVERT_TO_SET_P_HH
+#ifndef MLN_CONVERT_TO_P_SET_HH
+# define MLN_CONVERT_TO_P_SET_HH
/*! \file mln/convert/to_p_set.hh
*
@@ -146,4 +146,4 @@
} // end of namespace mln
-#endif // ! MLN_CONVERT_TO_SET_P_HH
+#endif // ! MLN_CONVERT_TO_P_SET_HH
Index: trunk/milena/mln/convert/to_p_array.hh
===================================================================
--- trunk/milena/mln/convert/to_p_array.hh (revision 1485)
+++ trunk/milena/mln/convert/to_p_array.hh (revision 1486)
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_CONVERT_TO_VEC_P_HH
-# define MLN_CONVERT_TO_VEC_P_HH
+#ifndef MLN_CONVERT_TO_P_ARRAY_HH
+# define MLN_CONVERT_TO_P_ARRAY_HH
/*! \file mln/convert/to_p_array.hh
*
@@ -85,4 +85,4 @@
} // end of namespace mln
-#endif // ! MLN_CONVERT_TO_VEC_P_HH
+#endif // ! MLN_CONVERT_TO_P_ARRAY_HH
Index: trunk/milena/mln/fun/i2v/all_to.hh
===================================================================
--- trunk/milena/mln/fun/i2v/all_to.hh (revision 1485)
+++ trunk/milena/mln/fun/i2v/all_to.hh (revision 1486)
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_FUN_ALL_TO_HH
-# define MLN_FUN_ALL_TO_HH
+#ifndef MLN_FUN_I2V_ALL_TO_HH
+# define MLN_FUN_I2V_ALL_TO_HH
/*! \file mln/fun/i2v/all_to.hh
*
@@ -102,4 +102,4 @@
} // end of namespace mln
-#endif // ! MLN_FUN_ALL_TO_HH
+#endif // ! MLN_FUN_I2V_ALL_TO_HH
Index: trunk/milena/mln/win/vline2d.hh
===================================================================
--- trunk/milena/mln/win/vline2d.hh (revision 1485)
+++ trunk/milena/mln/win/vline2d.hh (revision 1486)
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_CORE_WIN_VLINE2D_HH
-# define MLN_CORE_WIN_VLINE2D_HH
+#ifndef MLN_WIN_VLINE2D_HH
+# define MLN_WIN_VLINE2D_HH
/*! \file mln/win/vline2d.hh
*
@@ -62,4 +62,4 @@
-#endif // ! MLN_CORE_WIN_VLINE2D_HH
+#endif // ! MLN_WIN_VLINE2D_HH
Index: trunk/milena/mln/win/cube3d.hh
===================================================================
--- trunk/milena/mln/win/cube3d.hh (revision 1485)
+++ trunk/milena/mln/win/cube3d.hh (revision 1486)
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_CORE_WIN_CUBE3D_HH
-# define MLN_CORE_WIN_CUBE3D_HH
+#ifndef MLN_WIN_CUBE3D_HH
+# define MLN_WIN_CUBE3D_HH
/*! \file mln/win/cube3d.hh
*
@@ -190,4 +190,4 @@
-#endif // ! MLN_CORE_WIN_CUBE3D_HH
+#endif // ! MLN_WIN_CUBE3D_HH
Index: trunk/milena/mln/win/hline2d.hh
===================================================================
--- trunk/milena/mln/win/hline2d.hh (revision 1485)
+++ trunk/milena/mln/win/hline2d.hh (revision 1486)
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_CORE_WIN_HLINE2D_HH
-# define MLN_CORE_WIN_HLINE2D_HH
+#ifndef MLN_WIN_HLINE2D_HH
+# define MLN_WIN_HLINE2D_HH
/*! \file mln/win/hline2d.hh
*
@@ -60,4 +60,4 @@
-#endif // ! MLN_CORE_WIN_HLINE2D_HH
+#endif // ! MLN_WIN_HLINE2D_HH
Index: trunk/milena/mln/win/line.hh
===================================================================
--- trunk/milena/mln/win/line.hh (revision 1485)
+++ trunk/milena/mln/win/line.hh (revision 1486)
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_CORE_WIN_LINE_HH
-# define MLN_CORE_WIN_LINE_HH
+#ifndef MLN_WIN_LINE_HH
+# define MLN_WIN_LINE_HH
/*! \file mln/win/line.hh
*
@@ -180,4 +180,4 @@
-#endif // ! MLN_CORE_WIN_LINE_HH
+#endif // ! MLN_WIN_LINE_HH
Index: trunk/milena/mln/win/segment1d.hh
===================================================================
--- trunk/milena/mln/win/segment1d.hh (revision 1485)
+++ trunk/milena/mln/win/segment1d.hh (revision 1486)
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_CORE_WIN_SEGMENT1D_HH
-# define MLN_CORE_WIN_SEGMENT1D_HH
+#ifndef MLN_WIN_SEGMENT1D_HH
+# define MLN_WIN_SEGMENT1D_HH
/*! \file mln/win/segment1d.hh
*
@@ -178,4 +178,4 @@
-#endif // ! MLN_CORE_WIN_SEGMENT1D_HH
+#endif // ! MLN_WIN_SEGMENT1D_HH
Index: trunk/milena/mln/win/diag2d.hh
===================================================================
--- trunk/milena/mln/win/diag2d.hh (revision 1485)
+++ trunk/milena/mln/win/diag2d.hh (revision 1486)
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_CORE_WIN_DIAG2D_HH
-# define MLN_CORE_WIN_DIAG2D_HH
+#ifndef MLN_WIN_DIAG2D_HH
+# define MLN_WIN_DIAG2D_HH
/*! \file mln/win/diag2d.hh
*
@@ -182,4 +182,4 @@
-#endif // ! MLN_CORE_WIN_DIAG2D_HH
+#endif // ! MLN_WIN_DIAG2D_HH
Index: trunk/milena/mln/win/rectangle2d.hh
===================================================================
--- trunk/milena/mln/win/rectangle2d.hh (revision 1485)
+++ trunk/milena/mln/win/rectangle2d.hh (revision 1486)
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_CORE_WIN_RECTANGLE2D_HH
-# define MLN_CORE_WIN_RECTANGLE2D_HH
+#ifndef MLN_WIN_RECTANGLE2D_HH
+# define MLN_WIN_RECTANGLE2D_HH
/*! \file mln/win/rectangle2d.hh
*
@@ -204,4 +204,4 @@
# include <mln/win/vline2d.hh>
-#endif // ! MLN_CORE_WIN_RECTANGLE2D_HH
+#endif // ! MLN_WIN_RECTANGLE2D_HH
Index: trunk/milena/mln/win/backdiag2d.hh
===================================================================
--- trunk/milena/mln/win/backdiag2d.hh (revision 1485)
+++ trunk/milena/mln/win/backdiag2d.hh (revision 1486)
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_CORE_WIN_BACKDIAG2D_HH
-# define MLN_CORE_WIN_BACKDIAG2D_HH
+#ifndef MLN_WIN_BACKDIAG2D_HH
+# define MLN_WIN_BACKDIAG2D_HH
/*! \file mln/win/backdiag2d.hh
*
@@ -182,4 +182,4 @@
-#endif // ! MLN_CORE_WIN_BACKDIAG2D_HH
+#endif // ! MLN_WIN_BACKDIAG2D_HH
Index: trunk/milena/mln/win/disk2d.hh
===================================================================
--- trunk/milena/mln/win/disk2d.hh (revision 1485)
+++ trunk/milena/mln/win/disk2d.hh (revision 1486)
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_CORE_WIN_DISK2D_HH
-# define MLN_CORE_WIN_DISK2D_HH
+#ifndef MLN_WIN_DISK2D_HH
+# define MLN_WIN_DISK2D_HH
/*! \file mln/win/disk2d.hh
*
@@ -176,4 +176,4 @@
-#endif // ! MLN_CORE_WIN_DISK2D_HH
+#endif // ! MLN_WIN_DISK2D_HH
Index: trunk/milena/mln/win/octagon2d.hh
===================================================================
--- trunk/milena/mln/win/octagon2d.hh (revision 1485)
+++ trunk/milena/mln/win/octagon2d.hh (revision 1486)
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_CORE_WIN_OCTAGON2D_HH
-# define MLN_CORE_WIN_OCTAGON2D_HH
+#ifndef MLN_WIN_OCTAGON2D_HH
+# define MLN_WIN_OCTAGON2D_HH
/*! \file mln/win/octagon2d.hh
*
@@ -223,4 +223,4 @@
# include <mln/win/diag2d.hh>
# include <mln/win/backdiag2d.hh>
-#endif // ! MLN_CORE_WIN_OCTAGON2D_HH
+#endif // ! MLN_WIN_OCTAGON2D_HH
Index: trunk/milena/mln/canvas/browsing/dir_ricard51.hh
===================================================================
--- trunk/milena/mln/canvas/browsing/dir_ricard51.hh (revision 1485)
+++ trunk/milena/mln/canvas/browsing/dir_ricard51.hh (revision 1486)
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_CANVAS_DIR_RICARD51_HH
-# define MLN_CANVAS_DIR_RICARD51_HH
+#ifndef MLN_CANVAS_BROWSING_DIR_RICARD51_HH
+# define MLN_CANVAS_BROWSING_DIR_RICARD51_HH
/*! \file mln/canvas/browsing/dir_ricard51.hh
*
@@ -170,4 +170,4 @@
} // end of namespace mln
-#endif // ! MLN_CANVAS_DIR_RICARD51_HH
+#endif // ! MLN_CANVAS_BROWSING_DIR_RICARD51_HH
Index: trunk/milena/mln/canvas/browsing/directional.hh
===================================================================
--- trunk/milena/mln/canvas/browsing/directional.hh (revision 1485)
+++ trunk/milena/mln/canvas/browsing/directional.hh (revision 1486)
@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_CANVAS_DIRECTIONAL_HH
-# define MLN_CANVAS_DIRECTIONAL_HH
+#ifndef MLN_CANVAS_BROWSING_DIRECTIONAL_HH
+# define MLN_CANVAS_BROWSING_DIRECTIONAL_HH
/*! \file mln/canvas/browsing/directional.hh
*
@@ -115,4 +115,4 @@
} // end of namespace mln
-#endif // ! MLN_CANVAS_DIRECTIONAL_HH
+#endif // ! MLN_CANVAS_BROWSING_DIRECTIONAL_HH
1
0
URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena
ChangeLog:
2007-11-15 Guillaume Duhamel <guillaume.duhamel(a)lrde.epita.fr>
Move level test in level tests repertory.
* tests/level/abs.cc: New.
* tests/level/apply.cc: New.
* tests/level/approx: New.
* tests/level/approx_median.cc: New.
* tests/level/assign.cc: New.
* tests/level/fill.cc: New.
* tests/level/median.cc: New.
* tests/level/median_dir.cc: New.
* tests/level/median_fast.cc: New.
* tests/level/median_hline2d.cc: New.
* tests/level/memcpy_.cc: New.
* tests/level/memset_.cc: New.
* tests/level/naive/median.cc: New.
* tests/level/naive: New.
* tests/level/paste.cc: New.
* tests/level/transform.cc: New.
* tests/level: New.
* tests/level_approx_median.cc: Remove.
* tests/level_assign.cc: Remove.
* tests/level_fill.cc: Remove.
* tests/level_median.cc: Remove.
* tests/level_median_dir.cc: Remove.
* tests/level_median_fast.cc: Remove.
* tests/level_median_hline2d.cc: Remove.
* tests/level_memcpy_.cc: Remove.
* tests/level_memset_.cc: Remove.
* tests/level_naive_median.cc: Remove.
* tests/level_paste.cc: Remove.
* tests/level_transform.cc: Remove.
---
abs.cc | 60 +++++++++++++++++++++++++++++++
apply.cc | 57 +++++++++++++++++++++++++++++
approx_median.cc | 62 ++++++++++++++++++++++++++++++++
assign.cc | 48 ++++++++++++++++++++++++
fill.cc | 70 ++++++++++++++++++++++++++++++++++++
median.cc | 59 ++++++++++++++++++++++++++++++
median_dir.cc | 55 ++++++++++++++++++++++++++++
median_fast.cc | 104 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
median_hline2d.cc | 64 +++++++++++++++++++++++++++++++++
memcpy_.cc | 58 ++++++++++++++++++++++++++++++
memset_.cc | 53 +++++++++++++++++++++++++++
naive/median.cc | 58 ++++++++++++++++++++++++++++++
paste.cc | 62 ++++++++++++++++++++++++++++++++
transform.cc | 66 ++++++++++++++++++++++++++++++++++
14 files changed, 876 insertions(+)
Index: trunk/milena/tests/level_naive_median.cc (deleted)
===================================================================
Index: trunk/milena/tests/level_median_hline2d.cc (deleted)
===================================================================
Index: trunk/milena/tests/level_transform.cc (deleted)
===================================================================
Index: trunk/milena/tests/level_memcpy_.cc (deleted)
===================================================================
Index: trunk/milena/tests/level_median.cc (deleted)
===================================================================
Index: trunk/milena/tests/level_median_dir.cc (deleted)
===================================================================
Index: trunk/milena/tests/level_fill.cc (deleted)
===================================================================
Index: trunk/milena/tests/level_median_fast.cc (deleted)
===================================================================
Index: trunk/milena/tests/level_approx_median.cc (deleted)
===================================================================
Index: trunk/milena/tests/level_paste.cc (deleted)
===================================================================
Index: trunk/milena/tests/level_assign.cc (deleted)
===================================================================
Index: trunk/milena/tests/level_memset_.cc (deleted)
===================================================================
Index: trunk/milena/tests/level/transform.cc
===================================================================
--- trunk/milena/tests/level/transform.cc (revision 0)
+++ trunk/milena/tests/level/transform.cc (revision 1485)
@@ -0,0 +1,66 @@
+// Copyright (C) 2007 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
+// 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/level/transform.cc
+ *
+ * \brief Tests on mln::level::transform
+ */
+
+#include <cmath>
+
+#include <mln/core/image2d.hh>
+#include <mln/level/transform.hh>
+#include <mln/debug/iota.hh>
+
+
+struct mysqrt : mln::Function_v2v<mysqrt>
+{
+ typedef unsigned short result;
+ result operator()(unsigned short c) const
+ {
+ return result( std::sqrt(float(c)) );
+ }
+};
+
+
+
+int main()
+{
+ using namespace mln;
+
+ const unsigned size = 10000;
+ image2d<unsigned short>
+ ima(size, size);
+
+ (std::cout << "iota... ").flush();
+ debug::iota(ima);
+ std::cout << "done" << std::endl;
+
+ (std::cout << "transform... ").flush();
+ level::transform(ima, mysqrt(), ima);
+ std::cout << "done" << std::endl;
+}
Index: trunk/milena/tests/level/median_dir.cc
===================================================================
--- trunk/milena/tests/level/median_dir.cc (revision 0)
+++ trunk/milena/tests/level/median_dir.cc (revision 1485)
@@ -0,0 +1,55 @@
+// Copyright (C) 2007 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
+// 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/level/median_dir.cc
+ *
+ * \brief Test on mln::level::median.
+ */
+
+#include <mln/core/image2d.hh>
+
+#include <mln/io/pgm/load.hh>
+#include <mln/io/pgm/save.hh>
+
+#include <mln/value/int_u8.hh>
+#include <mln/level/median.hh>
+
+
+int main()
+{
+ using namespace mln;
+ using value::int_u8;
+
+ border::thickness = 7;
+
+ image2d<int_u8>
+ lena = io::pgm::load("../img/lena.pgm"),
+ out(lena.domain());
+
+ level::median_dir(lena, 1, 15, out);
+ io::pgm::save(out, "out.pgm");
+}
Index: trunk/milena/tests/level/paste.cc
===================================================================
--- trunk/milena/tests/level/paste.cc (revision 0)
+++ trunk/milena/tests/level/paste.cc (revision 1485)
@@ -0,0 +1,62 @@
+// Copyright (C) 2007 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
+// 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/level/paste.cc
+ *
+ * \brief Tests on mln::level::paste.
+ */
+
+#include <mln/core/image2d.hh>
+#include <mln/level/fill.hh>
+#include <mln/level/paste.hh>
+
+#include <mln/debug/iota.hh>
+#include <mln/debug/println.hh>
+
+
+int main()
+{
+ using namespace mln;
+
+ box2d b(make::point2d(1,2), make::point2d(2,4));
+ image2d<int> ima(b, 2);
+ debug::iota(ima);
+ debug::println(ima);
+
+
+ box2d b2(make::point2d(-1,-2), make::point2d(3,6));
+ image2d<int> ima2(b2, 0);
+ debug::iota(ima2);
+ debug::println(ima2);
+
+ trace::quiet = false;
+
+ level::paste(ima, ima2); // Fast version.
+ debug::println(ima2);
+
+ level::impl::generic::paste_(ima, ima2); // Not so fast version...
+}
Index: trunk/milena/tests/level/median.cc
===================================================================
--- trunk/milena/tests/level/median.cc (revision 0)
+++ trunk/milena/tests/level/median.cc (revision 1485)
@@ -0,0 +1,59 @@
+// Copyright (C) 2007 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
+// 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/level/median.cc
+ *
+ * \brief Test on mln::level::median.
+ */
+
+#include <mln/core/image2d.hh>
+#include <mln/win/rectangle2d.hh>
+
+#include <mln/io/pgm/load.hh>
+#include <mln/io/pgm/save.hh>
+
+#include <mln/value/int_u8.hh>
+#include <mln/level/median.hh>
+
+
+
+
+int main()
+{
+ using namespace mln;
+ using value::int_u8;
+
+ win::rectangle2d rect(51, 51);
+ border::thickness = 52;
+
+ image2d<int_u8>
+ lena = io::pgm::load("../img/lena.pgm"),
+ out(lena.domain());
+
+ level::median(lena, rect, out);
+ io::pgm::save(out, "out.pgm");
+}
Index: trunk/milena/tests/level/naive/median.cc
===================================================================
--- trunk/milena/tests/level/naive/median.cc (revision 0)
+++ trunk/milena/tests/level/naive/median.cc (revision 1485)
@@ -0,0 +1,58 @@
+// Copyright (C) 2007 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
+// 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/level/naive/median.cc
+ *
+ * \brief Test on mln::level::naive::median.
+ */
+
+#include <mln/core/image2d.hh>
+#include <mln/win/rectangle2d.hh>
+
+#include <mln/io/pgm/load.hh>
+#include <mln/io/pgm/save.hh>
+
+#include <mln/value/int_u8.hh>
+#include <mln/level/naive/median.hh>
+
+
+using namespace mln;
+using namespace mln::value;
+
+
+int main()
+{
+ win::rectangle2d rec(51, 51);
+ border::thickness = 52;
+
+ image2d<int_u8>
+ lena = io::pgm::load("../img/lena.pgm"),
+ out(lena.domain());
+
+ level::naive::median(lena, rec, out);
+ io::pgm::save(out, "out.pgm");
+}
Index: trunk/milena/tests/level/median_hline2d.cc
===================================================================
--- trunk/milena/tests/level/median_hline2d.cc (revision 0)
+++ trunk/milena/tests/level/median_hline2d.cc (revision 1485)
@@ -0,0 +1,64 @@
+// Copyright (C) 2007 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
+// 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/level/median_hline2d.cc
+ *
+ * \brief Test on the hline2d version of mln::level::median.
+ */
+
+#include <mln/core/image2d.hh>
+#include <mln/win/rectangle2d.hh>
+
+#include <mln/io/pgm/load.hh>
+#include <mln/io/pgm/save.hh>
+
+#include <mln/value/int_u8.hh>
+#include <mln/level/median.hh>
+#include <mln/level/compare.hh>
+
+
+
+
+int main()
+{
+ using namespace mln;
+ using value::int_u8;
+
+ border::thickness = 0;
+
+ image2d<int_u8>
+ lena = io::pgm::load("../img/lena.pgm"),
+ out(lena.domain()),
+ ref(lena.domain());
+
+ level::median(lena, win::rectangle2d(1, 101), ref);
+
+ level::median(lena, win::hline2d(101), out);
+ io::pgm::save(out, "out.pgm");
+
+ // FIXME: mln_assertion(out == ref);
+}
Index: trunk/milena/tests/level/assign.cc
===================================================================
--- trunk/milena/tests/level/assign.cc (revision 0)
+++ trunk/milena/tests/level/assign.cc (revision 1485)
@@ -0,0 +1,48 @@
+// Copyright (C) 2007 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
+// 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/level/assign.cc
+ *
+ * \brief Tests on mln::level::assign.
+ */
+
+#include <mln/core/image2d.hh>
+#include <mln/level/assign.hh>
+#include <mln/level/compare.hh>
+#include <mln/debug/iota.hh>
+
+
+int main()
+{
+ using namespace mln;
+
+ const unsigned size = 1000;
+ image2d<int> rhs(size, size), lhs(rhs.domain());
+ debug::iota(rhs);
+ level::assign(lhs, rhs);
+ mln_assertion(lhs == rhs);
+}
Index: trunk/milena/tests/level/apply.cc
===================================================================
--- trunk/milena/tests/level/apply.cc (revision 0)
+++ trunk/milena/tests/level/apply.cc (revision 1485)
@@ -0,0 +1,57 @@
+// Copyright (C) 2007 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
+// 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/level/apply.cc
+ *
+ * \brief Tests on mln::level::apply.
+ */
+
+#include <mln/core/image2d.hh>
+#include <mln/level/apply.hh>
+#include <mln/debug/iota.hh>
+#include <mln/fun/v2v/saturate.hh>
+
+
+int main()
+{
+ using namespace mln;
+
+ const unsigned size = 1000;
+ image2d<int> ima(3, 3);
+ int vs[3][3] = {
+ { 2, 2, 3 },
+ { 4, 5, 6 },
+ { 6, 6, 6 }
+ };
+
+ image2d<int> ref(make::image2d(vs));
+ debug::iota(ima);
+ level::apply(ima, fun::v2v::saturate<int>(2, 6));
+ box_fwd_piter_<point2d> p(ima.domain());
+ for_all(p)
+ mln_assertion(ima(p) == ref(p));
+}
Index: trunk/milena/tests/level/abs.cc
===================================================================
--- trunk/milena/tests/level/abs.cc (revision 0)
+++ trunk/milena/tests/level/abs.cc (revision 1485)
@@ -0,0 +1,60 @@
+// Copyright (C) 2007 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
+// 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/level/abs.cc
+ *
+ * \brief Tests on mln::level::abs.
+ */
+
+# include <mln/core/image2d.hh>
+# include <mln/level/abs.hh>
+
+int main()
+{
+
+ using namespace mln;
+
+ typedef image2d<int> I;
+
+ int vs[6][5] = {
+
+ { -3, -3, -4, -4, -4 },
+ { -2, -1, -1, -1, -1 },
+ { -1, -4, -4, -4, -1 },
+ { -1, -4, -3, -4, -1 },
+ { -1, -4, -5, -3, -1 },
+ { -1, -1, -1, -1, -1 }
+
+ };
+
+ image2d<int> ima(make::image2d(vs));
+ image2d<int> out(ima.domain());
+ level::abs(ima, out);
+ box_fwd_piter_<point2d> p(ima.domain());
+ for_all (p)
+ mln_assertion (out(p) >= 0);
+}
Index: trunk/milena/tests/level/approx_median.cc
===================================================================
--- trunk/milena/tests/level/approx_median.cc (revision 0)
+++ trunk/milena/tests/level/approx_median.cc (revision 1485)
@@ -0,0 +1,62 @@
+// Copyright (C) 2007 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
+// 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/level/approx/median.cc
+ *
+ * \brief Test on mln::level::approx::median.
+ */
+
+#include <mln/core/image2d.hh>
+#include <mln/win/rectangle2d.hh>
+#include <mln/win/octagon2d.hh>
+
+#include <mln/io/pgm/load.hh>
+#include <mln/io/pgm/save.hh>
+
+#include <mln/value/int_u8.hh>
+#include <mln/level/approx/median.hh>
+
+
+
+
+int main()
+{
+ using namespace mln;
+ using value::int_u8;
+
+ win::rectangle2d rect(51, 51);
+ win::octagon2d oct(13);
+ border::thickness = 52;
+
+ image2d<int_u8>
+ lena = io::pgm::load("../img/lena.pgm"),
+ out(lena.domain());
+
+// level::approx::median(lena, rect, out);
+ level::approx::median(lena, oct, out);
+ io::pgm::save(out, "out.pgm");
+}
Index: trunk/milena/tests/level/fill.cc
===================================================================
--- trunk/milena/tests/level/fill.cc (revision 0)
+++ trunk/milena/tests/level/fill.cc (revision 1485)
@@ -0,0 +1,70 @@
+// Copyright (C) 2007 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
+// 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/level/fill.cc
+ *
+ * \brief Tests on mln::level::fill
+ */
+
+#include <mln/core/image2d.hh>
+#include <mln/core/sub_image.hh>
+#include <mln/level/fill.hh>
+
+#include <mln/debug/println.hh>
+#include <mln/value/props.hh>
+
+
+int main()
+{
+ using namespace mln;
+
+
+ unsigned u = 300;
+ unsigned char uc = u;
+ mln_assertion(uc == 44);
+
+// {
+// const unsigned size = 3;
+// image2d<unsigned> ima(size, size);
+// level::fill(ima, u);
+// debug::println(ima);
+// }
+
+ {
+ const unsigned size = 10000;
+ image2d<unsigned char> ima(size, size);
+ for (unsigned i = 0; i < 5; ++i)
+ level::fill(ima, uc);
+ }
+
+// {
+// // do *not* compile so that's great since ima is not mutable
+// sub_image< const image2d<int>, box2d > ima;
+// level::fill(ima, 0);
+// }
+
+}
Index: trunk/milena/tests/level/memcpy_.cc
===================================================================
--- trunk/milena/tests/level/memcpy_.cc (revision 0)
+++ trunk/milena/tests/level/memcpy_.cc (revision 1485)
@@ -0,0 +1,58 @@
+// Copyright (C) 2007 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
+// 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/level/memcpy_.cc
+ *
+ * \brief Tests on mln::level::memcpy_.
+ *
+ * \todo Make this test not dummy!
+ */
+
+#include <mln/core/image2d.hh>
+#include <mln/core/inplace.hh>
+#include <mln/debug/iota.hh>
+#include <mln/level/memcpy_.hh>
+
+
+int main()
+{
+ using namespace mln;
+
+ typedef image2d<int> I;
+ I ima(3, 3);
+ debug::iota(ima);
+
+ point2d
+ src = make::point2d(0, 2),
+ dest = make::point2d(1, 2);
+
+ level::memcpy_(inplace(make::pixel(ima, dest)),
+ make::pixel(ima, src),
+ 2 + 2 * ima.border());
+
+ mln_assertion(ima(dest) == ima(src));
+}
Index: trunk/milena/tests/level/memset_.cc
===================================================================
--- trunk/milena/tests/level/memset_.cc (revision 0)
+++ trunk/milena/tests/level/memset_.cc (revision 1485)
@@ -0,0 +1,53 @@
+// Copyright (C) 2007 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
+// 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/level/memset_.cc
+ *
+ * \brief Tests on mln::level::memset_.
+ */
+
+#include <mln/core/image2d.hh>
+#include <mln/geom/ncols.hh>
+#include <mln/level/fill.hh>
+#include <mln/level/memset_.hh>
+
+
+int main()
+{
+ using namespace mln;
+
+ image2d<int> ima(3, 3);
+ level::fill(ima, 0);
+ int X = 9;
+ level::memset_(ima, make::point2d(0,0),
+ X,
+ geom::ncols(ima) + 2 * ima.border() + 1);
+ // ^
+ // |
+ mln_assertion(ima.at(1,0) == X); // <----------------+
+ mln_assertion(ima.at(1,1) != X);
+}
Index: trunk/milena/tests/level/median_fast.cc
===================================================================
--- trunk/milena/tests/level/median_fast.cc (revision 0)
+++ trunk/milena/tests/level/median_fast.cc (revision 1485)
@@ -0,0 +1,104 @@
+// Copyright (C) 2007 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
+// 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/level/median_fast.cc
+ *
+ * \brief Test on mln::level::fast_median.
+ */
+
+#include <mln/core/image2d.hh>
+#include <mln/win/rectangle2d.hh>
+
+#include <mln/io/pgm/load.hh>
+#include <mln/io/pgm/save.hh>
+
+#include <mln/value/int_u8.hh>
+#include <mln/debug/iota.hh>
+#include <mln/debug/println.hh>
+#include <mln/level/fast_median.hh>
+
+#include <mln/core/dpoints_pixter.hh>
+#include <mln/core/pixel.hh>
+
+
+namespace mln
+{
+
+ template <typename I, typename W>
+ void test(I& input, const W& win)
+ {
+ mln_point(I) p;
+ p.row() = p.col() = 1;
+
+ {
+ mln_qixter(I, W) qix(input, win, p);
+ for_all(qix)
+ std::cout << qix.val() << ' ';
+ std::cout << " : " << qix.center_val() << std::endl;
+ }
+
+ {
+ pixel<I> pix(input, p);
+ mln_qixter(I, W) qix(input, win, pix);
+ for_all(qix)
+ std::cout << qix.val() << ' ';
+ std::cout << " : " << qix.center_val() << std::endl;
+ }
+ }
+
+}
+
+
+
+int main()
+{
+ using namespace mln;
+ using value::int_u8;
+
+// {
+// win::rectangle2d rect(3, 3);
+// border::thickness = 4;
+// image2d<int_u8> ima(3, 3);
+// debug::iota(ima);
+// debug::println(ima);
+// test(ima, rect);
+// }
+
+
+ {
+ win::rectangle2d rect(51, 51);
+ border::thickness = 52;
+
+ image2d<int_u8>
+ lena = io::pgm::load("../img/lena.pgm"),
+ out(lena.domain());
+
+ level::fast_median(lena, rect, out);
+ io::pgm::save(out, "out.pgm");
+ }
+
+}
1
0