Changeset 20665 for trunk/magic/remove/src/warpedpixels.c
- Timestamp:
- Nov 10, 2008, 4:27:30 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/magic/remove/src/warpedpixels.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/magic/remove/src/warpedpixels.c
r20573 r20665 33 33 } 34 34 35 bool writeTouchedPixels = false; 35 bool writeTouchedPixels = false; // XXX: make this an argument to the program 36 36 if (writeTouchedPixels) { 37 37 // write out the warped pixels … … 123 123 // Now set the touched pixels 124 124 int ymin = fmax(0, pt[1].y); 125 int ymax = fmin(pt[3].y , sf->warpedPixels->numRows);125 int ymax = fmin(pt[3].y + .5, sf->warpedPixels->numRows - 1); 126 126 #ifdef DEBUG_PRINT 127 127 printf("\nymin: %d ymax: %d\n", ymin, ymax); 128 128 #endif 129 for (int y = ymin ; y < ymax; y++) {129 for (int y = ymin ; y <= ymax; y++) { 130 130 int xleft = xLeft(pt, y); 131 131 int xright = xRight(pt, y); … … 177 177 x_d = xOfY(&pt[0], &pt[3], y); 178 178 } 179 return (int) x_d;179 return (int) (x_d + 0.5); 180 180 } 181 181 … … 266 266 /* find pt0 the left most (bottom most) corner */ 267 267 int imin = 0; 268 double min =pt[0].x;268 int min = (int) pt[0].x; 269 269 int i; 270 for (i= 0; i<4; i++) {271 doublex = pt[i].x;270 for (i=1; i<4; i++) { 271 int x = pt[i].x; 272 272 if ((x < min) || 273 273 ((x == min) && (pt[i].y < pt[imin].y))) { … … 285 285 imin = 0; 286 286 min = pt[0].y; 287 for (i= 0; i<3; i++) {288 doubley = pt[i].y;287 for (i=1; i<3; i++) { 288 int y = pt[i].y; 289 289 if ((y < min) || 290 290 ((y == min) && (pt[i].x > pt[imin].x)) ) {
Note:
See TracChangeset
for help on using the changeset viewer.
