--- ray/src/hd/rhd_qtree.h 1997/11/21 13:35:58 3.3 +++ ray/src/hd/rhd_qtree.h 2005/01/07 20:33:02 3.18 @@ -1,18 +1,18 @@ -/* Copyright (c) 1997 Silicon Graphics, Inc. */ - -/* SCCSid "$SunId$ SGI" */ - +/* RCSid $Id: rhd_qtree.h,v 3.18 2005/01/07 20:33:02 greg Exp $ */ /* * Quadtree data structures for holodeck display drivers. */ +#ifndef _RAD_RHD_QTREE_H_ +#define _RAD_RHD_QTREE_H_ +#include "color.h" #include "tonemap.h" #include "rhdriver.h" - /* quantity of leaves to free at a time */ -#ifndef LFREEPCT -#define LFREEPCT 15 + +#ifdef __cplusplus +extern "C" { #endif - /* child ordering */ + #define DL 0 /* down left */ #define DR 1 /* down right */ #define UL 2 /* up left */ @@ -37,6 +37,7 @@ typedef struct rtree { extern struct rleaves { float (*wp)[3]; /* world intersection point array */ + int32 *wd; /* world direction array */ TMbright *brt; /* encoded brightness array */ BYTE (*chr)[3]; /* encoded chrominance array */ BYTE (*rgb)[3]; /* tone-mapped color array */ @@ -46,20 +47,34 @@ extern struct rleaves { char *base; /* base of allocated memory */ } qtL; /* our pile of leaves */ +#define is_stump(t) (!((t)->flgs & (BR_ANY|LF_ANY))) + extern RTREE qtrunk; /* trunk of quadtree */ extern double qtDepthEps; /* epsilon to compare depths (z fraction) */ extern int qtMinNodesiz; /* minimum node dimension (pixels) */ +extern int rayqleft; /* number of rays to queue before flush */ -/************************************************************************ - * These driver support routines implement the dev_value() call, but - * require the following callbacks: +extern TMstruct *tmGlobal; /* global tone-mapping structure */ -dev_paintr(rgb, x0, y0, x1, y1) : paint a rectangle -BYTE rgb[3]; : rectangle color -int x0, y0, x1, y1; : rectangle boundaries +/* +extern int32 encodedir(); +extern double fdir2diff(), dir2diff(); +*/ -Draws an open rectangle between [x0,x1) and [y0,y1) with the color rgb. -This function is called many times by qtUpdate(), qtRedraw() and qtReplant(). + /* rhd_qtree.c */ +extern int qtAllocLeaves(register int n); +extern void qtFreeLeaves(void); +extern int qtCompost(int pct); +extern void qtReplant(void); +extern int qtFindLeaf(int x, int y); +extern int qtMapLeaves(int redo); + /* rhd_qtree2c.c rhd_qtree2r.c */ +extern void qtRedraw(int x0, int y0, int x1, int y1); +extern void qtUpdate(void); - ************************************************************************/ +#ifdef __cplusplus +} +#endif +#endif /* _RAD_RHD_QTREE_H_ */ +