eq::util::Texture Class Reference

A wrapper around GL textures. More...

#include <texture.h>

Inheritance diagram for eq::util::Texture:
Inheritance graph
[legend]
Collaboration diagram for eq::util::Texture:
Collaboration graph
[legend]

List of all members.

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)

Detailed Description

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.


Constructor & Destructor Documentation

eq::util::Texture::Texture ( GLEWContext *const   glewContext = 0  ) 

Construct a new Texture.

Definition at line 26 of file texture.cpp.


Member Function Documentation

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().

Here is the caller graph for this function:

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]
Returns:
the target of the texture.

Definition at line 54 of file texture.h.

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().

Here is the caller graph for this function:

GLuint eq::util::Texture::getFormat (  )  const [inline]
Returns:
the internal format of the texture.

Definition at line 60 of file texture.h.

Referenced by writeTexture().

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

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().

Here is the caller graph for this function:

void eq::util::Texture::bind (  )  const

Bind the texture.

Definition at line 227 of file texture.cpp.

Referenced by eq::Compositor::assembleImageDB_GLSL().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

bool eq::util::Texture::isValid (  )  const
Returns:
true if the texture can be bound.

Definition at line 48 of file texture.cpp.

Referenced by eq::Image::hasTextureData(), and eq::util::FrameBufferObject::resize().

Here is the caller graph for this function:

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().

Here is the call graph for this function:


The documentation for this class was generated from the following files:
Generated on Sat Feb 6 13:15:06 2010 for Equalizer 0.9.1 by  doxygen 1.6.1