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 */ |
21 |
> |
#define BRF(i) (0x1<<(i)) /* branch flag bit */ |
22 |
> |
#define LFF(i) (0x10<<(i)) /* leaf flag bit */ |
23 |
> |
#define CHF(i) (0x100<<(i)) /* change flag bit */ |
24 |
> |
#define CHBRF(i) (0x101<<(i)) /* changed branch bit */ |
25 |
> |
#define CHLFF(i) (0x110<<(i)) /* changed leaf bit */ |
26 |
> |
#define BR_ANY 0xf /* flags for any branches */ |
27 |
> |
#define LF_ANY 0xf0 /* flags for any leaves */ |
28 |
> |
#define CH_ANY 0xf00 /* flags for any change */ |
29 |
|
|
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 |
– |
|
30 |
|
typedef struct rtree { |
31 |
< |
short flgs; /* branch flags */ |
31 |
> |
short flgs; /* content flags (defined above) */ |
32 |
|
union { |
33 |
|
struct rtree *b; /* if branch */ |
34 |
< |
RLEAF *l; /* if leaf */ |
34 |
> |
int li; /* if leaf */ |
35 |
|
} k[4]; /* children */ |
36 |
|
} RTREE; |
37 |
|
|
38 |
+ |
extern struct rleaves { |
39 |
+ |
float (*wp)[3]; /* world intersection point 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 |
|
extern RTREE qtrunk; /* trunk of quadtree */ |
50 |
|
extern double qtDepthEps; /* epsilon to compare depths (z fraction) */ |
51 |
|
extern int qtMinNodesiz; /* minimum node dimension (pixels) */ |
43 |
– |
|
44 |
– |
extern RLEAF *qtFindLeaf(); |
52 |
|
|
53 |
|
|
54 |
|
/************************************************************************ |