* mln/world/inter_pixel/all.hh: New.
* mln/world/inter_pixel/dim2/all.hh: Fix copyright.
* mln/world/all.hh: New.
* mln/all.hh: Update.
* tests/world/inter_pixel/is_separator.cc: New.
* tests/world/inter_pixel/is_pixel.cc: New.
* tests/world/inter_pixel/Makefile.am: Update.
* tests/world/inter_pixel/separator_to_pixels.cc: New.
* mln/world/inter_pixel/make: Remove; useless.
* tests/world/inter_pixel/image2full.cc: Remove;
new stuff is...
* tests/world/inter_pixel/immerse.hh: ...this.
---
milena/ChangeLog | 17 +++++++
milena/mln/all.hh | 1 +
milena/mln/world/{inter_pixel/dim2 => }/all.hh | 20 ++++-----
milena/mln/world/inter_pixel/{dim2 => }/all.hh | 26 ++++++-----
milena/mln/world/inter_pixel/dim2/all.hh | 6 +-
milena/tests/world/inter_pixel/Makefile.am | 12 ++++-
.../inter_pixel/{image2full.cc => is_pixel.cc} | 34 ++++----------
.../world/inter_pixel/is_separator.cc} | 28 +++++++-----
.../{image2full.cc => separator_to_pixels.cc} | 48 +++++++++-----------
9 files changed, 102 insertions(+), 90 deletions(-)
copy milena/mln/world/{inter_pixel/dim2 => }/all.hh (71%)
copy milena/mln/world/inter_pixel/{dim2 => }/all.hh (69%)
copy milena/tests/world/inter_pixel/{image2full.cc => is_pixel.cc} (66%)
copy milena/{mln/world/inter_pixel/dim2/all.hh =>
tests/world/inter_pixel/is_separator.cc} (70%)
rename milena/tests/world/inter_pixel/{image2full.cc => separator_to_pixels.cc} (66%)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 10648a0..9ac5049 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,3 +1,20 @@
+2009-05-07 Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
+
+ Fix missing files and tests in world inter-pixel.
+
+ * mln/world/inter_pixel/all.hh: New.
+ * mln/world/inter_pixel/dim2/all.hh: Fix copyright.
+ * mln/world/all.hh: New.
+ * mln/all.hh: Update.
+ * tests/world/inter_pixel/is_separator.cc: New.
+ * tests/world/inter_pixel/is_pixel.cc: New.
+ * tests/world/inter_pixel/Makefile.am: Update.
+ * tests/world/inter_pixel/separator_to_pixels.cc: New.
+ * mln/world/inter_pixel/make: Remove; useless.
+ * tests/world/inter_pixel/image2full.cc: Remove;
+ new stuff is...
+ * tests/world/inter_pixel/immerse.hh: ...this.
+
2009-05-07 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
Move object_id.hh to mln/util and add a missing operator<
diff --git a/milena/mln/all.hh b/milena/mln/all.hh
index cc4374b..7f77db4 100644
--- a/milena/mln/all.hh
+++ b/milena/mln/all.hh
@@ -72,6 +72,7 @@
#include <mln/util/all.hh>
#include <mln/value/all.hh>
#include <mln/win/all.hh>
+#include <mln/world/all.hh>
#include <mln/essential/1d.hh>
#include <mln/essential/2d.hh>
diff --git a/milena/mln/world/inter_pixel/dim2/all.hh b/milena/mln/world/all.hh
similarity index 71%
copy from milena/mln/world/inter_pixel/dim2/all.hh
copy to milena/mln/world/all.hh
index 1c7131b..7154654 100644
--- a/milena/mln/world/inter_pixel/dim2/all.hh
+++ b/milena/mln/world/all.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009 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,19 +25,17 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_WORLD_INTER_PIXEL_DIM2_ALL_HH
-# define MLN_WORLD_INTER_PIXEL_DIM2_ALL_HH
+#ifndef MLN_WORLD_ALL_HH
+# define MLN_WORLD_ALL_HH
-/// \file mln/world/inter_pixel/dim2/all.hh
+/// \file mln/world/all.hh
///
-/// File that includes all the dim2 routines.
+/// File that includes all the world routines.
-// Local directory.
-# include <mln/world/inter_pixel/dim2/is_dot.hh>
-# include <mln/world/inter_pixel/dim2/is_edge.hh>
-# include <mln/world/inter_pixel/dim2/is_pixel.hh>
-# include <mln/world/inter_pixel/dim2/is_row_odd.hh>
+// Sub-directories.
+# include <mln/world/binary_2d/all.hh>
+# include <mln/world/inter_pixel/all.hh>
-#endif // ! MLN_WORLD_INTER_PIXEL_DIM2_ALL_HH
+#endif // ! MLN_WORLD_ALL_HH
diff --git a/milena/mln/world/inter_pixel/dim2/all.hh
b/milena/mln/world/inter_pixel/all.hh
similarity index 69%
copy from milena/mln/world/inter_pixel/dim2/all.hh
copy to milena/mln/world/inter_pixel/all.hh
index 1c7131b..da3b105 100644
--- a/milena/mln/world/inter_pixel/dim2/all.hh
+++ b/milena/mln/world/inter_pixel/all.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009 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,19 +25,23 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_WORLD_INTER_PIXEL_DIM2_ALL_HH
-# define MLN_WORLD_INTER_PIXEL_DIM2_ALL_HH
+#ifndef MLN_WORLD_INTER_PIXEL_ALL_HH
+# define MLN_WORLD_INTER_PIXEL_ALL_HH
-/// \file mln/world/inter_pixel/dim2/all.hh
+/// \file mln/world/inter_pixel/all.hh
///
-/// File that includes all the dim2 routines.
+/// File that includes all the inter-pixel routines.
-// Local directory.
-# include <mln/world/inter_pixel/dim2/is_dot.hh>
-# include <mln/world/inter_pixel/dim2/is_edge.hh>
-# include <mln/world/inter_pixel/dim2/is_pixel.hh>
-# include <mln/world/inter_pixel/dim2/is_row_odd.hh>
+// Sub-directories.
+# include <mln/world/inter_pixel/dim2/all.hh>
-#endif // ! MLN_WORLD_INTER_PIXEL_DIM2_ALL_HH
+# include <mln/world/inter_pixel/compute.hh>
+# include <mln/world/inter_pixel/immerse.hh>
+# include <mln/world/inter_pixel/is_separator.hh>
+# include <mln/world/inter_pixel/is_pixel.hh>
+# include <mln/world/inter_pixel/separator_to_pixels.hh>
+
+
+#endif // ! MLN_WORLD_INTER_PIXEL_ALL_HH
diff --git a/milena/mln/world/inter_pixel/dim2/all.hh
b/milena/mln/world/inter_pixel/dim2/all.hh
index 1c7131b..8696371 100644
--- a/milena/mln/world/inter_pixel/dim2/all.hh
+++ b/milena/mln/world/inter_pixel/dim2/all.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009 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
@@ -30,10 +31,9 @@
/// \file mln/world/inter_pixel/dim2/all.hh
///
-/// File that includes all the dim2 routines.
+/// File that includes all the inter-pixel 2D routines.
-// Local directory.
# include <mln/world/inter_pixel/dim2/is_dot.hh>
# include <mln/world/inter_pixel/dim2/is_edge.hh>
# include <mln/world/inter_pixel/dim2/is_pixel.hh>
diff --git a/milena/tests/world/inter_pixel/Makefile.am
b/milena/tests/world/inter_pixel/Makefile.am
index fdbcea2..89f7bf7 100644
--- a/milena/tests/world/inter_pixel/Makefile.am
+++ b/milena/tests/world/inter_pixel/Makefile.am
@@ -6,10 +6,16 @@ SUBDIRS = \
dim2
check_PROGRAMS = \
- image2full \
- immerse
+ compute \
+ immerse \
+ is_pixel \
+ is_separator \
+ separator_to_pixels
-image2full_SOURCES = image2full.cc
+compute_SOURCES = compute.cc
immerse_SOURCES = immerse.cc
+is_pixel_SOURCES = is_pixel.cc
+is_separator_SOURCES = is_separator.cc
+separator_to_pixels_SOURCES = separator_to_pixels.cc
TESTS = $(check_PROGRAMS)
diff --git a/milena/tests/world/inter_pixel/image2full.cc
b/milena/tests/world/inter_pixel/is_pixel.cc
similarity index 66%
copy from milena/tests/world/inter_pixel/image2full.cc
copy to milena/tests/world/inter_pixel/is_pixel.cc
index 06398a1..b783e80 100644
--- a/milena/tests/world/inter_pixel/image2full.cc
+++ b/milena/tests/world/inter_pixel/is_pixel.cc
@@ -25,36 +25,22 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/// \file tests/world/inter_pixel/image2full.cc
+/// \file tests/world/inter_pixel/is_pixel.cc
///
-/// Tests on mln::world::inter_pixel::image2full
+/// Tests on mln::world::inter_pixel::is_pixel.
+
+#include <mln/core/alias/point2d.hh>
+#include <mln/world/inter_pixel/is_pixel.hh>
-#include <mln/core/image/image2d.hh>
-#include <mln/make/image.hh>
-#include <mln/value/int_u8.hh>
-#include <mln/level/compare.hh>
-#include <mln/world/inter_pixel/image2full.hh>
int main()
{
using namespace mln;
+ using namespace world::inter_pixel;
- value::int_u8 vals[][3] = { { 3, 4, 5 },
- { 1, 3, 6 },
- { 8, 7, 3 } } ;
-
- value::int_u8 refs[][5] = { { 3, 0, 4, 0, 5 },
- { 0, 0, 0, 0, 0 },
- { 1, 0, 3, 0, 6 },
- { 0, 0, 0, 0, 0 },
- { 8, 0, 7, 0, 3 } };
-
- typedef image2d<value::int_u8> ima_t;
- ima_t ima = make::image(vals);
- ima_t ref = make::image(refs);
-
- ima_t ima_l = world::inter_pixel::image2full(ima);
-
- mln_assertion(ima_l == ref);
+ point2d p00(0, 0), p01(0, 1), p11(1, 1);
+ mln_assertion( is_pixel()(p00));
+ mln_assertion(! is_pixel()(p01));
+ mln_assertion(! is_pixel()(p11));
}
diff --git a/milena/mln/world/inter_pixel/dim2/all.hh
b/milena/tests/world/inter_pixel/is_separator.cc
similarity index 70%
copy from milena/mln/world/inter_pixel/dim2/all.hh
copy to milena/tests/world/inter_pixel/is_separator.cc
index 1c7131b..7234acb 100644
--- a/milena/mln/world/inter_pixel/dim2/all.hh
+++ b/milena/tests/world/inter_pixel/is_separator.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009 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,19 +25,23 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_WORLD_INTER_PIXEL_DIM2_ALL_HH
-# define MLN_WORLD_INTER_PIXEL_DIM2_ALL_HH
-
-/// \file mln/world/inter_pixel/dim2/all.hh
+/// \file tests/world/inter_pixel/is_separator.cc
///
-/// File that includes all the dim2 routines.
+/// Tests on mln::world::inter_pixel::is_separator.
+
+#include <mln/core/alias/point2d.hh>
+#include <mln/world/inter_pixel/is_separator.hh>
-// Local directory.
-# include <mln/world/inter_pixel/dim2/is_dot.hh>
-# include <mln/world/inter_pixel/dim2/is_edge.hh>
-# include <mln/world/inter_pixel/dim2/is_pixel.hh>
-# include <mln/world/inter_pixel/dim2/is_row_odd.hh>
+int main()
+{
+ using namespace mln;
+ using namespace world::inter_pixel;
+ point2d p00(0, 0), p01(0, 1), p10(1, 0), p11(1, 1);
-#endif // ! MLN_WORLD_INTER_PIXEL_DIM2_ALL_HH
+ mln_assertion(! is_separator()(p00));
+ mln_assertion( is_separator()(p01));
+ mln_assertion(! is_separator()(p11));
+ mln_assertion( is_separator()(p10));
+}
diff --git a/milena/tests/world/inter_pixel/image2full.cc
b/milena/tests/world/inter_pixel/separator_to_pixels.cc
similarity index 66%
rename from milena/tests/world/inter_pixel/image2full.cc
rename to milena/tests/world/inter_pixel/separator_to_pixels.cc
index 06398a1..fd77491 100644
--- a/milena/tests/world/inter_pixel/image2full.cc
+++ b/milena/tests/world/inter_pixel/separator_to_pixels.cc
@@ -25,36 +25,32 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/// \file tests/world/inter_pixel/image2full.cc
+/// \file tests/world/inter_pixel/separator_to_pixels.cc
///
-/// Tests on mln::world::inter_pixel::image2full
+/// Tests on mln::world::inter_pixel::separator_to_pixels.
+
+#include <mln/core/alias/point2d.hh>
+#include <mln/world/inter_pixel/separator_to_pixels.hh>
-#include <mln/core/image/image2d.hh>
-#include <mln/make/image.hh>
-#include <mln/value/int_u8.hh>
-#include <mln/level/compare.hh>
-#include <mln/world/inter_pixel/image2full.hh>
int main()
{
using namespace mln;
-
- value::int_u8 vals[][3] = { { 3, 4, 5 },
- { 1, 3, 6 },
- { 8, 7, 3 } } ;
-
- value::int_u8 refs[][5] = { { 3, 0, 4, 0, 5 },
- { 0, 0, 0, 0, 0 },
- { 1, 0, 3, 0, 6 },
- { 0, 0, 0, 0, 0 },
- { 8, 0, 7, 0, 3 } };
-
- typedef image2d<value::int_u8> ima_t;
- ima_t ima = make::image(vals);
- ima_t ref = make::image(refs);
-
- ima_t ima_l = world::inter_pixel::image2full(ima);
-
- mln_assertion(ima_l == ref);
-
+ using namespace world::inter_pixel;
+
+ point2d
+ p00(0, 0), p01(0, 1), p02(0, 2),
+ p10(1, 0),
+ p20(2, 0);
+
+ {
+ point2d p00_, p02_;
+ separator_to_pixels(p01, p00_, p02_);
+ mln_assertion(p00_ == p00 && p02_ == p02);
+ }
+ {
+ point2d p00_, p20_;
+ separator_to_pixels(p10, p00_, p20_);
+ mln_assertion(p00_ == p00 && p20_ == p20);
+ }
}
--
1.6.1.2