1 //////////////////////////////////////////////////////////////////////
2 //
3 //                             Pixie
4 //
5 // Copyright � 1999 - 2003, Okan Arikan
6 //
7 // Contact: okan@cs.utexas.edu
8 //
9 //	This library is free software; you can redistribute it and/or
10 //	modify it under the terms of the GNU Lesser General Public
11 //	License as published by the Free Software Foundation; either
12 //	version 2.1 of the License, or (at your option) any later version.
13 //
14 //	This library is distributed in the hope that it will be useful,
15 //	but WITHOUT ANY WARRANTY; without even the implied warranty of
16 //	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 //	Lesser General Public License for more details.
18 //
19 //	You should have received a copy of the GNU Lesser General Public
20 //	License along with this library; if not, write to the Free Software
21 //	Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
22 //
23 ///////////////////////////////////////////////////////////////////////
24 ///////////////////////////////////////////////////////////////////////
25 //
26 //  File				:	rimain.h
27 //  Classes				:	-
28 //  Description			:	RenderMan Header
29 //
30 ////////////////////////////////////////////////////////////////////////
31 #ifndef PIXIE
32 #define PIXIE
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
38 #ifdef RENDERER
39 #if defined(_WINDOWS) || defined(WIN32)
40 #define	EXTERN(type)	extern __declspec(dllexport) type
41 #else
42 #define EXTERN(type)	extern type
43 #endif
44 #else
45 #if defined(_WINDOWS) || defined(WIN32)
46 #define	EXTERN(type)	extern __declspec(dllimport) type
47 #else
48 #define EXTERN(type)	extern type
49 #endif
50 #endif
51 
52 
53 ////////////////////////////////////////////////////////////////////////
54 //
55 //	Type definitions
56 //
57 ////////////////////////////////////////////////////////////////////////
58 typedef short		RtBoolean;
59 typedef int			RtInt;
60 typedef float		RtFloat;
61 typedef const char	*RtToken;
62 typedef	void		RtVoid;
63 typedef const char	*RtString;
64 typedef const void	*RtPointer;
65 typedef RtFloat		RtColor[3];
66 typedef RtFloat		RtPoint[3];
67 typedef RtFloat		RtMatrix[4][4];
68 typedef RtFloat		RtBasis[4][4];
69 typedef RtFloat		RtBound[6];
70 typedef RtPointer	RtObjectHandle;
71 typedef RtPointer	RtLightHandle;
72 typedef RtPointer	RtContextHandle;
73 typedef RtString	RtArchiveHandle;
74 typedef RtString	RtShaderHandle;
75 typedef RtFloat		(*RtFilterFunc)(RtFloat, RtFloat, RtFloat, RtFloat);
76 typedef RtFloat		(*RtStepFilterFunc)(RtFloat, RtFloat, RtFloat);
77 typedef RtVoid		(*RtErrorHandler)(RtInt code, RtInt severity,const char *msg);
78 typedef RtVoid		(*RtFunc)(const char *);
79 typedef RtVoid		(*RtArchiveCallback)(const char *,...);
80 
81 typedef void		*(*RtDisplayParameterFunction)(const char *,int,int);
82 typedef	void		*(*RtDisplayStartFunction)(const char *,int,int,int,const char *,RtDisplayParameterFunction);
83 typedef int			(*RtDisplayDataFunction)(void *,int,int,int,int,float *);
84 typedef int			(*RtDisplayRawDataFunction)(void *,int,int,int,int,void *);
85 typedef void		(*RtDisplayFinishFunction)(void *);
86 
87 
88 #define RI_FALSE    0
89 #define RI_TRUE     1
90 #define RI_INFINITY (RtFloat)1.0e38
91 #define RI_EPSILON  (RtFloat)1.0e-10
92 
93 #define RI_NULL		((RtToken)0)
94 
95 
96 ////////////////////////////////////////////////////////////////////////
97 //
98 //	Standard tokens
99 //
100 ////////////////////////////////////////////////////////////////////////
101 EXTERN(RtToken)	 RI_FRAMEBUFFER, RI_FILE;
102 EXTERN(RtToken)  RI_RGB, RI_RGBA, RI_RGBZ, RI_RGBAZ, RI_A, RI_Z, RI_AZ;
103 EXTERN(RtToken)  RI_PERSPECTIVE, RI_ORTHOGRAPHIC;
104 EXTERN(RtToken)  RI_HIDDEN, RI_PAINT;
105 EXTERN(RtToken)  RI_CONSTANT, RI_SMOOTH;
106 EXTERN(RtToken)  RI_FLATNESS, RI_FOV;
107 EXTERN(RtToken)  RI_AMBIENTLIGHT, RI_POINTLIGHT, RI_DISTANTLIGHT, RI_SPOTLIGHT;
108 EXTERN(RtToken)  RI_INTENSITY, RI_LIGHTCOLOR, RI_FROM, RI_TO, RI_CONEANGLE, RI_CONEDELTAANGLE, RI_BEAMDISTRIBUTION;
109 EXTERN(RtToken)  RI_MATTE, RI_METAL, RI_SHINYMETAL, RI_PLASTIC, RI_PAINTEDPLASTIC;
110 EXTERN(RtToken)  RI_KA, RI_KD, RI_KS, RI_ROUGHNESS, RI_KR, RI_TEXTURENAME, RI_SPECULARCOLOR;
111 EXTERN(RtToken)  RI_DEPTHCUE, RI_FOG, RI_BUMPY;
112 EXTERN(RtToken)  RI_MINDISTANCE, RI_BACKGROUND, RI_DISTANCE, RI_AMPLITUDE;
113 EXTERN(RtToken)  RI_RASTER, RI_SCREEN, RI_CAMERA, RI_WORLD, RI_OBJECT;
114 EXTERN(RtToken)  RI_INSIDE, RI_OUTSIDE, RI_LH, RI_RH;
115 EXTERN(RtToken)  RI_P, RI_PZ, RI_PW, RI_N, RI_NP, RI_CS, RI_OS, RI_S, RI_T, RI_ST;
116 EXTERN(RtToken)  RI_BILINEAR, RI_BICUBIC;
117 EXTERN(RtToken)  RI_PRIMITIVE, RI_INTERSECTION, RI_UNION, RI_DIFFERENCE;
118 EXTERN(RtToken)  RI_PERIODIC, RI_NOWRAP, RI_NONPERIODIC, RI_CLAMP, RI_BLACK;
119 EXTERN(RtToken)  RI_IGNORE, RI_PRINT, RI_ABORT, RI_HANDLER;
120 EXTERN(RtToken)  RI_ORIGIN, RI_IDENTIFIER, RI_NAME;
121 EXTERN(RtToken)  RI_COMMENT, RI_STRUCTURE, RI_VERBATIM;
122 EXTERN(RtToken)  RI_LINEAR, RI_CUBIC, RI_WIDTH, RI_CONSTANTWIDTH;
123 EXTERN(RtToken)	 RI_CATMULLCLARK,RI_HOLE,RI_CREASE,RI_CORNER,RI_INTERPOLATEBOUNDARY;
124 EXTERN(RtToken)  RI_CURRENT, RI_WORLD, RI_OBJECT, RI_SHADER;
125 EXTERN(RtToken)  RI_RASTER, RI_NDC, RI_SCREEN, RI_CAMERA, RI_EYE;
126 
127 
128 ////////////////////////////////////////////////////////////////////////
129 //
130 //	Recognized filter types
131 //
132 ////////////////////////////////////////////////////////////////////////
133 EXTERN(RtToken)	RI_BOXFILTER;
134 EXTERN(RtToken)	RI_TRIANGLEFILTER;
135 EXTERN(RtToken)	RI_GAUSSIANFILTER;
136 EXTERN(RtToken)	RI_SINCFILTER;
137 EXTERN(RtToken)	RI_CATMULLROMFILTER;
138 EXTERN(RtToken)	RI_BLACKMANHARRISFILTER;
139 EXTERN(RtToken)	RI_MITCHELLFILTER;
140 EXTERN(RtToken)	RI_BESSELFILTER;
141 EXTERN(RtToken)	RI_DISKFILTER;
142 EXTERN(RtToken)	RI_CUSTOM;
143 
144 EXTERN(RtToken)	RI_MIN;
145 EXTERN(RtToken)	RI_MAX;
146 EXTERN(RtToken)	RI_AVERAGE;
147 EXTERN(RtToken)	RI_ZMIN;
148 EXTERN(RtToken)	RI_ZMAX;
149 
150 
151 
152 
153 ////////////////////////////////////////////////////////////////////////
154 //
155 //	Non-Standard options/attributes entry points
156 //
157 ////////////////////////////////////////////////////////////////////////
158 EXTERN(RtToken)		RI_LIMITS;
159 EXTERN(RtToken)		RI_SEARCHPATH;
160 EXTERN(RtToken)		RI_SHADOW;
161 EXTERN(RtToken)		RI_RENDER;
162 EXTERN(RtToken)		RI_DICE;
163 EXTERN(RtToken)		RI_HINT;
164 EXTERN(RtToken)		RI_TEXTURE;
165 EXTERN(RtToken)		RI_HIDER;
166 EXTERN(RtToken)		RI_STATISTICS;
167 EXTERN(RtToken)		RI_VISIBILITY;
168 EXTERN(RtToken)		RI_SHADE;
169 EXTERN(RtToken)		RI_DISPLACEMENTBOUND;
170 EXTERN(RtToken)		RI_IRRADIANCE;
171 EXTERN(RtToken)		RI_CULL;
172 EXTERN(RtToken)		RI_COMPRESSION;
173 EXTERN(RtToken)		RI_RIB;
174 EXTERN(RtToken)		RI_SHUTTER;
175 EXTERN(RtToken)		RI_USER;
176 
177 ////////////////////////////////////////////////////////////////////////
178 //
179 //	Non-Standard attributes
180 //
181 ////////////////////////////////////////////////////////////////////////
182 
183 // The geometric approximation types
184 EXTERN(RtToken)		RI_NORMALDEVIATION;
185 EXTERN(RtToken)		RI_POINTDEVIATION;
186 
187 // Dice attributes
188 EXTERN(RtToken)		RI_MINSUBDIVISION;
189 EXTERN(RtToken)		RI_MAXSUBDIVISION;
190 EXTERN(RtToken)		RI_NUMPROBES;
191 EXTERN(RtToken)		RI_MINSPLITS;
192 EXTERN(RtToken)		RI_BOUNDEXPAND;
193 EXTERN(RtToken)		RI_BINARY;
194 EXTERN(RtToken)		RI_RASTERORIENT;
195 
196 // Displacementbound attributes
197 EXTERN(RtToken)		RI_SPHERE;
198 EXTERN(RtToken)		RI_COORDINATESYSYTEM;
199 
200 // Visibility attributes
201 EXTERN(RtToken)		RI_PHOTON;
202 EXTERN(RtToken)		RI_SHADOW;
203 EXTERN(RtToken)		RI_ENVIRONMENT;
204 EXTERN(RtToken)		RI_DIFFUSE;
205 EXTERN(RtToken)		RI_SPECULAR;
206 EXTERN(RtToken)		RI_TRACE;
207 EXTERN(RtToken)		RI_TRANSMISSION;
208 EXTERN(RtToken)		RI_CAUSTICS;
209 
210 // Shade attributes
211 EXTERN(RtToken)		RI_DIFFUSEHITMODE;
212 EXTERN(RtToken)		RI_SPECULARHITMODE;
213 EXTERN(RtToken)		RI_TRANSMISSIONHITMODE;
214 EXTERN(RtToken)		RI_CAMERAHITMODE;
215 
216 // Photon map attributes
217 EXTERN(RtToken)		RI_GLOBALMAP;
218 EXTERN(RtToken)		RI_CAUSTICMAP;
219 EXTERN(RtToken)		RI_ESTIMATOR;
220 EXTERN(RtToken)		RI_MAXDISTANCE;
221 EXTERN(RtToken)		RI_SHADINGMODEL;
222 EXTERN(RtToken)		RI_ILLUMINATEFRONT;
223 EXTERN(RtToken)		RI_IOR;
224 EXTERN(RtToken)		RI_IORRANGE;
225 
226 // Trace attributes
227 EXTERN(RtToken)		RI_BIAS;
228 EXTERN(RtToken)		RI_DISPLACEMENTS;
229 EXTERN(RtToken)		RI_MAXDIFFUSEDEPTH;
230 EXTERN(RtToken)		RI_MAXSPECULARDEPTH;
231 EXTERN(RtToken)		RI_SAMPLEMOTION;
232 
233 // Motionfactor attribute
234 EXTERN(RtToken)		RI_MOTIONFACTOR;
235 
236 // Cull attributes
237 //EXTERN(RtToken)	RI_HIDDEN;
238 EXTERN(RtToken)		RI_BACKFACING;
239 
240 ////////////////////////////////////////////////////////////////////////
241 //
242 //	Non-Standard options
243 //
244 ////////////////////////////////////////////////////////////////////////
245 
246 // Searchpath options
247 EXTERN(RtToken)		RI_ARCHIVE;
248 EXTERN(RtToken)		RI_PROCEDURAL;
249 EXTERN(RtToken)		RI_RESOURCE;
250 EXTERN(RtToken)		RI_DISPLAY;
251 
252 // Limits options
253 EXTERN(RtToken)		RI_BUCKETSIZE;
254 EXTERN(RtToken)		RI_METABUCKETS;
255 EXTERN(RtToken)		RI_GRIDSIZE;
256 EXTERN(RtToken)		RI_MAXRECURSION;
257 EXTERN(RtToken)		RI_TEXTUREMEMORY;
258 EXTERN(RtToken)		RI_BRICKMEMORY;
259 EXTERN(RtToken)		RI_EYESPLITS;
260 EXTERN(RtToken)		RI_NUMTHREADS;
261 EXTERN(RtToken)		RI_THREADSTRIDE;
262 EXTERN(RtToken)		RI_GEOCACHEMEMORY;
263 EXTERN(RtToken)		RI_OTHRESHOLD;
264 EXTERN(RtToken)		RI_ZTHRESHOLD;
265 
266 // Trace options
267 EXTERN(RtToken)		RI_MAXDEPTH;
268 
269 // Statistics options
270 EXTERN(RtToken)		RI_ENDOFFRAME;
271 EXTERN(RtToken)		RI_FILELOG;
272 EXTERN(RtToken)		RI_PROGRESS;
273 
274 // Irradiance options
275 EXTERN(RtToken)		RI_HANDLE;
276 EXTERN(RtToken)		RI_FILEMODE;
277 EXTERN(RtToken)		RI_MAXERROR;
278 EXTERN(RtToken)		RI_MAXPIXELDIST;
279 EXTERN(RtToken)		RI_MINSAMPLEDISTANCE;
280 EXTERN(RtToken)		RI_MAXSAMPLEDISTANCE;
281 
282 // Hider options
283 EXTERN(RtToken)		RI_JITTER;
284 EXTERN(RtToken)		RI_FALSECOLOR;
285 EXTERN(RtToken)		RI_EMIT;
286 EXTERN(RtToken)		RI_SAMPLESPECTRUM;
287 EXTERN(RtToken)		RI_DEPTHFILTER;
288 EXTERN(RtToken)		RI_RADIANCECACHE;
289 
290 // IO options
291 EXTERN(RtToken)		RI_MASKRESOLUTION;
292 EXTERN(RtToken)		RI_MASKPRINTF;
293 EXTERN(RtToken)		RI_MASKLOG;
294 EXTERN(RtToken)		RI_MASKPROGRESS;
295 EXTERN(RtToken)		RI_MASKSTATS;
296 EXTERN(RtToken)		RI_INHERITATTRIBUTES;
297 
298 // Shutter options
299 EXTERN(RtToken)		RI_OFFSET;
300 
301 // Misc junk
302 EXTERN(RtToken)		RI_DEFAULTSURFACE;
303 
304 EXTERN(RtInt)		RiLastError;
305 
306 EXTERN(RtBasis)		RiBezierBasis, RiBSplineBasis, RiCatmullRomBasis, RiHermiteBasis, RiPowerBasis, RiLinearBasis;
307 
308 #define RI_BEZIERSTEP       ((RtInt)3)
309 #define RI_BSPLINESTEP      ((RtInt)1)
310 #define RI_CATMULLROMSTEP   ((RtInt)1)
311 #define RI_HERMITESTEP      ((RtInt)2)
312 #define RI_POWERSTEP        ((RtInt)4)
313 
314 
315 ////////////////////////////////////////////////////////////////////////
316 //
317 //	Delarations of All of the RenderMan Interface Subroutines
318 //
319 ////////////////////////////////////////////////////////////////////////
320 
321 EXTERN(RtToken)
322     RiDeclare (const char *name,const char *declaration);
323 
324 EXTERN(RtContextHandle)
325 	RiGetContext(void);
326 
327 EXTERN(RtVoid)
328 	RiContext(RtContextHandle);
329 
330 EXTERN(RtVoid)
331     RiBegin (RtToken name), RiEnd (void),
332     RiFrameBegin (RtInt number), RiFrameEnd (void),
333     RiWorldBegin (void), RiWorldEnd (void);
334 
335 EXTERN(RtVoid)
336     RiFormat (RtInt xres, RtInt yres, RtFloat aspect),
337     RiFrameAspectRatio (RtFloat aspect),
338     RiScreenWindow (RtFloat left, RtFloat right, RtFloat bot, RtFloat top),
339     RiCropWindow (RtFloat xmin, RtFloat xmax, RtFloat ymin, RtFloat ymax),
340     RiProjection (const char *name, ...),
341     RiProjectionV (const char *name, RtInt n, RtToken tokens[], RtPointer params[]),
342     RiClipping (RtFloat hither, RtFloat yon),
343 	RiClippingPlane(RtFloat x,RtFloat y,RtFloat z,RtFloat nx,RtFloat ny,RtFloat nz),
344     RiDepthOfField (RtFloat fstop, RtFloat focallength, RtFloat focaldistance),
345     RiShutter (RtFloat smin, RtFloat smax);
346 
347 EXTERN(RtVoid)
348     RiPixelVariance (RtFloat variation),
349     RiPixelSamples (RtFloat xsamples, RtFloat ysamples),
350     RiPixelFilter (RtFilterFunc function, RtFloat xwidth, RtFloat ywidth),
351     RiExposure (RtFloat gain, RtFloat gamma),
352     RiImager (const char *name, ...),
353     RiImagerV (const char *name, RtInt n, RtToken tokens[], RtPointer params[]),
354     RiQuantize (RtToken type, RtInt one, RtInt qmin, RtInt qmax, RtFloat ampl),
355     RiDisplay (const char *name, RtToken type, RtToken mode, ...),
356     RiDisplayV (const char *name, RtToken type, RtToken mode, RtInt n, RtToken tokens[], RtPointer params[]),
357 	RiCustomDisplay (const char *name, RtToken mode, RtDisplayStartFunction, RtDisplayDataFunction, RtDisplayFinishFunction, ...),
358     RiCustomDisplayV (const char *name, RtToken mode, RtDisplayStartFunction, RtDisplayDataFunction, RtDisplayFinishFunction, RtInt n, RtToken tokens[], RtPointer params[]),
359 	RiDisplayChannel (RtToken channel, ...),
360     RiDisplayChannelV (RtToken channel,RtInt n, RtToken tokens[], RtPointer params[]);
361 
362 EXTERN(RtFloat)
363     RiGaussianFilter (RtFloat x, RtFloat y, RtFloat xwidth, RtFloat ywidth),
364     RiBoxFilter (RtFloat x, RtFloat y, RtFloat xwidth, RtFloat ywidth),
365     RiTriangleFilter (RtFloat x, RtFloat y, RtFloat xwidth, RtFloat ywidth),
366 	RiMitchellFilter( RtFloat x, RtFloat y, RtFloat xwidth, RtFloat ywidth),
367     RiCatmullRomFilter (RtFloat x, RtFloat y, RtFloat xwidth, RtFloat ywidth),
368     RiBlackmanHarrisFilter (RtFloat x, RtFloat y, RtFloat xwidth, RtFloat ywidth),
369     RiSincFilter (RtFloat x, RtFloat y, RtFloat xwidth, RtFloat ywidth),
370     RiBesselFilter (RtFloat x, RtFloat y, RtFloat xwidth, RtFloat ywidth),
371     RiDiskFilter (RtFloat x, RtFloat y, RtFloat xwidth, RtFloat ywidth);
372 
373 EXTERN(RtFloat)
374     RiGaussianStepFilter (RtFloat t, RtFloat edge, RtFloat width),
375     RiBoxStepFilter (RtFloat t, RtFloat edge, RtFloat width),
376     RiTriangleStepFilter (RtFloat t, RtFloat edge, RtFloat width),
377 	RiMitchellStepFilter (RtFloat t, RtFloat edge, RtFloat width),
378     RiCatmullRomStepFilter (RtFloat t, RtFloat edge, RtFloat width);
379 
380 EXTERN(RtVoid)
381     RiHider (RtToken type, ...),
382     RiHiderV (RtToken type, RtInt n, RtToken tokens[], RtPointer params[]),
383     RiColorSamples (RtInt N, RtFloat *nRGB, RtFloat *RGBn),
384     RiRelativeDetail (RtFloat relativedetail),
385     RiOption (const char *name, ...),
386     RiOptionV (const char *name, RtInt n, RtToken tokens[], RtPointer params[]);
387 
388 EXTERN(RtVoid)
389     RiAttributeBegin (void), RiAttributeEnd (void),
390     RiColor (RtColor Cs), RiOpacity (RtColor Cs),
391     RiTextureCoordinates (RtFloat s1, RtFloat t1, RtFloat s2, RtFloat t2, RtFloat s3, RtFloat t3, RtFloat s4, RtFloat t4);
392 
393 EXTERN(RtLightHandle)
394     RiLightSource (const char *name, ...),
395     RiLightSourceV (const char *name, RtInt n, RtToken tokens[], RtPointer params[]),
396     RiAreaLightSource (const char *name, ...),
397     RiAreaLightSourceV (const char *name, RtInt n, RtToken tokens[], RtPointer params[]);
398 
399 EXTERN(RtVoid)
400     RiIlluminate (RtLightHandle light, RtBoolean onoff),
401     RiSurface (const char *name, ...),
402     RiSurfaceV (const char *name, RtInt n, RtToken tokens[], RtPointer params[]),
403     RiAtmosphere (const char *name, ...),
404     RiAtmosphereV (const char *name, RtInt n, RtToken tokens[], RtPointer params[]),
405     RiInterior (const char *name, ...),
406     RiInteriorV (const char *name, RtInt n, RtToken tokens[], RtPointer params[]),
407     RiExterior (const char *name, ...),
408     RiExteriorV (const char *name, RtInt n, RtToken tokens[], RtPointer params[]),
409     RiShadingRate (RtFloat size),
410     RiShadingInterpolation (RtToken type),
411     RiMatte (RtBoolean onoff);
412 
413 EXTERN(RtVoid)
414     RiBound (RtBound bound), RiDetail (RtBound bound),
415     RiDetailRange (RtFloat minvis, RtFloat lowtran, RtFloat uptran, RtFloat maxvis),
416     RiGeometricApproximation (RtToken type, RtFloat value),
417     RiGeometricRepresentation (RtToken type),
418     RiOrientation (RtToken orientation), RiReverseOrientation (void),
419     RiSides (RtInt nsides);
420 
421 EXTERN(RtVoid)
422     RiIdentity (void),
423     RiTransform (RtMatrix transform), RiConcatTransform (RtMatrix transform),
424     RiPerspective (RtFloat fov),
425     RiTranslate (RtFloat dx, RtFloat dy, RtFloat dz),
426     RiRotate (RtFloat angle, RtFloat dx, RtFloat dy, RtFloat dz),
427     RiScale (RtFloat dx, RtFloat dy, RtFloat dz),
428     RiSkew (RtFloat angle, RtFloat dx1, RtFloat dy1, RtFloat dz1, RtFloat dx2, RtFloat dy2, RtFloat dz2),
429     RiDeformation (const char *name, ...),
430     RiDeformationV (const char *name, RtInt n, RtToken tokens[], RtPointer params[]),
431     RiDisplacement (const char *name, ...),
432     RiDisplacementV (const char *name, RtInt n, RtToken tokens[], RtPointer params[]),
433     RiCoordinateSystem (RtToken space),
434     RiCoordSysTransform (RtToken space);
435 
436 EXTERN(RtPoint *)
437 	RiTransformPoints (RtToken fromspace, RtToken tospace, RtInt npoints, RtPoint *points);
438 
439 EXTERN(RtVoid)
440 	RiTransformBegin (void),
441 	RiTransformEnd (void);
442 
443 EXTERN(RtVoid)
444     RiAttribute (const char *name, ...),
445     RiAttributeV (const char *name, RtInt n, RtToken tokens[], RtPointer params[]);
446 
447 EXTERN(RtVoid)
448     RiPolygon (RtInt nvertices, ...),
449     RiPolygonV (RtInt nvertices, RtInt n, RtToken tokens[], RtPointer params[]),
450     RiGeneralPolygon (RtInt nloops, RtInt *nverts, ...),
451     RiGeneralPolygonV (RtInt nloops, RtInt *nverts, RtInt n, RtToken tokens[], RtPointer params[]),
452     RiPointsPolygons (RtInt npolys, RtInt *nverts, RtInt *verts, ...),
453     RiPointsPolygonsV (RtInt npolys, RtInt *nverts, RtInt *verts, RtInt n, RtToken tokens[], RtPointer params[]),
454     RiPointsGeneralPolygons (RtInt npolys, RtInt *nloops, RtInt *nverts, RtInt *verts, ...),
455     RiPointsGeneralPolygonsV (RtInt npolys, RtInt *nloops, RtInt *nverts, RtInt *verts, RtInt n, RtToken tokens[], RtPointer params[]),
456     RiBasis (RtBasis ubasis, RtInt ustep, RtBasis vbasis, RtInt vstep),
457     RiPatch (RtToken type, ...),
458     RiPatchV (RtToken type, RtInt n, RtToken tokens[], RtPointer params[]),
459     RiPatchMesh (RtToken type, RtInt nu, RtToken uwrap, RtInt nv, RtToken vwrap, ...),
460     RiPatchMeshV (RtToken type, RtInt nu, RtToken uwrap, RtInt nv, RtToken vwrap, RtInt n, RtToken tokens[], RtPointer params[]),
461     RiNuPatch (RtInt nu, RtInt uorder, RtFloat *uknot, RtFloat umin, RtFloat umax, RtInt nv, RtInt vorder, RtFloat *vknot, RtFloat vmin, RtFloat vmax, ...),
462     RiNuPatchV (RtInt nu, RtInt uorder, RtFloat *uknot, RtFloat umin, RtFloat umax, RtInt nv, RtInt vorder, RtFloat *vknot, RtFloat vmin, RtFloat vmax, RtInt n, RtToken tokens[], RtPointer params[]),
463     RiTrimCurve (RtInt nloops, RtInt *ncurves, RtInt *order, RtFloat *knot, RtFloat *amin, RtFloat *amax, RtInt *n, RtFloat *u, RtFloat *v, RtFloat *w);
464 
465 EXTERN(RtVoid)
466     RiSphere (RtFloat radius, RtFloat zmin, RtFloat zmax, RtFloat thetamax, ...),
467     RiSphereV (RtFloat radius, RtFloat zmin, RtFloat zmax, RtFloat thetamax, RtInt n, RtToken tokens[], RtPointer params[]),
468     RiCone (RtFloat height, RtFloat radius, RtFloat thetamax, ...),
469     RiConeV (RtFloat height, RtFloat radius, RtFloat thetamax, RtInt n, RtToken tokens[], RtPointer params[]),
470     RiCylinder (RtFloat radius, RtFloat zmin, RtFloat zmax, RtFloat thetamax, ...),
471     RiCylinderV (RtFloat radius, RtFloat zmin, RtFloat zmax, RtFloat thetamax, RtInt n, RtToken tokens[], RtPointer params[]),
472     RiHyperboloid (RtPoint point1, RtPoint point2, RtFloat thetamax, ...),
473     RiHyperboloidV (RtPoint point1, RtPoint point2, RtFloat thetamax, RtInt n, RtToken tokens[], RtPointer params[]),
474     RiParaboloid (RtFloat rmax, RtFloat zmin, RtFloat zmax, RtFloat thetamax, ...),
475     RiParaboloidV (RtFloat rmax, RtFloat zmin, RtFloat zmax, RtFloat thetamax, RtInt n, RtToken tokens[], RtPointer params[]),
476     RiDisk (RtFloat height, RtFloat radius, RtFloat thetamax, ...),
477     RiDiskV (RtFloat height, RtFloat radius, RtFloat thetamax, RtInt n, RtToken tokens[], RtPointer params[]),
478     RiTorus (RtFloat majorrad, RtFloat minorrad, RtFloat phimin, RtFloat phimax, RtFloat thetamax, ...),
479     RiTorusV (RtFloat majorrad, RtFloat minorrad, RtFloat phimin, RtFloat phimax, RtFloat thetamax, RtInt n, RtToken tokens[], RtPointer params[]),
480     RiCurves (RtToken degree, RtInt ncurves, RtInt nverts[], RtToken wrap, ...),
481     RiCurvesV (RtToken degree, RtInt ncurves, RtInt nverts[], RtToken wrap, RtInt n, RtToken tokens[], RtPointer params[]),
482     RiProcedural (void *data, RtBound bound, RtVoid (*subdivfunc) (void *, RtFloat), RtVoid (*freefunc) (void *)),
483     RiGeometry (RtToken type, ...),
484     RiGeometryV (RtToken type, RtInt n, RtToken tokens[], RtPointer params[]);
485 
486 EXTERN(RtVoid)
487     RiCurves (RtToken degree, RtInt ncurves, RtInt nverts[], RtToken wrap, ...),
488     RiCurvesV (RtToken degree, RtInt ncurves, RtInt nverts[], RtToken wrap, RtInt n, RtToken tokens[], RtPointer params[]),
489     RiPoints (RtInt npts,...),
490     RiPointsV (RtInt npts, RtInt n, RtToken tokens[], RtPointer params[]),
491     RiSubdivisionMesh (RtToken scheme, RtInt nfaces, RtInt nvertices[], RtInt vertices[], RtInt ntags, RtToken tags[], RtInt nargs[], RtInt intargs[], RtFloat floatargs[], ...),
492     RiSubdivisionMeshV (RtToken scheme, RtInt nfaces, RtInt nvertices[], RtInt vertices[], RtInt ntags, RtToken tags[], RtInt nargs[], RtInt intargs[], RtFloat floatargs[], RtInt n, RtToken tokens[], RtPointer params[]),
493     RiBlobby (RtInt nleaf, RtInt ncode, RtInt code[], RtInt nflt, RtFloat flt[], RtInt nstr, RtString str[], ...),
494     RiBlobbyV (RtInt nleaf, RtInt ncode, RtInt code[], RtInt nflt, RtFloat flt[], RtInt nstr, RtString str[], RtInt n, RtToken tokens[], RtPointer params[]);
495 
496 EXTERN(RtVoid)
497 	RiProcDelayedReadArchive (void *data, RtFloat detail),
498     RiProcRunProgram (void *data, RtFloat detail),
499     RiProcDynamicLoad (void *data, RtFloat detail),
500 	RiProcFree(void *);
501 
502 EXTERN(RtVoid)
503 	RiSolidBegin(RtToken type),
504 	RiSolidEnd(void);
505 
506 EXTERN(RtObjectHandle)
507 	RiObjectBegin (void);
508 
509 EXTERN(RtVoid)
510     RiObjectEnd (void),
511     RiObjectInstance (RtObjectHandle handle),
512     RiMotionBegin (RtInt N, ...),
513     RiMotionBeginV (RtInt N, RtFloat times[]),
514     RiMotionEnd (void);
515 
516 EXTERN(RtVoid)
517     RiMakeTexture (const char *pic, const char *tex, RtToken swrap, RtToken twrap, RtFilterFunc filterfunc, RtFloat swidth, RtFloat twidth, ...),
518     RiMakeTextureV (const char *pic, const char *tex, RtToken swrap, RtToken twrap, RtFilterFunc filterfunc, RtFloat swidth, RtFloat twidth, RtInt n, RtToken tokens[], RtPointer params[]),
519     RiMakeBump (const char *pic, const char *tex, RtToken swrap, RtToken twrap, RtFilterFunc filterfunc, RtFloat swidth, RtFloat twidth, ...),
520     RiMakeBumpV (const char *pic, const char *tex, RtToken swrap, RtToken twrap, RtFilterFunc filterfunc, RtFloat swidth, RtFloat twidth, RtInt n, RtToken tokens[], RtPointer params[]),
521     RiMakeLatLongEnvironment (const char *pic, const char *tex, RtFilterFunc filterfunc, RtFloat swidth, RtFloat twidth, ...),
522     RiMakeLatLongEnvironmentV (const char *pic, const char *tex, RtFilterFunc filterfunc, RtFloat swidth, RtFloat twidth, RtInt n, RtToken tokens[], RtPointer params[]),
523     RiMakeCubeFaceEnvironment (const char *px, const char *nx, const char *py, const char *ny, const char *pz, const char *nz, const char *tex, RtFloat fov, RtFilterFunc filterfunc, RtFloat swidth, RtFloat twidth, ...),
524     RiMakeCubeFaceEnvironmentV (const char *px, const char *nx, const char *py, const char *ny, const char *pz, const char *nz, const char *tex, RtFloat fov, RtFilterFunc filterfunc, RtFloat swidth, RtFloat twidth, RtInt n, RtToken tokens[], RtPointer params[]),
525     RiMakeShadow (const char *pic, const char *tex, ...),
526     RiMakeShadowV (const char *pic, const char *tex, RtInt n, RtToken tokens[], RtPointer params[]),
527 	RiMakeBrickMap (int n,const char **src, const char *dest, ...),
528 	RiMakeBrickMapV(int n,const char **src, const char *dest,RtInt numTokens, RtToken tokens[], RtPointer params[]);
529 
530 EXTERN(RtVoid)
531     RiErrorHandler (RtErrorHandler handler),
532     RiErrorIgnore (RtInt code, RtInt severity, const char *message),
533     RiErrorPrint (RtInt code, RtInt severity, const char *message),
534     RiErrorAbort (RtInt code, RtInt severity, const char *message);
535 
536 EXTERN(RtVoid)
537 	RiResource(RtToken handle, RtToken type, ...),
538 	RiResourceV(RtToken handle, RtToken type,RtInt n, RtToken tokens[], RtPointer parms[]),
539 	RiResourceBegin(void),
540 	RiResourceEnd(void);
541 
542 EXTERN(RtArchiveHandle)
543 	RiArchiveBegin(RtToken name, ...),
544 	RiArchiveBeginV(RtToken name, RtInt n, RtToken tokens[], RtPointer parms[]);
545 
546 EXTERN(RtVoid)
547 	RiArchiveEnd(void);
548 
549 EXTERN(RtVoid)
550 	RiIfBegin(const char *expr, ...),
551 	RiIfBeginV(const char *expr, RtInt n, RtToken tokens[], RtPointer parms[]),
552 	RiElseIf(const char *expr, ...),
553 	RiElseIfV(const char *expr, RtInt n, RtToken tokens[], RtPointer parms[]),
554 	RiElse(void),
555 	RiIfEnd(void);
556 
557 EXTERN(RtVoid)
558     RiArchiveRecord (RtToken type, const char *format, ...),
559     RiReadArchive (RtString filename, RtArchiveCallback callback, ...),
560     RiReadArchiveV (RtString filename, RtArchiveCallback callback, int n, RtToken tokens[], RtPointer params[]);
561 
562 
563 
564 
565 /*
566     Error codes
567 
568      1 - 10     System and File errors
569     11 - 20     Program Limitations
570     21 - 40     State Errors
571     41 - 60     Parameter and Protocol Errors
572     61 - 80     Execution Errors
573 */
574 
575 #define RIE_NOERROR         0
576 
577 #define RIE_NOMEM           1       /* Out of memory */
578 #define RIE_SYSTEM          2       /* Miscellaneous system error */
579 #define RIE_NOFILE          3       /* File nonexistant */
580 #define RIE_BADFILE         4       /* Bad file format */
581 #define RIE_VERSION         5       /* File version mismatch */
582 
583 #define RIE_INCAPABLE      11       /* Optional RI feature */
584 #define RIE_OPTIONAL       11       /* Optional RI feature */
585 #define RIE_UNIMPLEMENT    12       /* Unimplemented feature */
586 #define RIE_LIMIT          13       /* Arbitrary program limit */
587 #define RIE_BUG            14       /* Probably a bug in renderer */
588 
589 #define RIE_NOTSTARTED     23       /* RiBegin not called */
590 #define RIE_NESTING        24       /* Bad begin-end nesting */
591 #define RIE_NOTOPTIONS     25       /* Invalid state for options */
592 #define RIE_NOTATTRIBS     26       /* Invalid state for attributes */
593 #define RIE_NOTPRIMS       27       /* Invalid state for primitives */
594 #define RIE_ILLSTATE       28       /* Other invalid state */
595 #define RIE_BADMOTION      29       /* Badly formed motion block */
596 #define RIE_BADSOLID       30       /* Badly formed solid block */
597 
598 #define RIE_BADTOKEN       41       /* Invalid token for request */
599 #define RIE_RANGE          42       /* Parameter out of range */
600 #define RIE_CONSISTENCY    43       /* Parameters inconsistent */
601 #define RIE_BADHANDLE      44       /* Bad object/light handle */
602 #define RIE_NOSHADER       45       /* Can't load requested shader */
603 #define RIE_MISSINGDATA    46       /* Required parameters not provided */
604 #define RIE_SYNTAX         47       /* Declare type syntax error */
605 
606 #define RIE_MATH           61       /* Zerodivide, noninvert matrix, etc. */
607 
608 #define	RIE_LOG				62
609 #define	RIE_PROGRESS		63
610 #define	RIE_PRINTF			64
611 #define RIE_SCRIPT			65
612 #define	RIE_BEGIN			66
613 #define RIE_END				67
614 #define	RIE_STATS			68
615 
616 /* Error severity levels */
617 #define RIE_INFO            0       /* Rendering stats & other info */
618 #define RIE_WARNING         1       /* Something seems wrong, maybe okay */
619 #define RIE_ERROR           2       /* Problem.  Results may be wrong */
620 #define RIE_SEVERE          3       /* So bad you should probably abort */
621 
622 #ifdef __cplusplus
623 }
624 #endif
625 
626 
627 #endif  /* RI_H */
628 
629