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

Comparing ray/src/hd/rhd_qtree.h (file contents):
Revision 3.1 by gregl, Wed Nov 19 18:01:03 1997 UTC vs.
Revision 3.12 by gwlarson, Thu Dec 17 09:46:35 1998 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1997 Silicon Graphics, Inc. */
1 > /* Copyright (c) 1998 Silicon Graphics, Inc. */
2  
3   /* SCCSid "$SunId$ SGI" */
4  
# Line 6 | Line 6
6   * Quadtree data structures for holodeck display drivers.
7   */
8  
9 + #undef NOPROTO
10 + #define NOPROTO 1
11 + #include "color.h"
12   #include "tonemap.h"
13   #include "rhdriver.h"
14 <                                /* quantity of leaves to free at a time */
12 < #ifndef LFREEPCT
13 < #define LFREEPCT        15
14 < #endif
15 <                                /* child ordering */
14 >
15   #define DL              0               /* down left */
16   #define DR              1               /* down right */
17   #define UL              2               /* up left */
18   #define UR              3               /* up right */
19  
20 < #define BRF(i)          (1<<(i))        /* branch flag bit */
21 < #define CHF(i)          (0x10<<(i))     /* change flag bit */
22 < #define CHBRF(i)        (0x11<<(i))     /* changed branch flags */
23 < #define CH_ANY          0xf0            /* flags for any change */
20 > #define BRF(i)          (0x1<<(i))      /* branch flag bit */
21 > #define LFF(i)          (0x10<<(i))     /* leaf flag bit */
22 > #define CHF(i)          (0x100<<(i))    /* change flag bit */
23 > #define CHBRF(i)        (0x101<<(i))    /* changed branch bit */
24 > #define CHLFF(i)        (0x110<<(i))    /* changed leaf bit */
25 > #define BR_ANY          0xf             /* flags for any branches */
26 > #define LF_ANY          0xf0            /* flags for any leaves */
27 > #define CH_ANY          0xf00           /* flags for any change */
28  
26 typedef struct {
27        float           wp[3];          /* world intersection point */
28        TMbright        brt;            /* encoded brightness (LogY) */
29        BYTE            chr[3];         /* encoded chrominance (RGB) */
30 }       RLEAF;                  /* recorded ray (leaf) value */
31
29   typedef struct rtree {
30 <        short   flgs;                   /* branch flags */
30 >        short   flgs;                   /* content flags (defined above) */
31          union {
32                  struct rtree    *b;             /* if branch */
33 <                RLEAF   *l;                     /* if leaf */
33 >                int     li;                     /* if leaf */
34          } k[4];                         /* children */
35   }       RTREE;
36  
37 + extern struct rleaves {
38 +        float           (*wp)[3];       /* world intersection point array */
39 +        int4            *wd;            /* world direction array */
40 +        TMbright        *brt;           /* encoded brightness array */
41 +        BYTE            (*chr)[3];      /* encoded chrominance array */
42 +        BYTE            (*rgb)[3];      /* tone-mapped color array */
43 +        int             nl;             /* count of leaves in our pile */
44 +        int             bl, tl;         /* bottom and top (next) leaf index */
45 +        int             tml;            /* next leaf needing tone-mapping */
46 +        char            *base;          /* base of allocated memory */
47 + }       qtL;                    /* our pile of leaves */
48 +
49 + #define is_stump(t)     (!((t)->flgs & (BR_ANY|LF_ANY)))
50 +
51   extern RTREE    qtrunk;         /* trunk of quadtree */
52   extern double   qtDepthEps;     /* epsilon to compare depths (z fraction) */
53   extern int      qtMinNodesiz;   /* minimum node dimension (pixels) */
54  
55 + extern int      rayqleft;       /* number of rays to queue before flush */
56  
57 < /************************************************************************
58 < * These driver support routines implement the dev_value() call, but
47 < * require the following callbacks:
48 <
49 < dev_paintr(rgb, x0, y0, x1, y1) : paint a rectangle
50 < BYTE    rgb[3];                 : rectangle color
51 < int     x0, y0, x1, y1;         : rectangle boundaries
52 <
53 < Draws an open rectangle between [x0,x1) and [y0,y1) with the color rgb.
54 < This function is called many times by qtUpdate(), qtRedraw() and qtReplant().
55 <
56 < ************************************************************************/
57 > extern int4     encodedir();
58 > extern double   fdir2diff(), dir2diff();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines