IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
ImageYStripSeq2dSplit.h
1 // ImageYStripSeq2dSplit.h:
3 // ------------------------
4 //
15 
16 #ifndef __IPSDKIMAGEPROCESSING_IMAGEYSTRIPSEQ2DSPLIT_H__
17 #define __IPSDKIMAGEPROCESSING_IMAGEYSTRIPSEQ2DSPLIT_H__
18 
19 #include <IPSDKImageProcessing/DataSplit/Strip/YStripSeq2d/BaseImageYStripSeq2dSplit.h>
20 
21 namespace ipsdk {
22 namespace imaproc {
23 
26 
27 template <typename TProcessor, typename InputDataType, typename TAttribute>
28 class ImageYStripSeq2dSplit : public BaseImageYStripSeq2dSplit<InputDataType,
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 
62  void init(const boost::shared_ptr<InputDataType>& pImage,
63  const image::eStripAllocationType& stripAllocationType,
64  const image::eStripParsingDirection& stripParsingDirection);
65 
66 protected:
68  bool checkProcessorType(const processor::BaseProcessor& processor);
69 
74  const boost::shared_ptr<OutputType>& pImageYStripSeq2d);
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 ImageYStripSeq2dSplit<TProcessor, InputDataType, TAttribute>::init(const boost::shared_ptr<InputDataType>& pImage,
101  const image::eStripAllocationType& stripAllocationType,
102  const image::eStripParsingDirection& stripParsingDirection)
103 {
104  // call of base class initialization method
105  this->initBase(pImage, stripAllocationType, stripParsingDirection);
106 }
107 
108 template <typename TProcessor, typename InputDataType, typename TAttribute>
109 inline bool
111 {
112  // check for consistency between processor and attribute
114  "This attribute is not part of processor class");
115 
116  return dynamic_cast<const TProcessor*>(&processor) != 0;
117 }
118 
119 template <typename TProcessor, typename InputDataType, typename TAttribute>
120 inline BoolResult
122  const boost::shared_ptr<OutputType>& pImageYStripSeq2d)
123 {
124  // cast of input processor object
125  TProcessor& tProcessor = static_cast<TProcessor&>(processor);
126 
127  // update of processor attribute value
128  tProcessor.TProcessor::template set<TAttribute>(pImageYStripSeq2d);
129 
130  return true;
131 }
132 
135 
136 } // end of namespace imaproc
137 } // end of namespace ipsdk
138 
139 #endif // __IPSDKIMAGEPROCESSING_IMAGEYSTRIPSEQ2DSPLIT_H__
TAttribute::ValueType OutputType
output data type for split operation
Definition: ImageYStripSeq2dSplit.h:40
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
void init(const boost::shared_ptr< InputDataType > &pImage, const image::eStripAllocationType &stripAllocationType, const image::eStripParsingDirection &stripParsingDirection)
initialization method for splitted objects
Definition: ImageYStripSeq2dSplit.h:100
Base class for split operation generating sequence image y strips 2d.
Definition: BaseImageYStripSeq2dSplit.h:33
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
TAttribute AttributeType
attribute type associated to object
Definition: ImageYStripSeq2dSplit.h:37
BoolResult processAttribute(processor::BaseProcessor &processor, const boost::shared_ptr< OutputType > &pImageYStripSeq2d)
initialize processor attribute associate to split operation for a given element index ...
Definition: ImageYStripSeq2dSplit.h:121
Concrete class for split operation generating sequence image y strips 2d.
Definition: ImageYStripSeq2dSplit.h:28
const std::string & getAttributeName() const
retrieve attribute name associated to split operation
Definition: ImageYStripSeq2dSplit.h:86
const std::string & getAttributeToolTip() const
retrieve attribute tooltip associated to split operation
Definition: ImageYStripSeq2dSplit.h:93
eStripParsingDirection
Enumerate describing strip parsing direction.
Definition: ImageStripTypes.h:72
TProcessor ProcessorType
processor type associated to object
Definition: ImageYStripSeq2dSplit.h:34
bool checkProcessorType(const processor::BaseProcessor &processor)
check processor type in derived class
Definition: ImageYStripSeq2dSplit.h:110