51 |
|
int bradj = 0; /* brightness adjustment */ |
52 |
|
int ncopies = 1; /* number of copies */ |
53 |
|
|
54 |
– |
char *progname; |
54 |
|
int xmax, ymax; /* input image dimensions */ |
55 |
|
|
56 |
|
typedef void putprimf_t(COLR *scn, int pri); |
80 |
|
{ |
81 |
|
char fmt[MAXFMTLEN]; |
82 |
|
|
83 |
< |
if (isformat(s)) { |
84 |
< |
formatval(fmt, s); |
85 |
< |
wrongformat = strcmp(fmt, COLRFMT); |
87 |
< |
} else if (isaspect(s)) |
83 |
> |
if (formatval(fmt, s)) |
84 |
> |
wrongformat = strcmp(fmt, COLRFMT) && strcmp(fmt, SPECFMT); |
85 |
> |
else if (isaspect(s)) |
86 |
|
pixaspect *= aspectval(s); |
87 |
+ |
else if (isncomp(s)) |
88 |
+ |
NCSAMP = ncompval(s); |
89 |
+ |
else if (iswlsplit(s)) |
90 |
+ |
wlsplitval(WLPART, s); |
91 |
|
return(0); |
92 |
|
} |
93 |
|
|
97 |
|
int i; |
98 |
|
double d; |
99 |
|
|
100 |
< |
progname = fixargv0(argv[0]); |
100 |
> |
fixargv0(argv[0]); /* assigns progname */ |
101 |
|
|
102 |
|
for (i = 1; i < argc; i++) |
103 |
|
if (argv[i][0] == '-') |
475 |
|
quiterr("out of memory in ra2ps"); |
476 |
|
/* convert image */ |
477 |
|
for (y = ymax-1; y >= 0; y--) { |
478 |
< |
if (freadcolrs(scanin, xmax, stdin) < 0) |
478 |
> |
if (fread2colrs(scanin, xmax, stdin, NCSAMP, WLPART) < 0) |
479 |
|
quiterr("error reading Radiance picture"); |
480 |
< |
if (putprim == Cputprim || devgam != 1.) { |
480 |
> |
if ((putprim == Cputprim) | (devgam != 1.)) { |
481 |
|
if (bradj) /* adjust exposure */ |
482 |
|
shiftcolrs(scanin, xmax, bradj); |
483 |
|
colrs_gambs(scanin, xmax); /* gamma compression */ |