|
|
@@ -154,7 +154,7 @@ static hull_t *compute_hull(int ncolors, double const *palette) |
|
|
|
for(i = 0; i < ncolors; i++) |
|
|
|
{ |
|
|
|
double k1[3]; |
|
|
|
double yk1; |
|
|
|
double yk1; |
|
|
|
k1[R] = pal[i][R] - p0[R]; |
|
|
|
k1[G] = pal[i][G] - p0[G]; |
|
|
|
k1[B] = pal[i][B] - p0[B]; |
|
|
@@ -170,7 +170,7 @@ static hull_t *compute_hull(int ncolors, double const *palette) |
|
|
|
double k2[3]; |
|
|
|
double yk2, s; |
|
|
|
|
|
|
|
if(i == j) |
|
|
|
if(i == j) |
|
|
|
continue; |
|
|
|
|
|
|
|
k2[R] = pal[j][R] - p0[R]; |
|
|
@@ -249,7 +249,7 @@ static hull_t *compute_hull(int ncolors, double const *palette) |
|
|
|
/* Remove points not in the convex hull */ |
|
|
|
for(i = 2; i < npts; /* */) |
|
|
|
{ |
|
|
|
double k1, k2; |
|
|
|
double k1, k2; |
|
|
|
|
|
|
|
if(i < 2) |
|
|
|
{ |
|
|
@@ -285,7 +285,7 @@ static hull_t *compute_hull(int ncolors, double const *palette) |
|
|
|
double aby = pts[i - 1][Y] - pts[0][Y]; |
|
|
|
double acx = pts[i][X] - pts[0][X]; |
|
|
|
double acy = pts[i][Y] - pts[0][Y]; |
|
|
|
double area; |
|
|
|
double area; |
|
|
|
double sqarea = (abx * abx + aby * aby) * (acx * acx + acy * acy) |
|
|
|
- (abx * acx + aby * acy) * (abx * acx + aby * acy); |
|
|
|
if(sqarea <= 0.) |
|
|
@@ -358,9 +358,9 @@ pipi_image_t *pipi_reduce(pipi_image_t *src, |
|
|
|
}; |
|
|
|
|
|
|
|
pipi_image_t *dst; |
|
|
|
pipi_pixels_t *srcp, *dstp; |
|
|
|
float *srcdata, *dstdata; |
|
|
|
hull_t *rgbhull, *myhull; |
|
|
|
pipi_pixels_t *srcp, *dstp; |
|
|
|
float *srcdata, *dstdata; |
|
|
|
hull_t *rgbhull, *myhull; |
|
|
|
int i, j, w, h; |
|
|
|
|
|
|
|
init_uv(); |
|
|
|