| 1 |
< |
/* Copyright (c) 1996 Regents of the University of California */ |
| 1 |
> |
/* Copyright (c) 1997 Regents of the University of California */ |
| 2 |
|
|
| 3 |
|
#ifndef lint |
| 4 |
|
static char SCCSid[] = "$SunId$ LBL"; |
| 21 |
|
char *mbcalfile = NULL; /* macbethcal mapping file */ |
| 22 |
|
|
| 23 |
|
static struct mbc { |
| 24 |
– |
float xa[3][6], ya[3][6]; |
| 24 |
|
COLORMAT cmat; |
| 25 |
+ |
float xa[3][6], ya[3][6]; |
| 26 |
+ |
COLOR cmin, cmax; |
| 27 |
|
} mbcond; /* macbethcal conditioning struct */ |
| 28 |
|
|
| 29 |
|
static COLOR *scanbuf; /* scanline processing buffer */ |
| 127 |
|
{ |
| 128 |
|
while (len--) { |
| 129 |
|
colortrans(sl[0], mat, sl[0]); |
| 130 |
+ |
clipgamut(sl[0], bright(sl[0]), CGAMUT, cblack, cwhite); |
| 131 |
|
sl++; |
| 132 |
|
} |
| 133 |
|
} |
| 143 |
|
|
| 144 |
|
while (len--) { |
| 145 |
|
colortrans(sl[0], mb->cmat, sl[0]); |
| 146 |
+ |
clipgamut(sl[0], bright(sl[0]), CGAMUT, mb->cmin, mb->cmax); |
| 147 |
|
for (i = 0; i < 3; i++) { |
| 148 |
|
d = colval(sl[0],i); |
| 149 |
|
for (j = 0; j < 4 && mb->xa[i][j+1] <= d; j++) |
| 165 |
|
char buf[128]; |
| 166 |
|
FILE *fp; |
| 167 |
|
int inpflags = 0; |
| 168 |
+ |
register int i; |
| 169 |
|
|
| 170 |
|
if ((fp = fopen(fn, "r")) == NULL) |
| 171 |
|
syserror(fn); |
| 244 |
|
exit(1); |
| 245 |
|
} |
| 246 |
|
fclose(fp); |
| 247 |
+ |
/* compute gamut */ |
| 248 |
+ |
for (i = 0; i < 3; i++) { |
| 249 |
+ |
colval(mb->cmin,i) = mb->xa[i][0] - |
| 250 |
+ |
mb->ya[i][0] * |
| 251 |
+ |
(mb->xa[i][1]-mb->xa[i][0]) / |
| 252 |
+ |
(mb->ya[i][1]-mb->ya[i][0]); |
| 253 |
+ |
colval(mb->cmax,i) = mb->xa[i][4] + |
| 254 |
+ |
(1.-mb->ya[i][4]) * |
| 255 |
+ |
(mb->xa[i][5] - mb->xa[i][4]) / |
| 256 |
+ |
(mb->ya[i][5] - mb->ya[i][4]); |
| 257 |
+ |
} |
| 258 |
|
} |