|
CGVIS Utils
|
OpenGL cube map texture (6 faces) with convenience upload helpers. More...
#include <GLTextureCube.h>
Public Member Functions | |
| GLTextureCube (GLint magFilter=GL_NEAREST, GLint minFilter=GL_NEAREST, GLint wrapX=GL_CLAMP_TO_EDGE, GLint wrapY=GL_CLAMP_TO_EDGE, GLint wrapZ=GL_CLAMP_TO_EDGE) | |
| Create an empty cube map and apply sampler parameters. | |
| ~GLTextureCube () | |
| Destroy and delete the GL texture name. | |
| GLTextureCube (const Image &image0, const Image &image1, const Image &image2, const Image &image3, const Image &image4, const Image &image5, GLint magFilter=GL_NEAREST, GLint minFilter=GL_NEAREST, GLint wrapX=GL_REPEAT, GLint wrapY=GL_REPEAT) | |
| Construct and upload six faces from images. | |
| GLTextureCube (const GLTextureCube &other) | |
| Copy‑construct and duplicate texture contents and parameters. | |
| GLTextureCube & | operator= (const GLTextureCube &other) |
| Copy‑assign and duplicate texture contents and parameters. | |
| const GLuint | getId () const |
| Retrieve the OpenGL texture object name. | |
| void | clear () |
| Clear the texture by reinitializing the current storage. | |
| void | setEmpty (uint32_t width, uint32_t height, uint8_t componentCount, GLDataType dataType=GLDataType::BYTE) |
| Allocate empty storage for all six faces. | |
| void | setData (const Image &image, Face face) |
| Upload one face from an Image (unsigned bytes). | |
| void | setData (const std::vector< GLubyte > &data, uint32_t width, uint32_t height, Face face, uint8_t componentCount=4) |
| Upload one face from unsigned‑byte data with explicit dimensions. | |
| void | setData (const std::vector< GLubyte > &data, Face face) |
| Upload one face from unsigned‑byte data using existing dimensions. | |
| void | setData (const std::vector< GLfloat > &data, uint32_t width, uint32_t height, Face face, uint8_t componentCount=4) |
| Upload one face from 32‑bit float data with explicit dimensions. | |
| void | setData (const std::vector< GLfloat > &data, Face face) |
| Upload one face from 32‑bit float data using existing dimensions. | |
| void | setData (const std::vector< GLhalf > &data, uint32_t width, uint32_t height, Face face, uint8_t componentCount=4) |
| Upload one face from 16‑bit half‑float data with explicit dimensions. | |
| void | setData (const std::vector< GLhalf > &data, Face face) |
| Upload one face from 16‑bit half‑float data using existing dimensions. | |
| void | setFilter (GLint magFilter, GLint minFilter) |
| Update filtering parameters on the bound cube map. | |
| void | generateMipmap () |
| Generate mipmaps for the cube map. | |
Introspection | |
| uint32_t | getHeight () const |
| Face height in texels. | |
| uint32_t | getWidth () const |
| Face width in texels. | |
| uint32_t | getComponentCount () const |
| Components per texel (1..4). | |
| uint32_t | getSize () const |
| Elements per face. | |
| GLDataType | getType () const |
| Element type (BYTE/HALF/FLOAT). | |
OpenGL cube map texture (6 faces) with convenience upload helpers.
| GLTextureCube::GLTextureCube | ( | GLint | magFilter = GL_NEAREST, |
| GLint | minFilter = GL_NEAREST, | ||
| GLint | wrapX = GL_CLAMP_TO_EDGE, | ||
| GLint | wrapY = GL_CLAMP_TO_EDGE, | ||
| GLint | wrapZ = GL_CLAMP_TO_EDGE ) |
Create an empty cube map and apply sampler parameters.
| magFilter | GL magnification filter (e.g., GL_NEAREST/GL_LINEAR). |
| minFilter | GL minification filter (e.g., GL_NEAREST/GL_LINEAR). |
| wrapX | GL wrap mode for S (x) coordinate (e.g., GL_CLAMP_TO_EDGE). |
| wrapY | GL wrap mode for T (y) coordinate. |
| wrapZ | GL wrap mode for R (z) coordinate. |
| GLTextureCube::~GLTextureCube | ( | ) |
Destroy and delete the GL texture name.
| GLTextureCube::GLTextureCube | ( | const Image & | image0, |
| const Image & | image1, | ||
| const Image & | image2, | ||
| const Image & | image3, | ||
| const Image & | image4, | ||
| const Image & | image5, | ||
| GLint | magFilter = GL_NEAREST, | ||
| GLint | minFilter = GL_NEAREST, | ||
| GLint | wrapX = GL_REPEAT, | ||
| GLint | wrapY = GL_REPEAT ) |
Construct and upload six faces from images.
| image0..image5 | Source images corresponding to faces; see setData(Image,Face). |
| magFilter | GL magnification filter. |
| minFilter | GL minification filter. |
| wrapX | GL wrap mode for S. |
| wrapY | GL wrap mode for T. |
| GLTextureCube::GLTextureCube | ( | const GLTextureCube & | other | ) |
Copy‑construct and duplicate texture contents and parameters.
| void GLTextureCube::clear | ( | ) |
Clear the texture by reinitializing the current storage.
| void GLTextureCube::generateMipmap | ( | ) |
Generate mipmaps for the cube map.
|
inline |
Components per texel (1..4).
|
inline |
Face height in texels.
| const GLuint GLTextureCube::getId | ( | ) | const |
Retrieve the OpenGL texture object name.
|
inline |
Elements per face.
|
inline |
Element type (BYTE/HALF/FLOAT).
|
inline |
Face width in texels.
| GLTextureCube & GLTextureCube::operator= | ( | const GLTextureCube & | other | ) |
Copy‑assign and duplicate texture contents and parameters.
Upload one face from an Image (unsigned bytes).
| image | Source image (bytes, interleaved). |
| face | Destination face. |
| void GLTextureCube::setData | ( | const std::vector< GLfloat > & | data, |
| Face | face ) |
Upload one face from 32‑bit float data using existing dimensions.
| data | Interleaved floats of size getSize(). |
| face | Destination face. |
| void GLTextureCube::setData | ( | const std::vector< GLfloat > & | data, |
| uint32_t | width, | ||
| uint32_t | height, | ||
| Face | face, | ||
| uint8_t | componentCount = 4 ) |
Upload one face from 32‑bit float data with explicit dimensions.
| data | Interleaved floats of size componentCount*width*height. |
| width | Width in texels. |
| height | Height in texels. |
| face | Destination face. |
| componentCount | Components per texel (default 4 = RGBA). |
| GLException | if sizes do not match. |
| void GLTextureCube::setData | ( | const std::vector< GLhalf > & | data, |
| Face | face ) |
Upload one face from 16‑bit half‑float data using existing dimensions.
| data | Interleaved half‑floats of size getSize(). |
| face | Destination face. |
| void GLTextureCube::setData | ( | const std::vector< GLhalf > & | data, |
| uint32_t | width, | ||
| uint32_t | height, | ||
| Face | face, | ||
| uint8_t | componentCount = 4 ) |
Upload one face from 16‑bit half‑float data with explicit dimensions.
| data | Interleaved half‑floats of size componentCount*width*height. |
| width | Width in texels. |
| height | Height in texels. |
| face | Destination face. |
| componentCount | Components per texel (default 4 = RGBA). |
| GLException | if sizes do not match. |
| void GLTextureCube::setData | ( | const std::vector< GLubyte > & | data, |
| Face | face ) |
Upload one face from unsigned‑byte data using existing dimensions.
| data | Interleaved pixel bytes of size getSize(). |
| face | Destination face. |
| void GLTextureCube::setData | ( | const std::vector< GLubyte > & | data, |
| uint32_t | width, | ||
| uint32_t | height, | ||
| Face | face, | ||
| uint8_t | componentCount = 4 ) |
Upload one face from unsigned‑byte data with explicit dimensions.
| data | Interleaved pixel bytes of size componentCount*width*height. |
| width | Width in texels. |
| height | Height in texels. |
| face | Destination face. |
| componentCount | Components per texel (default 4 = RGBA). |
| GLException | if sizes do not match. |
| void GLTextureCube::setEmpty | ( | uint32_t | width, |
| uint32_t | height, | ||
| uint8_t | componentCount, | ||
| GLDataType | dataType = GLDataType::BYTE ) |
Allocate empty storage for all six faces.
| width | Width in texels for each face. |
| height | Height in texels for each face. |
| componentCount | Components per texel (1..4). |
| dataType | Element type (BYTE/HALF/FLOAT). |
| void GLTextureCube::setFilter | ( | GLint | magFilter, |
| GLint | minFilter ) |
Update filtering parameters on the bound cube map.
| magFilter | GL magnification filter. |
| minFilter | GL minification filter. |