27 #ifndef SCRIBO_DRAW_LINE_COMPONENTS_HH
28 # define SCRIBO_DRAW_LINE_COMPONENTS_HH
33 # include <mln/util/object_id.hh>
35 # include <scribo/core/line_set.hh>
36 # include <scribo/core/component_set.hh>
46 template <
typename L,
typename I>
49 const line_set<L>& lines,
50 const line_info<L>&
line,
51 const mln_value(I)&
value);
54 # ifndef MLN_INCLUDE_ONLY
57 template <
typename L,
typename I>
60 const line_set<L>& lines,
61 const line_info<L>& line,
62 const mln_value(I)&
value)
64 mln_trace(
"scribo::draw::line_components");
66 I& input =
exact(input_);
68 mln_precondition(input.is_valid());
70 const component_set<L>& comp_set = lines.components();
75 for_all_elements(i, component_ids)
77 const unsigned c = component_ids(i);
78 const mln_value(L) v = c;
81 const
unsigned index = labeled_image.offset_of_point(bbox.pmin());
82 const
unsigned index2 = input.offset_of_point(bbox.pmin());
83 const mln_value(L)* ptr_in = &(labeled_image.element(index));
84 mln_value(I)* ptr_out = &(input.element(index2));
86 const
unsigned ncols = bbox.width();
88 const
int delta2 = input.delta_offset(dpoint2d(+1, -ncols));
90 for (
unsigned k = 0; k <
nrows; ++k)
92 for (
unsigned j = 0; j <
ncols; ++j)
108 # endif // ! MLN_INCLUDE_ONLY
113 #endif // ! SCRIBO_DRAW_LINE_COMPONENTS_HH