Image Component Library (ICL)
ImgIterator.h
Go to the documentation of this file.
1 /********************************************************************
2 ** Image Component Library (ICL) **
3 ** **
4 ** Copyright (C) 2006-2013 CITEC, University of Bielefeld **
5 ** Neuroinformatics Group **
6 ** Website: www.iclcv.org and **
7 ** http://opensource.cit-ec.de/projects/icl **
8 ** **
9 ** File : ICLCore/src/ICLCore/ImgIterator.h **
10 ** Module : ICLCore **
11 ** Authors: Christof Elbrechter, Michael Goetting, Robert Haschke **
12 ** **
13 ** **
14 ** GNU LESSER GENERAL PUBLIC LICENSE **
15 ** This file may be used under the terms of the GNU Lesser General **
16 ** Public License version 3.0 as published by the **
17 ** **
18 ** Free Software Foundation and appearing in the file LICENSE.LGPL **
19 ** included in the packaging of this file. Please review the **
20 ** following information to ensure the license requirements will **
21 ** be met: http://www.gnu.org/licenses/lgpl-3.0.txt **
22 ** **
23 ** The development of this software was supported by the **
24 ** Excellence Cluster EXC 277 Cognitive Interaction Technology. **
25 ** The Excellence Cluster EXC 277 is a grant of the Deutsche **
26 ** Forschungsgemeinschaft (DFG) in the context of the German **
27 ** Excellence Initiative. **
28 ** **
29 ********************************************************************/
30 
31 #pragma once
32 
33 #include <ICLUtils/CompatMacros.h>
34 #include <ICLCore/CoreFunctions.h>
36 
37 namespace icl{
38  namespace core{
40 
241  template <typename Type>
243  public:
244 
245  static inline const ImgIterator<Type> create_end_roi_iterator(const Type *data,
246  int width,
247  const utils::Rect &roi){
248  ImgIterator<Type> i(const_cast<Type*>(data),width,roi);
249  i.m_dataCurr = i.m_dataEnd - roi.width + width;
250  i.m_currLineEnd = i.m_dataCurr + roi.width;
251  return i;
252  }
253 
255  inline ImgIterator(){}
257 
263  inline ImgIterator(Type *data,int imageWidth,const utils::Rect &roi):
264  math::MatrixSubRectIterator<Type>(data,imageWidth,roi.x,roi.y,roi.width,roi.height){}
265 
267 
276  inline ImgIterator(const ImgIterator<Type> &origin, const utils::Size &s, const utils::Point &a){
281  ImgIterator<Type>::m_dataCurr=origin.m_dataCurr - a.x - a.y * origin.m_matrixWidth;
283  }
284 
286 
290  inline bool inRegionSubROI() const{
292  }
293 
297  return *this;
298  }
299 
303  return *this;
304  }
305 
307  int getROIWidth() const {
309  }
310 
312  int getROIHeight() const {
314  }
315  };
316  } // namespace core
317 } // namespace icl
int getROIWidth() const
returns ROIS width
Definition: ImgIterator.h:307
ImgIterator(Type *data, int imageWidth, const utils::Rect &roi)
Definition: ImgIterator.h:263
undocument this line if you encounter any issues!
Definition: Any.h:37
int y()
returns the current y position of the iterator (wrt matrix origin)
Definition: MatrixSubRectIterator.h:262
int m_matrixWidth
corresponding matrix width
Definition: MatrixSubRectIterator.h:268
ImgIterator< Type > & operator=(const math::MatrixSubRectIterator< Type > &other)
Allows to assign const instances.
Definition: ImgIterator.h:295
Type * m_dataCurr
pointer to the current data element
Definition: MatrixSubRectIterator.h:280
Type * m_dataOrigin
pointer to the upper matrix data origin (upper left element)
Definition: MatrixSubRectIterator.h:277
void init()
Definition: MatrixSubRectIterator.h:72
ICLQt_API ImgROI roi(ImgQ &r)
creates a ROI-struct from an image
Type * m_currLineEnd
pointer to the first invalid element of the current line
Definition: MatrixSubRectIterator.h:286
ImgIterator()
Default Constructor.
Definition: ImgIterator.h:256
Type * m_dataEnd
pointer to the first element behind the subrect
Definition: MatrixSubRectIterator.h:283
ICLQt_API ImgROI data(ImgQ &r)
creates full ROI ROI-struct
const MatrixSubRectIterator & operator=(const MatrixSubRectIterator &other) const
Definition: MatrixSubRectIterator.h:121
Iterator class used to iterate through an Images ROI-pixels.
Definition: ImgIterator.h:242
int x()
returns the current x position of the iterator (wrt matrix origin);
Definition: MatrixSubRectIterator.h:256
Iterator class used to iterate through a sub rect of 2D data.
Definition: MatrixSubRectIterator.h:70
Size class of the ICL.
Definition: Size.h:61
ImgIterator(const ImgIterator< Type > &origin, const utils::Size &s, const utils::Point &a)
3rd Constructor to create sub-regions of an Img-image
Definition: ImgIterator.h:276
int getSubRectWidth() const
returns the length of each row processed by this iterator
Definition: MatrixSubRectIterator.h:236
const ImgIterator< Type > & operator=(const math::MatrixSubRectIterator< Type > &other) const
Allows to assign const instances.
Definition: ImgIterator.h:301
Point class of the ICL used e.g. for the Images ROI offset.
Definition: Point.h:58
bool inSubRect() const
to check if iterator is still inside the ROI
Definition: MatrixSubRectIterator.h:201
int getSubRectHeight() const
Definition: MatrixSubRectIterator.h:240
Rectangle class of the ICL used e.g. for the Images ROI-rect.
Definition: Rect.h:95
static const ImgIterator< Type > create_end_roi_iterator(const Type *data, int width, const utils::Rect &roi)
Definition: ImgIterator.h:245
bool inRegionSubROI() const
to check if iterator is still inside the ROI
Definition: ImgIterator.h:290
int getROIHeight() const
returns ROIS width
Definition: ImgIterator.h:312