26 #ifndef MLN_ACCU_IMAGE_TO_RESULT_HH
27 # define MLN_ACCU_IMAGE_TO_RESULT_HH
33 # include <mln/core/concept/accumulator.hh>
34 # include <mln/core/concept/image.hh>
47 mln_ch_value(I, mln_deduce(I,
value, result))
52 # ifndef MLN_INCLUDE_ONLY
63 mln_ch_value(I, mln_deduce(I,
value, result))
66 mln_trace(
"accu::impl::image::generic::to_result");
68 mlc_is_a(mln_value(I), Accumulator)::check();
70 const I& input =
exact(input_);
71 mln_precondition(input.is_valid());
73 typedef mln_deduce(I,
value, result) R;
74 mln_ch_value(I, R) output;
77 mln_piter(I)
p(input.domain());
90 mln_ch_value(I, mln_deduce(I,
value, result))
91 to_result_fastest(const Image<I>& input_)
93 mln_trace(
"accu::impl::image::to_result_fastest");
95 mlc_is_a(mln_value(I), Accumulator)::check();
97 const I& input =
exact(input_);
98 mln_precondition(input.is_valid());
100 typedef mln_deduce(I, value, result) R;
101 typedef mln_ch_value(I, R) O;
105 mln_pixter(const I) p_in(input);
106 mln_pixter(O) p_out(output);
107 for_all_2(p_in, p_out)
108 p_out.val() = p_in.val().to_result();
122 template <
typename I>
123 mln_ch_value(I, mln_deduce(I, value, result))
124 to_result_dispatch(trait::image::speed::any,
125 const Image<I>& input)
130 template <
typename I>
131 mln_ch_value(I, mln_deduce(I, value, result))
132 to_result_dispatch(trait::image::speed::fastest,
133 const Image<I>& input)
135 return impl::to_result_fastest(input);
138 template <
typename I>
139 mln_ch_value(I, mln_deduce(I, value, result))
140 to_result_dispatch(const Image<I>& input)
142 return to_result_dispatch(mln_trait_image_speed(I)(),
151 template <
typename I>
152 mln_ch_value(I, mln_deduce(I, value, result))
153 to_result(const Image<I>& input)
155 mln_trace(
"accu::image::to_result");
157 mlc_is_a(mln_value(I), Accumulator)::check();
159 mln_precondition(
exact(input).is_valid());
161 typedef mln_deduce(I, value, result) R;
162 mln_ch_value(I, R) output;
163 output = internal::to_result_dispatch(input);
168 # endif // ! MLN_INCLUDE_ONLY
177 #endif // ! MLN_ACCU_IMAGE_TO_RESULT_HH