ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/hd/rhd_sample.h
(Generate patch)

Comparing ray/src/hd/rhd_sample.h (file contents):
Revision 3.7 by simmons, Thu Jun 10 15:21:09 1999 UTC vs.
Revision 3.10 by schorsch, Mon Jul 14 22:24:00 2003 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1998 Silicon Graphics, Inc. */
2 <
3 < /* SCCSid "$SunId$ SGI" */
4 <
1 > /* RCSid: $Id$ */
2   /*
3   * Sample data structures for holodeck display drivers.
4 + *
5 + * Include after "standard.h"
6   */
7 + #ifndef _RAD_RHD_SAMPLE_H_
8 + #define _RAD_RHD_SAMPLE_H_
9 +
10   #include "color.h"
11   #include "tonemap.h"
12   #include "rhdriver.h"
13 + #include "object.h"
14  
15 < #ifndef int2
16 < #define int2    short
15 > #ifdef __cplusplus
16 > extern "C" {
17   #endif
15 #ifndef int4
16 #define int4    int
17 #endif
18  
19   #ifndef INVALID
20   #define INVALID  -1
21   #endif
22  
23 #ifndef LORES
24 #define SFLOAT double
25 #else
23   #define SFLOAT float
27 #endif
24  
25 + typedef OBJECT S_ID;
26 +
27 + #define S_ID_MAX  ((1 << ((sizeof(S_ID)<<3)-1))-1)
28 +
29   typedef struct samp {
30          SFLOAT          (*wp)[3];       /* world intersection point array */
31 <        int4            *wd;            /* world direction array */
31 >        int32           *wd;            /* world direction array */
32          TMbright        *brt;           /* encoded brightness array */
33          BYTE            (*chr)[3];      /* encoded chrominance array */
34          BYTE            (*rgb)[3];      /* tone-mapped color array */
35          int             *info;          /* Extra sample info */
36 <        int             *info1;          /* Extra sample info */
36 >        int             *info1;         /* Extra sample info */
37          int             max_samp;       /* maximum number of samples */
38 <        int             max_base_pt;     /* maximum number of aux points */
39 <        int             next_base_pt;    /* next auxilliary point to add */
40 <        int             replace_samp;   /* next sample to free  */
38 >        int             max_base_pt;    /* maximum number of aux points */
39 >        S_ID            next_base_pt;   /* next auxilliary point to add */
40 >        S_ID            replace_samp;   /* next sample to free  */
41          int             num_samp;       /* current number of samples */
42 <        int             tone_map;       /* pointer to next value(s)t tonemap*/
43 <        int             free_samp;      /* free sample-not available yet */
42 >        S_ID             tone_map;      /* pointer to next value(s)t tonemap*/
43 >        S_ID             free_samp;     /* next free sample */
44          char            *base;          /* base of allocated memory */
45   } SAMP;
46  
# Line 51 | Line 51 | typedef struct samp {
51   #define S_CHR(s)                ((s)->chr)
52   #define S_RGB(s)                ((s)->rgb)
53   #define S_INFO(s)               ((s)->info)
54 < #define S_INFO1(s)               ((s)->info1)
54 > #define S_INFO1(s)              ((s)->info1)
55   #define S_MAX_SAMP(s)           ((s)->max_samp)
56   #define S_MAX_BASE_PT(s)        ((s)->max_base_pt)
57   #define S_NEXT_BASE_PT(s)       ((s)->next_base_pt)
# Line 67 | Line 67 | typedef struct samp {
67   #define S_NTH_RGB(s,n)          (S_RGB(s)[(n)])
68   #define S_NTH_CHR(s,n)          (S_CHR(s)[(n)])
69   #define S_NTH_INFO(s,n)         (S_INFO(s)[(n)])
70 < #define S_NTH_INFO1(s,n)         (S_INFO1(s)[(n)])
70 > #define S_NTH_INFO1(s,n)        (S_INFO1(s)[(n)])
71   #define S_NTH_BRT(s,n)          (S_BRT(s)[(n)])
72  
73   /* Sample Flag macros */
# Line 92 | Line 92 | typedef struct samp {
92  
93   extern  SAMP rsL;                      
94   extern double   sDepthEps;      /* epsilon to compare depths (z fraction) */
95 < extern int4     encodedir();    /* Encodes FVECT direction */
95 > extern int32    encodedir();    /* Encodes FVECT direction */
96   extern void     decodedir();    /* Decodes dir-> FVECT */
97   extern double   fdir2diff(), dir2diff(); /* Compare dir and FVECT */
98 < extern int4    *samp_flag;     /* Per/sample flags s */
98 > extern int32    *samp_flag;     /* Per/sample flags s */
99  
100   /* These values are set by the driver, and used in the OGL call for glFrustum*/
101   extern double dev_zmin,dev_zmax;
102 <
102 > extern S_ID sAdd_base_point();
103   extern SAMP *sAlloc();
104 + extern S_ID sAlloc_samp();
105 + /*
106 + * int
107 + * smInit(n)            : Initialize/clear data structures for n entries
108 + * int  n;
109 + *
110 + * Initialize sampL and other data structures for at least n samples.
111 + * If n is 0, then free data structures.  Return number actually allocated.
112 + *
113 + *
114 + * int
115 + * smNewSamp(c, p, v)   : register new sample point and return index
116 + * COLR c;              : pixel color (RGBE)
117 + * FVECT        p;      : world intersection point
118 + * FVECT        v;      : ray direction vector
119 + *
120 + * Add new sample point to data structures, removing old values as necessary.
121 + * New sample representation will be output in next call to smUpdate().
122 + *
123 + *
124 + * int
125 + * smFindSamp(orig, dir): intersect ray with 3D rep. and find closest sample
126 + * FVECT        orig, dir;
127 + *
128 + * Find the closest sample to the given ray.  Return -1 on failure.
129 + *
130 + *
131 + * smClean()            : display has been wiped clean
132 + *
133 + * Called after display has been effectively cleared, meaning that all
134 + * geometry must be resent down the pipeline in the next call to smUpdate().
135 + *
136 + *
137 + * smUpdate(vp, qua)    : update OpenGL output geometry for view vp
138 + * VIEW *vp;            : desired view
139 + * int  qua;            : quality level (percentage on linear time scale)
140 + *
141 + * Draw new geometric representation using OpenGL calls.  Assume that the
142 + * view has already been set up and the correct frame buffer has been
143 + * selected for drawing.  The quality level is on a linear scale, where 100%
144 + * is full (final) quality.  It is not necessary to redraw geometry that has
145 + * been output since the last call to smClean().  (The last view drawn will
146 + * be vp==&odev.v each time.)
147 + */
148  
149  
150 <
151 <
150 > #ifdef __cplusplus
151 > }
152 > #endif
153 > #endif /* _RAD_RHD_SAMPLE_H_ */
154  
155  
156  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines