Changeset 3161 for libpipi/trunk
- Timestamp:
- Oct 31, 2008, 1:21:32 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libpipi/trunk/pipi/quantize/reduce.c
r2905 r3161 89 89 int i, j, n; 90 90 91 debug("\n### NEW HULL ###\n\n"); 92 93 debug("Analysing %i colors\n", ncolors); 91 debug(""); 92 debug("### NEW HULL ###"); 93 debug(""); 94 95 debug("Analysing %i colors", ncolors); 94 96 95 97 for(i = 0; i < ncolors; i++) … … 98 100 pal[i][G] = palette[i * 3 + 1]; 99 101 pal[i][B] = palette[i * 3 + 2]; 100 debug(" [%i] (%g,%g,%g) \n", i, pal[i][R], pal[i][G], pal[i][B]);102 debug(" [%i] (%g,%g,%g)", i, pal[i][R], pal[i][G], pal[i][B]); 101 103 } 102 104 … … 123 125 gray[B] = light[B] - dark[B]; 124 126 125 debug(" gray axis (%g,%g,%g) - (%g,%g,%g) \n",127 debug(" gray axis (%g,%g,%g) - (%g,%g,%g)", 126 128 dark[R], dark[G], dark[B], light[R], light[G], light[B]); 127 129 … … 141 143 int npts = 0, left; 142 144 143 debug("Slice %i/%i \n", n, STEPS);145 debug("Slice %i/%i", n, STEPS); 144 146 145 147 p0[R] = dark[R] + t * gray[R]; … … 147 149 p0[B] = dark[B] + t * gray[B]; 148 150 149 debug(" 3D gray (%g,%g,%g) \n", p0[R], p0[G], p0[B]);151 debug(" 3D gray (%g,%g,%g)", p0[R], p0[G], p0[B]); 150 152 151 153 /* … … 274 276 275 277 for(i = 0; i < npts; i++) 276 debug(" 2D pt[%i] (%g,%g) \n", i, pts[i][X], pts[i][Y]);278 debug(" 2D pt[%i] (%g,%g)", i, pts[i][X], pts[i][Y]); 277 279 278 280 /* Compute the barycentre coordinates */ … … 317 319 } 318 320 319 debug(" 2D bary (%g,%g) \n", ctx, cty);321 debug(" 2D bary (%g,%g)", ctx, cty); 320 322 321 323 /* … … 336 338 ret->pts[n][i][A] = atan2(pts[i][Y] - cty, pts[i][X] - ctx); 337 339 338 debug(" 3D pt[%i] (%g,%g,%g) angle %g \n",340 debug(" 3D pt[%i] (%g,%g,%g) angle %g", 339 341 i, pts[i][R], pts[i][G], pts[i][B], ret->pts[n][i][A]); 340 342 } 341 343 ret->hullsize[n] = npts; 342 344 343 debug(" 3D bary (%g,%g,%g) \n",345 debug(" 3D bary (%g,%g,%g)", 344 346 ret->bary[n][R], ret->bary[n][G], ret->bary[n][B]); 345 347 } … … 373 375 */ 374 376 375 debug("\n### PROCESSING IMAGE ###\n\n"); 377 debug(""); 378 debug("### PROCESSING IMAGE ###"); 379 debug(""); 376 380 377 381 srcp = pipi_getpixels(src, PIPI_PIXELS_RGBA_F); … … 397 401 p[R] = srcdata[4 * (j * w + i) + 2]; 398 402 399 debug("Pixel +%i+%i (%g,%g,%g) \n", i, j, p[R], p[G], p[B]);403 debug("Pixel +%i+%i (%g,%g,%g)", i, j, p[R], p[G], p[B]); 400 404 401 405 slice = (int)(BRIGHT(p) * STEPS + 0.5); 402 406 403 debug(" slice %i \n", slice);407 debug(" slice %i", slice); 404 408 405 409 /* Convert to 2D. The origin is the slice's barycentre. */ … … 411 415 + (p[B] - rgbhull->bary[slice][B]) * v[B]; 412 416 413 debug(" 2D pt (%g,%g) \n", xp, yp);417 debug(" 2D pt (%g,%g)", xp, yp); 414 418 415 419 /* 1. find the excentricity in RGB space. There is an easier … … 447 451 t = 1.0; 448 452 449 debug(" best RGB %g (%g,%g) (%g,%g) \n", t, xa, ya, xb, yb);453 debug(" best RGB %g (%g,%g) (%g,%g)", t, xa, ya, xb, yb); 450 454 451 455 /* 2. apply the excentricity in reduced space. */ … … 475 479 s = (xp * (yb - ya) - yp * (xb - xa)) / (xa * yb - xb * ya); 476 480 477 debug(" best custom %g (%g,%g) (%g,%g) \n", s, xa, ya, xb, yb);481 debug(" best custom %g (%g,%g) (%g,%g)", s, xa, ya, xb, yb); 478 482 479 483 if(s > 0)
Note: See TracChangeset
for help on using the changeset viewer.