Cesium for Unreal 2.15.0
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
11/**
12 * @brief The component type that a metadata property's values will be encoded
13 * as. These correspond to the pixel component types that are supported in
14 * Unreal textures.
15 */
16UENUM()
18
19/**
20 * @brief The type that a metadata property's values will be encoded as.
21 */
22UENUM()
30
31/**
32 * @brief Indicates how a property value from EXT_structural_metadata should be
33 * converted to a GPU-accessible type, if possible.
34 */
35UENUM()
37 /**
38 * Do nothing. This is typically used for property types that are
39 * completely unable to be coerced.
40 */
42 /**
43 * Coerce the components of a property value to the specified component type.
44 * If the property contains string values, this attempts to parse numbers from
45 * the strings as uint8s.
46 */
48 /**
49 * Attempt to parse a color from a string property value. This supports
50 * the following formats:
51 * - `rgb(R, G, B)`, where R, G, and B are values in the range [0, 255]
52 * - hexcode colors, e.g. `#ff0000`
53 */
55};
56
57/**
58 * Describes how a property from EXT_structural_metadata will be encoded for
59 * access in Unreal materials.
60 */
61USTRUCT()
63 GENERATED_USTRUCT_BODY()
64
69
74 : Type(InType),
75 ComponentType(InComponentType),
76 Conversion(InConversion) {}
77
78 /**
79 * The GPU-compatible type that this property's values will be encoded as.
80 */
81 UPROPERTY(EditAnywhere, Category = "Cesium")
83
84 /**
85 * The GPU-compatible component type that this property's values will be
86 * encoded as. These correspond to the pixel component types that are
87 * supported in Unreal textures.
88 */
89 UPROPERTY(EditAnywhere, Category = "Cesium")
91
92 /**
93 * The method of conversion used for this property. This describes how the
94 * values will be converted for access in Unreal materials. Note that not all
95 * property types are compatible with the methods of conversion.
96 */
97 UPROPERTY(EditAnywhere, Category = "Cesium")
99
100 inline bool operator==(const FCesiumMetadataEncodingDetails& Info) const {
101 return Type == Info.Type && ComponentType == Info.ComponentType &&
102 Conversion == Info.Conversion;
103 }
104
105 inline bool operator!=(const FCesiumMetadataEncodingDetails& Info) const {
106 return Type != Info.Type || ComponentType != Info.ComponentType ||
107 Conversion != Info.Conversion;
108 }
109
114};
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.
ECesiumEncodedMetadataType
The type that a metadata property's values will be encoded as.
ECesiumEncodedMetadataComponentType
The component type that a metadata property's values will be encoded as.
FCesiumMetadataEncodingDetails(ECesiumEncodedMetadataType InType, ECesiumEncodedMetadataComponentType InComponentType, ECesiumEncodedMetadataConversion InConversion)
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.
bool operator!=(const FCesiumMetadataEncodingDetails &Info) const
ECesiumEncodedMetadataType Type
The GPU-compatible type that this property's values will be encoded as.