cesium-native  0.41.0
CesiumGltf::AccessorSpec Struct Reference

A typed view into a buffer view that contains raw binary data. More...

#include <CesiumGltf/AccessorSpec.h>

Inheritance diagram for CesiumGltf::AccessorSpec:
CesiumGltf::NamedObject CesiumUtility::ExtensibleObject CesiumGltf::Accessor

Classes

struct  ComponentType
 Known values for The datatype of the accessor's components. More...
 
struct  Type
 Known values for Specifies if the accessor's elements are scalars, vectors, or matrices. More...
 

Public Attributes

int32_t bufferView = -1
 The index of the bufferView. More...
 
int64_t byteOffset = 0
 The offset relative to the start of the buffer view in bytes. More...
 
int32_t componentType = ComponentType::BYTE
 The datatype of the accessor's components. More...
 
bool normalized = false
 Specifies whether integer data values are normalized before usage. More...
 
int64_t count = int64_t()
 The number of elements referenced by this accessor. More...
 
std::string type = Type::SCALAR
 Specifies if the accessor's elements are scalars, vectors, or matrices. More...
 
std::vector< double > max
 Maximum value of each component in this accessor. More...
 
std::vector< double > min
 Minimum value of each component in this accessor. More...
 
std::optional< CesiumGltf::AccessorSparsesparse
 Sparse storage of elements that deviate from their initialization value.
 
- Public Attributes inherited from CesiumGltf::NamedObject
std::string name
 The user-defined name of this object. More...
 
- Public Attributes inherited from CesiumUtility::ExtensibleObject
std::unordered_map< std::string, std::any > extensions
 The extensions attached to this object. More...
 
JsonValue::Object extras
 Application-specific data. More...
 
JsonValue::Object unknownProperties
 Unknown properties that exist on this object but do not have any representation in the statically-typed classes. More...
 

Static Public Attributes

static constexpr const char * TypeName = "Accessor"
 

Friends

struct Accessor
 

Additional Inherited Members

- Public Member Functions inherited from CesiumUtility::ExtensibleObject
template<typename T >
bool hasExtension () const noexcept
 Checks if an extension exists given its static type. More...
 
template<typename T >
const T * getExtension () const noexcept
 Gets an extension given its static type. More...
 
template<typename T >
T * getExtension () noexcept
 Gets an extension given its static type. More...
 
const JsonValuegetGenericExtension (const std::string &extensionName) const noexcept
 Gets a generic extension with the given name as a CesiumUtility::JsonValue. More...
 
JsonValuegetGenericExtension (const std::string &extensionName) noexcept
 Gets a generic extension with the given name as a CesiumUtility::JsonValue. More...
 
template<typename T , typename... ConstructorArgumentTypes>
T & addExtension (ConstructorArgumentTypes &&... constructorArguments)
 Adds a statically-typed extension to this object. More...
 
template<typename T >
void removeExtension ()
 Removes a statically-typed extension from this object. More...
 

Detailed Description

A typed view into a buffer view that contains raw binary data.

Definition at line 18 of file AccessorSpec.h.

Member Data Documentation

◆ bufferView

int32_t CesiumGltf::AccessorSpec::bufferView = -1

The index of the bufferView.

The index of the buffer view. When undefined, the accessor MUST be initialized with zeros; sparse property or extensions MAY override zeros with actual values.

Definition at line 73 of file AccessorSpec.h.

◆ byteOffset

int64_t CesiumGltf::AccessorSpec::byteOffset = 0

The offset relative to the start of the buffer view in bytes.

This MUST be a multiple of the size of the component datatype. This property MUST NOT be defined when bufferView is undefined.

Definition at line 81 of file AccessorSpec.h.

◆ componentType

int32_t CesiumGltf::AccessorSpec::componentType = ComponentType::BYTE

The datatype of the accessor's components.

Known values are defined in ComponentType.

UNSIGNED_INT type MUST NOT be used for any accessor that is not referenced by mesh.primitive.indices.

Definition at line 92 of file AccessorSpec.h.

◆ count

int64_t CesiumGltf::AccessorSpec::count = int64_t()

The number of elements referenced by this accessor.

The number of elements referenced by this accessor, not to be confused with the number of bytes or number of components.

Definition at line 110 of file AccessorSpec.h.

◆ max

std::vector<double> CesiumGltf::AccessorSpec::max

Maximum value of each component in this accessor.

Array elements MUST be treated as having the same data type as accessor's componentType. Both min and max arrays have the same length. The length is determined by the value of the type property; it can be 1, 2, 3, 4, 9, or 16.

normalized property has no effect on array values: they always correspond to the actual values stored in the buffer. When the accessor is sparse, this property MUST contain maximum values of accessor data with sparse substitution applied.

Definition at line 134 of file AccessorSpec.h.

◆ min

std::vector<double> CesiumGltf::AccessorSpec::min

Minimum value of each component in this accessor.

Array elements MUST be treated as having the same data type as accessor's componentType. Both min and max arrays have the same length. The length is determined by the value of the type property; it can be 1, 2, 3, 4, 9, or 16.

normalized property has no effect on array values: they always correspond to the actual values stored in the buffer. When the accessor is sparse, this property MUST contain minimum values of accessor data with sparse substitution applied.

Definition at line 149 of file AccessorSpec.h.

◆ normalized

bool CesiumGltf::AccessorSpec::normalized = false

Specifies whether integer data values are normalized before usage.

Specifies whether integer data values are normalized (true) to [0, 1] (for unsigned types) or to [-1, 1] (for signed types) when they are accessed. This property MUST NOT be set to true for accessors with FLOAT or UNSIGNED_INT component type.

Definition at line 102 of file AccessorSpec.h.

◆ type

std::string CesiumGltf::AccessorSpec::type = Type::SCALAR

Specifies if the accessor's elements are scalars, vectors, or matrices.

Known values are defined in Type.

Definition at line 119 of file AccessorSpec.h.


The documentation for this struct was generated from the following file: