IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
BaseImageXStrip2dWithKernelSplit.h
1 // BaseImageXStrip2dWithKernelSplit.h:
3 // -----------------------------------
4 //
15 
16 #ifndef __IPSDKIMAGEPROCESSING_BASEIMAGEXSTRIP2DWITHKERNELSPLIT_H__
17 #define __IPSDKIMAGEPROCESSING_BASEIMAGEXSTRIP2DWITHKERNELSPLIT_H__
18 
19 // suppression warnings
20 // warning C4251: 'ipsdk::imaproc::BaseImageXStrip2dWithKernelSplit<InputDataType,OutputDataType>::_stripAllocationType' : class 'ipsdk::image::eStripAllocationType' needs to have dll-interface to be used by clients of class 'ipsdk::imaproc::BaseImageXStrip2dWithKernelSplit<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 ~BaseImageXStrip2dWithKernelSplit() = 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;
85 
90  ipUInt64 getStartingKernelSizeX() const;
91  ipUInt64 getStartingKernelSizeY() const;
93 
98  ipUInt64 getEndingKernelSizeX() const;
99  ipUInt64 getEndingKernelSizeY() const;
101 
102 protected:
105  virtual BoolResult processAttribute(processor::BaseProcessor& processor,
106  const boost::shared_ptr<OutputDataType>& pImageXStrip2dWithKernel) = 0;
107 
111  BoolResult extractStrip(const ipUInt64 stripStartingOffsetX,
112  const ipUInt64 stripSizeX,
113  const image::BaseImage& image,
114  const core::BaseRequestOrigin& requestOrigin,
115  BorderStorageType& pStrip,
116  BorderStorageMap& stripMap);
117 
121  BoolResult storeStrip(const ipUInt64 stripStartingOffsetX,
122  const ipUInt64 stripSizeX,
123  const image::BaseImage& image,
124  const core::BaseRequestOrigin& requestOrigin,
125  BorderStorageMap& stripMap);
126 
138  void initBase(const boost::shared_ptr<InputDataType>& pImage,
139  const KernelXY& kernelXY,
140  const image::eStripAllocationType& stripAllocationType,
141  const image::eStripParsingDirection& stripParsingDirection,
142  const ipUInt64 nbMaxEltsPerSplit);
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  const ipUInt64 nbMaxEltsPerSplit);
160 
172  void initBase(const boost::shared_ptr<InputDataType>& pImage,
173  const ipUInt64 startingKernelSizeX,
174  const ipUInt64 endingKernelSizeX,
175  const ipUInt64 startingKernelSizeY,
176  const ipUInt64 endingKernelSizeY,
177  const image::eStripAllocationType& stripAllocationType,
178  const image::eStripParsingDirection& stripParsingDirection,
179  const ipUInt64 nbMaxEltsPerSplit);
180 
181 private:
185  BoolResult processAttribute(processor::BaseProcessor& processor,
186  const ipUInt64 elementsStartIndex,
187  const ipUInt64 nbElements,
188  const core::BaseRequestOrigin& requestOrigin);
189 
190 // attributes
191 private:
193  image::eStripAllocationType _stripAllocationType;
194 
196  image::eStripParsingDirection _stripParsingDirection;
197 
199  ipUInt64 _startingKernelSizeX;
200 
202  ipUInt64 _endingKernelSizeX;
203 
205  ipUInt64 _startingKernelSizeY;
206 
208  ipUInt64 _endingKernelSizeY;
209 
212  BorderStorageMap _startingInternalStripsMap;
213 
216  BorderStorageMap _endingInternalStripsMap;
217 
219  boost::mutex _mutex;
220 };
221 
224 
225 } // end of namespace imaproc
226 } // end of namespace ipsdk
227 
228 #pragma warning (pop)
229 
230 #endif // __IPSDKIMAGEPROCESSING_BASEIMAGEXSTRIP2DWITHKERNELSPLIT_H__
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
Split operation generating image 2d strip with splitting along X axis associated to a kernel...
Definition: ImageStripSplitTypes.h:39
std::map< ElementsRange, BorderStorageType > BorderStorageMap
collection of border strip index by range
Definition: BaseImageXStrip2dWithKernelSplit.h:49
Class encapsulating a 2d kernel spanning along x and y axis.
Definition: KernelXY.h:34
uint64_t ipUInt64
Base types definition.
Definition: BaseTypes.h:55
OutputDataType OutputType
output data type for split operation
Definition: BaseImageXStrip2dWithKernelSplit.h:43
OutputDataType::BorderStorageType BorderStorageType
border strip storage type
Definition: BaseImageXStrip2dWithKernelSplit.h:46
Base class for processor class.
Definition: BaseProcessor.h:43
eStripAllocationType
Enumerate describing image strip allocation policy.
Definition: ImageStripTypes.h:88
eImageStripSplitType getImageStripSplitType() const
retrieve image strip split operation type
Definition: BaseImageXStrip2dWithKernelSplit.h:61
#define IPSDKIMAGEPROCESSING_API
Import/Export macro for library IPSDKImageProcessing.
Definition: IPSDKImageProcessingExports.h:25
Predefined types for image strips management.
Base class for split operation generating image x strips 2d associated to a kernel.
Definition: BaseImageXStrip2dWithKernelSplit.h:38
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