ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/hd/rhd_qtree.h
Revision: 3.12
Committed: Thu Dec 17 09:46:35 1998 UTC (25 years, 4 months ago) by gwlarson
Content type: text/plain
Branch: MAIN
Changes since 3.11: +2 -0 lines
Log Message:
added NOPROTO define before tonemap.h include

File Contents

# Content
1 /* Copyright (c) 1998 Silicon Graphics, Inc. */
2
3 /* SCCSid "$SunId$ SGI" */
4
5 /*
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
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) (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
29 typedef struct rtree {
30 short flgs; /* content flags (defined above) */
31 union {
32 struct rtree *b; /* if branch */
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 extern int4 encodedir();
58 extern double fdir2diff(), dir2diff();