IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
ImageXStrip2dWithKernelSplit.h
1 // ImageXStrip2dWithKernelSplit.h:
3 // -------------------------------
4 //
15 
16 #ifndef __IPSDKIMAGEPROCESSING_IMAGEXSTRIP2DWITHKERNELSPLIT_H__
17 #define __IPSDKIMAGEPROCESSING_IMAGEXSTRIP2DWITHKERNELSPLIT_H__
18 
19 #include <IPSDKImageProcessing/DataSplit/Strip/XStrip2dWithKernel/BaseImageXStrip2dWithKernelSplit.h>
20 
21 namespace ipsdk {
22 namespace imaproc {
23 
26 
27 template <typename TProcessor, typename InputDataType, typename TAttribute>
29  typename TAttribute::ValueType>
30 {
31 // predefined public types
32 public:
34  typedef TProcessor ProcessorType;
35 
37  typedef TAttribute AttributeType;
38 
40  typedef typename TAttribute::ValueType OutputType;
41 
42 public:
48 
49 // methods
50 public:
52  const std::string& getAttributeName() const;
53 
55  const std::string& getAttributeToolTip() const;
56 
68  void init(const boost::shared_ptr<InputDataType>& pImage,
69  const KernelXY& kernelXY,
70  const image::eStripAllocationType& stripAllocationType,
71  const image::eStripParsingDirection& stripParsingDirection,
72  const ipUInt64 nbMaxEltsPerSplit = NumericLimits<ipUInt64>::max());
73 
85  void init(const boost::shared_ptr<InputDataType>& pImage,
86  const StructuringElementXY& structuringElementXY,
87  const image::eStripAllocationType& stripAllocationType,
88  const image::eStripParsingDirection& stripParsingDirection,
89  const ipUInt64 nbMaxEltsPerSplit = NumericLimits<ipUInt64>::max());
90 
102  void init(const boost::shared_ptr<InputDataType>& pImage,
103  const ipUInt64 startingKernelSizeX,
104  const ipUInt64 endingKernelSizeX,
105  const ipUInt64 startingKernelSizeY,
106  const ipUInt64 endingKernelSizeY,
107  const image::eStripAllocationType& stripAllocationType,
108  const image::eStripParsingDirection& stripParsingDirection,
109  const ipUInt64 nbMaxEltsPerSplit = NumericLimits<ipUInt64>::max());
110 
111 protected:
113  bool checkProcessorType(const processor::BaseProcessor& processor);
114 
119  const boost::shared_ptr<OutputType>& pImageYStrip2dWithKernel);
120 
121 // attributes
122 protected:
123 
124 };
125 
128 
129 template <typename TProcessor, typename InputDataType, typename TAttribute>
130 inline const std::string&
132 {
133  return TAttribute::getObjectNameStr();
134 }
135 
136 template <typename TProcessor, typename InputDataType, typename TAttribute>
137 inline const std::string&
139 {
140  return TAttribute::getToolTipStr();
141 }
142 
143 template <typename TProcessor, typename InputDataType, typename TAttribute>
144 inline void
146  const KernelXY& kernelXY,
147  const image::eStripAllocationType& stripAllocationType,
148  const image::eStripParsingDirection& stripParsingDirection,
149  const ipUInt64 nbMaxEltsPerSplit)
150 {
151  // call of base class initialization method
152  this->initBase(pImage,
153  kernelXY,
154  stripAllocationType, stripParsingDirection,
155  nbMaxEltsPerSplit);
156 }
157 
158 template <typename TProcessor, typename InputDataType, typename TAttribute>
159 inline void
161  const StructuringElementXY& structuringElementXY,
162  const image::eStripAllocationType& stripAllocationType,
163  const image::eStripParsingDirection& stripParsingDirection,
164  const ipUInt64 nbMaxEltsPerSplit)
165 {
166  // call of base class initialization method
167  this->initBase(pImage,
168  structuringElementXY,
169  stripAllocationType, stripParsingDirection,
170  nbMaxEltsPerSplit);
171 }
172 
173 template <typename TProcessor, typename InputDataType, typename TAttribute>
174 inline void
176  const ipUInt64 startingKernelSizeX,
177  const ipUInt64 endingKernelSizeX,
178  const ipUInt64 startingKernelSizeY,
179  const ipUInt64 endingKernelSizeY,
180  const image::eStripAllocationType& stripAllocationType,
181  const image::eStripParsingDirection& stripParsingDirection,
182  const ipUInt64 nbMaxEltsPerSplit)
183 {
184  // call of base class initialization method
185  this->initBase(pImage,
186  startingKernelSizeX, endingKernelSizeX, startingKernelSizeY, endingKernelSizeY,
187  stripAllocationType, stripParsingDirection,
188  nbMaxEltsPerSplit);
189 }
190 
191 template <typename TProcessor, typename InputDataType, typename TAttribute>
192 inline bool
194 {
195  // check for consistency between processor and attribute
197  "This attribute is not part of processor class");
198 
199  return dynamic_cast<const TProcessor*>(&processor) != 0;
200 }
201 
202 template <typename TProcessor, typename InputDataType, typename TAttribute>
203 inline BoolResult
205  const boost::shared_ptr<OutputType>& pImageXStrip2dWithKernel)
206 {
207  // cast of input processor object
208  TProcessor& tProcessor = static_cast<TProcessor&>(processor);
209 
210  // update of processor attribute value
211  tProcessor.TProcessor::template set<TAttribute>(pImageXStrip2dWithKernel);
212 
213  return true;
214 }
215 
218 
219 } // end of namespace imaproc
220 } // end of namespace ipsdk
221 
222 #endif // __IPSDKIMAGEPROCESSING_IMAGEXSTRIP2DWITHKERNELSPLIT_H__
Class allowing to encapsulate a typed process result associated to a string description.
Definition: ProcessingResult.h:28
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
bool checkProcessorType(const processor::BaseProcessor &processor)
check processor type in derived class
Definition: ImageXStrip2dWithKernelSplit.h:193
Class encapsulating a 2d kernel spanning along x and y axis.
Definition: KernelXY.h:34
TAttribute::ValueType OutputType
output data type for split operation
Definition: ImageXStrip2dWithKernelSplit.h:40
const std::string & getAttributeName() const
retrieve attribute name associated to split operation
Definition: ImageXStrip2dWithKernelSplit.h:131
uint64_t ipUInt64
Base types definition.
Definition: BaseTypes.h:55
Definition: NumericLimits.h:27
Base class for processor class.
Definition: BaseProcessor.h:43
structure allowing to check whether a given attribute exists in attribute collection information ...
Definition: AttributeCollInfoCheckMacros.h:131
eStripAllocationType
Enumerate describing image strip allocation policy.
Definition: ImageStripTypes.h:88
BoolResult processAttribute(processor::BaseProcessor &processor, const boost::shared_ptr< OutputType > &pImageYStrip2dWithKernel)
initialize processor attribute associate to split operation for a given element index ...
Definition: ImageXStrip2dWithKernelSplit.h:204
TAttribute AttributeType
attribute type associated to object
Definition: ImageXStrip2dWithKernelSplit.h:37
TProcessor ProcessorType
processor type associated to object
Definition: ImageXStrip2dWithKernelSplit.h:34
Base class for split operation generating image x strips 2d associated to a kernel.
Definition: BaseImageXStrip2dWithKernelSplit.h:38
const std::string & getAttributeToolTip() const
retrieve attribute tooltip associated to split operation
Definition: ImageXStrip2dWithKernelSplit.h:138
Class encapsulating a 2d structuring element spanning along x and y axis.
Definition: StructuringElementXY.h:32
eStripParsingDirection
Enumerate describing strip parsing direction.
Definition: ImageStripTypes.h:72
void init(const boost::shared_ptr< InputDataType > &pImage, const KernelXY &kernelXY, const image::eStripAllocationType &stripAllocationType, const image::eStripParsingDirection &stripParsingDirection, const ipUInt64 nbMaxEltsPerSplit=NumericLimits< ipUInt64 >::max())
initialization method for splitted objects
Definition: ImageXStrip2dWithKernelSplit.h:145
Concrete class for split operation generating image x strips 2d associated to a kernel.
Definition: ImageXStrip2dWithKernelSplit.h:28