IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
CudaImage.h
Go to the documentation of this file.
1 // CudaImage.h:
3 // ------------
4 //
14 
15 #ifndef __IPSDKIMAGE_CUDAIMAGE_H__
16 #define __IPSDKIMAGE_CUDAIMAGE_H__
17 
18 //#include <IPSDKImage/IPSDKImageExports.h>
19 #include <IPSDKImage/Image/BaseCompleteImage.h>
21 
22 namespace ipsdk {
23 namespace image {
24 
27 
29 {
30  // declare serial class
32 
33  // friend class for protected members access
34  friend boost::shared_ptr<CudaImage> boost::make_shared<CudaImage>();
35 
36 // predefined public types
37 public:
39  static const eImageType::domain g_imageType = eImageType::eIT_Gpu;
40 
41 protected:
43  CudaImage();
44 
45 public:
47  ~CudaImage();
48 
49 // methods
50 public:
52  eImageType getImageType() const;
53 
55  ipBool isGpuImage() const;
56 
58  ipBool isDiskImage() const;
59 
62  virtual BoolResult init(const BaseImageGeometry& geometry);
63 
66  eImageAccessMode getAccessMode() const;
67 
72  BoolResult resize(const BaseImageGeometry& geometry);
73 
78  const void* getDataPtr(const PlanIndex& planIndex) const;
79  void* getDataPtr(const PlanIndex& planIndex);
81 
86  const void* getDataPtr(const ipUInt64 zPlanIdx,
87  const ipUInt64 cPlanIdx,
88  const ipUInt64 tPlanIdx) const;
89  void* getDataPtr(const ipUInt64 zPlanIdx,
90  const ipUInt64 cPlanIdx,
91  const ipUInt64 tPlanIdx);
93 
95  void fromCPU(const BaseImage& inImage);
96 
99  virtual void toCPU(ipsdk::image::ImagePtr pOutImage) const;
100  virtual void toCPU(ipsdk::image::ImagePtr pOutImage);
102 
105  virtual ImageConstPtr toCPU() const;
106  virtual ImagePtr toCPU();
108 
114  const ipsdk::image::CudaBuffer&
115  getBuffer(const ipUInt64 zPlanIdx,
116  const ipUInt64 cPlanIdx,
117  const ipUInt64 tPlanIdx) const;
118 
119  ipsdk::image::CudaBuffer&
120  getBuffer(const ipUInt64 zPlanIdx,
121  const ipUInt64 cPlanIdx,
122  const ipUInt64 tPlanIdx);
124 
130  const char*
131  getBufferData(const ipUInt64 zPlanIdx,
132  const ipUInt64 cPlanIdx,
133  const ipUInt64 tPlanIdx) const;
134 
135  char*
136  getBufferData(const ipUInt64 zPlanIdx,
137  const ipUInt64 cPlanIdx,
138  const ipUInt64 tPlanIdx);
140 
142  ipUInt64 getNbDevices() const;
143 
144 protected:
147  BoolResult createImagePlans(const BaseImageGeometry& geometry,
148  PlanStorageColl3d& imagePlans);
149 
150 // attributes
151 protected:
152 
153 };
154 
157 
158 inline eImageType
160 {
161  return g_imageType;
162 }
163 
164 inline ipBool
166 {
167  return true;
168 }
169 
170 inline ipBool
172 {
173  return false;
174 }
175 
176 
179 
180 } // end of namespace image
181 } // end of namespace ipsdk
182 
183 #endif // __IPSDKIMAGE_CUDAIMAGE_H__
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
uint64_t ipUInt64
Base types definition.
Definition: BaseTypes.h:55
static const eImageType::domain g_imageType
type associated to attribute
Definition: CudaImage.h:39
boost::shared_ptr< BaseImage > ImagePtr
Definition: ImageTypes.h:139
GPU image.
Definition: ImageTypes.h:66
Base class for image geometry.
Definition: BaseImageGeometry.h:38
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
ipBool isDiskImage() const
returns true if the image is a disk one
Definition: CudaImage.h:171
#define IPSDK_DECLARE_SERIAL_WITHOUT_COPY(libraryName, className)
macro enabling serialization on class
Definition: SerializationHdrMacro.h:79
eImageType
Enumerate describing image type.
Definition: ImageTypes.h:58
eImageType getImageType() const
retrieve image type
Definition: CudaImage.h:159
std::vector< PlanStorageColl2d > PlanStorageColl3d
Definition: ImageTypes.h:196
#define IPSDKIMAGE_API
Import/Export macro for library IPSDKImage.
Definition: IPSDKImageExports.h:27
boost::shared_ptr< const BaseImage > ImageConstPtr
Definition: ImageTypes.h:140
Class used to store image plan index.
Definition: PlanIndex.h:26
bool ipBool
Base types definition.
Definition: BaseTypes.h:47
Definition: CudaImage.h:28
ipBool isGpuImage() const
returns true if the image is loaded on GPU
Definition: CudaImage.h:165
Base class for images data type.
Definition: BaseImage.h:43
Base class for complete images.
Definition: BaseCompleteImage.h:34
eImageAccessMode
Image access mode.
Definition: ImageTypes.h:110