11 |
|
#include "copyright.h" |
12 |
|
|
13 |
|
#include <signal.h> |
14 |
– |
#include <string.h> |
14 |
|
|
15 |
|
#include "platform.h" |
16 |
|
#include "standard.h" |
84 |
|
char *progname; |
85 |
|
|
86 |
|
static gethfunc headline; |
87 |
< |
static double rgb_bright(COLOR clr); |
88 |
< |
static double xyz_bright(COLOR clr); |
87 |
> |
static brightfunc_t rgb_bright; |
88 |
> |
static brightfunc_t xyz_bright; |
89 |
|
static void copyfile(FILE *in, FILE *out); |
90 |
|
static void pass1(FILE *in); |
91 |
|
static void pass2(FILE *in); |
339 |
|
} |
340 |
|
|
341 |
|
|
342 |
< |
double (*ourbright)() = rgb_bright; |
342 |
> |
brightfunc_t *ourbright = rgb_bright; |
343 |
|
|
345 |
– |
|
344 |
|
static int |
345 |
|
headline( /* process line from header */ |
346 |
|
char *s, |
347 |
|
void *p |
348 |
|
) |
349 |
|
{ |
350 |
< |
char fmt[32]; |
350 |
> |
char fmt[MAXFMTLEN]; |
351 |
|
|
352 |
|
fputs(s, stdout); /* copy to output */ |
353 |
|
if (isaspect(s)) /* get aspect ratio */ |
370 |
|
|
371 |
|
static void |
372 |
|
copyfile( /* copy a file */ |
373 |
< |
register FILE *in, |
374 |
< |
register FILE *out |
373 |
> |
FILE *in, |
374 |
> |
FILE *out |
375 |
|
) |
376 |
|
{ |
377 |
< |
register int c; |
377 |
> |
int c; |
378 |
|
|
379 |
|
while ((c = getc(in)) != EOF) |
380 |
|
putc(c, out); |
479 |
|
{ |
480 |
|
COLOR ctmp; |
481 |
|
double d; |
482 |
< |
register int i; |
482 |
> |
int i; |
483 |
|
|
484 |
|
xbrad = xres/ncols/2 + 1; |
485 |
|
ybrad = yres/nrows/2 + 1; |
560 |
|
static int nextrow = 0; |
561 |
|
COLOR ctmp; |
562 |
|
int ybot; |
563 |
< |
register int c; |
563 |
> |
int c; |
564 |
|
/* average input scanlines */ |
565 |
|
while (nextrow <= r+orad && nextrow < nrows) { |
566 |
|
ybot = (nextrow+.5)*yres/nrows; |
583 |
|
static void |
584 |
|
scan2flush(void) /* flush output buffer */ |
585 |
|
{ |
586 |
< |
register int r; |
586 |
> |
int r; |
587 |
|
|
588 |
|
for (r = nrows-orad; r < nrows; r++) |
589 |
|
if (fwritescan(scoutbar[r%obarsize], ncols, stdout) < 0) |