Changeset 11254
- Timestamp:
- Jan 23, 2007, 5:00:22 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/camera/pmHDUGenerate.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/camera/pmHDUGenerate.c
r9986 r11254 272 272 // Paste the source image into the target, according to the provided region. The source is then updated to 273 273 // reference the region within the target. 274 static void pasteImage(psImage *target, // Target image, into which the paste is made 275 psImage **sourcePtr,// Source image, from which the paste is made, and then changed 276 psRegion *region // Image section into which to paste 277 ) 278 { 279 psImage *source = *sourcePtr; // Dereference pointer, for convenience 274 static psImage *pasteImage(psImage *target, // Target image, into which the paste is made 275 psImage *source,// Source image, from which the paste is made, and then changed 276 psRegion *region // Image section into which to paste 277 ) 278 { 280 279 if (source->numCols != region->x1 - region->x0 || source->numRows != region->y1 - region->y0) { 281 280 psString regionString = psRegionToString(*region); … … 287 286 288 287 // Reference the HDU version, so that subsequent changes will touch the HDU 289 psFree(source); 290 *sourcePtr = psImageSubset(target, *region); 291 292 return; 288 return psImageSubset(target, *region); 293 289 } 294 290 … … 404 400 405 401 if (readout->image) { 406 pasteImage(hduImages->data[i], &readout->image, trimsec); 402 psImage *new = pasteImage(hduImages->data[i], readout->image, trimsec); 403 psFree(readout->image); 404 readout->image = new; 407 405 } 408 406 if (readout->mask) { 409 pasteImage(hduMasks->data[i], &readout->mask, trimsec); 407 psImage *new = pasteImage(hduMasks->data[i], readout->mask, trimsec); 408 psFree(readout->mask); 409 readout->mask = new; 410 410 } 411 411 if (readout->weight) { 412 pasteImage(hduWeights->data[i], &readout->weight, trimsec); 412 psImage *new = pasteImage(hduWeights->data[i], readout->weight, trimsec); 413 psFree(readout->weight); 414 readout->weight = new; 413 415 } 414 416 … … 424 426 while ((bias = psListGetAndIncrement(biasIter)) && 425 427 (biassec = psListGetAndIncrement(biassecsIter))) { 426 p asteImage(hduImages->data[i], &bias, biassec);427 psListAdd(newBias, PS_LIST_TAIL, bias);428 psImage *new = pasteImage(hduImages->data[i], bias, biassec); 429 psListAdd(newBias, PS_LIST_TAIL, new); 428 430 } 429 431 psFree(biasIter);
Note:
See TracChangeset
for help on using the changeset viewer.
