ChangeLog:
2007-09-21 Guillaume Duhamel <guillaume.duhamel(a)lrde.epita.fr>
Update tests with new println.
* labeling_level.hh,
* labeling_level_fast_10000x1000.cc,
* labeling_level_generic_10000x1000.cc,
* test_border_duplicate_image3d_1.cc,
* test_border_duplicate_image3d_2.cc,
* test_border_duplicate_image3d_3.cc,
* test_border_duplicate_image3d_4.cc,
* test_border_fill_image3d_1.cc,
* test_border_fill_image3d_2.cc,
* test_border_fill_image3d_3.cc,
* test_border_fill_image3d_4.cc,
* test_debug_iota_3d.cc: Update.
---
labeling_level.hh | 18 ++++++++++--------
labeling_level_fast_10000x1000.cc | 4 ++--
labeling_level_generic_10000x1000.cc | 4 ++--
test_border_duplicate_image3d_1.cc | 4 ++--
test_border_duplicate_image3d_2.cc | 4 ++--
test_border_duplicate_image3d_3.cc | 4 ++--
test_border_duplicate_image3d_4.cc | 5 +++--
test_border_fill_image3d_1.cc | 4 ++--
test_border_fill_image3d_2.cc | 7 +++----
test_border_fill_image3d_3.cc | 4 ++--
test_border_fill_image3d_4.cc | 4 ++--
test_debug_iota_3d.cc | 8 ++++----
12 files changed, 36 insertions(+), 34 deletions(-)
Index: trunk/milena/sandbox/duhamel/test_border_fill_image3d_1.cc
===================================================================
--- trunk/milena/sandbox/duhamel/test_border_fill_image3d_1.cc (revision 1148)
+++ trunk/milena/sandbox/duhamel/test_border_fill_image3d_1.cc (revision 1149)
@@ -30,7 +30,7 @@
* \brief Tests on mln::border::fill.
*/
-#include "debug_print_3d_with_border.hh"
+#include <mln/debug/println_with_border.hh>
#include "border_fill.hh"
#include <mln/core/image3d_b.hh>
#include <mln/value/int_u8.hh>
@@ -46,6 +46,6 @@
<< std::endl;
image3d_b<value::int_u8> i4(2, 3, 1, 2);
border::fill (i4, 7);
- debug::print_3d_with_border(i4);
+ debug::println_with_border(i4);
std::cout << std::endl;
}
Index: trunk/milena/sandbox/duhamel/test_border_fill_image3d_3.cc
===================================================================
--- trunk/milena/sandbox/duhamel/test_border_fill_image3d_3.cc (revision 1148)
+++ trunk/milena/sandbox/duhamel/test_border_fill_image3d_3.cc (revision 1149)
@@ -30,10 +30,10 @@
* \brief Tests on mln::border::fill.
*/
-#include "debug_print_3d_with_border.hh"
#include "border_fill.hh"
#include <mln/core/image3d_b.hh>
#include <mln/value/int_u8.hh>
+#include <mln/debug/println_with_border.hh>
using namespace mln;
@@ -48,6 +48,6 @@
box3d b(make::point3d(2, 6, 1), make::point3d(3, 8, 3));
image3d_b<value::int_u8> i4(b, 1);
border::fill (i4, 2);
- debug::print_3d_with_border(i4);
+ debug::println_with_border(i4);
std::cout << std::endl;
}
Index: trunk/milena/sandbox/duhamel/labeling_level_generic_10000x1000.cc
===================================================================
--- trunk/milena/sandbox/duhamel/labeling_level_generic_10000x1000.cc (revision 1148)
+++ trunk/milena/sandbox/duhamel/labeling_level_generic_10000x1000.cc (revision 1149)
@@ -52,8 +52,8 @@
unsigned border = 1;
- image2d_b<value::int_u8> i1(10000, 1000, border);
- i1[10009] = i1[10010] = 2;
+ image2d_b<value::int_u8> i1(1000, 1000, border);
+ i1[1009] = i1[1010] = 2;
unsigned n;
image2d_b<value::int_u8> out(i1.domain(), border);
Index: trunk/milena/sandbox/duhamel/test_border_duplicate_image3d_1.cc
===================================================================
--- trunk/milena/sandbox/duhamel/test_border_duplicate_image3d_1.cc (revision 1148)
+++ trunk/milena/sandbox/duhamel/test_border_duplicate_image3d_1.cc (revision 1149)
@@ -30,11 +30,11 @@
* \brief Tests on mln::border::fill.
*/
-#include "debug_print_3d_with_border.hh"
#include "border_duplicate.hh"
#include <mln/core/image3d_b.hh>
#include <mln/value/int_u8.hh>
#include <mln/debug/iota.hh>
+#include <mln/debug/println_with_border.hh>
using namespace mln;
@@ -48,6 +48,6 @@
image3d_b<value::int_u8> ima(2, 3, 1, 2);
debug::iota (ima);
border::duplicate (ima);
- debug::print_3d_with_border(ima);
+ debug::println_with_border(ima);
std::cout << std::endl;
}
Index: trunk/milena/sandbox/duhamel/test_border_duplicate_image3d_3.cc
===================================================================
--- trunk/milena/sandbox/duhamel/test_border_duplicate_image3d_3.cc (revision 1148)
+++ trunk/milena/sandbox/duhamel/test_border_duplicate_image3d_3.cc (revision 1149)
@@ -31,11 +31,11 @@
*/
-#include "debug_print_3d_with_border.hh"
#include "border_duplicate.hh"
#include <mln/core/image3d_b.hh>
#include <mln/value/int_u8.hh>
#include <mln/debug/iota.hh>
+#include <mln/debug/println_with_border.hh>
using namespace mln;
@@ -51,6 +51,6 @@
image3d_b<value::int_u8> ima(b, 1);
debug::iota (ima);
border::duplicate (ima);
- debug::print_3d_with_border(ima);
+ debug::println_with_border(ima);
std::cout << std::endl;
}
Index: trunk/milena/sandbox/duhamel/labeling_level_fast_10000x1000.cc
===================================================================
--- trunk/milena/sandbox/duhamel/labeling_level_fast_10000x1000.cc (revision 1148)
+++ trunk/milena/sandbox/duhamel/labeling_level_fast_10000x1000.cc (revision 1149)
@@ -52,8 +52,8 @@
unsigned border = 1;
- image2d_b<value::int_u8> i1(10000, 1000, border);
- i1[10009] = i1[10010] = 2;
+ image2d_b<value::int_u8> i1(1000, 1000, border);
+ i1[1009] = i1[1010] = 2;
unsigned n;
image2d_b<value::int_u8> out(i1.domain(), border);
Index: trunk/milena/sandbox/duhamel/test_border_fill_image3d_2.cc
===================================================================
--- trunk/milena/sandbox/duhamel/test_border_fill_image3d_2.cc (revision 1148)
+++ trunk/milena/sandbox/duhamel/test_border_fill_image3d_2.cc (revision 1149)
@@ -30,10 +30,9 @@
* \brief Tests on mln::border::fill.
*/
-#include "debug_print_3d_with_border.hh"
-#include "border_fill.hh"
#include <mln/core/image3d_b.hh>
-
+#include "border_fill.hh"
+#include <mln/debug/println_with_border.hh>
using namespace mln;
@@ -46,6 +45,6 @@
<< std::endl;
image3d_b<int> i3(2, 3, 1, 1);
border::fill (i3, 6);
- debug::print_3d_with_border(i3);
+ debug::println_with_border(i3);
std::cout << std::endl;
}
Index: trunk/milena/sandbox/duhamel/test_border_fill_image3d_4.cc
===================================================================
--- trunk/milena/sandbox/duhamel/test_border_fill_image3d_4.cc (revision 1148)
+++ trunk/milena/sandbox/duhamel/test_border_fill_image3d_4.cc (revision 1149)
@@ -31,9 +31,9 @@
*/
-#include "debug_print_3d_with_border.hh"
#include "border_fill.hh"
#include <mln/core/image3d_b.hh>
+#include <mln/debug/println_with_border.hh>
using namespace mln;
@@ -48,6 +48,6 @@
box3d b(make::point3d(-7, -8, -6), make::point3d(-5, -4, -1));
image3d_b<int> i4(b, 1);
border::fill (i4, 2);
- debug::print_3d_with_border(i4);
+ debug::println_with_border(i4);
std::cout << std::endl;
}
Index: trunk/milena/sandbox/duhamel/labeling_level.hh
===================================================================
--- trunk/milena/sandbox/duhamel/labeling_level.hh (revision 1148)
+++ trunk/milena/sandbox/duhamel/labeling_level.hh (revision 1149)
@@ -98,15 +98,17 @@
}
// first pass
{
- typedef mln_point (I) P;
mln_bkd_pixter(const I) p(f.input);
// mln_nixter(const I, N) n(p, f.nbh);
- mln_qixter(const I, window<P>) n(p, convert::to_upper_window(f.nbh));
+
+ typedef window<mln_dpoint(I)> W;
+ W win = convert::to_upper_window(f.nbh);
+ mln_qixter(const I, W) n(p, win);
for_all(p) if (f.handles(p))
{
make_set(p);
- for_all(n) if (n > p)
+ for_all(n)
if (f.equiv(n, p))
do_union(n, p);
else
@@ -173,21 +175,21 @@
template <typename I_, typename N_, typename O_>
- struct level_fast_t : mln::labeling::impl::base_fast_<I_,N_,O_>
+ struct level_fast_t : labeling::impl::base_fast_<I_,N_,O_>
{
typedef mln_point(I_) P;
// typedef mln_pset(I_) S;
// const S& s;
- void init() { mln::level::fill(this->output, 0); }
- bool handles(unsigned p) const { return
mln::labeling::impl::base_fast_<I_,N_,O_>::input[p] == val; }
- bool equiv(unsigned n, unsigned) const { return
mln::labeling::impl::base_fast_<I_,N_,O_>::input[n] == val; }
+ void init() { level::fill(this->output, 0); }
+ bool handles(unsigned p) const { return this->input[p] == val; }
+ bool equiv(unsigned n, unsigned) const { return this->input[n] == val; }
const mln_value(I_)& val;
level_fast_t(const I_& input, const mln_value(I_)& val, const N_& nbh,
O_& output)
- : mln::labeling::impl::base_fast_<I_,N_,O_>(input, nbh, output),
+ : labeling::impl::base_fast_<I_,N_,O_>(input, nbh, output),
// s(input.domain()),
val(val)
{}
Index: trunk/milena/sandbox/duhamel/test_border_duplicate_image3d_2.cc
===================================================================
--- trunk/milena/sandbox/duhamel/test_border_duplicate_image3d_2.cc (revision 1148)
+++ trunk/milena/sandbox/duhamel/test_border_duplicate_image3d_2.cc (revision 1149)
@@ -30,10 +30,10 @@
* \brief Tests on mln::border::fill.
*/
-#include "debug_print_3d_with_border.hh"
#include "border_duplicate.hh"
#include <mln/core/image3d_b.hh>
#include <mln/debug/iota.hh>
+#include <mln/debug/println_with_border.hh>
using namespace mln;
@@ -47,6 +47,6 @@
image3d_b<int> ima(2, 3, 1, 1);
debug::iota (ima);
border::duplicate (ima);
- debug::print_3d_with_border(ima);
+ debug::println_with_border(ima);
std::cout << std::endl;
}
Index: trunk/milena/sandbox/duhamel/test_border_duplicate_image3d_4.cc
===================================================================
--- trunk/milena/sandbox/duhamel/test_border_duplicate_image3d_4.cc (revision 1148)
+++ trunk/milena/sandbox/duhamel/test_border_duplicate_image3d_4.cc (revision 1149)
@@ -30,10 +30,11 @@
* \brief Tests on mln::border::fill.
*/
-#include "debug_print_3d_with_border.hh"
+
#include "border_duplicate.hh"
#include <mln/core/image3d_b.hh>
#include <mln/debug/iota.hh>
+#include <mln/debug/println_with_border.hh>
using namespace mln;
@@ -49,6 +50,6 @@
image3d_b<int> ima(b, 1);
debug::iota (ima);
border::duplicate (ima);
- debug::print_3d_with_border(ima);
+ debug::println_with_border(ima);
std::cout << std::endl;
}
Index: trunk/milena/sandbox/duhamel/test_debug_iota_3d.cc
===================================================================
--- trunk/milena/sandbox/duhamel/test_debug_iota_3d.cc (revision 1148)
+++ trunk/milena/sandbox/duhamel/test_debug_iota_3d.cc (revision 1149)
@@ -31,10 +31,11 @@
*/
-#include "debug_print_3d_with_border.hh"
+
#include <mln/core/image3d_b.hh>
#include <mln/value/int_u8.hh>
#include <mln/debug/iota.hh>
+#include <mln/debug/println_with_border.hh>
using namespace mln;
@@ -42,9 +43,8 @@
main (void)
{
- box3d b(make::point3d(2, 6, 1), make::point3d(3, 8, 3));
- image3d_b<value::int_u8> ima(b, 1);
+ image3d_b<bool> ima(2,3,3,1);
debug::iota (ima);
- debug::print_3d_with_border(ima);
+ debug::println_with_border(ima);
}