26 #ifndef MLN_WORLD_INTER_PIXEL_COMPUTE_HH
27 # define MLN_WORLD_INTER_PIXEL_COMPUTE_HH
33 # include <mln/core/concept/image.hh>
34 # include <mln/core/concept/function.hh>
36 # include <mln/core/image/dmorph/image_if.hh>
37 # include <mln/trait/ch_value.hh>
39 # include <mln/world/inter_pixel/is_separator.hh>
40 # include <mln/world/inter_pixel/separator_to_pixels.hh>
53 template <
typename I,
typename F>
54 image_if<mln_ch_value(mln_unmorph(I), mln_result(F)), is_separator>
55 compute(
const Image<I>& input,
const Function_vv2v<F>& f);
59 # ifndef MLN_INCLUDE_ONLY
61 template <
typename I,
typename F>
63 image_if<mln_ch_value(mln_unmorph(I), mln_result(F)), is_separator>
64 compute(
const Image<I>& input_,
const Function_vv2v<F>& f_)
66 trace::entering(
"world::inter_pixel::compute");
68 const I& input = exact(input_);
69 const F& f = exact(f_);
71 mln_precondition(input.is_valid());
73 typedef mln_unmorph(I) I_;
74 typedef mln_ch_value(I_, mln_result(F)) O_;
78 typedef image_if<O_, is_separator> O;
79 O output(output_, is_separator());
81 mln_piter(O) e(output.domain());
85 separator_to_pixels(e, p1, p2);
86 output(e) = f(input(p1), input(p2));
89 trace::exiting("world::inter_pixel::compute");
93 # endif // ! MLN_INCLUDE_ONLY
101 #endif // ! MLN_WORLD_INTER_PIXEL_COMPUTE_HH