cesium-native  0.41.0
CesiumGltf::TextureViewOptions Struct Reference

Describes options for constructing a view on a glTF texture. More...

#include <CesiumGltf/TextureView.h>

Public Attributes

bool applyKhrTextureTransformExtension = false
 Whether to automatically apply the KHR_texture_transform extension to the texture view, if it exists. More...
 
bool makeImageCopy = false
 Whether to copy the input image. More...
 

Detailed Description

Describes options for constructing a view on a glTF texture.

Definition at line 18 of file TextureView.h.

Member Data Documentation

◆ applyKhrTextureTransformExtension

bool CesiumGltf::TextureViewOptions::applyKhrTextureTransformExtension = false

Whether to automatically apply the KHR_texture_transform extension to the texture view, if it exists.

A glTF texture may contain the KHR_texture_transform extension, which transforms the texture coordinates used to sample the texture. The extension may also override the TEXCOORD set index that was specified by the original texture info.

If a view is constructed with applyKhrTextureTransformExtension set to true, it should automatically apply the texture transform to any UV coordinates used to sample the texture. If the extension defines its own TEXCOORD set index, it will override the original value.

Otherwise, if the flag is set to false, UVs will not be transformed and the original TEXCOORD set index will be preserved. The extension's values may still be retrieved using getTextureTransform, if desired.

Definition at line 37 of file TextureView.h.

◆ makeImageCopy

bool CesiumGltf::TextureViewOptions::makeImageCopy = false

Whether to copy the input image.

By default, a view is constructed on the input glTF image without copying its pixels. This can be problematic for clients that move or delete the original glTF model. When this flag is true, the view will manage its own copy of the pixel data to avoid such issues.

Definition at line 47 of file TextureView.h.


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