IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
StructuringElementXYZ.h
1 // StructuringElementXYZ.h:
3 // ------------------------
4 //
16 
17 #ifndef __IPSDKBASEDATA_STRUCTURINGELEMENTXYZ_H__
18 #define __IPSDKBASEDATA_STRUCTURINGELEMENTXYZ_H__
19 
20 // suppression warnings
21 // warning C4251: 'ipsdk::StructuringElementXYZ::_dataColl' : class 'std::set<_Kty>' needs to have dll-interface to be used by clients of class 'ipsdk::StructuringElementXYZ'
22 #pragma warning (push)
23 #pragma warning (disable : 4251)
24 
25 #include <IPSDKBaseData/Pattern/StructuringElement/BaseStructuringElement.h>
26 #include <set>
27 
28 namespace ipsdk {
29 
30 class OffsetXYZ;
31 
34 
36 {
37  // declare serial class
39 
40 public:
46 
47 // methods
48 public:
50  eStructuringElementType getStructuringElementType() const;
51 
53  ipUInt32 getNbData() const;
54 
56  bool exists(const OffsetXYZ& offset) const;
57 
61  void insert(const OffsetXYZ& offset);
62 
66  void remove(const OffsetXYZ& offset);
67 
69  const XYZOffsetColl& getDataColl() const;
70 
72  void setDataColl(const XYZOffsetColl& dataColl);
73 
76  const ipUInt32 getSizeX() const;
77  const ipUInt32 getSizeY() const;
78  const ipUInt32 getSizeZ() const;
80 
83  const ipInt32 getMinX() const;
84  const ipInt32 getMinY() const;
85  const ipInt32 getMinZ() const;
87 
90  const ipInt32 getMaxX() const;
91  const ipInt32 getMaxY() const;
92  const ipInt32 getMaxZ() const;
94 
98  const ipUInt32 getStartingSizeX() const;
99  const ipUInt32 getStartingSizeY() const;
100  const ipUInt32 getStartingSizeZ() const;
102 
106  const ipUInt32 getEndingSizeX() const;
107  const ipUInt32 getEndingSizeY() const;
108  const ipUInt32 getEndingSizeZ() const;
110 
112  void clear();
113 
114 // attributes
115 protected:
118 
125 
132 };
133 
136 
139 {
141 }
142 
143 inline const ipUInt32
145 {
146  return _sizeX;
147 }
148 
149 inline const ipUInt32
151 {
152  return _sizeY;
153 }
154 
155 inline const ipUInt32
157 {
158  return _sizeZ;
159 }
160 
161 inline const ipInt32
163 {
164  return _minX;
165 }
166 
167 inline const ipInt32
169 {
170  return _minY;
171 }
172 
173 inline const ipInt32
175 {
176  return _minZ;
177 }
178 
179 inline const ipInt32
181 {
182  if (_sizeX != 0)
183  return _minX + static_cast<ipInt32>(_sizeX-1);
184  else
185  return 0;
186 }
187 
188 inline const ipInt32
190 {
191  if (_sizeY != 0)
192  return _minY + static_cast<ipInt32>(_sizeY-1);
193  else
194  return 0;
195 }
196 
197 inline const ipInt32
199 {
200  if (_sizeZ != 0)
201  return _minZ + static_cast<ipInt32>(_sizeZ-1);
202  else
203  return 0;
204 }
205 
206 inline const ipUInt32
208 {
209  if (_minX < 0)
210  return static_cast<ipUInt32>(-_minX);
211  else
212  return 0;
213 }
214 
215 inline const ipUInt32
217 {
218  if (_minY < 0)
219  return static_cast<ipUInt32>(-_minY);
220  else
221  return 0;
222 }
223 
224 inline const ipUInt32
226 {
227  if (_minZ < 0)
228  return static_cast<ipUInt32>(-_minZ);
229  else
230  return 0;
231 }
232 
233 inline const ipUInt32
235 {
236  ipInt32 maxX = getMaxX();
237  if (maxX > 0)
238  return maxX;
239  else
240  return 0;
241 }
242 
243 inline const ipUInt32
245 {
246  ipInt32 maxY = getMaxY();
247  if (maxY > 0)
248  return maxY;
249  else
250  return 0;
251 }
252 
253 inline const ipUInt32
255 {
256  ipInt32 maxZ = getMaxZ();
257  if (maxZ > 0)
258  return maxZ;
259  else
260  return 0;
261 }
262 
265 
266 } // end of namespace ipsdk
267 
268 #pragma warning (pop)
269 
270 #endif // __IPSDKBASEDATA_STRUCTURINGELEMENTXYZ_H__
#define IPSDK_DECLARE_SERIAL_WITH_COPY(libraryName, className)
macro enabling serialization on class
Definition: SerializationHdrMacro.h:73
const ipUInt32 getSizeX() const
retrieve kernel size along x, y and z axis
Definition: StructuringElementXYZ.h:144
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
const ipUInt32 getEndingSizeY() const
retrieve ending size for kernel along x, y and z axis (upper positive offset or 0) ...
Definition: StructuringElementXYZ.h:244
const ipUInt32 getEndingSizeZ() const
retrieve ending size for kernel along x, y and z axis (upper positive offset or 0) ...
Definition: StructuringElementXYZ.h:254
const ipInt32 getMaxX() const
retrieve kernel maximum offsets along x, y and z axis
Definition: StructuringElementXYZ.h:180
ipUInt32 _sizeX
Definition: StructuringElementXYZ.h:128
const ipUInt32 getStartingSizeX() const
retrieve starting size for kernel along x, y and z axis (absolute value of lower negative offset or 0...
Definition: StructuringElementXYZ.h:207
const ipInt32 getMaxY() const
retrieve kernel maximum offsets along x, y and z axis
Definition: StructuringElementXYZ.h:189
const ipUInt32 getStartingSizeY() const
retrieve starting size for kernel along x, y and z axis (absolute value of lower negative offset or 0...
Definition: StructuringElementXYZ.h:216
int32_t ipInt32
Base types definition.
Definition: BaseTypes.h:52
XYZOffsetColl _dataColl
collection of data associated to kernel
Definition: StructuringElementXYZ.h:117
const ipUInt32 getEndingSizeX() const
retrieve ending size for kernel along x, y and z axis (upper positive offset or 0) ...
Definition: StructuringElementXYZ.h:234
const ipUInt32 getSizeZ() const
retrieve kernel size along x, y and z axis
Definition: StructuringElementXYZ.h:156
const ipInt32 getMinZ() const
retrieve kernel minimum offsets along x, y and z axis
Definition: StructuringElementXYZ.h:174
Base class for binary structuring element objects.
Definition: BaseStructuringElement.h:28
3d binary structuring element type spanning x, y and z direction
Definition: StructuringElementTypes.h:41
Class encapsulating a 3d offset along x, y and z axis.
Definition: OffsetXYZ.h:26
ipUInt32 _sizeY
Definition: StructuringElementXYZ.h:129
ipInt32 _minX
Definition: StructuringElementXYZ.h:121
eStructuringElementType getStructuringElementType() const
retrieve structuring element type associated to object
Definition: StructuringElementXYZ.h:138
const ipUInt32 getStartingSizeZ() const
retrieve starting size for kernel along x, y and z axis (absolute value of lower negative offset or 0...
Definition: StructuringElementXYZ.h:225
const ipUInt32 getSizeY() const
retrieve kernel size along x, y and z axis
Definition: StructuringElementXYZ.h:150
Class encapsulating a 3d structuring element spanning along x, y and z axis.
Definition: StructuringElementXYZ.h:35
ipInt32 _minZ
Definition: StructuringElementXYZ.h:123
std::set< OffsetXYZ > XYZOffsetColl
collection of xyz 3d offsets
Definition: StructuringElementTypes.h:54
const ipInt32 getMinX() const
retrieve kernel minimum offsets along x, y and z axis
Definition: StructuringElementXYZ.h:162
const ipInt32 getMaxZ() const
retrieve kernel maximum offsets along x, y and z axis
Definition: StructuringElementXYZ.h:198
ipUInt32 _sizeZ
Definition: StructuringElementXYZ.h:130
eStructuringElementType
Enumerate describing binary structuring element type.
Definition: StructuringElementTypes.h:37
ipInt32 _minY
Definition: StructuringElementXYZ.h:122
const ipInt32 getMinY() const
retrieve kernel minimum offsets along x, y and z axis
Definition: StructuringElementXYZ.h:168
#define IPSDKBASEDATA_API
Import/Export macro for library IPSDKUtil.
Definition: IPSDKBaseDataExports.h:27
uint32_t ipUInt32
Base types definition.
Definition: BaseTypes.h:53