https://svn.lrde.epita.fr/svn/oln/trunk/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Make tests compile without warnings.
* trash: New directory.
Trash mln::neighb stuff.
* mln/neighb/essential.hh: Remove.
* mln/neighb/all.hh: Remove.
* mln/neighb/image.hh: Rename as...
* trash/neighb_image.hh: ...this.
* tests/neighb/image.cc: Rename as...
* trash/neighb_image.cc: ...this.
* mln/neighb/get.hh: Rename as...
* trash/neighb_get.hh: ...this.
* tests/neighb/Makefile.am: Remove.
* tests/neighb: Remove directory.
* mln/neighb: Remove directory.
Trash convert/to_tiles.
* mln/convert/to_tiles.hh: Rename as...
* trash/to_tiles.hh: ...this.
* tests/convert/to_tiles.cc: Rename as...
* trash/to_tiles.cc: ...this.
Trash display stuff.
* mln/display/show.hh: Rename as....
* trash/display_show.hh: ...this.
* tests/display/show.cc: Rename as....
* trash/display_show.cc: ...this.
* mln/display/save_and_show.hh: Rename as....
* trash/display_save_and_show.hh: ...this.
* tests/display/save_and_show.cc: Rename as....
* trash/save_and_show.cc: ...this.
* mln/display/color_pretty.hh: Rename as....
* trash/display_color_pretty.hh: ...this.
* tests/display/color_pretty.cc: Rename as....
* trash/display_color_pretty.cc: ...this.
Trash translate image.
* mln/core/image/translate_image.hh: Rename as...
* trash/translate_image.hh: ...this.
* mln/core/image/all.hh: Update.
* tests/core/image/translate_image.cc: Rename as...
* trash/translate_image.cc: ...this.
Remove obsolete files.
* mln/draw/label.hh: Remove.
* mln/draw/all.hh: Update.
* tests/draw/label.cc: Remove.
* mln/morpho/erosion_fast.hh: Remove.
* mln/morpho/dilation_fast.hh: Remove.
* mln/morpho/all.hh: Update.
* mln/morpho/essential.hh: Update.
* tests/morpho/dilation_max_h.cc: Remove.
* tests/morpho/erosion_min_h.cc: Remove.
* tests/morpho/temp.erosion.cc: Remove.
* tests/logical/or_full.cc: Remove.
* tests/logical/not_full.cc: Remove.
* tests/logical/and_not_full.cc: Remove.
* tests/logical/and_full.cc: Remove.
Update Makefiles.
* tests/convert/Makefile.am: Update.
* tests/core/image/Makefile.am: Update.
* tests/display/Makefile.am: Update.
* tests/morpho/Makefile.am: Update.
Fix some tests warnings and errors.
* mln/trait/value_.hh,
* mln/metal/converts_to.hh,
* mln/level/replace.hh,
* mln/accu/line.hh,
* mln/convert/all.hh,
* mln/win/inter.hh,
* mln/morpho/meyer_wst.hh,
* mln/util/tree_fast.hh,
* mln/util/lemmings.hh,
* mln/labeling/blobs.hh,
* tests/literal/zero.cc,
* tests/literal/one.cc,
* tests/draw/graph.cc,
* tests/arith/revert_full.cc,
* tests/level/compute_full.cc,
* tests/border/fill_full.cc,
* tests/win/inter.cc,
* tests/morpho/meyer_wst.cc,
* tests/morpho/meyer_wst_long.cc,
* tests/Makefile.am,
* tests/util/ord_pair.cc,
* tests/util/lemmings.cc,
* tests/util/tree_fast_to_image.cc: Fix.
* mln/literal/all.hh: Add a commentary about g++ warning.
Eventually use -Wignore_qualifiers.
mln/accu/line.hh | 12 ++-
mln/convert/all.hh | 13 ++-
mln/core/image/all.hh | 11 +--
mln/draw/all.hh | 13 ++-
mln/labeling/blobs.hh | 7 +-
mln/level/replace.hh | 28 +++++---
mln/literal/all.hh | 21 ++++--
mln/metal/converts_to.hh | 18 +++--
mln/morpho/all.hh | 2
mln/morpho/essential.hh | 12 +--
mln/morpho/meyer_wst.hh | 4 -
mln/trait/value_.hh | 4 -
mln/util/lemmings.hh | 21 +++---
mln/util/tree_fast.hh | 21 +++---
mln/win/inter.hh | 8 +-
tests/Makefile.am | 1
tests/arith/revert_full.cc | 48 ++------------
tests/border/fill_full.cc | 128 ++-------------------------------------
tests/convert/Makefile.am | 2
tests/core/image/Makefile.am | 2
tests/display/Makefile.am | 11 ---
tests/draw/graph.cc | 2
tests/level/compute_full.cc | 9 +-
tests/literal/one.cc | 14 ++--
tests/literal/zero.cc | 14 ++--
tests/morpho/Makefile.am | 5 -
tests/morpho/meyer_wst.cc | 11 +--
tests/morpho/meyer_wst_long.cc | 28 +++-----
tests/util/lemmings.cc | 51 ++++++++-------
tests/util/ord_pair.cc | 16 ++--
tests/util/tree_fast_to_image.cc | 18 ++---
tests/win/inter.cc | 4 -
32 files changed, 215 insertions(+), 344 deletions(-)
Property changes on: trash/to_tiles.hh
___________________________________________________________________
Added: svn:mergeinfo
Property changes on: trash/neighb_image.cc
___________________________________________________________________
Added: svn:mergeinfo
Property changes on: trash/translate_image.cc
___________________________________________________________________
Added: svn:mergeinfo
Property changes on: trash/display_show.hh
___________________________________________________________________
Added: svn:mergeinfo
Property changes on: trash/display_save_and_show.hh
___________________________________________________________________
Added: svn:mergeinfo
Property changes on: trash/save_and_show.cc
___________________________________________________________________
Added: svn:mergeinfo
Property changes on: trash/to_tiles.cc
___________________________________________________________________
Added: svn:mergeinfo
Property changes on: trash/display_color_pretty.hh
___________________________________________________________________
Added: svn:mergeinfo
Property changes on: trash/display_show.cc
___________________________________________________________________
Added: svn:mergeinfo
Property changes on: trash/neighb_get.hh
___________________________________________________________________
Added: svn:mergeinfo
Property changes on: trash/neighb_image.hh
___________________________________________________________________
Added: svn:mergeinfo
Property changes on: trash/translate_image.hh
___________________________________________________________________
Added: svn:mergeinfo
Property changes on: trash/display_color_pretty.cc
___________________________________________________________________
Added: svn:mergeinfo
Index: tests/core/image/Makefile.am
--- tests/core/image/Makefile.am (revision 2991)
+++ tests/core/image/Makefile.am (working copy)
@@ -28,7 +28,6 @@
sub_image \
t_image \
tr_image
-## translate_image \
## value_enc_image
##bgraph_image_SOURCES = bgraph_image.cc
@@ -55,7 +54,6 @@
sub_image_SOURCES = sub_image.cc
t_image_SOURCES = t_image.cc
tr_image_SOURCES = tr_image.cc
-##translate_image_SOURCES = translate_image.cc
##value_enc_image_SOURCES = value_enc_image.cc
# Tests depending on the FreeImagePlus library.
Index: tests/literal/zero.cc
--- tests/literal/zero.cc (revision 2991)
+++ tests/literal/zero.cc (working copy)
@@ -1,4 +1,5 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -25,10 +26,9 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/literal/zero.cc
- *
- * \brief Tests on mln::literal::zero.
- */
+/// \file tests/literal/zero.cc
+///
+/// Tests on mln::literal::zero.
#include <mln/literal/zero.hh>
#include <mln/literal/one.hh>
@@ -43,7 +43,7 @@
unsigned char c;
c = literal::zero;
- mln_assertion(c == 0);
+ mln_assertion(c == 0u);
double d;
d = literal::zero;
@@ -54,5 +54,5 @@
value::int_u8 u(literal::zero), uu;
uu = literal::zero;
- mln_assertion(u == 0 && 0 == u);
+ mln_assertion(u == 0u && 0u == u);
}
Index: tests/literal/one.cc
--- tests/literal/one.cc (revision 2991)
+++ tests/literal/one.cc (working copy)
@@ -1,4 +1,5 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -25,10 +26,9 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/literal/one.cc
- *
- * \brief Tests on mln::literal::one.
- */
+/// \file tests/literal/one.cc
+///
+/// Tests on mln::literal::one.
#include <mln/literal/one.hh>
#include <mln/literal/zero.hh>
@@ -43,7 +43,7 @@
unsigned char c;
c = literal::one;
- mln_assertion(c == 1);
+ mln_assertion(c == 1u);
double d;
d = literal::one;
@@ -54,5 +54,5 @@
value::int_u8 u(literal::one), uu;
uu = literal::one;
- mln_assertion(u == 1 && 1 == u);
+ mln_assertion(u == 1u && 1u == u);
}
Index: tests/draw/graph.cc
--- tests/draw/graph.cc (revision 2991)
+++ tests/draw/graph.cc (working copy)
@@ -74,7 +74,7 @@
mln::p_vertices<G, F> pg(g, fpoints);
image2d<int> ima(nrows, ncols);
- level::fill(ima, literal::zero);
+ level::fill(ima, 0);
debug::draw_graph(ima, pg, 2, 1);
mln_assertion(ima == ref);
}
Index: tests/level/compute_full.cc
--- tests/level/compute_full.cc (revision 2991)
+++ tests/level/compute_full.cc (working copy)
@@ -1,4 +1,5 @@
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -25,10 +26,9 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/level/compute_full.cc
- *
- * \brief Tests on mln::level::compute.
- */
+/// \file tests/level/compute_full.cc
+///
+/// Tests on mln::level::compute.
#include <mln/core/image/image1d.hh>
#include <mln/core/image/image2d.hh>
@@ -194,7 +194,6 @@
image3d<I> ima (slis, rows, cols);
debug::iota (ima);
I real_min = 1;
- I real_min2 = 1;
I real_max;
if (slis * rows * cols >= (unsigned)mln_max(I))
{
Index: tests/arith/revert_full.cc
--- tests/arith/revert_full.cc (revision 2991)
+++ tests/arith/revert_full.cc (working copy)
@@ -1,4 +1,5 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -25,31 +26,24 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/arith/revert_full.cc
- *
- * \brief Tests on mln::arith::revert.
- */
-
-
-
-
+/// \file tests/arith/revert_full.cc
+///
+/// Tests on mln::arith::revert.
+///
+/// \todo Rewrite this non-sense test file!!!
#include <mln/core/image/image1d.hh>
#include <mln/core/image/image2d.hh>
#include <mln/core/image/image3d.hh>
#include <mln/core/image/sub_image.hh>
-
#include <mln/core/image/image_if.hh>
-#include <mln/fun/p2b/chess.hh>
+#include <mln/fun/p2b/chess.hh>
#include <mln/literal/origin.hh>
-
#include <mln/value/int_s8.hh>
#include <mln/value/int_s16.hh>
-
#include <mln/debug/iota.hh>
-
#include <mln/arith/revert.hh>
@@ -108,7 +102,7 @@
mln_piter(I) p (ima.domain ());
for_all(p)
- mln_assertion (ima(p) == mln_min(V) + mln_max(V) - ref(p));
+ mln_assertion (ima(p) == mln_value(J)(mln_min(V) + mln_max(V) - ref(p)));
}
template <typename V>
@@ -126,7 +120,6 @@
unsigned col = 100;
- (std::cerr << "in 1d ... ").flush ();
{
typedef image1d<V> I;
@@ -141,9 +134,6 @@
chck (ref, ima);
}
}
- std::cerr << "OK" << std::endl;
-
- (std::cerr << "in 2d ... ").flush ();
{
typedef image2d<V> I;
@@ -159,9 +149,6 @@
chck (ref, ima);
}
}
- std::cerr << "OK" << std::endl;
-
- (std::cerr << "in 3d ... ").flush ();
{
typedef image3d<V> I;
@@ -178,10 +165,6 @@
chck (ref, ima);
}
}
- std::cerr << "OK" << std::endl;
-
-
- (std::cerr << "in subimage 1d ... ").flush ();
{
typedef image1d<V> I;
typedef sub_image<I, box1d> J;
@@ -201,9 +184,6 @@
chck (ref, ima);
}
}
- std::cerr << "OK" << std::endl;
-
- (std::cerr << "in subimage 2d ... ").flush ();
{
typedef image2d<V> I;
typedef sub_image<I, box2d> J;
@@ -223,9 +203,6 @@
chck (ref, ima);
}
}
- std::cerr << "OK" << std::endl;
-
- (std::cerr << "in subimage 3d ... ").flush ();
{
typedef image3d<V> I;
typedef sub_image<I, box3d> J;
@@ -246,7 +223,6 @@
chck (ref, ima);
}
}
- std::cerr << "OK" << std::endl;
}
}
@@ -259,16 +235,10 @@
{
using namespace mln;
- std::cerr << "Tests arith::revert:" << std::endl;
- std::cerr << "on int:" << std::endl;
chk<int>();
- std::cerr << "on int_s8:" << std::endl;
chk<value::int_s8>();
- std::cerr << "on int_s16:" << std::endl;
chk<value::int_s16>();
- std::cerr << "on int_u8:" << std::endl;
chk<value::int_u8>();
- std::cerr << "on unsigned:" << std::endl;
chk<unsigned>();
}
Index: tests/border/fill_full.cc
--- tests/border/fill_full.cc (revision 2991)
+++ tests/border/fill_full.cc (working copy)
@@ -1,4 +1,5 @@
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -25,10 +26,11 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/border/fill_full.cc
- *
- * \brief Tests on mln::border::fill.
- */
+/// \file tests/border/fill_full.cc
+///
+/// Tests on mln::border::fill.
+///
+/// \todo Rewrite this non-sense test file!!!
#include <mln/border/fill.hh>
#include <mln/level/fill.hh>
@@ -49,7 +51,7 @@
template <typename T>
-int
+void
check1d(unsigned row, unsigned border, T& value, T& v)
{
image1d<T> ima(row, border);
@@ -68,7 +70,7 @@
}
template <typename T>
-int
+void
check2d(unsigned row, unsigned col, unsigned border, T& value, T& v)
{
image2d<T> ima(row, col, border);
@@ -98,7 +100,7 @@
}
template <typename T>
-int
+void
check3d(unsigned sli, unsigned row, unsigned col, unsigned border, T& value, T&
v)
{
image3d<T> ima(sli, row, col, border);
@@ -133,267 +135,155 @@
{
int limits = 10;
- std::cerr << "Tests border::fill:" << std::endl;
-
{
- std::cerr << " on int:" << std::endl;
-
typedef int T;
T value = (T) -1;
T v = 42;
- (std::cerr << " in 1d ... ").flush ();
-
for (int i = 1; i < limits; ++i)
for (int j = 1; j < limits; ++j)
check1d(i, j, value, v);
- std::cerr << "OK" << std::endl;
-
-
- (std::cerr << " in 2d ... ").flush ();
-
for (int i = 1; i < limits; ++i)
for (int j = 1; j < limits; ++j)
for (int k = 1; k < limits; ++k)
check2d(i, j, k, value, v);
-
- std::cerr << "OK" << std::endl;
}
{
- std::cerr << " on unsigned:" << std::endl;
-
typedef unsigned T;
T value = (T) -1;
T v = 42;
- (std::cerr << " in 1d ... ").flush ();
-
for (int i = 1; i < limits; ++i)
for (int j = 1; j < limits; ++j)
check1d(i, j, value, v);
- std::cerr << "OK" << std::endl;
-
-
- (std::cerr << " in 2d ... ").flush ();
-
for (int i = 1; i < limits; ++i)
for (int j = 1; j < limits; ++j)
for (int k = 1; k < limits; ++k)
check2d(i, j, k, value, v);
-
- std::cerr << "OK" << std::endl;
}
{
- std::cerr << " on int_u8:" << std::endl;
-
typedef value::int_u8 T;
T value = 255;
T v = 42;
- (std::cerr << " in 1d ... ").flush ();
-
for (int i = 1; i < limits; ++i)
for (int j = 1; j < limits; ++j)
check1d(i, j, value, v);
- std::cerr << "OK" << std::endl;
-
-
- (std::cerr << " in 2d ... ").flush ();
-
for (int i = 1; i < limits; ++i)
for (int j = 1; j < limits; ++j)
for (int k = 1; k < limits; ++k)
check2d(i, j, k, value, v);
-
- std::cerr << "OK" << std::endl;
}
{
- std::cerr << " on int_u16:" << std::endl;
-
typedef value::int_u16 T;
T value = 65535;
T v = 42;
- (std::cerr << " in 1d ... ").flush ();
-
for (int i = 1; i < limits; ++i)
for (int j = 1; j < limits; ++j)
check1d(i, j, value, v);
- std::cerr << "OK" << std::endl;
-
-
- (std::cerr << " in 2d ... ").flush ();
-
for (int i = 1; i < limits; ++i)
for (int j = 1; j < limits; ++j)
for (int k = 1; k < limits; ++k)
check2d(i, j, k, value, v);
-
- std::cerr << "OK" << std::endl;
}
{
- std::cerr << " on int_s8:" << std::endl;
-
typedef value::int_s8 T;
T value = 127;
T v = 42;
- (std::cerr << " in 1d ... ").flush ();
-
for (int i = 1; i < limits; ++i)
for (int j = 1; j < limits; ++j)
check1d(i, j, value, v);
- std::cerr << "OK" << std::endl;
-
-
- (std::cerr << " in 2d ... ").flush ();
-
for (int i = 1; i < limits; ++i)
for (int j = 1; j < limits; ++j)
for (int k = 1; k < limits; ++k)
check2d(i, j, k, value, v);
-
- std::cerr << "OK" << std::endl;
}
{
- std::cerr << " on int_s16:" << std::endl;
-
typedef value::int_s16 T;
T value = 32767;
T v = 42;
- (std::cerr << " in 1d ... ").flush ();
-
for (int i = 1; i < limits; ++i)
for (int j = 1; j < limits; ++j)
check1d(i, j, value, v);
- std::cerr << "OK" << std::endl;
-
-
- (std::cerr << " in 2d ... ").flush ();
-
for (int i = 1; i < limits; ++i)
for (int j = 1; j < limits; ++j)
for (int k = 1; k < limits; ++k)
check2d(i, j, k, value, v);
-
- std::cerr << "OK" << std::endl;
}
{
- std::cerr << " on rgb8:" << std::endl;
-
typedef value::rgb8 T;
T value = T(255, 255, 255);
T v = T(42, 0, 0);
- (std::cerr << " in 1d ... ").flush ();
-
for (int i = 1; i < limits; ++i)
for (int j = 1; j < limits; ++j)
check1d(i, j, value, v);
- std::cerr << "OK" << std::endl;
-
-
- (std::cerr << " in 2d ... ").flush ();
-
for (int i = 1; i < limits; ++i)
for (int j = 1; j < limits; ++j)
for (int k = 1; k < limits; ++k)
check2d(i, j, k, value, v);
-
- std::cerr << "OK" << std::endl;
}
{
- std::cerr << " on rgb16:" << std::endl;
-
typedef value::rgb16 T;
T value = T(65535, 65535, 65535);
T v = T(42, 0, 0);
- (std::cerr << " in 1d ... ").flush ();
-
for (int i = 1; i < limits; ++i)
for (int j = 1; j < limits; ++j)
check1d(i, j, value, v);
- std::cerr << "OK" << std::endl;
-
-
- (std::cerr << " in 2d ... ").flush ();
-
for (int i = 1; i < limits; ++i)
for (int j = 1; j < limits; ++j)
for (int k = 1; k < limits; ++k)
check2d(i, j, k, value, v);
-
- std::cerr << "OK" << std::endl;
}
{
- std::cerr << " on float01_8:" << std::endl;
-
typedef value::float01_8 T;
T value = T(0.9999);
T v = T(0.111);
- (std::cerr << " in 1d ... ").flush ();
-
for (int i = 1; i < limits; ++i)
for (int j = 1; j < limits; ++j)
check1d(i, j, value, v);
- std::cerr << "OK" << std::endl;
-
-
- (std::cerr << " in 2d ... ").flush ();
-
for (int i = 1; i < limits; ++i)
for (int j = 1; j < limits; ++j)
for (int k = 1; k < limits; ++k)
check2d(i, j, k, value, v);
-
- std::cerr << "OK" << std::endl;
}
{
- std::cerr << " on float01_16:" << std::endl;
-
typedef value::float01_16 T;
T value = T(0.9999);
T v = T(0.111);
- (std::cerr << " in 1d ... ").flush ();
-
for (int i = 1; i < limits; ++i)
for (int j = 1; j < limits; ++j)
check1d(i, j, value, v);
- std::cerr << "OK" << std::endl;
-
-
- (std::cerr << " in 2d ... ").flush ();
-
for (int i = 1; i < limits; ++i)
for (int j = 1; j < limits; ++j)
for (int k = 1; k < limits; ++k)
check2d(i, j, k, value, v);
-
- std::cerr << "OK" << std::endl;
}
Index: tests/convert/Makefile.am
--- tests/convert/Makefile.am (revision 2991)
+++ tests/convert/Makefile.am (working copy)
@@ -7,13 +7,11 @@
to_image \
to_p_array \
to_p_set \
-## to_tiles \
to_window
to_image_SOURCES = to_image.cc
to_p_array_SOURCES = to_p_array.cc
to_p_set_SOURCES = to_p_set.cc
-#to_tiles_SOURCES = to_tiles.cc
to_window_SOURCES = to_window.cc
TESTS = $(check_PROGRAMS)
Index: tests/win/inter.cc
--- tests/win/inter.cc (revision 2991)
+++ tests/win/inter.cc (working copy)
@@ -28,7 +28,7 @@
/// \file tests/win/inter.cc
///
-/// Tests on mln::set::inter.
+/// Tests on mln::win::inter.
#include <mln/win/inter.hh>
#include <mln/core/alias/dpoint2d.hh>
@@ -53,7 +53,7 @@
win2.insert(-4, 0);
win2.insert( 1,-1);
win2.insert( 6, 5);
- window2d win3 = set::inter(win1, win2);
+ window2d win3 = win1 && win2;
mln_assertion(!win3.has(dpoint2d( 2, 1)));
mln_assertion(!win3.has(dpoint2d( 0, 0)));
mln_assertion(!win3.has(dpoint2d( 1, 1)));
Index: tests/morpho/meyer_wst.cc
--- tests/morpho/meyer_wst.cc (revision 2991)
+++ tests/morpho/meyer_wst.cc (working copy)
@@ -26,7 +26,8 @@
// Public License.
/// \file tests/morpho/meyer_wst.cc
-// /\brief Test on mln::morpho::extrema_components
+///
+/// Test on mln::morpho::meyer_wst.
#include <iostream>
@@ -52,9 +53,9 @@
image2d<int_u8> input;
io::pgm::load(input, MLN_IMG_DIR "/squares.pgm");
- typedef int_u8 wst_val;
- wst_val nbasins;
- image2d<int_u8> output = morpho::meyer_wst(input, c4(), nbasins);
- std::cout << "nbasins = " << nbasins << std::endl;
+ typedef int_u8 L;
+ L nbasins;
+ image2d<L> output = morpho::meyer_wst(input, c4(), nbasins);
+
io::pgm::save(output, "out.pgm");
}
Index: tests/morpho/meyer_wst_long.cc
--- tests/morpho/meyer_wst_long.cc (revision 2991)
+++ tests/morpho/meyer_wst_long.cc (working copy)
@@ -26,7 +26,8 @@
// Public License.
/// \file tests/morpho/meyer_wst_long.cc
-// /\brief Test on mln::morpho::extrema_components
+///
+/// Test on mln::morpho::meyer_wst.
#include <iostream>
@@ -36,7 +37,7 @@
#include <mln/core/alias/neighb2d.hh>
#include <mln/value/int_u8.hh>
-#include <mln/value/int_u16.hh>
+#include <mln/value/label_16.hh>
#include <mln/morpho/gradient.hh>
#include <mln/morpho/closing_area.hh>
@@ -47,9 +48,9 @@
#include <mln/pw/cst.hh>
#include <mln/pw/value.hh>
-#include <mln/display/color_pretty.hh>
#include <mln/io/pgm/load.hh>
#include <mln/io/ppm/save.hh>
+#include <mln/debug/colorize.hh>
#include "tests/data.hh"
@@ -58,26 +59,19 @@
{
using namespace mln;
using value::int_u8;
- using value::int_u16;
image2d<int_u8> input;
io::pgm::load(input, MLN_IMG_DIR "/lena.pgm");
- image2d<int_u8> gradient =
- morpho::gradient (input, convert::to_window(c4()));
-
- // Simplify the input image.
- image2d<int_u8> work(input.domain());
- morpho::closing_area(gradient, c4(), 200, work);
+ image2d<int_u8>
+ grad = morpho::gradient(input, c4().win()),
+ clo = morpho::closing_area(grad, c4(), 200);
// Perform a Watershed Transform.
- typedef int_u16 wst_val;
- wst_val nbasins;
- image2d<wst_val> ws = morpho::meyer_wst(work, c4(), nbasins);
- std::cout << "nbasins = " << nbasins << std::endl;
+ typedef value::label16 L;
+ L nbasins;
+ image2d<L> ws = morpho::meyer_wst(clo, c4(), nbasins);
// Save the image in color.
- image2d<value::rgb8> input_plus_ws =
- display::color_pretty(input | (pw::value(ws) != pw::cst(0)));
- io::ppm::save(input_plus_ws, "out.ppm");
+ io::ppm::save(debug::colorize(value::rgb8(), ws, nbasins), "out.ppm");
}
Index: tests/morpho/Makefile.am
--- tests/morpho/Makefile.am (revision 2991)
+++ tests/morpho/Makefile.am (working copy)
@@ -17,9 +17,7 @@
complex_image_wst \
contrast \
dilation \
-## dilation_max_h \
erosion \
-## erosion_min_h \
general \
gradient \
## graph_image_morpho \
@@ -46,9 +44,6 @@
# FIXME: Have erosion and dilation perform symmetric tests.
erosion_SOURCES = erosion.cc
-##dilation_max_h_SOURCES = dilation_max_h.cc
-##erosion_min_h_SOURCES = erosion_min_h.cc
-
opening_area_SOURCES = opening_area.cc
closing_area_SOURCES = closing_area.cc
closing_height_SOURCES = closing_height.cc
Index: tests/display/Makefile.am
--- tests/display/Makefile.am (revision 2991)
+++ tests/display/Makefile.am (working copy)
@@ -2,17 +2,12 @@
include $(top_srcdir)/milena/tests/tests.mk
-check_PROGRAMS = \
- show \
- save_and_show \
- color_pretty
+check_PROGRAMS =
-show_SOURCES = show.cc
-save_and_show_SOURCES = save_and_show.cc
-color_pretty_SOURCES = color_pretty.cc
# FIXME: Don't execute `save' and `save_and_show' by default! These
# tests require a running X11 server (as well as a `pkill' binary...).
# Perform the necessary checks at configure time first.
#TESTS = $(check_PROGRAMS)
-TESTS = color_pretty
+
+TESTS =
Index: tests/Makefile.am
--- tests/Makefile.am (revision 2991)
+++ tests/Makefile.am (working copy)
@@ -30,7 +30,6 @@
math \
metal \
morpho \
- neighb \
norm \
pw \
set \
Index: tests/util/ord_pair.cc
--- tests/util/ord_pair.cc (revision 2991)
+++ tests/util/ord_pair.cc (working copy)
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -26,10 +27,11 @@
// Public License.
/// \file util/ord_pair.cc
-/// \brief Tests on mln::util::ord_pair.
+///
+/// Tests on mln::util::ord_pair.
#include <mln/core/alias/point2d.hh>
-#include <mln/util/ordpair.hh>
+#include <mln/util/ord_pair.hh>
int main()
@@ -38,8 +40,8 @@
point2d p1(5,6), p2(5,7), p3(4,2);
- mln_assertion(make::ordpair (p2, p1) == make::ordpair (p1, p2));
- mln_assertion(make::ordpair (p1, p3) < make::ordpair (p1, p2));
- mln_assertion(make::ordpair (p1, p2) <= make::ordpair (p1, p2));
- mln_assertion(make::ordpair (p1, p3) <= make::ordpair (p1, p2));
+ mln_assertion(make::ord_pair(p2, p1) == make::ord_pair(p1, p2));
+ mln_assertion(make::ord_pair(p1, p3) < make::ord_pair(p1, p2));
+ mln_assertion(make::ord_pair(p1, p2) <= make::ord_pair(p1, p2));
+ mln_assertion(make::ord_pair(p1, p3) <= make::ord_pair(p1, p2));
}
Index: tests/util/lemmings.cc
--- tests/util/lemmings.cc (revision 2991)
+++ tests/util/lemmings.cc (working copy)
@@ -1,4 +1,5 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -25,16 +26,15 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*!
- * \file tests/util/lemmings.cc
- *
- * \brief test of mln::util::lemmings
- *
- */
+///
+/// \file tests/util/lemmings.cc
+///
+/// test of mln::util::lemmings
#include <mln/util/lemmings.hh>
#include <mln/core/image/image2d.hh>
+
int main ()
{
using namespace mln;
@@ -48,23 +48,26 @@
I ima = make::image<int>(vals);
- mln_site_(I) pt1(1, 0);
- mln_site_(I) pt2(0, 2);
- mln_site_(I) pt3(2, 3);
- mln_site_(I) pt4(3, 1);
- mln_site_(I) pt5(1, 1);
-
- mln_value_(I) vl1 = ima(pt1);
- mln_value_(I) vl2 = ima(pt2);
- mln_value_(I) vl3 = ima(pt3);
- mln_value_(I) vl4 = ima(pt4);
- mln_value_(I) vl5 = ima(pt5);
-
- mln_site_(I) ptl1 = util::lemmings(ima, pt1, right, vl1);
- mln_site_(I) ptl2 = util::lemmings(ima, pt2, down, vl2);
- mln_site_(I) ptl3 = util::lemmings(ima, pt3, left, vl3);
- mln_site_(I) ptl4 = util::lemmings(ima, pt4, up, vl4);
- mln_site_(I) ptl5 = util::lemmings(ima, pt5, up, vl5);
+ point2d
+ pt1(1, 0),
+ pt2(0, 2),
+ pt3(2, 3),
+ pt4(3, 1),
+ pt5(1, 1);
+
+ int
+ vl1 = ima(pt1),
+ vl2 = ima(pt2),
+ vl3 = ima(pt3),
+ vl4 = ima(pt4),
+ vl5 = ima(pt5);
+
+ point2d
+ ptl1 = util::lemmings(ima, pt1, right, vl1),
+ ptl2 = util::lemmings(ima, pt2, down, vl2),
+ ptl3 = util::lemmings(ima, pt3, left, vl3),
+ ptl4 = util::lemmings(ima, pt4, up, vl4),
+ ptl5 = util::lemmings(ima, pt5, up, vl5);
mln_assertion(ptl1 == point2d(1, 2));
mln_assertion(ptl2 == point2d(2, 2));
Index: tests/util/tree_fast_to_image.cc
--- tests/util/tree_fast_to_image.cc (revision 2991)
+++ tests/util/tree_fast_to_image.cc (working copy)
@@ -1,4 +1,5 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -25,12 +26,9 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*!
- * \file tests/util/tree_fast_to_image.cc
- *
- * \brief test of mln::util::tree_fast_to_image
- *
- */
+/// \file tests/util/tree_fast_to_image.cc
+///
+/// Test of mln::util::tree_fast_to_image.
#include <mln/util/tree_fast.hh>
#include <mln/core/contract.hh>
@@ -45,6 +43,7 @@
#include <mln/util/tree_fast_to_image.hh>
#include <mln/debug/println.hh>
+
template <typename P, typename V>
struct fllt_node
{
@@ -54,14 +53,13 @@
};
-int main (void)
+int main()
{
using namespace mln;
using value::int_u8;
typedef fllt_node<point2d , int_u8> I;
-
I s1;
I s2;
I s3;
@@ -131,7 +129,7 @@
};
- debug::printl (output);
+ debug::println(output);
image2d<int_u8> ref (make::image(vs));
mln_assertion(ref == output);
}
Index: mln/trait/value_.hh
--- mln/trait/value_.hh (revision 2991)
+++ mln/trait/value_.hh (working copy)
@@ -71,8 +71,8 @@
/// FIXME: check that the -1 is correct
# define mln_value_quant_from_(C) \
mlc_if(mln::metal::bool_<( int(C) > int(mlc_pow_int(2,
mln::def::low_quant_nbits)) \
- || C == 0 \
- || C == -1)>, \
+ || int(C) == 0 \
+ || int(C) == -1)>, \
mln::trait::value::quant::high, \
mln::trait::value::quant::low)
Index: mln/core/image/all.hh
--- mln/core/image/all.hh (revision 2991)
+++ mln/core/image/all.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,11 +28,9 @@
#ifndef MLN_CORE_IMAGE_ALL_HH
# define MLN_CORE_IMAGE_ALL_HH
-/*! \file mln/core/image/all.hh
- *
- * \brief File that includes all image types.
- *
- */
+/// \file mln/core/image/all.hh
+///
+/// File that includes all image types.
//# include <mln/core/image/bgraph_image.hh>
@@ -91,7 +89,6 @@
# include <mln/core/image/sub_image.hh>
# include <mln/core/image/sub_image_if.hh>
# include <mln/core/image/t_image.hh>
-# include <mln/core/image/translate_image.hh>
# include <mln/core/image/tr_image.hh>
# include <mln/core/image/tr_mesh.hh>
//# include <mln/core/image/value_enc_image.hh>
Index: mln/literal/all.hh
--- mln/literal/all.hh (revision 2991)
+++ mln/literal/all.hh (working copy)
@@ -1,4 +1,5 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,10 +29,20 @@
#ifndef MLN_LITERAL_ALL_HH
# define MLN_LITERAL_ALL_HH
-/*! \file mln/literal/all.hh
- *
- * \brief File that includes all literals.
- */
+/// \file mln/literal/all.hh
+///
+/// File that includes all literals.
+
+// Technical note:
+//
+// With some recent g++ versions, we have a warning due to literal
+// conversions (namely: "type qualifiers ignored on function return
+// type"). This warning comes from the "operator T()" method
+// instantiated with T being a const type, for instance, when
+// literal::zero is given to a procedure expecting a "const int&"
+// object. This warning will be avoided in very recent versions
+// of C++ thanks to the new compiling option -Wignore_qualifiers.
+
namespace mln
{
Index: mln/draw/all.hh
--- mln/draw/all.hh (revision 2991)
+++ mln/draw/all.hh (working copy)
@@ -1,4 +1,5 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,10 +29,9 @@
#ifndef MLN_DRAW_ALL_HH
# define MLN_DRAW_ALL_HH
-/*! \file mln/draw/all.hh
- *
- * \brief File that includes all draw-related routines.
- */
+/// \file mln/draw/all.hh
+///
+/// File that includes all draw-related routines.
namespace mln
@@ -42,9 +42,10 @@
}
+
# include <mln/draw/box.hh>
-# include <mln/draw/label.hh>
# include <mln/draw/line.hh>
# include <mln/draw/plot.hh>
+
#endif // ! MLN_DRAW_ALL_HH
Index: mln/metal/converts_to.hh
--- mln/metal/converts_to.hh (revision 2991)
+++ mln/metal/converts_to.hh (working copy)
@@ -1,4 +1,5 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,10 +29,9 @@
#ifndef MLN_METAL_CONVERTS_TO_HH
# define MLN_METAL_CONVERTS_TO_HH
-/*! \file mln/metal/converts_to.hh
- *
- * \brief Definition of a type that means "converts to".
- */
+/// \file mln/metal/converts_to.hh
+///
+/// Definition of a type that means "converts to".
# include <mln/metal/is_a.hh>
# include <mln/metal/const.hh>
@@ -71,6 +71,14 @@
sizeof(internal::yes_) )>
{};
+ template <typename T, typename U>
+ struct converts_to<T*, U*> : converts_to<T, U>
+ {};
+
+ template <typename T, typename U>
+ struct converts_to<T**, U**> : false_
+ {};
+
} // end of namespace mln::metal
} // end of namespace mln
Index: mln/level/replace.hh
--- mln/level/replace.hh (revision 2991)
+++ mln/level/replace.hh (working copy)
@@ -1,4 +1,5 @@
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,11 +29,9 @@
#ifndef MLN_LEVEL_REPLACE_HH
# define MLN_LEVEL_REPLACE_HH
-/*! \file mln/level/replace.hh
- *
- * \brief Replace the contents of an image into another one.
- *
- */
+/// \file mln/level/replace.hh
+///
+/// Replace the contents of an image into another one.
# include <mln/core/concept/image.hh>
# include <mln/core/image/image_if.hh>
@@ -41,6 +40,7 @@
# include <mln/pw/value.hh>
# include <mln/pw/cst.hh>
+
namespace mln
{
@@ -52,11 +52,11 @@
* \param[in] input The input image.
* \param[in] old_value The value to be replaced...
* \param[in] new_value ...by this one.
- *
*/
template <typename I>
- void replace(Image<I>& input, const mln_value(I)& old_value,
- const mln_value(I)& new_value);
+ void replace(Image<I>& input,
+ const mln_value(I)& old_value, const mln_value(I)& new_value);
+
# ifndef MLN_INCLUDE_ONLY
@@ -72,7 +72,11 @@
const mln_value(I)& new_value)
{
trace::entering("level::impl::generic::replace");
- level::fill((exact(input_) | pw::value(input_) == pw::cst(old_value)).rw(),
new_value);
+ I& input = exact(input_);
+
+ level::fill((input | (pw::value(input) == pw::cst(old_value))).rw(),
+ new_value);
+
trace::exiting("level::impl::generic::replace");
}
@@ -81,16 +85,18 @@
} // end of namespace mln::level::impl
+
// Facade.
template <typename I>
- void replace(Image<I>& input, const mln_value(I)& old_value,
- const mln_value(I)& new_value)
+ void replace(Image<I>& input,
+ const mln_value(I)& old_value, const mln_value(I)& new_value)
{
trace::entering("level::replace");
mln_precondition(exact(input).has_data());
impl::generic::replace_<I>(exact(input), old_value, new_value);
+
trace::exiting("level::replace");
}
Index: mln/accu/line.hh
--- mln/accu/line.hh (revision 2991)
+++ mln/accu/line.hh (working copy)
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -29,6 +30,7 @@
# define MLN_ACCU_LINE_HH
/// \file mln/accu/line.hh
+///
/// Run an accumulator on a line of images.
///
/// \todo Suppress integer manipulations (redundant with ptr arith).
@@ -112,8 +114,8 @@
typename I, typename O>
void
line(const Image<I>& input_,
- const mln_site(I)& p_start, unsigned len,
- unsigned half_length,
+ const mln_site(I)& p_start, unsigned len_,
+ unsigned half_length_,
Image<O>& output_)
{
typedef mln_site(I) P;
@@ -122,6 +124,10 @@
const I& input = exact(input_);
O& output = exact(output_);
+ // Avoid warning in signed/unsigned comparison.
+ const def::coord len = len_;
+ const def::coord half_length = half_length_;
+
// Checks and tests.
internal::line_tests<Meta_Accu, Dir>(input,
p_start, len,
Index: mln/convert/all.hh
--- mln/convert/all.hh (revision 2991)
+++ mln/convert/all.hh (working copy)
@@ -1,4 +1,5 @@
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,18 +29,20 @@
#ifndef MLN_CONVERT_ALL_HH
# define MLN_CONVERT_ALL_HH
-/*! \file mln/convert/all.hh
- *
- * \brief File that includes all conversion-related routines.
- */
+/// \file mln/convert/all.hh
+///
+/// File that includes all conversion-related routines.
namespace mln
{
+
/// Namespace of conversion routines.
namespace convert {}
+
}
+
# include <mln/convert/from_to.hh>
# include <mln/convert/to.hh>
@@ -48,8 +51,8 @@
# include <mln/convert/to_image.hh>
# include <mln/convert/to_rgb.hh>
# include <mln/convert/to_std_set.hh>
-# include <mln/convert/to_tiles.hh>
# include <mln/convert/to_p_array.hh>
# include <mln/convert/to_window.hh>
+
#endif // ! MLN_CONVERT_ALL_HH
Index: mln/win/inter.hh
--- mln/win/inter.hh (revision 2991)
+++ mln/win/inter.hh (working copy)
@@ -1,4 +1,5 @@
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,10 +29,9 @@
#ifndef MLN_WIN_INTER_HH
# define MLN_WIN_INTER_HH
-/*! \file mln/win/inter.hh
- *
- * \brief Define a function which inters a window with a delta-point.
- */
+/// \file mln/win/inter.hh
+///
+/// \brief Define a function which inters a window with a delta-point.
# include <mln/core/window.hh>
Index: mln/morpho/all.hh
--- mln/morpho/all.hh (revision 2991)
+++ mln/morpho/all.hh (working copy)
@@ -59,9 +59,7 @@
# include <mln/morpho/closing.hh>
# include <mln/morpho/complementation.hh>
# include <mln/morpho/contrast.hh>
-# include <mln/morpho/dilation_fast.hh>
# include <mln/morpho/dilation.hh>
-# include <mln/morpho/erosion_fast.hh>
# include <mln/morpho/erosion.hh>
# include <mln/morpho/general.hh>
# include <mln/morpho/gradient.hh>
Index: mln/morpho/essential.hh
--- mln/morpho/essential.hh (revision 2991)
+++ mln/morpho/essential.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,15 +28,13 @@
#ifndef MLN_MORPHO_ESSENTIAL_HH
# define MLN_MORPHO_ESSENTIAL_HH
-/*! \file mln/morpho/essential.hh
- *
- * \brief File that includes essential morpho-related routines.
- */
+/// \file mln/morpho/essential.hh
+///
+/// File that includes essential morpho-related routines.
+
# include <mln/morpho/closing.hh>
-# include <mln/morpho/dilation_fast.hh>
# include <mln/morpho/dilation.hh>
-# include <mln/morpho/erosion_fast.hh>
# include <mln/morpho/erosion.hh>
# include <mln/morpho/gradient.hh>
# include <mln/morpho/hit_or_miss.hh>
Index: mln/morpho/meyer_wst.hh
--- mln/morpho/meyer_wst.hh (revision 2991)
+++ mln/morpho/meyer_wst.hh (working copy)
@@ -75,7 +75,7 @@
\li \p I is the exact type of the input image.
\li \p N is the exact type of the neighborhood used to express
\a input's connexity. */
- template <typename L, typename I, typename N>
+ template <typename I, typename N, typename L>
mln_ch_value(I, L)
meyer_wst(const Image<I>& input, const Neighborhood<N>& nbh,
L& nbasins);
@@ -103,7 +103,7 @@
# ifndef MLN_INCLUDE_ONLY
- template <typename L, typename I, typename N>
+ template <typename I, typename N, typename L>
mln_ch_value(I, L)
meyer_wst(const Image<I>& input_, const Neighborhood<N>& nbh_,
L& nbasins)
Index: mln/util/tree_fast.hh
--- mln/util/tree_fast.hh (revision 2991)
+++ mln/util/tree_fast.hh (working copy)
@@ -1,4 +1,5 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -29,15 +30,12 @@
# define MLN_UTIL_TREE_FAST_HH
# include <vector>
-
# include <mln/core/contract.hh>
-/*!
- * \file mln/util/tree_fast.hh
- *
- * \brief Definition of a fast generic general fast tree.
- *
- */
+/// \file mln/util/tree_fast.hh
+///
+/// Definition of a fast generic general fast tree.
+
namespace mln
{
@@ -63,7 +61,7 @@
*
* \return the number of node of the tree.
*/
- const unsigned size() const;
+ unsigned size() const;
/*! \brief Check if the tree has \p elt.
@@ -115,6 +113,8 @@
unsigned root_;
};
+
+
# ifndef MLN_INCLUDE_ONLY
template <typename T>
@@ -136,7 +136,7 @@
template <typename T>
inline
- const unsigned
+ unsigned
tree_fast<T>::size() const
{
return (data_.size ());
@@ -213,7 +213,6 @@
} // end of namespace mln::util
-
} // end of namespace mln
Index: mln/util/lemmings.hh
--- mln/util/lemmings.hh (revision 2991)
+++ mln/util/lemmings.hh (working copy)
@@ -1,4 +1,5 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,10 +29,9 @@
#ifndef MLN_UTIL_LEMMINGS_HH
# define MLN_UTIL_LEMMINGS_HH
-/*! \file mln/util/lemmings.hh
- *
- * \brief Definition of an "lemmings" object.
- */
+/// \file mln/util/lemmings.hh
+///
+/// Definition of an "lemmings" object.
# include <mln/core/concept/image.hh>
# include <mln/set/is_subset_of.hh>
@@ -50,13 +50,13 @@
struct lemmings_ : public Object< lemmings_<I> >
{
lemmings_(const Image<I>& ima, const mln_psite(I)& pt,
- const mln_dpsite(I)& dpt, const mln_value(I)& val);
+ const mln_deduce(I, psite, delta)& dpt, const mln_value(I)& val);
mln_psite(I) operator()();
const I& ima_;
mln_psite(I) pt_;
- const mln_dpsite(I)& dpt_;
+ const mln_deduce(I, psite, delta)& dpt_;
const mln_value(I)& val_;
};
@@ -76,7 +76,8 @@
template <typename I>
mln_psite(I)
lemmings(const Image<I>& ima, const mln_psite(I)& pt,
- const mln_dpsite(I)& dpt, const mln_value(I)& val);
+ const mln_deduce(I, psite, delta)& dpt, const mln_value(I)& val);
+
# ifndef MLN_INCLUDE_ONLY
@@ -85,7 +86,7 @@
template <typename I>
inline
lemmings_<I>::lemmings_(const Image<I>& ima, const mln_psite(I)&
pt,
- const mln_dpsite(I)& dpt, const mln_value(I)& val)
+ const mln_deduce(I, psite, delta)& dpt, const mln_value(I)& val)
: ima_(exact(ima)),
pt_(pt),
dpt_(dpt),
@@ -105,7 +106,7 @@
template <typename I>
mln_psite(I)
lemmings(const Image<I>& ima, const mln_psite(I)& pt,
- const mln_dpsite(I)& dpt, const mln_value(I)& val)
+ const mln_deduce(I, psite, delta)& dpt, const mln_value(I)& val)
{
lemmings_<I> lm(ima, pt, dpt, val);
return lm();
Index: mln/labeling/blobs.hh
--- mln/labeling/blobs.hh (revision 2991)
+++ mln/labeling/blobs.hh (working copy)
@@ -85,17 +85,18 @@
P cur;
mln_niter(N) n(nbh, cur);
p_queue_fast<P> qu;
+ const L zero = literal::zero;
// Initialization.
nlabels = literal::zero;
mln_ch_value(I, L) output;
initialize(output, input);
- level::fill(output, literal::zero);
+ level::fill(output, zero);
// Loop.
mln_piter(I) p(input.domain());
for_all(p)
- if (input(p) && output(p) == literal::zero) // Object point, not labeled
yet.
+ if (input(p) && output(p) == zero) // Object point, not labeled yet.
{
// Label this point component.
if (nlabels == mln_max(L))
@@ -112,7 +113,7 @@
cur = qu.front();
qu.pop();
for_all(n) if (input.has(n))
- if (input(n) && output(n) == literal::zero)
+ if (input(n) && output(n) == zero)
{
mln_invariant(! qu.compute_has(n));
qu.push(n);