JeVoisBase  1.20
JeVois Smart Embedded Machine Vision Toolkit Base Modules
Share this page:
GPUtexture.H
Go to the documentation of this file.
1 // ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
2 //
3 // JeVois Smart Embedded Machine Vision Toolkit - Copyright (C) 2016 by Laurent Itti, the University of Southern
4 // California (USC), and iLab at USC. See http://iLab.usc.edu and http://jevois.org for information about this project.
5 //
6 // This file is part of the JeVois Smart Embedded Machine Vision Toolkit. This program is free software; you can
7 // redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software
8 // Foundation, version 2. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
9 // without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
10 // License for more details. You should have received a copy of the GNU General Public License along with this program;
11 // if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
12 //
13 // Contact information: Laurent Itti - 3641 Watt Way, HNB-07A - Los Angeles, CA 90089-2520 - USA.
14 // Tel: +1 213 740 3527 - itti@pollux.usc.edu - http://iLab.usc.edu - http://jevois.org
15 // ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
16 /*! \file */
17 
18 #pragma once
19 
20 #include <jevois/GPU/OpenGL.H>
21 
22 //! Simple class to hold an OpenGL texture
23 /*! OpenGL textures are used to transfer image data from CPU to GPU and then allow the GPU to perform some processing on
24  the data. Processing is typically done by using "shader" GPU programs that transform the texture's pixel data and
25  render it, in some user-programmable way. */
27 {
28  public:
29  //! Constructor
30  /*! format should be as in glTexImage2D(), typically only GL_RGBA or GL_LUMINANCE are supported on embedded hardware
31  platforms. */
32  GPUtexture(GLsizei width, GLsizei height, GLenum format, bool createFramebuffer);
33 
34  //! Destructor, frees the texture in OpenGL
35  ~GPUtexture();
36 
37  //! Copy pixel data from memory location to the texture
38  /*! data should have been allocated by caller and have the correct size given the textute width, height, and
39  format. */
40  void setPixels(void const * data);
41 
42  //! Copy pixel data from the texture to already-allocated memory location
43  /*! data should have been allocated by caller and have the correct size given the textute width, height, and
44  format. */
45  void getPixels(void * data) const;
46 
47  GLsizei const Width;
48  GLsizei const Height;
49  GLenum const Format;
50  GLuint Id;
51  GLuint FramebufferId;
53 };
GPUtexture::GPUtexture
GPUtexture(GLsizei width, GLsizei height, GLenum format, bool createFramebuffer)
Constructor.
Definition: GPUtexture.C:21
GPUtexture::Format
const GLenum Format
Definition: GPUtexture.H:49
GPUtexture::setPixels
void setPixels(void const *data)
Copy pixel data from memory location to the texture.
Definition: GPUtexture.C:64
GPUtexture::FramebufferId
GLuint FramebufferId
Definition: GPUtexture.H:51
GPUtexture::~GPUtexture
~GPUtexture()
Destructor, frees the texture in OpenGL.
Definition: GPUtexture.C:56
GPUtexture::Id
GLuint Id
Definition: GPUtexture.H:50
GPUtexture::getPixels
void getPixels(void *data) const
Copy pixel data from the texture to already-allocated memory location.
Definition: GPUtexture.C:84
GPUtexture::Width
const GLsizei Width
Definition: GPUtexture.H:47
GPUtexture
Simple class to hold an OpenGL texture.
Definition: GPUtexture.H:26
GPUtexture::RenderBufferId
GLuint RenderBufferId
Definition: GPUtexture.H:52
OpenGL.H
GPUtexture::Height
const GLsizei Height
Definition: GPUtexture.H:48