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, 1 month 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

# Content
1 /* RCSid $Id$ */
2 /*
3 * Quadtree data structures for holodeck display drivers.
4 */
5
6 #include "color.h"
7 #include "tonemap.h"
8 #include "rhdriver.h"
9
10 #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 #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
24 typedef struct rtree {
25 short flgs; /* content flags (defined above) */
26 union {
27 struct rtree *b; /* if branch */
28 int li; /* if leaf */
29 } k[4]; /* children */
30 } RTREE;
31
32 extern struct rleaves {
33 float (*wp)[3]; /* world intersection point array */
34 int4 *wd; /* world direction array */
35 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 #define is_stump(t) (!((t)->flgs & (BR_ANY|LF_ANY)))
45
46 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
50 extern int rayqleft; /* number of rays to queue before flush */
51
52 extern int4 encodedir();
53 extern double fdir2diff(), dir2diff();