version 3.3

VRS::ImageOpenGLTool Class Reference

#include <vrs/image/imageopengltool.h>

List of all members.

Static Public Member Functions

static void * getImagePointer (const Image *image=NULL, const Area &subArea=Area(-1,-1,-1,-1))
static void setPixelStoreModes (int width, int height, int alignment=1, const Area &subArea=Area(-1,-1,-1,-1))
 Sets the pixel store modes.
static GLenum getImageFormat (const Image *image)
static GLenum getPixelFormat (const Image *image)
static GLenum getInternalFormat (const Image *image)
static GLenum getTextureFormat (const GLenum internalFormat)
static bool isS3TC (const Image *const image)


Member Function Documentation

static void* VRS::ImageOpenGLTool::getImagePointer ( const Image image = NULL,
const Area subArea = Area(-1,-1,-1,-1) 
) [static]

Sets the OpenGL pixel-store-parameters for reading and writing for the given image. If no image is given the parameters are reseted to their default values. The returned pointer should be passed to calls of glTexImage*(), glReadPixel*(), etc. If an subArea is specified, the pixel-store-parameters are set in a way the updating a (smaller) area with contents of the given image will be possible. Consider, for example, if you have a texture with 32x32 pixel, an image with 637x812 pixel and you want to fill the texture with a part of that picture. Just call this method with the image and the area describing the part of the picture that should be used as texture. After that you can call glTexImage* for the 32x32 texture with the returned pointer.

static void VRS::ImageOpenGLTool::setPixelStoreModes ( int  width,
int  height,
int  alignment = 1,
const Area subArea = Area(-1,-1,-1,-1) 
) [static]

Sets the pixel store modes.

You can use this method to prepare OpenGL pixel storage state (pack and unpack) and afterwards render a bitmap, fill a texture etc. This method differs not so much from the getImagePointer-method but you can use it without having an image. The primary intention of this method was for bitmap rendering. Note that width and height specify the number of pixels stored in the memory area you want to pass to OpenGL. The subArea width and height, if specified, on the other hand should equal the width and height values passed to OpenGL.

static GLenum VRS::ImageOpenGLTool::getImageFormat ( const Image image  )  [static]

returns the image format of the given image, e.g.: GL_RGB, GL_BGR, GL_LUMINANCE, GL_RED, etc.

static GLenum VRS::ImageOpenGLTool::getPixelFormat ( const Image image  )  [static]

returns the pixel format of the given image: GL_UNSIGNED_BYTE, GL_UNSIGNED_SHORT, GL_UNSIGNED_INT

static GLenum VRS::ImageOpenGLTool::getInternalFormat ( const Image image  )  [static]

returns the default internal format for the given image which can be used for OpenGL textures, e.g.: GL_RGB, GL_RGBA, etc.

static GLenum VRS::ImageOpenGLTool::getTextureFormat ( const GLenum  internalFormat  )  [static]

returns the default format for the given internal format which can be used for OpenGL textures, e.g.: GL_RGB, GL_RGBA, etc.

static bool VRS::ImageOpenGLTool::isS3TC ( const Image *const   image  )  [static]

Retursn true it the given image is s3 compressed.


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

Generated on Mon May 21 06:00:18 2012 by Doxygen 1.5.6
© 2001-2010 Hasso-Plattner-Institut | Impressum | Contact