RenderMan API  23.0
RixInterfaces.h
Go to the documentation of this file.
1 /*
2 # ------------------------------------------------------------------------------
3 #
4 # Copyright (c) 1986-2019 Pixar. All rights reserved.
5 #
6 # The information in this file (the "Software") is provided for the exclusive
7 # use of the software licensees of Pixar ("Licensees"). Licensees have the
8 # right to incorporate the Software into other products for use by other
9 # authorized software licensees of Pixar, without fee. Except as expressly
10 # permitted herein, the Software may not be disclosed to third parties, copied
11 # or duplicated in any form, in whole or in part, without the prior written
12 # permission of Pixar.
13 #
14 # The copyright notices in the Software and this entire statement, including the
15 # above license grant, this restriction and the following disclaimer, must be
16 # included in all copies of the Software, in whole or in part, and all permitted
17 # derivative works of the Software, unless such copies or derivative works are
18 # solely in the form of machine-executable object code generated by a source
19 # language processor.
20 #
21 # PIXAR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
22 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL PIXAR BE
23 # LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
24 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
25 # OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
26 # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. IN NO CASE WILL
27 # PIXAR'S TOTAL LIABILITY FOR ALL DAMAGES ARISING OUT OF OR IN CONNECTION WITH
28 # THE USE OR PERFORMANCE OF THIS SOFTWARE EXCEED $50.
29 #
30 # Pixar
31 # 1200 Park Ave
32 # Emeryville CA 94608
33 #
34 # ------------------------------------------------------------------------------
35 */
36 
37 
38 #ifndef RixInterfaces_h
39 #define RixInterfaces_h
40 
41 #include <cstddef> // for NULL, size_t
42 #include <utility> // for std::move
43 #include "RiTypesHelper.h" // for RtFloat3, RtUString, etc
44 
45 class RixLPEState;
46 class RixShadingContext;
48 
92 enum RixInterfaceId
94 {
95  // clang-format off
109  k_RixRiCtl = 20,
124  // clang-format on
125 };
126 
132 {
133 public:
134  // type of the results returned by
135  // - RixRenderState::GetAttribute
136  // - RixRenderState::GetOption
137  // - RixTexture::GetProperty
138  enum Type
139  {
150  };
153  virtual int GetVersion() const { return m_version; }
154 
155 protected:
158 
160  RixInterface(int version) : m_version(version) {}
161 
163  virtual ~RixInterface() {}
164 };
165 
171 {
172 public:
175  virtual RixInterface* GetRixInterface(RixInterfaceId id) const = 0;
176 
178  virtual ~RixContext() {}
179 };
180 
188 class RixXcpt : public RixInterface
189 {
190 public:
194  {
195  public:
196  virtual void HandleXcpt(int code, int severity, const char* msg) = 0;
197  virtual void HandleExitRequest(int code) = 0;
198 
199  protected:
200  virtual ~XcptHandler() {}
201  };
202 
206  virtual void Register(XcptHandler*) = 0;
207 
209  virtual void Unregister(XcptHandler*) = 0;
210 
213  virtual void SetBuiltinHandler(RtUString name) = 0;
214 
215 protected:
217 };
218 
219 
225 {
226 public:
228  virtual uint32_t XXHash32(void const* input, size_t size, unsigned seed)=0;
229 
231  virtual uint64_t XXHash64(void const* input, size_t size, unsigned seed)=0;
232 
233 protected:
236 };
237 
240 class RixMessages : public RixInterface
241 {
242 public:
247 
249  virtual void Error(const char* format, ...) = 0;
250 
252  virtual void ErrorAlways(const char* format, ...) = 0;
253 
255  virtual void Warning(const char* format, ...) = 0;
256 
258  virtual void WarningAlways(const char* format, ...) = 0;
259 
261  virtual void Info(const char* format, ...) = 0;
262 
264  virtual void InfoAlways(const char* format, ...) = 0;
265 
266 protected:
269 };
270 
287 class RixTexture : public RixInterface
288 {
289 public:
290  enum ErrType
291  {
292  Ok = 0,
299  InvalidFile
300  };
301 
303  {
304  public:
307  {
308  texture = 0,
315  };
316 
319  : version(2),
320  fileHandle(NULL),
321  nchannels(0),
322  channelTypes(NULL),
323  nparts(0),
324  width(0),
325  height(0),
326  pixelAspectRatio(0.0f),
327  type(texture)
328  {
329  }
330 
331  int version; // Version of this struct
332  void* fileHandle; // If NULL, the file could not be acquired
333  int nchannels; // The # of channels in the texture
334  unsigned char* channelTypes; // The types of the channels
335  // 0 - unknown
336  // 1 - 8 bit
337  // 2 - 16 bit
338  // 3 - 32 bit
339  // 4 - float
340  // 5 - half
341  int nparts; // The number of parts present
342  int width, height; // Width and height of texture
343  float pixelAspectRatio; // Pixel aspect ratio of texture
344  TextureType type; // What type of texture?
345  };
346 
348  {
349  AtlasNone=0,
352  AtlasUvTile0
353  };
354 
355  struct TxParams
356  {
357  public:
360  {
361  Nearest = 0, // *WARNING* disables MIPMAP! No filtering
362  Box, // Fast "box" like filter
363  Bilinear, // Slower, supports derivatives
364  Bspline, // Slower bicubic filter, supports derivatives
365  Mitchell, // Negative lobed, fast, bicubic filter - PTEX ONLY
366  Catmullrom, // Negative lobed, fast, bicubic filter - PTEX ONLY
367  Gaussian, // Gaussian fast filter
368  Lagrangian, // Fastest (SSE based) filter
369  BsplineAniso // Same as Bspline, but supports anisotropic filtering
370  };
371 
374  : version(1),
375  nchannels(1),
376  firstchannel(0),
377  lerp(true),
378  invertT(false),
379  filter(Box),
380  sblur(NULL),
381  tblur(NULL),
382  sblurVarying(true),
383  tblurVarying(true),
384  swidth(1.0f),
385  twidth(1.0f),
386  fill(0.f),
387  faceIndex(NULL)
388  {
389  }
390 
391  int version; // Version of this struct
392  int nchannels; // The number of channels to lookup
393  int firstchannel; // The channel to start the lookup
394  bool lerp; // Should MIP levels be interpolated
395  bool invertT; // Should the texture space origin be bottom left
396  // (false) or top left (true)
397  FilterType filter; // Which filter should be used
398  const float* sblur; // Amount of blur to apply to lookup
399  const float* tblur;
400  bool sblurVarying; // Is the blur uniform?
402  float swidth; // Multiplier for filter radius
403  float twidth;
404  float fill; // Value to fill missing channels
405  float* faceIndex; // A faceIndex to access ptexture
406  };
407 
421  virtual int AcquireTexture(
422  RtUString const fileName,
423  TxAtlasStyle const atlasStyle,
424  TxProperties& txProperties) = 0;
425 
429  virtual int AcquireTexturePart(
430  int partIndex,
431  TxProperties const& txProperties,
432  TxProperties& partProperties) = 0;
433 
436  virtual int ReleaseTexture(TxProperties const& txProperties) = 0;
437 
452  virtual int Texture(
453  TxProperties const& txProperties,
454  TxParams const& txParams,
455  int nPoints,
456  RtFloat2 const* st,
457  float const* stRadius,
458  float* result,
459  int* runFlags = NULL) = 0;
460  virtual int Texture(
461  TxProperties const& txProperties,
462  TxParams const& txParams,
463  int nPoints,
464  RtFloat3 const* st,
465  float const* stRadius,
466  float* result,
467  int* runFlags = NULL) = 0;
468 
488  virtual int TextureDerivatives(
489  TxProperties const& txProperties,
490  TxParams const& txParams,
491  int nPoints,
492  RtFloat2 const* st,
493  float const* dsdu,
494  float const* dtdu,
495  float const* dsdv,
496  float const* dtdv,
497  float const* dufp,
498  float const* dvfp,
499  float* result,
500  float* dresultds,
501  float* dresultdt,
502  int* runFlags = NULL) = 0;
503  virtual int TextureDerivatives(
504  TxProperties const& txProperties,
505  TxParams const& txParams,
506  int nPoints,
507  RtFloat3 const* st,
508  float const* dsdu,
509  float const* dtdu,
510  float const* dsdv,
511  float const* dtdv,
512  float const* dufp,
513  float const* dvfp,
514  float* result,
515  float* dresultds,
516  float* dresultdt,
517  int* runFlags = NULL) = 0;
518 
535  virtual int Ptexture(
536  TxProperties const& txProperties,
537  TxParams const& txParams,
538  int nPoints,
539  RtFloat2 const* uv,
540  float const* uWidth,
541  float const* vWidth,
542  float* result,
543  int* runFlags = NULL) = 0;
544 
567  virtual int PtextureDerivatives(
568  TxProperties const& txProperties,
569  TxParams const& txParams,
570  int nPoints,
571  RtFloat2 const* st,
572  float const* dsdu,
573  float const* dtdu,
574  float const* dsdv,
575  float const* dtdv,
576  float* result,
577  float* dresultds,
578  float* dresultdt,
579  int* runFlags = NULL) = 0;
580 
584  // NOTE: No filtering is applied to the data being read.
585  virtual int TextureData(
586  TxProperties const& txProperties,
587  TxParams const& txParams,
588  int mipLevel,
589  int cubeFace,
590  void* result) = 0;
591 
592  virtual int GetProperty(
593  TxProperties const& txProperties,
594  RtUString const propertyName,
595  void* result,
596  int resultLen,
597  Type* resultType,
598  int* resultCount
599  ) = 0;
600 
621  virtual const ErrType* GetLastError() = 0;
622 
623 protected:
626 };
627 
631 {
632 public:
633  virtual int RxTexture3dV(
634  char const* filename,
635  RtPoint3 point,
636  RtNormal3 normal,
637  float filterradius,
638  int n,
639  RtUString tokens[],
640  void* parms[]) = 0;
641 
642  // The RxTexture3d interface takes name/value pairs through the ellipses.
643  // It is important to note that names should be passed through as c-strings.
644  // These are converted to unique strings internally so something to
645  // note is that the vectorized API, RxTexture3dV, is likely to be more
646  // efficient and scalable for names and values that can be constructed up
647  // front.
648  virtual int RxTexture3d(
649  char const* filename,
650  RtPoint3 point,
651  RtNormal3 normal,
652  float filterradius,
653  ...) = 0;
654 
655 protected:
658 };
659 
664 {
665 public:
667  virtual float Noise(float in) = 0;
668  virtual float Noise(RtFloat2 const& in) = 0;
669  virtual float Noise(RtFloat3 const& in) = 0;
670  virtual float Noise(RtFloat3 const& in, float inF) = 0;
671 
672  virtual RtFloat3 Noise3(float in) = 0;
673  virtual RtFloat3 Noise3(RtFloat2 const& in) = 0;
674  virtual RtFloat3 Noise3(RtFloat3 const& in) = 0;
675  virtual RtFloat3 Noise3(RtFloat3 const& in, float inF) = 0;
676 
678  virtual float PNoise(float in, float period) = 0;
679  virtual float PNoise(RtFloat2 const& in, RtFloat2 const& period) = 0;
680  virtual float PNoise(RtFloat3 const& in, RtFloat3 const& period) = 0;
681  virtual float PNoise(
682  RtFloat3 const& in,
683  float inF,
684  RtFloat3 const& period,
685  float periodF) = 0;
686 
687  virtual RtFloat3 PNoise3(float in, float period) = 0;
688  virtual RtFloat3 PNoise3(RtFloat2 const& in, RtFloat2 const& period) = 0;
689  virtual RtFloat3 PNoise3(RtFloat3 const& in, RtFloat3 const& period) = 0;
690  virtual RtFloat3 PNoise3(
691  RtFloat3 const& in,
692  float inF,
693  RtFloat3 const& period,
694  float periodF) = 0;
695 
697  virtual float CellNoise(float in) = 0;
698  virtual float CellNoise(RtFloat2 const& in) = 0;
699  virtual float CellNoise(RtFloat3 const& in) = 0;
700  virtual float CellNoise(RtFloat3 const& in, float inF) = 0;
701 
702  virtual RtFloat3 CellNoise3(float in) = 0;
703  virtual RtFloat3 CellNoise3(RtFloat2 const& in) = 0;
704  virtual RtFloat3 CellNoise3(RtFloat3 const& in) = 0;
705  virtual RtFloat3 CellNoise3(RtFloat3 const& in, float inF) = 0;
706 
709  {
710  Bezier = 0,
714  Catmullrom
715  };
716 
717  virtual float SolveSpline(
718  SplineType type,
719  float const knot[],
720  int nKnots,
721  float a) = 0;
722  virtual float EvalSpline(
723  SplineType type,
724  float const knot[],
725  int nKnots,
726  float a) = 0;
727  virtual RtFloat3 EvalSpline3(
728  SplineType type,
729  RtFloat3 const knot[],
730  int nknot,
731  float a) = 0;
732 
733 protected:
736 };
737 
741 {
742 public:
747  virtual int TransformPoints(
748  RtUString const fromspace,
749  RtUString const tospace,
750  int n,
751  RtPoint3 p[],
752  float time) = 0;
753 
755  virtual void TransformPoints(RtMatrix4x4 const& m, int n, RtPoint3 p[]) = 0;
756 
761  virtual int TransformMatrix(
762  RtUString const fromspace,
763  RtUString const tospace,
764  float time,
765  RtMatrix4x4& m) = 0;
766 
767 protected:
770 };
771 
774 {
775 public:
777  {
778  const char* renderer;
779  const char* version;
780  int versionCode[4];
781  char _reserved[32];
782  };
784  virtual int GetRendererInfo(RendererInfo*) = 0;
785 
786  struct FrameInfo
787  {
788  FrameInfo() : _vers(2) {}
789 
791  {
793  k_finalPixels
794  };
795 
796  int frame;
797  int nthreads;
798  float shutter[2]; // when shutter values are equal, no motion-blur
800  struct
801  {
802  int nDisplays; // indexes for GetDspyInfo
803  int resolution[2];
805  } displayState;
806 
807  int _vers;
808 
809  // added in version 2
810  // integrator settings are only non-null in RIS mode
814 
815  char _reserved[32];
816  };
817 
820  virtual int GetFrameInfo(FrameInfo*) = 0;
821 
822  struct DspyInfo
823  {
827  char _reserved[32];
828  };
831  virtual int GetDspyInfo(int dspyId, DspyInfo*) = 0;
832 
834  {
835  k_siInvalid = 0,
839  k_siNumShadingIntents
840  };
841 
842  struct RayCtxInfo
843  {
844  int integratorIteration; // always 0 when in distribution integration
845  char _reserved[32];
846  };
847 
851  virtual int GetRayCtxInfo(RayCtxInfo*) = 0;
852 
868  virtual int GetOption(
869  RtUString const name,
870  void* result,
871  int resultLength,
872  Type* resultType,
873  int* resultCount) = 0;
874 
875  virtual int GetAttribute(
876  RtUString const name,
877  void* result,
878  int resultLength,
879  Type* resultType,
880  int* resultCount) = 0;
881 
893  virtual int GetRIBFileContext(int* linenumber, char** filename) = 0;
894 
895 
910  virtual int GetRIBArchive(RtUString const filename, const char** archive) = 0;
911 
912 protected:
914 };
915 
916 class [[deprecated]] RixSymbolResolver : public RixInterface
917 {
918 public:
928  virtual void ResolvePredefinedStrings(RiPredefinedStrings &ps) const = 0;
929 
931  {
932  k_PixelFilter = 0,
933  k_Basis = 1,
935  k_ErrorHandler = 3,
936  k_RiEntryPoint = 4
937  };
938  //
951  virtual void* ResolveSymbol(const char* nm, SymbolGroup group) = 0;
952 
953 protected:
955 };
956 
957 
959 {
960 public:
961  virtual void EmitVector(RtVector3 v, RtColorRGB c) = 0;
962  virtual void EmitPoint(RtPoint3 p, RtColorRGB c) = 0;
963  virtual void EmitPointNormal(RtPoint3 p, RtNormal3 n, RtColorRGB c) = 0;
964  virtual void EmitLine(RtPoint3 p1, RtPoint3 p2, RtColorRGB c) = 0;
965  virtual void EmitBound(RtPoint3 pmin, RtPoint3 pmax, RtColorRGB c) = 0;
966  virtual void Clear() = 0;
967  virtual void Flush() = 0;
968 
969 protected:
971 };
972 
973 typedef int RixLPEToken;
974 
977 class RixLPEInfo : public RixInterface
978 {
979 public:
984  virtual int GetLpeIdByName(
985  bool discrete,
986  bool specular,
987  bool reflect,
988  bool user,
989  unsigned char lobeId,
990  char const* name) const = 0;
991 
995  virtual int GetNumPotentialDiffuseLobes() const = 0;
996  virtual int GetNumPotentialSpecularLobes() const = 0;
997  virtual int GetNumPotentialUserLobes() const = 0;
998 
999 protected:
1001 };
1002 
1003 // This is a callback routine for use with the
1004 // RixCustomLPE::RegisterScatterCallback() and
1005 // RixCustomLPE::InvokeScatterCallbacks(), described in more detail below.
1006 typedef void (*RixLPECallback)(
1007  void* userData,
1008  RixLPEState* lpeState,
1009  RixShadingContext const* sCtx,
1010  int sCtxIndex,
1011  RtColorRGB const& thruput,
1012  RtColorRGB const* lightTrans,
1013  bool firstContribution);
1014 
1017 {
1018 public:
1019  // Use this method to return an integer identifier that corresponds to
1020  // a given Light Path Expression (LPE).
1021  virtual int LookupLPE(char const* lpeExpr) = 0;
1022 
1023  // Use this method to return an integer identifier that corresponds to
1024  // a given Light Path Expression (LPE) name.
1025  virtual int LookupLPEByName(char const* lpeName) = 0;
1026 
1027  // This method returns true if the 'customLpe' integer identifier
1028  // (which should be obtained by calling LookupLPE()) matches the current
1029  // ray hit, returning true or false along with the cumulative path
1030  // thruput corresponding to the custom LPE. This method should typically
1031  // be called from within a registered "transition" callback routine
1032  // (see RegisterScatterCallback() below).
1033  virtual bool MatchesLPE(
1034  int customLpe,
1035  RixLPEState* lpeState,
1036  RtColorRGB& thruput) = 0;
1037 
1038  // Use this method to register a "scatter" callback. Each scattering
1039  // event along the ray path counts as a "scatter" event (that is, each
1040  // ray-geometry intersection hit point that results in light being
1041  // scattered throughout the scene). Ater registering a scatter callback,
1042  // the callback routine will be invoked at each scattering event. Within
1043  // a scatter callback routine one might make a call to the MatchesLPE()
1044  // method in order to determine whether a particular custom LPE matches
1045  // the current ray path history.
1046  virtual void RegisterScatterCallback(
1047  RixLPECallback callbackFunc,
1048  void* userData = NULL) = 0;
1049 
1050  // Calling this method will invoke all registered scatter callback routines.
1051  // Typically this method is only called internally by the core rendering
1052  // code (and typically end-user code would not need to call this method
1053  // directly). Instead this routine is called indirectly via the RixLPE
1054  // interface whenever there is a scattering event.
1055  virtual void InvokeScatterCallbacks(
1056  RixLPEState* lpeState,
1057  RixShadingContext const* sCtx,
1058  int sCtxIndex,
1059  RtColorRGB const& thruput,
1060  RtColorRGB const* lightTrans,
1061  bool firstContribution) = 0;
1062 
1063 protected:
1065 };
1066 
1072 {
1073 public:
1079  virtual void WriteXml(const char* format, ...) = 0;
1080 
1083  virtual void WriteText(const char* format, ...) = 0;
1084 
1086  virtual ~RixXmlFile() {}
1087 
1088  // Helper functions for writings stats.
1089  void WriteStat(char const* name, char const* desc, int value)
1090  {
1091  WriteXml("<int name=\"%s\"", name);
1092  if (desc)
1093  WriteXml(" description=\"%s\"", desc);
1094  WriteXml("> %i </int>\n", value);
1095  }
1096 
1097  void WriteStat(char const* name, char const* desc, uint64_t value)
1098  {
1099  WriteXml("<int name=\"%s\"", name);
1100  if (desc)
1101  WriteXml(" description=\"%s\"", desc);
1102  WriteXml("> %llu </int>\n", value);
1103  }
1104 
1105  void WriteStat(char const* name, char const* desc, float value)
1106  {
1107  WriteXml("<float name=\"%s\"", name);
1108  if (desc)
1109  WriteXml(" description=\"%s\"", desc);
1110  WriteXml("> %f </float>\n", value);
1111  }
1112 
1113  void WriteStat(char const* name, char const* desc, char const* value)
1114  {
1115  WriteXml("<string name=\"%s\"", name);
1116  if (desc)
1117  WriteXml(" description=\"%s\"", desc);
1118  WriteXml("> %s </string>\n", value);
1119  }
1120 
1121  void WriteTime(char const* name, char const* desc, float time)
1122  {
1123  WriteXml("<timer name=\"%s\"", name);
1124  if (desc)
1125  WriteXml(" description=\"%s\"", desc);
1126  WriteXml("><elapsed>%f</elapsed></timer>\n", time);
1127  }
1128 };
1129 
1142 class RixTimer : public RixInterface
1143 {
1144 public:
1146  virtual uint64_t SampleTime() = 0;
1148  virtual float ConvertIntervalToSeconds(uint64_t interval) = 0;
1149 
1150 protected:
1152 };
1153 
1170 class RixStats : public RixInterface
1171 {
1172 public:
1179  virtual void AddTimerStat(
1180  float* seconds,
1181  const char* name,
1182  const char* description) = 0;
1183 
1192  {
1193  public:
1194  enum Fmt
1195  {
1200  k_fmtAsFloat
1201  };
1202  virtual ~SimpleStat() {}
1203  virtual void Reset() = 0;
1204  virtual const char* GetName() = 0;
1205  virtual const char* GetDescription() = 0;
1206  virtual void GetResults(uint64_t* result, Fmt* fmt) = 0;
1207  };
1208  virtual int AddSimpleStat(SimpleStat*) = 0;
1209 
1216  virtual void AddMemoryStat(
1217  size_t* bytes,
1218  const char* name,
1219  const char* description) = 0;
1220 
1223  typedef void (*Reporter)(class RixXmlFile* file);
1224  typedef void (*ReporterCtx)(void* ctx, class RixXmlFile*);
1225 
1243  virtual void AddReporter(Reporter func) = 0;
1244  virtual void AddReporterCtx(ReporterCtx func, void* ctx) = 0;
1245 
1251  virtual void AddFileLogStat(const char* fileName, const char* path) = 0;
1252 
1253 protected:
1256 };
1257 
1258 
1259 class [[deprecated]] RixResourceResolver : public RixInterface
1260 {
1261 public:
1263  {
1264  k_Shader = 0,
1270  k_RixPlugin
1271  };
1272 
1275  virtual char const* GetResourcePaths(ResourceType) = 0;
1276 
1288  virtual int ResolveResource(
1289  ResourceType,
1290  char const* nm,
1291  char result[],
1292  int maxlen) = 0;
1293 
1294 protected:
1296 };
1297 
1299 [[deprecated]] typedef void (*RixCleanupFunc)(RixContext* context, void* data);
1300 
1363 class [[deprecated]] RixStorage : public RixInterface
1364 {
1365 public:
1367  virtual void* Get(const RtUString key) = 0;
1368 
1372  virtual void Set(
1373  const RtUString key,
1374  void* data,
1375  RixCleanupFunc cleanup = NULL) = 0;
1376 
1379  virtual void Clear(const RtUString key) = 0;
1380 
1382  virtual void Lock() = 0;
1383 
1385  virtual void Unlock() = 0;
1386 
1387 protected:
1390 };
1391 
1397 template<typename _Signature>
1399 
1400 template <typename _Res, typename... _ArgTypes>
1401 class [[deprecated]] RixFunction<_Res(_ArgTypes...)>
1402 {
1404  struct FunctionPrototype
1405  {
1406  virtual ~FunctionPrototype() {}
1407  virtual _Res operator()(_ArgTypes... __args) const = 0;
1408  };
1409 
1411  template< typename Closure >
1412  struct Function : FunctionPrototype
1413  {
1414  Function(Closure&& t ) : fn(t) {}
1415  virtual ~Function() {}
1416  virtual _Res operator()(_ArgTypes... __args) const
1417  { return fn(__args...); }
1418  Closure fn;
1419  };
1420 
1421  FunctionPrototype* object;
1422 
1423 public:
1425  template< typename Closure >
1426  RixFunction(Closure&& obj )
1427  : object( new Function<Closure>( std::move(obj) ) )
1428  {}
1429 
1431  { delete object; }
1432 
1433  _Res operator()(_ArgTypes... __args) const
1434  {
1435  return (*object)(__args...);
1436  }
1437 };
1438 
1448 class [[deprecated]] RixMutex
1449 {
1450 public:
1452  virtual ~RixMutex() {}
1453 
1455  virtual void Lock() = 0;
1456 
1458  virtual void Unlock() = 0;
1459 };
1460 
1465 class [[deprecated]] RixThreadUtils : public RixInterface
1466 {
1467 public:
1469  virtual RixMutex* NewMutex() const = 0;
1470 
1472  virtual void DeleteMutex(RixMutex *mutex) const = 0;
1473 
1497  virtual void ParallelFor(size_t start, size_t end,
1498  const RixFunction<void(size_t)>& fn) const = 0;
1499  virtual void ParallelFor(size_t start, size_t end, size_t step,
1500  const RixFunction<void(size_t)>& fn) const = 0;
1501 
1502 protected:
1505 };
1506 
1507 
1508 
1509 #endif // RIX_INTERFACE_H
t_displayStyle displayStyle
pxrcore::ColorRGB RtColorRGB
Id for RixRenderState interface.
Custom proceudral geometry.
RixTexture3d()
constructor for internal use only
RixStorage()
Constructor is for internal use only.
An interface to lookup and match custom light path expressions (LPEs).
Id for per-thread RixStorage interface.
Definition: RixInterfaces.h:99
Id for RixThreadUtils interface.
Definition: RixInterfaces.h:96
Id for shader file query interface.
RixTexture()
constructor for internal use only
_Res operator()(_ArgTypes... __args) const
const float * tblur
void WriteStat(char const *name, char const *desc, int value)
Id for New Texture-2D interface.
Id for Shade functions interface.
Id for RixStats interface.
FilterType
Filter selection.
RtFloat3 RtPoint3
Definition: RiTypesHelper.h:69
Id for geometric debugger interface.
RixShadeFunctions()
constructor for internal use only
Id for Riinterface.
Id for RixDspy interface.
void(* RixLPECallback)(void *userData, RixLPEState *lpeState, RixShadingContext const *sCtx, int sCtxIndex, RtColorRGB const &thruput, RtColorRGB const *lightTrans, bool firstContribution)
virtual int GetVersion() const
Id for local RixStorage interface.
void WriteTime(char const *name, char const *desc, float time)
virtual ~RixXmlFile()
Virtual destructor.
Id for SymbolResolver interface.
Id for per session RixStorage interface.
Id for RixDeepTexture interface.
void(* RixCleanupFunc)(RixContext *context, void *data)
A cleanup function can be associated with data in RixStorage.
RtFloat3 RtNormal3
Definition: RiTypesHelper.h:72
SplineType
Spline solver and evaluator.
RixStats()
Constructor is for internal use only.
An interface for discovering the current state of the renderer.
void WriteStat(char const *name, char const *desc, float value)
void WriteStat(char const *name, char const *desc, uint64_t value)
RixMessages()
Constructor is for internal use only.
virtual ~RixInterface()
Interfaces should not be deleted by users.
Id for Transformation interface.
Id for RenderMan scene graph interface.
Id for RenderMan event callbacks interface.
Id for RixLPEInfo interface.
Id for global (per frame) RixStorage interface.
Definition: RixInterfaces.h:98
pxrcore::UString RtUString
Id for RixTimer interface.
RixHashUtils()
constructor for internal use only
Id for RIB Parser interface.
Id for RixHashUtils interface to UtHash.
virtual ~RixContext()
Destructor is for internal use only.
Id for RixRIB interface.
pxrcore::Matrix4x4 RtMatrix4x4
Definition: RiTypesHelper.h:73
TODO: implement a new Texture-3D interface.
pxrcore::Float3 RtFloat3
Definition: RiTypesHelper.h:68
Id for RixMessages interface.
Definition: RixInterfaces.h:97
const float * sblur
RixInterfaceId
Identifiers for Rix interfaces.
Definition: RixInterfaces.h:93
int m_version
Version number of this interface.
Id for ResourceResolver interface.
virtual ~RixMutex()
Virtual destructor.
class RixIntegratorEnvironment const * integratorEnv
TxProperties()
Create TxProperties with initial defaults.
RixThreadUtils()
Constructor is for internal use only.
RixInterface(int version)
Interfaces should not be constructed by users.
RixTransform()
constructor for internal use only
Id for interface to exception handling.
Id for RixCustomLPE interface.
RixFunction(Closure &&obj)
Template constructor for Lambda capture.
unsigned char * channelTypes
TxParams()
Create TxParams with initial defaults.
int RixLPEToken
void WriteStat(char const *name, char const *desc, char const *value)
RtFloat3 RtVector3
Definition: RiTypesHelper.h:71