27 #ifndef MLN_CORE_IMAGE_DMORPH_SLICE_IMAGE_HH
28 # define MLN_CORE_IMAGE_DMORPH_SLICE_IMAGE_HH
36 # include <mln/core/internal/image_domain_morpher.hh>
37 # include <mln/core/alias/box3d.hh>
38 # include <mln/core/image/image2d.hh>
39 # include <mln/data/paste.hh>
46 template <
typename I>
struct slice_image;
56 struct data< slice_image<I> >
72 struct image_< slice_image<I> > : default_image_morpher< I,
76 typedef trait::image::category::domain_morpher
category;
78 typedef trait::image::dimension::two_d
dimension;
84 typedef trait::image::vw_io::none
vw_io;
85 typedef trait::image::vw_set::none
vw_set;
116 template <
typename V>
126 mln_rvalue(I) operator()(const
point2d&
p) const;
129 mln_morpher_lvalue(I) operator()(const
point2d&
p);
138 template <typename I>
142 template <typename I>
152 template <
typename I,
typename V>
162 # ifndef MLN_INCLUDE_ONLY
184 template <
typename I>
190 b_ =
make::box2d(ima.domain().pmin().row(), ima.domain().pmin().col(),
191 ima.domain().pmax().row(), ima.domain().pmax().col());
199 template <
typename I>
205 template <
typename I>
212 template <
typename I>
217 mln_precondition(! this->
is_valid());
218 this->
data_ =
new internal::data< slice_image<I> >(ima,
sli);
221 template <
typename I>
222 template <
typename V>
229 template <
typename I>
235 return this->
data_->b_;
238 template <
typename I>
244 return this->
data_->sli_;
247 template <
typename I>
252 mln_precondition(this->
has(p));
254 mln_precondition(this->
data_->ima_.has(p_));
255 return this->
data_->ima_(p_);
258 template <
typename I>
260 mln_morpher_lvalue(I)
263 mln_precondition(this->
has(p));
265 mln_precondition(this->
data_->ima_.has(p_));
266 return this->
data_->ima_(p_);
269 template <
typename I>
271 slice_image<I>::operator slice_image<const I>()
const
274 slice_image<const I> tmp(this->
data_->ima_,
282 template <
typename I>
287 mlc_equal(mln_domain(I), box3d)::check();
289 I& ima =
exact(ima_);
290 mln_precondition(ima.is_valid());
291 mln_precondition(sli >= ima.domain().pmin().sli() &&
292 sli <= ima.domain().pmax().sli());
294 slice_image<I> tmp(ima, sli);
298 template <
typename I>
303 mlc_equal(mln_domain(I), box3d)::check();
305 const I& ima =
exact(ima_);
306 mln_precondition(ima.is_valid());
307 mln_precondition(sli >= ima.domain().pmin().sli() &&
308 sli <= ima.domain().pmax().sli());
310 slice_image<const I> tmp(ima, sli);
315 # endif // ! MLN_INCLUDE_ONLY
321 #endif // ! MLN_CORE_IMAGE_DMORPH_SLICE_IMAGE_HH