HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GT_DataArray.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_DataArray.h ( GT Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __GT_DataArray__
12 #define __GT_DataArray__
13 
14 #include "GT_API.h"
15 #include "GT_Types.h"
16 #include "GT_Handles.h"
17 #include <SYS/SYS_Hash.h>
18 #include <UT/UT_Assert.h>
19 #include <UT/UT_ParallelUtil.h>
20 #include <UT/UT_IntrusivePtr.h>
21 #include <UT/UT_Vector3.h>
22 #include <UT/UT_Vector4.h>
23 #include <UT/UT_Matrix3.h>
24 #include <UT/UT_Matrix4.h>
25 #include <UT/UT_BoundingBox.h>
26 #include <UT/UT_StackBuffer.h>
27 
28 class UT_StringArray;
29 class UT_JSONWriter;
31 
34 
35 /// @brief Abstract data class for an array of float, int or string data
36 ///
37 /// This is an abstract class. The data does not have to be owned by this
38 /// array. The data can be generated on the fly by the class. Or the data
39 /// might be flat numeric data.
41  : public UT_IntrusiveRefCounter<GT_DataArray>
42 {
43 public:
44  GT_DataArray();
46  virtual ~GT_DataArray();
47 
48  virtual const char *className() const = 0;
49 
50  /// Create a "hardened" version of the array
51  virtual GT_DataArrayHandle harden() const;
52 
53  /// Type of data stored in the array
54  virtual GT_Storage getStorage() const = 0;
55 
56  /// Number of entries in the array
57  virtual GT_Size entries() const = 0;
58 
59  /// Return the number of elements in the array for the given item
60  virtual GT_Size itemSize(GT_Offset) const { return 0; }
61  /// Total number of array elements if this is an array attribute.
62  /// Sum of each entry's array length, as each entry's array length can vary.
63  virtual GT_Size getTotalArrayEntries() const { return 0; }
64 
65  /// Number of elements for each array element
66  virtual GT_Size getTupleSize() const = 0;
67 
68  /// Get an approximation of the memory usage. Since data is shared, this
69  /// may be an over-estimation of the memory used.
70  virtual int64 getMemoryUsage() const = 0;
71 
72  /// Return "type" information for the data. This defaults to GT_TYPE_NONE
73  virtual GT_Type getTypeInfo() const;
74 
75  /// Returns "true" if each entry is an array.
76  virtual bool hasArrayEntries() const { return false; }
77 
78  /// Return "true" if there's pointer aliasing
79  virtual bool getPointerAliasing(const void *data) const
80  { return false; }
81 
82  /// Data array is valid; can be sampled from.
83  virtual bool isValid() const { return true; }
84 
85  /// If the array has backing storage, this method can be used to access the
86  /// storage. The backing storage must be a flat array of interleaved
87  /// values of the given pod type. For example, if the array has 35 entries
88  /// of fpreal32 color (RGB) data, the pointer returned should be mapped to
89  /// an array that's (35*3) fpreal32 values with the first three values
90  /// representing the RGB values for the first item in the array.
91  virtual const void *getBackingData() const { return nullptr; }
92 
93  /// Return the "data id" associated with the data. The data ID will be
94  /// incremented if the data is modified. An ID less than 0 indicates that
95  /// the data ID should always be considered unique and will never be the
96  /// same across evaluations. This data ID can be used to detect whether
97  /// attribute data has changed in similar tesselations.
98  virtual int64 getDataId() const { return myDataId; }
99 
100  /// @{
101  /// Get data out of the data array
102  virtual uint8 getU8(GT_Offset offset, int idx=0) const = 0;
103  virtual int8 getI8(GT_Offset offset, int idx=0) const
104  { return getI32(offset, idx); }
105  virtual int16 getI16(GT_Offset offset, int idx=0) const
106  { return getI32(offset, idx); }
107  virtual int32 getI32(GT_Offset offset, int idx=0) const = 0;
108  virtual int64 getI64(GT_Offset offset, int idx=0) const
109  { return getI32(offset, idx); }
110 
111  virtual fpreal16 getF16(GT_Offset offset, int idx=0) const
112  { return getF32(offset, idx); }
113  virtual fpreal32 getF32(GT_Offset offset, int idx=0) const = 0;
114  virtual fpreal64 getF64(GT_Offset offset, int idx=0) const
115  { return getF32(offset, idx); }
116 
117  virtual GT_String getS(GT_Offset offset, int idx=0) const = 0;
118 
119  virtual bool getSA(UT_StringArray &a, GT_Offset offset) const
120  { return false; }
122  { return false; }
124  { return false; }
126  { return false; }
128  { return false; }
129  virtual bool getIA8(UT_ValArray<int8> &a, GT_Offset offset) const
130  { return false; }
132  { return false; }
134  { return false; }
136  { return false; }
137  /// @}
138 
139  /// @{
140  /// Get raw access to the data buffer (or fill the data array passed in)
141  /// If the array is unable to provide a raw pointer to the underlying data,
142  /// the GT_DataArrayHandle will be allocated to store the data, and it's
143  /// raw data will be returned.
144  ///
145  /// This means that the data returned will be destructed when the buffer is
146  /// destructed. Beware.
147  virtual const uint8 *getU8Array(GT_DataArrayHandle &buffer) const;
148  virtual const int8 *getI8Array(GT_DataArrayHandle &buffer) const;
149  virtual const int16 *getI16Array(GT_DataArrayHandle &buffer) const;
150  virtual const int32 *getI32Array(GT_DataArrayHandle &buffer) const;
151  virtual const int64 *getI64Array(GT_DataArrayHandle &buffer) const;
152  virtual const fpreal16 *getF16Array(GT_DataArrayHandle &buffer) const;
153  virtual const fpreal32 *getF32Array(GT_DataArrayHandle &buffer) const;
154  virtual const fpreal64 *getF64Array(GT_DataArrayHandle &buffer) const;
155  const fpreal *getRealArray(GT_DataArrayHandle &buffer) const;
156  /// @}
157 
158  /// Template-friendly version of getU8Array() and related methods.
159  template <typename T>
160  const T *getArray(GT_DataArrayHandle &buffer) const;
161 
162  /// When an array of strings is based on an indexed list of strings, this
163  /// method can be used to query the maximum number of indices. If the
164  /// strings are not indexed, the method should return -1.
165  virtual GT_Size getStringIndexCount() const = 0;
166 
167  /// When an array of strings is based on an indexed list of strings, this
168  /// method can be used to query each element's index. If the strings are
169  /// not indexed, the method should return -1.
170  virtual GT_Offset getStringIndex(GT_Offset offset, int idx=0) const = 0;
171 
172  /// When an array of strings is based on an indexed list of strings, this
173  /// method can be used to extract all the strings and their corresponding
174  /// indicies. It's possible that the indices may not be contiguous or may
175  /// even be out of order.
176  virtual void getIndexedStrings(UT_StringArray &strings,
177  UT_IntArray &indices) const = 0;
178  /// When an array of strings is based on an indexed list of strings, this
179  /// method can be used to extract all the strings. If an index is not
180  /// used, the string array may contain a NULL pointer. When you call @c
181  /// getStringIndex(), you can look up directly into the @c strings array
182  /// returned here.
183  ///
184  /// Note, if the strings are not stored as an indexed list, this method
185  /// will return an empty array.
186  virtual void getStrings(UT_StringArray &strings) const;
187 
188  /// Fill an array of std::string with the strings corresponding to each
189  /// entry. There must be @c entries() strings in the array. Only a single
190  /// tuple index is extracted.
191  void fillStrings(std::string *strings,
192  int tuple_idx=0) const;
193 
194  /// Fill array of strings from start to length number of entries.
195  /// This should only be called for an array attribute of strings.
196  /// The @c data will contain a flattened array of strings, with
197  /// the @c sizes array containing the array length per entry.
200  GT_Offset start, GT_Size length) const {}
201 
202  /// @{
203  /// Extract data out of the array in a template friendly fashion.
204  /// Unlike the @c get() methods, these methods will @b always copy data
205  /// into the buffers. If the @c size is 0, the tuple size will be used.
206  /// The data buffer must be big enough.
207  ///
208  /// If the size given is larger than getTupleSize(), only the first
209  /// @c getTupleSize() elements will be filled out (leaving the others
210  /// untouched).
211  void import(GT_Offset idx, int8 *data, GT_Size size=0) const
212  { doImport(idx, data, size); }
213  void import(GT_Offset idx, int16 *data, GT_Size size=0) const
214  { doImport(idx, data, size); }
215  void import(GT_Offset idx, int32 *data, GT_Size size=0) const
216  { doImport(idx, data, size); }
217  void import(GT_Offset idx, int64 *data, GT_Size size=0) const
218  { doImport(idx, data, size); }
219  void import(GT_Offset idx, fpreal16 *data, GT_Size size=0) const
220  { doImport(idx, data, size); }
221  void import(GT_Offset idx, fpreal32 *data, GT_Size size=0) const
222  { doImport(idx, data, size); }
223  void import(GT_Offset idx, fpreal64 *data, GT_Size size=0) const
224  { doImport(idx, data, size); }
225  void import(GT_Offset idx, UT_ValArray<fpreal16> &data) const
226  { doImportArray(idx, data); }
227  void import(GT_Offset idx, UT_ValArray<fpreal32> &data) const
228  { doImportArray(idx, data); }
229  void import(GT_Offset idx, UT_ValArray<fpreal64> &data) const
230  { doImportArray(idx, data); }
231  void import(GT_Offset idx, UT_ValArray<uint8> &data) const
232  { doImportArray(idx, data); }
233  void import(GT_Offset idx, UT_ValArray<int8> &data) const
234  { doImportArray(idx, data); }
235  void import(GT_Offset idx, UT_ValArray<int16> &data) const
236  { doImportArray(idx, data); }
237  void import(GT_Offset idx, UT_ValArray<int32> &data) const
238  { doImportArray(idx, data); }
239  void import(GT_Offset idx, UT_ValArray<int64> &data) const
240  { doImportArray(idx, data); }
241  void import(GT_Offset idx, UT_StringArray &data) const
242  { getSA(data, idx); }
243  void import(GT_Offset idx, uint8 *data, GT_Size size=0,
244  fpreal black=0, fpreal white=1) const
245  {
246  if (GTisFloat(getStorage()))
247  doImportQuantized(idx, data, size, black, white);
248  else
249  doImport(idx, data, size);
250  }
251  /// @}
252 
253  /// @{
254  /// Extract data for the entire array into a flat data array.
255  /// By default, this is implemented as: @code
256  /// if (tuple_size <= 0)
257  /// tuple_size = getTupleSize();
258  /// for (GT_Offset idx = 0; idx < length; ++idx, data += tuple_size)
259  /// import(idx+start, data, tuple_size);
260  /// @endcode
261  /// Obviously, the @c data array should be big enough to hold @c
262  /// length*tuple_size elements.
263  ///
264  /// The tuple size (@c tsize) specifies how many elements to extract from
265  /// each element of this array. The @c stride specifies how many items to
266  /// skip over for each element. With a stride of -1, the stride will be
267  /// set to the @c tsize. Otherwise the stride will be set to the maximum
268  /// of @c tsize and @c stride.
269  ///
270  /// The stride can be useful when trying to interleave data. For example:
271  /// @code
272  /// float uvbuf[ucoord->entries()*2];
273  /// ucoord->fillArray(&uvbuf[0], 0, ucoord->entries(), 1, 2);
274  /// vcoord->fillArray(&uvbuf[1], 0, vcoord->entries(), 1, 2);
275  /// @endcode
277  int tsize, int stride=-1) const
278  { doFillArray(data, start, length, tsize, stride); }
280  int tsize, int stride=-1) const
281  { doFillArray(data, start, length, tsize, stride); }
283  int tsize, int stride=-1) const
284  { doFillArray(data, start, length, tsize, stride); }
286  int tsize, int stride=-1) const
287  { doFillArray(data, start, length, tsize, stride); }
289  int tsize, int stride=-1) const
290  { doFillArray(data, start, length, tsize, stride); }
292  int tsize, int stride=-1) const
293  { doFillArray(data, start, length, tsize, stride); }
295  int tsize, int stride=-1) const
296  { doFillArray(data, start, length, tsize, stride); }
299  int tsize, int stride=-1,
300  fpreal black=0, fpreal white=1) const
301  {
302  if(GTisFloat(getStorage()))
303  doFillQuantizedArray(data, start, length, tsize,
304  stride, black, white);
305  else
306  doFillArray(data, start, length, tsize, stride);
307  }
308 
310  UT_BoundingBoxF &bbox, int tsize, int stride=-1)
311  {
312  UT_ASSERT_P(tsize==3);
313  doFillVec3BBox(dest, start, length, bbox,
314  tsize, stride);
315  }
317  UT_BoundingBoxD &bbox, int tsize, int stride=-1)
318  {
319  UT_ASSERT_P(tsize==3);
320  doFillVec3BBox(dest, start, length, bbox,
321  tsize, stride);
322  }
323  /// @}
324 
325  /// @{
326  /// Extract data for an array attribute into a flat data array.
327  /// Since each entry in an array attribute varies in terms of array size,
328  /// the sizes of each entry will be stored in the @c sizes array.
330  GT_Offset start, GT_Size length) const
331  { doFillArrayAttr(data, sizes, start, length); }
333  GT_Offset start, GT_Size length) const
334  { doFillArrayAttr(data, sizes, start, length); }
336  GT_Offset start, GT_Size length) const
337  { doFillArrayAttr(data, sizes, start, length); }
339  GT_Offset start, GT_Size length) const
340  { doFillArrayAttr(data, sizes, start, length); }
342  GT_Offset start, GT_Size length) const
343  { doFillArrayAttr(data, sizes, start, length); }
345  GT_Offset start, GT_Size length) const
346  { doFillArrayAttr(data, sizes, start, length); }
348  GT_Offset start, GT_Size length) const
349  { doFillArrayAttr(data, sizes, start, length); }
351  GT_Offset start, GT_Size length) const
352  { doFillArrayAttr(data, sizes, start, length); }
353  /// @}
354 
355  virtual void extendedFillArray(uint8 *data,
357  int tsize, int nrepeats,
358  int stride=-1,
359  fpreal black=0, fpreal white=1) const
360  {
361  doExtendedQuantizedFill(data, start, length, tsize,
362  nrepeats, stride, black, white);
363  }
364 
365  /// @{
366  /// Extract an element, but making @c nrepeats copies. The buffer
367  /// should be able to contain @c length*nrepeats*tsize elements
368  /// When filling an RGB color, with a repeat count of 4, the resulting
369  /// buffer will look like: @code
370  /// [ RGB0 RGB0 RGB0 RGB0 RGB1 RGB1 RGB1 RGB1 ... ]
371  /// @endcode
372  /// With a repeat count of 1, this is equivalent to @c fillArray()
374  int tsize, int nrepeats, int stride=-1) const
375  {
376  t_extendedFill(data, start, length, tsize,
377  nrepeats, stride);
378  }
380  int tsize, int nrepeats, int stride=-1) const
381  {
382  t_extendedFill(data, start, length, tsize,
383  nrepeats, stride);
384  }
386  int tsize, int nrepeats, int stride=-1) const
387  {
388  t_extendedFill(data, start, length, tsize,
389  nrepeats, stride);
390  }
392  int tsize, int nrepeats, int stride=-1) const
393  {
394  t_extendedFill(data, start, length, tsize,
395  nrepeats, stride);
396  }
398  int tsize, int nrepeats, int stride=-1) const
399  {
400  t_extendedFill(data, start, length, tsize,
401  nrepeats, stride);
402  }
404  int tsize, int nrepeats, int stride=-1) const
405  {
406  t_extendedFill(data, start, length, tsize,
407  nrepeats, stride);
408  }
410  int tsize, int nrepeats, int stride=-1) const
411  {
412  t_extendedFill(data, start, length, tsize,
413  nrepeats, stride);
414  }
416  int tsize, int nrepeats, int stride=-1) const
417  {
418  t_extendedFill(data, start, length, tsize,
419  nrepeats, stride);
420  }
421  /// @}
422 
423  /// @{
424  /// Copy the data out of the array as a tuple of @em size entries
425  /// The data may be copied, or the array may return a pointer to raw data.
426  /// That is, the sub-class may @b not copy the data into the storage.
427  virtual const uint8 *get(GT_Offset i, uint8 *store, int sz) const;
428  virtual const int8 *get(GT_Offset i, int8 *store, int sz) const;
429  virtual const int16 *get(GT_Offset i, int16 *store, int sz) const;
430  virtual const int32 *get(GT_Offset i, int32 *store, int sz) const;
431  virtual const int64 *get(GT_Offset i, int64 *store, int sz) const;
432  virtual const fpreal16 *get(GT_Offset i, fpreal16 *store, int z) const;
433  virtual const fpreal32 *get(GT_Offset i, fpreal32 *store, int z) const;
434  virtual const fpreal64 *get(GT_Offset i, fpreal64 *store, int z) const;
435  /// @}
436 
437  /// @{
438  /// Get the range of values in the array
439  virtual void getRange(exint &lo, exint &hi, int tuple_idx=0) const;
440  virtual void getRange(fpreal &lo, fpreal &hi, int tidx=0) const;
441  /// @}
442 
443  /// Compare whether two data arrays are equal.
444  virtual bool isEqual(const GT_DataArray &src) const;
445 
446  /// @{
447  /// Compute a hash of the data in the array. The base class hash is computed
448  /// @code
449  /// SYS_HashType hash = 0;
450  /// for (i = begin; i < end; ++i) {
451  /// import(i, tmp, getTupleSize());
452  /// for (t = 0; t < getTupleSize(); t++)
453  /// SYShashCombine(hash, hashNumeric(tmp[t]));
454  /// }
455  /// @endcode
456  /// Where @c hashNumeric returns the value for integer types. Real data is
457  /// cast to the corresponding unsigned integer values. For example, fpreal16 @code
458  /// void hashNumeric(SYS_HashType &hash, fpreal16 v) {
459  /// SYShashCombine(hash, *(const uint16 *)(&v));
460  /// }
461  /// void hashNumeric(SYS_HashType &hash, fpreal32 v) {
462  /// SYShashCombine(hash, *(const uint32 *)(&v));
463  /// }
464  /// @endcode
465  SYS_HashType hash() const { return hashRange(0, entries()); }
466  virtual SYS_HashType hashRange(exint begin, exint end) const;
467  /// @}
468 
469  /// Enlarge a bounding box with values of this 3-tuple array
471  {
472  // Initialize min/max
473  for (int i = 0, n = getTupleSize(); i < n; ++i)
474  {
475  min[i] = SYS_FP64_MAX;
476  max[i] = -SYS_FP64_MAX;
477  }
478  if (getStorage() == GT_STORE_STRING)
479  return false;
480  if (!entries())
481  return true;
482  return computeMinMax(min, max);
483  }
485  {
486  int tsize = getTupleSize();
487  UT_StackBuffer<fpreal64> min(tsize), max(tsize);
488  getMinMax(min, max);
489  if (min[0] <= max[0] && min[1] <= max[1] && min[2] <= max[2])
490  {
491  b.enlargeBounds(min[0], min[1], min[2]);
492  b.enlargeBounds(max[0], max[1], max[2]);
493  }
494  return true;
495  }
496 
497  /// Test to see whether the data array requires int32 or int64 indexing.
498  GT_Storage checkIndexing(GT_IndexingMode mode) const;
499 
500  /// Quick & dirty test to see if a size is bigger than a 32 bit int
501  static bool isBigInteger(GT_Size size)
502  { return size >= (((int64)1) << 31); }
503 
504  /// For debugging, print values to stdout
505  void dumpValues(const char *msg=NULL) const;
506 
507  /// Save array to a JSON stream. The 'flat' determines how to output
508  /// arrays with a tuple size greater than 1. If 'flat' is true, the
509  /// output will be an uninterrupted stream of values. If 'flat' is
510  /// false, then the output will look something like [[1,2,3],[4,5,6], ... ]
511  bool save(UT_JSONWriter &w, bool flat = true) const;
512 
513  /// @{
514  /// For memory tracking, we override the new/delete operators
515  static void *operator new(size_t size);
516  static void *operator new(size_t size, void *p);
517  static void operator delete(void *p, size_t size);
518  /// @}
519 
520  /// Forcibly set the data id for the array. You take responsibility for
521  /// all artifacts and crashes if you call this indiscriminately.
522  void copyDataId(const GT_DataArray &src)
523  { setDataId(src.getDataId()); }
524 
525  /// Set the data id - This is used by geometry arrays to copy over the data
526  /// id from GA. As above, you take responsibility for all artifacts and
527  /// crashes if you set this incorrectly. Do not set this if you don't
528  /// know how data IDs work.
529  void setDataId(int64 id) { myDataId = id; }
530 
531  /// Update cached data, in case the underlying attribute changed.
532  virtual void updateGeoDetail(const GU_ConstDetailHandle &dtl,
533  const char *attrib_name,
534  GT_Owner attrib_owner,
535  const int expected_size) {}
536 
537 protected:
538  /// Compute the min & max values for an array. This fails for strings
540  {
541  public:
543  : myArray(array)
544  , myTupleSize(array.getTupleSize())
545  {
546  initBuffers();
547  for (int j = 0; j < myTupleSize; ++j)
548  {
549  myMin[j] = SYS_FP64_MAX;
550  myMax[j] = -SYS_FP64_MAX;
551  }
552  }
554  : myArray(src.myArray)
555  , myTupleSize(src.myTupleSize)
556  {
557  initBuffers();
558  std::copy(src.myMin, src.myMin+myTupleSize, myMin);
559  std::copy(src.myMax, src.myMax+myTupleSize, myMax);
560  }
562  {
563  if (myMin != myMinBuffer)
564  {
565  delete [] myMin;
566  delete [] myMax;
567  delete [] myPos;
568  }
569  }
571  {
572  for (GT_Size i = range.begin(), n = range.end(); i < n; ++i)
573  {
574  myArray.import(i, myPos, myTupleSize);
575  for (int j = 0; j < myTupleSize; ++j)
576  {
577  myMin[j] = SYSmin(myMin[j], myPos[j]);
578  myMax[j] = SYSmax(myMax[j], myPos[j]);
579  }
580  }
581  }
583  {
584  for (int j = 0; j < myTupleSize; ++j)
585  {
586  min[j] = SYSmin(min[j], myMin[j]);
587  max[j] = SYSmax(max[j], myMax[j]);
588  }
589  }
590  void join(const minMaxTask &src)
591  {
592  for (int j = 0; j < myTupleSize; ++j)
593  {
594  myMin[j] = SYSmin(myMin[j], src.myMin[j]);
595  myMax[j] = SYSmax(myMax[j], src.myMax[j]);
596  }
597  }
598  private:
599  void initBuffers()
600  {
601  if (myTupleSize > 16)
602  {
603  myMin = new fpreal64[myTupleSize];
604  myMax = new fpreal64[myTupleSize];
605  myPos = new fpreal64[myTupleSize];
606  }
607  else
608  {
609  myMin = myMinBuffer;
610  myMax = myMaxBuffer;
611  myPos = myPosBuffer;
612  }
613  }
614  const GT_DataArray &myArray;
615  fpreal64 *myMin;
616  fpreal64 *myMax;
617  fpreal64 *myPos;
618  fpreal64 myMinBuffer[16];
619  fpreal64 myMaxBuffer[16];
620  fpreal64 myPosBuffer[16];
621  int myTupleSize;
622  };
623  virtual bool computeMinMax(fpreal64 *min, fpreal64 *max) const
624  {
625  minMaxTask task(*this);
627  task.getResult(min, max);
628  return true;
629  }
630  /// Ensure the size is set properly when performing an import. If the size
631  /// isn't specified, we use the array's tuple size, otherwise we make sure
632  /// to clamp the tuple size.
635  {
636  return size == 0 ? tuple_size : SYSmin(size, tuple_size);
637  }
638 
639  /// @{
640  /// Virtual implementation for inline methods.
641  /// Note that @c doImport is for tuple data, while @c doImportArray
642  /// is for tuple array data.
643  virtual void doImport(GT_Offset idx, uint8 *data, GT_Size size) const;
644  virtual void doImport(GT_Offset idx, int8 *data, GT_Size size) const;
645  virtual void doImport(GT_Offset idx, int16 *data, GT_Size size) const;
646  virtual void doImport(GT_Offset idx, int32 *data, GT_Size size) const;
647  virtual void doImport(GT_Offset idx, int64 *data, GT_Size size) const;
648  virtual void doImport(GT_Offset idx, fpreal16 *data, GT_Size size) const;
649  virtual void doImport(GT_Offset idx, fpreal32 *data, GT_Size size) const;
650  virtual void doImport(GT_Offset idx, fpreal64 *data, GT_Size size) const;
651  virtual void doImportArray(GT_Offset idx, UT_ValArray<fpreal16> &data) const;
652  virtual void doImportArray(GT_Offset idx, UT_ValArray<fpreal32> &data) const;
653  virtual void doImportArray(GT_Offset idx, UT_ValArray<fpreal64> &data) const;
654  virtual void doImportArray(GT_Offset idx, UT_ValArray<uint8> &data) const;
655  virtual void doImportArray(GT_Offset idx, UT_ValArray<int8> &data) const;
656  virtual void doImportArray(GT_Offset idx, UT_ValArray<int16> &data) const;
657  virtual void doImportArray(GT_Offset idx, UT_ValArray<int32> &data) const;
658  virtual void doImportArray(GT_Offset idx, UT_ValArray<int64> &data) const;
659  virtual void doImportQuantized(GT_Offset idx, uint8 *data, GT_Size size,
660  fpreal black, fpreal white) const;
661 
663  int tuple_size, int stride) const
664  { t_extendedFill(data, start, length, tuple_size, 1, stride); }
665 
667  int tuple_size, int stride) const
668  { t_extendedFill(data, start, length, tuple_size, 1, stride); }
670  int tuple_size, int stride) const
671  { t_extendedFill(data, start, length, tuple_size, 1, stride); }
673  int tuple_size, int stride) const
674  { t_extendedFill(data, start, length, tuple_size, 1, stride); }
676  int tuple_size, int stride) const
677  { t_extendedFill(data, start, length, tuple_size, 1, stride); }
679  int tuple_size, int stride) const
680  { t_extendedFill(data, start, length, tuple_size, 1, stride); }
682  int tuple_size, int stride) const
683  { t_extendedFill(data, start, length, tuple_size, 1, stride); }
685  int tuple_size, int stride) const
686  { t_extendedFill(data, start, length, tuple_size, 1, stride); }
688  GT_Offset start, GT_Size length) const
689  { t_extendedFillArray(data, sizes, start, length); }
691  GT_Offset start, GT_Size length) const
692  { t_extendedFillArray(data, sizes, start, length); }
694  GT_Offset start, GT_Size length) const
695  { t_extendedFillArray(data, sizes, start, length); }
697  GT_Offset start, GT_Size length) const
698  { t_extendedFillArray(data, sizes, start, length); }
700  GT_Offset start, GT_Size length) const
701  { t_extendedFillArray(data, sizes, start, length); }
703  GT_Offset start, GT_Size length) const
704  { t_extendedFillArray(data, sizes, start, length); }
706  GT_Offset start, GT_Size length) const
707  { t_extendedFillArray(data, sizes, start, length); }
709  GT_Offset start, GT_Size length) const
710  { t_extendedFillArray(data, sizes, start, length); }
711 
714  int tuple_size, int stride,
715  fpreal black, fpreal white) const
716  {
717  doExtendedQuantizedFill(data, start, length, tuple_size,
718  1, stride, black, white);
719  }
720  virtual void doExtendedQuantizedFill(uint8 *data,
722  int tuple_size, int nrepeats, int stride,
723  fpreal black, fpreal white) const;
724 
725  /// Nested class to perform filling for a POD array
726  template <typename T_POD>
728  {
729  public:
731  GT_Offset start, int stride)
732  : myArray(array)
733  , myData(data)
734  , myStart(start)
735  , myStride(stride)
736  {
737  myBox.initBounds();
738  }
740  : myArray(src.myArray)
741  , myBox(src.myBox)
742  , myData(src.myData)
743  , myStart(src.myStart)
744  , myStride(src.myStride)
745  {
746  }
748  {
749  exint i = range.begin();
750  T_POD *dest = myData + i*myStride;
751  for (; i != range.end(); ++i, dest += myStride)
752  {
753  myArray.import(i+myStart, dest, 3);
754  myBox.enlargeBounds(dest[0], dest[1], dest[2]);
755  }
756  }
757  void join(const fillV3BoxTask<T_POD> &src)
758  {
759  myBox.enlargeBounds(src.myBox);
760  }
761  const UT_BoundingBox &box() const { return myBox; }
762  private:
763  const GT_DataArray &myArray;
764  UT_BoundingBox myBox;
765  T_POD *myData;
766  GT_Offset myStart;
767  int myStride;
768  };
769 
771  UT_BoundingBoxF &bbox, int, int stride)
772  {
773  stride = SYSmax(stride, 3);
774  fillV3BoxTask<fpreal32> task(*this, dest, start, stride);
776  bbox = task.box();
777  }
779  UT_BoundingBoxD &bbox, int, int stride)
780  {
781  stride = SYSmax(stride, 3);
782  fillV3BoxTask<fpreal64> task(*this, dest, start, stride);
784  bbox = task.box();
785  }
786  /// @}
787 
788  /// Templated method to fill an array
789  template <typename T_POD> void
790  t_extendedFill(T_POD *dest, GT_Offset start, GT_Size length,
791  int tsize, int nrepeats, int stride) const;
792 
793  /// Templated method to fill an array attribute
794  template <typename T_POD> void
795  t_extendedFillArray(UT_Array<T_POD> &dest, UT_Array<int> &sizes,
796  GT_Offset start, GT_Size length) const;
797 
798 private:
799  /// @{
800  /// @private
801  /// Get more complicated POD data types out of the array
802  template <typename T, int tuplesize> class VectorPODAccessor
803  {
804  public:
805  static T getValue(const GT_DataArray &array, GT_Offset offset)
806  {
807  T result;
808  UT_ASSERT_P(array.getTupleSize() >= tuplesize);
809  array.get(offset, result.data(), tuplesize);
810  return result;
811  }
812  };
813  class I32Accessor {
814  public:
815  static int32 getValue(const GT_DataArray &a, GT_Offset i)
816  { return a.getI32(i); }
817  };
818  class I64Accessor {
819  public:
820  static int64 getValue(const GT_DataArray &a, GT_Offset i)
821  { return a.getI64(i); }
822  };
823  class F16Accessor {
824  public:
825  static fpreal16 getValue(const GT_DataArray &a, GT_Offset i)
826  { return a.getF16(i); }
827  };
828  class F32Accessor {
829  public:
830  static fpreal32 getValue(const GT_DataArray &a, GT_Offset i)
831  { return a.getF32(i); }
832  };
833  class F64Accessor {
834  public:
835  static fpreal64 getValue(const GT_DataArray &a, GT_Offset i)
836  { return a.getF64(i); }
837  };
838  /// @}
839 
840  /// @{
841  /// @private
842  /// Private template class to register POD accessors
843  template <typename T, int FAKE> class TypeInfo {};
844  /// @}
845 
846  /// @{
847  /// @private
848  /// Simple scalar and vector accessors
849  template <int FAKE> class TypeInfo<int32, FAKE>
850  { public: typedef I32Accessor Accessors; };
851  template <int FAKE> class TypeInfo<int64, FAKE>
852  { public: typedef I64Accessor Accessors; };
853  template <int FAKE> class TypeInfo<fpreal16, FAKE>
854  { public: typedef F16Accessor Accessors; };
855  template <int FAKE> class TypeInfo<fpreal32, FAKE>
856  { public: typedef F32Accessor Accessors; };
857  template <int FAKE> class TypeInfo<fpreal64, FAKE>
858  { public: typedef F64Accessor Accessors; };
859 
860  template <int FAKE> class TypeInfo<UT_Vector3F, FAKE>
861  { public: typedef VectorPODAccessor<UT_Vector3F, 3> Accessors; };
862  template <int FAKE> class TypeInfo<UT_Vector3D, FAKE>
863  { public: typedef VectorPODAccessor<UT_Vector3D, 3> Accessors; };
864  template <int FAKE> class TypeInfo<UT_Vector4F, FAKE>
865  { public: typedef VectorPODAccessor<UT_Vector4F, 4> Accessors; };
866  template <int FAKE> class TypeInfo<UT_Vector4D, FAKE>
867  { public: typedef VectorPODAccessor<UT_Vector4D, 4> Accessors; };
868  template <int FAKE> class TypeInfo<UT_Matrix3F, FAKE>
869  { public: typedef VectorPODAccessor<UT_Matrix3F, 9> Accessors; };
870  template <int FAKE> class TypeInfo<UT_Matrix3D, FAKE>
871  { public: typedef VectorPODAccessor<UT_Matrix3D, 9> Accessors; };
872  template <int FAKE> class TypeInfo<UT_Matrix4F, FAKE>
873  { public: typedef VectorPODAccessor<UT_Matrix4F, 16> Accessors; };
874  template <int FAKE> class TypeInfo<UT_Matrix4D, FAKE>
875  { public: typedef VectorPODAccessor<UT_Matrix4D, 16> Accessors; };
876  /// @}
877 public:
878  /// Public accessor for POD types
879  template <typename T> T
881  { return TypeInfo<T, 0>::Accessors::getValue(*this, index); }
882 
883  template <typename T> T
885  {
886  return (1-t)*getValue<T>(i0) + t*getValue<T>(i1);
887  }
888 
889  template <typename T> T
891  GT_Offset u0v1, GT_Offset u1v1, fpreal u, fpreal v)
892  {
893  T l = (1-v)*getValue<T>(u0v0) + v*getValue<T>(u0v1);
894  T r = (1-v)*getValue<T>(u1v0) + v*getValue<T>(u1v1);
895  return (1-u)*l + u*r;
896  }
897 
898 private:
899  int64 myDataId;
900 };
901 
902 #endif
SYS_HashType hash() const
Definition: GT_DataArray.h:465
#define SYSmax(a, b)
Definition: SYS_Math.h:1535
GT_Storage
Definition: GT_Types.h:18
virtual void updateGeoDetail(const GU_ConstDetailHandle &dtl, const char *attrib_name, GT_Owner attrib_owner, const int expected_size)
Update cached data, in case the underlying attribute changed.
Definition: GT_DataArray.h:532
virtual void extendedFill(int16 *data, GT_Offset start, GT_Size length, int tsize, int nrepeats, int stride=-1) const
Definition: GT_DataArray.h:385
GLboolean GLboolean GLboolean b
Definition: glcorearb.h:1221
virtual bool getIA32(UT_ValArray< int32 > &a, GT_Offset offset) const
Definition: GT_DataArray.h:133
virtual void doFillQuantizedArray(uint8 *data, GT_Offset start, GT_Size length, int tuple_size, int stride, fpreal black, fpreal white) const
Definition: GT_DataArray.h:712
virtual bool isValid() const
Data array is valid; can be sampled from.
Definition: GT_DataArray.h:83
void fillArray(UT_Array< fpreal64 > &data, UT_Array< int > &sizes, GT_Offset start, GT_Size length) const
Definition: GT_DataArray.h:350
int int32
Definition: SYS_Types.h:39
virtual fpreal16 getF16(GT_Offset offset, int idx=0) const
Definition: GT_DataArray.h:111
tbb::split UT_Split
Definition: GA_PolyCounts.h:24
virtual void extendedFill(int32 *data, GT_Offset start, GT_Size length, int tsize, int nrepeats, int stride=-1) const
Definition: GT_DataArray.h:391
void fillArray(fpreal64 *data, GT_Offset start, GT_Size length, int tsize, int stride=-1) const
Definition: GT_DataArray.h:294
Nested class to perform filling for a POD array.
Definition: GT_DataArray.h:727
virtual bool getFA64(UT_ValArray< fpreal64 > &a, GT_Offset offset) const
Definition: GT_DataArray.h:125
virtual fpreal64 getF64(GT_Offset offset, int idx=0) const
Definition: GT_DataArray.h:114
T lerpValue(GT_Offset i0, GT_Offset i1, fpreal t) const
Definition: GT_DataArray.h:884
virtual void fillStringArray(UT_StringArray &data, UT_ValArray< int > &sizes, GT_Offset start, GT_Size length) const
Definition: GT_DataArray.h:198
void join(const fillV3BoxTask< T_POD > &src)
Definition: GT_DataArray.h:757
GLuint start
Definition: glcorearb.h:474
void fillArray(UT_Array< fpreal32 > &data, UT_Array< int > &sizes, GT_Offset start, GT_Size length) const
Definition: GT_DataArray.h:347
virtual void doFillArray(int16 *data, GT_Offset start, GT_Size length, int tuple_size, int stride) const
Definition: GT_DataArray.h:669
bool enlargeBounds(UT_BoundingBox &b) const
Definition: GT_DataArray.h:484
GT_IndexingMode
Definition: GT_Types.h:102
virtual fpreal32 getF32(GT_Offset offset, int idx=0) const =0
virtual const void * getBackingData() const
Definition: GT_DataArray.h:91
#define GT_API
Definition: GT_API.h:11
int64 exint
Definition: SYS_Types.h:125
const UT_BoundingBox & box() const
Definition: GT_DataArray.h:761
GT_Type
Definition: GT_Types.h:34
virtual int64 getI64(GT_Offset offset, int idx=0) const
Definition: GT_DataArray.h:108
std::size_t SYS_HashType
Define the type for hash values.
Definition: SYS_Hash.h:19
static bool isBigInteger(GT_Size size)
Quick & dirty test to see if a size is bigger than a 32 bit int.
Definition: GT_DataArray.h:501
virtual bool getUA8(UT_ValArray< uint8 > &a, GT_Offset offset) const
Definition: GT_DataArray.h:127
void fillArray(int16 *data, GT_Offset start, GT_Size length, int tsize, int stride=-1) const
Definition: GT_DataArray.h:279
virtual void extendedFill(fpreal16 *data, GT_Offset start, GT_Size length, int tsize, int nrepeats, int stride=-1) const
Definition: GT_DataArray.h:403
Class which writes ASCII or binary JSON streams.
Definition: UT_JSONWriter.h:35
minMaxTask(const GT_DataArray &array)
Definition: GT_DataArray.h:542
virtual void extendedFill(int64 *data, GT_Offset start, GT_Size length, int tsize, int nrepeats, int stride=-1) const
Definition: GT_DataArray.h:397
GLenum src
Definition: glcorearb.h:1792
A reference counter base class for use with UT_IntrusivePtr.
void fillArray(UT_Array< int16 > &data, UT_Array< int > &sizes, GT_Offset start, GT_Size length) const
Definition: GT_DataArray.h:335
virtual void doFillArray(int64 *data, GT_Offset start, GT_Size length, int tuple_size, int stride) const
Definition: GT_DataArray.h:675
virtual GT_Size itemSize(GT_Offset) const
Return the number of elements in the array for the given item.
Definition: GT_DataArray.h:60
float fpreal32
Definition: SYS_Types.h:200
GLdouble GLdouble t
Definition: glew.h:1403
GLuint buffer
Definition: glcorearb.h:659
#define SYS_FP64_MAX
Definition: SYS_Types.h:221
virtual void doFillVec3BBox(fpreal64 *dest, GT_Offset start, GT_Size length, UT_BoundingBoxD &bbox, int, int stride)
Definition: GT_DataArray.h:778
virtual void extendedFill(fpreal32 *data, GT_Offset start, GT_Size length, int tsize, int nrepeats, int stride=-1) const
Definition: GT_DataArray.h:409
virtual void doFillVec3BBox(fpreal32 *dest, GT_Offset start, GT_Size length, UT_BoundingBoxF &bbox, int, int stride)
Definition: GT_DataArray.h:770
void fillArray(fpreal32 *data, GT_Offset start, GT_Size length, int tsize, int stride=-1) const
Definition: GT_DataArray.h:291
virtual bool getIA64(UT_ValArray< int64 > &a, GT_Offset offset) const
Definition: GT_DataArray.h:135
virtual bool computeMinMax(fpreal64 *min, fpreal64 *max) const
Definition: GT_DataArray.h:623
GLdouble l
Definition: glew.h:9164
virtual bool getIA16(UT_ValArray< int16 > &a, GT_Offset offset) const
Definition: GT_DataArray.h:131
GLsizeiptr size
Definition: glcorearb.h:663
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:856
double fpreal64
Definition: SYS_Types.h:201
unsigned char uint8
Definition: SYS_Types.h:36
GLenum array
Definition: glew.h:9108
virtual void extendedFill(int8 *data, GT_Offset start, GT_Size length, int tsize, int nrepeats, int stride=-1) const
Definition: GT_DataArray.h:379
virtual void doFillArrayAttr(UT_Array< fpreal16 > &data, UT_Array< int > &sizes, GT_Offset start, GT_Size length) const
Definition: GT_DataArray.h:702
void getResult(fpreal64 *min, fpreal64 *max) const
Definition: GT_DataArray.h:582
virtual void doFillArrayAttr(UT_Array< int32 > &data, UT_Array< int > &sizes, GT_Offset start, GT_Size length) const
Definition: GT_DataArray.h:696
Abstract data class for an array of float, int or string data.
Definition: GT_DataArray.h:40
ImageBuf OIIO_API min(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
virtual const uint8 * get(GT_Offset i, uint8 *store, int sz) const
virtual void extendedFill(uint8 *data, GT_Offset start, GT_Size length, int tsize, int nrepeats, int stride=-1) const
Definition: GT_DataArray.h:373
UT_IntrusivePtr< GT_DataArray > GT_DataArrayHandle
Definition: GT_DataArray.h:32
virtual void extendedFill(fpreal64 *data, GT_Offset start, GT_Size length, int tsize, int nrepeats, int stride=-1) const
Definition: GT_DataArray.h:415
virtual int64 getDataId() const
Definition: GT_DataArray.h:98
#define UT_ASSERT_P(ZZ)
Definition: UT_Assert.h:170
fillV3BoxTask(const GT_DataArray &array, T_POD *data, GT_Offset start, int stride)
Definition: GT_DataArray.h:730
const GLdouble * v
Definition: glcorearb.h:836
void fillArray(UT_Array< int8 > &data, UT_Array< int > &sizes, GT_Offset start, GT_Size length) const
Definition: GT_DataArray.h:332
virtual void doFillArray(int8 *data, GT_Offset start, GT_Size length, int tuple_size, int stride) const
Definition: GT_DataArray.h:666
GLboolean GLboolean GLboolean GLboolean a
Definition: glcorearb.h:1221
GLuint GLuint end
Definition: glcorearb.h:474
virtual bool getFA32(UT_ValArray< fpreal32 > &a, GT_Offset offset) const
Definition: GT_DataArray.h:123
GLsizei const GLchar *const * string
Definition: glcorearb.h:813
GLsizei GLenum const void * indices
Definition: glcorearb.h:405
virtual bool getIA8(UT_ValArray< int8 > &a, GT_Offset offset) const
Definition: GT_DataArray.h:129
virtual bool getPointerAliasing(const void *data) const
Return "true" if there's pointer aliasing.
Definition: GT_DataArray.h:79
ImageBuf OIIO_API max(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
GLdouble GLdouble GLdouble z
Definition: glcorearb.h:847
virtual void doFillArrayAttr(UT_Array< int8 > &data, UT_Array< int > &sizes, GT_Offset start, GT_Size length) const
Definition: GT_DataArray.h:690
virtual void doFillArrayAttr(UT_Array< int16 > &data, UT_Array< int > &sizes, GT_Offset start, GT_Size length) const
Definition: GT_DataArray.h:693
int64 GT_Offset
Definition: GT_Types.h:124
long long int64
Definition: SYS_Types.h:116
virtual void doFillArray(uint8 *data, GT_Offset start, GT_Size length, int tuple_size, int stride) const
Definition: GT_DataArray.h:662
GLfloat GLfloat p
Definition: glew.h:16656
GLuint id
Definition: glcorearb.h:654
virtual void extendedFillArray(uint8 *data, GT_Offset start, GT_Size length, int tsize, int nrepeats, int stride=-1, fpreal black=0, fpreal white=1) const
Definition: GT_DataArray.h:355
virtual bool getSA(UT_StringArray &a, GT_Offset offset) const
Definition: GT_DataArray.h:119
#define SYS_STATIC_FORCE_INLINE
Definition: SYS_Inline.h:48
T getValue(GT_Offset index) const
Public accessor for POD types.
Definition: GT_DataArray.h:880
signed char int8
Definition: SYS_Types.h:35
GLsizei const GLchar *const * strings
Definition: glcorearb.h:1932
void enlargeBounds(const UT_Vector3T< T > &min, const UT_Vector3T< T > &max)
void fillArray(fpreal16 *data, GT_Offset start, GT_Size length, int tsize, int stride=-1) const
Definition: GT_DataArray.h:288
void setDataId(int64 id)
Definition: GT_DataArray.h:529
fillV3BoxTask(fillV3BoxTask &src, UT_Split)
Definition: GT_DataArray.h:739
virtual void doFillArrayAttr(UT_Array< fpreal64 > &data, UT_Array< int > &sizes, GT_Offset start, GT_Size length) const
Definition: GT_DataArray.h:708
void copyDataId(const GT_DataArray &src)
Definition: GT_DataArray.h:522
GLenum mode
Definition: glcorearb.h:98
GLdouble n
Definition: glcorearb.h:2007
GT_Owner
Definition: GT_Types.h:86
void operator()(const UT_BlockedRange< GT_Size > &range)
Definition: GT_DataArray.h:570
GLboolean * data
Definition: glcorearb.h:130
minMaxTask(minMaxTask &src, UT_Split)
Definition: GT_DataArray.h:553
int64 GT_Size
Definition: GT_Types.h:123
GLuint GLsizei GLsizei * length
Definition: glcorearb.h:794
void fillArray(int8 *data, GT_Offset start, GT_Size length, int tsize, int stride=-1) const
Definition: GT_DataArray.h:276
virtual bool getFA16(UT_ValArray< fpreal16 > &a, GT_Offset offset) const
Definition: GT_DataArray.h:121
virtual void doFillArray(fpreal16 *data, GT_Offset start, GT_Size length, int tuple_size, int stride) const
Definition: GT_DataArray.h:678
void fillVec3BBox(fpreal64 *dest, GT_Offset start, GT_Size length, UT_BoundingBoxD &bbox, int tsize, int stride=-1)
Definition: GT_DataArray.h:316
virtual void doFillArray(fpreal32 *data, GT_Offset start, GT_Size length, int tuple_size, int stride) const
Definition: GT_DataArray.h:681
virtual void doFillArrayAttr(UT_Array< fpreal32 > &data, UT_Array< int > &sizes, GT_Offset start, GT_Size length) const
Definition: GT_DataArray.h:705
bool getMinMax(fpreal64 *min, fpreal64 *max) const
Enlarge a bounding box with values of this 3-tuple array.
Definition: GT_DataArray.h:470
virtual int16 getI16(GT_Offset offset, int idx=0) const
Definition: GT_DataArray.h:105
void operator()(const UT_BlockedRange< exint > &range)
Definition: GT_DataArray.h:747
void fillVec3BBox(fpreal32 *dest, GT_Offset start, GT_Size length, UT_BoundingBoxF &bbox, int tsize, int stride=-1)
Definition: GT_DataArray.h:309
short int16
Definition: SYS_Types.h:37
fpreal64 fpreal
Definition: SYS_Types.h:277
virtual bool hasArrayEntries() const
Returns "true" if each entry is an array.
Definition: GT_DataArray.h:76
GLuint index
Definition: glcorearb.h:785
void fillArray(UT_Array< int64 > &data, UT_Array< int > &sizes, GT_Offset start, GT_Size length) const
Definition: GT_DataArray.h:341
virtual void doFillArray(fpreal64 *data, GT_Offset start, GT_Size length, int tuple_size, int stride) const
Definition: GT_DataArray.h:684
OIIO_API bool copy(string_view from, string_view to, std::string &err)
void fillArray(UT_Array< fpreal16 > &data, UT_Array< int > &sizes, GT_Offset start, GT_Size length) const
Definition: GT_DataArray.h:344
void fillArray(uint8 *data, GT_Offset start, GT_Size length, int tsize, int stride=-1, fpreal black=0, fpreal white=1) const
Definition: GT_DataArray.h:297
virtual void doFillArrayAttr(UT_Array< int64 > &data, UT_Array< int > &sizes, GT_Offset start, GT_Size length) const
Definition: GT_DataArray.h:699
T bilerpValue(GT_Offset u0v0, GT_Offset u1v0, GT_Offset u0v1, GT_Offset u1v1, fpreal u, fpreal v)
Definition: GT_DataArray.h:890
GLuint GLsizei const GLuint const GLintptr const GLsizeiptr * sizes
Definition: glcorearb.h:2620
GLenum GLint * range
Definition: glcorearb.h:1924
void fillArray(int32 *data, GT_Offset start, GT_Size length, int tsize, int stride=-1) const
Definition: GT_DataArray.h:282
GLintptr offset
Definition: glcorearb.h:664
GLint GLenum GLboolean GLsizei stride
Definition: glcorearb.h:871
void fillArray(int64 *data, GT_Offset start, GT_Size length, int tsize, int stride=-1) const
Definition: GT_DataArray.h:285
virtual void doFillArray(int32 *data, GT_Offset start, GT_Size length, int tuple_size, int stride) const
Definition: GT_DataArray.h:672
void join(const minMaxTask &src)
Definition: GT_DataArray.h:590
virtual int32 getI32(GT_Offset offset, int idx=0) const =0
SYS_STATIC_FORCE_INLINE GT_Size fixImportTupleSize(GT_Size size, GT_Size tuple_size)
Definition: GT_DataArray.h:634
GLboolean r
Definition: glcorearb.h:1221
virtual int8 getI8(GT_Offset offset, int idx=0) const
Definition: GT_DataArray.h:103
virtual GT_Size getTupleSize() const =0
Number of elements for each array element.
#define SYSmin(a, b)
Definition: SYS_Math.h:1536
void fillArray(UT_Array< uint8 > &data, UT_Array< int > &sizes, GT_Offset start, GT_Size length) const
Definition: GT_DataArray.h:329
Declare prior to use.
virtual void doFillArrayAttr(UT_Array< uint8 > &data, UT_Array< int > &sizes, GT_Offset start, GT_Size length) const
Definition: GT_DataArray.h:687
Compute the min & max values for an array. This fails for strings.
Definition: GT_DataArray.h:539
virtual GT_Size getTotalArrayEntries() const
Definition: GT_DataArray.h:63
void UTparallelReduceLightItems(const Range &range, Body &body)
void fillArray(UT_Array< int32 > &data, UT_Array< int > &sizes, GT_Offset start, GT_Size length) const
Definition: GT_DataArray.h:338