27 #ifndef MLN_CORE_ROUTINE_EXTEND_HH
28 # define MLN_CORE_ROUTINE_EXTEND_HH
38 # include <mln/core/image/dmorph/extension_ima.hh>
39 # include <mln/core/image/dmorph/extension_fun.hh>
40 # include <mln/core/image/dmorph/extension_val.hh>
42 # include <mln/trait/undef.hh>
45 # define mln_extension_type(I,J) \
46 typename mln::internal::extension_type<I,J>::result;
48 # define mln_extension_type_(I,J) \
49 mln::internal::extension_type<I,J>::result;
58 template <
typename I,
typename J,
typename B1,
typename B2>
65 template <
typename I,
typename J>
67 metal::
bool_<false>, metal::bool_<false> >
68 : mlc_converts_to(J, mln_value(I))::check_t
74 template <
typename I,
typename J>
76 metal::
bool_<false>, metal::bool_<true> >
82 template <
typename I,
typename J>
84 metal::
bool_<true>, metal::bool_<false> >
90 template <
typename I,
typename J>
93 typename mlc_is_a(J,Image)::eval,
94 typename mlc_is_a(J,Function)::eval>
104 template <
typename I,
typename F>
108 template <
typename I,
typename F>
115 template <
typename I,
typename J>
122 template <
typename I>
126 template <
typename I>
132 # ifndef MLN_INCLUDE_ONLY
137 template <
typename I,
typename F>
142 mlc_converts_to(mln_result(F), mln_value(I))::check();
147 template <
typename I,
typename F>
150 extend(Image<I>& ima,
const Function_v2v<F>& fun)
152 mlc_converts_to(mln_result(F), mln_value(I))::check();
153 extension_fun<I, F> tmp(
exact(ima),
exact(fun));
160 template <
typename I,
typename J>
161 extension_ima<const I, const J>
162 extend(
const Image<I>& ima,
const Image<J>& ext)
164 mlc_converts_to(mln_value(J), mln_value(I))::check();
165 extension_ima<const I, const J> tmp(
exact(ima),
exact(ext));
172 template <
typename I>
174 extension_val<const I>
175 extend(
const Image<I>& ima,
const mln_value(I)& val)
177 extension_val<const I> tmp(
exact(ima), val);
181 template <
typename I>
184 extend(Image<I>& ima,
const mln_value(I)& val)
186 extension_val<I> tmp(
exact(ima), val);
191 # endif // ! MLN_INCLUDE_ONLY
196 #endif // ! MLN_CORE_ROUTINE_EXTEND_HH