IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
ImageYStrip2dSplit.h
1 // ImageYStrip2dSplit.h:
3 // ---------------------
4 //
14 
15 #ifndef __IPSDKIMAGEPROCESSING_IMAGEYSTRIP2DSPLIT_H__
16 #define __IPSDKIMAGEPROCESSING_IMAGEYSTRIP2DSPLIT_H__
17 
18 #include <IPSDKImageProcessing/DataSplit/Strip/YStrip2d/BaseImageYStrip2dSplit.h>
19 
20 namespace ipsdk {
21 namespace imaproc {
22 
25 
26 template <typename TProcessor, typename InputDataType, typename TAttribute>
27 class ImageYStrip2dSplit : public BaseImageYStrip2dSplit<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:
45  ~ImageYStrip2dSplit() {}
47 
48 // methods
49 public:
51  const std::string& getAttributeName() const;
52 
54  const std::string& getAttributeToolTip() const;
55 
62  void init(const boost::shared_ptr<InputDataType>& pImage,
63  const image::eStripAllocationType& stripAllocationType,
64  const image::eStripParsingDirection& stripParsingDirection);
65  void init(const boost::shared_ptr<InputDataType>& pImage,
66  const image::eStripAllocationType& stripAllocationType,
67  const image::eStripParsingDirection& stripParsingDirection,
68  const image::eStripParsingDirection& lineParsingDirection);
70 
71 protected:
73  bool checkProcessorType(const processor::BaseProcessor& processor);
74 
79  const boost::shared_ptr<OutputType>& pImageYStrip2d);
80 
81 // attributes
82 protected:
83 
84 };
85 
88 
89 template <typename TProcessor, typename InputDataType, typename TAttribute>
90 inline const std::string&
92 {
93  return TAttribute::getObjectNameStr();
94 }
95 
96 template <typename TProcessor, typename InputDataType, typename TAttribute>
97 inline const std::string&
99 {
100  return TAttribute::getToolTipStr();
101 }
102 
103 template <typename TProcessor, typename InputDataType, typename TAttribute>
104 inline void
105 ImageYStrip2dSplit<TProcessor, InputDataType, TAttribute>::init(const boost::shared_ptr<InputDataType>& pImage,
106  const image::eStripAllocationType& stripAllocationType,
107  const image::eStripParsingDirection& stripParsingDirection)
108 {
109  // call of base class initialization method
110  this->initBase(pImage, stripAllocationType, stripParsingDirection);
111 }
112 
113 template <typename TProcessor, typename InputDataType, typename TAttribute>
114 inline void
115 ImageYStrip2dSplit<TProcessor, InputDataType, TAttribute>::init(const boost::shared_ptr<InputDataType>& pImage,
116  const image::eStripAllocationType& stripAllocationType,
117  const image::eStripParsingDirection& stripParsingDirection,
118  const image::eStripParsingDirection& lineParsingDirection)
119 {
120  // call of base class initialization method
121  this->initBase(pImage, stripAllocationType, stripParsingDirection, lineParsingDirection);
122 }
123 
124 template <typename TProcessor, typename InputDataType, typename TAttribute>
125 inline bool
127 {
128  // check for consistency between processor and attribute
130  "This attribute is not part of processor class");
131 
132  return dynamic_cast<const TProcessor*>(&processor) != 0;
133 }
134 
135 template <typename TProcessor, typename InputDataType, typename TAttribute>
136 inline BoolResult
138  const boost::shared_ptr<OutputType>& pImageYStrip2d)
139 {
140  // cast of input processor object
141  TProcessor& tProcessor = static_cast<TProcessor&>(processor);
142 
143  // update of processor attribute value
144  tProcessor.TProcessor::template set<TAttribute>(pImageYStrip2d);
145 
146  return true;
147 }
148 
151 
152 } // end of namespace imaproc
153 } // end of namespace ipsdk
154 
155 #endif // __IPSDKIMAGEPROCESSING_IMAGEYSTRIP2DSPLIT_H__
BoolResult processAttribute(processor::BaseProcessor &processor, const boost::shared_ptr< OutputType > &pImageYStrip2d)
initialize processor attribute associate to split operation for a given element index ...
Definition: ImageYStrip2dSplit.h:137
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
Concrete class for split operation generating image y strips 2d.
Definition: ImageYStrip2dSplit.h:27
void init(const boost::shared_ptr< InputDataType > &pImage, const image::eStripAllocationType &stripAllocationType, const image::eStripParsingDirection &stripParsingDirection)
initialization method for splitted objects
Definition: ImageYStrip2dSplit.h:105
const std::string & getAttributeName() const
retrieve attribute name associated to split operation
Definition: ImageYStrip2dSplit.h:91
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: ImageYStrip2dSplit.h:36
bool checkProcessorType(const processor::BaseProcessor &processor)
check processor type in derived class
Definition: ImageYStrip2dSplit.h:126
const std::string & getAttributeToolTip() const
retrieve attribute tooltip associated to split operation
Definition: ImageYStrip2dSplit.h:98
TProcessor ProcessorType
processor type associated to object
Definition: ImageYStrip2dSplit.h:33
eStripParsingDirection
Enumerate describing strip parsing direction.
Definition: ImageStripTypes.h:72
TAttribute::ValueType OutputType
output data type for split operation
Definition: ImageYStrip2dSplit.h:39
Base class for split operation generating image y strips 2d.
Definition: BaseImageYStrip2dSplit.h:32