Basic Image AlgorithmS Library
2.8.0
|
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... | |
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.
Definition at line 39 of file glfFormatDB.hh.
|
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().
|
static |
Returns the OpenGL pixel format (GL_RGB etc.) for a BIAS color model.
Definition at line 185 of file glfFormatDB.cpp.
References BIAS::ImageBase::CM_BGR, BIAS::ImageBase::CM_BGRA, BIAS::ImageBase::CM_Depth, BIAS::ImageBase::CM_Disparity, BIAS::ImageBase::CM_Grey, BIAS::ImageBase::CM_GreyA, BIAS::ImageBase::CM_LAB, BIAS::ImageBase::CM_LUV, BIAS::ImageBase::CM_RGB, and BIAS::ImageBase::CM_RGBA.
Referenced by BIAS::glfTexture3D::Upload2DImage(), BIAS::glfCubeMap::UploadImage(), and BIAS::glfTexture2D::UploadImage().
|
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().
|
static |
Returns the OpenGL pixel type (GL_UNSIGNED_BYTE etc.) for a BIAS storage type.
Definition at line 151 of file glfFormatDB.cpp.
References BIAS::ImageBase::ST_char, BIAS::ImageBase::ST_double, BIAS::ImageBase::ST_float, BIAS::ImageBase::ST_int, BIAS::ImageBase::ST_invalid, BIAS::ImageBase::ST_shortint, BIAS::ImageBase::ST_unsignedchar, BIAS::ImageBase::ST_unsignedint, and BIAS::ImageBase::ST_unsignedshortint.
Referenced by BIAS::glfCubeMap::CopyChannelsToImage(), BIAS::glfTexture2D::CopyChannelsToImage(), BIAS::glfRenderbuffer::CopyToImage(), BIAS::glfCubeMap::CopyToImage(), BIAS::glfTexture2D::CopyToImage(), BIAS::glfTexture3D::Upload2DImage(), BIAS::glfCubeMap::UploadImage(), and BIAS::glfTexture2D::UploadImage().
|
static |
Taking the enum as string and converting to the appropriate numerical constant.
Definition at line 269 of file glfFormatDB.cpp.
|
static |
Returns an OpenGL internal pixel format for a BIAS storage type and color model.
Definition at line 213 of file glfFormatDB.cpp.
References BIAS::ImageBase::CM_BGR, BIAS::ImageBase::CM_BGRA, BIAS::ImageBase::CM_Depth, BIAS::ImageBase::CM_Disparity, BIAS::ImageBase::CM_Grey, BIAS::ImageBase::CM_GreyA, BIAS::ImageBase::CM_LAB, BIAS::ImageBase::CM_LUV, BIAS::ImageBase::CM_RGB, BIAS::ImageBase::CM_RGBA, BIAS::ImageBase::ST_float, BIAS::ImageBase::ST_unsignedchar, BIAS::ImageBase::ST_unsignedint, and BIAS::ImageBase::ST_unsignedshortint.
Referenced by BIAS::glfCubeMap::Allocate(), BIAS::glfTexture2D::Allocate(), BIAS::glfTexture3D::Allocate3DImage(), BIAS::glfCubeMap::UploadImage(), and BIAS::glfTexture2D::UploadImage().