| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | #if defined(CL_SIFTGPU_ENABLED) |
| |
|
| | #ifndef CL_TEX_IMAGE_H |
| | #define CL_TEX_IMAGE_H |
| |
|
| | class GLTexImage; |
| |
|
| | class CLTexImage |
| | { |
| | protected: |
| | cl_context _context; |
| | cl_command_queue _queue; |
| | cl_mem _clData; |
| | int _numChannel; |
| | int _imgWidth; |
| | int _imgHeight; |
| | int _texWidth; |
| | int _texHeight; |
| | int _bufferLen; |
| | int _fromGL; |
| | private: |
| | void ReleaseTexture(); |
| | public: |
| | void SetImageSize(int width, int height); |
| | void SetPackedSize(int width, int height, int packed); |
| | void InitBufferTex(int width, int height, int nchannel); |
| | void InitTexture(int width, int height, int nchannel); |
| | void InitPackedTex(int width, int height, int packed); |
| | void InitTextureGL(GLuint tex, int width, int height, int nchannel); |
| | void CopyToHost(void* buf); |
| | void CopyFromHost(const void* buf); |
| | public: |
| | int CopyToPBO(GLuint pbo); |
| | int GetImageDataSize(); |
| | public: |
| | inline operator cl_mem(){return _clData; } |
| | inline int GetImgWidth(){return _imgWidth;} |
| | inline int GetImgHeight(){return _imgHeight;} |
| | inline int GetTexWidth(){return _texWidth;} |
| | inline int GetTexHeight(){return _texHeight;} |
| | inline int GetDataSize(){return _bufferLen;} |
| | inline bool IsImage2D() {return _bufferLen == 0;} |
| | inline int GetImgPixelCount(){return _imgWidth*_imgHeight;} |
| | inline int GetTexPixelCount(){return _texWidth*_texHeight;} |
| | public: |
| | CLTexImage(); |
| | CLTexImage(cl_context context, cl_command_queue queue); |
| | void SetContext(cl_context context, cl_command_queue queue); |
| | virtual ~CLTexImage(); |
| | friend class ProgramCL; |
| | friend class PyramidCL; |
| | friend class ProgramBagCL; |
| | friend class ProgramBagCLN; |
| | }; |
| |
|
| | |
| | |
| | |
| | #endif |
| | #endif |
| |
|
| |
|
| |
|