IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
BaseRawYStrip2dParser.h
1 // BaseRawYStrip2dParser.h:
3 // ------------------------
4 //
14 
15 #ifndef __IPSDKIMAGEPROCESSING_BASERAWYSTRIP2DPARSER_H__
16 #define __IPSDKIMAGEPROCESSING_BASERAWYSTRIP2DPARSER_H__
17 
18 // suppression warnings
19 // warning C4251: 'ipsdk::imaproc::BaseRawYStrip2dParser<T>::_pImageYStrip2d' : class 'boost::shared_ptr<T>' needs to have dll-interface to be used by clients of class 'ipsdk::imaproc::BaseRawYStrip2dParser<T>'
20 #pragma warning (push)
21 #pragma warning (disable : 4251)
22 
23 #include <IPSDKImageProcessing/Algorithm/Parser/Strip/BaseStripParser.h>
24 #include <IPSDKImage/Fragment/Strip/YStrip2d/BaseImageYStrip2d.h>
25 #include <boost/mpl/not_equal_to.hpp>
26 #include <boost/mpl/int.hpp>
27 #include <boost/mpl/if.hpp>
28 
29 namespace ipsdk {
30 namespace imaproc {
31 
32 template <typename T, typename BaseStripAttributeClassType>
34 template <typename T, typename BaseStripAttributeClassType>
36 template <typename T, typename BaseStripAttributeClassType>
38 template <typename T, typename BaseStripAttributeClassType>
40 
43 
44 template <typename BaseStripAttributeClassType>
46 {
47  // friend class for protected members access
48  template <typename T, typename BaseStripAttributeClass>
50  template <typename T, typename BaseStripAttributeClass>
52  template <typename T, typename BaseStripAttributeClass>
53  friend class imaproc::RawYStripSeq2dParser;
54  template <typename T, typename BaseStripAttributeClass>
55  friend class imaproc::RawZStrip3dParser;
56 
57 // predefined public types
58 public:
60  static const eIOStatus::domain g_attributeIO = BaseStripAttributeClassType::g_dataIOStatus;
61 
63  typedef typename BaseStripAttributeClassType::ValueType ValueType;
64 
66  typedef typename BaseStripAttributeClassType::StorageType StorageType;
67 
68 public:
72  virtual ~BaseRawYStrip2dParser() = 0;
74 
75 // methods
76 public:
79  {
81  }
82 
88  void init(const StorageType& pImageYStrip2d);
89 
94  ipUInt64 getBufferSize() const;
95 
100  template <typename T>
101  typename boost::enable_if<typename boost::mpl::not_equal_to<boost::mpl::int_<g_attributeIO>,
102  boost::mpl::int_<eIOStatus::eIOS_Output> >::type,
103  const T*>::type
104  getBuffer() const
105  {
106  return static_cast<const T*>(accessBuffer());
107  }
108  template <typename T>
109  typename boost::enable_if<typename boost::mpl::not_equal_to<boost::mpl::int_<g_attributeIO>,
110  boost::mpl::int_<eIOStatus::eIOS_Input> >::type,
111  T*>::type
113  {
114  return static_cast<T*>(accessBuffer());
115  }
117 
118 protected:
123  const void* accessBuffer() const;
124  void* accessBuffer();
126 
127 private:
129  void updateToInitDataDerived();
130 
132  void updateToMainDataDerived();
133 
135  void updateToFinalDataDerived();
136 
141  virtual void updateImageYStrip2d(const StorageType& pImageYStrip2d) = 0;
142 
144  void clearDerived();
145 
146 // attributes
147 protected:
150 
153 
156 
159 
162 
165 };
166 
169 
170 } // end of namespace imaproc
171 } // end of namespace ipsdk
172 
173 #pragma warning (pop)
174 
175 #endif // __IPSDKIMAGEPROCESSING_BASERAWYSTRIP2DPARSER_H__
image::eStripParsingDirection _stripParsingDirection
strip parsing direction
Definition: BaseRawYStrip2dParser.h:152
HybridBufferPtr _pMainDataBuffer
buffer used to store main data to process
Definition: BaseRawYStrip2dParser.h:161
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
uint64_t ipUInt64
Base types definition.
Definition: BaseTypes.h:55
BaseStripAttributeClassType::StorageType StorageType
storage type associated to object
Definition: BaseRawYStrip2dParser.h:66
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: BaseRawYStrip2dParser.h:104
eStripParserType
Enumerate describing strip parser type.
Definition: StripParserTypes.h:30
Concrete class for raw user color y strip 2d parsing.
Definition: BaseRawYStrip2dParser.h:35
BaseStripAttributeClassType::ValueType ValueType
value type associated to object
Definition: BaseRawYStrip2dParser.h:63
HybridBufferPtr _pFinalDataBuffer
buffer used to store final data to process
Definition: BaseRawYStrip2dParser.h:164
eStripParserType getStripParserType() const
retrieve strip parser type
Definition: BaseRawYStrip2dParser.h:78
#define IPSDKIMAGEPROCESSING_API
Import/Export macro for library IPSDKImageProcessing.
Definition: IPSDKImageProcessingExports.h:25
Concrete class for raw z strip 3d parsing.
Definition: BaseRawYStrip2dParser.h:39
Concrete class for raw rgb color y strip 2d parsing.
Definition: BaseRawYStrip2dParser.h:33
eStripParsingDirection
Enumerate describing strip parsing direction.
Definition: ImageStripTypes.h:72
Y strip 2d parser allowing raw data parsing.
Definition: StripParserTypes.h:50
Concrete class for raw sequence y strip 2d parsing.
Definition: BaseRawYStrip2dParser.h:37
Base class for objects allowing to parse strip attribute data.
Definition: BaseStripParser.h:27
boost::shared_ptr< HybridBuffer > HybridBufferPtr
shared pointer to HybridBuffer
Definition: BufferTypes.h:64
HybridBufferPtr _pInitialDataBuffer
buffer used to store initial data to process
Definition: BaseRawYStrip2dParser.h:158
StorageType _pImageYStrip2d
shared pointer to y strip 2d
Definition: BaseRawYStrip2dParser.h:149
Base class for raw y strip 2d parsing.
Definition: BaseRawYStrip2dParser.h:45
HybridBufferPtr _pCurDataBuffer
buffer used to store data currently processed
Definition: BaseRawYStrip2dParser.h:155
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: BaseRawYStrip2dParser.h:112