JeVois  1.21
JeVois Smart Embedded Machine Vision Toolkit
Share this page:
Loading...
Searching...
No Matches
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
22namespace jevois
23{
24 //! Simple class to hold an OpenGL texture
25 /*! OpenGL textures are used to transfer image data from CPU to GPU and then allow the GPU to perform some processing
26 on the data. Processing is typically done by using "shader" GPU programs that transform the texture's pixel data
27 and render it, in some user-programmable way. */
29 {
30 public:
31 //! Constructor
32 /*! format should be as in glTexImage2D(), typically only GL_RGBA or GL_LUMINANCE are supported on embedded
33 hardware platforms. */
34 GPUtexture(GLsizei width, GLsizei height, GLenum format, bool createFramebuffer);
35
36 //! Destructor, frees the texture in OpenGL
38
39 //! Copy pixel data from memory location to the texture
40 /*! data should have been allocated by caller and have the correct size given the textute width, height, and
41 format. */
42 void setPixels(void const * data);
43
44 //! Copy pixel data from the texture to already-allocated memory location
45 /*! data should have been allocated by caller and have the correct size given the textute width, height, and
46 format. */
47 void getPixels(void * data) const;
48
49 GLsizei const Width;
50 GLsizei const Height;
51 GLenum const Format;
52 GLuint Id;
55 };
56} // namespace jevois
Simple class to hold an OpenGL texture.
Definition GPUtexture.H:29
void setPixels(void const *data)
Copy pixel data from memory location to the texture.
Definition GPUtexture.C:64
GLenum const Format
Definition GPUtexture.H:51
void getPixels(void *data) const
Copy pixel data from the texture to already-allocated memory location.
Definition GPUtexture.C:87
GLsizei const Width
Definition GPUtexture.H:49
GLsizei const Height
Definition GPUtexture.H:50
~GPUtexture()
Destructor, frees the texture in OpenGL.
Definition GPUtexture.C:56
Main namespace for all JeVois classes and functions.
Definition Concepts.dox:2