| 149 |
|
/* improves saturated color rendering */ |
| 150 |
|
copycolor(gryc, col); |
| 151 |
|
for (i = 3; i--; ) |
| 152 |
< |
if (gryc[i] > cwhite[i]) |
| 153 |
< |
gryc[i] = cwhite[i]; |
| 154 |
< |
else if (gryc[i] < cblack[i]) |
| 155 |
< |
gryc[i] = cblack[i]; |
| 152 |
> |
if (gryc[i] > 1) |
| 153 |
> |
gryc[i] = 1; |
| 154 |
> |
else if (gryc[i] < 0) |
| 155 |
> |
gryc[i] = 0; |
| 156 |
|
return(bright(gryc)); |
| 157 |
|
} |
| 158 |
|
|
| 164 |
|
COLORMAT mat |
| 165 |
|
) |
| 166 |
|
{ |
| 167 |
– |
double gryv; |
| 168 |
– |
|
| 167 |
|
while (len--) { |
| 170 |
– |
gryv = greypoint(sl[0]); |
| 168 |
|
colortrans(sl[0], mat, sl[0]); |
| 169 |
< |
clipgamut(sl[0], gryv, CGAMUT, cblack, cwhite); |
| 169 |
> |
clipgamut(sl[0], greypoint(sl[0]), CGAMUT, cblack, cwhite); |
| 170 |
|
sl++; |
| 171 |
|
} |
| 172 |
|
} |
| 183 |
|
register int i, j; |
| 184 |
|
|
| 185 |
|
while (len--) { |
| 189 |
– |
d = greypoint(sl[0]); |
| 186 |
|
colortrans(sl[0], mb->cmat, sl[0]); |
| 187 |
< |
clipgamut(sl[0], d, CGAMUT, mb->cmin, mb->cmax); |
| 187 |
> |
clipgamut(sl[0], greypoint(sl[0]), CGAMUT, mb->cmin, mb->cmax); |
| 188 |
|
for (i = 0; i < 3; i++) { |
| 189 |
|
d = colval(sl[0],i); |
| 190 |
|
for (j = 0; j < 4 && mb->xa[i][j+1] <= d; j++) |
| 206 |
|
) |
| 207 |
|
{ |
| 208 |
|
int rval; |
| 213 |
– |
double gryv; |
| 209 |
|
|
| 210 |
|
while (len--) { |
| 216 |
– |
gryv = greypoint(sl[0]); |
| 211 |
|
rval = warp3d(sl[0], sl[0], wp); |
| 212 |
|
if (rval & W3ERROR) |
| 213 |
|
syserror("warp3d"); |
| 216 |
|
progname, cwarpfile); |
| 217 |
|
exit(1); |
| 218 |
|
} |
| 219 |
< |
clipgamut(sl[0], gryv, CGAMUT, cblack, cwhite); |
| 219 |
> |
clipgamut(sl[0], greypoint(sl[0]), CGAMUT, cblack, cwhite); |
| 220 |
|
sl++; |
| 221 |
|
} |
| 222 |
|
} |