|
CGVIS Utils
|
#include <GLTexture3D.h>
Public Member Functions | |
| GLTexture3D (GLint magFilter=GL_NEAREST, GLint minFilter=GL_NEAREST, GLint wrapX=GL_REPEAT, GLint wrapY=GL_REPEAT, GLint wrapZ=GL_REPEAT) | |
| Create an empty GL_TEXTURE_3D and set sampler parameters. | |
| ~GLTexture3D () | |
| Destroy and delete the GL texture name. | |
| GLTexture3D (const GLTexture3D &other) | |
| Copy-construct and duplicate texture contents and parameters. | |
| GLTexture3D & | operator= (GLTexture3D other) |
| Copy-assign and duplicate texture contents and parameters. | |
| const GLuint | getId () const |
| Retrieve the OpenGL texture object name. | |
| void | clear () |
| Clear the texture to an empty image preserving dimensions/type. | |
| void | setEmpty (uint32_t width, uint32_t height, uint32_t depth, uint8_t componentCount, bool isFloat=false) |
| Allocate an empty texture of given size and format. | |
| void | setData (const std::vector< GLubyte > &data, uint32_t width, uint32_t height, uint32_t depth, uint8_t componentCount=4) |
| Upload unsigned-byte data with explicit dimensions. | |
| void | setData (const std::vector< GLubyte > &data) |
| Upload unsigned-byte data using previously set dimensions. | |
| void | setData (const std::vector< GLfloat > &data, uint32_t width, uint32_t height, uint32_t depth, uint8_t componentCount=4) |
| Upload 32-bit float data with explicit dimensions. | |
| void | setData (const std::vector< GLfloat > &data) |
| Upload 32-bit float data using previously set dimensions. | |
| const std::vector< GLubyte > & | getDataByte () |
| Read back raw unsigned bytes via glGetTexImage. | |
| const std::vector< GLfloat > & | getDataFloat () |
| Read back raw floats via glGetTexImage. | |
Introspection | |
| uint32_t | getHeight () const |
| Texture height (texels). | |
| uint32_t | getWidth () const |
| Texture width (texels). | |
| uint32_t | getDepth () const |
| Texture depth (texels). | |
| uint32_t | getComponentCount () const |
| Components per texel (1..4). | |
| uint32_t | getSize () const |
| Total number of elements (width*height*depth*components). | |
| bool | getIsFloat () const |
| True if the storage/type is floating point. | |
| GLTexture3D::GLTexture3D | ( | GLint | magFilter = GL_NEAREST, |
| GLint | minFilter = GL_NEAREST, | ||
| GLint | wrapX = GL_REPEAT, | ||
| GLint | wrapY = GL_REPEAT, | ||
| GLint | wrapZ = GL_REPEAT ) |
Create an empty GL_TEXTURE_3D and set 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_REPEAT). |
| wrapY | GL wrap mode for T (y) coordinate. |
| wrapZ | GL wrap mode for R (z) coordinate. |
| GLTexture3D::~GLTexture3D | ( | ) |
Destroy and delete the GL texture name.
| GLTexture3D::GLTexture3D | ( | const GLTexture3D & | other | ) |
Copy-construct and duplicate texture contents and parameters.
| void GLTexture3D::clear | ( | ) |
Clear the texture to an empty image preserving dimensions/type.
|
inline |
Components per texel (1..4).
| const std::vector< GLubyte > & GLTexture3D::getDataByte | ( | ) |
Read back raw unsigned bytes via glGetTexImage.
| const std::vector< GLfloat > & GLTexture3D::getDataFloat | ( | ) |
Read back raw floats via glGetTexImage.
|
inline |
Texture depth (texels).
|
inline |
Texture height (texels).
| const GLuint GLTexture3D::getId | ( | ) | const |
Retrieve the OpenGL texture object name.
|
inline |
True if the storage/type is floating point.
|
inline |
Total number of elements (width*height*depth*components).
|
inline |
Texture width (texels).
| GLTexture3D & GLTexture3D::operator= | ( | GLTexture3D | other | ) |
Copy-assign and duplicate texture contents and parameters.
| void GLTexture3D::setData | ( | const std::vector< GLfloat > & | data | ) |
Upload 32-bit float data using previously set dimensions.
| data | Interleaved float pixels of size getSize()*sizeof(GLfloat). |
| void GLTexture3D::setData | ( | const std::vector< GLfloat > & | data, |
| uint32_t | width, | ||
| uint32_t | height, | ||
| uint32_t | depth, | ||
| uint8_t | componentCount = 4 ) |
Upload 32-bit float data with explicit dimensions.
| data | Interleaved float pixels of size componentCount*width*height*depth*4 bytes. |
| width | Width in texels. |
| height | Height in texels. |
| depth | Depth in texels. |
| componentCount | Components per texel (default 4 = RGBA). |
| GLException | if sizes do not match. |
| void GLTexture3D::setData | ( | const std::vector< GLubyte > & | data | ) |
Upload unsigned-byte data using previously set dimensions.
| data | Interleaved pixel bytes of size getSize(). |
| void GLTexture3D::setData | ( | const std::vector< GLubyte > & | data, |
| uint32_t | width, | ||
| uint32_t | height, | ||
| uint32_t | depth, | ||
| uint8_t | componentCount = 4 ) |
Upload unsigned-byte data with explicit dimensions.
| data | Interleaved pixel bytes of size componentCount*width*height*depth. |
| width | Width in texels. |
| height | Height in texels. |
| depth | Depth in texels. |
| componentCount | Components per texel (default 4 = RGBA). |
| GLException | if sizes do not match. |
| void GLTexture3D::setEmpty | ( | uint32_t | width, |
| uint32_t | height, | ||
| uint32_t | depth, | ||
| uint8_t | componentCount, | ||
| bool | isFloat = false ) |
Allocate an empty texture of given size and format.
| width | Width in texels. |
| height | Height in texels. |
| depth | Depth in texels. |
| componentCount | Components per texel (1..4). |
| isFloat | If true, allocate 32-bit float storage; otherwise unsigned byte. |