13 |
|
#include <signal.h> |
14 |
|
#include <string.h> |
15 |
|
|
16 |
– |
#include "standard.h" |
16 |
|
#include "platform.h" |
17 |
+ |
#include "standard.h" |
18 |
+ |
#include "rtio.h" |
19 |
|
#include "color.h" |
20 |
|
#include "view.h" |
21 |
|
#include "paths.h" |
22 |
+ |
#include "pfilt.h" |
23 |
|
|
22 |
– |
extern float *matchlamp(); |
24 |
|
|
25 |
|
#define FEQ(a,b) ((a) >= .98*(b) && (a) <= 1.02*(b)) |
26 |
|
|
84 |
|
|
85 |
|
char *progname; |
86 |
|
|
87 |
+ |
static gethfunc headline; |
88 |
+ |
static brightfunc_t rgb_bright; |
89 |
+ |
static brightfunc_t xyz_bright; |
90 |
+ |
//static double rgb_bright(COLOR clr); |
91 |
+ |
//static double xyz_bright(COLOR clr); |
92 |
+ |
static void copyfile(FILE *in, FILE *out); |
93 |
+ |
static void pass1(FILE *in); |
94 |
+ |
static void pass2(FILE *in); |
95 |
+ |
static void scan2init(void); |
96 |
+ |
static void scan2sync(int r); |
97 |
+ |
static void scan2flush(void); |
98 |
|
|
99 |
< |
main(argc, argv) |
100 |
< |
int argc; |
101 |
< |
char **argv; |
99 |
> |
|
100 |
> |
int |
101 |
> |
main( |
102 |
> |
int argc, |
103 |
> |
char **argv |
104 |
> |
) |
105 |
|
{ |
91 |
– |
extern int headline(); |
106 |
|
FILE *fin; |
107 |
|
float *lampcolor; |
108 |
|
char *lamptype = NULL; |
320 |
|
pass2(fin); |
321 |
|
|
322 |
|
quit(estatus); |
323 |
+ |
return estatus; /* pro forma return */ |
324 |
|
} |
325 |
|
|
326 |
|
|
327 |
< |
double |
328 |
< |
rgb_bright(clr) |
329 |
< |
COLOR clr; |
327 |
> |
static double |
328 |
> |
rgb_bright( |
329 |
> |
COLOR clr |
330 |
> |
) |
331 |
|
{ |
332 |
|
return(bright(clr)); |
333 |
|
} |
334 |
|
|
335 |
|
|
336 |
< |
double |
337 |
< |
xyz_bright(clr) |
338 |
< |
COLOR clr; |
336 |
> |
static double |
337 |
> |
xyz_bright( |
338 |
> |
COLOR clr |
339 |
> |
) |
340 |
|
{ |
341 |
|
return(clr[CIEY]); |
342 |
|
} |
343 |
|
|
344 |
|
|
345 |
< |
double (*ourbright)() = rgb_bright; |
345 |
> |
brightfunc_t *ourbright = rgb_bright; |
346 |
|
|
347 |
< |
|
348 |
< |
int |
349 |
< |
headline(s) /* process line from header */ |
350 |
< |
char *s; |
347 |
> |
static int |
348 |
> |
headline( /* process line from header */ |
349 |
> |
char *s, |
350 |
> |
void *p |
351 |
> |
) |
352 |
|
{ |
353 |
|
char fmt[32]; |
354 |
|
|
371 |
|
} |
372 |
|
|
373 |
|
|
374 |
< |
copyfile(in, out) /* copy a file */ |
375 |
< |
register FILE *in, *out; |
374 |
> |
static void |
375 |
> |
copyfile( /* copy a file */ |
376 |
> |
register FILE *in, |
377 |
> |
register FILE *out |
378 |
> |
) |
379 |
|
{ |
380 |
|
register int c; |
381 |
|
|
389 |
|
} |
390 |
|
|
391 |
|
|
392 |
< |
pass1(in) /* first pass of picture file */ |
393 |
< |
FILE *in; |
392 |
> |
static void |
393 |
> |
pass1( /* first pass of picture file */ |
394 |
> |
FILE *in |
395 |
> |
) |
396 |
|
{ |
397 |
|
int i; |
398 |
|
COLOR *scan; |
424 |
|
} |
425 |
|
|
426 |
|
|
427 |
< |
pass2(in) /* last pass on file, write to stdout */ |
428 |
< |
FILE *in; |
427 |
> |
static void |
428 |
> |
pass2( /* last pass on file, write to stdout */ |
429 |
> |
FILE *in |
430 |
> |
) |
431 |
|
{ |
432 |
|
int yread; |
433 |
|
int ycent, xcent; |
477 |
|
} |
478 |
|
|
479 |
|
|
480 |
< |
scan2init() /* prepare scanline arrays */ |
480 |
> |
static void |
481 |
> |
scan2init(void) /* prepare scanline arrays */ |
482 |
|
{ |
483 |
|
COLOR ctmp; |
484 |
|
double d; |
516 |
|
if (obarsize > 0) { |
517 |
|
scoutbar = (COLOR **)malloc(obarsize*sizeof(COLOR *)); |
518 |
|
greybar = (float **)malloc(obarsize*sizeof(float *)); |
519 |
< |
if (scoutbar == NULL | greybar == NULL) |
519 |
> |
if ((scoutbar == NULL) | (greybar == NULL)) |
520 |
|
goto memerr; |
521 |
|
for (i = 0; i < obarsize; i++) { |
522 |
|
scoutbar[i] = (COLOR *)malloc(ncols*sizeof(COLOR)); |
523 |
|
greybar[i] = (float *)malloc(ncols*sizeof(float)); |
524 |
< |
if (scoutbar[i] == NULL | greybar[i] == NULL) |
524 |
> |
if ((scoutbar[i] == NULL) | (greybar[i] == NULL)) |
525 |
|
goto memerr; |
526 |
|
} |
527 |
|
} else { |
555 |
|
} |
556 |
|
|
557 |
|
|
558 |
< |
scan2sync(r) /* synchronize grey averages and output scan */ |
559 |
< |
int r; |
558 |
> |
static void |
559 |
> |
scan2sync( /* synchronize grey averages and output scan */ |
560 |
> |
int r |
561 |
> |
) |
562 |
|
{ |
563 |
|
static int nextrow = 0; |
564 |
|
COLOR ctmp; |
583 |
|
} |
584 |
|
|
585 |
|
|
586 |
< |
scan2flush() /* flush output buffer */ |
586 |
> |
static void |
587 |
> |
scan2flush(void) /* flush output buffer */ |
588 |
|
{ |
589 |
|
register int r; |
590 |
|
|