ANSYS::Nexus::GLTFWriter::Texture Class Reference
Last update: 17.04.2023Textures are images that can be used to color a primitive. More...
#include <GLTFWriter.h>
Inheritance diagram for ANSYS::Nexus::GLTFWriter::Texture:
Public Types | |
enum | TextureFormat { TF_RGB = 6407 , TF_RGBA = 6408 } |
enum | TextureTarget { TT_TEXTURE_2D = 3553 } |
Static Public Member Functions | |
static Texture * | Create (GLTF *gltf, TextureFormat format, TextureTarget target, Sampler *sampler, Image *image) |
static Texture * | Create (GLTF *gltf, TextureFormat format, unsigned int numColors, const unsigned char *colors, bool smooth=true, unsigned int numBands=0, const float *bandLocations=0) |
static Texture * | Create (GLTF *gltf, TextureFormat format, unsigned int width, unsigned int height, unsigned char *data) |
Detailed Description
Textures are images that can be used to color a primitive.
Definition at line 27 of file GLTFTexture.h.
Member Enumeration Documentation
◆ TextureFormat
Format of image data or color data
Enumerator | |
---|---|
TF_RGB | 3 unsigned chars per pixel. |
TF_RGBA | 4 unsigned chars per pixel. |
Definition at line 31 of file GLTFTexture.h.
◆ TextureTarget
Texture targets
Enumerator | |
---|---|
TT_TEXTURE_2D | texture is 2 dimensional. |
Definition at line 41 of file GLTFTexture.h.
Member Function Documentation
◆ Create() [1/3]
|
static |
Creates a texture from an Image and Sampler.
- Returns
- Texture object. Do not delete this pointer.
- Parameters
-
[in] gltf GLTF object. [in] format Texture::TextureFormat describing image data. [in] target Must be Texture::TextureTarget = TT_TEXTURE_2D. [in] sampler Sampler object. [in] image Image object.
- Examples
- Test001.cpp, Test002.cpp, Test005.cpp, Test009.cpp, Test013.cpp, and Test014.cpp.
◆ Create() [2/3]
|
static |
Creates a texture from a 1D array of colors. Colors are linearly (not logaritmically) interpolated. The Sampler and Image are created internally.
- Returns
- Texture object. Do not delete this pointer.
- Parameters
-
[in] gltf GLTF object. [in] format Texture::TextureFormat describing color data. [in] numColors Number of colors in colors. [in] colors 1D array of RGB or RGBA tuple of colors. [in] smooth Optional, flag indicating whether to create banded texture or smooth gradient texture. [in] numBands Optional, If smooth is false, indicates number of bands to create from colors [in] bandLocations Optional, If smooth is false, indicates locations of start of band within texture, specified as fraction from 0 to 1. bandLocation size is specified by numBands.
◆ Create() [3/3]
|
static |
Creates a texture from a 2D array of colors. The Sampler and Image are created internally.
- Returns
- Texture object. Do not delete this pointer.
- Parameters
-
[in] gltf GLTF object. [in] format Texture::TextureFormat describing color array data. [in] width Width of image data. [in] height Height of image data. [in] data 2D array of RGB or RGBA tuple of colors
The documentation for this class was generated from the following file:
- D:/ANSYSDev/NoBackup/branches/EnSight-Second-Coming/webgl_viewer/gltfwriterlib/include/GLTFTexture.h