27 #ifndef SCRIBO_PRIMITIVE_INTERNAL_FIND_GRAPH_LINK_HH
28 # define SCRIBO_PRIMITIVE_INTERNAL_FIND_GRAPH_LINK_HH
34 # include <mln/core/concept/image.hh>
35 # include <mln/core/concept/graph.hh>
38 # include <mln/core/alias/dpoint2d.hh>
40 # include <mln/math/abs.hh>
42 # include <mln/util/array.hh>
45 # include <scribo/core/component_set.hh>
47 # include <scribo/primitive/internal/update_graph_link.hh>
67 template <
typename G,
typename L>
70 const component_set<L>& comps,
71 unsigned current_comp,
73 const mln_site(L)& c);
75 # ifndef MLN_INCLUDE_ONLY
77 template <
typename G,
typename L>
80 const component_set<L>& comps,
81 unsigned current_comp,
85 mln_trace(
"scribo::primitive::internal::find_graph_link");
88 mln_precondition(g.is_valid());
92 mln_site(L) p = c + right;
94 const L& lbl = comps.labeled_image();
96 while (comps.domain().has(p) && (lbl(p) == literal::zero
97 || lbl(p) == current_comp)
98 && math::
abs(p.col() - c.col()) < dmax)
105 # endif // MLN_INCLUDE_ONLY
114 #endif // ! SCRIBO_PRIMITIVE_INTERNAL_FIND_GRAPH_LINK_HH