IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
ImageYStrip2dWithKernelSplit.h
1 // ImageYStrip2dWithKernelSplit.h:
3 // -------------------------------
4 //
15 
16 #ifndef __IPSDKIMAGEPROCESSING_IMAGEYSTRIP2DWITHKERNELSPLIT_H__
17 #define __IPSDKIMAGEPROCESSING_IMAGEYSTRIP2DWITHKERNELSPLIT_H__
18 
19 #include <IPSDKImageProcessing/DataSplit/Strip/YStrip2dWithKernel/BaseImageYStrip2dWithKernelSplit.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 
84  void init(const boost::shared_ptr<InputDataType>& pImage,
85  const StructuringElementXY& structuringElementXY,
86  const image::eStripAllocationType& stripAllocationType,
87  const image::eStripParsingDirection& stripParsingDirection);
88 
100  void init(const boost::shared_ptr<InputDataType>& pImage,
101  const ipUInt64 startingKernelSizeX,
102  const ipUInt64 endingKernelSizeX,
103  const ipUInt64 startingKernelSizeY,
104  const ipUInt64 endingKernelSizeY,
105  const image::eStripAllocationType& stripAllocationType,
106  const image::eStripParsingDirection& stripParsingDirection);
107 
108 protected:
110  bool checkProcessorType(const processor::BaseProcessor& processor);
111 
116  const boost::shared_ptr<OutputType>& pImageYStrip2dWithKernel);
117 
118 // attributes
119 protected:
120 
121 };
122 
125 
126 template <typename TProcessor, typename InputDataType, typename TAttribute>
127 inline const std::string&
129 {
130  return TAttribute::getObjectNameStr();
131 }
132 
133 template <typename TProcessor, typename InputDataType, typename TAttribute>
134 inline const std::string&
136 {
137  return TAttribute::getToolTipStr();
138 }
139 
140 template <typename TProcessor, typename InputDataType, typename TAttribute>
141 inline void
143  const KernelXY& kernelXY,
144  const image::eStripAllocationType& stripAllocationType,
145  const image::eStripParsingDirection& stripParsingDirection)
146 {
147  // call of base class initialization method
148  this->initBase(pImage,
149  kernelXY,
150  stripAllocationType, stripParsingDirection);
151 }
152 
153 template <typename TProcessor, typename InputDataType, typename TAttribute>
154 inline void
156  const StructuringElementXY& structuringElementXY,
157  const image::eStripAllocationType& stripAllocationType,
158  const image::eStripParsingDirection& stripParsingDirection)
159 {
160  // call of base class initialization method
161  this->initBase(pImage,
162  structuringElementXY,
163  stripAllocationType, stripParsingDirection);
164 }
165 
166 template <typename TProcessor, typename InputDataType, typename TAttribute>
167 inline void
169  const ipUInt64 startingKernelSizeX,
170  const ipUInt64 endingKernelSizeX,
171  const ipUInt64 startingKernelSizeY,
172  const ipUInt64 endingKernelSizeY,
173  const image::eStripAllocationType& stripAllocationType,
174  const image::eStripParsingDirection& stripParsingDirection)
175 {
176  // call of base class initialization method
177  this->initBase(pImage,
178  startingKernelSizeX, endingKernelSizeX, startingKernelSizeY, endingKernelSizeY,
179  stripAllocationType, stripParsingDirection);
180 }
181 
182 template <typename TProcessor, typename InputDataType, typename TAttribute>
183 inline bool
185 {
186  // check for consistency between processor and attribute
188  "This attribute is not part of processor class");
189 
190  return dynamic_cast<const TProcessor*>(&processor) != 0;
191 }
192 
193 template <typename TProcessor, typename InputDataType, typename TAttribute>
194 inline BoolResult
196  const boost::shared_ptr<OutputType>& pImageYStrip2dWithKernel)
197 {
198  // cast of input processor object
199  TProcessor& tProcessor = static_cast<TProcessor&>(processor);
200 
201  // update of processor attribute value
202  tProcessor.TProcessor::template set<TAttribute>(pImageYStrip2dWithKernel);
203 
204  return true;
205 }
206 
209 
210 } // end of namespace imaproc
211 } // end of namespace ipsdk
212 
213 #endif // __IPSDKIMAGEPROCESSING_IMAGEYSTRIP2DWITHKERNELSPLIT_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
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
bool checkProcessorType(const processor::BaseProcessor &processor)
check processor type in derived class
Definition: ImageYStrip2dWithKernelSplit.h:184
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
TProcessor ProcessorType
processor type associated to object
Definition: ImageYStrip2dWithKernelSplit.h:34
BoolResult processAttribute(processor::BaseProcessor &processor, const boost::shared_ptr< OutputType > &pImageYStrip2dWithKernel)
initialize processor attribute associate to split operation for a given element index ...
Definition: ImageYStrip2dWithKernelSplit.h:195
Class encapsulating a 2d structuring element spanning along x and y axis.
Definition: StructuringElementXY.h:32
const std::string & getAttributeToolTip() const
retrieve attribute tooltip associated to split operation
Definition: ImageYStrip2dWithKernelSplit.h:135
Concrete class for split operation generating image y strips 2d associated to a kernel.
Definition: ImageYStrip2dWithKernelSplit.h:28
TAttribute AttributeType
attribute type associated to object
Definition: ImageYStrip2dWithKernelSplit.h:37
eStripParsingDirection
Enumerate describing strip parsing direction.
Definition: ImageStripTypes.h:72
const std::string & getAttributeName() const
retrieve attribute name associated to split operation
Definition: ImageYStrip2dWithKernelSplit.h:128
TAttribute::ValueType OutputType
output data type for split operation
Definition: ImageYStrip2dWithKernelSplit.h:40
void init(const boost::shared_ptr< InputDataType > &pImage, const KernelXY &kernelXY, const image::eStripAllocationType &stripAllocationType, const image::eStripParsingDirection &stripParsingDirection)
initialization method for splitted objects
Definition: ImageYStrip2dWithKernelSplit.h:142
Base class for split operation generating image y strips 2d associated to a kernel.
Definition: BaseImageYStrip2dWithKernelSplit.h:39