37 |
|
|
38 |
|
char *progname; |
39 |
|
|
40 |
– |
VIEW theirview = STDVIEW(512); /* input view */ |
41 |
– |
int gotview; /* got input view? */ |
42 |
– |
|
40 |
|
int fill = F_FORE|F_BACK; /* selected fill algorithm */ |
41 |
|
extern int backfill(), rcalfill(); /* fill functions */ |
42 |
|
int (*deffill)() = backfill; /* selected fill function */ |
43 |
|
COLR backcolr = BLKCOLR; /* background color */ |
44 |
|
double backz = 0.0; /* background z value */ |
45 |
+ |
int normdist = 1; /* normalized distance? */ |
46 |
+ |
double ourexp = -1; /* output picture exposure */ |
47 |
|
|
48 |
+ |
VIEW theirview = STDVIEW(512); /* input view */ |
49 |
+ |
int gotview; /* got input view? */ |
50 |
|
double theirs2ours[4][4]; /* transformation matrix */ |
51 |
< |
int normdist = 1; /* normalized distance? */ |
51 |
> |
double theirexp; /* input picture exposure */ |
52 |
|
|
53 |
|
int childpid = -1; /* id of fill process */ |
54 |
|
FILE *psend, *precv; /* pipes to/from fill calculation */ |
214 |
|
fprintview(&ourview, stdout); |
215 |
|
printf("\n"); |
216 |
|
} |
217 |
+ |
if (ourexp > 0 && ourexp != 1.0) |
218 |
+ |
fputexpos(ourexp, stdout); |
219 |
|
printf("\n"); |
220 |
|
/* write picture */ |
221 |
|
writepicture(); |
241 |
|
|
242 |
|
printf("\t%s", s); |
243 |
|
|
244 |
+ |
if (isexpos(s)) { |
245 |
+ |
theirexp *= exposval(s); |
246 |
+ |
return; |
247 |
+ |
} |
248 |
|
for (an = altname; *an != NULL; an++) |
249 |
|
if (!strncmp(*an, s, strlen(*an))) { |
250 |
|
if (sscanview(&theirview, s+strlen(*an)) == 0) |
269 |
|
perror(pfile); |
270 |
|
exit(1); |
271 |
|
} |
272 |
< |
/* get header and view */ |
273 |
< |
printf("%s:\n", pfile); |
272 |
> |
/* get header with exposure and view */ |
273 |
> |
theirexp = 1.0; |
274 |
|
gotview = 0; |
275 |
+ |
printf("%s:\n", pfile); |
276 |
|
getheader(pfp, headline); |
277 |
|
if (!gotview || fgetresolu(&theirview.hresolu, &theirview.vresolu, pfp) |
278 |
|
!= (YMAJOR|YDECR)) { |
279 |
|
fprintf(stderr, "%s: picture view error\n", pfile); |
280 |
|
exit(1); |
281 |
|
} |
282 |
+ |
if (ourexp <= 0) |
283 |
+ |
ourexp = theirexp; |
284 |
+ |
else if (ABS(theirexp-ourexp) > .01*ourexp) |
285 |
+ |
fprintf(stderr, "%s: different exposure (warning)\n", pfile); |
286 |
|
if (err = setview(&theirview)) { |
287 |
|
fprintf(stderr, "%s: %s\n", pfile, err); |
288 |
|
exit(1); |
726 |
|
fprintf(stderr, "%s: read error in clearqueue\n", |
727 |
|
progname); |
728 |
|
exit(1); |
729 |
+ |
} |
730 |
+ |
if (ourexp > 0 && ourexp != 1.0) { |
731 |
+ |
inbuf[0] *= ourexp; |
732 |
+ |
inbuf[1] *= ourexp; |
733 |
+ |
inbuf[2] *= ourexp; |
734 |
|
} |
735 |
|
setcolr(pscan(queue[i][1])[queue[i][0]], |
736 |
|
inbuf[0], inbuf[1], inbuf[2]); |