26 #ifndef SCRIBO_AFP_LINK_HH
27 # define SCRIBO_AFP_LINK_HH
33 # include <mln/geom/ncols.hh>
34 # include <mln/geom/nrows.hh>
35 # include <mln/util/couple.hh>
36 # include <mln/math/max.hh>
38 # include <scribo/core/object_links.hh>
39 # include <scribo/core/component_set.hh>
40 # include <scribo/core/macros.hh>
62 right(components, static_cast<unsigned>(components.
nelements()) + 1);
66 left(components, static_cast<unsigned>(components.
nelements()) + 1);
71 for_all_comps(i, components)
76 unsigned dmax = (w / 2.0f) + (3 *
math::max(w, h));
79 const mln_site(L) c =
components(i).mass_center();
87 nright =
std::min(static_cast<unsigned>(nrightima), midcol + dmax),
88 nleft =
std::min(static_cast<unsigned>(nleftima), midcol + dmax);
94 *pstop =
p + nright + 1;
96 for (;
p != pstop; ++
p)
98 if (*
p != literal::zero
113 *pstop =
p - nleft - 1;
115 for (;
p != pstop; --
p)
117 if (*
p != literal::zero
132 template <
typename L>
137 left(components, static_cast<unsigned>(components.
nelements()) + 1);
142 for_all_comps(i, components)
144 const mln_site(L) c =
components(i).mass_center();
151 nleft =
std::min(static_cast<unsigned>(nleftima), midcol + dmax);
157 *pstop =
p - nleft - 1;
159 for (;
p != pstop; --
p)
161 if (*
p != literal::zero
181 #endif // ! SCRIBO_AFP_LINK_HH