26 #ifndef MLN_CORE_PIXTER3D_HH
27 # define MLN_CORE_PIXTER3D_HH
33 # include <mln/core/internal/pixel_iterator_base.hh>
34 # include <mln/core/alias/point3d.hh>
35 # include <mln/geom/size3d.hh>
36 # include <mln/opt/at.hh>
49 :
public internal::forward_pixel_iterator_base_< I, fwd_pixter3d<I> >
51 typedef internal::forward_pixel_iterator_base_< I, fwd_pixter3d<I> > super_;
70 const unsigned border_x2_;
73 const unsigned row_offset_;
76 mln_qlf_value(I)* eor_;
79 const unsigned next_sli_offset_;
82 const unsigned next_srow_offset_;
85 const unsigned sli_offset_;
88 mln_qlf_value(I)* eos_;
101 :
public internal::backward_pixel_iterator_base_< I, bkd_pixter3d<I> >
103 typedef internal::backward_pixel_iterator_base_< I, bkd_pixter3d<I> > super_;
122 const unsigned border_x2_;
125 const unsigned row_offset_;
128 mln_qlf_value(I)* bor_;
131 const unsigned next_sli_offset_;
134 const unsigned next_srow_offset_;
137 const unsigned sli_offset_;
140 mln_qlf_value(I)* bos_;
142 using super_::image_;
146 #ifndef MLN_INCLUDE_ONLY
152 template <
typename I>
156 border_x2_(2 * image.border()),
157 row_offset_(image.bbox().ncols() + border_x2_),
158 next_sli_offset_(row_offset_ * border_x2_ + border_x2_),
159 next_srow_offset_(next_sli_offset_ + image.bbox().ncols()),
160 sli_offset_((image.bbox().ncols() + border_x2_) *
161 (image.bbox().nrows() + border_x2_))
163 mln_precondition(image.is_valid());
166 template <
typename I>
181 template <
typename I>
184 fwd_pixter3d<I>::next_()
187 if (this->value_ptr_ == eos_ && this->value_ptr_ != this->eoi_)
189 this->value_ptr_ += next_sli_offset_;
191 eor_ += next_srow_offset_;
193 else if (this->value_ptr_ == eor_ && this->value_ptr_ != this->eoi_)
195 this->value_ptr_ += border_x2_;
205 template <
typename I>
209 border_x2_(2 * image.border()),
210 row_offset_(image.bbox().ncols() + border_x2_),
211 next_sli_offset_(row_offset_ * border_x2_ + border_x2_),
212 next_srow_offset_(next_sli_offset_ + image.bbox().ncols()),
213 sli_offset_((image.bbox().ncols() + border_x2_) *
214 (image.bbox().nrows() + border_x2_))
216 mln_precondition(image.is_valid());
219 template <
typename I>
234 template <
typename I>
237 bkd_pixter3d<I>::next_()
240 if (this->value_ptr_ == bos_ && this->value_ptr_ != this->boi_)
242 this->value_ptr_ -= next_sli_offset_;
244 bor_ -= next_srow_offset_;
246 else if (this->value_ptr_ == bor_ && this->value_ptr_ != this->boi_)
248 this->value_ptr_ -= border_x2_;
253 #endif // ! MLN_INCLUDE_ONLY
258 #endif // ! MLN_CORE_PIXTER3D_HH