IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
PreviousImageYStrip2dSplit.h
1 // PreviousImageYStrip2dSplit.h:
3 // -----------------------------
4 //
20 
21 #ifndef __IPSDKIMAGEPROCESSING_PREVIOUSIMAGEYSTRIP2DSPLIT_H__
22 #define __IPSDKIMAGEPROCESSING_PREVIOUSIMAGEYSTRIP2DSPLIT_H__
23 
24 #include <IPSDKImageProcessing/DataSplit/Strip/PreviousYStrip2d/BasePreviousImageYStrip2dSplit.h>
25 
26 namespace ipsdk {
27 namespace imaproc {
28 
31 
32 template <typename TProcessor, typename InputDataType, typename TAttribute>
34  typename TAttribute::ValueType>
35 {
36 // predefined public types
37 public:
39  typedef TProcessor ProcessorType;
40 
42  typedef TAttribute AttributeType;
43 
45  typedef typename TAttribute::ValueType OutputType;
46 
47 public:
53 
54 // methods
55 public:
57  const std::string& getAttributeName() const;
58 
60  const std::string& getAttributeToolTip() const;
61 
67  void init(const boost::shared_ptr<InputDataType>& pImage,
68  const image::eStripParsingDirection& stripParsingDirection);
69 
70 protected:
72  bool checkProcessorType(const processor::BaseProcessor& processor);
73 
78  const boost::shared_ptr<OutputType>& pImageYStrip2d);
79 
80 // attributes
81 protected:
82 
83 };
84 
87 
88 template <typename TProcessor, typename InputDataType, typename TAttribute>
89 inline const std::string&
91 {
92  return TAttribute::getObjectNameStr();
93 }
94 
95 template <typename TProcessor, typename InputDataType, typename TAttribute>
96 inline const std::string&
98 {
99  return TAttribute::getToolTipStr();
100 }
101 
102 template <typename TProcessor, typename InputDataType, typename TAttribute>
103 inline void
104 PreviousImageYStrip2dSplit<TProcessor, InputDataType, TAttribute>::init(const boost::shared_ptr<InputDataType>& pImage,
105  const image::eStripParsingDirection& stripParsingDirection)
106 {
107  // call of base class initialization method
108  this->initBase(pImage, stripParsingDirection);
109 }
110 
111 template <typename TProcessor, typename InputDataType, typename TAttribute>
112 inline bool
114 {
115  // check for consistency between processor and attribute
117  "This attribute is not part of processor class");
118 
119  return dynamic_cast<const TProcessor*>(&processor) != 0;
120 }
121 
122 template <typename TProcessor, typename InputDataType, typename TAttribute>
123 inline BoolResult
125  const boost::shared_ptr<OutputType>& pImageYStrip2d)
126 {
127  // cast of input processor object
128  TProcessor& tProcessor = static_cast<TProcessor&>(processor);
129 
130  // update of processor attribute value
131  tProcessor.TProcessor::template set<TAttribute>(pImageYStrip2d);
132 
133  return true;
134 }
135 
138 
139 } // end of namespace imaproc
140 } // end of namespace ipsdk
141 
142 #endif // __IPSDKIMAGEPROCESSING_PREVIOUSIMAGEYSTRIP2DSPLIT_H__
TAttribute AttributeType
attribute type associated to object
Definition: PreviousImageYStrip2dSplit.h:42
TAttribute::ValueType OutputType
output data type for split operation
Definition: PreviousImageYStrip2dSplit.h:45
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: PreviousImageYStrip2dSplit.h:113
BoolResult processAttribute(processor::BaseProcessor &processor, const boost::shared_ptr< OutputType > &pImageYStrip2d)
initialize processor attribute associate to split operation for a given element index ...
Definition: PreviousImageYStrip2dSplit.h:124
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
Concrete class for split operation allowing to generate y strips 2d :
Definition: PreviousImageYStrip2dSplit.h:33
TProcessor ProcessorType
processor type associated to object
Definition: PreviousImageYStrip2dSplit.h:39
void init(const boost::shared_ptr< InputDataType > &pImage, const image::eStripParsingDirection &stripParsingDirection)
initialization method for splitted objects
Definition: PreviousImageYStrip2dSplit.h:104
const std::string & getAttributeName() const
retrieve attribute name associated to split operation
Definition: PreviousImageYStrip2dSplit.h:90
eStripParsingDirection
Enumerate describing strip parsing direction.
Definition: ImageStripTypes.h:72
Base class for split operation allowing to generate y strips 2d :
Definition: BasePreviousImageYStrip2dSplit.h:40
const std::string & getAttributeToolTip() const
retrieve attribute tooltip associated to split operation
Definition: PreviousImageYStrip2dSplit.h:97