JeVoisBase  1.5
JeVois Smart Embedded Machine Vision Toolkit Base Modules
Share this page:
GPUtexture Class Reference

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. More...
 
 ~GPUtexture ()
 Destructor, frees the texture in OpenGL. More...
 
void setPixels (void const *data)
 Copy pixel data from memory location to the texture. More...
 
void getPixels (void *data) const
 Copy pixel data from the texture to already-allocated memory location. More...
 

Public Attributes

GLsizei const Width
 
GLsizei const Height
 
GLenum const Format
 
GLuint Id
 
GLuint FramebufferId
 
GLuint RenderBufferId
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ GPUtexture()

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::~GPUtexture ( )

Destructor, frees the texture in OpenGL.

Definition at line 56 of file GPUtexture.C.

References FramebufferId, Id, and RenderBufferId.

Member Function Documentation

◆ getPixels()

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.

◆ setPixels()

void GPUtexture::setPixels ( void const *  data)

Copy pixel data from memory location to the texture.

data should have been allocated by caller and have the correct size given the textute width, height, and format.

Definition at line 64 of file GPUtexture.C.

References Format, GL_CHECK, Height, Id, and Width.

Member Data Documentation

◆ Format

GLenum const GPUtexture::Format

Definition at line 49 of file GPUtexture.H.

Referenced by getPixels(), GPUtexture(), and setPixels().

◆ FramebufferId

GLuint GPUtexture::FramebufferId

Definition at line 51 of file GPUtexture.H.

Referenced by getPixels(), GPUtexture(), and ~GPUtexture().

◆ Height

GLsizei const GPUtexture::Height

Definition at line 48 of file GPUtexture.H.

Referenced by getPixels(), GPUtexture(), and setPixels().

◆ Id

GLuint GPUtexture::Id

Definition at line 50 of file GPUtexture.H.

Referenced by GPUtexture(), setPixels(), and ~GPUtexture().

◆ RenderBufferId

GLuint GPUtexture::RenderBufferId

Definition at line 52 of file GPUtexture.H.

Referenced by GPUtexture(), and ~GPUtexture().

◆ Width

GLsizei const GPUtexture::Width

Definition at line 47 of file GPUtexture.H.

Referenced by getPixels(), GPUtexture(), and setPixels().


The documentation for this class was generated from the following files: