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>
129 int64_t textureCoordinateSetIndex,
140 return this->_textureViewStatus;
152 if (this->_applyTextureTransform && this->_textureTransform) {
153 return this->_textureTransform->getTexCoordSetIndex().value_or(
154 this->_texCoordSetIndex);
156 return this->_texCoordSetIndex;
177 if (this->_pImageCopy) {
178 return this->_pImageCopy.get();
180 return this->_pImage.get();
196 return this->_textureTransform;
208 const std::vector<int64_t>& channels)
const noexcept;
215 int64_t _texCoordSetIndex;
217 bool _applyTextureTransform;
218 std::optional<KhrTextureTransform> _textureTransform;
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,...
const ImageAsset * getImage() const noexcept
Get the image containing this property's data. If this view was constructed with options....
TextureViewStatus getTextureViewStatus() const noexcept
Get the status of this texture view.
const Sampler * getSampler() const noexcept
Get the sampler describing how to sample the data from the property's texture.
TextureView() noexcept
Constructs an empty, uninitialized texture view.
int64_t getTexCoordSetIndex() const noexcept
Get the texture coordinate set index for this view. If this view was constructed with options....
std::optional< KhrTextureTransform > getTextureTransform() const noexcept
Get the KHR_texture_transform for this texture if it exists.
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.
@ ErrorEmptyImage
This texture is viewing an empty image.
@ ErrorUninitialized
This texture view has not yet been initialized.
@ Valid
This texture view is valid and ready to use.
@ ErrorInvalidSampler
This texture view does not have a valid sampler index.
@ ErrorInvalidImage
This texture view does not have a valid image index.
@ ErrorInvalidBytesPerChannel
The image for this texture has channels that take up more than a byte. Only single-byte channels are ...
@ ErrorInvalidTexture
This texture view does not have a valid texture index.
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...
The root object for a glTF asset.
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,...