IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
BaseLineYStripSeq2dParser.h
1 // BaseLineYStripSeq2dParser.h:
3 // ---------------------------
4 //
14 
15 #ifndef __IPSDKIMAGEPROCESSING_BASELINEYSTRIPSEQ2DPARSER_H__
16 #define __IPSDKIMAGEPROCESSING_BASELINEYSTRIPSEQ2DPARSER_H__
17 
18 // suppression warnings
19 // warning C4251: 'ipsdk::imaproc::BaseLineYStripSeq2dParser<BaseStripAttributeClassType>::_pImageYStripSeq2d' : class 'boost::shared_ptr<T>' needs to have dll-interface to be used by clients of class 'ipsdk::imaproc::BaseLineYStripSeq2dParser<BaseStripAttributeClassType>'
20 #pragma warning (push)
21 #pragma warning (disable : 4251)
22 
24 #include <IPSDKImageProcessing/Algorithm/Parser/Strip/BaseStripParser.h>
25 #include <IPSDKImage/Fragment/Strip/YStripSeq2d/BaseImageYStripSeq2d.h>
26 #include <boost/shared_ptr.hpp>
27 #include <boost/mpl/equal_to.hpp>
28 #include <boost/mpl/not_equal_to.hpp>
29 #include <boost/mpl/int.hpp>
30 #include <boost/mpl/if.hpp>
31 
32 namespace ipsdk {
33 namespace imaproc {
34 
35 class BaseInputYStrip2dAttribute;
36 class BaseInOutYStrip2dAttribute;
37 class BaseOutputYStrip2dAttribute;
38 
41 
42 template <typename BaseStripAttributeClassType>
44 {
45 
46 // predefined public types
47 public:
49  static const eIOStatus::domain g_attributeIO = BaseStripAttributeClassType::g_dataIOStatus;
50 
52  typedef BaseStripAttributeClassType BaseStripAttributeClass;
53 
55  typedef typename BaseStripAttributeClassType::ValueType ValueType;
56 
58  typedef typename BaseStripAttributeClassType::StorageType StorageType;
59 
61  typedef typename boost::mpl::if_<typename boost::mpl::equal_to<boost::mpl::int_<g_attributeIO>,
62  boost::mpl::int_<eIOStatus::eIOS_Input> >::type,
64  typename boost::mpl::if_<typename boost::mpl::equal_to<boost::mpl::int_<g_attributeIO>,
65  boost::mpl::int_<eIOStatus::eIOS_Output> >::type,
69 
70 public:
74  virtual ~BaseLineYStripSeq2dParser() = 0;
76 
77 // methods
78 public:
81  {
83  }
84 
90  void init(const StorageType& pImageYStripSeq2d);
91 
96  virtual ipUInt64 getBufferSize() const = 0;
97 
101  ipUInt64 getSizeT() const;
102 
109  template <typename T>
110  typename boost::enable_if<typename boost::mpl::not_equal_to<boost::mpl::int_<g_attributeIO>,
111  boost::mpl::int_<eIOStatus::eIOS_Output> >::type,
112  const T*>::type
113  getBuffer(const ipUInt64 tPlanIdx) const
114  {
115  return static_cast<const T*>(accessBuffer(tPlanIdx));
116  }
117  template <typename T>
118  typename boost::enable_if<typename boost::mpl::not_equal_to<boost::mpl::int_<g_attributeIO>,
119  boost::mpl::int_<eIOStatus::eIOS_Input> >::type,
120  T*>::type
121  getBuffer(const ipUInt64 tPlanIdx)
122  {
123  return static_cast<T*>(accessBuffer(tPlanIdx));
124  }
126 
127 protected:
134  virtual const void* accessBuffer(const ipUInt64 cPlanIdx) const = 0;
135  virtual void* accessBuffer(const ipUInt64 cPlanIdx) = 0;
137 
139  virtual void clearDerived();
140 
141 // attributes
142 protected:
145 };
146 
149 
150 } // end of namespace imaproc
151 } // end of namespace ipsdk
152 
153 #pragma warning (pop)
154 
155 #endif // __IPSDKIMAGEPROCESSING_BASELINEYSTRIPSEQ2DPARSER_H__
boost::enable_if< typename boost::mpl::not_equal_to< boost::mpl::int_< g_attributeIO >, boost::mpl::int_< eIOStatus::eIOS_Output > >::type, const T * >::type getBuffer(const ipUInt64 tPlanIdx) const
retrieve buffer associated to current operation
Definition: BaseLineYStripSeq2dParser.h:113
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
BaseStripAttributeClassType::ValueType ValueType
value type associated to object
Definition: BaseLineYStripSeq2dParser.h:55
BaseStripAttributeClassType BaseStripAttributeClass
base attribute class associated to object
Definition: BaseLineYStripSeq2dParser.h:52
uint64_t ipUInt64
Base types definition.
Definition: BaseTypes.h:55
eStripParserType getStripParserType() const
retrieve strip parser type
Definition: BaseLineYStripSeq2dParser.h:80
boost::mpl::if_< typename boost::mpl::equal_to< boost::mpl::int_< g_attributeIO >, boost::mpl::int_< eIOStatus::eIOS_Input > >::type, BaseInputYStrip2dAttribute, typename boost::mpl::if_< typename boost::mpl::equal_to< boost::mpl::int_< g_attributeIO >, boost::mpl::int_< eIOStatus::eIOS_Output > >::type, BaseOutputYStrip2dAttribute, BaseInOutYStrip2dAttribute >::type >::type YStrip2dAttributeType
associated y strip 2d attribute
Definition: BaseLineYStripSeq2dParser.h:68
eStripParserType
Enumerate describing strip parser type.
Definition: StripParserTypes.h:30
Base class for input image 2d strip with splitting along Y axis attributes.
Definition: BaseInputYStrip2dAttribute.h:32
Definition of import/export macro for library.
#define IPSDKIMAGEPROCESSING_API
Import/Export macro for library IPSDKImageProcessing.
Definition: IPSDKImageProcessingExports.h:25
BaseStripAttributeClassType::StorageType StorageType
storage type associated to object
Definition: BaseLineYStripSeq2dParser.h:58
StorageType _pImageYStripSeq2d
shared pointer to y strip sequence 2d
Definition: BaseLineYStripSeq2dParser.h:144
Base class for input and output image 2d strip with splitting along Y axis attributes.
Definition: BaseInOutYStrip2dAttribute.h:32
Base class for output image 2d strip with splitting along Y axis attributes.
Definition: BaseOutputYStrip2dAttribute.h:32
Base class for sequence y strip 2d parsing line by line.
Definition: BaseLineYStripSeq2dParser.h:43
Base class for objects allowing to parse strip attribute data.
Definition: BaseStripParser.h:27
Y strip sequence 2d parser allowing line by line strip parsing.
Definition: StripParserTypes.h:42
boost::enable_if< typename boost::mpl::not_equal_to< boost::mpl::int_< g_attributeIO >, boost::mpl::int_< eIOStatus::eIOS_Input > >::type, T * >::type getBuffer(const ipUInt64 tPlanIdx)
retrieve buffer associated to current operation
Definition: BaseLineYStripSeq2dParser.h:121