ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/hd/rhd_qtree.h
Revision: 3.1
Committed: Wed Nov 19 18:01:03 1997 UTC (26 years, 4 months ago) by gregl
Content type: text/plain
Branch: MAIN
Log Message:
Initial revision

File Contents

# Content
1 /* Copyright (c) 1997 Silicon Graphics, Inc. */
2
3 /* SCCSid "$SunId$ SGI" */
4
5 /*
6 * Quadtree data structures for holodeck display drivers.
7 */
8
9 #include "tonemap.h"
10 #include "rhdriver.h"
11 /* quantity of leaves to free at a time */
12 #ifndef LFREEPCT
13 #define LFREEPCT 15
14 #endif
15 /* child ordering */
16 #define DL 0 /* down left */
17 #define DR 1 /* down right */
18 #define UL 2 /* up left */
19 #define UR 3 /* up right */
20
21 #define BRF(i) (1<<(i)) /* branch flag bit */
22 #define CHF(i) (0x10<<(i)) /* change flag bit */
23 #define CHBRF(i) (0x11<<(i)) /* changed branch flags */
24 #define CH_ANY 0xf0 /* flags for any change */
25
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
32 typedef struct rtree {
33 short flgs; /* branch flags */
34 union {
35 struct rtree *b; /* if branch */
36 RLEAF *l; /* if leaf */
37 } k[4]; /* children */
38 } RTREE;
39
40 extern RTREE qtrunk; /* trunk of quadtree */
41 extern double qtDepthEps; /* epsilon to compare depths (z fraction) */
42 extern int qtMinNodesiz; /* minimum node dimension (pixels) */
43
44
45 /************************************************************************
46 * 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 ************************************************************************/