28 #include <mln/core/image/image2d.hh>
29 #include <mln/core/alias/neighb2d.hh>
30 #include <mln/value/label_16.hh>
31 #include <mln/io/pbm/load.hh>
32 #include <scribo/primitive/extract/components.hh>
33 #include <scribo/primitive/link/with_single_left_link.hh>
34 #include <scribo/primitive/group/from_single_link.hh>
35 #include <scribo/core/line_set.hh>
37 #include "tests/data.hh"
42 using namespace scribo;
46 int ref[][9] = { { 0, 0, 0, 0, 0, 0, 0, 0, 0 },
48 { 2, 2, 2, 2, 1, 0, 1, 1, 1 },
49 { 4, 4, 4, 4, 1, 0, 1, 0, 1 },
50 { 6, 6, 6, 6, 1, 0, 1, 0, 1 },
51 { 7, 7, 7, 7, 1, 0, 1, 0, 1 },
52 { 12, 12, 10, 12, 1, 0, 3, 0, 1 },
53 { 17, 15, 15, 17, 3, 0, 3, 0, 4 } };
55 std::string img = SCRIBO_IMG_DIR
"/pixels.pbm";
60 value::label_16 nbboxes;
72 for_all_lines(l, lines)
74 mln_assertion(lines(l).baseline() == ref[l][0]);
75 mln_assertion(lines(l).meanline() == ref[l][1]);
76 mln_assertion(lines(l).ascent() == ref[l][2]);
77 mln_assertion(lines(l).descent() == ref[l][3]);
78 mln_assertion(lines(l).x_height() ==
unsigned(ref[l][4]));
79 mln_assertion(lines(l).d_height() == ref[l][5]);
80 mln_assertion(lines(l).a_height() == ref[l][6]);
81 mln_assertion(lines(l).char_space() ==
unsigned(ref[l][7]));
82 mln_assertion(lines(l).char_width() ==
unsigned(ref[l][8]));