cesium-native
0.41.0
|
Public Member Functions | |
TextureView () noexcept | |
Constructs an empty, uninitialized texture view. | |
TextureView (const Model &model, const TextureInfo &textureInfo, const TextureViewOptions &options=TextureViewOptions()) noexcept | |
Constructs a view of the texture specified by the given TextureInfo. More... | |
TextureView (const Sampler &sampler, const ImageAsset &image, int64_t textureCoordinateSetIndex, const ExtensionKhrTextureTransform *pKhrTextureTransformExtension=nullptr, const TextureViewOptions &options=TextureViewOptions()) noexcept | |
Constructs a view of the texture specified by the given Sampler and ImageAsset. More... | |
TextureViewStatus | getTextureViewStatus () const noexcept |
Get the status of this texture view. More... | |
int64_t | getTexCoordSetIndex () const noexcept |
Get the texture coordinate set index for this view. If this view was constructed with options.applyKhrTextureTransformExtension as true, and if the texture contains the KHR_texture_transform extension, then this will return the value from the extension since it is meant to override the original index. However, if the extension does not specify a TEXCOORD set index, then the original index of the texture is returned. | |
const Sampler * | getSampler () const noexcept |
Get the sampler describing how to sample the data from the property's texture. More... | |
const ImageAsset * | getImage () const noexcept |
Get the image containing this property's data. If this view was constructed with options.makeImageCopy set to true, this will return a pointer to the copied image. More... | |
std::optional< KhrTextureTransform > | getTextureTransform () const noexcept |
Get the KHR_texture_transform for this texture if it exists. More... | |
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, returning the bytes as uint8_t values. A channels vector must be supplied to specify how many image channels are needed, and in what order the bytes should be retrieved. | |
Definition at line 95 of file TextureView.h.
|
noexcept |
Constructs a view of the texture specified by the given TextureInfo.
model | The glTF model in which to look for the texture's data. |
textureInfo | The texture info to create a view for. |
options | The options for constructing the view. |
|
noexcept |
Constructs a view of the texture specified by the given Sampler and ImageAsset.
sampler | The Sampler used by the texture. |
image | The ImageAsset used by the texture. |
textureCoordinateSetIndex | The set index for the TEXCOORD_n attribute used to sample this texture. |
pKhrTextureTransformExtension | A pointer to the KHR_texture_transform extension on the texture, if it exists. |
options | The options for constructing the view. |
|
inlinenoexcept |
Get the image containing this property's data. If this view was constructed with options.makeImageCopy set to true, this will return a pointer to the copied image.
This will be nullptr if the texture view runs into problems during construction.
Definition at line 176 of file TextureView.h.
|
inlinenoexcept |
Get the sampler describing how to sample the data from the property's texture.
This will be nullptr if the property texture property view runs into problems during construction.
Definition at line 166 of file TextureView.h.
|
inlinenoexcept |
Get the KHR_texture_transform for this texture if it exists.
Even if this view was constructed with options.applyKhrTextureTransformExtension set to false, it will save the extension's values, and they may be retrieved through this function.
If this view was constructed with applyKhrTextureTransformExtension set to true, any texture coordinates passed into get
or getRaw
will be automatically transformed, so there's no need to re-apply the transform here.
Definition at line 195 of file TextureView.h.
|
inlinenoexcept |
Get the status of this texture view.
If invalid, it will not be safe to sample from this view.
Definition at line 139 of file TextureView.h.