31 #ifndef MLN_GEOM_TRANSLATE_HH
32 # define MLN_GEOM_TRANSLATE_HH
34 # include <mln/core/concept/image.hh>
35 # include <mln/core/concept/site_set.hh>
36 # include <mln/core/concept/box.hh>
38 # include <mln/core/routine/extend.hh>
39 # include <mln/core/site_set/p_transformed.hh>
40 # include <mln/core/image/imorph/tr_image.hh>
42 # include <mln/data/fill.hh>
44 # include <mln/fun/x2x/translation.hh>
46 # include <mln/literal/zero.hh>
48 # include <mln/geom/bbox.hh>
73 template <
typename I,
typename V,
typename Ext,
typename S>
76 const algebra::vec<mln_site_(I)::dim, V>& ref,
77 const Ext& extension, const Site_Set<S>& output_domain);
84 template <typename I, typename V, typename Ext>
87 const algebra::vec<mln_site_(I)::dim, V>& ref,
88 const Ext& extension);
96 template <typename I, typename V>
99 const algebra::vec<mln_site_(I)::dim, V>& ref);
103 # ifndef MLN_INCLUDE_ONLY
106 template <
typename I,
typename V,
typename Ext,
typename S>
109 const algebra::vec<mln_site_(I)::dim, V>& ref,
110 const Ext& extension_, const Site_Set<S>& output_domain_)
112 mln_trace(
"geom::translate");
114 const I& input =
exact(input_);
115 const S& output_domain =
exact(output_domain_);
116 const mln_exact(Ext)& extension =
exact(extension_);
119 mln_precondition(input.is_valid());
120 mln_precondition(output_domain.is_valid());
123 typedef fun::x2x::translation<mln_site_(I)::dim, V> trans_t;
124 typedef p_transformed<mln_domain(I), trans_t> trans_domain_t;
125 typedef tr_image<trans_domain_t, I, trans_t> tr_ima_t;
128 trans_domain_t d(input.domain(), t);
129 tr_ima_t tr_ima(d, input, t);
131 mln_concrete(I) output(output_domain);
138 template <typename I, typename V, typename Ext>
141 const algebra::vec<mln_site_(I)::dim, V>& ref,
142 const Ext& extension)
147 typedef mln_domain(I) domain_t;
148 return
translate(input, ref, extension, domain_t());
152 template <typename I, typename V>
155 const algebra::vec<mln_site_(I)::dim, V>& ref)
161 # endif // ! MLN_INCLUDE_ONLY
169 #endif // ! MLN_GEOM_TRANSLATE_HH