Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Static Public Member Functions | List of all members
BIAS::glfFormatDB Class Reference

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

#include <OpenGLFramework/Base/glfFormatDB.hh>

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. More...
 
static GLenum GetFormatForColorModel (ImageBase::EColorModel colorModel)
 Returns the OpenGL pixel format (GL_RGB etc.) for a BIAS color model. More...
 
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. More...
 
static GLenum GetPixelTypeForStorageType (ImageBase::EStorageType storageType)
 Returns the OpenGL pixel type (GL_UNSIGNED_BYTE etc.) for a BIAS storage type. More...
 
static GLenum GLenumFromString (const std::string &enumString)
 Taking the enum as string and converting to the appropriate numerical constant. More...
 
static GLenum ProposeInternalFormat (ImageBase::EStorageType storageType, ImageBase::EColorModel colorModel)
 Returns an OpenGL internal pixel format for a BIAS storage type and color model. More...
 

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 304 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::glfCubeMap::Allocate(), BIAS::glfTexture2D::Allocate(), BIAS::glfTexture3D::Allocate3DImage(), BIAS::glfRenderbuffer::CopyToImage(), BIAS::glfCubeMap::CopyToImage(), and BIAS::glfTexture2D::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 269 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: