* headers.mk: add new headers to distribution.
* mln/all.hh,
* mln/essential/routine.hh,
* mln/extract/all.hh,
* mln/extract/essential.hh: include the new headers.
* mln/extract/blue.hh,
* mln/extract/green.hh,
* mln/extract/red.hh: new routines. Create a fun_image to work on a
specific color component.
* tests/extract/Makefile.am,
* tests/extract/blue.cc,
* tests/extract/green.cc,
* tests/extract/red.cc: add new tests.
* tests/unit_test/Makefile.am,
* tests/unit_test/mln_extract_all.cc,
* tests/unit_test/mln_extract_blue.cc,
* tests/unit_test/mln_extract_essential.cc,
* tests/unit_test/mln_extract_green.cc,
* tests/unit_test/mln_extract_red.cc,
* tests/unit_test/mln_opt_element.cc: add unit tests.
---
milena/ChangeLog | 30 ++++++++
milena/headers.mk | 6 ++
milena/mln/all.hh | 83 ++++++++---------------
milena/mln/essential/routine.hh | 1 +
milena/mln/extract/all.hh | 50 ++++++++++++++
milena/mln/extract/blue.hh | 65 ++++++++++++++++++
milena/mln/extract/essential.hh | 38 ++++++++++
milena/mln/extract/green.hh | 65 ++++++++++++++++++
milena/mln/extract/red.hh | 65 ++++++++++++++++++
milena/tests/extract/Makefile.am | 14 ++++
milena/tests/extract/blue.cc | 45 ++++++++++++
milena/tests/extract/green.cc | 45 ++++++++++++
milena/tests/extract/red.cc | 45 ++++++++++++
milena/tests/unit_test/Makefile.am | 12 +++
milena/tests/unit_test/mln_extract_all.cc | 11 +++
milena/tests/unit_test/mln_extract_blue.cc | 11 +++
milena/tests/unit_test/mln_extract_essential.cc | 11 +++
milena/tests/unit_test/mln_extract_green.cc | 11 +++
milena/tests/unit_test/mln_extract_red.cc | 11 +++
milena/tests/unit_test/mln_opt_element.cc | 11 +++
20 files changed, 575 insertions(+), 55 deletions(-)
create mode 100644 milena/mln/extract/all.hh
create mode 100644 milena/mln/extract/blue.hh
create mode 100644 milena/mln/extract/essential.hh
create mode 100644 milena/mln/extract/green.hh
create mode 100644 milena/mln/extract/red.hh
create mode 100644 milena/tests/extract/Makefile.am
create mode 100644 milena/tests/extract/blue.cc
create mode 100644 milena/tests/extract/green.cc
create mode 100644 milena/tests/extract/red.cc
create mode 100644 milena/tests/unit_test/mln_extract_all.cc
create mode 100644 milena/tests/unit_test/mln_extract_blue.cc
create mode 100644 milena/tests/unit_test/mln_extract_essential.cc
create mode 100644 milena/tests/unit_test/mln_extract_green.cc
create mode 100644 milena/tests/unit_test/mln_extract_red.cc
create mode 100644 milena/tests/unit_test/mln_opt_element.cc
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 7584344..6350650 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,3 +1,33 @@
+2009-01-23 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Add routines to work on a specific color component.
+
+ * headers.mk: add new headers to distribution.
+
+ * mln/all.hh,
+ * mln/essential/routine.hh,
+ * mln/extract/all.hh,
+ * mln/extract/essential.hh: include the new headers.
+
+ * mln/extract/blue.hh,
+ * mln/extract/green.hh,
+ * mln/extract/red.hh: new routines. Create a fun_image to work on a
+ specific color component.
+
+
+ * tests/extract/Makefile.am,
+ * tests/extract/blue.cc,
+ * tests/extract/green.cc,
+ * tests/extract/red.cc: add new tests.
+
+ * tests/unit_test/Makefile.am,
+ * tests/unit_test/mln_extract_all.cc,
+ * tests/unit_test/mln_extract_blue.cc,
+ * tests/unit_test/mln_extract_essential.cc,
+ * tests/unit_test/mln_extract_green.cc,
+ * tests/unit_test/mln_extract_red.cc,
+ * tests/unit_test/mln_opt_element.cc: add unit tests.
+
2009-01-21 Thierry GERAUD <thierry.geraud(a)lrde.epita.fr>
Add some images.
diff --git a/milena/headers.mk b/milena/headers.mk
index 5babdd4..7263811 100644
--- a/milena/headers.mk
+++ b/milena/headers.mk
@@ -158,6 +158,11 @@ mln/make/w_window3d_int.hh \
mln/make/essential.hh \
mln/make/w_window1d_int.hh \
mln/make/point2d_h.hh \
+mln/extract/red.hh \
+mln/extract/all.hh \
+mln/extract/green.hh \
+mln/extract/blue.hh \
+mln/extract/essential.hh \
mln/display/all.hh \
mln/display/essential.hh \
mln/extension/adjust.hh \
@@ -427,6 +432,7 @@ mln/math/essential.hh \
mln/math/acos.hh \
mln/math/round_sat.hh \
mln/opt/at.hh \
+mln/opt/element.hh \
mln/opt/value.hh \
mln/binarization/includes.hh \
mln/binarization/all.hh \
diff --git a/milena/mln/all.hh b/milena/mln/all.hh
index 42d38a0..f9f16d0 100644
--- a/milena/mln/all.hh
+++ b/milena/mln/all.hh
@@ -32,70 +32,43 @@
///
/// File that includes all the headers.
+
+#include <mln/accu/all.hh>
+#include <mln/arith/all.hh>
+#include <mln/border/all.hh>
+#include <mln/canvas/all.hh>
+#include <mln/convert/all.hh>
+#include <mln/core/all.hh>
#include <mln/data/all.hh>
-#include <mln/util/all.hh>
-#include <mln/fun/p2v/all.hh>
-#include <mln/fun/x2x/all.hh>
-#include <mln/fun/v2v/all.hh>
-#include <mln/fun/i2v/all.hh>
-#include <mln/fun/all.hh>
-#include <mln/fun/x2v/all.hh>
-#include <mln/fun/p2b/all.hh>
+#include <mln/debug/all.hh>
+#include <mln/display/all.hh>
+#include <mln/draw/all.hh>
+#include <mln/estim/all.hh>
#include <mln/extension/all.hh>
+#include <mln/extract/all.hh>
+#include <mln/fun/all.hh>
+#include <mln/geom/all.hh>
#include <mln/histo/all.hh>
-#include <mln/trait/op/all.hh>
-#include <mln/trait/all.hh>
-#include <mln/trait/value/all.hh>
-#include <mln/win/all.hh>
-#include <mln/core/routine/all.hh>
-#include <mln/core/trait/all.hh>
-#include <mln/core/def/all.hh>
-#include <mln/core/internal/check/image_all.hh>
-#include <mln/core/image/all.hh>
-#include <mln/core/site_set/all.hh>
-#include <mln/io/pbm/all.hh>
-#include <mln/io/pfm/all.hh>
-#include <mln/io/pgm/all.hh>
#include <mln/io/all.hh>
-#include <mln/io/fits/all.hh>
-#include <mln/io/pnm/all.hh>
-#include <mln/io/ppm/all.hh>
-#include <mln/make/all.hh>
-#include <mln/canvas/morpho/all.hh>
-#include <mln/canvas/all.hh>
-#include <mln/canvas/browsing/all.hh>
-#include <mln/estim/all.hh>
-#include <mln/arith/all.hh>
-#include <mln/display/all.hh>
-#include <mln/test/all.hh>
-#include <mln/border/all.hh>
-#include <mln/trace/all.hh>
-#include <mln/debug/all.hh>
-#include <mln/morpho/elementary/all.hh>
-#include <mln/morpho/all.hh>
-#include <mln/accu/all.hh>
-#include <mln/pw/all.hh>
+#include <mln/labeling/all.hh>
+#include <mln/level/all.hh>
#include <mln/linear/all.hh>
-#include <mln/metal/all.hh>
-#include <mln/metal/math/all.hh>
-#include <mln/set/all.hh>
-#include <mln/convert/impl/all.hh>
-#include <mln/convert/all.hh>
-#include <mln/geom/all.hh>
#include <mln/literal/all.hh>
-#include <mln/level/approx/all.hh>
-#include <mln/level/all.hh>
-#include <mln/level/naive/all.hh>
+#include <mln/logical/all.hh>
+#include <mln/make/all.hh>
#include <mln/math/all.hh>
+#include <mln/metal/all.hh>
+#include <mln/morpho/all.hh>
#include <mln/norm/all.hh>
-#include <mln/logical/all.hh>
-#include <mln/draw/all.hh>
-#include <mln/value/builtin/all.hh>
-#include <mln/value/all.hh>
-#include <mln/value/internal/all.hh>
-#include <mln/value/concept/all.hh>
+#include <mln/pw/all.hh>
+#include <mln/set/all.hh>
#include <mln/tag/all.hh>
-#include <mln/labeling/all.hh>
+#include <mln/test/all.hh>
+#include <mln/trace/all.hh>
+#include <mln/trait/all.hh>
+#include <mln/util/all.hh>
+#include <mln/value/all.hh>
+#include <mln/win/all.hh>
#include <mln/essential/1d.hh>
#include <mln/essential/2d.hh>
diff --git a/milena/mln/essential/routine.hh b/milena/mln/essential/routine.hh
index 819749b..ba164b4 100644
--- a/milena/mln/essential/routine.hh
+++ b/milena/mln/essential/routine.hh
@@ -42,6 +42,7 @@
# include <mln/draw/essential.hh>
# include <mln/estim/essential.hh>
# include <mln/extension/essential.hh>
+# include <mln/extract/essential.hh>
# include <mln/fun/essential.hh>
# include <mln/geom/essential.hh>
# include <mln/histo/essential.hh>
diff --git a/milena/mln/extract/all.hh b/milena/mln/extract/all.hh
new file mode 100644
index 0000000..eeea24d
--- /dev/null
+++ b/milena/mln/extract/all.hh
@@ -0,0 +1,50 @@
+// 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
+// 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_EXTRACT_ALL_HH
+# define MLN_EXTRACT_ALL_HH
+
+/// \file mln/extract/all.hh
+///
+/// File that includes all sub-data extraction related routines.
+
+
+namespace mln
+{
+
+ namespace extract
+ {
+ }
+
+}
+
+# include <mln/extract/red.hh>
+# include <mln/extract/green.hh>
+# include <mln/extract/blue.hh>
+
+
+#endif // ! MLN_EXTRACT_ALL_HH
diff --git a/milena/mln/extract/blue.hh b/milena/mln/extract/blue.hh
new file mode 100644
index 0000000..3315a25
--- /dev/null
+++ b/milena/mln/extract/blue.hh
@@ -0,0 +1,65 @@
+// 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
+// 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_EXTRACT_GREEN_HH
+# define MLN_EXTRACT_GREEN_HH
+
+/// \file mln/extract/blue.hh
+///
+/// Extract the blue component of an image.
+
+
+# include <mln/core/image/fun_image.hh>
+# include <mln/fun/meta/blue.hh>
+
+namespace mln
+{
+
+ namespace extract
+ {
+
+ template <typename I>
+ fun_image<meta::blue<mln_value(I)>,I>
+ blue(Image<I>& ima);
+
+# ifndef MLN_INCLUDE_ONLY
+
+ template <typename I>
+ fun_image<meta::blue<mln_value(I)>,I>
+ blue(Image<I>& ima)
+ {
+ fun_image<meta::blue<mln_value(I)>,I> result(ima);
+ return result;
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::extract
+
+} // end of namespace mln
+
+#endif // ! MLN_EXTRACT_GREEN_HH
diff --git a/milena/mln/extract/essential.hh b/milena/mln/extract/essential.hh
new file mode 100644
index 0000000..27a4cae
--- /dev/null
+++ b/milena/mln/extract/essential.hh
@@ -0,0 +1,38 @@
+// 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
+// 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_EXTRACT_ESSENTIAL_HH
+# define MLN_EXTRACT_ESSENTIAL_HH
+
+/// \file mln/extract/all.hh
+///
+/// File that includes all sub-data extraction related routines.
+
+# include <mln/extract/all.hh>
+
+
+#endif // ! MLN_EXTRACT_ESSENTIAL_HH
diff --git a/milena/mln/extract/green.hh b/milena/mln/extract/green.hh
new file mode 100644
index 0000000..7a4e54c
--- /dev/null
+++ b/milena/mln/extract/green.hh
@@ -0,0 +1,65 @@
+// 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
+// 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_EXTRACT_GREEN_HH
+# define MLN_EXTRACT_GREEN_HH
+
+/// \file mln/extract/green.hh
+///
+/// Extract the green component of an image.
+
+
+# include <mln/core/image/fun_image.hh>
+# include <mln/fun/meta/green.hh>
+
+namespace mln
+{
+
+ namespace extract
+ {
+
+ template <typename I>
+ fun_image<meta::green<mln_value(I)>,I>
+ green(Image<I>& ima);
+
+# ifndef MLN_INCLUDE_ONLY
+
+ template <typename I>
+ fun_image<meta::green<mln_value(I)>,I>
+ green(Image<I>& ima)
+ {
+ fun_image<meta::green<mln_value(I)>,I> result(ima);
+ return result;
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::extract
+
+} // end of namespace mln
+
+#endif // ! MLN_EXTRACT_GREEN_HH
diff --git a/milena/mln/extract/red.hh b/milena/mln/extract/red.hh
new file mode 100644
index 0000000..9946568
--- /dev/null
+++ b/milena/mln/extract/red.hh
@@ -0,0 +1,65 @@
+// 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
+// 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_EXTRACT_RED_HH
+# define MLN_EXTRACT_RED_HH
+
+/// \file mln/extract/red.hh
+///
+/// Extract the red component of an image.
+
+
+# include <mln/core/image/fun_image.hh>
+# include <mln/fun/meta/red.hh>
+
+namespace mln
+{
+
+ namespace extract
+ {
+
+ template <typename I>
+ fun_image<meta::red<mln_value(I)>,I>
+ red(Image<I>& ima);
+
+# ifndef MLN_INCLUDE_ONLY
+
+ template <typename I>
+ fun_image<meta::red<mln_value(I)>,I>
+ red(Image<I>& ima)
+ {
+ fun_image<meta::red<mln_value(I)>,I> result(ima);
+ return result;
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::extract
+
+} // end of namespace mln
+
+#endif // ! MLN_EXTRACT_RED_HH
diff --git a/milena/tests/extract/Makefile.am b/milena/tests/extract/Makefile.am
new file mode 100644
index 0000000..d39a20f
--- /dev/null
+++ b/milena/tests/extract/Makefile.am
@@ -0,0 +1,14 @@
+## Process this file through Automake to create Makefile.in -*- Makefile -*-
+
+include $(top_srcdir)/milena/tests/tests.mk
+
+check_PROGRAMS = \
+ red \
+ green \
+ blue
+
+red_SOURCES = red.cc
+green_SOURCES = green.cc
+blue_SOURCES = blue.cc
+
+TESTS = $(check_PROGRAMS)
diff --git a/milena/tests/extract/blue.cc b/milena/tests/extract/blue.cc
new file mode 100644
index 0000000..2748fa3
--- /dev/null
+++ b/milena/tests/extract/blue.cc
@@ -0,0 +1,45 @@
+// 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
+// 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/image/image2d.hh>
+# include <mln/extract/blue.hh>
+# include <mln/value/rgb8.hh>
+# include <mln/core/var.hh>
+
+int main()
+{
+ using namespace mln;
+
+ image2d<value::rgb8> ima(2,2);
+ point2d p(1,1);
+ ima(p) = value::rgb8(200, 230, 240);
+
+ mln_VAR(ima_blue, extract::blue(ima));
+
+ mln_assertion(ima(p).blue() == ima_blue(p));
+}
+
diff --git a/milena/tests/extract/green.cc b/milena/tests/extract/green.cc
new file mode 100644
index 0000000..59a8c28
--- /dev/null
+++ b/milena/tests/extract/green.cc
@@ -0,0 +1,45 @@
+// 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
+// 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/image/image2d.hh>
+# include <mln/extract/green.hh>
+# include <mln/value/rgb8.hh>
+# include <mln/core/var.hh>
+
+int main()
+{
+ using namespace mln;
+
+ image2d<value::rgb8> ima(2,2);
+ point2d p(1,1);
+ ima(p) = value::rgb8(200, 230, 240);
+
+ mln_VAR(ima_green, extract::green(ima));
+
+ mln_assertion(ima(p).green() == ima_green(p));
+}
+
diff --git a/milena/tests/extract/red.cc b/milena/tests/extract/red.cc
new file mode 100644
index 0000000..de2facb
--- /dev/null
+++ b/milena/tests/extract/red.cc
@@ -0,0 +1,45 @@
+// 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
+// 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/image/image2d.hh>
+# include <mln/extract/red.hh>
+# include <mln/value/rgb8.hh>
+# include <mln/core/var.hh>
+
+int main()
+{
+ using namespace mln;
+
+ image2d<value::rgb8> ima(2,2);
+ point2d p(1,1);
+ ima(p) = value::rgb8(200, 230, 240);
+
+ mln_VAR(ima_red, extract::red(ima));
+
+ mln_assertion(ima(p).red() == ima_red(p));
+}
+
diff --git a/milena/tests/unit_test/Makefile.am b/milena/tests/unit_test/Makefile.am
index 9398c88..3b4444a 100644
--- a/milena/tests/unit_test/Makefile.am
+++ b/milena/tests/unit_test/Makefile.am
@@ -155,6 +155,11 @@ mln_make_w_window3d_int \
mln_make_essential \
mln_make_w_window1d_int \
mln_make_point2d_h \
+mln_extract_red \
+mln_extract_all \
+mln_extract_green \
+mln_extract_blue \
+mln_extract_essential \
mln_display_all \
mln_display_essential \
mln_extension_adjust \
@@ -421,6 +426,7 @@ mln_math_essential \
mln_math_acos \
mln_math_round_sat \
mln_opt_at \
+mln_opt_element \
mln_opt_value \
mln_binarization_includes \
mln_binarization_all \
@@ -1170,6 +1176,11 @@ mln_make_w_window3d_int_SOURCES = mln_make_w_window3d_int.cc
mln_make_essential_SOURCES = mln_make_essential.cc
mln_make_w_window1d_int_SOURCES = mln_make_w_window1d_int.cc
mln_make_point2d_h_SOURCES = mln_make_point2d_h.cc
+mln_extract_red_SOURCES = mln_extract_red.cc
+mln_extract_all_SOURCES = mln_extract_all.cc
+mln_extract_green_SOURCES = mln_extract_green.cc
+mln_extract_blue_SOURCES = mln_extract_blue.cc
+mln_extract_essential_SOURCES = mln_extract_essential.cc
mln_display_all_SOURCES = mln_display_all.cc
mln_display_essential_SOURCES = mln_display_essential.cc
mln_extension_adjust_SOURCES = mln_extension_adjust.cc
@@ -1436,6 +1447,7 @@ mln_math_essential_SOURCES = mln_math_essential.cc
mln_math_acos_SOURCES = mln_math_acos.cc
mln_math_round_sat_SOURCES = mln_math_round_sat.cc
mln_opt_at_SOURCES = mln_opt_at.cc
+mln_opt_element_SOURCES = mln_opt_element.cc
mln_opt_value_SOURCES = mln_opt_value.cc
mln_binarization_includes_SOURCES = mln_binarization_includes.cc
mln_binarization_all_SOURCES = mln_binarization_all.cc
diff --git a/milena/tests/unit_test/mln_extract_all.cc
b/milena/tests/unit_test/mln_extract_all.cc
new file mode 100644
index 0000000..1d2ce3d
--- /dev/null
+++ b/milena/tests/unit_test/mln_extract_all.cc
@@ -0,0 +1,11 @@
+// Unit test for mln/extract/all.hh.
+// Generated by ./build_unit_test.sh, do not modify.
+
+// Include the file twice, so we detect missing inclusion guards.
+#include <mln/extract/all.hh>
+#include <mln/extract/all.hh>
+
+int main()
+{
+ // Nothing.
+}
diff --git a/milena/tests/unit_test/mln_extract_blue.cc
b/milena/tests/unit_test/mln_extract_blue.cc
new file mode 100644
index 0000000..db1009f
--- /dev/null
+++ b/milena/tests/unit_test/mln_extract_blue.cc
@@ -0,0 +1,11 @@
+// Unit test for mln/extract/blue.hh.
+// Generated by ./build_unit_test.sh, do not modify.
+
+// Include the file twice, so we detect missing inclusion guards.
+#include <mln/extract/blue.hh>
+#include <mln/extract/blue.hh>
+
+int main()
+{
+ // Nothing.
+}
diff --git a/milena/tests/unit_test/mln_extract_essential.cc
b/milena/tests/unit_test/mln_extract_essential.cc
new file mode 100644
index 0000000..ab8ba1e
--- /dev/null
+++ b/milena/tests/unit_test/mln_extract_essential.cc
@@ -0,0 +1,11 @@
+// Unit test for mln/extract/essential.hh.
+// Generated by ./build_unit_test.sh, do not modify.
+
+// Include the file twice, so we detect missing inclusion guards.
+#include <mln/extract/essential.hh>
+#include <mln/extract/essential.hh>
+
+int main()
+{
+ // Nothing.
+}
diff --git a/milena/tests/unit_test/mln_extract_green.cc
b/milena/tests/unit_test/mln_extract_green.cc
new file mode 100644
index 0000000..b504f6c
--- /dev/null
+++ b/milena/tests/unit_test/mln_extract_green.cc
@@ -0,0 +1,11 @@
+// Unit test for mln/extract/green.hh.
+// Generated by ./build_unit_test.sh, do not modify.
+
+// Include the file twice, so we detect missing inclusion guards.
+#include <mln/extract/green.hh>
+#include <mln/extract/green.hh>
+
+int main()
+{
+ // Nothing.
+}
diff --git a/milena/tests/unit_test/mln_extract_red.cc
b/milena/tests/unit_test/mln_extract_red.cc
new file mode 100644
index 0000000..8af1a91
--- /dev/null
+++ b/milena/tests/unit_test/mln_extract_red.cc
@@ -0,0 +1,11 @@
+// Unit test for mln/extract/red.hh.
+// Generated by ./build_unit_test.sh, do not modify.
+
+// Include the file twice, so we detect missing inclusion guards.
+#include <mln/extract/red.hh>
+#include <mln/extract/red.hh>
+
+int main()
+{
+ // Nothing.
+}
diff --git a/milena/tests/unit_test/mln_opt_element.cc
b/milena/tests/unit_test/mln_opt_element.cc
new file mode 100644
index 0000000..8a0225c
--- /dev/null
+++ b/milena/tests/unit_test/mln_opt_element.cc
@@ -0,0 +1,11 @@
+// Unit test for mln/opt/element.hh.
+// Generated by ./build_unit_test.sh, do not modify.
+
+// Include the file twice, so we detect missing inclusion guards.
+#include <mln/opt/element.hh>
+#include <mln/opt/element.hh>
+
+int main()
+{
+ // Nothing.
+}
--
1.5.6.5