27 #ifndef MLN_LABELING_COMPUTE_IMAGE_HH
28 # define MLN_LABELING_COMPUTE_IMAGE_HH
40 # include <mln/core/concept/image.hh>
41 # include <mln/core/concept/accumulator.hh>
42 # include <mln/core/concept/meta_accumulator.hh>
44 # include <mln/labeling/compute.hh>
66 template <
typename A,
typename I,
typename L>
67 mln_ch_value(L, mln_result(A))
69 const Image<I>& input,
70 const Image<L>& labels,
71 const mln_value(L)& nlabels);
86 template <typename A, typename I, typename L>
88 mln_ch_value(L, mln_result(A))
90 const Image<I>& input,
91 const Image<L>& labels,
92 const mln_value(L)& nlabels);
108 template <typename A, typename I, typename L>
110 mln_ch_value(L, mln_meta_accu_result(A, mln_value(I)))
112 const Image<I>& input,
113 const Image<L>& labels,
114 const mln_value(L)& nlabels);
117 # ifndef MLN_INCLUDE_ONLY
122 template <
typename A,
typename L>
125 const Image<L>& labels_,
126 const mln_value(L)& nlabels)
128 const L& labels =
exact(labels_);
131 typedef mln_ch_value(L, A) O;
135 mln_piter(L)
p(labels.domain());
138 mln_assertion(labels(p) <= nlabels);
139 output(p) = a[labels(p)];
148 template <
typename A,
typename I,
typename L>
150 mln_ch_value(L, mln_result(A))
152 const Image<L>& labels,
153 const mln_value(L)& nlabels)
157 mln_trace(
"labeling::compute_image");
159 mln_ch_value(L, mln_result(A)) output =
165 template <typename A, typename I, typename L>
167 mln_ch_value(L, mln_result(A))
169 const Image<I>& input,
170 const Image<L>& labels,
171 const mln_value(L)& nlabels)
173 mln_trace(
"labeling::compute_image");
175 util::array<mln_result(A)> res =
176 compute(accu, input, labels, nlabels);
178 mln_ch_value(L, mln_result(A)) output =
184 template <typename A, typename I, typename L>
186 mln_ch_value(L, mln_meta_accu_result(A, mln_value(I)))
188 const Image<I>& input,
189 const Image<L>& labels,
190 const mln_value(L)& nlabels)
192 mln_trace(
"labeling::compute_image");
194 typedef mln_meta_accu_result(A, mln_value(I))
T;
197 compute(accu, input, labels, nlabels);
199 mln_ch_value(L, T) output =
205 # endif // ! MLN_INCLUDE_ONLY
211 #endif // ! MLN_LABELING_COMPUTE_IMAGE_HH