00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #if !defined SOOPENCLCONVOLUTION_H
00024 #define SOOPENCLCONVOLUTION_H
00025
00026 #include <Inventor/SbString.h>
00027
00028 #include <Inventor/STL/vector>
00029
00030 #include <Inventor/OpenCL/algorithms/SoOpenCLAlgorithmsDefs.h>
00031
00032 #include <Inventor/algorithms/SoConvolution.h>
00033
00034 class SoConvolutionHandle;
00035 class SoOpenCLBufferObject;
00036
00057 class INVENTOROPENCLALGORITHMS_API SoOpenCLConvolution : public SoConvolution
00058 {
00059 private:
00061 static void initClass();
00062
00064 static void exitClass();
00065
00067 virtual ~SoOpenCLConvolution();
00068
00069 public:
00071 SoOpenCLConvolution();
00072
00091 virtual int doSeparateConvolution1D( SoBufferObject* sourceBufferObject,
00092 SoBufferObject* targetBufferObject,
00093 float* kernelData, int kernelSize, int width, int height );
00094
00100 int doSeparateConvolution1D( SoOpenCLBufferObject* sourceBufferObject,
00101 SoOpenCLBufferObject* targetBufferObject,
00102 float* kernelData, int kernelSize, int width, int height );
00103
00126 virtual int doSeparateConvolution2D( SoBufferObject* sourceBufferObject,
00127 SoBufferObject* targetBufferObject,
00128 float* kernelData, int kernelSize, int width, int height );
00129
00135 int doSeparateConvolution2D( SoOpenCLBufferObject* sourceBufferObject,
00136 SoOpenCLBufferObject* targetBufferObject,
00137 float* kernelData, int kernelSize, int width, int height );
00138
00155 virtual int doSeparateConvolutionRow( SoBufferObject* sourceBufferObject,
00156 SoBufferObject* targetBufferObject,
00157 float* kernelData, int kernelSize, int width, int height );
00158
00164 int doSeparateConvolutionRow( SoOpenCLBufferObject* sourceBufferObject,
00165 SoOpenCLBufferObject* targetBufferObject,
00166 float* kernelData, int kernelSize, int width, int height );
00167
00184 virtual int doSeparateConvolutionColumn( SoBufferObject* sourceBufferObject,
00185 SoBufferObject* targetBufferObject,
00186 float* kernelData, int kernelSize, int width, int height );
00187
00193 int doSeparateConvolutionColumn( SoOpenCLBufferObject* sourceBufferObject,
00194 SoOpenCLBufferObject* targetBufferObject,
00195 float* kernelData, int kernelSize, int width, int height );
00196
00197 private:
00201 void setKernel( int kernelSize, float* data );
00202
00203 SoConvolutionHandle* createConvolutionHandle();
00204
00205 void freeConvolutionHandle( SoConvolutionHandle* handle );
00206
00207 private:
00208
00209 SoConvolutionHandle* m_convolutionHandle;
00210
00211 };
00212
00213 #endif //SOOPENCLCONVOLUTION_H
00214
00215