27 #ifndef SCRIBO_DEBUG_MEAN_AND_BASE_LINES_IMAGE_HH
28 # define SCRIBO_DEBUG_MEAN_AND_BASE_LINES_IMAGE_HH
35 # include <mln/core/concept/image.hh>
36 # include <mln/data/convert.hh>
37 # include <mln/value/rgb8.hh>
38 # include <mln/literal/colors.hh>
40 # include <mln/draw/box.hh>
41 # include <mln/draw/line.hh>
42 # include <mln/draw/dashed_line.hh>
44 # include <scribo/core/line_set.hh>
72 template <
typename I,
typename L>
75 const line_set<L>& lines,
76 const
value::rgb8& bbox_value,
77 const
value::rgb8& meanline_value,
78 const
value::rgb8& baseline_value);
86 template <typename I, typename L>
87 mln_ch_value(I,
value::rgb8)
89 const line_set<L>& lines);
92 # ifndef MLN_INCLUDE_ONLY
95 template <
typename I,
typename L>
98 const line_set<L>& lines,
99 const
value::rgb8& bbox_value,
100 const
value::rgb8& meanline_value,
101 const
value::rgb8& baseline_value)
103 mln_trace(
"scribo::debug::mean_and_base_lines_image");
104 mln_precondition(
exact(input).is_valid());
109 for_all_lines(l, lines)
111 if (! lines(l).is_hidden())
115 if (! (lines(l).type() == line::Text
116 || (lines(l).type() == line::Undefined
117 && lines(l).tag() == line::None
118 && lines(l).
card() > 2)))
122 b_top(lines(l).meanline(), lines(l).
bbox().pmin().col()),
123 e_top(lines(l).meanline(), lines(l).
bbox().pmax().col()),
124 b_bot(lines(l).baseline(), lines(l).
bbox().pmin().col()),
125 e_bot(lines(l).baseline(), lines(l).
bbox().pmax().col());
137 template <
typename I,
typename L>
140 const line_set<L>& lines)
143 literal::purple, literal::blue,
147 # endif // ! MLN_INCLUDE_ONLY
154 #endif // ! SCRIBO_DEBUG_MEAN_AND_BASE_LINES_IMAGE_HH