Changeset 21183 for trunk/psLib/src/imageops/psImageInterpolate.c
- Timestamp:
- Jan 26, 2009, 8:40:07 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/imageops/psImageInterpolate.c (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/imageops/psImageInterpolate.c
r20758 r21183 7 7 * @author Paul Price, IfA 8 8 * 9 * @version $Revision: 1.3 0$ $Name: not supported by cvs2svn $10 * @date $Date: 200 8-11-15 03:09:34$9 * @version $Revision: 1.31 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2009-01-27 06:39:37 $ 11 11 * 12 12 * Copyright 2004-2007 Institute for Astronomy, University of Hawaii … … 205 205 psImageInterpolation *psImageInterpolationAlloc(psImageInterpolateMode mode, 206 206 const psImage *image, const psImage *variance, 207 const psImage *mask, ps MaskType maskVal,207 const psImage *mask, psImageMaskType maskVal, 208 208 double badImage, double badVariance, 209 ps MaskType badMask, psMaskType poorMask,209 psImageMaskType badMask, psImageMaskType poorMask, 210 210 float poorFrac, int numKernels) 211 211 { … … 274 274 // Interpolation engine for flat mode (nearest pixel) 275 275 static inline psImageInterpolateStatus interpolateFlat(double *imageValue, double *varianceValue, 276 ps MaskType *maskValue, float x, float y,276 psImageMaskType *maskValue, float x, float y, 277 277 const psImageInterpolation *interp) 278 278 { … … 331 331 if (maskValue) { 332 332 if (interp->mask) { 333 *maskValue = interp->mask->data.PS_TYPE_ MASK_DATA[yInt][xInt];333 *maskValue = interp->mask->data.PS_TYPE_IMAGE_MASK_DATA[yInt][xInt]; 334 334 } else { 335 335 *maskValue = 0; … … 456 456 // Interpolation engine for separable interpolation kernels 457 457 static psImageInterpolateStatus interpolateSeparable(double *imageValue, double *varianceValue, 458 ps MaskType *maskValue, float x, float y,458 psImageMaskType *maskValue, float x, float y, 459 459 const psImageInterpolation *interp) 460 460 { … … 465 465 const psImage *mask = interp->mask; // Image mask 466 466 const psImage *variance = interp->variance; // Image variance 467 ps MaskType maskVal = interp->maskVal; // Value to mask467 psImageMaskType maskVal = interp->maskVal; // Value to mask 468 468 bool wantVariance = variance && varianceValue; // Does the user want the variance value? 469 469 bool haveMask = mask && maskVal; // Does the user want the variance value? … … 582 582 const ps##TYPE *imageData = &image->data.TYPE[yPix][xMin]; \ 583 583 const ps##TYPE *varianceData = &variance->data.TYPE[yPix][xMin]; \ 584 const ps MaskType *maskData = &mask->data.PS_TYPE_MASK_DATA[yPix][xMin]; \584 const psImageMaskType *maskData = &mask->data.PS_TYPE_IMAGE_MASK_DATA[yPix][xMin]; \ 585 585 const psF32 *xKernelData = xKernel; \ 586 586 const psF32 *xKernel2Data = xKernel2; \ … … 642 642 /* Dereferenced versions of inputs */ \ 643 643 const ps##TYPE *imageData = &image->data.TYPE[yPix][xMin]; \ 644 const ps MaskType *maskData = &mask->data.PS_TYPE_MASK_DATA[yPix][xMin]; \644 const psImageMaskType *maskData = &mask->data.PS_TYPE_IMAGE_MASK_DATA[yPix][xMin]; \ 645 645 const psF32 *xKernelData = xKernel; \ 646 646 const psF32 *xKernel2Data = xKernel2; \ … … 713 713 // Interpolation engine for (separable) interpolation kernels 714 714 static psImageInterpolateStatus interpolateKernel(double *imageValue, double *varianceValue, 715 ps MaskType *maskValue, float x, float y,715 psImageMaskType *maskValue, float x, float y, 716 716 const psImageInterpolation *interp) 717 717 { … … 722 722 const psImage *mask = interp->mask; // Image mask 723 723 const psImage *variance = interp->variance; // Image variance 724 ps MaskType maskVal = interp->maskVal; // Value to mask724 psImageMaskType maskVal = interp->maskVal; // Value to mask 725 725 bool wantVariance = variance && varianceValue; // Does the user want the variance value? 726 726 bool haveMask = mask && maskVal; // Does the user want the variance value? … … 790 790 float kernelValue = kernel[j][i]; /* Value of kernel */ \ 791 791 float kernelValue2 = PS_SQR(kernelValue); /* Square of kernel */ \ 792 if (mask->data.PS_TYPE_ MASK_DATA[yPix][xPix] & maskVal) { \792 if (mask->data.PS_TYPE_IMAGE_MASK_DATA[yPix][xPix] & maskVal) { \ 793 793 sumBad += kernelValue2; \ 794 794 } else { \ … … 820 820 float kernelValue = kernel[j][i]; /* Value of kernel */ \ 821 821 float kernelValue2 = PS_SQR(kernelValue); /* Square of kernel */ \ 822 if (mask->data.PS_TYPE_ MASK_DATA[yPix][xPix] & maskVal) { \822 if (mask->data.PS_TYPE_IMAGE_MASK_DATA[yPix][xPix] & maskVal) { \ 823 823 sumBad += kernelValue2; \ 824 824 } else { \ … … 866 866 867 867 868 psImageInterpolateStatus psImageInterpolate(double *imageValue, double *varianceValue, ps MaskType *maskValue,868 psImageInterpolateStatus psImageInterpolate(double *imageValue, double *varianceValue, psImageMaskType *maskValue, 869 869 float x, float y, const psImageInterpolation *interp) 870 870 { … … 885 885 if (maskValue && mask) { 886 886 PS_ASSERT_IMAGE_NON_NULL(mask, PS_INTERPOLATE_STATUS_ERROR); 887 PS_ASSERT_IMAGE_TYPE(mask, PS_TYPE_ MASK, PS_INTERPOLATE_STATUS_ERROR);887 PS_ASSERT_IMAGE_TYPE(mask, PS_TYPE_IMAGE_MASK, PS_INTERPOLATE_STATUS_ERROR); 888 888 psAssert(image->numCols == mask->numCols && image->numRows == mask->numRows, "Image and mask sizes"); 889 889 }
Note:
See TracChangeset
for help on using the changeset viewer.
