IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 12744 for trunk/stac/src


Ignore:
Timestamp:
Apr 4, 2007, 12:54:56 PM (19 years ago)
Author:
Paul Price
Message:

Updating following API change to psImagePixelInterpolate

Location:
trunk/stac/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/stac/src/stacRejection.c

    r9740 r12744  
    111111#endif
    112112
     113        psImageInterpolateOptions *interp = psImageInterpolateOptionsAlloc(PS_INTERPOLATE_BILINEAR,
     114                                                                           reject, NULL, NULL, 0, 0.0, 0.0,
     115                                                                           0, 0, 0.0);
     116
    113117        // Transform the mask
    114118        // Optimisation option is to only transform the pixels that have been rejected in the output,
     
    125129                    inCoords->y = (double)y + 0.5;
    126130                    (void)psPlaneTransformApply(outCoords, map, inCoords);
    127                     float maskVal = (float)psImagePixelInterpolate(reject, outCoords->x, outCoords->y,
    128                                                                    NULL, 0, 0.0, PS_INTERPOLATE_BILINEAR);
     131                    double maskVal;
     132                    if (!psImageInterpolate(&maskVal, NULL, NULL, outCoords->x, outCoords->y, interp)) {
     133                        psError(PS_ERR_UNKNOWN, false, "Unable to interpolate image.");
     134                        psFree(grads);
     135                        psFree(gradsMask);
     136                        psFree(inCoords);
     137                        psFree(outCoords);
     138                        return NULL;
     139                    }
     140
    129141#ifdef TESTING
    130142                    rejmap->data.F32[y][x] = maskVal;
  • trunk/stac/src/stacTransform.c

    r9740 r12744  
    193193        }
    194194
     195        psImageInterpolateOptions *interp = psImageInterpolateOptionsAlloc(PS_INTERPOLATE_BILINEAR,
     196                                                                           image, error, mask, 1, NAN, NAN,
     197                                                                           1, 0, 0.0);
     198
    195199        // Iterate over the output image pixels
    196200        for (int y = 0; y < outny; y++) {
     
    204208
    205209                    // Change PS_INTERPOLATE_BILINEAR to best available technique.
    206                     outImage->data.F32[y][x] = (psF32)psImagePixelInterpolate(image, detector->x,
    207                                                                               detector->y, mask, 1, NAN,
    208                                                                               PS_INTERPOLATE_BILINEAR);
     210                    double imageValue, varianceValue;
     211                    if (!psImageInterpolate(&imageValue, &varianceValue, NULL,
     212                                            detector->x, detector->y, interp)) {
     213                        psError(PS_ERR_UNKNOWN, false, "Unable to interpolate image.");
     214                        psFree(interp);
     215                        psFree(detector);
     216                        psFree(sky);
     217                        return false;
     218                    }
     219                    outImage->data.F32[y][x] = imageValue;
     220
    209221                    if (error) {
    210222                        // Error is actually the variance
    211                         outError->data.F32[y][x] = (psF32)p_psImageErrorInterpolateBILINEAR_F32(error,
    212                                                                                                 detector->x,
    213                                                                                                 detector->y,
    214                                                                                                 mask, 1, NAN);
     223                        outError->data.F32[y][x] = varianceValue;
    215224                    }
    216225
     
    224233            }
    225234        } // Iterating over output pixels
     235        psFree(interp);
    226236
    227237    } // Iterating over images
Note: See TracChangeset for help on using the changeset viewer.