| 10 |
|
|
| 11 |
|
#include "copyright.h" |
| 12 |
|
|
| 13 |
< |
#include "color.h" |
| 13 |
> |
#include <stdio.h> |
| 14 |
|
#include <string.h> |
| 15 |
+ |
#include "color.h" |
| 16 |
|
|
| 17 |
|
#define CEPS 1e-4 /* color epsilon */ |
| 18 |
|
|
| 178 |
|
vv = 1.; /* check each limit */ |
| 179 |
|
for (i = 0; i < 3; i++) |
| 180 |
|
if (gamut & CGAMUT_LOWER && col[i] < lower[i]) { |
| 181 |
< |
v = (lower[i]+CEPS - cgry[i])/(col[i] - cgry[i]); |
| 181 |
> |
v = (lower[i] - cgry[i])/(col[i] - cgry[i]); |
| 182 |
|
if (v < vv) vv = v; |
| 183 |
|
rflags |= CGAMUT_LOWER; |
| 184 |
|
} else if (gamut & CGAMUT_UPPER && col[i] > upper[i]) { |
| 185 |
< |
v = (upper[i]-CEPS - cgry[i])/(col[i] - cgry[i]); |
| 185 |
> |
v = (upper[i] - cgry[i])/(col[i] - cgry[i]); |
| 186 |
|
if (v < vv) vv = v; |
| 187 |
|
rflags |= CGAMUT_UPPER; |
| 188 |
|
} |