IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
StructuringElementXY.h
1 // StructuringElementXY.h:
3 // -----------------------
4 //
16 
17 #ifndef __IPSDKBASEDATA_STRUCTURINGELEMENTXY_H__
18 #define __IPSDKBASEDATA_STRUCTURINGELEMENTXY_H__
19 
20 // suppression warnings
21 // warning C4251: 'ipsdk::StructuringElementXY::_dataColl' : class 'std::set<_Kty>' needs to have dll-interface to be used by clients of class 'ipsdk::StructuringElementXY'
22 #pragma warning (push)
23 #pragma warning (disable : 4251)
24 
25 #include <IPSDKBaseData/Pattern/StructuringElement/BaseStructuringElement.h>
26 
27 namespace ipsdk {
28 
31 
33 {
34  // declare serial class
36 
37 public:
43 
44 // methods
45 public:
47  eStructuringElementType getStructuringElementType() const;
48 
50  ipUInt32 getNbData() const;
51 
53  bool exists(const OffsetXY& offset) const;
54 
58  void insert(const OffsetXY& offset);
59 
63  void remove(const OffsetXY& offset);
64 
66  void setDataColl(const XYOffsetColl& dataColl);
67 
69  const XYOffsetColl& getDataColl() const;
70 
73  const ipUInt32 getSizeX() const;
74  const ipUInt32 getSizeY() const;
76 
79  const ipInt32 getMinX() const;
80  const ipInt32 getMinY() const;
82 
85  const ipInt32 getMaxX() const;
86  const ipInt32 getMaxY() const;
88 
92  const ipUInt32 getStartingSizeX() const;
93  const ipUInt32 getStartingSizeY() const;
95 
99  const ipUInt32 getEndingSizeX() const;
100  const ipUInt32 getEndingSizeY() const;
102 
104  void clear();
105 
106 // attributes
107 protected:
110 
116 
122 };
123 
126 
129 {
131 }
132 
133 inline const ipUInt32
135 {
136  return _sizeX;
137 }
138 
139 inline const ipUInt32
141 {
142  return _sizeY;
143 }
144 
145 inline const ipInt32
147 {
148  return _minX;
149 }
150 
151 inline const ipInt32
153 {
154  return _minY;
155 }
156 
157 inline const ipInt32
159 {
160  if (_sizeX != 0)
161  return _minX + static_cast<ipInt32>(_sizeX-1);
162  else
163  return 0;
164 }
165 
166 inline const ipInt32
168 {
169  if (_sizeY != 0)
170  return _minY + static_cast<ipInt32>(_sizeY-1);
171  else
172  return 0;
173 }
174 
175 inline const ipUInt32
177 {
178  if (_minX < 0)
179  return static_cast<ipUInt32>(-_minX);
180  else
181  return 0;
182 }
183 
184 inline const ipUInt32
186 {
187  if (_minY < 0)
188  return static_cast<ipUInt32>(-_minY);
189  else
190  return 0;
191 }
192 
193 inline const ipUInt32
195 {
196  ipInt32 maxX = getMaxX();
197  if (maxX > 0)
198  return maxX;
199  else
200  return 0;
201 }
202 
203 inline const ipUInt32
205 {
206  ipInt32 maxY = getMaxY();
207  if (maxY > 0)
208  return maxY;
209  else
210  return 0;
211 }
212 
215 
216 } // end of namespace ipsdk
217 
218 #pragma warning (pop)
219 
220 #endif // __IPSDKBASEDATA_STRUCTURINGELEMENTXY_H__
#define IPSDK_DECLARE_SERIAL_WITH_COPY(libraryName, className)
macro enabling serialization on class
Definition: SerializationHdrMacro.h:73
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
const ipInt32 getMinY() const
retrieve kernel minimum offsets along x and y axis
Definition: StructuringElementXY.h:152
const ipUInt32 getStartingSizeY() const
retrieve starting size for kernel along x and y axis (absolute value of lower negative offset or 0) ...
Definition: StructuringElementXY.h:185
Class encapsulating a 2d offset along x and y axis.
Definition: OffsetXY.h:26
2d binary structuring element type spanning x and y direction
Definition: StructuringElementTypes.h:39
ipUInt32 _sizeX
Definition: StructuringElementXY.h:119
ipInt32 _minX
Definition: StructuringElementXY.h:113
int32_t ipInt32
Base types definition.
Definition: BaseTypes.h:52
const ipUInt32 getEndingSizeY() const
retrieve ending size for kernel along x and y axis (upper positive offset or 0)
Definition: StructuringElementXY.h:204
ipInt32 _minY
Definition: StructuringElementXY.h:114
const ipUInt32 getSizeY() const
retrieve kernel size along x and y axis
Definition: StructuringElementXY.h:140
const ipInt32 getMaxX() const
retrieve kernel maximum offsets along x and y axis
Definition: StructuringElementXY.h:158
Base class for binary structuring element objects.
Definition: BaseStructuringElement.h:28
const ipInt32 getMinX() const
retrieve kernel minimum offsets along x and y axis
Definition: StructuringElementXY.h:146
const ipUInt32 getStartingSizeX() const
retrieve starting size for kernel along x and y axis (absolute value of lower negative offset or 0) ...
Definition: StructuringElementXY.h:176
ipUInt32 _sizeY
Definition: StructuringElementXY.h:120
Class encapsulating a 2d structuring element spanning along x and y axis.
Definition: StructuringElementXY.h:32
eStructuringElementType getStructuringElementType() const
retrieve structuring element type associated to object
Definition: StructuringElementXY.h:128
XYOffsetColl _dataColl
collection of data associated to kernel
Definition: StructuringElementXY.h:109
eStructuringElementType
Enumerate describing binary structuring element type.
Definition: StructuringElementTypes.h:37
const ipInt32 getMaxY() const
retrieve kernel maximum offsets along x and y axis
Definition: StructuringElementXY.h:167
std::set< OffsetXY > XYOffsetColl
collection of xy 2d offsets
Definition: StructuringElementTypes.h:50
const ipUInt32 getSizeX() const
retrieve kernel size along x and y axis
Definition: StructuringElementXY.h:134
#define IPSDKBASEDATA_API
Import/Export macro for library IPSDKUtil.
Definition: IPSDKBaseDataExports.h:27
const ipUInt32 getEndingSizeX() const
retrieve ending size for kernel along x and y axis (upper positive offset or 0)
Definition: StructuringElementXY.h:194
uint32_t ipUInt32
Base types definition.
Definition: BaseTypes.h:53