IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
BaseRawYStripSeq2dParser.h
1 // BaseRawYStripSeq2dParser.h:
3 // ---------------------------
4 //
14 
15 #ifndef __IPSDKIMAGEPROCESSING_BASERAWYSTRIPSEQ2DPARSER_H__
16 #define __IPSDKIMAGEPROCESSING_BASERAWYSTRIPSEQ2DPARSER_H__
17 
18 // suppression warnings
19 // warning C4251: 'ipsdk::imaproc::BaseRawYStripSeq2dParser<BaseStripAttributeClassType>::_pImageYStripSeq2d' : class 'boost::shared_ptr<T>' needs to have dll-interface to be used by clients of class 'ipsdk::imaproc::BaseRawYStripSeq2dParser<BaseStripAttributeClassType>'
20 #pragma warning (push)
21 #pragma warning (disable : 4251)
22 
23 #include <IPSDKImageProcessing/Algorithm/Parser/Strip/BaseStripParser.h>
24 #include <IPSDKImage/Fragment/Strip/YStripSeq2d/BaseImageYStripSeq2d.h>
25 #include <boost/shared_ptr.hpp>
26 #include <boost/mpl/equal_to.hpp>
27 #include <boost/mpl/not_equal_to.hpp>
28 #include <boost/mpl/int.hpp>
29 #include <boost/mpl/if.hpp>
30 
31 namespace ipsdk {
32 namespace imaproc {
33 
34 class BaseInputYStrip2dAttribute;
35 class BaseInOutYStrip2dAttribute;
36 class BaseOutputYStrip2dAttribute;
37 
40 
41 template <typename BaseStripAttributeClassType>
43 {
44 // predefined public types
45 public:
47  static const eIOStatus::domain g_attributeIO = BaseStripAttributeClassType::g_dataIOStatus;
48 
50  typedef typename BaseStripAttributeClassType::ValueType ValueType;
51 
53  typedef typename BaseStripAttributeClassType::StorageType StorageType;
54 
56  typedef typename boost::mpl::if_<typename boost::mpl::equal_to<boost::mpl::int_<g_attributeIO>,
57  boost::mpl::int_<eIOStatus::eIOS_Input> >::type,
59  typename boost::mpl::if_<typename boost::mpl::equal_to<boost::mpl::int_<g_attributeIO>,
60  boost::mpl::int_<eIOStatus::eIOS_Output> >::type,
64 
65 public:
69  virtual ~BaseRawYStripSeq2dParser() = 0;
71 
72 // methods
73 public:
76  {
78  }
79 
85  void init(const StorageType& pImageYStripSeq2d);
86 
91  virtual ipUInt64 getBufferSize() const = 0;
92 
96  ipUInt64 getSizeT() const;
97 
104  template <typename T>
105  typename boost::enable_if<typename boost::mpl::not_equal_to<boost::mpl::int_<g_attributeIO>,
106  boost::mpl::int_<eIOStatus::eIOS_Output> >::type,
107  const T*>::type
108  getBuffer(const ipUInt64 tPlanIdx) const
109  {
110  return static_cast<const T*>(accessBuffer(tPlanIdx));
111  }
112  template <typename T>
113  typename boost::enable_if<typename boost::mpl::not_equal_to<boost::mpl::int_<g_attributeIO>,
114  boost::mpl::int_<eIOStatus::eIOS_Input> >::type,
115  T*>::type
116  getBuffer(const ipUInt64 tPlanIdx)
117  {
118  return static_cast<T*>(accessBuffer(tPlanIdx));
119  }
121 
122 protected:
129  virtual const void* accessBuffer(const ipUInt64 cPlanIdx) const = 0;
130  virtual void* accessBuffer(const ipUInt64 cPlanIdx) = 0;
132 
134  virtual void clearDerived();
135 
136 // attributes
137 protected:
140 };
141 
144 
145 } // end of namespace imaproc
146 } // end of namespace ipsdk
147 
148 #pragma warning (pop)
149 
150 #endif // __IPSDKIMAGEPROCESSING_BASERAWYSTRIPSEQ2DPARSER_H__
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
uint64_t ipUInt64
Base types definition.
Definition: BaseTypes.h:55
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
Y strip sequence 2d parser allowing raw data parsing.
Definition: StripParserTypes.h:54
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: BaseRawYStripSeq2dParser.h:108
#define IPSDKIMAGEPROCESSING_API
Import/Export macro for library IPSDKImageProcessing.
Definition: IPSDKImageProcessingExports.h:25
Base class for raw sequence y strip 2d parsing.
Definition: BaseRawYStripSeq2dParser.h:42
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: BaseRawYStripSeq2dParser.h:63
Base class for input and output image 2d strip with splitting along Y axis attributes.
Definition: BaseInOutYStrip2dAttribute.h:32
BaseStripAttributeClassType::StorageType StorageType
storage type associated to object
Definition: BaseRawYStripSeq2dParser.h:53
Base class for output image 2d strip with splitting along Y axis attributes.
Definition: BaseOutputYStrip2dAttribute.h:32
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(const ipUInt64 tPlanIdx)
retrieve buffer associated to current operation
Definition: BaseRawYStripSeq2dParser.h:116
eStripParserType getStripParserType() const
retrieve strip parser type
Definition: BaseRawYStripSeq2dParser.h:75
BaseStripAttributeClassType::ValueType ValueType
value type associated to object
Definition: BaseRawYStripSeq2dParser.h:50
StorageType _pImageYStripSeq2d
shared pointer to y strip sequence 2d
Definition: BaseRawYStripSeq2dParser.h:139