26 #ifndef MLN_LABELING_PACK_HH
27 # define MLN_LABELING_PACK_HH
34 # include <mln/core/concept/image.hh>
36 # include <mln/make/relabelfun.hh>
38 # include <mln/data/compute.hh>
39 # include <mln/data/transform.hh>
41 # include <mln/accu/label_used.hh>
61 pack(const Image<I>& label, mln_value(I)& new_nlabels,
62 fun::i2v::array<mln_value(I)>& repack_fun);
68 pack(const Image<I>& label, mln_value(I)& new_nlabels);
82 fun::i2v::array<mln_value(I)>& repack_fun);
88 pack_inplace(Image<I>& label, mln_value(I)& new_nlabels);
92 # ifndef MLN_INCLUDE_ONLY
100 pack_tests(
const Image<I>& label, mln_value(I)& new_nlabels)
104 mln_precondition(exact(label).is_valid());
113 template <
typename I>
117 fun::i2v::array<mln_value(I)> repack_fun;
118 return pack(label, new_nlabels, repack_fun);
122 template <
typename I>
125 fun::i2v::array<mln_value(I)>& repack_fun)
127 trace::entering(
"labeling::pack");
129 internal::pack_tests(label, new_nlabels);
131 fun::i2v::array<bool>
134 mln_value(I) tmp_nlabels = fv2b.size() - 1;
141 trace::exiting(
"labeling::pack");
146 template <
typename I>
150 fun::i2v::array<mln_value(I)> repack_fun;
155 template <
typename I>
158 fun::i2v::array<mln_value(I)>& repack_fun)
160 trace::entering(
"labeling::pack_inplace");
162 internal::pack_tests(label, new_nlabels);
164 fun::i2v::array<bool>
167 mln_value(I) tmp_nlabels = fv2b.size() - 1;
172 trace::exiting(
"labeling::pack_inplace");
176 # endif // ! MLN_INCLUDE_ONLY
183 #endif // ! MLN_LABELING_PACK_HH