Image Component Library (ICL)
ImageRegionPart.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 : ICLCV/src/ICLCV/ImageRegionPart.h **
10 ** Module : ICLCV **
11 ** Authors: Christof Elbrechter, Erik Weitnauer **
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 #pragma once
31 
32 #include <ICLUtils/CompatMacros.h>
34 
35 #include <vector>
36 #include <list>
37 
38 namespace icl{
39  namespace cv{
40 
43 
45  typedef std::vector<ImageRegionPart*> children_container;
46 
48  typedef std::vector<WorkingLineSegment*> segment_container;
49 
52  segments.clear();
53  segments.resize(1,s);
54  children.clear();
55  flags = 0x1; // top
56  val = s->val;
57  return this;
58  }
59 
62 
65 
68 
70  int val;
71 
73  inline bool is_top() const { return flags & 0x1; }
74 
76  inline bool is_counted() const { return flags & 0x2; }
77 
79  inline bool is_collected() const { return flags & 0x4; }
80 
82  inline void notify_counted() { flags |= 0x2; }
83 
85  inline void notify_collected() { flags |= 0x4; }
86 
87  // sets the top bit to false and returns the this-pointer
89  flags &= 0x6;
90  return this;
91  }
92  };
93 
94  } // namespace cv
95 }
96 
int val
image value
Definition: WorkingLineSegment.h:49
undocument this line if you encounter any issues!
Definition: Any.h:37
Ipp8u icl8u
8Bit unsigned integer type for the ICL
Definition: BasicTypes.h:64
icl8u flags
binary flags 0b_____[collected][counted][top]
Definition: ImageRegionPart.h:67
std::vector< WorkingLineSegment * > segment_container
internally used type for buffring segments
Definition: ImageRegionPart.h:48
#define ICLCV_API
Definition: CompatMacros.h:177
void notify_counted()
sets the counted bit to true
Definition: ImageRegionPart.h:82
segment_container segments
list of vector of all directly contained LineSegments
Definition: ImageRegionPart.h:64
The working line segment class extends the LineSegment class by some working parameters.
Definition: WorkingLineSegment.h:47
std::vector< ImageRegionPart * > children_container
internally used type for buffering children
Definition: ImageRegionPart.h:45
bool is_collected() const
returns whether this ImageRegionPart has already been collected
Definition: ImageRegionPart.h:79
bool is_counted() const
returns whether this ImageRegionPart has already been counted
Definition: ImageRegionPart.h:76
ImageRegionPart * init(WorkingLineSegment *s)
initializes this instance with the first WorkingLoineSegment
Definition: ImageRegionPart.h:51
The ImageRegionPart represents a intermediate region part for the connected component analysis.
Definition: ImageRegionPart.h:42
int val
chached value
Definition: ImageRegionPart.h:70
bool is_top() const
returns whether this ImageRegionPart is on top
Definition: ImageRegionPart.h:73
ImageRegionPart * adopt()
Definition: ImageRegionPart.h:88
void notify_collected()
sets the collected bit to true
Definition: ImageRegionPart.h:85
children_container children
list or vector of all contained regions
Definition: ImageRegionPart.h:61