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/enums.h" 30 #include "pxr/imaging/hd/version.h" 31 #include "pxr/base/vt/value.h" 37 PXR_NAMESPACE_OPEN_SCOPE
62 HdWrapLegacyNoOpinionFallbackRepeat,
64 HdWrapUseMetadata = HdWrapNoOpinion,
65 HdWrapLegacy = HdWrapLegacyNoOpinionFallbackRepeat
85 HdMinFilterNearestMipmapNearest,
86 HdMinFilterLinearMipmapNearest,
87 HdMinFilterNearestMipmapLinear,
88 HdMinFilterLinearMipmapLinear,
118 HdBorderColorTransparentBlack,
119 HdBorderColorOpaqueBlack,
120 HdBorderColorOpaqueWhite,
132 HdMinFilter minFilter;
133 HdMagFilter magFilter;
134 HdBorderColor borderColor;
136 HdCompareFunction compareFunction;
143 HdMinFilter minFilter, HdMagFilter magFilter,
144 HdBorderColor borderColor=HdBorderColorTransparentBlack,
145 bool enableCompare=
false,
146 HdCompareFunction compareFunction=HdCmpFuncNever);
158 typedef uint32_t HdDirtyBits;
161 inline int HdConvertFloatToFixed(
float v,
int b)
165 std::min(std::max(v, -1.0f), 1.0f) * (
float(1 << (b-1)) - 1.0f)));
169 inline float HdConvertFixedToFloat(
int v,
int b)
173 (v / (
float(1 << (b-1)) - 1.0f))));
187 template <
typename Vec3Type>
189 x = HdConvertFloatToFixed(value[0], 10);
190 y = HdConvertFloatToFixed(value[1], 10);
191 z = HdConvertFloatToFixed(value[2], 10);
197 reinterpret_cast<HdVec4f_2_10_10_10_REV const*>(&value);
204 template <
typename Vec3Type>
205 Vec3Type GetAsVec()
const {
206 return Vec3Type(HdConvertFixedToFloat(x, 10),
207 HdConvertFixedToFloat(y, 10),
208 HdConvertFixedToFloat(z, 10));
211 int GetAsInt()
const {
212 int const* asInt = reinterpret_cast<int const*>(
this);
217 return (other.w == w &&
223 return !(*
this == other);
350 HdTypeInt32_2_10_10_10_REV,
363 return (type < rhs.type) || (type == rhs.type && count < rhs.count);
366 return type == rhs.type && count == rhs.count;
369 return !(*
this == rhs);
374 template <
class HashState>
378 h.Append(tt.type, tt.count);
384 const void* HdGetValueData(
const VtValue &);
397 HdType HdGetComponentType(HdType);
402 size_t HdGetComponentCount(HdType t);
406 size_t HdDataSizeOfType(HdType);
472 HdFormatFloat32UInt8,
479 HdFormat HdGetComponentFormat(HdFormat f);
483 size_t HdGetComponentCount(HdFormat f);
488 size_t HdDataSizeOfFormat(HdFormat f);
490 PXR_NAMESPACE_CLOSE_SCOPE
492 #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...