Image Component Library (ICL)
LineSampler.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/LineSampler.h **
10 ** Module : ICLCore **
11 ** Authors: Christof Elbrechter **
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 <ICLUtils/Point.h>
35 #include <ICLUtils/Rect.h>
36 #include <ICLUtils/Exception.h>
37 
38 #include <vector>
39 
40 
41 namespace icl{
42  namespace core{
44 
68  protected:
69  std::vector<utils::Point> m_buf;
70  std::vector<int> m_br;
71 
72  public:
73 
75  struct Result{
77  int n;
78 
80  const utils::Point &operator[](int idx) const { return points[idx]; }
81  };
82 
84 
85  LineSampler(int maxLen=0);
86 
88  LineSampler(const utils::Rect &br);
89 
91 
92  void setBoundingRect(const utils::Rect &bb);
93 
95  void removeBoundingBox(int bufferSize);
96 
98  Result sample(const utils::Point &a, const utils::Point &b);
99 
101  void sample(const utils::Point &a, const utils::Point &b, std::vector<utils::Point> &dst);
102  };
103 
104  } // namespace core
105 }
106 
int n
number of sampled points
Definition: LineSampler.h:77
undocument this line if you encounter any issues!
Definition: Any.h:37
result type providing a Point-pointer and number of sample points
Definition: LineSampler.h:75
Utility class for line sampling.
Definition: LineSampler.h:67
std::vector< utils::Point > m_buf
internal buffer
Definition: LineSampler.h:69
const utils::Point * points
sampled points data
Definition: LineSampler.h:76
std::vector< int > m_br
optionally given bounding rect
Definition: LineSampler.h:70
const utils::Point & operator[](int idx) const
convenience inde operator to iterate over sampled points
Definition: LineSampler.h:80
Point class of the ICL used e.g. for the Images ROI offset.
Definition: Point.h:58
Rectangle class of the ICL used e.g. for the Images ROI-rect.
Definition: Rect.h:95
#define ICLCore_API
Definition: CompatMacros.h:174