IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
BaseImageYStrip2dWithKernelSplit.h
1 // BaseImageYStrip2dWithKernelSplit.h:
3 // -----------------------------------
4 //
15 
16 #ifndef __IPSDKIMAGEPROCESSING_BASEIMAGEYSTRIP2DWITHKERNELSPLIT_H__
17 #define __IPSDKIMAGEPROCESSING_BASEIMAGEYSTRIP2DWITHKERNELSPLIT_H__
18 
19 // suppression warnings
20 // warning C4251: 'ipsdk::imaproc::BaseImageYStrip2dWithKernelSplit<InputDataType,OutputDataType>::_stripAllocationType' : class 'ipsdk::image::eStripAllocationType' needs to have dll-interface to be used by clients of class 'ipsdk::imaproc::BaseImageYStrip2dWithKernelSplit<InputDataType,OutputDataType>'
21 #pragma warning (push)
22 #pragma warning (disable : 4251)
23 
24 #include <IPSDKImageProcessing/DataSplit/Strip/BaseImageStripSplit.h>
26 #include <IPSDKBaseData/Range/ElementsRange.h>
29 #include <boost/thread/mutex.hpp>
30 #include <map>
31 
32 namespace ipsdk {
33 namespace imaproc {
34 
37 
38 template <typename InputDataType, typename OutputDataType>
40 {
41 // predefined public types
42 public:
44  typedef OutputDataType OutputType;
45 
47  typedef typename OutputDataType::BorderStorageType BorderStorageType;
48 
50  typedef std::map<ElementsRange, BorderStorageType> BorderStorageMap;
51 
52 public:
56  virtual ~BaseImageYStrip2dWithKernelSplit() = 0;
58 
59 // methods
60 public:
63  {
65  }
66 
71  const image::eStripAllocationType& getStripAllocationType() const;
72 
77  const image::eStripParsingDirection& getStripParsingDirection() const;
78 
83  ipUInt64 getKernelSizeX() const;
84  ipUInt64 getKernelSizeY() const;
86 
91  ipUInt64 getStartingKernelSizeX() const;
92  ipUInt64 getStartingKernelSizeY() const;
94 
99  ipUInt64 getEndingKernelSizeX() const;
100  ipUInt64 getEndingKernelSizeY() const;
102 
103 protected:
106  virtual BoolResult processAttribute(processor::BaseProcessor& processor,
107  const boost::shared_ptr<OutputDataType>& pImageYStrip2dWithKernel) = 0;
108 
112  BoolResult extractStrip(const ipUInt64 stripStartingOffsetY,
113  const ipUInt64 stripSizeY,
114  const image::BaseImage& image,
115  const core::BaseRequestOrigin& requestOrigin,
116  BorderStorageType& pStrip,
117  BorderStorageMap& stripMap);
118 
122  BoolResult storeStrip(const ipUInt64 stripStartingOffsetY,
123  const ipUInt64 stripSizeY,
124  const image::BaseImage& image,
125  const core::BaseRequestOrigin& requestOrigin,
126  BorderStorageMap& stripMap);
127 
139  void initBase(const boost::shared_ptr<InputDataType>& pImage,
140  const KernelXY& kernelXY,
141  const image::eStripAllocationType& stripAllocationType,
142  const image::eStripParsingDirection& stripParsingDirection);
143 
155  void initBase(const boost::shared_ptr<InputDataType>& pImage,
156  const StructuringElementXY& structuringElementXY,
157  const image::eStripAllocationType& stripAllocationType,
158  const image::eStripParsingDirection& stripParsingDirection);
159 
171  void initBase(const boost::shared_ptr<InputDataType>& pImage,
172  const ipUInt64 startingKernelSizeX,
173  const ipUInt64 endingKernelSizeX,
174  const ipUInt64 startingKernelSizeY,
175  const ipUInt64 endingKernelSizeY,
176  const image::eStripAllocationType& stripAllocationType,
177  const image::eStripParsingDirection& stripParsingDirection);
178 
179 private:
183  BoolResult processAttribute(processor::BaseProcessor& processor,
184  const ipUInt64 elementsStartIndex,
185  const ipUInt64 nbElements,
186  const core::BaseRequestOrigin& requestOrigin);
187 
188 // attributes
189 private:
191  image::eStripAllocationType _stripAllocationType;
192 
194  image::eStripParsingDirection _stripParsingDirection;
195 
197  ipUInt64 _startingKernelSizeX;
198 
200  ipUInt64 _endingKernelSizeX;
201 
203  ipUInt64 _startingKernelSizeY;
204 
206  ipUInt64 _endingKernelSizeY;
207 
210  BorderStorageMap _startingInternalStripsMap;
211 
214  BorderStorageMap _endingInternalStripsMap;
215 
217  boost::mutex _mutex;
218 };
219 
222 
223 } // end of namespace imaproc
224 } // end of namespace ipsdk
225 
226 #pragma warning (pop)
227 
228 #endif // __IPSDKIMAGEPROCESSING_BASEIMAGEYSTRIP2DWITHKERNELSPLIT_H__
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
Class encapsulating a 2d kernel spanning along x and y axis.
Definition: KernelXY.h:34
std::map< ElementsRange, BorderStorageType > BorderStorageMap
collection of border strip index by range
Definition: BaseImageYStrip2dWithKernelSplit.h:50
eImageStripSplitType getImageStripSplitType() const
retrieve image strip split operation type
Definition: BaseImageYStrip2dWithKernelSplit.h:62
uint64_t ipUInt64
Base types definition.
Definition: BaseTypes.h:55
Split operation generating image 2d strip with splitting along Y axis associated to a kernel...
Definition: ImageStripSplitTypes.h:41
OutputDataType::BorderStorageType BorderStorageType
border strip storage type
Definition: BaseImageYStrip2dWithKernelSplit.h:47
Base class for processor class.
Definition: BaseProcessor.h:43
eStripAllocationType
Enumerate describing image strip allocation policy.
Definition: ImageStripTypes.h:88
OutputDataType OutputType
output data type for split operation
Definition: BaseImageYStrip2dWithKernelSplit.h:44
#define IPSDKIMAGEPROCESSING_API
Import/Export macro for library IPSDKImageProcessing.
Definition: IPSDKImageProcessingExports.h:25
Predefined types for image strips management.
Class encapsulating a 2d structuring element spanning along x and y axis.
Definition: StructuringElementXY.h:32
Base class for request origin description.
Definition: BaseRequestOrigin.h:28
Predefined types for structuring element management.
eStripParsingDirection
Enumerate describing strip parsing direction.
Definition: ImageStripTypes.h:72
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
Base class for split operation generating image y strips 2d associated to a kernel.
Definition: BaseImageYStrip2dWithKernelSplit.h:39