Changeset 12744 for trunk/stac/src
- Timestamp:
- Apr 4, 2007, 12:54:56 PM (19 years ago)
- Location:
- trunk/stac/src
- Files:
-
- 2 edited
-
stacRejection.c (modified) (2 diffs)
-
stacTransform.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/stac/src/stacRejection.c
r9740 r12744 111 111 #endif 112 112 113 psImageInterpolateOptions *interp = psImageInterpolateOptionsAlloc(PS_INTERPOLATE_BILINEAR, 114 reject, NULL, NULL, 0, 0.0, 0.0, 115 0, 0, 0.0); 116 113 117 // Transform the mask 114 118 // Optimisation option is to only transform the pixels that have been rejected in the output, … … 125 129 inCoords->y = (double)y + 0.5; 126 130 (void)psPlaneTransformApply(outCoords, map, inCoords); 127 float maskVal = (float)psImagePixelInterpolate(reject, outCoords->x, outCoords->y, 128 NULL, 0, 0.0, PS_INTERPOLATE_BILINEAR); 131 double maskVal; 132 if (!psImageInterpolate(&maskVal, NULL, NULL, outCoords->x, outCoords->y, interp)) { 133 psError(PS_ERR_UNKNOWN, false, "Unable to interpolate image."); 134 psFree(grads); 135 psFree(gradsMask); 136 psFree(inCoords); 137 psFree(outCoords); 138 return NULL; 139 } 140 129 141 #ifdef TESTING 130 142 rejmap->data.F32[y][x] = maskVal; -
trunk/stac/src/stacTransform.c
r9740 r12744 193 193 } 194 194 195 psImageInterpolateOptions *interp = psImageInterpolateOptionsAlloc(PS_INTERPOLATE_BILINEAR, 196 image, error, mask, 1, NAN, NAN, 197 1, 0, 0.0); 198 195 199 // Iterate over the output image pixels 196 200 for (int y = 0; y < outny; y++) { … … 204 208 205 209 // Change PS_INTERPOLATE_BILINEAR to best available technique. 206 outImage->data.F32[y][x] = (psF32)psImagePixelInterpolate(image, detector->x, 207 detector->y, mask, 1, NAN, 208 PS_INTERPOLATE_BILINEAR); 210 double imageValue, varianceValue; 211 if (!psImageInterpolate(&imageValue, &varianceValue, NULL, 212 detector->x, detector->y, interp)) { 213 psError(PS_ERR_UNKNOWN, false, "Unable to interpolate image."); 214 psFree(interp); 215 psFree(detector); 216 psFree(sky); 217 return false; 218 } 219 outImage->data.F32[y][x] = imageValue; 220 209 221 if (error) { 210 222 // Error is actually the variance 211 outError->data.F32[y][x] = (psF32)p_psImageErrorInterpolateBILINEAR_F32(error, 212 detector->x, 213 detector->y, 214 mask, 1, NAN); 223 outError->data.F32[y][x] = varianceValue; 215 224 } 216 225 … … 224 233 } 225 234 } // Iterating over output pixels 235 psFree(interp); 226 236 227 237 } // Iterating over images
Note:
See TracChangeset
for help on using the changeset viewer.
