$extrastylesheet
Olena  User documentation 2.1
An Image Processing Platform
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
font_color.cc
1 // Copyright (C) 2011, 2013 EPITA Research and Development Laboratory (LRDE).
2 //
3 // This file is part of Olena.
4 //
5 // Olena is free software: you can redistribute it and/or modify it under
6 // the terms of the GNU General Public License as published by the Free
7 // Software Foundation, version 2 of the License.
8 //
9 // Olena is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with Olena. If not, see <http://www.gnu.org/licenses/>.
16 
18 
19 #include <cstdio>
20 #include <cstdlib>
21 
22 #include <mln/core/image/image2d.hh>
23 #include <mln/data/compare.hh>
24 
25 #include <mln/io/ppm/load.hh>
26 #include <mln/io/pbm/load.hh>
27 
28 #include <mln/value/rgb8.hh>
29 
30 #include <scribo/estim/font_color.hh>
31 
32 #include "tests/data.hh"
33 
34 using namespace mln;
35 
36 int main()
37 {
38  image2d<value::rgb8> input_rgb;
39  io::ppm::load(input_rgb, SCRIBO_IMG_DIR "/phillip.ppm");
40  image2d<bool> input_bin;
41  io::pbm::load(input_bin, SCRIBO_IMG_DIR "/phillip.pbm");
42 
43  value::rgb8 val = scribo::estim::font_color(input_rgb, input_bin);
44 
45  mln_assertion(val == value::rgb8(77, 146, 140));
46 }