27 #ifndef MLN_DATA_PASTE_HH
28 # define MLN_DATA_PASTE_HH
34 # include <mln/core/concept/image.hh>
37 # include <mln/data/paste.spe.hh>
65 template <
typename I,
typename J>
66 void paste(
const Image<I>& input, Image<J>& output);
70 # ifndef MLN_INCLUDE_ONLY
81 template <
typename I,
typename J>
83 void paste_tests(
const Image<I>& input, Image<J>& output)
85 mlc_is(mln_trait_image_pw_io(J), trait::image::pw_io::read_write)::
87 mlc_converts_to(mln_value(I), mln_value(J))::check();
89 mln_precondition(
exact(input).is_valid());
112 template <
typename I,
typename J>
114 void paste(
const Image<I>& input_, Image<J>& output_)
116 mln_trace(
"data::impl::generic::paste");
118 data::internal::paste_tests(input_, output_);
120 const I& input =
exact(input_);
121 J& output =
exact(output_);
124 mln_piter(I)
p(input.domain());
126 output(
p) = static_cast<mln_value(J)>(input(
p));
137 template <typename I, typename J>
139 void paste(const Image<I>& input, Image<J>& output)
141 mln_trace(
"data::paste");
143 mlc_converts_to(mln_value(I), mln_value(J))::check();
145 internal::paste_tests(input, output);
146 internal::paste_dispatch(input, output);
150 # endif // ! MLN_INCLUDE_ONLY
158 #endif // ! MLN_DATA_PASTE_HH