|
cesium-native 0.62.0
|
A view of the normalized data specified by a PropertyTextureProperty.
More...
#include <CesiumGltf/PropertyTexturePropertyView.h>
Public Member Functions | |
| PropertyTexturePropertyView () noexcept | |
| Constructs an invalid instance for a non-existent property. | |
| PropertyTexturePropertyView (PropertyViewStatusType status) noexcept | |
| Constructs an invalid instance for an erroneous property. | |
| PropertyTexturePropertyView (const ClassProperty &classProperty) noexcept | |
Constructs an instance of an empty property that specifies a default value. Although this property has no data, it can return the default value when PropertyTexturePropertyView<ElementType, true>::get is called. However, PropertyTexturePropertyView<ElementType, true>::getRaw cannot be used. | |
| PropertyTexturePropertyView (const PropertyTextureProperty &property, const ClassProperty &classProperty, const Sampler &sampler, const CesiumImage::ImageAsset &image, const TextureViewOptions &options=TextureViewOptions()) noexcept | |
| Construct a view of the data specified by a PropertyTextureProperty. | |
| std::optional< PropertyValueViewToCopy< NormalizedType > > | get (double u, double v) const noexcept |
| Gets the value of the property for the given texture coordinates with all value transforms applied. That is, if the property specifies an offset and scale, they will be applied to the value before the value is returned. The sampler's wrapping mode will be used when sampling the texture. | |
| PropertyValueViewToCopy< ElementType > | getRaw (double u, double v) const noexcept |
| Gets the raw value of the property for the given texture coordinates. The sampler's wrapping mode will be used when sampling the texture. | |
| const std::vector< int64_t > & | getChannels () const noexcept |
| Gets the channels of this property texture property. | |
| const std::string & | getSwizzle () const noexcept |
| Gets this property's channels as a swizzle string. | |
Public Member Functions inherited from CesiumGltf::PropertyView< ElementType, true > | |
| PropertyView () | |
| Constructs an empty property instance. | |
| PropertyView (const ClassProperty &classProperty) | |
| Constructs a property instance from a class definition only. | |
| PropertyViewStatusType | status () const noexcept |
| Constructs an empty property instance. false>status | |
| const std::optional< std::string > & | name () const noexcept |
| Constructs an empty property instance. false>name | |
| const std::optional< std::string > & | semantic () const noexcept |
| Constructs an empty property instance. false>semantic | |
| const std::optional< std::string > & | description () const noexcept |
| Constructs an empty property instance. false>description | |
| int64_t | arrayCount () const noexcept |
| Constructs an empty property instance. false>arrayCount | |
| bool | normalized () const noexcept |
| Constructs an empty property instance. false>normalized | |
| std::optional< NormalizedType > | offset () const noexcept |
| Constructs an empty property instance. false>offset | |
| std::optional< NormalizedType > | scale () const noexcept |
| Constructs an empty property instance. false>scale | |
| std::optional< NormalizedType > | max () const noexcept |
| Constructs an empty property instance. false>max | |
| std::optional< NormalizedType > | min () const noexcept |
| Constructs an empty property instance. false>min | |
| bool | required () const noexcept |
| Constructs an empty property instance. false>required | |
| std::optional< ElementType > | noData () const noexcept |
| Constructs an empty property instance. false>noData | |
| std::optional< NormalizedType > | defaultValue () const noexcept |
| Constructs an empty property instance. false>defaultValue | |
| PropertyType | propertyType () const noexcept |
| Returns the PropertyType of the property this view is accessing. | |
Public Member Functions inherited from CesiumGltf::TextureView | |
| 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. | |
| TextureView (const Sampler &sampler, const CesiumImage::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 CesiumImage::ImageAsset. | |
| TextureViewStatus | getTextureViewStatus () const noexcept |
| Get the status of this texture view. | |
| 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. | |
| const CesiumImage::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. | |
| std::optional< KhrTextureTransform > | getTextureTransform () const noexcept |
| Get the KHR_texture_transform for this texture if it exists. | |
| 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. | |
Additional Inherited Members | |
Protected Member Functions inherited from CesiumGltf::PropertyView< ElementType, true > | |
| PropertyView (PropertyViewStatusType status) | |
| Constructs an invalid instance for an erroneous property. | |
| PropertyView (const ClassProperty &classProperty, const PropertyTableProperty &property) | |
| Constructs a property instance from a property table property and its class definition. | |
| PropertyView (const ClassProperty &classProperty, const PropertyTextureProperty &property) | |
| Constructs a property instance from a property texture property and its class definition. | |
| PropertyView (const ClassProperty &classProperty, const PropertyAttributeProperty &property) | |
| Constructs a property instance from a property attribute property and its class definition. | |
Protected Attributes inherited from CesiumGltf::PropertyView< ElementType, true > | |
| PropertyViewStatusType | _status |
| Indicates the status of a property view. | |
A view of the normalized data specified by a PropertyTextureProperty.
Provides utilities to sample the property texture property using texture coordinates.
Definition at line 574 of file PropertyTexturePropertyView.h.
|
inlinenoexcept |
Constructs an invalid instance for a non-existent property.
Definition at line 583 of file PropertyTexturePropertyView.h.
|
inlinenoexcept |
Constructs an invalid instance for an erroneous property.
| status | The code from PropertyTexturePropertyViewStatus indicating the error with the property. |
Definition at line 594 of file PropertyTexturePropertyView.h.
|
inlinenoexcept |
Constructs an instance of an empty property that specifies a default value. Although this property has no data, it can return the default value when PropertyTexturePropertyView<ElementType, true>::get is called. However, PropertyTexturePropertyView<ElementType, true>::getRaw cannot be used.
| classProperty | The ClassProperty this property conforms to. |
Definition at line 613 of file PropertyTexturePropertyView.h.
|
inlinenoexcept |
Construct a view of the data specified by a PropertyTextureProperty.
| property | The PropertyTextureProperty |
| classProperty | The ClassProperty this property conforms to. |
| sampler | The Sampler used by the property. |
| image | The CesiumImage::ImageAsset used by the property. |
| options | The options for constructing the view. |
Definition at line 646 of file PropertyTexturePropertyView.h.
|
inlinenoexcept |
Gets the value of the property for the given texture coordinates with all value transforms applied. That is, if the property specifies an offset and scale, they will be applied to the value before the value is returned. The sampler's wrapping mode will be used when sampling the texture.
If this property has a specified "no data" value, and the retrieved element is equal to that value, then this will return the property's specified default value. If the property did not provide a default value, this returns std::nullopt.
| u | The u-component of the texture coordinates. |
| v | The v-component of the texture coordinates. |
Definition at line 729 of file PropertyTexturePropertyView.h.
|
inlinenoexcept |
Gets the channels of this property texture property.
Definition at line 800 of file PropertyTexturePropertyView.h.
|
inlinenoexcept |
Gets the raw value of the property for the given texture coordinates. The sampler's wrapping mode will be used when sampling the texture.
If this property has a specified "no data" value, the raw value will still be returned, even if it equals the "no data" value.
| u | The u-component of the texture coordinates. |
| v | The v-component of the texture coordinates. |
Definition at line 785 of file PropertyTexturePropertyView.h.
|
inlinenoexcept |
Gets this property's channels as a swizzle string.
Definition at line 807 of file PropertyTexturePropertyView.h.