JeVoisBase
1.22
JeVois Smart Embedded Machine Vision Toolkit Base Modules
|
|
Simple class to hold an OpenGL texture. More...
#include <jevoisbase/Components/FilterGPU/GPUtexture.H>
Public Member Functions | |
GPUtexture (GLsizei width, GLsizei height, GLenum format, bool createFramebuffer) | |
Constructor. | |
~GPUtexture () | |
Destructor, frees the texture in OpenGL. | |
void | setPixels (void const *data) |
Copy pixel data from memory location to the texture. | |
void | getPixels (void *data) const |
Copy pixel data from the texture to already-allocated memory location. | |
Public Attributes | |
GLsizei const | Width |
GLsizei const | Height |
GLenum const | Format |
GLuint | Id |
GLuint | FramebufferId |
GLuint | RenderBufferId |
Simple class to hold an OpenGL texture.
OpenGL textures are used to transfer image data from CPU to GPU and then allow the GPU to perform some processing on the data. Processing is typically done by using "shader" GPU programs that transform the texture's pixel data and render it, in some user-programmable way.
Definition at line 26 of file GPUtexture.H.
GPUtexture::GPUtexture | ( | GLsizei | width, |
GLsizei | height, | ||
GLenum | format, | ||
bool | createFramebuffer | ||
) |
Constructor.
format should be as in glTexImage2D(), typically only GL_RGBA or GL_LUMINANCE are supported on embedded hardware platforms.
Definition at line 21 of file GPUtexture.C.
References Format, FramebufferId, GL_CHECK, Height, Id, LERROR, LINFO, RenderBufferId, and Width.
GPUtexture::~GPUtexture | ( | ) |
Destructor, frees the texture in OpenGL.
Definition at line 56 of file GPUtexture.C.
References FramebufferId, Id, and RenderBufferId.
void GPUtexture::getPixels | ( | void * | data | ) | const |
Copy pixel data from the texture to already-allocated memory location.
data should have been allocated by caller and have the correct size given the textute width, height, and format.
Definition at line 84 of file GPUtexture.C.
References Format, FramebufferId, GL_CHECK, Height, and Width.
void GPUtexture::setPixels | ( | void const * | data | ) |
GLenum const GPUtexture::Format |
Definition at line 49 of file GPUtexture.H.
Referenced by getPixels(), GPUtexture(), and setPixels().
GLuint GPUtexture::FramebufferId |
Definition at line 51 of file GPUtexture.H.
Referenced by getPixels(), GPUtexture(), and ~GPUtexture().
GLsizei const GPUtexture::Height |
Definition at line 48 of file GPUtexture.H.
Referenced by getPixels(), GPUtexture(), and setPixels().
GLuint GPUtexture::Id |
Definition at line 50 of file GPUtexture.H.
Referenced by GPUtexture(), setPixels(), and ~GPUtexture().
GLuint GPUtexture::RenderBufferId |
Definition at line 52 of file GPUtexture.H.
Referenced by GPUtexture(), and ~GPUtexture().
GLsizei const GPUtexture::Width |
Definition at line 47 of file GPUtexture.H.
Referenced by getPixels(), GPUtexture(), and setPixels().