Commit 12bc673f authored by Guillaume Lazzara's avatar Guillaume Lazzara
Browse files

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.

git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@3189 4aad255d-cdde-0310-9447-f3009e2ae8c0
parent 751b8111
2009-01-23 Guillaume Lazzara <z@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@lrde.epita.fr>
 
Add some images.
......@@ -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 \
......
......@@ -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>
......
......@@ -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>
......
// 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
// 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
// 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
// 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
// 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
## 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)
// 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));
}
// 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));
}
// 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));
}
......@@ -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_d