26 #ifndef MLN_MORPHO_ELEMENTARY_DILATION_HH
27 # define MLN_MORPHO_ELEMENTARY_DILATION_HH
31 # include <mln/morpho/elementary/like_ero_fun.hh>
32 # include <mln/morpho/elementary/like_ero_set.hh>
45 template <
typename I,
typename N>
47 dilation(const Image<I>& input, const Neighborhood<N>& nbh);
50 # ifndef MLN_INCLUDE_ONLY
57 template <
typename I,
typename N>
59 dilation_dispatch(trait::image::kind::any,
60 const Image<I>& input, const Neighborhood<N>& nbh)
62 return like_ero_fun(accu::meta::stat::max(), f_accu(), input, nbh);
65 template <
typename I,
typename N>
67 dilation_dispatch(trait::image::kind::logic,
68 const Image<I>& input, const Neighborhood<N>& nbh)
78 return like_ero_set(val, input, nbh);
81 template <
typename I,
typename N>
83 dilation_dispatch(const Image<I>& input, const Neighborhood<N>& nbh)
85 return dilation_dispatch(mln_trait_image_kind(I)(),
94 template <
typename I,
typename N>
96 dilation(const Image<I>& input, const Neighborhood<N>& nbh)
98 trace::entering(
"morpho::elementary::dilation");
100 mln_precondition(exact(input).is_valid());
101 mln_precondition(exact(nbh).is_valid());
103 mln_concrete(I) output = internal::dilation_dispatch(input, nbh);
105 mln_postcondition(output >= input);
106 trace::exiting("morpho::elementary::dilation");
110 # endif // ! MLN_INCLUDE_ONLY
119 #endif // ! MLN_MORPHO_ELEMENTARY_DILATION_HH