Changeset 21368 for trunk/pswarp/src/pswarpTransformTile.c
- Timestamp:
- Feb 5, 2009, 5:10:36 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/pswarp/src/pswarpTransformTile.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pswarp/src/pswarpTransformTile.c
r21323 r21368 6 6 * 7 7 * @author IfA 8 * @version $Revision: 1. 8$ $Name: not supported by cvs2svn $9 * @date $Date: 2009-02-0 5 20:44:04$8 * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2009-02-06 03:10:36 $ 10 10 * Copyright 2009 Institute for Astronomy, University of Hawaii 11 11 */ … … 20 20 psFree(args->interp); 21 21 psFree(args->region); 22 psFree(args->covariance); 22 23 return; 23 24 } … … 42 43 args->yMin = PS_MAX_S32; 43 44 args->yMax = PS_MIN_S32; 45 args->covariance = NULL; 44 46 45 47 return args; … … 60 62 // Dereference images for convenience 61 63 psF32 **outImageData = args->output->image->data.F32; 62 psF32 **outVarData = (args->output-> weight) ? args->output->weight->data.F32 : NULL;64 psF32 **outVarData = (args->output->variance) ? args->output->variance->data.F32 : NULL; 63 65 psImageMaskType **outMaskData = (args->output->mask) ? args->output->mask->data.PS_TYPE_IMAGE_MASK_DATA : NULL; 64 66 psImageMaskType **inMaskData = (args->input->mask) ? args->input->mask->data.PS_TYPE_IMAGE_MASK_DATA : NULL; … … 92 94 } 93 95 94 double imageValue, varValue; // Value of image and variance map95 96 96 // psImagePixelInterpolate determines the value at pixel coordinate (x,y) in child coordinates 97 double imageValue, varValue; // Value of image and variance map 97 98 psImageMaskType maskValue = inMaskData ? inMaskData[(int)yIn][(int)xIn] : 0; // Value of mask 98 99 99 if (!psImageInterpolate(&imageValue, &varValue, &maskValue, xIn, yIn, args->interp)) { 100 100 psError(PS_ERR_UNKNOWN, false, "Unable to interpolate image."); … … 118 118 } 119 119 120 if (goodPixels > 0) { 121 float xOut = 0.5 * (xMin + xMax), yOut = 0.5 * (yMin + yMax); // Position of interest on output 122 double xIn, yIn; // Position of interest on input 123 pswarpMapApply(&xIn, &yIn, map, xOut + 0.5, yOut + 0.5); 124 // XXX Why are we subtracting the *output* col0,row0 from the *input* coordinates? 125 // I expect these are zero, so that it makes no difference, but it's distracting. 126 xIn -= outCol0; 127 yIn -= outRow0; 128 psKernel *kernel = psImageInterpolationKernel(xIn, yIn, args->interp->mode); // Interpolation kernel 129 args->covariance = psImageCovarianceCalculate(kernel, args->input->covariance); 130 psFree(kernel); 131 } 132 120 133 args->goodPixels = goodPixels; 121 134 args->xMin = xMin;
Note:
See TracChangeset
for help on using the changeset viewer.
