27 #ifndef MLN_CORE_IMAGE_DMORPH_SUB_IMAGE_IF_HH
28 # define MLN_CORE_IMAGE_DMORPH_SUB_IMAGE_IF_HH
38 # include <mln/core/internal/image_domain_morpher.hh>
39 # include <mln/core/site_set/p_if.hh>
40 # include <mln/fun/p2b/has.hh>
42 # include <mln/debug/println.hh>
50 template <
typename I,
typename S>
struct sub_image_if;
57 template <
typename I,
typename S>
58 struct data< sub_image_if<I,S> >
60 data(I& ima,
const S& s);
63 p_if< S, fun::p2b::has<I> > s_;
73 template <
typename I,
typename S>
74 struct image_< sub_image_if<I,S> > : default_image_morpher< I,
83 typedef trait::image::category::domain_morpher category;
85 typedef trait::image::ext_domain::none ext_domain;
86 typedef trait::image::ext_value::irrelevant ext_value;
87 typedef trait::image::ext_io::irrelevant ext_io;
89 typedef trait::image::value_storage::disrupted value_storage;
101 template <
typename I,
typename S>
103 p_if< S, fun::p2b::has<I> >,
116 void init_(I& ima,
const S& s);
129 template <
typename I,
typename S>
134 template <
typename I,
typename S>
139 template <
typename I,
typename S,
typename J>
144 # ifndef MLN_INCLUDE_ONLY
148 template <
typename I,
typename S,
typename J>
153 init_(tag::image, ima, model);
155 init_(tag::domain, s, model);
156 target.init_(ima, s);
165 template <
typename I,
typename S>
170 typedef fun::p2b::has<I> F;
172 s_ = p_if<S,F>(s, f);
180 template <
typename I,
typename S>
186 template <
typename I,
typename S>
193 template <
typename I,
typename S>
198 mln_precondition(! this->is_valid());
199 this->data_ =
new internal::data< sub_image_if<I,S> >(ima, s);
202 template <
typename I,
typename S>
204 const p_if< S, fun::p2b::has<I> >&
207 return this->data_->s_;
222 template <
typename I,
typename S>
232 template <
typename I,
typename S>
235 operator / (Image<I>& ima,
const Site_Set<S>& s)
238 sub_image_if<I, S> tmp(exact(ima), exact(s));
242 # endif // ! MLN_INCLUDE_ONLY
247 #endif // ! MLN_CORE_IMAGE_DMORPH_SUB_IMAGE_IF_HH