27 #ifndef MLN_CORE_IMAGE_DMORPH_EXTENDED_HH
28 # define MLN_CORE_IMAGE_DMORPH_EXTENDED_HH
38 # include <mln/core/internal/image_domain_morpher.hh>
39 # include <mln/core/site_set/box.hh>
47 template <
typename I>
struct extended;
55 struct data< extended<I> >
57 data(I& ima,
const box<mln_site(I)>& b_);
71 struct image_< extended<I> > : default_image_morpher< I,
75 typedef trait::image::category::domain_morpher category;
77 typedef trait::image::ext_domain::none ext_domain;
78 typedef trait::image::ext_value::irrelevant ext_value;
79 typedef trait::image::ext_io::irrelevant ext_io;
81 typedef trait::image::value_storage::disrupted value_storage;
93 struct extended :
public internal::image_domain_morpher< I,
96 private mlc_not_equal(mln_trait_image_ext_domain(I),
97 trait::image::ext_domain::none)::check_t
112 void init_(I& ima, const
box<mln_site(I)>& b);
120 template <typename I, typename J>
121 void init_(tag::image_t,
extended<I>& target, const J& model);
124 template <typename I, typename B>
126 extended_to(const
Image<I>& ima, const
Box<B>& b);
128 template <typename I, typename B>
130 extended_to(
Image<I>& ima, const
Box<B>& b);
134 # ifndef MLN_INCLUDE_ONLY
138 template <
typename I,
typename J>
140 void init_(tag::image_t,
extended<I>& target,
const J& model)
143 init_(tag::image, ima, model);
145 init_(tag::bbox, b, model);
146 target.init_(ima, b);
155 template <
typename I>
168 template <
typename I>
174 template <
typename I>
181 template <
typename I>
186 mln_precondition(! this->is_valid());
187 this->data_ =
new internal::data< extended<I> >(ima, b);
190 template <
typename I>
192 const box<mln_site(I)>&
195 return this->data_->b_;
201 template <
typename I,
typename B>
205 mlc_not_equal(mln_trait_image_ext_domain(I),
206 trait::image::ext_domain::none)::check();
207 mln_precondition(exact(ima).is_valid());
212 template <
typename I,
typename B>
214 extended_to(Image<I>& ima,
const Box<B>& b)
216 mlc_not_equal(mln_trait_image_ext_domain(I),
217 trait::image::ext_domain::none)::check();
218 mln_precondition(exact(ima).is_valid());
219 extended<I> tmp(exact(ima), exact(b));
223 # endif // ! MLN_INCLUDE_ONLY
228 #endif // ! MLN_CORE_IMAGE_DMORPH_EXTENDED_HH