Basic Image AlgorithmS Library 2.8.0
Static Public Member Functions

BIAS::glfFormatDB Class Reference

Helper methods for format conversions in GL and between GL and BIAS. More...

#include <OpenGLFramework/Base/glfFormatDB.hh>

List of all members.

Static Public Member Functions

static int ChannelsFromGLFormat (GLenum textureFormat)
 Returns the number of channels required to store an image of specified texture format, e.g.
static GLenum GetFormatForColorModel (ImageBase::EColorModel colorModel)
 Returns the OpenGL pixel format (GL_RGB etc.) for a BIAS color model.
static void GetFormatForInternalFormat (GLenum internalFormat, GLenum &format, int &numChannels)
 Computes a pixel format that can be used with glGetTexImage and glReadPixels for an internal format of a texture.
static GLenum GetPixelTypeForStorageType (ImageBase::EStorageType storageType)
 Returns the OpenGL pixel type (GL_UNSIGNED_BYTE etc.) for a BIAS storage type.
static GLenum GLenumFromString (const std::string &enumString)
 Taking the enum as string and converting to the appropriate numerical constant.
static GLenum ProposeInternalFormat (ImageBase::EStorageType storageType, ImageBase::EColorModel colorModel)
 Returns an OpenGL internal pixel format for a BIAS storage type and color model.

Detailed Description

Helper methods for format conversions in GL and between GL and BIAS.

Class originates from glfTexture methods which from now on are deprecated and will be removed.

Author:
bartczak 12/2009

Definition at line 39 of file glfFormatDB.hh.


Member Function Documentation

int glfFormatDB::ChannelsFromGLFormat ( GLenum  textureFormat) [static]

Returns the number of channels required to store an image of specified texture format, e.g.

GL_RED returns 1 while GL_RGBA returns 4.

Definition at line 299 of file glfFormatDB.cpp.

Referenced by BIAS::glfTexture2D::CopyChannelsToImage().

GLenum glfFormatDB::GetFormatForColorModel ( ImageBase::EColorModel  colorModel) [static]
void glfFormatDB::GetFormatForInternalFormat ( GLenum  internalFormat,
GLenum &  format,
int &  numChannels 
) [static]

Computes a pixel format that can be used with glGetTexImage and glReadPixels for an internal format of a texture.

Also returns the number of channels. For example: If internalFormat = GL_R3_G3_B2, then format = GL_RGB and numChannels = 3.

Definition at line 32 of file glfFormatDB.cpp.

Referenced by BIAS::glfTexture2D::Allocate(), BIAS::glfCubeMap::Allocate(), BIAS::glfTexture3D::Allocate3DImage(), BIAS::glfTexture2D::CopyToImage(), BIAS::glfRenderbuffer::CopyToImage(), and BIAS::glfCubeMap::CopyToImage().

GLenum glfFormatDB::GetPixelTypeForStorageType ( ImageBase::EStorageType  storageType) [static]
GLenum glfFormatDB::GLenumFromString ( const std::string &  enumString) [static]

Taking the enum as string and converting to the appropriate numerical constant.

Definition at line 264 of file glfFormatDB.cpp.

GLenum glfFormatDB::ProposeInternalFormat ( ImageBase::EStorageType  storageType,
ImageBase::EColorModel  colorModel 
) [static]

The documentation for this class was generated from the following files:
 All Classes Functions Variables Typedefs Enumerations Enumerator Friends