| 1 |
< |
/* Copyright (c) 1997 Silicon Graphics, Inc. */ |
| 2 |
< |
|
| 3 |
< |
/* SCCSid "$SunId$ SGI" */ |
| 4 |
< |
|
| 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 |
< |
/* child ordering */ |
| 9 |
> |
|
| 10 |
|
#define DL 0 /* down left */ |
| 11 |
|
#define DR 1 /* down right */ |
| 12 |
|
#define UL 2 /* up left */ |
| 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 */ |
| 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 |
< |
/************************************************************************ |
| 53 |
< |
* These driver support routines implement the dev_value() call, but |
| 52 |
< |
* require the following callbacks: |
| 53 |
< |
|
| 54 |
< |
dev_paintr(rgb, x0, y0, x1, y1) : paint a rectangle |
| 55 |
< |
BYTE rgb[3]; : rectangle color |
| 56 |
< |
int x0, y0, x1, y1; : rectangle boundaries |
| 57 |
< |
|
| 58 |
< |
Draws an open rectangle between [x0,x1) and [y0,y1) with the color rgb. |
| 59 |
< |
This function is called many times by qtUpdate(), qtRedraw() and qtReplant(). |
| 60 |
< |
|
| 61 |
< |
************************************************************************/ |
| 52 |
> |
extern int4 encodedir(); |
| 53 |
> |
extern double fdir2diff(), dir2diff(); |