A wrapper around GL textures. More...
#include <texture.h>


Public Member Functions | |
| Texture (GLEWContext *const glewContext=0) | |
| Construct a new Texture. | |
| void | flush () |
| Clear the texture, including the GL texture name. | |
| void | setTarget (const GLenum target) |
| Set the target of the texture. | |
| GLenum | getTarget () const |
| void | setFormat (const GLuint format) |
| Set the internal format of the texture. | |
| GLuint | getFormat () const |
| void | copyFromFrameBuffer (const PixelViewport &pvp) |
| Copy the specified area from the current read buffer to the texture at 0,0. | |
| void | upload (const Image *image, const Frame::Buffer which) |
| Copy the specified image buffer to the texture at 0,0. | |
| void | upload (const int width, const int height, void *ptr) |
| Copy the specified buffer to the texture at 0,0. | |
| void | download (void *buffer, const uint32_t format, const uint32_t type) const |
| Copy the texture data to the given memory address. | |
| void | download (void *buffer) const |
| Copy the texture data to the given memory address, using the internal format and type. | |
| void | bind () const |
| Bind the texture. | |
| void | bindToFBO (const GLenum target, const int width, const int height) |
| Create and bind a texture to the current FBO. | |
| void | resize (const int width, const int height) |
| Resize the texture. | |
| bool | isValid () const |
| void | writeTexture (const std::string &filename, const eq::Frame::Buffer buffer, const PixelViewport &pvp) const |
| Writes the texture data as a rgb image file. | |
| GLEWContext * | glewGetContext () |
| const GLEWContext * | glewGetContext () const |
| void | setGLEWContext (GLEWContext *context) |
A wrapper around GL textures.
So far used by the Image and Compositor. The target is assumed to be GL_TEXTURE_RECTANGLE_ARB.
Definition at line 40 of file texture.h.
| eq::util::Texture::Texture | ( | GLEWContext *const | glewContext = 0 |
) |
Construct a new Texture.
Definition at line 26 of file texture.cpp.
| void eq::util::Texture::flush | ( | ) |
Clear the texture, including the GL texture name.
Definition at line 53 of file texture.cpp.
Referenced by eq::util::FrameBufferObject::exit(), and eq::util::AccumBufferObject::exit().

| void eq::util::Texture::setTarget | ( | const GLenum | target | ) |
Set the target of the texture.
Definition at line 64 of file texture.cpp.
| GLenum eq::util::Texture::getTarget | ( | ) | const [inline] |
| void eq::util::Texture::setFormat | ( | const GLuint | format | ) |
Set the internal format of the texture.
Definition at line 69 of file texture.cpp.
Referenced by eq::util::FrameBufferObject::FrameBufferObject(), eq::util::AccumBufferObject::init(), and upload().

| GLuint eq::util::Texture::getFormat | ( | ) | const [inline] |
Definition at line 60 of file texture.h.
Referenced by writeTexture().

| void eq::util::Texture::upload | ( | const Image * | image, | |
| const Frame::Buffer | which | |||
| ) |
Copy the specified image buffer to the texture at 0,0.
Definition at line 184 of file texture.cpp.
References eq::Image::getFormat(), eq::Image::getInternalTextureFormat(), eq::Image::getPixelPointer(), eq::Image::getPixelViewport(), eq::Image::getType(), and setFormat().
Referenced by eq::Compositor::assembleImageDB_GLSL().


| void eq::util::Texture::upload | ( | const int | width, | |
| const int | height, | |||
| void * | ptr | |||
| ) |
Copy the specified buffer to the texture at 0,0.
Definition at line 199 of file texture.cpp.
References resize().

| void eq::util::Texture::download | ( | void * | buffer, | |
| const uint32_t | format, | |||
| const uint32_t | type | |||
| ) | const |
Copy the texture data to the given memory address.
Definition at line 212 of file texture.cpp.
Referenced by download(), and writeTexture().

| void eq::util::Texture::bind | ( | ) | const |
Bind the texture.
Definition at line 227 of file texture.cpp.
Referenced by eq::Compositor::assembleImageDB_GLSL().

| void eq::util::Texture::bindToFBO | ( | const GLenum | target, | |
| const int | width, | |||
| const int | height | |||
| ) |
Create and bind a texture to the current FBO.
Definition at line 233 of file texture.cpp.
Referenced by eq::util::FrameBufferObject::init().

| void eq::util::Texture::resize | ( | const int | width, | |
| const int | height | |||
| ) |
Resize the texture.
Definition at line 253 of file texture.cpp.
Referenced by copyFromFrameBuffer(), eq::util::FrameBufferObject::resize(), and upload().

| bool eq::util::Texture::isValid | ( | ) | const |
Definition at line 48 of file texture.cpp.
Referenced by eq::Image::hasTextureData(), and eq::util::FrameBufferObject::resize().

| void eq::util::Texture::writeTexture | ( | const std::string & | filename, | |
| const eq::Frame::Buffer | buffer, | |||
| const PixelViewport & | pvp | |||
| ) | const |
Writes the texture data as a rgb image file.
Definition at line 278 of file texture.cpp.
References download(), getFormat(), eq::Image::getPixelPointer(), eq::Image::setFormat(), eq::Image::setPixelViewport(), eq::Image::setType(), eq::Image::validatePixelData(), and eq::Image::writeImage().

0.9.1 by
1.6.1