IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 26, 2009, 8:40:07 PM (17 years ago)
Author:
eugene
Message:

incorporating changes from 16bit mask upgrades (eam_branch_20081230)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/imageops/psImageInterpolate.c

    r20758 r21183  
    77 *  @author Paul Price, IfA
    88 *
    9  *  @version $Revision: 1.30 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2008-11-15 03:09:34 $
     9 *  @version $Revision: 1.31 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2009-01-27 06:39:37 $
    1111 *
    1212 *  Copyright 2004-2007 Institute for Astronomy, University of Hawaii
     
    205205psImageInterpolation *psImageInterpolationAlloc(psImageInterpolateMode mode,
    206206                                                const psImage *image, const psImage *variance,
    207                                                 const psImage *mask, psMaskType maskVal,
     207                                                const psImage *mask, psImageMaskType maskVal,
    208208                                                double badImage, double badVariance,
    209                                                 psMaskType badMask, psMaskType poorMask,
     209                                                psImageMaskType badMask, psImageMaskType poorMask,
    210210                                                float poorFrac, int numKernels)
    211211{
     
    274274// Interpolation engine for flat mode (nearest pixel)
    275275static inline psImageInterpolateStatus interpolateFlat(double *imageValue, double *varianceValue,
    276                                                        psMaskType *maskValue, float x, float y,
     276                                                       psImageMaskType *maskValue, float x, float y,
    277277                                                       const psImageInterpolation *interp)
    278278{
     
    331331        if (maskValue) {
    332332            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];
    334334            } else {
    335335                *maskValue = 0;
     
    456456// Interpolation engine for separable interpolation kernels
    457457static psImageInterpolateStatus interpolateSeparable(double *imageValue, double *varianceValue,
    458                                                      psMaskType *maskValue, float x, float y,
     458                                                     psImageMaskType *maskValue, float x, float y,
    459459                                                     const psImageInterpolation *interp)
    460460{
     
    465465    const psImage *mask = interp->mask; // Image mask
    466466    const psImage *variance = interp->variance; // Image variance
    467     psMaskType maskVal = interp->maskVal; // Value to mask
     467    psImageMaskType maskVal = interp->maskVal; // Value to mask
    468468    bool wantVariance = variance && varianceValue; // Does the user want the variance value?
    469469    bool haveMask = mask && maskVal; // Does the user want the variance value?
     
    582582                  const ps##TYPE *imageData = &image->data.TYPE[yPix][xMin]; \
    583583                  const ps##TYPE *varianceData = &variance->data.TYPE[yPix][xMin]; \
    584                   const psMaskType *maskData = &mask->data.PS_TYPE_MASK_DATA[yPix][xMin]; \
     584                  const psImageMaskType *maskData = &mask->data.PS_TYPE_IMAGE_MASK_DATA[yPix][xMin]; \
    585585                  const psF32 *xKernelData = xKernel; \
    586586                  const psF32 *xKernel2Data = xKernel2; \
     
    642642              /* Dereferenced versions of inputs */ \
    643643              const ps##TYPE *imageData = &image->data.TYPE[yPix][xMin]; \
    644               const psMaskType *maskData = &mask->data.PS_TYPE_MASK_DATA[yPix][xMin]; \
     644              const psImageMaskType *maskData = &mask->data.PS_TYPE_IMAGE_MASK_DATA[yPix][xMin]; \
    645645              const psF32 *xKernelData = xKernel; \
    646646              const psF32 *xKernel2Data = xKernel2; \
     
    713713// Interpolation engine for (separable) interpolation kernels
    714714static psImageInterpolateStatus interpolateKernel(double *imageValue, double *varianceValue,
    715                                                   psMaskType *maskValue, float x, float y,
     715                                                  psImageMaskType *maskValue, float x, float y,
    716716                                                  const psImageInterpolation *interp)
    717717{
     
    722722    const psImage *mask = interp->mask; // Image mask
    723723    const psImage *variance = interp->variance; // Image variance
    724     psMaskType maskVal = interp->maskVal; // Value to mask
     724    psImageMaskType maskVal = interp->maskVal; // Value to mask
    725725    bool wantVariance = variance && varianceValue; // Does the user want the variance value?
    726726    bool haveMask = mask && maskVal; // Does the user want the variance value?
     
    790790                      float kernelValue = kernel[j][i]; /* Value of kernel */ \
    791791                      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) { \
    793793                          sumBad += kernelValue2; \
    794794                      } else { \
     
    820820                  float kernelValue = kernel[j][i]; /* Value of kernel */ \
    821821                  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) { \
    823823                      sumBad += kernelValue2; \
    824824                  } else { \
     
    866866
    867867
    868 psImageInterpolateStatus psImageInterpolate(double *imageValue, double *varianceValue, psMaskType *maskValue,
     868psImageInterpolateStatus psImageInterpolate(double *imageValue, double *varianceValue, psImageMaskType *maskValue,
    869869                                            float x, float y, const psImageInterpolation *interp)
    870870{
     
    885885    if (maskValue && mask) {
    886886        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);
    888888        psAssert(image->numCols == mask->numCols && image->numRows == mask->numRows, "Image and mask sizes");
    889889    }
Note: See TracChangeset for help on using the changeset viewer.