- Timestamp:
- Sep 14, 2012, 6:10:32 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/czw_branch/20120906/pswarp/src/pswarpTransformTile.c
r29331 r34442 83 83 // Iterate over the output image pixels (parent frame) 84 84 long goodPixels = 0; ///< Number of input pixels landing on the output image 85 psTrace("pswarp",3,"Size: %d %d\n",xMax,yMax); 85 86 for (int y = yMin; y < yMax; y++) { 86 87 for (int x = xMin; x < xMax; x++) { 88 /* if ((x == 931)||(x == 717)||(x == 924)) { */ 89 /* /\* if ((y == 1348)||(y == 1249)||(y == 1081)) { *\/ */ 90 /* /\* fprintf(stderr,"BEcause: %d %d [%d %d %d %d]\n",x,y,yMin,yMax,xMin,xMax); *\/ */ 91 /* /\* } *\/ */ 92 /* } */ 93 if (((x == 931)&&(y == 1348))|| 94 ((x == 717)&&(y == 1249))|| 95 ((x == 924)&&(y == 1081))) { 96 psTrace("pswarp",3,"TT: A\n"); 97 psTrace("pswarp",3,"TT: %d %d %d %d\n",xMin,xMax,yMin,yMax); 98 99 } 87 100 88 101 // Only transform those pixels requested … … 90 103 continue; 91 104 } 105 if (((x == 931)&&(y == 1348))|| 106 ((x == 717)&&(y == 1249))|| 107 ((x == 924)&&(y == 1081))) { 108 psTrace("pswarp",3,"TT: B\n"); 109 psTrace("pswarp",3,"TT: %d %d %d %d\n",xMin,xMax,yMin,yMax); 110 111 } 92 112 93 113 // pswarpMapApply converts the output coordinate (x,y) to the input coordinate. … … 95 115 double xIn, yIn; // Input pixel coordinates 96 116 pswarpMapApply(&xIn, &yIn, map, x + 0.5, y + 0.5); 117 if (((x == 931)&&(y == 1348))|| 118 ((x == 717)&&(y == 1249))|| 119 ((x == 924)&&(y == 1081))) { 120 psTrace("pswarp",3,"TT: Ct\n"); 121 psTrace("pswarp",3,"TT: %d %d %d %d %g %g %d %d\n",xMin,xMax,yMin,yMax,xIn,yIn,inNumCols,inNumRows); 122 123 } 124 97 125 if (xIn < 0 || xIn >= inNumCols || yIn < 0 || yIn >= inNumRows) { 98 126 continue; 99 127 } 128 if (((x == 931)&&(y == 1348))|| 129 ((x == 717)&&(y == 1249))|| 130 ((x == 924)&&(y == 1081))) { 131 psTrace("pswarp",3,"TT: C\n"); 132 psTrace("pswarp",3,"TT: %d %d %d %d\n",xMin,xMax,yMin,yMax); 133 134 } 100 135 101 136 // psImagePixelInterpolate determines the value at pixel coordinate (x,y) in child coordinates … … 109 144 int xOut = x - outCol0, yOut = y - outRow0; ///< Position on output image 110 145 146 if ((xIn >= args->interp->image->numCols - 1)|| 147 (yIn >= args->interp->image->numRows - 1)) { 148 imageValue = NAN; 149 } 111 150 if (outImageData) { 112 151 outImageData[yOut][xOut] = imageValue * jacobian; … … 120 159 121 160 goodPixels++; 161 162 if ((x == 931)||(x == 717)||(x == 924)) { 163 if ((y == 1348)||(y == 1249)||(y == 1081)) { 164 psTrace("pswarp",3,"TT: %d %d %g %g %d %d %g %g (%g) %ld %g %g %g %g\n",x,y,xIn,yIn,xOut,yOut,imageValue,jacobian, 165 args->input->image->data.F32[(int) yIn][(int) xIn],(long) args->interp, 166 0.0,0.0,0.0,0.0); 167 /* inImage->data.F32[(int) yIn][(int) xIn], */ 168 /* inImage->data.F32[(int) yIn+1][(int) xIn], */ 169 /* inImage->data.F32[(int) yIn+1][(int) xIn+1], */ 170 /* inImage->data.F32[(int) yIn][(int) xIn+1]); */ 171 psTrace("pswarp",3,"TT: %d %d %d %d\n",xMin,xMax,yMin,yMax); 172 } 173 } 174 175 if (((xOut == 931)&&(yOut == 1348))|| 176 ((xOut == 717)&&(yOut == 1249))|| 177 ((xOut == 924)&&(yOut == 1081))) { 178 psTrace("pswarp",3,"TT: %d %d %g %g %d %d %g %g (%g) %ld %g %g %g %g\n",x,y,xIn,yIn,xOut,yOut,imageValue,jacobian, 179 args->input->image->data.F32[(int) yIn][(int) xIn],(long) args->interp, 180 0.0,0.0,0.0,0.0); 181 /* inImage->data.F32[(int) yIn][(int) xIn], */ 182 /* inImage->data.F32[(int) yIn+1][(int) xIn], */ 183 /* inImage->data.F32[(int) yIn+1][(int) xIn+1], */ 184 /* inImage->data.F32[(int) yIn][(int) xIn+1]); */ 185 psTrace("pswarp",3,"TT: %d %d %d %d\n",xMin,xMax,yMin,yMax); 186 187 } 188 if ((xOut == 443)&&(yOut == 659)) { 189 psTrace("pswarp",3,"TT: %d %d %g %g %d %d %g %g (%g) %ld\n",x,y,xIn,yIn,xOut,yOut,imageValue,jacobian, 190 args->input->image->data.F32[(int) yIn][(int) xIn],(long) args->interp); 191 psTrace("pswarp",3,"TT: %d %d %d %d\n",xMin,xMax,yMin,yMax); 192 193 } 194 if ((xOut == 524)&&(yOut == 576)) { 195 psTrace("pswarp",3,"TT: %d %d %g %g %d %d %g %g (%g) %ld\n",x,y,xIn,yIn,xOut,yOut,imageValue,jacobian, 196 args->input->image->data.F32[(int) yIn][(int) xIn],(long) args->interp); 197 psTrace("pswarp",3,"TT: %d %d %d %d\n",xMin,xMax,yMin,yMax); 198 199 } 122 200 } 123 201 }
Note:
See TracChangeset
for help on using the changeset viewer.
