27 #ifndef SCRIBO_DEBUG_BBOXES_IMAGE_HH
28 # define SCRIBO_DEBUG_BBOXES_IMAGE_HH
34 # include <mln/core/concept/image.hh>
35 # include <mln/data/convert.hh>
36 # include <mln/value/rgb8.hh>
37 # include <mln/util/array.hh>
38 # include <mln/io/ppm/save.hh>
39 # include <mln/literal/colors.hh>
41 # include <scribo/core/line_set.hh>
42 # include <scribo/draw/bounding_boxes.hh>
61 const mln::util::array<
box<mln_site(I)> >& bboxes,
68 template <typename I, typename L>
69 mln_ch_value(I, value::rgb8)
71 const line_set<L>& lines,
72 const value::rgb8& value);
79 template <typename I, typename L>
81 mln_ch_value(I, value::rgb8)
83 const line_set<L>& lines);
89 template <typename I, typename L>
91 mln_ch_value(I, value::rgb8)
93 const component_set<L>& comps,
94 const value::rgb8& value);
96 # ifndef MLN_INCLUDE_ONLY
102 const mln::util::array<
box<mln_site(I)> >& bboxes,
103 const value::rgb8& value)
105 mln_trace(
"scribo::debug::bboxes_image");
106 mln_precondition(
exact(input).is_valid());
109 draw::bounding_boxes(tmp, bboxes, value);
115 template <typename I, typename L>
117 mln_ch_value(I, value::rgb8)
119 const line_set<L>& lines,
120 const value::rgb8& value)
122 mln_trace(
"scribo::debug::bboxes_image");
123 mln_precondition(
exact(input).is_valid());
128 for_all_lines(l, lines)
129 if (! lines(l).is_hidden())
130 mln::draw::
box(output, lines(l).
bbox(), value);
136 template <typename I, typename L>
138 mln_ch_value(I, value::rgb8)
140 const line_set<L>& lines)
146 template <
typename I,
typename L>
150 const component_set<L>& comps,
151 const value::rgb8& value)
153 mln_trace(
"scribo::debug::bboxes_image");
154 mln_precondition(
exact(input).is_valid());
159 for_all_comps(c, comps)
160 if (comps(c).is_valid())
161 mln::draw::
box(output, comps(c).
bbox(), value);
167 # endif // ! MLN_INCLUDE_ONLY
174 #endif // ! SCRIBO_DEBUG_BBOXES_IMAGE_HH