1 |
< |
/* Copyright (c) 1998 Silicon Graphics, Inc. */ |
2 |
< |
|
3 |
< |
/* SCCSid "$SunId$ SGI" */ |
4 |
< |
|
1 |
> |
/* RCSid $Id$ */ |
2 |
|
/* |
3 |
|
* Header for OpenGL cone drawing routines with depth buffer checks. |
4 |
+ |
* |
5 |
+ |
* Include after "standard.h" |
6 |
|
*/ |
7 |
+ |
#ifndef _RAD_RHD_ODRAW_H_ |
8 |
+ |
#define _RAD_RHD_ODRAW_H_ |
9 |
|
|
9 |
– |
#undef NOPROTO |
10 |
– |
#define NOPROTO 1 |
10 |
|
#include "color.h" |
11 |
|
#include "tonemap.h" |
12 |
|
#include "rhdriver.h" |
13 |
|
|
14 |
< |
#ifndef int4 |
15 |
< |
#define int4 int |
14 |
> |
#ifdef __cplusplus |
15 |
> |
extern "C" { |
16 |
|
#endif |
17 |
|
|
18 |
|
extern struct ODview { |
19 |
+ |
int sfirst, snext; /* first sample and first in next view */ |
20 |
|
short hhi, vhi; /* screen image resolution */ |
21 |
|
short hlow, vlow; /* block resolution */ |
22 |
+ |
int n2redraw; /* approx. number of samples needing redraw */ |
23 |
|
struct ODblock { |
24 |
|
short nsamp; /* number of samples in block */ |
25 |
|
short nused; /* number actually allocated */ |
26 |
|
int first; /* first sample in this block */ |
27 |
|
int free; /* index for block free list */ |
28 |
+ |
float pthresh; /* proximity threshold */ |
29 |
|
} *bmap; /* low resolution image map */ |
30 |
< |
int4 *emap; /* low resolution edge presence map */ |
30 |
> |
int32 *emap; /* low resolution edge presence map */ |
31 |
> |
int32 *pmap; /* high resolution presence map */ |
32 |
|
GLfloat *dmap; /* high resolution depth map */ |
33 |
|
} *odView; /* our view list */ |
34 |
|
|
35 |
|
extern int odNViews; /* number of views in our list */ |
36 |
|
|
37 |
+ |
extern TMstruct *tmGlobal; /* global tone-mapping structure */ |
38 |
+ |
|
39 |
|
extern struct ODsamp { |
40 |
|
union ODfunion { |
41 |
|
float prox; /* viewpoint proximity */ |
42 |
< |
int4 next; /* next in free list */ |
42 |
> |
int32 next; /* next in free list */ |
43 |
|
|
44 |
|
} *f; /* free list next or proximity */ |
45 |
|
short (*ip)[2]; /* image position array */ |
46 |
|
TMbright *brt; /* encoded brightness array */ |
47 |
|
BYTE (*chr)[3]; /* encoded chrominance array */ |
48 |
|
BYTE (*rgb)[3]; /* tone-mapped color array */ |
49 |
< |
int4 *redraw; /* redraw flags */ |
49 |
> |
int32 *redraw; /* redraw flags */ |
50 |
|
int nsamp; /* total number of samples */ |
51 |
|
char *base; /* base of allocated memory */ |
52 |
|
} odS; /* sample values */ |
58 |
|
#define CLR4(f,i) FL4OP(f,i,&=~) |
59 |
|
#define TGL4(f,i) FL4OP(f,i,^=) |
60 |
|
#define FL4NELS(n) (((n)+0x1f)>>5) |
61 |
< |
#define CLR4ALL(f,n) bzero((char *)(f),FL4NELS(n)*sizeof(int4)) |
61 |
> |
#define CLR4ALL(f,n) memset((char *)(f),'\0',FL4NELS(n)*sizeof(int32)) |
62 |
|
#endif |
63 |
|
|
64 |
|
#define OMAXDEPTH 32000 /* maximum depth value */ |
116 |
|
|
117 |
|
|
118 |
|
void |
119 |
+ |
odRedrawAll() : everything needs to be redrawn |
120 |
+ |
|
121 |
+ |
Redraw everything in all views on the next call to odUpdate(). |
122 |
+ |
Unless odRemap() is called, no new tone mapping will be done. |
123 |
+ |
|
124 |
+ |
|
125 |
+ |
void |
126 |
|
odUpdate(vn) : update the current view |
127 |
|
int vn; : view number |
128 |
|
|
130 |
|
|
131 |
|
|
132 |
|
void |
133 |
< |
odRemap() : recompute tone mapping |
133 |
> |
odRemap(newhist) : recompute tone mapping |
134 |
> |
int newhist; : flag whether to clear history |
135 |
|
|
136 |
|
Recompute the tone mapping for all the samples in all the views |
137 |
< |
and redraw them on the next call(s) to odUpdate(). |
137 |
> |
and redraw them on the next call(s) to odUpdate(). If newhist |
138 |
> |
is non-zero, then clear the previous sample history. |
139 |
|
|
140 |
|
**********************************************************************/ |
141 |
+ |
|
142 |
+ |
/* rhd_geom.c */ |
143 |
+ |
void gmNewGeom( char *file); |
144 |
+ |
extern void gmEndGeom(void); |
145 |
+ |
extern int gmDrawGeom(void); |
146 |
+ |
extern void gmDrawPortals(int r, int g, int b, int a); |
147 |
+ |
extern void gmDepthLimit( double dl[2], FVECT vorg, FVECT vdir); |
148 |
+ |
extern void gmNewPortal(char *pflist); |
149 |
+ |
extern int gmEndPortal(void); |
150 |
+ |
/* rhd_odraw.c */ |
151 |
+ |
extern int odInit(int n); |
152 |
+ |
extern void odSample(COLR c, FVECT d, FVECT p); |
153 |
+ |
extern void odRemap(int newhist); |
154 |
+ |
extern void odRedrawAll(void); |
155 |
+ |
extern void odRedraw(int vn, int hmin, int vmin, int hmax, int vmax); |
156 |
+ |
extern void odDepthMap(int vn, GLfloat *dm); |
157 |
+ |
extern void odUpdate(int vn); |
158 |
+ |
|
159 |
+ |
|
160 |
+ |
#ifdef __cplusplus |
161 |
+ |
} |
162 |
+ |
#endif |
163 |
+ |
#endif /* _RAD_RHD_ODRAW_H_ */ |
164 |
+ |
|