IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
BasePlanStorage.h
1 // BasePlanStorage.h:
3 // ------------------
4 //
14 
15 #ifndef __IPSDKIMAGE_BASEPLANSTORAGE_H__
16 #define __IPSDKIMAGE_BASEPLANSTORAGE_H__
17 
18 // suppression warnings
19 // warning C4251: 'ipsdk::image::BasePlanStorage::_pImageHeader' : class 'boost::shared_ptr<T>' needs to have dll-interface to be used by clients of class 'ipsdk::image::BasePlanStorage'
20 #pragma warning (push)
21 #pragma warning (disable : 4251)
22 
25 #include <IPSDKImage/Geometry/Plan/ImagePlanGeometry.h>
28 #include <IPSDKSerialization/Engine/BaseObjectWithSkeleton.h>
29 
30 namespace ipsdk {
31 namespace image {
32 
33 class BasePlanGeometry;
34 
37 
39 {
40  // declare dynamic class
42 
43  // friend class for protected access
44  friend class SubImage;
45 
46 public:
50  virtual ~BasePlanStorage() = 0;
52 
53 // methods
54 public:
56  virtual ePlanStorageType getPlanStorageType() const = 0;
57 
59  bool isInit() const;
60 
61  //----------------------
64  //----------------------
65 
68  const ImagePlanGeometry& getPlanGeometry() const;
69 
72  ipUInt64 getSizeX() const;
73 
76  ipUInt64 getSizeY() const;
77 
80  ipUInt64 getNbPixels() const;
81 
84  const eImageBufferType& getBufferType() const;
86 
89  virtual eImageAccessMode getAccessMode() const = 0;
90 
97  virtual const void* getDataPtr() const;
98  virtual void* getDataPtr();
100 
104  bool hasFullDataAccess() const;
105 
110  virtual bool hasRowDataAccess(const ipUInt64 startOffsetY,
111  const ipUInt64 sizeY = 1) const;
112 
115  virtual bool canBeRemotlyAccessed() const = 0;
116 
120  virtual bool hasBinary8BitsStorage() const = 0;
121 
130  virtual const void* getRowDataPtr(const ipUInt64 offsetY) const;
131  virtual void* getRowDataPtr(const ipUInt64 offsetY);
133 
137  BoolResult resize(const ImagePlanGeometry& planGeometry);
138 
143  virtual ipUInt64 getFullBufferSize() const;
144 
145  //-----------------------
148  //-----------------------
149 
154  BoolResult readRaw(const ipUInt64 startOffset,
155  const ipUInt64 size,
156  void* pData) const;
157 
164  BoolResult readArea(const ipUInt64 areaStartOffsetX,
165  const ipUInt64 areaSizeX,
166  const ipUInt64 areaStartOffsetY,
167  const BufferPtrColl& dataColl) const;
168 
175  BoolResult writeRaw(const ipUInt64 startOffset,
176  const ipUInt64 size,
177  const void* pData);
178 
187  BoolResult writeArea(const ipUInt64 areaStartOffsetX,
188  const ipUInt64 areaSizeX,
189  const ipUInt64 areaStartOffsetY,
190  const BufferConstPtrColl& dataColl);
192 
194  void clear();
195 
197  virtual ipBool isDiskPlanStorage() const;
198 
199 protected:
201  void initBase(const ImagePlanGeometry& planGeometry);
202 
205  virtual BoolResult resizePlan(const ImagePlanGeometry& planGeometry) = 0;
206 
209  virtual BoolResult readRawData(const ipUInt64 startOffset,
210  const ipUInt64 size,
211  void* pData) const = 0;
212 
215  virtual BoolResult readAreaData(const ipUInt64 areaStartOffsetX,
216  const ipUInt64 areaSizeX,
217  const ipUInt64 areaStartOffsetY,
218  const BufferPtrColl& dataColl) const;
219 
224  virtual BoolResult writeRawData(const ipUInt64 startOffset,
225  const ipUInt64 size,
226  const void* pData) = 0;
227 
232  virtual BoolResult writeAreaData(const ipUInt64 areaStartOffsetX,
233  const ipUInt64 areaSizeX,
234  const ipUInt64 areaStartOffsetY,
235  const BufferConstPtrColl& dataColl);
236 
238  virtual void clearPlanData() = 0;
239 
240 // attributes
241 private:
243  ImagePlanGeometry _planGeometry;
244 
246  bool _bInit;
247 };
248 
251 
252 inline bool
254 {
255  return _bInit;
256 }
257 
260 
261 } // end of namespace image
262 } // end of namespace ipsdk
263 
264 #pragma warning (pop)
265 
266 #endif // __IPSDKIMAGE_BASEPLANSTORAGE_H__
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
uint64_t ipUInt64
Base types definition.
Definition: BaseTypes.h:55
bool isInit() const
retrieve object initialisation flag
Definition: BasePlanStorage.h:253
#define IPSDK_DECLARE_ABSTRACT_SERIAL_WITHOUT_COPY(libraryName, className)
macro enabling serialization on abstract class
Definition: SerializationHdrMacro.h:97
Predefined types for buffer manipulations.
IPSDKGEOMETRY_API ipUInt64 getNbPixels(const ipsdk::geom::RowIntersections &)
return the number of pixels in the input RowIntersections data structure
Predefined types for plan storage management.
Base class for image plan data storage.
Definition: BasePlanStorage.h:38
Class for sub images of complete image.
Definition: SubImage.h:31
Definition of import/export macro for library.
#define IPSDKIMAGE_API
Import/Export macro for library IPSDKImage.
Definition: IPSDKImageExports.h:27
bool ipBool
Base types definition.
Definition: BaseTypes.h:47
Base class for serialization object with three serialization modes :
Definition: BaseObjectWithSkeleton.h:33
Class encapsulating image plan geometry.
Definition: ImagePlanGeometry.h:33
ePlanStorageType
Enumerate describing plan storage type.
Definition: PlanStorageTypes.h:33
Predefined type for image management.
eImageAccessMode
Image access mode.
Definition: ImageTypes.h:110
eImageBufferType
types associated to image buffers
Definition: ImageTypes.h:78