11 #ifndef __VEX_KVexRamp__
12 #define __VEX_KVexRamp__
34 template <
typename FLOAT_T,
typename VALUE_T>
42 for (
const auto &k : keys)
43 SYShashCombine(hash, k);
44 for (
const auto &
v : values)
45 SYShashCombine(hash,
v);
46 for (
const auto &
b : basis)
47 SYShashCombine(hash,
b);
49 return uhash ? uhash : 1;
52 #define VEC_CTOR(FLOAT_T, VALUE_T) \
53 VEX_KVexRamp(const UT_Span<const FLOAT_T> &keys, \
54 const UT_Span<const VALUE_T<FLOAT_T>> &values, \
55 const UT_Span<const UT_StringHolder> &basis) \
56 { initVec<FLOAT_T, VALUE_T<FLOAT_T>>(keys, values, basis); } \
59 #define FLT_CTOR(FLOAT_T) \
60 VEX_KVexRamp(const UT_Span<const FLOAT_T> &keys, \
61 const UT_Span<const FLOAT_T> &values, \
62 const UT_Span<const UT_StringHolder> &basis) \
63 { initFloat<FLOAT_T>(keys, values, basis); } \
64 VEX_KVexRamp(int tsize, \
65 const UT_Span<const FLOAT_T> &keys, \
66 const UT_Span<const FLOAT_T> &vals, \
67 const UT_Span<const UT_StringHolder> &basis) \
68 { initArray<FLOAT_T>(tsize, keys, vals, basis); } \
69 VEC_CTOR(FLOAT_T, UT_Vector2T) \
70 VEC_CTOR(FLOAT_T, UT_Vector3T) \
71 VEC_CTOR(FLOAT_T, UT_Vector4T) \
81 template <
typename FLOAT_T>
88 int size()
const {
return mySize; }
97 template <
typename FLOAT_T>
101 template <
typename FLOAT_T>
102 void initArray(
int tsize,
106 template <
typename FLOAT_T,
typename VALUE_T>
111 template <
typename FLOAT_T,
int VSIZE>
130 int result_size)
const
137 int result_size)
const
fpreal32 evalF(float k) const
std::size_t SYS_HashType
Define the type for hash values.
virtual void eval(const VEX_KVexRamp &ramp, fpreal32 t, fpreal32 *result, int result_size) const
UT_Vector2 evalU(float k) const
Class which writes ASCII or binary JSON streams.
**But if you need a result
A reference counter base class for use with UT_IntrusivePtr.
UT_Vector3 evalV(float k) const
constexpr SYS_FORCE_INLINE const T * data() const noexcept
UT_Vector4 evalP(float k) const
vex_RampHash hash() const
void eval(FLOAT_T key, FLOAT_T *result, int size) const
constexpr SYS_FORCE_INLINE const T * data() const noexcept
HUSD_API bool eval(VtValue &val, T &ret_val)
virtual void eval(const VEX_KVexRamp &ramp, fpreal64 t, fpreal64 *result, int result_size) const
GLboolean GLboolean GLboolean b
static UT_IntrusivePtr< VEX_KVexRamp > theEmptyRamp
GLenum GLsizei GLsizei GLint * values
constexpr SYS_FORCE_INLINE const T * data() const noexcept
Utility class for containing a color ramp.
GLubyte GLubyte GLubyte GLubyte w
static vex_RampHash computeHash(const UT_Span< const FLOAT_T > &keys, const UT_Span< const VALUE_T > &values, const UT_Span< const UT_StringHolder > &basis, uint components)
#define FLT_CTOR(FLOAT_T)