Skip to main content

Post-processing tools 2024 R1

GLTFTexture

Last update: 16.07.2025
1/*
2 * Copyright 2018-2021 ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited.
3 *
4 * Restricted Rights Legend
5 *
6 * Use, duplication, or disclosure of this
7 * software and its documentation by the
8 * Government is subject to restrictions as
9 * set forth in subdivision [(b)(3)(ii)] of
10 * the Rights in Technical Data and Computer
11 * Software clause at 52.227-7013.
12 */
13#ifndef __INCLUDED_GLTF_GLTFTEXTURE__
14#define __INCLUDED_GLTF_GLTFTEXTURE__
15
16#include "GLTFCommon.h"
17#include "GLTFObject.h"
18
19namespace ANSYS { namespace Nexus { namespace GLTFWriter {
20 class GLTF;
21 class Image;
22 class Sampler;
23
27 class Texture : public Object
28 {
29 public:
32 {
33// TF_ALPHA = 6406,
34 TF_RGB = 6407,
35 TF_RGBA = 6408
36// TF_LUMINANCE = 6409,
37// TF_LUMINANCE_ALPHA = 6410
38 };
39
42 {
43 TT_TEXTURE_2D = 3553
44// TT_TEXTURE_CUBE_MAP = 34067
45 };
46
47 protected:
48 virtual ~Texture() {}
49
50 public:
53 static GLTFWRITERSPEC Texture *Create(GLTF *gltf,
54 TextureFormat format,
55 TextureTarget target,
56 Sampler *sampler,
57 Image *image
58 );
61 static GLTFWRITERSPEC Texture *Create(GLTF *gltf,
62 TextureFormat format,
63 unsigned int numColors,
64 const unsigned char *colors,
65 bool smooth = true,
66 unsigned int numBands = 0,
67 const float *bandLocations = 0
68 );
71 static GLTFWRITERSPEC Texture *Create(GLTF *gltf,
72 TextureFormat format,
73 unsigned int width,
74 unsigned int height,
75 unsigned char *data
76 );
77 };
78
79} } }
80
81#endif
This is the main class of the GLTFWriter.
Definition: GLTFGLTF.h:32
Images define texture data.
Definition: GLTFImage.h:27
Samplers define how values are generated from textures with the give texture coordinates.
Definition: GLTFSampler.h:26
Textures are images that can be used to color a primitive.
Definition: GLTFTexture.h:28
static Texture * Create(GLTF *gltf, TextureFormat format, TextureTarget target, Sampler *sampler, Image *image)
static Texture * Create(GLTF *gltf, TextureFormat format, unsigned int width, unsigned int height, unsigned char *data)
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)
@ TT_TEXTURE_2D
texture is 2 dimensional.
Definition: GLTFTexture.h:43
@ TF_RGB
3 unsigned chars per pixel.
Definition: GLTFTexture.h:34
@ TF_RGBA
4 unsigned chars per pixel.
Definition: GLTFTexture.h:35
GLTFWriter API Documentation.
Definition: GLTFAnimation.h:19

Connect with Ansys