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.1 by gwlarson, Wed Aug 19 17:45:24 1998 UTC vs.
Revision 3.9 by greg, Fri Jun 20 00:25:49 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   #include "color.h"
8   #include "tonemap.h"
9   #include "rhdriver.h"
10 + #include "object.h"
11  
12 < #ifndef int2
13 < #define int2    short
12 > #ifndef INVALID
13 > #define INVALID  -1
14   #endif
15 < #ifndef int4
16 < #define int4    int
17 < #endif
18 <                                /* child ordering */
19 < typedef struct rsamp {
20 <        float           (*wp)[3];       /* world intersection point array */
21 <        int4            *wd;            /* world direction array */
15 >
16 > #define SFLOAT float
17 >
18 > typedef OBJECT S_ID;
19 >
20 > #define S_ID_MAX  ((1 << ((sizeof(S_ID)<<3)-1))-1)
21 >
22 > typedef struct samp {
23 >        SFLOAT          (*wp)[3];       /* world intersection point array */
24 >        int32           *wd;            /* world direction array */
25          TMbright        *brt;           /* encoded brightness array */
26          BYTE            (*chr)[3];      /* encoded chrominance array */
27          BYTE            (*rgb)[3];      /* tone-mapped color array */
28 +        int             *info;          /* Extra sample info */
29 +        int             *info1;         /* Extra sample info */
30          int             max_samp;       /* maximum number of samples */
31 <        int             max_aux_pt;     /* maximum number of aux points */
32 <        int             next_aux_pt;      /* next auxilliary point to add */
33 <        int             replace_samp;      /* next sample to free  */
34 <        int             num_samp;        /* reached end of list? */
35 <        int             tone_map;        /* pointer to next value(s) to tonemap*/
36 <        int             free_samp;       /* list of freed samples */
31 >        int             max_base_pt;    /* maximum number of aux points */
32 >        S_ID            next_base_pt;   /* next auxilliary point to add */
33 >        S_ID            replace_samp;   /* next sample to free  */
34 >        int             num_samp;       /* current number of samples */
35 >        S_ID             tone_map;      /* pointer to next value(s)t tonemap*/
36 >        S_ID             free_samp;     /* next free sample */
37          char            *base;          /* base of allocated memory */
38 < } RSAMP;
38 > } SAMP;
39  
40 < #define RS_W_PT(s)               ((s)->wp)
41 < #define RS_W_DIR(s)              ((s)->wd)
42 < #define RS_BRT(s)                ((s)->brt)
43 < #define RS_CHR(s)                ((s)->chr)
44 < #define RS_RGB(s)                ((s)->rgb)
45 < #define RS_MAX_SAMP(s)           ((s)->max_samp)
46 < #define RS_TONE_MAP(s)           ((s)->tone_map)
47 < #define RS_MAX_POINTS(s)         ((s)->max_aux_pt)
48 < #define RS_REPLACE_SAMP(s)       ((s)->replace_samp)
49 < #define RS_NEXT_AUX_PT(s)        ((s)->next_aux_pt)
50 < #define RS_MAX_AUX_PT(s)         ((s)->max_aux_pt)
51 < #define RS_BASE(s)               ((s)->base)
52 < #define RS_NUM_SAMP(s)           ((s)->num_samp)
53 < #define RS_FREE_SAMP(s)          ((s)->free_samp)
54 < #define RS_NTH_W_PT(s,n)         (RS_W_PT(s)[(n)])
55 < #define RS_NTH_W_DIR(s,n)        (RS_W_DIR(s)[(n)])
51 < #define RS_NTH_RGB(s,n)          (RS_RGB(s)[(n)])
52 < #define RS_NTH_CHR(s,n)          (RS_CHR(s)[(n)])
53 < #define RS_NTH_BRT(s,n)          (RS_BRT(s)[(n)])
54 < #define RS_EOL(s)                (RS_NUM_SAMP(s) >= RS_MAX_SAMP(s))
55 < extern  RSAMP rsL;                      
40 > /* Sample field access macros */
41 > #define S_W_PT(s)               ((s)->wp)
42 > #define S_W_DIR(s)              ((s)->wd)
43 > #define S_BRT(s)                ((s)->brt)
44 > #define S_CHR(s)                ((s)->chr)
45 > #define S_RGB(s)                ((s)->rgb)
46 > #define S_INFO(s)               ((s)->info)
47 > #define S_INFO1(s)              ((s)->info1)
48 > #define S_MAX_SAMP(s)           ((s)->max_samp)
49 > #define S_MAX_BASE_PT(s)        ((s)->max_base_pt)
50 > #define S_NEXT_BASE_PT(s)       ((s)->next_base_pt)
51 > #define S_REPLACE_SAMP(s)       ((s)->replace_samp)
52 > #define S_NUM_SAMP(s)           ((s)->num_samp)
53 > #define S_TONE_MAP(s)           ((s)->tone_map)
54 > #define S_FREE_SAMP(s)          ((s)->free_samp)
55 > #define S_BASE(s)               ((s)->base)
56  
57 < extern double   rsDepthEps;     /* epsilon to compare depths (z fraction) */
57 > #define S_MAX_POINTS(s)         ((s)->max_base_pt)
58 > #define S_NTH_W_PT(s,n)         (S_W_PT(s)[(n)])
59 > #define S_NTH_W_DIR(s,n)        (S_W_DIR(s)[(n)])
60 > #define S_NTH_RGB(s,n)          (S_RGB(s)[(n)])
61 > #define S_NTH_CHR(s,n)          (S_CHR(s)[(n)])
62 > #define S_NTH_INFO(s,n)         (S_INFO(s)[(n)])
63 > #define S_NTH_INFO1(s,n)        (S_INFO1(s)[(n)])
64 > #define S_NTH_BRT(s,n)          (S_BRT(s)[(n)])
65  
66 < extern int4     encodedir();
67 < extern double   fdir2diff(), dir2diff();
68 < extern void     decodedir();
66 > /* Sample Flag macros */
67 > #define S_IS_FLAG(s)            IS_FLAG(samp_flag,s)
68 > #define S_SET_FLAG(s)           SET_FLAG(samp_flag,s)
69 > #define S_CLR_FLAG(s)           CLR_FLAG(samp_flag,s)
70 >
71 > #define S_NTH_NEXT(s,n)         S_NTH_W_DIR(s,n)
72 > #define sUnalloc_samp(s,n) (S_NTH_NEXT(s,n)=S_FREE_SAMP(s),S_FREE_SAMP(s)=n)
73 > #define sClear_base_points(s)  (S_NEXT_BASE_PT(s) = S_MAX_SAMP(s))
74 > #define sClear(s)      sInit(s)
75 > /* MAXDIFF2 Max allowed cos angle squared of sample dir from current view */
76 > /* In terms of cos: if angle is 30: MAXDIFF2 = cos(30)^2, if difference
77 >  is greater than this point not accepted on rebuild
78 >  */
79 > #define MAXDIFF2        0.75
80 > /* Max difference in direction for points at infinity: if over 45degrees
81 >  not accepted on rebuild cos(45)
82 >  */
83 > #define MAXDIR           0.70710678        
84 > #define MAXQUALITY      10000   /* Maximum quality for rendering rep */
85 >
86 > extern  SAMP rsL;                      
87 > extern double   sDepthEps;      /* epsilon to compare depths (z fraction) */
88 > extern int32    encodedir();    /* Encodes FVECT direction */
89 > extern void     decodedir();    /* Decodes dir-> FVECT */
90 > extern double   fdir2diff(), dir2diff(); /* Compare dir and FVECT */
91 > extern int32    *samp_flag;     /* Per/sample flags s */
92 >
93 > /* These values are set by the driver, and used in the OGL call for glFrustum*/
94 > extern double dev_zmin,dev_zmax;
95 > extern S_ID sAdd_base_point();
96 > extern SAMP *sAlloc();
97 > extern S_ID sAlloc_samp();
98   /*
99   * int
100   * smInit(n)            : Initialize/clear data structures for n entries
# Line 99 | Line 135 | extern void     decodedir();
135   * view has already been set up and the correct frame buffer has been
136   * selected for drawing.  The quality level is on a linear scale, where 100%
137   * is full (final) quality.  It is not necessary to redraw geometry that has
138 < * been output since the last call to smClean().
138 > * been output since the last call to smClean().  (The last view drawn will
139 > * be vp==&odev.v each time.)
140   */
104
105 /* These values are set by the driver, and used in the OGL call for glFrustum*/
106 extern double dev_zmin,dev_zmax;
107
141  
142  
143  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines