20 |
|
|
21 |
|
char *mbcalfile = NULL; /* macbethcal mapping file */ |
22 |
|
|
23 |
< |
static struct mbc mbcond; /* macbethcal conditioning struct */ |
23 |
> |
static struct mbc { |
24 |
> |
float xa[3][6], ya[3][6]; |
25 |
> |
COLORMAT cmat; |
26 |
> |
} mbcond; /* macbethcal conditioning struct */ |
27 |
|
|
28 |
|
static COLOR *scanbuf; /* scanline processing buffer */ |
29 |
|
static int nread; /* number of scanlines processed */ |
65 |
|
#endif |
66 |
|
return(NULL); |
67 |
|
} |
68 |
< |
if (freadscan(scanbuf, scanlen(&inpres), infp) < 0) { |
68 |
> |
if (what2do&DO_ACUITY) |
69 |
> |
acuscan(scanbuf, nread); |
70 |
> |
else if (freadscan(scanbuf, scanlen(&inpres), infp) < 0) { |
71 |
|
fprintf(stderr, "%s: %s: scanline read error\n", |
72 |
|
progname, infn); |
73 |
|
exit(1); |
74 |
|
} |
70 |
– |
nread++; |
75 |
|
if (what2do&DO_VEIL) /* add veiling */ |
76 |
< |
addveil(scanbuf, nread-1); |
76 |
> |
addveil(scanbuf, nread); |
77 |
|
if (what2do&DO_COLOR) /* scotopic color loss */ |
78 |
|
scotscan(scanbuf, scanlen(&inpres)); |
79 |
|
if (what2do&DO_LINEAR) /* map luminances */ |
84 |
|
mbscan(scanbuf, scanlen(&inpres), &mbcond); |
85 |
|
else if (lumf == cielum | inprims != outprims) |
86 |
|
matscan(scanbuf, scanlen(&inpres), mbcond.cmat); |
87 |
+ |
nread++; |
88 |
|
return(scanbuf); |
89 |
|
} |
90 |
|
|
99 |
|
comprgb2rgbmat(mbcond.cmat, inprims, outprims); |
100 |
|
else |
101 |
|
compxyz2rgbmat(mbcond.cmat, outprims); |
102 |
+ |
if (what2do&DO_ACUITY) { |
103 |
+ |
#ifdef DEBUG |
104 |
+ |
fprintf(stderr, "%s: initializing acuity sampling...", |
105 |
+ |
progname); |
106 |
+ |
#endif |
107 |
+ |
initacuity(); |
108 |
+ |
#ifdef DEBUG |
109 |
+ |
fprintf(stderr, "done\n"); |
110 |
+ |
#endif |
111 |
+ |
} |
112 |
|
scanbuf = (COLOR *)malloc(scanlen(&inpres)*sizeof(COLOR)); |
113 |
|
if (scanbuf == NULL) |
114 |
|
syserror("malloc"); |