10 #ifndef __GT_DAClampedArray__
11 #define __GT_DAClampedArray__
40 const char *
className()
const override {
return "GT_DAClampedArray"; }
42 #define CLAMP(EXPR, TYPE) SYSclamp((EXPR), (TYPE)myMin, (TYPE)myMax)
50 {
return CLAMP(myData->getU8(offset, idx),
uint8); }
52 {
return CLAMP(myData->getI32(offset, idx),
int32); }
54 {
return CLAMP(myData->getI64(offset, idx),
int64); }
56 {
return myData->getS(offset, idx); }
58 {
return myData->getStringIndexCount(); }
60 {
return myData->getStringIndex(offset, idx); }
63 { myData->getIndexedStrings(strings, indices); }
65 {
return myData->getSA(a, offset); }
67 {
return myData->getDictIndexCount(); }
69 {
return myData->getDictIndex(offset, idx); }
72 { myData->getIndexedDicts(dicts, indices); }
74 #define CLAMP_VALUES(TYPE) \
75 for(exint i=0; i<sz; i++) \
76 d[i] = SYSclamp(d[i], TYPE(myMin), TYPE(myMax))
79 { myData->import(off, d, sz);
82 { myData->import(off, d, sz);
85 { myData->import(off, d, sz);
88 { myData->import(off, d, sz);
91 { myData->import(off, d, sz);
94 { myData->import(off, d, sz);
97 { myData->import(off, d, sz);
101 { myData->import(off, d, sz);
104 #define CLAMP_ARRAY(TYPE) \
105 for(int i=0; i<data.entries(); i++) \
106 data(i) = SYSclamp(data(i), (TYPE)myMin, (TYPE)myMax)
110 { myData->import(off, data);
114 { myData->import(off, data);
118 { myData->import(off, data);
122 { myData->import(off, data);
126 { myData->import(off, data);
130 { myData->import(off, data);
134 { myData->import(off, data);
138 { myData->import(off, data);
150 attr_strings.
clear();
151 getSA(attr_strings, off);
153 data.
concat(attr_strings);
fpreal32 getF32(GT_Offset offset, int idx=0) const override
void doImport(GT_Offset off, int16 *d, GT_Size sz) const override
GLuint GLsizei const GLuint const GLintptr const GLsizeiptr * sizes
#define CLAMP(EXPR, TYPE)
void doImportArray(GT_Offset off, UT_ValArray< fpreal64 > &data) const override
GLsizei GLenum const void * indices
fpreal64 getF64(GT_Offset offset, int idx=0) const override
GT_DAClampedArray(const GT_DataArrayHandle &data, fpreal64 min_v, fpreal64 max_v)
GT_Size entries() const override
Number of entries in the array.
void doImport(GT_Offset off, fpreal32 *d, GT_Size sz) const override
uint8 getU8(GT_Offset offset, int idx=0) const override
GT_DAClampedArray(const GT_DAClampedArray &src)
void fillStringArray(UT_StringArray &data, UT_ValArray< int > &sizes, GT_Offset start, GT_Size length) const override
GT_Size getStringIndexCount() const override
void doImportArray(GT_Offset off, UT_ValArray< int32 > &data) const override
bool getSA(UT_StringArray &a, GT_Offset offset) const override
void doImport(GT_Offset off, fpreal64 *d, GT_Size sz) const override
#define CLAMP_ARRAY(TYPE)
GLboolean GLboolean GLboolean GLboolean a
GLuint GLsizei GLsizei * length
A value-clamped version of another array, useful for data ranges.
void doImport(GT_Offset off, fpreal16 *d, GT_Size sz) const override
exint concat(const UT_Array< T > &a)
Takes another T array and concatenate it onto my end.
void doImportArray(GT_Offset off, UT_ValArray< uint8 > &data) const override
void doImport(GT_Offset off, int32 *d, GT_Size sz) const override
int32 getI32(GT_Offset offset, int idx=0) const override
const char * className() const override
void getIndexedDicts(UT_Array< UT_OptionsHolder > &dicts, UT_IntArray &indices) const override
GT_Offset getDictIndex(GT_Offset offset, int idx) const override
void doImport(GT_Offset off, int64 *d, GT_Size sz) const override
void doImportArray(GT_Offset off, UT_ValArray< int8 > &data) const override
int64 getI64(GT_Offset offset, int idx=0) const override
#define CLAMP_VALUES(TYPE)
virtual bool getSA(UT_StringArray &a, GT_Offset offset) const
fpreal16 getF16(GT_Offset offset, int idx=0) const override
void doImport(GT_Offset off, uint8 *d, GT_Size sz) const override
GLsizei const GLchar *const * strings
virtual GT_Size entries() const =0
Number of entries in the array.
void doImportArray(GT_Offset off, UT_ValArray< fpreal16 > &data) const override
GT_Size getDictIndexCount() const override
exint entries() const
Alias of size(). size() is preferred.
GT_String getS(GT_Offset offset, int idx=0) const override
void doImportArray(GT_Offset off, UT_ValArray< int64 > &data) const override
Base class for a data array which references another data array.
void getIndexedStrings(UT_StringArray &strings, UT_IntArray &indices) const override
GT_Offset getStringIndex(GT_Offset offset, int idx) const override
void doImportArray(GT_Offset off, UT_ValArray< int16 > &data) const override
void clear()
Resets list to an empty list.
void doImport(GT_Offset off, int8 *d, GT_Size sz) const override
void doImportArray(GT_Offset off, UT_ValArray< fpreal32 > &data) const override