27 #ifndef MLN_LABELING_SUPERPOSE_HH
28 # define MLN_LABELING_SUPERPOSE_HH
35 # include <mln/core/concept/image.hh>
36 # include <mln/util/array.hh>
37 # include <mln/labeling/relabel.hh>
38 # include <mln/data/paste.hh>
39 # include <mln/pw/all.hh>
41 # include <mln/value/next.hh>
42 # include <mln/value/equiv.hh>
70 template <
typename I,
typename J>
72 superpose(const Image<I>& lhs, const mln_value(I)& lhs_nlabels,
73 const Image<J>& rhs, const mln_value(J)& rhs_nlabels,
74 mln_value(I)& new_nlabels);
79 # ifndef MLN_INCLUDE_ONLY
81 template <
typename I,
typename J>
84 const
Image<J>& rhs_, const mln_value(J)& rhs_nlabels,
85 mln_value(I)& new_nlabels)
87 trace::entering(
"mln::labeling::superpose");
89 const I& lhs = exact(lhs_);
90 const J& rhs = exact(rhs_);
92 mlc_converts_to(mln_value(I), mln_value(J))::check();
93 mln_precondition(lhs.is_valid());
94 mln_precondition(rhs.is_valid());
95 mln_precondition(lhs.domain() == rhs.domain());
101 rebase_lbl(value::next(rhs_nlabels));
104 for (
unsigned i = 1; i <= rhs_nlabels; ++i)
114 trace::exiting(
"mln::labeling::superpose");
119 # endif // ! MLN_INCLUDE_ONLY
126 #endif // ! MLN_LABELING_SUPERPOSE_HH