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"
37PXR_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);
158typedef uint32_t HdDirtyBits;
161inline int HdConvertFloatToFixed(
float v,
int b)
165 std::min(std::max(v, -1.0f), 1.0f) * (
float(1 << (b-1)) - 1.0f)));
169inline 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);
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);
374template <
class HashState>
378 h.Append(tt.type, tt.count);
384const void* HdGetValueData(
const VtValue &);
397HdType HdGetComponentType(HdType);
402size_t HdGetComponentCount(HdType t);
406size_t HdDataSizeOfType(HdType);
472 HdFormatFloat32UInt8,
479HdFormat HdGetComponentFormat(HdFormat f);
483size_t HdGetComponentCount(HdFormat f);
488size_t HdDataSizeOfFormat(HdFormat f);
493using HdDepthStencilType = std::pair<float, uint32_t>;
495PXR_NAMESPACE_CLOSE_SCOPE
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...
HdTupleType represents zero, one, or more values of the same HdType.
HdVec4f_2_10_10_10_REV is a compact representation of a GfVec4f.