24 #ifndef PXR_IMAGING_HD_TYPES_H
25 #define PXR_IMAGING_HD_TYPES_H
28 #include "pxr/imaging/hd/api.h"
29 #include "pxr/imaging/hd/version.h"
30 #include "pxr/base/vt/value.h"
36 PXR_NAMESPACE_OPEN_SCOPE
61 HdWrapLegacyNoOpinionFallbackRepeat,
63 HdWrapUseMetadata = HdWrapNoOpinion,
64 HdWrapLegacy = HdWrapLegacyNoOpinionFallbackRepeat
84 HdMinFilterNearestMipmapNearest,
85 HdMinFilterLinearMipmapNearest,
86 HdMinFilterNearestMipmapLinear,
87 HdMinFilterLinearMipmapLinear,
114 HdMinFilter minFilter;
115 HdMagFilter magFilter;
127 typedef uint32_t HdDirtyBits;
130 inline int HdConvertFloatToFixed(
float v,
int b)
134 std::min(std::max(v, -1.0f), 1.0f) * (
float(1 << (b-1)) - 1.0f)));
138 inline float HdConvertFixedToFloat(
int v,
int b)
142 (v / (
float(1 << (b-1)) - 1.0f))));
156 template <
typename Vec3Type>
158 x = HdConvertFloatToFixed(value[0], 10);
159 y = HdConvertFloatToFixed(value[1], 10);
160 z = HdConvertFloatToFixed(value[2], 10);
173 template <
typename Vec3Type>
174 Vec3Type GetAsVec()
const {
175 return Vec3Type(HdConvertFixedToFloat(x, 10),
176 HdConvertFixedToFloat(y, 10),
177 HdConvertFixedToFloat(z, 10));
180 int GetAsInt()
const {
181 int const* asInt =
reinterpret_cast<int const*
>(
this);
186 return (other.w == w &&
192 return !(*
this == other);
319 HdTypeInt32_2_10_10_10_REV,
330 return (type < rhs.type) || (type == rhs.type && count < rhs.count);
333 return type == rhs.type && count == rhs.count;
336 return !(*
this == rhs);
341 template <
class HashState>
345 h.Append(tt.type, tt.count);
351 const void* HdGetValueData(
const VtValue &);
364 HdType HdGetComponentType(HdType);
369 size_t HdGetComponentCount(HdType t);
373 size_t HdDataSizeOfType(HdType);
439 HdFormatFloat32UInt8,
446 HdFormat HdGetComponentFormat(HdFormat f);
450 size_t HdGetComponentCount(HdFormat f);
455 size_t HdDataSizeOfFormat(HdFormat f);
457 PXR_NAMESPACE_CLOSE_SCOPE
459 #endif // PXR_IMAGING_HD_TYPES_H
HdTupleType represents zero, one, or more values of the same HdType.
HdVec4f_2_10_10_10_REV is a compact representation of a GfVec4f.
Collection of standard parameters such as wrap modes to sample a texture.
Provides a container which may hold any type, and provides introspection and iteration over array typ...