26 #ifndef MLN_ACCU_COMPUTE_HH
27 # define MLN_ACCU_COMPUTE_HH
36 # include <mln/core/concept/meta_accumulator.hh>
37 # include <mln/core/concept/image.hh>
38 # include <mln/util/pix.hh>
58 template <
typename A,
typename I>
60 compute(const Accumulator<A>& a, const Image<I>& input);
74 template <typename A, typename I>
76 compute(const Meta_Accumulator<A>& a, const Image<I>& input);
80 # ifndef MLN_INCLUDE_ONLY
89 template <
typename A,
typename I>
91 compute(const Accumulator<A>&, const Image<I>& input_)
93 trace::entering(
"accu::impl::generic::compute");
95 const I& input = exact(input_);
96 mln_precondition(input.is_valid());
99 mln_piter(I) p(input.domain());
101 a.take(make::pix(input, p));
103 trace::exiting("accu::impl::generic::
compute");
104 return a.to_result();
115 template <
typename A,
typename I>
118 compute_dispatch(const Accumulator<A>& a, const Image<I>& input)
120 return impl::generic::compute(a, input);
127 template <
typename A,
typename I>
132 trace::entering(
"accu::compute");
134 mln_precondition(exact(input).is_valid());
135 mln_result(A) output = internal::compute_dispatch(a, input);
137 trace::exiting(
"accu::compute");
141 template <
typename A,
typename I>
146 trace::entering(
"accu::compute");
148 mln_precondition(exact(input).is_valid());
151 util::pix<I> pix_(exact(input), mln_psite(I)());
152 A_ a_ = accu::unmeta(exact(a), pix_);
154 mln_result(A_) output = internal::compute_dispatch(a_, input);
156 trace::exiting("accu::
compute");
160 # endif // ! MLN_INCLUDE_ONLY
167 #endif // ! MLN_ACCU_COMPUTE_HH