27 #ifndef MLN_DATA_UPDATE_HH
28 # define MLN_DATA_UPDATE_HH
34 # include <mln/core/concept/accumulator.hh>
35 # include <mln/core/concept/image.hh>
54 template <
typename A,
typename I>
56 update(Accumulator<A>& a, const Image<I>& input);
60 # ifndef MLN_INCLUDE_ONLY
68 template <
typename A,
typename I>
71 update_tests(Accumulator<A>& a_,
const Image<I>& input_)
74 const I& input =
exact(input_);
75 mln_precondition(input.is_valid());
101 template <
typename A,
typename I>
104 update(Accumulator<A>& a_, const Image<I>& input_)
106 mln_trace(
"data::impl::generic::update");
109 const I& input =
exact(input_);
110 data::internal::update_tests(a, input);
112 mln_piter(I)
p(input.domain());
116 return a.to_result();
129 template <typename A, typename I>
132 update_fastest(Accumulator<A>& a_, const Image<I>& input_)
134 mln_trace(
"data::impl::update_fastest");
137 const I& input =
exact(input_);
138 data::internal::update_tests(a, input);
140 mln_pixter(
const I) pxl(input);
144 return a.to_result();
157 template <
typename A,
typename I>
160 update_dispatch(trait::image::speed::any,
161 Accumulator<A>& a, const Image<I>& input)
166 template <
typename A,
typename I>
169 update_dispatch(trait::image::speed::fastest,
170 Accumulator<A>& a, const Image<I>& input)
172 return impl::update_fastest(a, input);
175 template <
typename A,
typename I>
178 update_dispatch(Accumulator<A>& a, const Image<I>& input)
180 return update_dispatch(mln_trait_image_speed(I)(),
190 template <
typename A,
typename I>
193 update(Accumulator<A>& a, const Image<I>& input)
195 mln_trace(
"data::update");
197 data::internal::update_tests(a, input);
198 mln_result(A) r = internal::update_dispatch(a, input);
203 # endif // ! MLN_INCLUDE_ONLY
210 #endif // ! MLN_DATA_UPDATE_HH