| 15 |
|
char DSTSUF[] = ".dist"; /* distribution suffix */ |
| 16 |
|
char FNCFNM[] = "illum.cal"; /* function file name */ |
| 17 |
|
|
| 18 |
< |
void compinv(COLORV *rinv, COLORV *rp, int m); |
| 19 |
< |
void colorout(int p, COLORV *da, int n, int m, double mult, FILE *fp); |
| 20 |
< |
void fputnum(double d, FILE *fp); |
| 21 |
< |
void brightout(COLORV *da, int n, int m, double mult, FILE *fp); |
| 22 |
< |
void fputeol(FILE *fp); |
| 23 |
< |
void compavg(COLOR col, COLORV *da, int n); |
| 24 |
< |
char * dfname(struct illum_args *il, int c); |
| 25 |
< |
FILE * dfopen(struct illum_args *il, int c); |
| 18 |
> |
static void compinv(COLORV *rinv, COLORV *rp, int m); |
| 19 |
> |
static void colorout(int p, COLORV *da, int n, int m, double mult, FILE *fp); |
| 20 |
> |
static void fputnum(double d, FILE *fp); |
| 21 |
> |
static void brightout(COLORV *da, int n, int m, double mult, FILE *fp); |
| 22 |
> |
static void fputeol(FILE *fp); |
| 23 |
> |
static void compavg(COLOR col, COLORV *da, int n); |
| 24 |
> |
static char * dfname(struct illum_args *il, int c); |
| 25 |
> |
static FILE * dfopen(struct illum_args *il, int c); |
| 26 |
|
|
| 27 |
|
|
| 28 |
|
void |
| 29 |
|
printobj( /* print out an object */ |
| 30 |
|
char *mod, |
| 31 |
< |
register OBJREC *obj |
| 31 |
> |
OBJREC *obj |
| 32 |
|
) |
| 33 |
|
{ |
| 34 |
< |
register int i; |
| 34 |
> |
int i; |
| 35 |
|
|
| 36 |
|
if (issurface(obj->otype) && !strcmp(mod, VOIDID)) |
| 37 |
|
return; /* don't print void surfaces */ |
| 63 |
|
) |
| 64 |
|
{ |
| 65 |
|
char fname[MAXSTR]; |
| 66 |
< |
register char *s; |
| 66 |
> |
char *s; |
| 67 |
|
|
| 68 |
|
s = strcpy(fname, il->datafile); |
| 69 |
|
s += strlen(s); |
| 77 |
|
} |
| 78 |
|
|
| 79 |
|
|
| 80 |
< |
FILE * |
| 80 |
> |
static FILE * |
| 81 |
|
dfopen( /* open data file */ |
| 82 |
< |
register struct illum_args *il, |
| 82 |
> |
struct illum_args *il, |
| 83 |
|
int c |
| 84 |
|
) |
| 85 |
|
{ |
| 99 |
|
} |
| 100 |
|
|
| 101 |
|
|
| 102 |
< |
extern void |
| 102 |
> |
void |
| 103 |
|
flatout( /* write hemispherical distribution */ |
| 104 |
|
struct illum_args *il, |
| 105 |
|
COLORV *da, |
| 156 |
|
} |
| 157 |
|
|
| 158 |
|
|
| 159 |
< |
extern void |
| 159 |
> |
void |
| 160 |
|
roundout( /* write spherical distribution */ |
| 161 |
|
struct illum_args *il, |
| 162 |
|
COLORV *da, |
| 212 |
|
} |
| 213 |
|
|
| 214 |
|
|
| 215 |
< |
extern void |
| 215 |
> |
void |
| 216 |
|
illumout( /* print illum object */ |
| 217 |
< |
register struct illum_args *il, |
| 217 |
> |
struct illum_args *il, |
| 218 |
|
OBJREC *ob |
| 219 |
|
) |
| 220 |
|
{ |
| 243 |
|
} |
| 244 |
|
|
| 245 |
|
|
| 246 |
< |
void |
| 246 |
> |
static void |
| 247 |
|
compavg( /* compute average for set of data values */ |
| 248 |
|
COLOR col, |
| 249 |
< |
register COLORV *da, |
| 249 |
> |
COLORV *da, |
| 250 |
|
int n |
| 251 |
|
) |
| 252 |
|
{ |
| 253 |
< |
register int i; |
| 253 |
> |
int i; |
| 254 |
|
|
| 255 |
|
setcolor(col, 0.0, 0.0, 0.0); |
| 256 |
|
i = n; |
| 262 |
|
} |
| 263 |
|
|
| 264 |
|
|
| 265 |
< |
void |
| 265 |
> |
static void |
| 266 |
|
compinv( /* compute other side of row average */ |
| 267 |
< |
register COLORV *rinv, |
| 268 |
< |
register COLORV *rp, |
| 267 |
> |
COLORV *rinv, |
| 268 |
> |
COLORV *rp, |
| 269 |
|
int m |
| 270 |
|
) |
| 271 |
|
{ |
| 280 |
|
} |
| 281 |
|
|
| 282 |
|
|
| 283 |
< |
extern int |
| 283 |
> |
int |
| 284 |
|
average( /* evaluate average value for distribution */ |
| 285 |
< |
register struct illum_args *il, |
| 285 |
> |
struct illum_args *il, |
| 286 |
|
COLORV *da, |
| 287 |
|
int n |
| 288 |
|
) |
| 300 |
|
|
| 301 |
|
static int colmcnt = 0; /* count of columns written */ |
| 302 |
|
|
| 303 |
< |
void |
| 303 |
> |
static void |
| 304 |
|
fputnum( /* put out a number to fp */ |
| 305 |
|
double d, |
| 306 |
|
FILE *fp |
| 312 |
|
} |
| 313 |
|
|
| 314 |
|
|
| 315 |
< |
void |
| 315 |
> |
static void |
| 316 |
|
fputeol( /* write end of line to fp */ |
| 317 |
< |
register FILE *fp |
| 317 |
> |
FILE *fp |
| 318 |
|
) |
| 319 |
|
{ |
| 320 |
|
putc('\n', fp); |
| 322 |
|
} |
| 323 |
|
|
| 324 |
|
|
| 325 |
< |
void |
| 325 |
> |
static void |
| 326 |
|
colorout( /* put out color distribution data */ |
| 327 |
|
int p, |
| 328 |
< |
register COLORV *da, |
| 328 |
> |
COLORV *da, |
| 329 |
|
int n, |
| 330 |
|
int m, |
| 331 |
|
double mult, |
| 332 |
|
FILE *fp |
| 333 |
|
) |
| 334 |
|
{ |
| 335 |
< |
register int i, j; |
| 335 |
> |
int i, j; |
| 336 |
|
|
| 337 |
|
for (i = 0; i < n; i++) { |
| 338 |
|
for (j = 0; j < m; j++) { |
| 344 |
|
} |
| 345 |
|
|
| 346 |
|
|
| 347 |
< |
void |
| 347 |
> |
static void |
| 348 |
|
brightout( /* put out brightness distribution data */ |
| 349 |
< |
register COLORV *da, |
| 349 |
> |
COLORV *da, |
| 350 |
|
int n, |
| 351 |
|
int m, |
| 352 |
|
double mult, |
| 353 |
|
FILE *fp |
| 354 |
|
) |
| 355 |
|
{ |
| 356 |
< |
register int i, j; |
| 356 |
> |
int i, j; |
| 357 |
|
|
| 358 |
|
for (i = 0; i < n; i++) { |
| 359 |
|
for (j = 0; j < m; j++) { |