27 #ifndef MLN_MORPHO_DILATION_HH
28 # define MLN_MORPHO_DILATION_HH
36 # include <mln/morpho/includes.hh>
37 # include <mln/morpho/general.hh>
38 # include <mln/accu/logic/lor.hh>
39 # include <mln/accu/logic/lor_basic.hh>
40 # include <mln/accu/stat/max.hh>
41 # include <mln/accu/stat/max_h.hh>
54 template <
typename I,
typename W>
56 dilation(const Image<I>& input, const Window<W>&
win);
59 # ifndef MLN_INCLUDE_ONLY
66 mln_morpho_select_accu(I, logic::lor_basic,
stat::max)
67 accu(const Image<I>&)
const
69 mln_morpho_select_accu(I, logic::lor_basic,
stat::max) tmp;
74 mln_morpho_select_accu(I, logic::lor, stat::max_h)
75 accu_incr(const Image<I>&)
const
77 mln_morpho_select_accu(I, logic::lor, stat::max_h) tmp;
82 mln_value(I) neutral(const Image<I>&)
const
84 return internal::neutral<I>::infimum();
96 template <
typename I,
typename W>
98 general_on_set_centered(const dilation_op&,
99 const Image<I>& input_, const Window<W>& win_)
101 mln_trace(
"morpho::impl::general_on_set_centered__dilation");
103 typedef mln_concrete(I) O;
104 const I& input =
exact(input_);
105 const W& win =
exact(win_);
112 mln_piter(I)
p(input.domain());
113 mln_qiter(W) q(win,
p);
115 if (input(p) == false)
116 for_all(q) if (input.has(q))
117 if (input(q) == true)
127 template <
typename I,
typename W>
129 general_on_set_centered_fastest(const dilation_op&,
130 const Image<I>& input_, const Window<W>& win_)
132 mln_trace(
"morpho::impl::general_on_set_centered_fastest__dilation");
134 typedef mln_concrete(I) O;
135 const I& input =
exact(input_);
136 const W& win =
exact(win_);
143 mln_pixter(const I)
p(input);
144 mln_qixter(const I, W) q(
p, win);
145 mln_pixter(O) p_out(output);
147 if (p.val() == false)
161 template <
typename I,
typename W>
164 dilation(const Image<I>& input, const Window<W>& win)
166 mln_trace(
"morpho::dilation");
167 mln_precondition(
exact(input).is_valid());
168 mln_precondition(!
exact(win).is_empty());
170 mln_concrete(I) output =
general(dilation_op(), input, win);
172 if (
exact(win).is_centered())
173 mln_postcondition(output >= input);
178 # endif // ! MLN_INCLUDE_ONLY
185 #endif // ! MLN_MORPHO_DILATION_HH