62 |
|
#endif |
63 |
|
return(NULL); |
64 |
|
} |
65 |
< |
if (freadscan(scanbuf, scanlen(&inpres), infp) < 0) { |
65 |
> |
if (what2do&DO_ACUITY) |
66 |
> |
acuscan(scanbuf, nread); |
67 |
> |
else if (freadscan(scanbuf, scanlen(&inpres), infp) < 0) { |
68 |
|
fprintf(stderr, "%s: %s: scanline read error\n", |
69 |
|
progname, infn); |
70 |
|
exit(1); |
71 |
|
} |
70 |
– |
nread++; |
72 |
|
if (what2do&DO_VEIL) /* add veiling */ |
73 |
< |
addveil(scanbuf, nread-1); |
73 |
> |
addveil(scanbuf, nread); |
74 |
|
if (what2do&DO_COLOR) /* scotopic color loss */ |
75 |
|
scotscan(scanbuf, scanlen(&inpres)); |
76 |
|
if (what2do&DO_LINEAR) /* map luminances */ |
81 |
|
mbscan(scanbuf, scanlen(&inpres), &mbcond); |
82 |
|
else if (lumf == cielum | inprims != outprims) |
83 |
|
matscan(scanbuf, scanlen(&inpres), mbcond.cmat); |
84 |
+ |
nread++; |
85 |
|
return(scanbuf); |
86 |
|
} |
87 |
|
|
96 |
|
comprgb2rgbmat(mbcond.cmat, inprims, outprims); |
97 |
|
else |
98 |
|
compxyz2rgbmat(mbcond.cmat, outprims); |
99 |
+ |
if (what2do&DO_ACUITY) { |
100 |
+ |
#ifdef DEBUG |
101 |
+ |
fprintf(stderr, "%s: initializing acuity sampling...", |
102 |
+ |
progname); |
103 |
+ |
#endif |
104 |
+ |
initacuity(); |
105 |
+ |
#ifdef DEBUG |
106 |
+ |
fprintf(stderr, "done\n"); |
107 |
+ |
#endif |
108 |
+ |
} |
109 |
|
scanbuf = (COLOR *)malloc(scanlen(&inpres)*sizeof(COLOR)); |
110 |
|
if (scanbuf == NULL) |
111 |
|
syserror("malloc"); |