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;
60 template <
typename I,
typename S>
61 struct data< sub_image_if<I,S> >
63 data(I& ima,
const S& s);
66 p_if< S, fun::p2b::has<I> > s_;
76 template <
typename I,
typename S>
77 struct image_< sub_image_if<I,S> > : default_image_morpher< I,
86 typedef trait::image::category::domain_morpher
category;
88 typedef trait::image::ext_domain::none
ext_domain;
89 typedef trait::image::ext_value::irrelevant
ext_value;
90 typedef trait::image::ext_io::irrelevant
ext_io;
104 template <
typename I,
typename S>
106 p_if< S, fun::p2b::has<I> >,
120 void init_(I& ima,
const S& s);
134 template <
typename I,
typename S>
139 template <
typename I,
typename S>
145 template <
typename I,
typename S,
typename J>
151 # ifndef MLN_INCLUDE_ONLY
155 template <
typename I,
typename S,
typename J>
163 target.
init_(ima, s);
172 template <
typename I,
typename S>
177 typedef fun::p2b::has<I> F;
179 s_ = p_if<S,F>(s, f);
187 template <
typename I,
typename S>
189 sub_image_if<I,S>::sub_image_if()
193 template <
typename I,
typename S>
195 sub_image_if<I,S>::sub_image_if(I& ima,
const S& s)
200 template <
typename I,
typename S>
203 sub_image_if<I,S>::init_(I& ima,
const S& s)
205 mln_precondition(! this->is_valid());
206 this->data_ =
new internal::data< sub_image_if<I,S> >(ima, s);
209 template <
typename I,
typename S>
211 const p_if< S, fun::p2b::has<I> >&
212 sub_image_if<I,S>::domain()
const
214 return this->data_->s_;
229 template <
typename I,
typename S>
231 sub_image_if<const I, S>
232 operator / (
const Image<I>& ima,
const Site_Set<S>& s)
235 sub_image_if<const I, S> tmp(
exact(ima),
exact(s));
239 template <
typename I,
typename S>
242 operator / (Image<I>& ima,
const Site_Set<S>& s)
249 # endif // ! MLN_INCLUDE_ONLY
254 #endif // ! MLN_CORE_IMAGE_DMORPH_SUB_IMAGE_IF_HH