IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
BaseImageAccessor.h
1 // BaseImageAccessor.h:
3 // --------------------
4 //
14 
15 #ifndef __IPSDKIMAGE_BASEIMAGEACCESSOR_H__
16 #define __IPSDKIMAGE_BASEIMAGEACCESSOR_H__
17 
18 // suppression warnings
19 // warning C4251: 'ipsdk::image::BaseImageAccessor::_accessMode' : class 'ipsdk::image::eImageAccessMode' needs to have dll-interface to be used by clients of class 'ipsdk::image::BaseImageAccessor'
20 #pragma warning (push)
21 #pragma warning (disable : 4251)
22 
26 #include <IPSDKSerialization/Engine/BaseSerializationObject.h>
27 
28 namespace ipsdk {
29 namespace image {
30 
33 
35 {
36  // declare serial class
38 
39  // friend class for protected access
40  friend class DiskImage;
41  friend class DiskPlanStorage;
42  friend class UserImage;
43  friend class UserPlanStorage;
44 
45 public:
49  virtual ~BaseImageAccessor() = 0;
51 
52 // methods
53 public:
55  bool isInit() const;
56 
59  const eImageAccessMode& getAccessMode() const;
60 
63  const BaseImageGeometry& getGeometry() const;
64 
68  const GeometricCalibrationConstPtr& getGeometricCalibrationConstPtr() const;
69 
73  virtual bool hasBinary8BitsStorage() const = 0;
74 
78  bool isValidPlanIdx(const ipUInt64 zPlanIdx,
79  const ipUInt64 cPlanIdx,
80  const ipUInt64 tPlanIdx) const;
81  bool isValidPlanIdx(const PlanIndex& planIdx) const;
83 
88  BoolResult resize(const BaseImageGeometry& imageGeometry);
89 
100  BoolResult readRaw(const ipUInt64 zPlanIdx,
101  const ipUInt64 cPlanIdx,
102  const ipUInt64 tPlanIdx,
103  const ipUInt64 pixelStartOffset,
104  const ipUInt64 nbPixels,
105  void* pData) const;
106  BoolResult readRaw(const PlanIndex& planIdx,
107  const ipUInt64 pixelStartOffset,
108  const ipUInt64 nbPixels,
109  void* pData) const;
111 
124  BoolResult writeRaw(const ipUInt64 zPlanIdx,
125  const ipUInt64 cPlanIdx,
126  const ipUInt64 tPlanIdx,
127  const ipUInt64 pixelStartOffset,
128  const ipUInt64 nbPixels,
129  const void* pData);
130  BoolResult writeRaw(const PlanIndex& planIdx,
131  const ipUInt64 pixelStartOffset,
132  const ipUInt64 nbPixels,
133  const void* pData);
135 
137  void clear();
138 
139 protected:
142  virtual std::string getImageInfoStr() const = 0;
143 
146  ImageGeometryPtr getGeometryPtr();
147 
151  void initBase(const eImageAccessMode& accessMode,
153  const GeometricCalibrationConstPtr& pGeometricCalibration);
154 
157  virtual BoolResult resizeData(const BaseImageGeometry& geometry) = 0;
158 
166  virtual BoolResult readRawData(const ipUInt64 zPlanIdx,
167  const ipUInt64 cPlanIdx,
168  const ipUInt64 tPlanIdx,
169  const ipUInt64 pixelsStartOffset,
170  const ipUInt64 nbPixels,
171  void* pData) const = 0;
172 
180  virtual BoolResult writeRawData(const ipUInt64 zPlanIdx,
181  const ipUInt64 cPlanIdx,
182  const ipUInt64 tPlanIdx,
183  const ipUInt64 pixelsStartOffset,
184  const ipUInt64 nbPixels,
185  const void* pData) = 0;
186 
188  virtual void clearDerived() = 0;
189 
190 // attributes
191 protected:
194 
197 
200 
202  bool _bInit;
203 };
204 
207 
208 inline bool
210 {
211  return _bInit;
212 }
213 
216 
217 } // end of namespace image
218 } // end of namespace ipsdk
219 
220 #pragma warning (pop)
221 
222 #endif // __IPSDKIMAGE_BASEIMAGEACCESSOR_H__
ImageGeometryPtr _pGeometry
geometry associated to file
Definition: BaseImageAccessor.h:196
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
GeometricCalibrationConstPtr _pGeometricCalibration
geometric calibration associated to image
Definition: BaseImageAccessor.h:199
uint64_t ipUInt64
Base types definition.
Definition: BaseTypes.h:55
bool _bInit
object initialization flag
Definition: BaseImageAccessor.h:202
boost::shared_ptr< const ipsdk::GeometricCalibration > GeometricCalibrationConstPtr
shared pointer to const ipsdk::GeometricCalibration
Definition: GeometricCalibrationTypes.h:31
#define IPSDK_DECLARE_ABSTRACT_SERIAL_WITHOUT_COPY(libraryName, className)
macro enabling serialization on abstract class
Definition: SerializationHdrMacro.h:97
Base class for image geometry.
Definition: BaseImageGeometry.h:38
Image class with user data storage support.
Definition: UserImage.h:32
IPSDKIMAGE_API ImageGeometryPtr geometry(const eImageBufferType &imageBufferType, const ipUInt64 sizeX, const ipUInt64 sizeY, const VolumeGeometry &volumeGeometry, const ColorGeometry &colorGeometry, const TemporalGeometry &temporalGeometry)
create an image geometry
Image class with disk data storage support.
Definition: DiskImage.h:33
Base class for image accessors.
Definition: BaseImageAccessor.h:34
Definition of import/export macro for library.
Predefined types for image geometry management.
bool isInit() const
retrieve object initialisation flag
Definition: BaseImageAccessor.h:209
Class encapsulating disk plan data.
Definition: DiskPlanStorage.h:32
#define IPSDKIMAGE_API
Import/Export macro for library IPSDKImage.
Definition: IPSDKImageExports.h:27
Class used to store image plan index.
Definition: PlanIndex.h:26
Class encapsulating user plan data.
Definition: UserPlanStorage.h:32
eImageAccessMode _accessMode
file access mode associated to manager
Definition: BaseImageAccessor.h:193
boost::shared_ptr< BaseImageGeometry > ImageGeometryPtr
shared pointer to image geometry
Definition: ImageGeometryTypes.h:55
Predefined type for image management.
Base class for serializable class.
Definition: BaseSerializationObject.h:33
eImageAccessMode
Image access mode.
Definition: ImageTypes.h:110