ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/hd/rhd_qtree.h
Revision: 3.14
Committed: Tue Mar 4 05:49:21 2003 UTC (21 years ago) by greg
Content type: text/plain
Branch: MAIN
CVS Tags: rad3R5
Changes since 3.13: +1 -3 lines
Log Message:
Moved dircode.c and fixed prototype compiles in hd directory

File Contents

# User Rev Content
1 greg 3.14 /* RCSid $Id$ */
2 gregl 3.1 /*
3     * Quadtree data structures for holodeck display drivers.
4     */
5    
6 gwlarson 3.11 #include "color.h"
7 gregl 3.1 #include "tonemap.h"
8     #include "rhdriver.h"
9 gregl 3.7
10 gregl 3.1 #define DL 0 /* down left */
11     #define DR 1 /* down right */
12     #define UL 2 /* up left */
13     #define UR 3 /* up right */
14    
15 gregl 3.3 #define BRF(i) (0x1<<(i)) /* branch flag bit */
16     #define LFF(i) (0x10<<(i)) /* leaf flag bit */
17     #define CHF(i) (0x100<<(i)) /* change flag bit */
18     #define CHBRF(i) (0x101<<(i)) /* changed branch bit */
19     #define CHLFF(i) (0x110<<(i)) /* changed leaf bit */
20     #define BR_ANY 0xf /* flags for any branches */
21     #define LF_ANY 0xf0 /* flags for any leaves */
22     #define CH_ANY 0xf00 /* flags for any change */
23 gregl 3.1
24     typedef struct rtree {
25 gregl 3.3 short flgs; /* content flags (defined above) */
26 gregl 3.1 union {
27     struct rtree *b; /* if branch */
28 gregl 3.3 int li; /* if leaf */
29 gregl 3.1 } k[4]; /* children */
30     } RTREE;
31    
32 gregl 3.3 extern struct rleaves {
33     float (*wp)[3]; /* world intersection point array */
34 gregl 3.7 int4 *wd; /* world direction array */
35 gregl 3.3 TMbright *brt; /* encoded brightness array */
36     BYTE (*chr)[3]; /* encoded chrominance array */
37     BYTE (*rgb)[3]; /* tone-mapped color array */
38     int nl; /* count of leaves in our pile */
39     int bl, tl; /* bottom and top (next) leaf index */
40     int tml; /* next leaf needing tone-mapping */
41     char *base; /* base of allocated memory */
42     } qtL; /* our pile of leaves */
43    
44 gregl 3.5 #define is_stump(t) (!((t)->flgs & (BR_ANY|LF_ANY)))
45    
46 gregl 3.1 extern RTREE qtrunk; /* trunk of quadtree */
47     extern double qtDepthEps; /* epsilon to compare depths (z fraction) */
48     extern int qtMinNodesiz; /* minimum node dimension (pixels) */
49 gregl 3.8
50 gregl 3.9 extern int rayqleft; /* number of rays to queue before flush */
51    
52 gregl 3.8 extern int4 encodedir();
53     extern double fdir2diff(), dir2diff();