IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
BaseLineYStrip2dParser.h
1 // BaseLineYStrip2dParser.h:
3 // -------------------------
4 //
14 
15 #ifndef __IPSDKIMAGEPROCESSING_BASELINEYSTRIP2DPARSER_H__
16 #define __IPSDKIMAGEPROCESSING_BASELINEYSTRIP2DPARSER_H__
17 
18 // suppression warnings
19 // warning C4251: 'ipsdk::imaproc::BaseLineYStrip2dParser<BaseStripAttributeClassType>::_pImageYStrip2d' : class 'boost::shared_ptr<T>' needs to have dll-interface to be used by clients of class 'ipsdk::imaproc::BaseLineYStrip2dParser<BaseStripAttributeClassType>'
20 #pragma warning (push)
21 #pragma warning (disable : 4251)
22 
24 #include <IPSDKImageProcessing/Algorithm/Parser/Strip/BaseStripParser.h>
25 #include <IPSDKImage/Fragment/Strip/YStrip2d/BaseImageYStrip2d.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 
33 template <typename T, typename BaseStripAttributeClassType>
35 template <typename T, typename BaseStripAttributeClassType>
37 template <typename T, typename BaseStripAttributeClassType>
39 
42 
43 template <typename BaseStripAttributeClassType>
45 {
46  // friend class for protected members access
47  template <typename T, typename BaseStripAttributeClass>
48  friend class LineYStripUserColor2dParser;
49  template <typename T, typename BaseStripAttributeClass>
50  friend class LineYStripRgbColor2dParser;
51  template <typename T, typename BaseStripAttributeClass>
52  friend class LineYStripSeq2dParser;
53  template <typename T, typename BaseStripAttributeClass>
54  friend class LineZStrip3dParser;
55 
56 // predefined public types
57 public:
59  static const eIOStatus::domain g_attributeIO = BaseStripAttributeClassType::g_dataIOStatus;
60 
62  typedef BaseStripAttributeClassType BaseStripAttributeClass;
63 
65  typedef typename BaseStripAttributeClassType::ValueType ValueType;
66 
68  typedef typename BaseStripAttributeClassType::StorageType StorageType;
69 
70 public:
74  virtual ~BaseLineYStrip2dParser() = 0;
76 
77 // methods
78 public:
81  {
83  }
84 
90  void init(const StorageType& pImageYStrip2d);
91 
96  ipUInt64 getBufferSize() const;
97 
102  template <typename T>
103  typename boost::enable_if<typename boost::mpl::not_equal_to<boost::mpl::int_<g_attributeIO>,
104  boost::mpl::int_<eIOStatus::eIOS_Output> >::type,
105  const T*>::type
106  getBuffer() const
107  {
108  return static_cast<const T*>(accessBuffer());
109  }
110  template <typename T>
111  typename boost::enable_if<typename boost::mpl::not_equal_to<boost::mpl::int_<g_attributeIO>,
112  boost::mpl::int_<eIOStatus::eIOS_Input> >::type,
113  T*>::type
115  {
116  return static_cast<T*>(accessBuffer());
117  }
119 
120 private:
125  const void* accessBuffer() const;
126  void* accessBuffer();
128 
130  void updateToInitDataDerived();
131 
133  void updateToMainDataDerived();
134 
136  void updateToFinalDataDerived();
137 
142  void updateImageYStrip2d(const StorageType& pImageYStrip2d);
143 
145  void clearDerived();
146 
147 // attributes
148 protected:
151 
154 
157 
160 
163 
166 
169 
172 
175 
178 };
179 
182 
183 } // end of namespace imaproc
184 } // end of namespace ipsdk
185 
186 #pragma warning (pop)
187 
188 #endif // __IPSDKIMAGEPROCESSING_BASELINEYSTRIP2DPARSER_H__
HybridBufferPtr _pCurDataBuffer
buffer used to store data currently processed
Definition: BaseLineYStrip2dParser.h:168
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
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: BaseLineYStrip2dParser.h:106
HybridBufferPtr _pMainDataBuffer
buffer used to store main data to process
Definition: BaseLineYStrip2dParser.h:174
uint64_t ipUInt64
Base types definition.
Definition: BaseTypes.h:55
ipUInt64 _sizeX
image size along X axis
Definition: BaseLineYStrip2dParser.h:159
BaseStripAttributeClassType BaseStripAttributeClass
base attribute class associated to object
Definition: BaseLineYStrip2dParser.h:62
BaseStripAttributeClassType::StorageType StorageType
storage type associated to object
Definition: BaseLineYStrip2dParser.h:68
eStripParserType
Enumerate describing strip parser type.
Definition: StripParserTypes.h:30
Definition of import/export macro for library.
Base class for y strip 2d parsed line by line.
Definition: BaseLineYStrip2dParser.h:44
HybridBufferPtr _pFinalDataBuffer
buffer used to store final data to process
Definition: BaseLineYStrip2dParser.h:177
image::eStripParsingDirection _lineParsingDirection
line parsing direction (along X)
Definition: BaseLineYStrip2dParser.h:156
#define IPSDKIMAGEPROCESSING_API
Import/Export macro for library IPSDKImageProcessing.
Definition: IPSDKImageProcessingExports.h:25
StorageType _pImageYStrip2d
shared pointer to y strip 2d
Definition: BaseLineYStrip2dParser.h:150
eDataType
Enumerate describing a base type.
Definition: BaseTypes.h:77
Concrete class for line user color y strip 2d parsing.
Definition: BaseLineYStrip2dParser.h:34
Concrete class for sequence y strip 2d parsing line by line.
Definition: LineYStripSeq2dParser.h:35
image::eStripParsingDirection _stripParsingDirection
strip parsing direction (along Y)
Definition: BaseLineYStrip2dParser.h:153
HybridBufferPtr _pInitialDataBuffer
buffer used to store initial data to process
Definition: BaseLineYStrip2dParser.h:171
Concrete class for z strip 3d parsed line by line.
Definition: BaseLineYStrip2dParser.h:38
eStripParsingDirection
Enumerate describing strip parsing direction.
Definition: ImageStripTypes.h:72
ipUInt64 _stripSizeY
strip size along Y axis
Definition: BaseLineYStrip2dParser.h:162
Base class for objects allowing to parse strip attribute data.
Definition: BaseStripParser.h:27
eDataType _dataType
base data buffer type associated to input strips
Definition: BaseLineYStrip2dParser.h:165
boost::shared_ptr< HybridBuffer > HybridBufferPtr
shared pointer to HybridBuffer
Definition: BufferTypes.h:64
Concrete class for line rgb color y strip 2d parsing.
Definition: BaseLineYStrip2dParser.h:36
BaseStripAttributeClassType::ValueType ValueType
value type associated to object
Definition: BaseLineYStrip2dParser.h:65
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: BaseLineYStrip2dParser.h:114
eStripParserType getStripParserType() const
retrieve strip parser type
Definition: BaseLineYStrip2dParser.h:80
Y strip 2d parser allowing line by line strip parsing.
Definition: StripParserTypes.h:36