IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
BaseLineXStrip2dParser.h
1 // BaseLineXStrip2dParser.h:
3 // -------------------------
4 //
14 
15 #ifndef __IPSDKIMAGEPROCESSING_BASELINEXSTRIP2DPARSER_H__
16 #define __IPSDKIMAGEPROCESSING_BASELINEXSTRIP2DPARSER_H__
17 
18 // suppression warnings
19 // warning C4251: 'ipsdk::imaproc::BaseLineXStrip2dParser<BaseStripAttributeClassType>::_pImageXStrip2d' : class 'boost::shared_ptr<T>' needs to have dll-interface to be used by clients of class 'ipsdk::imaproc::BaseLineXStrip2dParser<BaseStripAttributeClassType>'
20 #pragma warning (push)
21 #pragma warning (disable : 4251)
22 
24 #include <IPSDKImageProcessing/Algorithm/Parser/Strip/BaseStripParser.h>
25 #include <IPSDKImage/Fragment/Strip/XStrip2d/BaseImageXStrip2d.h>
26 #include <boost/mpl/not_equal_to.hpp>
27 #include <boost/mpl/int.hpp>
28 #include <boost/mpl/if.hpp>
29 
30 namespace ipsdk {
31 namespace imaproc {
32 
35 
36 template <typename BaseStripAttributeClassType>
38 {
39 // predefined public types
40 public:
42  static const eIOStatus::domain g_attributeIO = BaseStripAttributeClassType::g_dataIOStatus;
43 
45  typedef typename BaseStripAttributeClassType::ValueType ValueType;
46 
48  typedef typename BaseStripAttributeClassType::StorageType StorageType;
49 
50 public:
54  virtual ~BaseLineXStrip2dParser() = 0;
56 
57 // methods
58 public:
60  {
62  }
63 
69  void init(const StorageType& pImageXStrip2d);
70 
75  ipUInt64 getBufferSize() const;
76 
81  template <typename T>
82  typename boost::enable_if<typename boost::mpl::not_equal_to<boost::mpl::int_<g_attributeIO>,
83  boost::mpl::int_<eIOStatus::eIOS_Output> >::type,
84  const T*>::type
85  getBuffer() const
86  {
87  return static_cast<const T*>(accessBuffer());
88  }
89  template <typename T>
90  typename boost::enable_if<typename boost::mpl::not_equal_to<boost::mpl::int_<g_attributeIO>,
91  boost::mpl::int_<eIOStatus::eIOS_Input> >::type,
92  T*>::type
94  {
95  return static_cast<T*>(accessBuffer());
96  }
98 
99 private:
104  const void* accessBuffer() const;
105  void* accessBuffer();
107 
109  void updateToInitDataDerived();
110 
112  void updateToMainDataDerived();
113 
115  void updateToFinalDataDerived();
116 
118  void clearDerived();
119 
120 // attributes
121 protected:
124 
127 
130 
133 
136 
139 
142 
145 
148 };
149 
152 
153 } // end of namespace imaproc
154 } // end of namespace ipsdk
155 
156 #pragma warning (pop)
157 
158 #endif // __IPSDKIMAGEPROCESSING_BASELINEXSTRIP2DPARSER_H__
X strip 2d parser allowing line by line strip parsing.
Definition: StripParserTypes.h:32
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
Base class for x strip 2d parsed line by line.
Definition: BaseLineXStrip2dParser.h:37
ipUInt64 _sizeY
image size along Y axis
Definition: BaseLineXStrip2dParser.h:129
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
retrieve buffer associated to current operation
Definition: BaseLineXStrip2dParser.h:85
uint64_t ipUInt64
Base types definition.
Definition: BaseTypes.h:55
BaseStripAttributeClassType::StorageType StorageType
storage type associated to object
Definition: BaseLineXStrip2dParser.h:48
eStripParserType
Enumerate describing strip parser type.
Definition: StripParserTypes.h:30
eStripParserType getStripParserType() const
retrieve strip parser type
Definition: BaseLineXStrip2dParser.h:59
HybridBufferPtr _pCurDataBuffer
buffer used to store data currently processed
Definition: BaseLineXStrip2dParser.h:138
HybridBufferPtr _pFinalDataBuffer
buffer used to store final data to process
Definition: BaseLineXStrip2dParser.h:147
Definition of import/export macro for library.
HybridBufferPtr _pMainDataBuffer
buffer used to store main data to process
Definition: BaseLineXStrip2dParser.h:144
#define IPSDKIMAGEPROCESSING_API
Import/Export macro for library IPSDKImageProcessing.
Definition: IPSDKImageProcessingExports.h:25
eDataType
Enumerate describing a base type.
Definition: BaseTypes.h:77
BaseStripAttributeClassType::ValueType ValueType
value type associated to object
Definition: BaseLineXStrip2dParser.h:45
eDataType _dataType
base data buffer type associated to input strips
Definition: BaseLineXStrip2dParser.h:135
ipUInt64 _stripSizeX
strip size along X axis
Definition: BaseLineXStrip2dParser.h:132
eStripParsingDirection
Enumerate describing strip parsing direction.
Definition: ImageStripTypes.h:72
Base class for objects allowing to parse strip attribute data.
Definition: BaseStripParser.h:27
boost::enable_if< typename boost::mpl::not_equal_to< boost::mpl::int_< g_attributeIO >, boost::mpl::int_< eIOStatus::eIOS_Input > >::type, T * >::type getBuffer()
retrieve buffer associated to current operation
Definition: BaseLineXStrip2dParser.h:93
StorageType _pImageXStrip2d
shared pointer to x strip 2d
Definition: BaseLineXStrip2dParser.h:123
boost::shared_ptr< HybridBuffer > HybridBufferPtr
shared pointer to HybridBuffer
Definition: BufferTypes.h:64
image::eStripParsingDirection _stripParsingDirection
strip parsing direction
Definition: BaseLineXStrip2dParser.h:126
HybridBufferPtr _pInitialDataBuffer
buffer used to store initial data to process
Definition: BaseLineXStrip2dParser.h:141