cesium-native  0.41.0
FeatureIdTextureView.h
1 #pragma once
2 
3 #include "CesiumGltf/FeatureIdTexture.h"
4 #include "CesiumGltf/TextureView.h"
5 
6 #include <cstdint>
7 
8 namespace CesiumGltf {
9 
10 struct Model;
11 
23  Valid,
24 
29 
35 
41 
47 
52 
58 
66 };
67 
75 public:
80 
104  const Model& model,
105  const FeatureIdTexture& featureIdTexture,
106  const TextureViewOptions& options = TextureViewOptions()) noexcept;
107 
118  int64_t getFeatureID(double u, double v) const noexcept;
119 
125  FeatureIdTextureViewStatus status() const noexcept { return this->_status; }
126 
131  std::vector<int64_t> getChannels() const noexcept { return this->_channels; }
132 
133 private:
135  std::vector<int64_t> _channels;
136 };
137 } // namespace CesiumGltf
A view on the image data of FeatureIdTexture.
FeatureIdTextureViewStatus status() const noexcept
Get the status of this view.
FeatureIdTextureView() noexcept
Constructs an uninitialized and invalid view.
std::vector< int64_t > getChannels() const noexcept
Get the channels of this feature ID texture. The channels represent the bytes of the actual feature I...
int64_t getFeatureID(double u, double v) const noexcept
Get the feature ID from the texture at the given texture coordinates. If the texture is somehow inval...
Classes for working with glTF models.
FeatureIdTextureViewStatus
The status of a feature ID texture view.
@ ErrorInvalidImageBytesPerChannel
The image for this feature ID texture has channels that take up more than a byte. Only single-byte ch...
@ ErrorEmptyImage
This feature ID texture has an empty image.
@ ErrorUninitialized
This view has not yet been initialized.
@ Valid
This view is valid and ready to use.
@ ErrorInvalidChannels
The channels of this feature ID texture property are invalid. Channels must be in the range 0-3,...
@ 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.
A texture containing feature IDs.
The root object for a glTF asset.
Definition: Model.h:14
Describes options for constructing a view on a glTF texture.
Definition: TextureView.h:18