Cesium for Unreal 2.22.1
Loading...
Searching...
No Matches
CesiumMetadataEncodingDetails.h
Go to the documentation of this file.
1// Copyright 2020-2024 CesiumGS, Inc. and Contributors
2
3#pragma once
4
6#include <cstdlib>
7#include <type_traits>
8
9#include "CesiumMetadataEncodingDetails.generated.h"
10
12
13/**
14 * @brief The component type that a metadata property's values will be encoded
15 * as. These correspond to the pixel component types that are supported in
16 * Unreal textures.
17 */
18UENUM()
20
21/**
22 * @brief Gets the best-fitting encoded type for the given metadata component
23 * type.
24 */
27
28/**
29 * @brief The type that a metadata property's values will be encoded as.
30 */
31UENUM()
39
40/**
41 * @brief Gets the best-fitting encoded type for the given metadata type.
42 */
45
46/**
47 * @brief Gets the number of components associated with the given encoded type.
48 * @param type The encoded metadata type.
49 */
50size_t
52
53/**
54 * @brief Indicates how a property value from EXT_structural_metadata should be
55 * converted to a GPU-accessible type, if possible.
56 */
57UENUM()
59 /**
60 * Do nothing. This is typically used for property types that are
61 * completely unable to be coerced.
62 */
64 /**
65 * Coerce the components of a property value to the specified component type.
66 * If the property contains string values, this attempts to parse numbers from
67 * the strings as uint8s.
68 */
70 /**
71 * Attempt to parse a color from a string property value. This supports
72 * the following formats:
73 * - `rgb(R, G, B)`, where R, G, and B are values in the range [0, 255]
74 * - hexcode colors, e.g. `#ff0000`
75 */
77};
78
79/**
80 * Describes how a property from EXT_structural_metadata will be encoded for
81 * access in Unreal materials.
82 */
83USTRUCT()
84struct CESIUMRUNTIME_API FCesiumMetadataEncodingDetails {
85 GENERATED_USTRUCT_BODY()
86
88
93
94 /**
95 * The GPU-compatible type that this property's values will be encoded as.
96 */
97 UPROPERTY(EditAnywhere, Category = "Cesium")
99
100 /**
101 * The GPU-compatible component type that this property's values will be
102 * encoded as. These correspond to the pixel component types that are
103 * supported in Unreal textures.
104 */
105 UPROPERTY(EditAnywhere, Category = "Cesium")
107
108 /**
109 * The method of conversion used for this property. This describes how the
110 * values will be converted for access in Unreal materials. Note that not all
111 * property types are compatible with the methods of conversion.
112 */
113 UPROPERTY(EditAnywhere, Category = "Cesium")
115
116 bool operator==(const FCesiumMetadataEncodingDetails& Info) const;
117
118 bool operator!=(const FCesiumMetadataEncodingDetails& Info) const;
119
120 bool HasValidType() const;
121
122 /**
123 * @brief Gets the best-fitting encoded types and conversion method for a
124 * given metadata type. This determines the best way (if one is possible) to
125 * transfer values of the given type to the GPU, for access in Unreal
126 * materials.
127 *
128 * An array size can also be supplied if bIsArray is true on the given value
129 * type. If bIsArray is true, but the given array size is zero, this indicates
130 * the arrays of the property vary in length. Variable-length array properties
131 * are unsupported.
132 *
133 * @param PropertyDetails The metadata property details
134 */
137};
ECesiumEncodedMetadataConversion
Indicates how a property value from EXT_structural_metadata should be converted to a GPU-accessible t...
@ ParseColorFromString
Attempt to parse a color from a string property value.
@ Coerce
Coerce the components of a property value to the specified component type.
ECesiumEncodedMetadataComponentType CesiumMetadataComponentTypeToEncodingType(ECesiumMetadataComponentType Type)
Gets the best-fitting encoded type for the given metadata component type.
ECesiumEncodedMetadataType
The type that a metadata property's values will be encoded as.
size_t CesiumGetEncodedMetadataTypeComponentCount(ECesiumEncodedMetadataType Type)
Gets the number of components associated with the given encoded type.
ECesiumEncodedMetadataType CesiumMetadataTypeToEncodingType(ECesiumMetadataType Type)
Gets the best-fitting encoded type for the given metadata type.
ECesiumEncodedMetadataComponentType
The component type that a metadata property's values will be encoded as.
ECesiumMetadataComponentType
The component type of a metadata property in EXT_structural_metadata.
ECesiumMetadataType
The type of a metadata property in EXT_structural_metadata.
static FCesiumMetadataEncodingDetails GetBestFitForProperty(const FCesiumMetadataPropertyDetails &PropertyDetails)
Gets the best-fitting encoded types and conversion method for a given metadata type.
ECesiumEncodedMetadataConversion Conversion
The method of conversion used for this property.
ECesiumEncodedMetadataComponentType ComponentType
The GPU-compatible component type that this property's values will be encoded as.
ECesiumEncodedMetadataType Type
The GPU-compatible type that this property's values will be encoded as.
Represents information about a metadata property according to how the property is defined in EXT_stru...
ECesiumMetadataType Type
The type of the metadata property.