28 # define MLN_OPT_AT_HH
34 # include <mln/core/concept/image.hh>
35 # include <mln/trait/images.hh>
36 # include <mln/debug/trace.hh>
38 # include <mln/core/alias/point1d.hh>
39 # include <mln/core/alias/point2d.hh>
40 # include <mln/core/alias/point3d.hh>
51 mln_rvalue(I)
at(const Image<I>& ima, def::
coord ind);
55 mln_lvalue(I)
at(Image<I>& ima, def::
coord ind);
61 mln_rvalue(I)
at(const Image<I>& ima, def::
coord row, def::
coord col);
65 mln_lvalue(I)
at(Image<I>& ima, def::
coord row, def::
coord col);
71 mln_rvalue(I)
at(const Image<I>& ima,
79 mln_lvalue(I)
at(Image<I>& ima,
83 # ifndef MLN_INCLUDE_ONLY
92 mln_rvalue(I) at_1d_impl(trait::image::category::domain_morpher,
93 const Image<I>& ima, def::
coord ind)
101 mln_rvalue(I) at_1d_impl(trait::image::category::morpher,
102 const Image<I>& ima, def::
coord ind)
106 return at(*
exact(ima).delegatee_(), ind);
109 template <
typename I>
111 mln_rvalue(I) at_1d_impl(trait::image::category::
primary,
112 const Image<I>& ima, def::
coord ind)
114 return exact(ima).at_(ind);
118 template <
typename I>
120 mln_lvalue(I) at_1d_impl(trait::image::category::domain_morpher,
121 Image<I>& ima, def::
coord ind)
123 mlc_is(mln_trait_image_pw_io(I),
124 trait::image::pw_io::read_write)::check();
130 template <
typename I>
132 mln_lvalue(I) at_1d_impl(trait::image::category::morpher,
133 Image<I>& ima, def::
coord ind)
137 return at(*
exact(ima).delegatee_(), ind);
140 template <
typename I>
142 mln_lvalue(I) at_1d_impl(trait::image::category::primary,
143 Image<I>& ima, def::
coord ind)
145 return exact(ima).at_(ind);
150 template <
typename I>
152 mln_rvalue(I)
at(const Image<I>& ima, def::
coord ind)
154 mlc_is(mln_trait_image_dimension(I),
155 trait::image::dimension::one_d)::check();
157 return impl::at_1d_impl(mln_trait_image_category(I)(), ima, ind);
160 template <
typename I>
161 mln_lvalue(I)
at(Image<I>& ima, def::
coord ind)
163 mlc_is(mln_trait_image_dimension(I),
164 trait::image::dimension::one_d)::check();
166 return impl::at_1d_impl(mln_trait_image_category(I)(), ima, ind);
175 template <
typename I>
177 mln_rvalue(I) at_2d_impl(trait::image::category::domain_morpher,
178 const Image<I>& ima, def::
coord row, def::
coord col)
184 template <
typename I>
186 mln_rvalue(I) at_2d_impl(trait::image::category::morpher,
187 const Image<I>& ima, def::
coord row, def::
coord col)
191 return at(*
exact(ima).delegatee_(), row, col);
194 template <
typename I>
196 mln_rvalue(I) at_2d_impl(trait::image::category::primary,
197 const Image<I>& ima, def::
coord row, def::
coord col)
199 return exact(ima).at_(row, col);
203 template <
typename I>
205 mln_lvalue(I) at_2d_impl(trait::image::category::domain_morpher,
206 Image<I>& ima, def::
coord row, def::
coord col)
208 mlc_is(mln_trait_image_pw_io(I),
209 trait::image::pw_io::read_write)::check();
215 template <
typename I>
217 mln_lvalue(I) at_2d_impl(trait::image::category::morpher,
218 Image<I>& ima, def::
coord row, def::
coord col)
222 return at(*
exact(ima).delegatee_(), row, col);
225 template <
typename I>
227 mln_lvalue(I) at_2d_impl(trait::image::category::primary,
228 Image<I>& ima, def::
coord row, def::
coord col)
230 return exact(ima).at_(row, col);
235 template <
typename I>
237 mln_rvalue(I)
at(const Image<I>& ima, def::
coord row, def::
coord col)
239 mlc_is(mln_trait_image_dimension(I),
240 trait::image::dimension::two_d)::check();
242 return impl::at_2d_impl(mln_trait_image_category(I)(), ima, row, col);
245 template <
typename I>
246 mln_lvalue(I)
at(Image<I>& ima, def::
coord row, def::
coord col)
248 mlc_is(mln_trait_image_dimension(I),
249 trait::image::dimension::two_d)::check();
251 return impl::at_2d_impl(mln_trait_image_category(I)(), ima, row, col);
259 template <
typename I>
261 mln_rvalue(I) at_3d_impl(trait::image::category::domain_morpher,
268 template <
typename I>
270 mln_rvalue(I) at_3d_impl(trait::image::category::morpher,
275 return at(*
exact(ima).delegatee_(), sli, row, col);
278 template <
typename I>
280 mln_rvalue(I) at_3d_impl(trait::image::category::primary,
283 return exact(ima).at_(sli, row, col);
287 template <
typename I>
289 mln_lvalue(I) at_3d_impl(trait::image::category::domain_morpher,
292 mlc_is(mln_trait_image_pw_io(I),
293 trait::image::pw_io::read_write)::check();
299 template <
typename I>
301 mln_lvalue(I) at_3d_impl(trait::image::category::morpher,
306 return at(*
exact(ima).delegatee_(), sli, row, col);
309 template <
typename I>
311 mln_lvalue(I) at_3d_impl(trait::image::category::primary,
314 return exact(ima).at_(sli, row, col);
319 template <
typename I>
321 mln_rvalue(I)
at(const Image<I>& ima, def::
coord sli, def::
coord row, def::
coord col)
323 mlc_is(mln_trait_image_dimension(I),
324 trait::image::dimension::three_d)::check();
326 return impl::at_3d_impl(mln_trait_image_category(I)(),
330 template <
typename I>
333 mlc_is(mln_trait_image_dimension(I),
334 trait::image::dimension::three_d)::check();
336 return impl::at_3d_impl(mln_trait_image_category(I)(),
340 # endif // ! MLN_INCLUDE_ONLY
347 #endif // ! MLN_OPT_AT_HH