27 #ifndef SCRIBO_PRIMITIVE_LINK_WITH_SINGLE_LEFT_LINK_DMAX_RATIO_HH
28 # define SCRIBO_PRIMITIVE_LINK_WITH_SINGLE_LEFT_LINK_DMAX_RATIO_HH
35 # include <mln/core/concept/image.hh>
36 # include <mln/core/concept/neighborhood.hh>
38 # include <mln/accu/center.hh>
39 # include <mln/labeling/compute.hh>
40 # include <mln/math/abs.hh>
41 # include <mln/util/array.hh>
43 # include <scribo/core/macros.hh>
44 # include <scribo/core/concept/dmax_functor.hh>
45 # include <scribo/core/component_set.hh>
46 # include <scribo/core/object_links.hh>
48 # include <scribo/primitive/link/internal/find_link.hh>
49 # include <scribo/primitive/link/internal/dmax_default.hh>
50 # include <scribo/primitive/link/internal/link_single_dmax_ratio_base.hh>
52 # include <scribo/primitive/link/compute.hh>
76 template <
typename L,
typename F>
80 const DMax_Functor<F>& dmax_f,
87 template <
typename L,
typename F>
112 template <
typename L,
typename F>
118 # ifndef MLN_INCLUDE_ONLY
126 template <
typename L,
typename F>
127 class single_left_dmax_ratio_functor
128 :
public internal::link_single_dmax_ratio_base<L, F,
129 single_left_dmax_ratio_functor<L, F> >
131 typedef single_left_dmax_ratio_functor<L, F> self_t;
132 typedef internal::link_single_dmax_ratio_base<L, F, self_t> super_;
135 typedef mln_site(L) P;
137 single_left_dmax_ratio_functor(const component_set<L>&
components,
138 const DMax_Functor<F>& dmax_f)
139 : super_(components, anchor::Horizontal, exact(dmax_f))
143 void compute_next_site_(P& p)
156 template <
typename L,
typename F>
160 const DMax_Functor<F>& dmax_f,
163 mln_trace(
"scribo::primitive::link::with_single_left_link_dmax_ratio");
165 mln_precondition(components.is_valid());
167 internal::single_left_dmax_ratio_functor<L, F>
168 functor(components, dmax_f);
170 object_links<L> output =
compute(functor, anchor);
176 template <
typename L>
185 internal::dmax_default(dmax_ratio),
190 template <
typename L>
198 internal::dmax_default(dmax_ratio),
203 template <
typename L>
212 # endif // ! MLN_INCLUDE_ONLY
220 #endif // ! SCRIBO_PRIMITIVE_LINK_WITH_SINGLE_LEFT_LINK_DMAX_RATIO_HH