IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
BaseImageYStripColor2d.h
1 // BaseImageYStripColor2d.h:
3 // -------------------------
4 //
14 
15 #ifndef __IPSDKIMAGE_BASEIMAGEYSTRIPCOLOR2D_H__
16 #define __IPSDKIMAGE_BASEIMAGEYSTRIPCOLOR2D_H__
17 
18 // suppression warnings
19 // warning C4251: 'ipsdk::image::BaseImageYStripColor2d::_bufferType' : class 'ipsdk::image::eImageBufferType' needs to have dll-interface to be used by clients of class 'ipsdk::image::BaseImageYStripColor2d'
20 #pragma warning (push)
21 #pragma warning (disable : 4251)
22 
23 #include <IPSDKImage/Fragment/Strip/BaseImageStrip.h>
24 #include <IPSDKImage/Geometry/Component/ColorGeometry.h>
25 #include <IPSDKBaseData/Buffer/HybridBuffer.h>
26 
27 namespace ipsdk {
28 namespace image {
29 
32 
34 {
35  // declare serial class
37 
38 // predefined public types
39 public:
41  static const eImageStripType::domain g_imageStripType = eImageStripType::eIST_YColor2d;
42 
43 public:
47  virtual ~BaseImageYStripColor2d() = 0;
49 
50 // methods
51 public:
53  eImageStripType getImageStripType() const;
54 
55  //------------------------------------
58  //------------------------------------
59 
62  const eStripParsingDirection& getStripParsingDirection() const;
63 
66  ipUInt64 getSizeX() const;
67 
70  const ColorGeometry& getColorGeometry() const;
71 
74  const eColorGeometryType& getColorGeometryType() const;
75 
78  ipUInt64 getSizeC() const;
79 
82  ipUInt64 getStripStartOffsetY() const;
83 
86  ipUInt64 getStripSizeY() const;
87 
90  ipUInt64 getImageSizeY() const;
91 
94  bool isValidY(ipUInt64 y) const;
95 
98  const eImageBufferType& getBufferType() const;
99 
102  const ipUInt64 getFullStripSize() const;
103 
106  const ipUInt64 getPlanStripSize() const;
107 
110  const ipUInt64 getStripNbPlans() const;
112 
113  //--------------------
116  //--------------------
117 
120  ipUInt64 getZPlanIdx() const;
121 
124  ipUInt64 getTPlanIdx() const;
126 
132  const HybridBuffer& getBuffer(const ipUInt64 cPlanIdx) const;
133 
138  ImageYStrip2dConstPtr getImageYStrip2dPtr(const ipUInt64 cPlanIdx) const;
139  ImageYStrip2dPtr getImageYStrip2dPtr(const ipUInt64 cPlanIdx);
141 
142 protected:
146  void initBase(const ipUInt64 zPlanIdx,
147  const ipUInt64 tPlanIdx,
148  const ColorGeometry& colorGeometry,
149  const ipUInt64 stripStartOffsetY,
150  const ipUInt64 stripSizeY,
151  const eStripAllocationType& stripAllocationType,
152  const eStripParsingDirection& stripParsingDirection,
153  const PlanStorageColl1d& colorColl,
154  const DataIdentifierConstPtr& pImageIdentifier,
155  const DataItemMapConstPtr& pImageHeader);
156 
158  bool isBufferInitDerived() const;
159 
161  BoolResult initBufferDerived();
162 
164  void clearBufferDerived();
165 
167  eDataAccessMode retrieveAccessMode() const;
168 
169  //-----------------------------------
172  //-----------------------------------
173 
176  BoolResult readDataDerived() const;
177 
180  BoolResult writeDataDerived();
182 
189  const HybridBuffer& accessBuffer(const ipUInt64 cPlanIdx) const;
190  HybridBuffer& accessBuffer(const ipUInt64 cPlanIdx);
192 
194  void clearDerived();
195 
198  virtual void createSubStrip(const ipUInt64 zPlanIdx,
199  const ipUInt64 cPlanIdx,
200  const ipUInt64 tPlanIdx,
201  const ipUInt64 stripStartOffsetY,
202  const ipUInt64 stripSizeY,
203  const eStripAllocationType& stripAllocationType,
204  const eStripParsingDirection& stripParsingDirection,
205  const PlanStoragePtr& pPlanStorage,
206  const DataIdentifierConstPtr& pImageIdentifier,
207  const DataItemMapConstPtr& pImageHeader,
208  ImageYStrip2dPtr& pImageYStrip2d) const = 0;
209 
210 // attributes
211 private:
214  ipUInt64 _zPlanIdx;
215  ipUInt64 _tPlanIdx;
217 
219  ColorGeometry _colorGeometry;
220 
222  ipUInt64 _sizeX;
223 
225  ipUInt64 _stripStartOffsetY;
226 
228  ipUInt64 _stripSizeY;
229 
231  ipUInt64 _imageSizeY;
232 
234  eImageBufferType _bufferType;
235 
237  PlanStorageColl1d _colorColl;
238 
240  typedef std::vector<ImageYStrip2dPtr> ImageYStrip2dColl;
241 
243  ImageYStrip2dColl _imageYStrip2dColl;
244 };
245 
248 
249 inline eImageStripType
251 {
252  return g_imageStripType;
253 }
254 
255 inline const HybridBuffer&
257 {
258  return accessBuffer(cPlanIdx);
259 }
260 
263 
264 } // end of namespace image
265 } // end of namespace ipsdk
266 
267 #pragma warning (pop)
268 
269 #endif // __IPSDKIMAGE_BASEIMAGEYSTRIPCOLOR2D_H__
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
boost::shared_ptr< const BaseImageYStrip2d > ImageYStrip2dConstPtr
Definition: ImageStripTypes.h:118
eDataAccessMode
Enumerate describing access mode for an image fragment data.
Definition: ImageFragmentTypes.h:45
uint64_t ipUInt64
Base types definition.
Definition: BaseTypes.h:55
#define IPSDK_DECLARE_ABSTRACT_SERIAL_WITHOUT_COPY(libraryName, className)
macro enabling serialization on abstract class
Definition: SerializationHdrMacro.h:97
eColorGeometryType
Color geometry type.
Definition: GeometryComponentTypes.h:45
eStripAllocationType
Enumerate describing image strip allocation policy.
Definition: ImageStripTypes.h:88
const HybridBuffer & getBuffer(const ipUInt64 cPlanIdx) const
retrieve strip full buffer
Definition: BaseImageYStripColor2d.h:256
Base class for color image 2d strip with splitting along Y axis.
Definition: BaseImageYStripColor2d.h:33
static const eImageStripType::domain g_imageStripType
image strip type
Definition: BaseImageYStripColor2d.h:41
Base class for image strip fragments.
Definition: BaseImageStrip.h:34
const HybridBuffer & accessBuffer(const ipUInt64 cPlanIdx) const
access to strip full buffer
boost::shared_ptr< const DataItemMap > DataItemMapConstPtr
shared pointer to const DataItemMap
Definition: DataItemTypes.h:170
#define IPSDKIMAGE_API
Import/Export macro for library IPSDKImage.
Definition: IPSDKImageExports.h:27
boost::shared_ptr< BasePlanStorage > PlanStoragePtr
shared pointer to image plan storage
Definition: PlanStorageTypes.h:55
eStripParsingDirection
Enumerate describing strip parsing direction.
Definition: ImageStripTypes.h:72
Class encapsulating color geometryThis class allows to define geometry color size and type (grey...
Definition: ColorGeometry.h:35
boost::shared_ptr< const DataIdentifier > DataIdentifierConstPtr
shared pointer to const data identifier
Definition: DataIdentifierTypes.h:31
Class allowing to encapsulate an hybrid form of buffer.
Definition: HybridBuffer.h:52
std::vector< PlanStoragePtr > PlanStorageColl1d
Definition: ImageTypes.h:184
boost::shared_ptr< BaseImageYStrip2d > ImageYStrip2dPtr
Definition: ImageStripTypes.h:117
eImageStripType getImageStripType() const
retrieve image strip type
Definition: BaseImageYStripColor2d.h:250
eImageStripType
Enumerate describing image strip type.
Definition: ImageStripTypes.h:42
color image 2d strip with splitting along Y axis
Definition: ImageStripTypes.h:54
eImageBufferType
types associated to image buffers
Definition: ImageTypes.h:78