3#include <CesiumGltf/ImageAsset.h>
4#include <CesiumGltf/KhrTextureTransform.h>
5#include <CesiumGltf/Sampler.h>
6#include <CesiumGltf/TextureInfo.h>
7#include <CesiumUtility/IntrusivePointer.h>
132 int64_t textureCoordinateSetIndex,
143 return this->_textureViewStatus;
155 if (this->_applyTextureTransform && this->_textureTransform) {
156 return this->_textureTransform->getTexCoordSetIndex().value_or(
157 this->_texCoordSetIndex);
159 return this->_texCoordSetIndex;
180 if (this->_pImageCopy) {
181 return this->_pImageCopy.get();
183 return this->_pImage.get();
199 return this->_textureTransform;
211 const std::vector<int64_t>& channels)
const noexcept;
218 int64_t _texCoordSetIndex;
220 bool _applyTextureTransform;
221 std::optional<KhrTextureTransform> _textureTransform;
A view into the texture data of a single texture from a Model.
const Sampler * getSampler() const noexcept
Get the sampler describing how to sample the data from the property's texture.
std::optional< KhrTextureTransform > getTextureTransform() const noexcept
Get the KHR_texture_transform for this texture if it exists.
TextureViewStatus getTextureViewStatus() const noexcept
Get the status of this texture view.
TextureView() noexcept
Constructs an empty, uninitialized texture view.
const ImageAsset * getImage() const noexcept
Get the image containing this property's data. If this view was constructed with options....
int64_t getTexCoordSetIndex() const noexcept
Get the texture coordinate set index for this view. If this view was constructed with options....
std::vector< uint8_t > sampleNearestPixel(double u, double v, const std::vector< int64_t > &channels) const noexcept
Samples the image at the specified texture coordinates using NEAREST pixel filtering,...
A smart pointer that calls addReference and releaseReference on the controlled object.
Classes for working with glTF models.
TextureViewStatus
Indicates the status of a texture view.
@ ErrorInvalidBytesPerChannel
The image for this texture has channels that take up more than a byte. Only single-byte channels are ...
@ ErrorEmptyImage
This feature ID texture has an empty image.
@ ErrorUninitialized
This view has not yet been initialized.
@ ErrorInvalidSampler
This feature ID texture has a sampler index that doesn't exist in the glTF.
@ ErrorInvalidImage
This feature ID texture has an image index that doesn't exist in the glTF.
@ ErrorInvalidTexture
This feature ID texture has a texture index that doesn't exist in the glTF.
@ Valid
This accessor is valid and ready to use.
glTF extension that enables shifting and scaling UV coordinates on a per-texture basis
A 2D image asset, including its pixel data. The image may have mipmaps, and it may be encoded in a GP...
This class is not meant to be instantiated directly. Use Model instead.
Texture sampler properties for filtering and wrapping modes.
Describes options for constructing a view on a glTF texture.
bool makeImageCopy
Whether to copy the input image.
bool applyKhrTextureTransformExtension
Whether to automatically apply the KHR_texture_transform extension to the texture view,...