--- ray/src/hd/rhd_qtree.h 2003/06/20 00:25:49 3.15 +++ ray/src/hd/rhd_qtree.h 2011/05/20 02:06:39 3.19 @@ -1,12 +1,18 @@ -/* RCSid $Id: rhd_qtree.h,v 3.15 2003/06/20 00:25:49 greg Exp $ */ +/* RCSid $Id: rhd_qtree.h,v 3.19 2011/05/20 02:06:39 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" +#ifdef __cplusplus +extern "C" { +#endif + #define DL 0 /* down left */ #define DR 1 /* down right */ #define UL 2 /* up left */ @@ -33,8 +39,8 @@ 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 */ + uby8 (*chr)[3]; /* encoded chrominance array */ + uby8 (*rgb)[3]; /* tone-mapped color array */ int nl; /* count of leaves in our pile */ int bl, tl; /* bottom and top (next) leaf index */ int tml; /* next leaf needing tone-mapping */ @@ -49,5 +55,26 @@ extern int qtMinNodesiz; /* minimum node dimension (pi extern int rayqleft; /* number of rays to queue before flush */ +extern TMstruct *tmGlobal; /* global tone-mapping structure */ + +/* extern int32 encodedir(); extern double fdir2diff(), dir2diff(); +*/ + + /* 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_ */ +