|
|
@@ -21,7 +21,7 @@ |
|
|
|
#define BRIGHT(x) (0.299*(x)[0] + 0.587*(x)[1] + 0.114*(x)[2]) |
|
|
|
|
|
|
|
#define MAXCOLORS 16 |
|
|
|
#define STEPS 25 |
|
|
|
#define STEPS 256 |
|
|
|
#define EPSILON (0.000001) |
|
|
|
|
|
|
|
typedef struct |
|
|
@@ -213,9 +213,9 @@ static hull_t *compute_hull(int ncolors, double const *palette) |
|
|
|
* (pts[j + 1][Y] - pts[0][Y]); |
|
|
|
double k2 = (pts[j + 1][X] - pts[0][X]) |
|
|
|
* (pts[j][Y] - pts[0][Y]); |
|
|
|
if(k1 < k2) |
|
|
|
if(k1 < k2 - EPSILON) |
|
|
|
SWAP(pts[j], pts[j + 1]); |
|
|
|
else if(k1 == k2) |
|
|
|
else if(k1 < k2 + EPSILON) |
|
|
|
{ |
|
|
|
/* Aligned! keep the farthest point */ |
|
|
|
double ax = pts[j][X] - pts[0][X]; |
|
|
@@ -250,6 +250,7 @@ static hull_t *compute_hull(int ncolors, double const *palette) |
|
|
|
else |
|
|
|
i++; |
|
|
|
} |
|
|
|
/* FIXME: check the last point */ |
|
|
|
|
|
|
|
for(i = 0; i < npts; i++) |
|
|
|
debug(" 2D pt[%i] (%g,%g)\n", i, pts[i][X], pts[i][Y]); |
|
|
|