HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GU_PrimVolumeCache.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: GU_PrimVolumeCache.h ( GU Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __GU_PrimVolumeCache__
12 #define __GU_PrimVolumeCache__
13 
14 #include "GU_API.h"
15 
16 #include <string.h>
17 #include <UT/UT_Vector3.h>
18 #include <UT/UT_Vector4.h>
19 #include <UT/UT_Array.h>
20 #include <UT/UT_VoxelArray.h>
22 
23 #include <GEO/GEO_PrimVolume.h>
24 
25 #include "GU_Detail.h"
26 #include "GU_DetailHandle.h"
27 #include "GU_DisplayCache.h"
28 
29 class UT_Ramp;
30 class GEO_PrimVolume;
31 class GEO_PrimVDB;
32 
33 // TODO: When deleting GU_DisplayCache, DON'T delete
34 // GU_PrimVolumeCache. Move it to GT_PrimVolumeCache,
35 // along with any functions needed from the superclass.
36 // It's still used by GT_PrimVolume!!!
38 
40 {
41 public:
43  : myOrg(0,0,0), myDir(0,0,0), myCd(0,0,0), myShadow(0.0),
44  myHasAttenuation(false), myIsAmbient(false), myIsInfinite(false),
45  myIsHeadlight(false), myIsEnvironment(false)
46  {
47  memset(myAtten, 0, sizeof(float)*8);
48  }
49 
50  bool operator==(const GU_PrimVolumeCacheLight &l) const
51  {
52  // ignore headlight to prevent updates on tumble
53  if (myIsHeadlight &&
54  myIsHeadlight == l.myIsHeadlight)
55  return true;
56 
57  return (myOrg == l.myOrg) &&
58  (myDir == l.myDir) &&
59  (myCd == l.myCd) &&
60  (myIsAmbient == l.myIsAmbient) &&
61  (myIsInfinite == l.myIsInfinite) &&
62  (myShadow == l.myShadow) &&
63  (myIsEnvironment == l.myIsEnvironment);
64  }
65 
66  void setOrg(const UT_Vector3 &org) { myOrg = org; }
67  void setDir(const UT_Vector3 &dir) { myDir = dir; }
68  void setCd(const UT_Vector3 &cd) { myCd = cd; }
69  void setShadowIntensity(float shadow) { myShadow = shadow; }
70  void setIsAmbient(bool isamb) { myIsAmbient = isamb; }
71  void setIsInfinite(bool isinf) { myIsInfinite = isinf; }
72  void setIsHeadlight(bool hl) { myIsHeadlight = hl; }
73  void setIsEnvironment(bool env) { myIsEnvironment = env; }
74 
75  const UT_Vector3 &getOrg() const { return myOrg; }
76  const UT_Vector3 &getDir() const { return myDir; }
77  const UT_Vector3 &getCd() const { return myCd; }
78  float getShadow() const { return myShadow; }
79 
80  bool isAmbient() const { return myIsAmbient; }
81  bool isInfinite() const { return myIsInfinite; }
82  bool isHeadlight() const { return myIsHeadlight; }
83  bool isEnvironment() const { return myIsEnvironment; }
84 
85  float getDistance(const UT_Vector3 &pos) const;
86  // Inv Brightness attenuation for the 8 corners: x, then y, then z; - then +
87  // interpolate, then invert.
88  void setCornerAttenuation(float a[8])
89  {
90  myHasAttenuation = true;
91  for(int i=0; i<8; i++)
92  myAtten[i] = a[i];
93  }
94  bool hasAttenuation() const { return myHasAttenuation; }
95  float getAttenuation(const UT_Vector3F &uvw) const;
96 protected:
97  UT_Vector3 myOrg, myDir;
99  float myShadow;
101  float myAtten[8];
102  bool myIsAmbient, myIsInfinite, myIsHeadlight;
104 };
105 
106 
108 class GU_PrimVolume;
109 
111 {
112 public:
113  SYS_DEPRECATED_HDK(13.0)
115  SYS_DEPRECATED_HDK(13.0)
116  virtual ~GU_PrimVolumeTexture() {}
117 
118  SYS_DEPRECATED_HDK(13.0)
119  virtual void refresh(const UT_VoxelArrayV4 *voxels) = 0;
120  SYS_DEPRECATED_HDK(13.0)
121  virtual int64 getMemoryUsage(bool inclusive) const = 0;
122 };
123 
125 {
126 public:
127  GU_PrimVolumeCacheRamp(UT_Ramp *ramp, bool periodic);
128  ~GU_PrimVolumeCacheRamp();
129 
130  void eval(float &rval, float val) const;
131  void eval(UT_Vector4 &rval, float val) const;
132 
133 protected:
136 };
137 
139 {
140 public:
141  GU_PrimVolumeCacheSampler(const GEO_Detail *gdp, const GEO_Primitive *vol);
143 
144  GU_PrimVolumeCacheRamp *buildRampFromAttribute(
145  const GEO_Detail *gdp,
146  const char *attribname) const;
147  int findCollationIndex(const GEO_Detail *gdp,
148  const GEO_Primitive *vol) const;
149  const GEO_Primitive *selectVolumeFromAttribute(
150  const GEO_Detail *gdp,
151  const char *attribname,
152  int collateidx) const;
153  void selectVolumesFromAttribute(
154  const GEO_Primitive *vol[3],
155  const GEO_Detail *gdp,
156  const char *attribname,
157  int collateidx) const;
158  void getRangeFromAttribute(
159  const GEO_Detail *gdp,
160  const char *attribname,
161  float &rmin, float &rscale) const;
162  float getFloatFromAttribute(
163  const GEO_Detail *gdp,
164  const char *attribname,
165  float def) const;
166 
167  float getDensity(int x, int y, int z) const;
168  UT_Vector4 getDiffuse(int x, int y, int z) const;
169 
170  void getDensityProbe(UT_VoxelProbeF &probe) const;
171  void getEmitProbe(UT_VoxelProbeF &probe) const;
172  void getEmitCdProbe(UT_VoxelProbeV4 &probe) const;
173  const UT_VoxelArrayF *getDensityArray() const;
174 
175  const GEO_Primitive *densityField() const { return myDensityField; }
176  void setDensityField(const GEO_Primitive *densityfield);
177 
178  void hardenFields(const UT_VoxelArray<UT_Vector4> &refvol,
179  const GEO_PrimVolumeXform &volxform);
180 
181  UT_VoxelArrayReadHandleF hardenScalar(const UT_VoxelArrayV4 &refvol,
182  const GEO_PrimVolumeXform &volxform,
183  const GEO_Primitive *field,
185  float rmin, float rinvscale);
186  UT_VoxelArrayReadHandleV4 hardenVector(const UT_VoxelArrayV4 &refvol,
187  const GEO_PrimVolumeXform &volxform,
188  const GEO_Primitive *field,
190  float rmin, float rinvscale);
191  UT_VoxelArrayReadHandleV4 hardenVectorMulti(const UT_VoxelArrayV4 &refvol,
192  const GEO_PrimVolumeXform &volxform,
193  const GEO_Primitive *field[3],
195  float rmin, float rinvscale);
196  UT_VoxelArrayReadHandleV4 hardenVDBVector(const UT_VoxelArrayV4 &refvol,
197  const GEO_PrimVolumeXform &volxform,
198  const GEO_Primitive *field,
200  float rmin, float rinvscale);
201 
203  dst->numTiles() > 1,
204  doHardenAligned,
205  UT_VoxelArrayF *, dst,
206  const UT_VoxelArrayF *, src,
207  const GEO_PrimVolumeXform &, dst_xform,
208  const GEO_PrimVolumeXform &, src_xform,
209  GU_PrimVolumeCacheRamp *, ramp,
210  float, rmin,
211  float, rinvscale)
212  void doHardenAlignedPartial(UT_VoxelArrayF *dst,
214  const GEO_PrimVolumeXform &dst_xform,
215  const GEO_PrimVolumeXform &src_xform,
217  float rmin, float rinvscale,
218  const UT_JobInfo &info) const;
220  dst->numTiles() > 1,
221  doHardenUnaligned,
222  UT_VoxelArrayF *, dst,
223  const UT_VoxelArrayF *, src,
224  const GEO_PrimVolumeXform &, dst_xform,
225  const GEO_PrimVolumeXform &, src_xform,
226  GU_PrimVolumeCacheRamp *, ramp,
227  float, rmin,
228  float, rinvscale)
229  void doHardenUnalignedPartial(UT_VoxelArrayF *dst,
230  const UT_VoxelArrayF *src,
231  const GEO_PrimVolumeXform &dst_xform,
232  const GEO_PrimVolumeXform &src_xform,
234  float rmin, float rinvscale,
235  const UT_JobInfo &info) const;
237  dst->numTiles() > 1,
238  doHardenVectorAligned,
239  UT_VoxelArrayV4 *, dst,
240  const UT_VoxelArrayF *, src,
241  const GEO_PrimVolumeXform &, dst_xform,
242  const GEO_PrimVolumeXform &, src_xform,
243  GU_PrimVolumeCacheRamp *, ramp,
244  float, rmin,
245  float, rinvscale)
246  void doHardenVectorAlignedPartial(UT_VoxelArrayV4 *dst,
247  const UT_VoxelArrayF *src,
248  const GEO_PrimVolumeXform &dst_xform,
249  const GEO_PrimVolumeXform &src_xform,
251  float rmin, float rinvscale,
252  const UT_JobInfo &info) const;
254  dst->numTiles() > 1,
255  doHardenVectorUnaligned,
256  UT_VoxelArrayV4 *, dst,
257  const UT_VoxelArrayF *, src,
258  const GEO_PrimVolumeXform &, dst_xform,
259  const GEO_PrimVolumeXform &, src_xform,
260  GU_PrimVolumeCacheRamp *, ramp,
261  float, rmin,
262  float, rinvscale)
263  void doHardenVectorUnalignedPartial(UT_VoxelArrayV4 *dst,
264  const UT_VoxelArrayF *src,
265  const GEO_PrimVolumeXform &dst_xform,
266  const GEO_PrimVolumeXform &src_xform,
268  float rmin, float rinvscale,
269  const UT_JobInfo &info) const;
271  dst->numTiles() > 1,
272  doHardenVectorAxisAligned,
273  UT_VoxelArrayV4 *, dst,
274  const UT_VoxelArrayF *, src,
275  int, axis,
276  const GEO_PrimVolumeXform &, dst_xform,
277  const GEO_PrimVolumeXform &, src_xform,
278  GU_PrimVolumeCacheRamp *, ramp,
279  float, rmin,
280  float, rinvscale)
281  void doHardenVectorAxisAlignedPartial(UT_VoxelArrayV4 *dst,
283  int axis,
284  const GEO_PrimVolumeXform &dst_xform,
285  const GEO_PrimVolumeXform &src_xform,
287  float rmin, float rinvscale,
288  const UT_JobInfo &info) const;
290  dst->numTiles() > 1,
291  doHardenVectorAxisUnaligned,
292  UT_VoxelArrayV4 *, dst,
293  const UT_VoxelArrayF *, src,
294  int, axis,
295  const GEO_PrimVolumeXform &, dst_xform,
296  const GEO_PrimVolumeXform &, src_xform,
297  GU_PrimVolumeCacheRamp *, ramp,
298  float, rmin,
299  float, rinvscale)
300  void doHardenVectorAxisUnalignedPartial(UT_VoxelArrayV4 *dst,
301  const UT_VoxelArrayF *src,
302  int axis,
303  const GEO_PrimVolumeXform &dst_xform,
304  const GEO_PrimVolumeXform &src_xform,
306  float rmin, float rinvscale,
307  const UT_JobInfo &info) const;
308 
310  dst->numTiles() > 1,
311  doHardenVDB,
312  UT_VoxelArrayF *, dst,
313  const GEO_PrimVDB *, src,
314  const GEO_PrimVolumeXform &, xform,
315  GU_PrimVolumeCacheRamp *, ramp,
316  float, rmin,
317  float, rinvscale)
318  void doHardenVDBPartial(UT_VoxelArrayF *dst,
319  const GEO_PrimVDB *src,
320  const GEO_PrimVolumeXform &xform,
322  float rmin, float rinvscale,
323  const UT_JobInfo &info) const;
325  dst->numTiles() > 1,
326  doHardenVectorVDB,
327  UT_VoxelArrayV4 *, dst,
328  const GEO_PrimVDB *, src,
329  const GEO_PrimVolumeXform &, xform,
330  GU_PrimVolumeCacheRamp *, ramp,
331  float, rmin,
332  float, rinvscale)
333  void doHardenVectorVDBPartial(UT_VoxelArrayV4 *dst,
334  const GEO_PrimVDB *src,
335  const GEO_PrimVolumeXform &xform,
337  float rmin, float rinvscale,
338  const UT_JobInfo &info) const;
340  dst->numTiles() > 1,
341  doHardenVectorAxisVDB,
342  UT_VoxelArrayV4 *, dst,
343  const GEO_PrimVDB *, src,
344  int, axis,
345  const GEO_PrimVolumeXform &, xform,
346  GU_PrimVolumeCacheRamp *, ramp,
347  float, rmin,
348  float, rinvscale)
349  void doHardenVectorAxisVDBPartial(UT_VoxelArrayV4 *dst,
350  const GEO_PrimVDB *src,
351  int axis,
352  const GEO_PrimVolumeXform &xform,
354  float rmin, float rinvscale,
355  const UT_JobInfo &info) const;
357  dst->numTiles() > 1,
358  doHardenVectorVectorVDB,
359  UT_VoxelArrayV4 *, dst,
360  const GEO_PrimVDB *, src,
361  const GEO_PrimVolumeXform &, xform,
362  GU_PrimVolumeCacheRamp *, ramp,
363  float, rmin,
364  float, rinvscale)
365  void doHardenVectorVectorVDBPartial(UT_VoxelArrayV4 *dst,
366  const GEO_PrimVDB *src,
367  const GEO_PrimVolumeXform &xform,
369  float rmin, float rinvscale,
370  const UT_JobInfo &info) const;
371 
373  dst->numTiles() > 1,
374  applyAmbientLight,
375  UT_VoxelArrayV4 *, dst,
376  const UT_Vector4, cd)
377  void applyAmbientLightPartial(UT_VoxelArrayV4 *dst,
378  const UT_Vector4 &cd,
379  const UT_JobInfo &info) const;
380 
381  bool hasEmission() const;
382  float getEmissionScale() const { return myEmissionScale; }
383  float getShadowScale() const { return myShadowScale; }
384 
385 protected:
386  float myDensityMin, myDensityInvRange;
390 
391 
392  float myDiffuseMin, myDiffuseInvRange;
393  const GEO_Primitive *myDiffuseField[3];
395 
397  float myEmissionMin, myEmissionInvRange;
400 
401 
402  float myEmissionCdMin, myEmissionCdInvRange;
403  const GEO_Primitive *myEmissionCdField[3];
405 
410 };
411 
413 {
414 public:
415  GU_PrimVolumeCache(void);
416  virtual ~GU_PrimVolumeCache(void);
417 
418  // Build the cache.
419  int refresh(const GEO_Primitive *parent_prim,
420  const GU_PrimVolumeCacheParms &parms);
421 
422  // Get the cached data.
423  UT_VoxelArrayV4 *getShadedVoxels(bool *reduced=nullptr) const
424  {
425  if(reduced)
426  *reduced = myVolumeReduced;
427  return myVoxels;
428  }
429  SYS_DEPRECATED_HDK(13.0)
430  GU_PrimVolumeTexture *getTexture() const { return myTexture; }
431  SYS_DEPRECATED_HDK(13.0)
432  void setTexture(GU_PrimVolumeTexture *tex)
433  { myTexture = tex; }
434 
435  GU_ConstDetailHandle getIsoSurface() const { return myIsoSurf; }
436 
437  UT_Vector3 getIsoCd() const { return myIsoCd; }
438 
439  /// The cached resolution
440  UT_Vector3I getRes() const { return myCacheRes; }
441 
443  { return myVolumeXform; }
444 
445  int64 getMemoryUsage(bool inclusive) const
446  {
447  int64 mem = inclusive ? sizeof(*this) : 0;
448  if (myVoxels)
449  mem += myVoxels->getMemoryUsage(true);
450  mem += myLightList.getMemoryUsage(true);
451  if (myTexture)
452  mem += myTexture->getMemoryUsage(true);
453  mem += myIsoSurf.getMemoryUsage(false);
454  return mem;
455  }
456 
457 protected:
458  void lightVoxelsFromLight(const GU_PrimVolumeCacheSampler &sampler,
459  const GU_PrimVolumeCacheLight &light,
460  const UT_Vector3 &cd,
461  float shadowdensity);
462 
463  void rainbowVoxels(const GU_PrimVolumeCacheSampler &sampler);
464 
465  THREADED_METHOD3(GU_PrimVolumeCache, myVoxels->numTiles() > 1,
466  computeAlphaVoxels,
468  float, lightdensity,
469  bool, premultiply)
470  void computeAlphaVoxelsPartial(
472  float lightdensity,
473  bool premultiply,
474  const UT_JobInfo &info);
475 
476  /// Maximum per-axis resolution to do the self shadowing calculations
477  /// at.
478  int getMaxRes(const GEO_Primitive *volume,
479  const GU_PrimVolumeCacheParms &parms,
480  int axis) const;
481 
482  /// Used to convert to and from our *cached* indices, not the
483  /// actual primitive indices that may be a different resolution
484  bool indexToPos(int x, int y, int z, UT_Vector3 &pos) const;
485  bool posToIndex(UT_Vector3 pos, int &x, int &y, int &z) const;
486 
489  SYS_DEPRECATED_HDK(13.0)
491  GU_DetailHandle myIsoSurf;
492  float myOldLOD;
493  UT_Vector3 myIsoCd;
494 
495  UT_Vector3I myCacheRes;
496  GEO_PrimVolumeXform myVolumeXform;
497  bool myVolumeReduced;
498 
499  // Ignore these
500  UT_Matrix4 myCacheXform;
501  UT_Matrix4 myCacheIXform;
502 
503  const UT_VoxelArrayV4 *myCacheVolume;
504 };
505 
507 {
508 public:
510  : myMaxResW(0), myMaxResH(0), myMaxResD(0)
511  , myMax2DRes(0)
512  , myIsoPoints(false)
513  , myPreMultiply(true)
514  , myCachedFlag(true)
515  {}
516  virtual ~GU_PrimVolumeCacheParms(void) {}
517 
519  { myLightList = lightlist; }
521  { return myLightList; }
522 
523  void setMaxResolution(int w, int h, int d)
524  { myMaxResW = w; myMaxResH = h; myMaxResD = d; }
525  void getMaxResolution(int &w, int &h, int &d) const
526  { w = myMaxResW; h = myMaxResH; d = myMaxResD; }
527 
528  void setMax2DRes(int s)
529  { myMax2DRes = s; }
530  int getMax2DRes() const
531  { return myMax2DRes; }
532 
533  void setIsoPoints(bool iso_pts) { myIsoPoints = iso_pts; }
534  bool isIsoPoints() const { return myIsoPoints; }
535 
536  void setPreMultiply(bool premultiply) { myPreMultiply = premultiply; }
537  bool getPreMultiply() const { return myPreMultiply; }
538 
539  void setCached(bool b) const { myCachedFlag = b; }
540  bool isCached() const { return myCachedFlag; }
541 
542 private:
544  int myMaxResW;
545  int myMaxResH;
546  int myMaxResD;
547  int myMax2DRes;
548  bool myIsoPoints;
549  bool myPreMultiply;
550  mutable bool myCachedFlag;
551 };
552 
554 
555 #endif
556 
void setIsEnvironment(bool env)
#define THREADED_METHOD8_CONST(CLASSNAME, DOMULTI, METHOD, PARMTYPE1, PARMNAME1, PARMTYPE2, PARMNAME2, PARMTYPE3, PARMNAME3, PARMTYPE4, PARMNAME4, PARMTYPE5, PARMNAME5, PARMTYPE6, PARMNAME6, PARMTYPE7, PARMNAME7, PARMTYPE8, PARMNAME8)
#define THREADED_METHOD6_CONST(CLASSNAME, DOMULTI, METHOD, PARMTYPE1, PARMNAME1, PARMTYPE2, PARMNAME2, PARMTYPE3, PARMNAME3, PARMTYPE4, PARMNAME4, PARMTYPE5, PARMNAME5, PARMTYPE6, PARMNAME6)
const UT_Array< GU_PrimVolumeCacheLight > & getLights() const
void setIsAmbient(bool isamb)
const UT_Vector3 & getOrg() const
#define SYS_DEPRECATED_PUSH_DISABLE()
void setCd(const UT_Vector3 &cd)
const GEO_Primitive * myEmissionField
#define SYS_DEPRECATED_POP_DISABLE()
void getMaxResolution(int &w, int &h, int &d) const
void setDir(const UT_Vector3 &dir)
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
GLdouble GLdouble GLdouble z
Definition: glcorearb.h:847
void setLights(UT_Array< GU_PrimVolumeCacheLight > &lightlist)
void setShadowIntensity(float shadow)
GLboolean GLboolean GLboolean GLboolean a
Definition: glcorearb.h:1221
void setPreMultiply(bool premultiply)
void setOrg(const UT_Vector3 &org)
GU_PrimVolumeCacheRamp * myEmissionCdRamp
GLint y
Definition: glcorearb.h:102
GLuint sampler
Definition: glcorearb.h:1655
GU_PrimVolumeCacheRamp * myEmissionRamp
png_uint_32 i
Definition: png.h:2877
GU_ConstDetailHandle getIsoSurface() const
#define THREADED_METHOD3(CLASSNAME, DOMULTI, METHOD, PARMTYPE1, PARMNAME1, PARMTYPE2, PARMNAME2, PARMTYPE3, PARMNAME3)
UT_VoxelArrayReadHandleF myEmissionHandle
UT_VoxelArrayV4 * getShadedVoxels(bool *reduced=nullptr) const
long long int64
Definition: SYS_Types.h:100
UT_Vector4T< float > UT_Vector4
const UT_Vector3 & getCd() const
GU_PrimVolumeCacheRamp * myDensityRamp
#define THREADED_METHOD7_CONST(CLASSNAME, DOMULTI, METHOD, PARMTYPE1, PARMNAME1, PARMTYPE2, PARMNAME2, PARMTYPE3, PARMNAME3, PARMTYPE4, PARMNAME4, PARMTYPE5, PARMNAME5, PARMTYPE6, PARMNAME6, PARMTYPE7, PARMNAME7)
void setMaxResolution(int w, int h, int d)
#define GU_API
Definition: GU_API.h:11
#define SYS_DEPRECATED_HDK(__V__)
void setIsInfinite(bool isinf)
GLboolean GLboolean GLboolean b
Definition: glcorearb.h:1221
#define THREADED_METHOD2_CONST(CLASSNAME, DOMULTI, METHOD, PARMTYPE1, PARMNAME1, PARMTYPE2, PARMNAME2)
UT_Array< GU_PrimVolumeCacheLight > myLightList
GLfloat GLfloat GLfloat GLfloat h
Definition: glcorearb.h:2001
GLenum GLenum dst
Definition: glcorearb.h:1792
UT_Vector3 getIsoCd() const
typedef int
Definition: png.h:1175
Utility class for containing a color ramp.
Definition: UT_Ramp.h:84
const GEO_Primitive * myDensityField
bool operator==(const GU_PrimVolumeCacheLight &l) const
void setIsoPoints(bool iso_pts)
GLint GLenum GLint x
Definition: glcorearb.h:408
GLuint GLfloat * val
Definition: glcorearb.h:1607
const GEO_Primitive * densityField() const
void setCornerAttenuation(float a[8])
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:856
UT_VoxelArrayV4 * myVoxels
UT_VoxelArrayReadHandleV4 myDiffuseHandle
GU_PrimVolumeCacheRamp * myDiffuseRamp
#define const
Definition: zconf.h:214
void setCached(bool b) const
virtual ~GU_PrimVolumeCacheParms(void)
UT_Vector3I getRes() const
The cached resolution.
UT_VoxelArrayReadHandleF myDensityHandle
UT_VoxelArrayReadHandleV4 myEmissionCdHandle
GEO_PrimVolumeXform getSpaceTransform() const
int64 getMemoryUsage(bool inclusive) const
const UT_Vector3 & getDir() const
GLenum src
Definition: glcorearb.h:1792