Changeset 15587
- Timestamp:
- Nov 11, 2007, 11:49:18 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/objects/pmModel.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/objects/pmModel.c
r15562 r15587 6 6 * @author EAM, IfA 7 7 * 8 * @version $Revision: 1.1 6$ $Name: not supported by cvs2svn $9 * @date $Date: 2007-11-1 0 01:09:20$8 * @version $Revision: 1.17 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2007-11-11 21:49:18 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 218 218 float yResidCenter = 0.0; 219 219 220 psImage *myRo = NULL; 221 psImage *myRx = NULL; 222 psImage *myRy = NULL; 220 223 psImageInterpolateOptions *Ro = NULL; 221 224 psImageInterpolateOptions *Rx = NULL; 222 225 psImageInterpolateOptions *Ry = NULL; 223 226 if (model->residuals && (mode & (PM_MODEL_OP_RES0 | PM_MODEL_OP_RES1))) { 224 Ro = psImageInterpolateOptionsAlloc( 225 PS_INTERPOLATE_BILINEAR, 226 model->residuals->Ro, NULL, mask, 0, 0.0, 0.0, 1, 0, 0.0); 227 Rx = psImageInterpolateOptionsAlloc( 228 PS_INTERPOLATE_BILINEAR, 229 model->residuals->Rx, NULL, NULL, 0, 0.0, 0.0, 1, 0, 0.0); 230 Ry = psImageInterpolateOptionsAlloc( 231 PS_INTERPOLATE_BILINEAR, 232 model->residuals->Ry, NULL, NULL, 0, 0.0, 0.0, 1, 0, 0.0); 227 // if the residual image and object image don't match, 228 // supply an appropriately overlapped residual image 229 psImage *inRo = model->residuals->Ro; 230 psImage *inRx = model->residuals->Rx; 231 psImage *inRy = model->residuals->Ry; 232 if ((image->numCols != inRo->numCols) || 233 (image->numRows != inRo->numRows)) { 234 myRo = psImageAlloc (image->numCols, image->numRows, PS_TYPE_F32); 235 myRx = psImageAlloc (image->numCols, image->numRows, PS_TYPE_F32); 236 myRy = psImageAlloc (image->numCols, image->numRows, PS_TYPE_F32); 237 dx = (int)(inRx->numCols / 2) - (xPos - image->col0); 238 dy = (int)(inRx->numCols / 2) - (xPos - image->col0); 239 for (int iy = 0; iy < myRo->numRows; iy++) { 240 int jy = iy + dy; 241 if ((jy < 0) || (jy >= inRo->numRows)) { 242 for (int ix = 0; ix < myRo->numCols; ix++) { 243 myRo->data.F32[iy][ix] = 0.0; 244 myRx->data.F32[iy][ix] = 0.0; 245 myRy->data.F32[iy][ix] = 0.0; 246 } 247 continue; 248 } 249 for (int ix = 0; ix < myRo->numCols; ix++) { 250 int jx = ix + dx; 251 if ((jx < 0) || (jx >= inRo->numCols)) { 252 myRo->data.F32[iy][ix] = 0.0; 253 myRx->data.F32[iy][ix] = 0.0; 254 myRy->data.F32[iy][ix] = 0.0; 255 } else { 256 myRo->data.F32[iy][ix] = inRo->data.F32[jy][jx]; 257 myRx->data.F32[iy][ix] = inRx->data.F32[jy][jx]; 258 myRy->data.F32[iy][ix] = inRy->data.F32[jy][jx]; 259 } 260 } 261 } 262 } else { 263 myRo = psMemIncrRefCounter (inRo); 264 myRx = psMemIncrRefCounter (inRx); 265 myRy = psMemIncrRefCounter (inRy); 266 } 267 268 Ro = psImageInterpolateOptionsAlloc(PS_INTERPOLATE_BILINEAR, myRo, NULL, mask, 0, 0.0, 0.0, 1, 0, 0.0); 269 Rx = psImageInterpolateOptionsAlloc(PS_INTERPOLATE_BILINEAR, myRx, NULL, NULL, 0, 0.0, 0.0, 1, 0, 0.0); 270 Ry = psImageInterpolateOptionsAlloc(PS_INTERPOLATE_BILINEAR, myRy, NULL, NULL, 0, 0.0, 0.0, 1, 0, 0.0); 233 271 234 272 xBin = model->residuals->xBin; … … 303 341 psFree(Rx); 304 342 psFree(Ry); 343 psFree(myRo); 344 psFree(myRx); 345 psFree(myRy); 305 346 psTrace("psModules.objects", 3, "---- %s(true) end ----\n", __func__); 306 347 return(true);
Note:
See TracChangeset
for help on using the changeset viewer.
