IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
ImageYStripColor2dSplit.h
1 // ImageYStripColor2dSplit.h:
3 // --------------------------
4 //
14 
15 #ifndef __IPSDKIMAGEPROCESSING_IMAGEYSTRIPCOLOR2DSPLIT_H__
16 #define __IPSDKIMAGEPROCESSING_IMAGEYSTRIPCOLOR2DSPLIT_H__
17 
18 #include <IPSDKImageProcessing/DataSplit/Strip/YStripColor2d/BaseImageYStripColor2dSplit.h>
19 
20 namespace ipsdk {
21 namespace imaproc {
22 
25 
26 template <typename TProcessor, typename InputDataType, typename TAttribute>
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  const image::eStripParsingDirection& stripParsingDirection,
64  const bool bAllowGreyColorGeometry);
65 
66 protected:
68  bool checkProcessorType(const processor::BaseProcessor& processor);
69 
74  const boost::shared_ptr<OutputType>& pImageYStripColor2d);
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 ImageYStripColor2dSplit<TProcessor, InputDataType, TAttribute>::init(const boost::shared_ptr<InputDataType>& pImage,
101  const image::eStripAllocationType& stripAllocationType,
102  const image::eStripParsingDirection& stripParsingDirection,
103  const bool bAllowGreyColorGeometry)
104 {
105  // call of base class initialization method
106  this->initBase(pImage, stripAllocationType, stripParsingDirection, bAllowGreyColorGeometry);
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>& pImageYStripColor2d)
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>(pImageYStripColor2d);
130 
131  return true;
132 }
133 
136 
137 } // end of namespace imaproc
138 } // end of namespace ipsdk
139 
140 #endif // __IPSDKIMAGEPROCESSING_IMAGEYSTRIPCOLOR2DSPLIT_H__
Class allowing to encapsulate a typed process result associated to a string description.
Definition: ProcessingResult.h:28
Concrete class for split operation generating color image y strips 2d.
Definition: ImageYStripColor2dSplit.h:27
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, const bool bAllowGreyColorGeometry)
initialization method for splitted objects
Definition: ImageYStripColor2dSplit.h:100
Base class for split operation generating color image y strips 2d.
Definition: BaseImageYStripColor2dSplit.h:32
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::ValueType OutputType
output data type for split operation
Definition: ImageYStripColor2dSplit.h:39
bool checkProcessorType(const processor::BaseProcessor &processor)
check processor type in derived class
Definition: ImageYStripColor2dSplit.h:111
const std::string & getAttributeName() const
retrieve attribute name associated to split operation
Definition: ImageYStripColor2dSplit.h:86
TProcessor ProcessorType
processor type associated to object
Definition: ImageYStripColor2dSplit.h:33
eStripParsingDirection
Enumerate describing strip parsing direction.
Definition: ImageStripTypes.h:72
const std::string & getAttributeToolTip() const
retrieve attribute tooltip associated to split operation
Definition: ImageYStripColor2dSplit.h:93
BoolResult processAttribute(processor::BaseProcessor &processor, const boost::shared_ptr< OutputType > &pImageYStripColor2d)
initialize processor attribute associate to split operation for a given element index ...
Definition: ImageYStripColor2dSplit.h:122
TAttribute AttributeType
attribute type associated to object
Definition: ImageYStripColor2dSplit.h:36