Changeset 18890
- Timestamp:
- Aug 4, 2008, 11:50:51 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/pswarp/src/pswarpTransformTile.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pswarp/src/pswarpTransformTile.c
r18839 r18890 34 34 int outCol0 = args->output->image->col0; 35 35 int outRow0 = args->output->image->row0; 36 //int outNcol = args->output->image->numCols;37 //int outNrow = args->output->image->numRows;36 int outNcol = args->output->image->numCols; 37 int outNrow = args->output->image->numRows; 38 38 39 39 // get the coordinate range for this grid tile … … 56 56 psMaskType maskValue; 57 57 58 // Bounds for iteration 59 int xMin = PS_MAX(minPt.x, 0); 60 int xMax = PS_MIN(maxPt.x, outNcol); 61 int yMin = PS_MAX(minPt.y, 0); 62 int yMax = PS_MIN(maxPt.y, outNrow); 63 64 58 65 // Iterate over the output image pixels (parent frame) 59 66 long goodPixels = 0; // Number of input pixels landing on the output image 60 for (int y = minPt.y; y < maxPt.y; y++) {61 for (int x = minPt.x; x < maxPt.x; x++) {67 for (int y = yMin; y < yMax; y++) { 68 for (int x = xMin; x < xMax; x++) { 62 69 63 70 // Only transform those pixels requested … … 68 75 pswarpMapApply (&xInRaw, &yInRaw, map, x + 0.5, y + 0.5); 69 76 70 double xIn = xInRaw - outCol0; // Position on input image71 double yIn = yInRaw - outRow0;// Position on input image77 double xIn = xInRaw - outCol0; // Position on input image 78 double yIn = yInRaw - outRow0; // Position on input image 72 79 73 80 if (xIn < 0) continue; … … 85 92 86 93 int xOut = x - outCol0; // Position on output image 87 int yOut = y - outRow0;// Position on output image94 int yOut = y - outRow0; // Position on output image 88 95 89 // not all images need be transformed90 if (outImageData) {91 outImageData[yOut][xOut] = imageValue;92 }96 // not all images need be transformed 97 if (outImageData) { 98 outImageData[yOut][xOut] = imageValue; 99 } 93 100 if (outVarData) { 94 101 outVarData[yOut][xOut] = varValue;
Note:
See TracChangeset
for help on using the changeset viewer.
