HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GT_DANumeric.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: GT_DANumeric.h ( GT Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __GT_DANumeric__
12 #define __GT_DANumeric__
13 
14 #include "GT_API.h"
15 #include "GT_DataArray.h"
16 #include "GT_Memory.h"
17 #include <UT/UT_Assert.h>
18 #include <UT/UT_ArrayHelp.h>
19 #include <string.h>
20 
21 /// @brief An array of numeric values (int32, int64, fpreal16, fpreal32, fpreal64)
22 template <typename T>
24 {
25 public:
26  typedef T data_type;
27 
28  /// Create a numeric array
29  GT_DANumeric(GT_Size array_size, int tuple_size, GT_Type type=GT_TYPE_NONE)
30  : myData(NULL)
31  , myTupleSize(tuple_size)
32  , myType(type)
33  , myCapacity(0)
34  , mySize(0)
35  {
36  resize(array_size);
37  }
38  /// Create a numeric array, copying values from the source data. The data
39  /// array does @b not hold a reference to the source data, it's copied.
40  GT_DANumeric(const T *data, GT_Size array_size, int tuple_size,
42  : myData(NULL)
43  , myTupleSize(tuple_size)
44  , myType(type)
45  , myCapacity(0)
46  , mySize(0)
47  {
48  resize(array_size);
49  copyFrom(data);
50  }
51  ~GT_DANumeric() override
52  {
53  resize(0);
54  }
55 
56  const char *className() const override { return "GT_DANumeric"; }
57 
58  /// A numeric array is hard to begin with
59  GT_DataArrayHandle harden() const override
60  {
61  GT_DataArray *me;
62  me = const_cast<
63  GT_DANumeric<T> *>(this);
64  return GT_DataArrayHandle(me);
65  }
66 
67  void truncate()
68  {
69  if (mySize != myCapacity)
70  resize(mySize);
71  }
72 
73  void resize(GT_Size size, GT_Size capacity = -1)
74  {
75  if (capacity < 0)
76  capacity = size;
77 
78  if (!capacity)
79  {
80  GT_Size bytes = myCapacity * myTupleSize * sizeof(T);
81  GT_Memory::Free(GT_MEM_DATA, myData, bytes);
82  myData = NULL;
83  }
84  else
85  {
86  GT_Size obytes = myCapacity * myTupleSize * sizeof(T);
87  GT_Size nbytes = capacity * myTupleSize * sizeof(T);
88  myData = (T *)GT_Memory::Realloc(GT_MEM_DATA,
89  myData, obytes, nbytes);
90  }
91  mySize = size;
92  myCapacity = capacity;
93  }
94 
95  /// Append a scalar value to the array
96  void append(T value)
97  {
98  if (mySize == myCapacity)
99  grow();
100  mySize++;
101  set(value, mySize-1);
102  }
103  void append(const T *value)
104  {
105  if (mySize == myCapacity)
106  grow();
107  mySize++;
108  setTuple(value, mySize-1);
109  }
111  {
112  UT_ASSERT_P(src.myTupleSize == myTupleSize);
113  UT_ASSERT_P(src.myType == myType);
114  if (src.mySize)
115  {
116  // Ensure we have enough room
117  if (mySize + src.mySize > myCapacity)
118  grow(mySize + src.mySize);
119  memcpy(myData + mySize*myTupleSize,
120  src.myData,
121  src.mySize*src.myTupleSize*sizeof(T));
122  mySize += src.mySize;
123  }
124  }
125 
126  /// Provide virtual access to the backing data
127  const void *getBackingData() const override { return myData; }
128 
129  /// Raw access to the data array
130  T *data() const { return myData; }
131  /// Raw pointer access to a tuple
133  {
134  UT_ASSERT_P(offset >= 0 && offset < mySize);
135  offset *= myTupleSize;
136  return myData + offset;
137  }
138  /// Raw pointer access to a tuple
139  const T *getData(GT_Offset offset) const
140  {
141  UT_ASSERT_P(offset >= 0 && offset < mySize);
142  offset *= myTupleSize;
143  return myData + offset;
144  }
145  /// Set a component of the tuple
146  void set(T value, GT_Offset offset, int index=0)
147  {
148  offset = offset * myTupleSize + index;
149  UT_ASSERT_P(offset>=0 && offset<mySize*myTupleSize);
150  myData[offset] = value;
151  }
152  /// Set an entire tuple
154  {
155  UT_ASSERT_P(offset>=0 && offset<mySize);
156  offset = offset * myTupleSize;
157  memcpy(myData + offset, value, myTupleSize*sizeof(T));
158  }
159  /// Set a block of entire tuples
161  {
162  if (values->mySize)
163  {
164  UT_ASSERT_P(offset>=0 && offset<mySize);
165  offset = offset * myTupleSize;
166  memcpy(myData + offset, values->myData, values->mySize*myTupleSize*sizeof(T));
167  }
168  }
169  /// Set a block of entire tuples
171  {
172  if (n)
173  {
174  UT_ASSERT_P(offset>=0 && offset<mySize);
175  offset = offset * myTupleSize;
176  memcpy(myData + offset, values, n*myTupleSize*sizeof(T));
177  }
178  }
179  /// Copy an entire data from a flat array
180  void copyFrom(const T *src)
181  {
182  if (src)
183  {
184  memcpy(myData, src, myTupleSize*mySize*sizeof(T));
185  }
186  else UT_ASSERT_P(mySize == 0);
187  }
188 
189  /// @{
190  /// Methods defined on GT_DataArray
191  GT_Storage getStorage() const override { return GTstorage<T>(); }
192  GT_Size getTupleSize() const override { return myTupleSize; }
193  GT_Size entries() const override { return mySize; }
194  GT_Type getTypeInfo() const override { return myType; }
195  int64 getMemoryUsage() const override
196  { return sizeof(T)*mySize*myTupleSize; }
197 
198  uint8 getU8(GT_Offset offset, int index=0) const override
199  {
200  offset = offset * myTupleSize + index;
201  UT_ASSERT_P(offset>=0 && offset<mySize*myTupleSize);
202  return (uint8)myData[offset];
203  }
204  int32 getI32(GT_Offset offset, int index=0) const override
205  {
206  offset = offset * myTupleSize + index;
207  UT_ASSERT_P(offset>=0 && offset<mySize*myTupleSize);
208  return (int32)myData[offset];
209  }
210  int64 getI64(GT_Offset offset, int index=0) const override
211  {
212  offset = offset * myTupleSize + index;
213  UT_ASSERT_P(offset>=0 && offset<mySize*myTupleSize);
214  return (int64)myData[offset];
215  }
216  fpreal16 getF16(GT_Offset offset, int index=0) const override
217  {
218  offset = offset * myTupleSize + index;
219  UT_ASSERT_P(offset>=0 && offset<mySize*myTupleSize);
220  return (fpreal16)myData[offset];
221  }
222  fpreal32 getF32(GT_Offset offset, int index=0) const override
223  {
224  offset = offset * myTupleSize + index;
225  UT_ASSERT_P(offset>=0 && offset<mySize*myTupleSize);
226  return (fpreal32)myData[offset];
227  }
228  fpreal64 getF64(GT_Offset offset, int index=0) const override
229  {
230  offset = offset * myTupleSize + index;
231  UT_ASSERT_P(offset>=0 && offset<mySize*myTupleSize);
232  return (fpreal64)myData[offset];
233  }
234  GT_String getS(GT_Offset, int) const override
236  GT_Size getStringIndexCount() const override
237  { return -1; }
238  GT_Offset getStringIndex(GT_Offset, int) const override
239  { return -1; }
241  UT_IntArray &) const override {}
242  GT_Size getDictIndexCount() const override
243  { return -1; }
244  GT_Offset getDictIndex(GT_Offset, int) const override
245  { return -1; }
247  UT_IntArray &) const override {}
248 
249  const uint8 *getU8Array(GT_DataArrayHandle &buffer) const override
250  {
251  if (SYSisSame<T, uint8>())
252  return reinterpret_cast<const uint8 *>(data());
253  return GT_DataArray::getU8Array(buffer);
254  }
255  const int8 *getI8Array(GT_DataArrayHandle &buffer) const override
256  {
257  if (SYSisSame<T, int8>())
258  return reinterpret_cast<const int8 *>(data());
259  return GT_DataArray::getI8Array(buffer);
260  }
261  const int16 *getI16Array(GT_DataArrayHandle &buffer) const override
262  {
263  if (SYSisSame<T, int16>())
264  return reinterpret_cast<const int16 *>(data());
265  return GT_DataArray::getI16Array(buffer);
266  }
267  const int32 *getI32Array(GT_DataArrayHandle &buffer) const override
268  {
269  if (SYSisSame<T, int32>())
270  return reinterpret_cast<const int32 *>(data());
271  return GT_DataArray::getI32Array(buffer);
272  }
273  const int64 *getI64Array(GT_DataArrayHandle &buffer) const override
274  {
275  if (SYSisSame<T, int64>())
276  return reinterpret_cast<const int64 *>(data());
277  return GT_DataArray::getI64Array(buffer);
278  }
280  {
281  if (SYSisSame<T, fpreal16>())
282  return reinterpret_cast<const fpreal16 *>(data());
283  return GT_DataArray::getF16Array(buffer);
284  }
286  {
287  if (SYSisSame<T, fpreal32>())
288  return reinterpret_cast<const fpreal32 *>(data());
289  return GT_DataArray::getF32Array(buffer);
290  }
292  {
293  if (SYSisSame<T, fpreal64>())
294  return reinterpret_cast<const fpreal64 *>(data());
295  return GT_DataArray::getF64Array(buffer);
296  }
297 
298  void doImport(GT_Offset idx, uint8 *data, GT_Size size) const override
299  { importTuple<uint8>(idx, data, size); }
300  void doImport(GT_Offset idx, int8 *data, GT_Size size) const override
301  { importTuple<int8>(idx, data, size); }
302  void doImport(GT_Offset idx, int16 *data, GT_Size size) const override
303  { importTuple<int16>(idx, data, size); }
304  void doImport(GT_Offset idx, int32 *data, GT_Size size) const override
305  { importTuple<int32>(idx, data, size); }
306  void doImport(GT_Offset idx, int64 *data, GT_Size size) const override
307  { importTuple<int64>(idx, data, size); }
308  void doImport(GT_Offset idx, fpreal16 *data, GT_Size size) const override
309  { importTuple<fpreal16>(idx, data, size); }
310  void doImport(GT_Offset idx, fpreal32 *data, GT_Size size) const override
311  { importTuple<fpreal32>(idx, data, size); }
312  void doImport(GT_Offset idx, fpreal64 *data, GT_Size size) const override
313  { importTuple<fpreal64>(idx, data, size); }
314 
316  int tsize, int stride) const override
317  { t_NumericFill(data, start, length, tsize, stride); }
319  int tsize, int stride) const override
320  { t_NumericFill(data, start, length, tsize, stride); }
322  int tsize, int stride) const override
323  { t_NumericFill(data, start, length, tsize, stride); }
325  int tsize, int stride) const override
326  { t_NumericFill(data, start, length, tsize, stride); }
328  int tsize, int stride) const override
329  { t_NumericFill(data, start, length, tsize, stride); }
331  int tsize, int stride) const override
332  { t_NumericFill(data, start, length, tsize, stride); }
334  int tsize, int stride) const override
335  { t_NumericFill(data, start, length, tsize, stride); }
337  int tsize, int stride) const override
338  { t_NumericFill(data, start, length, tsize, stride); }
339  /// @}
340 
341  /// @{
342  /// Hash and compare
343  bool isEqual(const GT_DataArray &src) const override;
344  SYS_HashType hashRange(exint begin, exint end) const override;
345  /// @}
346 
347  /// Accessor to capacity of the array
348  GT_Size capacity() const { return myCapacity; }
349 
350 protected:
352  {
353  public:
354  num_MinMaxTask(const T *data, int tsize)
355  : myData(data)
356  , myTupleSize(tsize)
357  {
358  initBuffers();
359  for (int j = 0; j < myTupleSize; ++j)
360  {
361  myMin[j] = myMax[j] = data[j];
362  }
363  }
365  : myData(src.myData)
366  , myTupleSize(src.myTupleSize)
367  {
368  initBuffers();
369  std::copy(src.myMin, src.myMin+myTupleSize, myMin);
370  std::copy(src.myMax, src.myMax+myTupleSize, myMax);
371  }
373  {
374  if (myMin != myMinBuffer)
375  {
376  delete [] myMin;
377  delete [] myMax;
378  }
379  }
381  {
382  for (GT_Size i = range.begin(), n = range.end(); i < n; ++i)
383  {
384  const T *pos = myData + i * myTupleSize;
385  for (int j = 0; j < myTupleSize; ++j)
386  {
387  myMin[j] = SYSmin(myMin[j], pos[j]);
388  myMax[j] = SYSmax(myMax[j], pos[j]);
389  }
390  }
391  }
393  {
394  for (int j = 0; j < myTupleSize; ++j)
395  {
396  min[j] = SYSmin(min[j], fpreal64(myMin[j]));
397  max[j] = SYSmax(max[j], fpreal64(myMax[j]));
398  }
399  }
400  void join(const num_MinMaxTask &src)
401  {
402  for (int j = 0; j < myTupleSize; ++j)
403  {
404  myMin[j] = SYSmin(myMin[j], src.myMin[j]);
405  myMax[j] = SYSmax(myMax[j], src.myMax[j]);
406  }
407  }
408  private:
409  void initBuffers()
410  {
411  if (myTupleSize > 16)
412  {
413  myMin = new T[myTupleSize];
414  myMax = new T[myTupleSize];
415  }
416  else
417  {
418  myMin = myMinBuffer;
419  myMax = myMaxBuffer;
420  }
421  }
422  const T *myData;
423  T *myMin;
424  T *myMax;
425  T myMinBuffer[16];
426  T myMaxBuffer[16];
427  int myTupleSize;
428  };
429  bool computeMinMax(fpreal64 *min, fpreal64 *max) const override
430  {
431  num_MinMaxTask task(myData, myTupleSize);
433  task.getResult(min, max);
434  return true;
435  }
436 
437 private:
438  void grow(exint sz=-1)
439  {
440  GT_Size obytes = myCapacity * myTupleSize * sizeof(T);
441  myCapacity = sz < 0 ? UTbumpAlloc(myCapacity+1) : sz;
442  GT_Size nbytes = myCapacity * myTupleSize * sizeof(T);
443  myData = (T *)GT_Memory::Realloc(GT_MEM_DATA,
444  myData, obytes, nbytes);
445  }
446  template <typename T_POD> inline void
447  importTuple(GT_Offset idx, T_POD *data, GT_Size tsize) const
448  {
449  if (tsize < 1)
450  tsize = myTupleSize;
451  else
452  tsize = SYSmin(tsize, myTupleSize);
453  const T *src = myData + idx*myTupleSize;
454  for (int i = 0; i < tsize; ++i)
455  data[i] = (T_POD)src[i];
456  }
457 
458  inline void
459  t_NumericFill(T *dest, GT_Offset start, GT_Size length,
460  int tsize, int stride) const
461  {
462  if (tsize < 1)
463  tsize = myTupleSize;
464  stride = SYSmax(stride, tsize);
465  int n = SYSmin(tsize, myTupleSize);
466  if (n == myTupleSize && stride == myTupleSize)
467  {
468  memcpy(dest, myData+start*myTupleSize,
469  length*n*sizeof(T));
470  }
471  else
472  {
473  const T *src = myData+start*myTupleSize;
474  for (GT_Offset i = 0; i < length; ++i,
475  src += myTupleSize, dest += stride)
476  {
477  for (int j = 0; j < n; ++j)
478  dest[j] = src[j];
479  }
480  }
481  }
482 
483  template <typename T_POD> inline void
484  t_NumericFill(T_POD *dest, GT_Offset start, GT_Size length,
485  int tsize, int stride) const
486  {
487  if (tsize < 1)
488  tsize = myTupleSize;
489  stride = SYSmax(stride, tsize);
490  int n = SYSmin(tsize, myTupleSize);
491  const T *src = myData+start*myTupleSize;
492  for (GT_Offset i = 0; i < length; ++i,
493  src += myTupleSize, dest += stride)
494  {
495  for (int j = 0; j < n; ++j)
496  dest[j] = (T_POD)src[j];
497  }
498  }
499 
500  T *myData;
501  GT_Size mySize;
502  GT_Size myCapacity;
503  int myTupleSize;
504  GT_Type myType;
505 };
514 
525 
527 {
528 public:
529  GT_DAPointMaterialID(int pcount) : GT_Int32Array(pcount,1) {}
530 };
531 
532 /// Return either an int64 or int32 array based on the contents of the
533 /// array. That is, only allocate a 64 bit integer array if it's needed.
534 /// For tuple sizes > 1, this function assumes that the array is an array
535 /// of structs, rather than a struct of arrays.
536 GT_API extern GT_DataArray *GTallocateIntArray(const int64 *array,
537  GT_Size size, int tuple_size=1);
538 GT_API extern GT_DataArray *GTallocateIntArray(const int32 *array,
539  GT_Size size, int tuple_size=1);
540 
541 #endif
const fpreal64 * getF64Array(GT_DataArrayHandle &buffer) const override
Definition: GT_DANumeric.h:291
#define SYSmax(a, b)
Definition: SYS_Math.h:1570
GT_Storage
Definition: GT_Types.h:19
GT_API GT_DataArray * GTallocateIntArray(const int64 *array, GT_Size size, int tuple_size=1)
void doImport(GT_Offset idx, uint8 *data, GT_Size size) const override
Definition: GT_DANumeric.h:298
void doImport(GT_Offset idx, int8 *data, GT_Size size) const override
Definition: GT_DANumeric.h:300
void append(const T *value)
Definition: GT_DANumeric.h:103
int int32
Definition: SYS_Types.h:39
GLenum GLint * range
Definition: glcorearb.h:1925
GT_DAPointMaterialID(int pcount)
Definition: GT_DANumeric.h:529
tbb::split UT_Split
Definition: GA_PolyCounts.h:24
virtual SYS_HashType hashRange(exint begin, exint end) const
GT_Size getStringIndexCount() const override
Definition: GT_DANumeric.h:236
const void * getBackingData() const override
Provide virtual access to the backing data.
Definition: GT_DANumeric.h:127
GLboolean * data
Definition: glcorearb.h:131
OIIO_UTIL_API bool copy(string_view from, string_view to, std::string &err)
void doFillArray(int32 *data, GT_Offset start, GT_Size length, int tsize, int stride) const override
Definition: GT_DANumeric.h:324
GLuint start
Definition: glcorearb.h:475
GLsizei const GLfloat * value
Definition: glcorearb.h:824
virtual const fpreal32 * getF32Array(GT_DataArrayHandle &buffer) const
uint8 getU8(GT_Offset offset, int index=0) const override
Definition: GT_DANumeric.h:198
void doFillArray(fpreal64 *data, GT_Offset start, GT_Size length, int tsize, int stride) const override
Definition: GT_DANumeric.h:336
#define GT_API
Definition: GT_API.h:13
const uint8 * getU8Array(GT_DataArrayHandle &buffer) const override
Definition: GT_DANumeric.h:249
int64 exint
Definition: SYS_Types.h:125
GT_Type
Definition: GT_Types.h:36
const int64 * getI64Array(GT_DataArrayHandle &buffer) const override
Definition: GT_DANumeric.h:273
std::size_t SYS_HashType
Define the type for hash values.
Definition: SYS_Hash.h:19
GLuint GLsizei GLsizei * length
Definition: glcorearb.h:795
ImageBuf OIIO_API min(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
T * data() const
Raw access to the data array.
Definition: GT_DANumeric.h:130
GT_Size getDictIndexCount() const override
Definition: GT_DANumeric.h:242
T * getData(GT_Offset offset)
Raw pointer access to a tuple.
Definition: GT_DANumeric.h:132
GT_Size capacity() const
Accessor to capacity of the array.
Definition: GT_DANumeric.h:348
virtual const fpreal64 * getF64Array(GT_DataArrayHandle &buffer) const
int32 getI32(GT_Offset offset, int index=0) const override
Definition: GT_DANumeric.h:204
float fpreal32
Definition: SYS_Types.h:200
void doImport(GT_Offset idx, int16 *data, GT_Size size) const override
Definition: GT_DANumeric.h:302
virtual const int16 * getI16Array(GT_DataArrayHandle &buffer) const
void doFillArray(fpreal16 *data, GT_Offset start, GT_Size length, int tsize, int stride) const override
Definition: GT_DANumeric.h:330
void doFillArray(fpreal32 *data, GT_Offset start, GT_Size length, int tsize, int stride) const override
Definition: GT_DANumeric.h:333
GT_DANumeric< uint8 > GT_Unsigned8Array
Definition: GT_DANumeric.h:515
double fpreal64
Definition: SYS_Types.h:201
unsigned char uint8
Definition: SYS_Types.h:36
virtual const fpreal16 * getF16Array(GT_DataArrayHandle &buffer) const
GLdouble n
Definition: glcorearb.h:2008
GLintptr offset
Definition: glcorearb.h:665
void doImport(GT_Offset idx, fpreal64 *data, GT_Size size) const override
Definition: GT_DANumeric.h:312
Definition: core.h:760
Abstract data class for an array of float, int or string data.
Definition: GT_DataArray.h:40
const int32 * getI32Array(GT_DataArrayHandle &buffer) const override
Definition: GT_DANumeric.h:267
GT_Size getTupleSize() const override
Definition: GT_DANumeric.h:192
const int16 * getI16Array(GT_DataArrayHandle &buffer) const override
Definition: GT_DANumeric.h:261
GT_String getS(GT_Offset, int) const override
Definition: GT_DANumeric.h:234
UT_IntrusivePtr< GT_DataArray > GT_DataArrayHandle
Definition: GT_DataArray.h:32
int64 getI64(GT_Offset offset, int index=0) const override
Definition: GT_DANumeric.h:210
#define UT_ASSERT_P(ZZ)
Definition: UT_Assert.h:155
num_MinMaxTask(const T *data, int tsize)
Definition: GT_DANumeric.h:354
static const UT_StringHolder theEmptyString
const T * getData(GT_Offset offset) const
Raw pointer access to a tuple.
Definition: GT_DANumeric.h:139
GLuint GLuint end
Definition: glcorearb.h:475
void doFillArray(int16 *data, GT_Offset start, GT_Size length, int tsize, int stride) const override
Definition: GT_DANumeric.h:321
GLint GLenum GLboolean GLsizei stride
Definition: glcorearb.h:872
void doImport(GT_Offset idx, int64 *data, GT_Size size) const override
Definition: GT_DANumeric.h:306
int64 GT_Offset
Definition: GT_Types.h:129
long long int64
Definition: SYS_Types.h:116
virtual const int8 * getI8Array(GT_DataArrayHandle &buffer) const
void doFillArray(uint8 *data, GT_Offset start, GT_Size length, int tsize, int stride) const override
Definition: GT_DANumeric.h:315
void resize(GT_Size size, GT_Size capacity=-1)
Definition: GT_DANumeric.h:73
signed char int8
Definition: SYS_Types.h:35
const int8 * getI8Array(GT_DataArrayHandle &buffer) const override
Definition: GT_DANumeric.h:255
GT_DANumeric(GT_Size array_size, int tuple_size, GT_Type type=GT_TYPE_NONE)
Create a numeric array.
Definition: GT_DANumeric.h:29
~GT_DANumeric() override
Definition: GT_DANumeric.h:51
void truncate()
Definition: GT_DANumeric.h:67
GLint j
Definition: glad.h:2733
int64 GT_Size
Definition: GT_Types.h:128
GLsizeiptr size
Definition: glcorearb.h:664
void setTuple(const T *value, GT_Offset offset)
Set an entire tuple.
Definition: GT_DANumeric.h:153
GT_Offset getDictIndex(GT_Offset, int) const override
Definition: GT_DANumeric.h:244
ImageBuf OIIO_API resize(const ImageBuf &src, string_view filtername="", float filterwidth=0.0f, ROI roi={}, int nthreads=0)
void set(T value, GT_Offset offset, int index=0)
Set a component of the tuple.
Definition: GT_DANumeric.h:146
fpreal16 getF16(GT_Offset offset, int index=0) const override
Definition: GT_DANumeric.h:216
GLenum GLsizei GLsizei GLint * values
Definition: glcorearb.h:1602
void operator()(const UT_BlockedRange< GT_Size > &range)
Definition: GT_DANumeric.h:380
void doFillArray(int64 *data, GT_Offset start, GT_Size length, int tsize, int stride) const override
Definition: GT_DANumeric.h:327
short int16
Definition: SYS_Types.h:37
GT_DANumeric(const T *data, GT_Size array_size, int tuple_size, GT_Type type=GT_TYPE_NONE)
Definition: GT_DANumeric.h:40
void concat(const GT_DANumeric< T > &src)
Definition: GT_DANumeric.h:110
void doFillArray(int8 *data, GT_Offset start, GT_Size length, int tsize, int stride) const override
Definition: GT_DANumeric.h:318
GT_Offset getStringIndex(GT_Offset, int) const override
Definition: GT_DANumeric.h:238
GLuint index
Definition: glcorearb.h:786
virtual const int64 * getI64Array(GT_DataArrayHandle &buffer) const
const fpreal32 * getF32Array(GT_DataArrayHandle &buffer) const override
Definition: GT_DANumeric.h:285
void copyFrom(const T *src)
Copy an entire data from a flat array.
Definition: GT_DANumeric.h:180
void doImport(GT_Offset idx, int32 *data, GT_Size size) const override
Definition: GT_DANumeric.h:304
ImageBuf OIIO_API max(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
void doImport(GT_Offset idx, fpreal16 *data, GT_Size size) const override
Definition: GT_DANumeric.h:308
GT_Type getTypeInfo() const override
Definition: GT_DANumeric.h:194
int64 getMemoryUsage() const override
Definition: GT_DANumeric.h:195
void append(T value)
Append a scalar value to the array.
Definition: GT_DANumeric.h:96
GT_Size entries() const override
Definition: GT_DANumeric.h:193
An array of numeric values (int32, int64, fpreal16, fpreal32, fpreal64)
Definition: GT_DANumeric.h:23
virtual const uint8 * getU8Array(GT_DataArrayHandle &buffer) const
Definition: core.h:1131
void doImport(GT_Offset idx, fpreal32 *data, GT_Size size) const override
Definition: GT_DANumeric.h:310
num_MinMaxTask(num_MinMaxTask &src, UT_Split)
Definition: GT_DANumeric.h:364
void getIndexedStrings(UT_StringArray &, UT_IntArray &) const override
Definition: GT_DANumeric.h:240
fpreal64 getF64(GT_Offset offset, int index=0) const override
Definition: GT_DANumeric.h:228
void setTupleBlock(const T *values, GT_Size n, GT_Offset offset)
Set a block of entire tuples.
Definition: GT_DANumeric.h:170
GT_DataArrayHandle harden() const override
A numeric array is hard to begin with.
Definition: GT_DANumeric.h:59
void setTupleBlock(const GT_DANumeric< T > *values, GT_Offset offset)
Set a block of entire tuples.
Definition: GT_DANumeric.h:160
void join(const num_MinMaxTask &src)
Definition: GT_DANumeric.h:400
#define SYSmin(a, b)
Definition: SYS_Math.h:1571
type
Definition: core.h:1059
void getIndexedDicts(UT_Array< UT_OptionsHolder > &, UT_IntArray &) const override
Definition: GT_DANumeric.h:246
virtual bool isEqual(const GT_DataArray &src) const
Compare whether two data arrays are equal.
Declare prior to use.
const char * className() const override
Definition: GT_DANumeric.h:56
GT_EXTERN_TEMPLATE(GT_DANumeric< int8 >)
GT_Storage getStorage() const override
Definition: GT_DANumeric.h:191
const fpreal16 * getF16Array(GT_DataArrayHandle &buffer) const override
Definition: GT_DANumeric.h:279
bool computeMinMax(fpreal64 *min, fpreal64 *max) const override
Definition: GT_DANumeric.h:429
Definition: format.h:895
Definition: format.h:2459
fpreal32 getF32(GT_Offset offset, int index=0) const override
Definition: GT_DANumeric.h:222
void UTparallelReduceLightItems(const Range &range, Body &body)
void getResult(fpreal64 *min, fpreal64 *max) const
Definition: GT_DANumeric.h:392
virtual const int32 * getI32Array(GT_DataArrayHandle &buffer) const
GLenum src
Definition: glcorearb.h:1793
PcpNodeRef_ChildrenIterator begin(const PcpNodeRef::child_const_range &r)
Support for range-based for loops for PcpNodeRef children ranges.
Definition: node.h:558