Changeset 17780
- Timestamp:
- May 23, 2008, 11:24:51 AM (18 years ago)
- Location:
- trunk/pswarp/src
- Files:
-
- 2 edited
-
pswarpPixelFraction.c (modified) (3 diffs)
-
pswarpTransformReadout_Opt.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pswarp/src/pswarpPixelFraction.c
r15610 r17780 39 39 long numPix = numCols * numRows; 40 40 41 // Range of valid pixels 42 int xMin = INT_MAX, xMax = -INT_MAX, yMin = INT_MAX, yMax = -INT_MAX; 43 41 44 long numBad = 0; // Number of bad pixels 42 45 for (int y = 0; y < numRows; y++) { … … 44 47 if (mask->data.PS_TYPE_MASK_DATA[y][x] & maskVal) { 45 48 numBad++; 49 } else { 50 if (y > yMax) { 51 yMax = y; 52 } 53 if (y < yMin) { 54 yMin = y; 55 } 56 if (x > xMax) { 57 xMax = x; 58 } 59 if (x < xMin) { 60 xMin = x; 61 } 46 62 } 47 63 } … … 53 69 if (stats) { 54 70 psMetadataAddBool(stats, PS_LIST_HEAD, "ACCEPT", 0, "Accept this readout?", accept); 71 72 psMetadataAddS32(stats, PS_LIST_TAIL, "RANGE.XMIN", 0, "Minimum valid x value", xMin); 73 psMetadataAddS32(stats, PS_LIST_TAIL, "RANGE.XMAX", 0, "Maximum valid x value", xMax); 74 psMetadataAddS32(stats, PS_LIST_TAIL, "RANGE.YMIN", 0, "Minimum valid y value", yMin); 75 psMetadataAddS32(stats, PS_LIST_TAIL, "RANGE.YMAX", 0, "Maximum valid y value", yMax); 55 76 } 56 77 -
trunk/pswarp/src/pswarpTransformReadout_Opt.c
r15334 r17780 97 97 nextGridX = nextGridXo; 98 98 map = grid->maps[gridX][gridY]; 99 int yOut = y - outRow0; // Position on image 99 100 for (int x = minX; x < maxX; x++) { 100 101 if (x >= nextGridX) { … … 127 128 psError(PS_ERR_UNKNOWN, false, "Unable to interpolate image."); 128 129 psFree(interp); 129 psFree (inPix);130 psFree (grid);130 psFree(inPix); 131 psFree(grid); 131 132 return false; 132 133 } 133 outImageData[y-outRow0][x-outCol0] = imageValue; 134 int xOut = x - outCol0; // Position on image 135 outImageData[yOut][xOut] = imageValue; 134 136 if (inVar) { 135 outVarData[y -outRow0][x-outCol0] = varValue;137 outVarData[yOut][xOut] = varValue; 136 138 } 137 139 if (outMaskData) { 138 outMaskData[y-outRow0][x-outCol0] = maskValue; 139 } 140 } 141 } 142 140 outMaskData[yOut][xOut] = maskValue; 141 } 142 } 143 } 143 144 psFree(interp); 144 psFree (inPix);145 psFree (grid);145 psFree(inPix); 146 psFree(grid); 146 147 147 148 // Transform sources
Note:
See TracChangeset
for help on using the changeset viewer.
