26 #ifndef MLN_DATA_PASTE_HH
27 # define MLN_DATA_PASTE_HH
33 # include <mln/core/concept/image.hh>
36 # include <mln/data/paste.spe.hh>
62 template <
typename I,
typename J>
63 void paste(
const Image<I>& input, Image<J>& output);
67 # ifndef MLN_INCLUDE_ONLY
78 template <
typename I,
typename J>
80 void paste_tests(
const Image<I>& input, Image<J>& output)
82 mlc_is(mln_trait_image_pw_io(J), trait::image::pw_io::read_write)::
84 mlc_converts_to(mln_value(I), mln_value(J))::check();
86 mln_precondition(exact(input).is_valid());
87 mln_precondition(exact(input).domain() <= exact(output).domain());
109 template <
typename I,
typename J>
113 trace::entering(
"data::impl::generic::paste");
115 data::internal::paste_tests(input_, output_);
117 const I& input = exact(input_);
118 J& output = exact(output_);
121 mln_piter(I) p(input.domain());
123 output(p) =
static_cast<mln_value(J)
>(input(p));
125 trace::exiting(
"data::impl::generic::paste");
135 template <
typename I,
typename J>
139 trace::entering(
"data::paste");
141 mlc_converts_to(mln_value(I), mln_value(J))::check();
143 internal::paste_tests(input, output);
144 internal::paste_dispatch(input, output);
146 trace::exiting(
"data::paste");
149 # endif // ! MLN_INCLUDE_ONLY
157 #endif // ! MLN_DATA_PASTE_HH