Open CASCADE Technology  7.7.0
Public Member Functions | Static Public Member Functions

OpenGl_TextureFormat Class Reference

Stores parameters of OpenGL texture format. More...

#include <OpenGl_TextureFormat.hxx>

Public Member Functions

 OpenGl_TextureFormat ()
 Empty constructor (invalid texture format). More...
 
bool IsValid () const
 Return TRUE if format is defined. More...
 
GLint InternalFormat () const
 Returns OpenGL internal format of the pixel data (example: GL_R32F). More...
 
void SetInternalFormat (GLint theInternal)
 Sets texture internal format. More...
 
GLenum PixelFormat () const
 Returns OpenGL format of the pixel data (example: GL_RED). More...
 
void SetPixelFormat (GLenum theFormat)
 Sets OpenGL format of the pixel data. More...
 
GLint DataType () const
 Returns OpenGL data type of the pixel data (example: GL_FLOAT). More...
 
void SetDataType (GLint theType)
 Sets OpenGL data type of the pixel data. More...
 
GLint NbComponents () const
 Returns number of components (channels). Here for debugging purposes. More...
 
void SetNbComponents (GLint theNbComponents)
 Sets number of components (channels). More...
 
bool IsSRGB () const
 Return TRUE if internal texture format is sRGB(A). More...
 
Image_Format ImageFormat () const
 Returns image format (best match or Image_Format_UNKNOWN if no suitable fit). More...
 
void SetImageFormat (Image_Format theFormat)
 Sets image format. More...
 
GLint Internal () const
 Returns OpenGL internal format of the pixel data (example: GL_R32F). More...
 
GLenum Format () const
 Returns OpenGL format of the pixel data (example: GL_RED). More...
 

Static Public Member Functions

template<class theCompType , int theNbComps>
static OpenGl_TextureFormat Create ()
 Returns texture format for specified type and number of channels. More...
 
static OpenGl_TextureFormat FindFormat (const Handle< OpenGl_Context > &theCtx, Image_Format theFormat, bool theIsColorMap)
 Find texture format suitable to specified image format. More...
 
static OpenGl_TextureFormat FindSizedFormat (const Handle< OpenGl_Context > &theCtx, GLint theSizedFormat)
 Find texture format suitable to specified internal (sized) texture format. More...
 
static OpenGl_TextureFormat FindCompressedFormat (const Handle< OpenGl_Context > &theCtx, Image_CompressedFormat theFormat, bool theIsColorMap)
 Find texture format suitable to specified compressed texture format. More...
 
static TCollection_AsciiString FormatFormat (GLint theInternalFormat)
 Format pixel format enumeration. More...
 
static TCollection_AsciiString FormatDataType (GLint theDataType)
 Format data type enumeration. More...
 

Detailed Description

Stores parameters of OpenGL texture format.

Constructor & Destructor Documentation

◆ OpenGl_TextureFormat()

OpenGl_TextureFormat::OpenGl_TextureFormat ( )
inline

Empty constructor (invalid texture format).

Member Function Documentation

◆ Create()

template<class theCompType , int theNbComps>
OpenGl_TextureFormat OpenGl_TextureFormat::Create
inlinestatic

Returns texture format for specified type and number of channels.

Template Parameters
theCompTypecomponent type
theNbCompsnumber of components

◆ DataType()

GLint OpenGl_TextureFormat::DataType ( ) const
inline

Returns OpenGL data type of the pixel data (example: GL_FLOAT).

◆ FindCompressedFormat()

static OpenGl_TextureFormat OpenGl_TextureFormat::FindCompressedFormat ( const Handle< OpenGl_Context > &  theCtx,
Image_CompressedFormat  theFormat,
bool  theIsColorMap 
)
static

Find texture format suitable to specified compressed texture format.

Parameters
theCtx[in] OpenGL context defining supported texture formats
theFormat[in] compressed texture format
Returns
found format or invalid format

◆ FindFormat()

static OpenGl_TextureFormat OpenGl_TextureFormat::FindFormat ( const Handle< OpenGl_Context > &  theCtx,
Image_Format  theFormat,
bool  theIsColorMap 
)
static

Find texture format suitable to specified image format.

Parameters
theCtx[in] OpenGL context defining supported texture formats
theFormat[in] image format
theIsColorMap[in] flag indicating color nature of image (to select sRGB texture)
Returns
found format or invalid format

◆ FindSizedFormat()

static OpenGl_TextureFormat OpenGl_TextureFormat::FindSizedFormat ( const Handle< OpenGl_Context > &  theCtx,
GLint  theSizedFormat 
)
static

Find texture format suitable to specified internal (sized) texture format.

Parameters
theCtx[in] OpenGL context defining supported texture formats
theSizedFormat[in] sized (internal) texture format (example: GL_RGBA8)
Returns
found format or invalid format

◆ Format()

GLenum OpenGl_TextureFormat::Format ( ) const
inline

Returns OpenGL format of the pixel data (example: GL_RED).

◆ FormatDataType()

static TCollection_AsciiString OpenGl_TextureFormat::FormatDataType ( GLint  theDataType)
static

Format data type enumeration.

◆ FormatFormat()

static TCollection_AsciiString OpenGl_TextureFormat::FormatFormat ( GLint  theInternalFormat)
static

Format pixel format enumeration.

◆ ImageFormat()

Image_Format OpenGl_TextureFormat::ImageFormat ( ) const
inline

Returns image format (best match or Image_Format_UNKNOWN if no suitable fit).

◆ Internal()

GLint OpenGl_TextureFormat::Internal ( ) const
inline

Returns OpenGL internal format of the pixel data (example: GL_R32F).

◆ InternalFormat()

GLint OpenGl_TextureFormat::InternalFormat ( ) const
inline

Returns OpenGL internal format of the pixel data (example: GL_R32F).

◆ IsSRGB()

bool OpenGl_TextureFormat::IsSRGB ( ) const
inline

Return TRUE if internal texture format is sRGB(A).

◆ IsValid()

bool OpenGl_TextureFormat::IsValid ( ) const
inline

Return TRUE if format is defined.

◆ NbComponents()

GLint OpenGl_TextureFormat::NbComponents ( ) const
inline

Returns number of components (channels). Here for debugging purposes.

◆ PixelFormat()

GLenum OpenGl_TextureFormat::PixelFormat ( ) const
inline

Returns OpenGL format of the pixel data (example: GL_RED).

◆ SetDataType()

void OpenGl_TextureFormat::SetDataType ( GLint  theType)
inline

Sets OpenGL data type of the pixel data.

◆ SetImageFormat()

void OpenGl_TextureFormat::SetImageFormat ( Image_Format  theFormat)
inline

Sets image format.

◆ SetInternalFormat()

void OpenGl_TextureFormat::SetInternalFormat ( GLint  theInternal)
inline

Sets texture internal format.

◆ SetNbComponents()

void OpenGl_TextureFormat::SetNbComponents ( GLint  theNbComponents)
inline

Sets number of components (channels).

◆ SetPixelFormat()

void OpenGl_TextureFormat::SetPixelFormat ( GLenum  theFormat)
inline

Sets OpenGL format of the pixel data.


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