IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
BaseImageZStrip3dWithKernelSplit.h
1 // BaseImageZStrip3dWithKernelSplit.h:
3 // -----------------------------------
4 //
15 
16 #ifndef __IPSDKIMAGEPROCESSING_BASEIMAGEZSTRIP3DWITHKERNELSPLIT_H__
17 #define __IPSDKIMAGEPROCESSING_BASEIMAGEZSTRIP3DWITHKERNELSPLIT_H__
18 
19 // suppression warnings
20 // warning C4251: 'ipsdk::imaproc::BaseImageZStrip3dWithKernelSplit<InputDataType,OutputDataType>::_stripAllocationType' : class 'ipsdk::image::eStripAllocationType' needs to have dll-interface to be used by clients of class 'ipsdk::imaproc::BaseImageZStrip3dWithKernelSplit<InputDataType,OutputDataType>'
21 #pragma warning (push)
22 #pragma warning (disable : 4251)
23 
24 #include <IPSDKImageProcessing/DataSplit/Strip/BaseImageStripSplit.h>
28 #include <boost/thread/mutex.hpp>
29 #include <map>
30 
31 namespace ipsdk {
32 namespace imaproc {
33 
36 
37 template <typename InputDataType, typename OutputDataType>
39 {
40 // predefined public types
41 public:
43  typedef OutputDataType OutputType;
44 
46  typedef typename OutputDataType::BorderStorageType BorderStorageType;
47 
49  typedef std::map<ElementsRange, BorderStorageType> BorderStorageMap;
50 
51 public:
55  virtual ~BaseImageZStrip3dWithKernelSplit() = 0;
57 
58 // methods
59 public:
62  {
64  }
65 
70  const image::eStripAllocationType& getStripAllocationType() const;
71 
76  const image::eStripParsingDirection& getStripParsingDirection() const;
77 
82  ipUInt64 getKernelSizeX() const;
83  ipUInt64 getKernelSizeY() const;
84  ipUInt64 getKernelSizeZ() const;
86 
91  ipUInt64 getStartingKernelSizeX() const;
92  ipUInt64 getStartingKernelSizeY() const;
93  ipUInt64 getStartingKernelSizeZ() const;
95 
100  ipUInt64 getEndingKernelSizeX() const;
101  ipUInt64 getEndingKernelSizeY() const;
102  ipUInt64 getEndingKernelSizeZ() const;
104 
105 protected:
108  virtual BoolResult processAttribute(processor::BaseProcessor& processor,
109  const boost::shared_ptr<OutputDataType>& pImageZStrip3dWithKernel) = 0;
110 
114  BoolResult extractStrip(const ipUInt64 stripStartingOffsetZ,
115  const ipUInt64 stripSizeZ,
116  const image::BaseImage& image,
117  const core::BaseRequestOrigin& requestOrigin,
118  BorderStorageType& pStrip,
119  BorderStorageMap& stripMap);
120 
124  BoolResult storeStrip(const ipUInt64 stripStartingOffsetZ,
125  const ipUInt64 stripSizeZ,
126  const image::BaseImage& image,
127  const core::BaseRequestOrigin& requestOrigin,
128  BorderStorageMap& stripMap);
129 
145  void initBase(const boost::shared_ptr<InputDataType>& pImage,
146  const KernelXYZ& kernelXYZ,
147  const image::eStripAllocationType& stripAllocationType,
148  const image::eStripParsingDirection& stripParsingDirection);
149 
165  void initBase(const boost::shared_ptr<InputDataType>& pImage,
166  const StructuringElementXYZ& structuringElementXYZ,
167  const image::eStripAllocationType& stripAllocationType,
168  const image::eStripParsingDirection& stripParsingDirection);
169 
185  void initBase(const boost::shared_ptr<InputDataType>& pImage,
186  const ipUInt64 startingKernelSizeX,
187  const ipUInt64 endingKernelSizeX,
188  const ipUInt64 startingKernelSizeY,
189  const ipUInt64 endingKernelSizeY,
190  const ipUInt64 startingKernelSizeZ,
191  const ipUInt64 endingKernelSizeZ,
192  const image::eStripAllocationType& stripAllocationType,
193  const image::eStripParsingDirection& stripParsingDirection);
194 
195 private:
199  BoolResult processAttribute(processor::BaseProcessor& processor,
200  const ipUInt64 elementsStartIndex,
201  const ipUInt64 nbElements,
202  const core::BaseRequestOrigin& requestOrigin);
203 
204 // attributes
205 private:
207  image::eStripAllocationType _stripAllocationType;
208 
210  image::eStripParsingDirection _stripParsingDirection;
211 
213  ipUInt64 _startingKernelSizeX;
214 
216  ipUInt64 _endingKernelSizeX;
217 
219  ipUInt64 _startingKernelSizeY;
220 
222  ipUInt64 _endingKernelSizeY;
223 
225  ipUInt64 _startingKernelSizeZ;
226 
228  ipUInt64 _endingKernelSizeZ;
229 
232  BorderStorageMap _startingInternalStripsMap;
233 
236  BorderStorageMap _endingInternalStripsMap;
237 
239  boost::mutex _mutex;
240 };
241 
244 
245 } // end of namespace imaproc
246 } // end of namespace ipsdk
247 
248 #pragma warning (pop)
249 
250 #endif // __IPSDKIMAGEPROCESSING_BASEIMAGEZSTRIP3DWITHKERNELSPLIT_H__
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
uint64_t ipUInt64
Base types definition.
Definition: BaseTypes.h:55
OutputDataType OutputType
output data type for split operation
Definition: BaseImageZStrip3dWithKernelSplit.h:43
eImageStripSplitType getImageStripSplitType() const
retrieve image strip split operation type
Definition: BaseImageZStrip3dWithKernelSplit.h:61
Base class for processor class.
Definition: BaseProcessor.h:43
eStripAllocationType
Enumerate describing image strip allocation policy.
Definition: ImageStripTypes.h:88
OutputDataType::BorderStorageType BorderStorageType
border strip storage type
Definition: BaseImageZStrip3dWithKernelSplit.h:46
#define IPSDKIMAGEPROCESSING_API
Import/Export macro for library IPSDKImageProcessing.
Definition: IPSDKImageProcessingExports.h:25
Predefined types for image strips management.
Base class for request origin description.
Definition: BaseRequestOrigin.h:28
Predefined types for structuring element management.
Class encapsulating a 3d structuring element spanning along x, y and z axis.
Definition: StructuringElementXYZ.h:35
std::map< ElementsRange, BorderStorageType > BorderStorageMap
collection of border strip index by range
Definition: BaseImageZStrip3dWithKernelSplit.h:49
Split operation generating image 3d strip with splitting along Z axis associated to a kernel...
Definition: ImageStripSplitTypes.h:55
eStripParsingDirection
Enumerate describing strip parsing direction.
Definition: ImageStripTypes.h:72
Base class for split operation generating image z strips 3d associated to a kernel.
Definition: BaseImageZStrip3dWithKernelSplit.h:38
eImageStripSplitType
Enumerate describing image strip split type.
Definition: ImageStripSplitTypes.h:33
Base class for images data type.
Definition: BaseImage.h:43
Predefined types for kernel management.
Base class for image strip split operations for data dispatch.
Definition: BaseImageStripSplit.h:35
Class encapsulating a 3d kernel spanning along x, y and z axis.
Definition: KernelXYZ.h:34