| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| |
|
| | #ifndef CU_TEX_IMAGE_H |
| | #define CU_TEX_IMAGE_H |
| |
|
| | class GLTexImage; |
| | struct cudaArray; |
| | struct textureReference; |
| |
|
| | |
| |
|
| | #define SIFTGPU_ENABLE_LINEAR_TEX2D |
| |
|
| | class CuTexImage |
| | { |
| | protected: |
| | void* _cuData; |
| | cudaArray* _cuData2D; |
| | int _numChannel; |
| | size_t _numBytes; |
| | int _imgWidth; |
| | int _imgHeight; |
| | int _texWidth; |
| | int _texHeight; |
| | GLuint _fromPBO; |
| | public: |
| | virtual void SetImageSize(int width, int height); |
| | virtual bool InitTexture(int width, int height, int nchannel = 1); |
| | void InitTexture2D(); |
| | inline void BindTexture(textureReference& texRef); |
| | inline void BindTexture2D(textureReference& texRef); |
| | void CopyToTexture2D(); |
| | void CopyToHost(void* buf); |
| | void CopyToHost(void* buf, int stream); |
| | void CopyFromHost(const void* buf); |
| | int CopyToPBO(GLuint pbo); |
| | void CopyFromPBO(int width, int height, GLuint pbo); |
| | static int DebugCopyToTexture2D(); |
| | public: |
| | inline int GetImgWidth(){return _imgWidth;} |
| | inline int GetImgHeight(){return _imgHeight;} |
| | inline int GetDataSize(){return _numBytes;} |
| | public: |
| | CuTexImage(); |
| | CuTexImage(int width, int height, int nchannel, GLuint pbo); |
| | virtual ~CuTexImage(); |
| | friend class ProgramCU; |
| | friend class PyramidCU; |
| | }; |
| |
|
| | |
| | |
| | |
| | #endif |
| |
|
| |
|