IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
ImageYSubStrip2dSplit.h
1 // ImageYSubStrip2dSplit.h:
3 // ---------------------
4 //
14 
15 #ifndef __IPSDKIMAGEPROCESSING_IMAGEYSUBSTRIP2DSPLIT_H__
16 #define __IPSDKIMAGEPROCESSING_IMAGEYSUBSTRIP2DSPLIT_H__
17 
18 #include <IPSDKImageProcessing/DataSplit/Strip/YSubStrip2d/BaseImageYSubStrip2dSplit.h>
19 
20 namespace ipsdk {
21 namespace imaproc {
22 
25 
26 template <typename TProcessor, typename InputDataType, typename TAttribute>
27 class ImageYSubStrip2dSplit : public BaseImageYSubStrip2dSplit<InputDataType,
28  typename TAttribute::ValueType>
29 {
30 // predefined public types
31 public:
33  typedef TProcessor ProcessorType;
34 
36  typedef TAttribute AttributeType;
37 
39  typedef typename TAttribute::ValueType OutputType;
40 
41 public:
47 
48 // methods
49 public:
51  const std::string& getAttributeName() const;
52 
54  const std::string& getAttributeToolTip() const;
55 
61  void init(const boost::shared_ptr<InputDataType>& pImage,
62  const image::eStripAllocationType& stripAllocationType,
63  ipUInt64 yOffset,
64  ipUInt64 nbRows);
65 
66 protected:
68  bool checkProcessorType(const processor::BaseProcessor& processor);
69 
74  const boost::shared_ptr<OutputType>& pImageYStrip2d);
75 
76 // attributes
77 protected:
78 
79 };
80 
83 
84 template <typename TProcessor, typename InputDataType, typename TAttribute>
85 inline const std::string&
87 {
88  return TAttribute::getObjectNameStr();
89 }
90 
91 template <typename TProcessor, typename InputDataType, typename TAttribute>
92 inline const std::string&
94 {
95  return TAttribute::getToolTipStr();
96 }
97 
98 template <typename TProcessor, typename InputDataType, typename TAttribute>
99 inline void
100 ImageYSubStrip2dSplit<TProcessor, InputDataType, TAttribute>::init(const boost::shared_ptr<InputDataType>& pImage,
101  const image::eStripAllocationType& stripAllocationType,
102  ipUInt64 yOffset,
103  ipUInt64 nbRows)
104 {
105  // call of base class initialization method
106  this->initBase(pImage, stripAllocationType, yOffset, nbRows);
107 }
108 
109 template <typename TProcessor, typename InputDataType, typename TAttribute>
110 inline bool
112 {
113  // check for consistency between processor and attribute
115  "This attribute is not part of processor class");
116 
117  return dynamic_cast<const TProcessor*>(&processor) != 0;
118 }
119 
120 template <typename TProcessor, typename InputDataType, typename TAttribute>
121 inline BoolResult
123  const boost::shared_ptr<OutputType>& pImageYStrip2d)
124 {
125  // cast of input processor object
126  TProcessor& tProcessor = static_cast<TProcessor&>(processor);
127 
128  // update of processor attribute value
129  tProcessor.TProcessor::template set<TAttribute>(pImageYStrip2d);
130 
131  return true;
132 }
133 
136 
137 } // end of namespace imaproc
138 } // end of namespace ipsdk
139 
140 #endif // __IPSDKIMAGEPROCESSING_IMAGEYSUBSTRIP2DSPLIT_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
TAttribute::ValueType OutputType
output data type for split operation
Definition: ImageYSubStrip2dSplit.h:39
uint64_t ipUInt64
Base types definition.
Definition: BaseTypes.h:55
BoolResult processAttribute(processor::BaseProcessor &processor, const boost::shared_ptr< OutputType > &pImageYStrip2d)
initialize processor attribute associate to split operation for a given element index ...
Definition: ImageYSubStrip2dSplit.h:122
TAttribute AttributeType
attribute type associated to object
Definition: ImageYSubStrip2dSplit.h:36
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
void init(const boost::shared_ptr< InputDataType > &pImage, const image::eStripAllocationType &stripAllocationType, ipUInt64 yOffset, ipUInt64 nbRows)
initialization method for splitted objects
Definition: ImageYSubStrip2dSplit.h:100
Base class for split operation generating image y strips 2d from a subset of contiguous rows...
Definition: BaseImageYSubStrip2dSplit.h:33
const std::string & getAttributeName() const
retrieve attribute name associated to split operation
Definition: ImageYSubStrip2dSplit.h:86
TProcessor ProcessorType
processor type associated to object
Definition: ImageYSubStrip2dSplit.h:33
bool checkProcessorType(const processor::BaseProcessor &processor)
check processor type in derived class
Definition: ImageYSubStrip2dSplit.h:111
const std::string & getAttributeToolTip() const
retrieve attribute tooltip associated to split operation
Definition: ImageYSubStrip2dSplit.h:93
Concrete class for split operation generating image y strips 2d from a subset of contiguous rows...
Definition: ImageYSubStrip2dSplit.h:27