IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

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

Updating following API change to psImagePixelInterpolate

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/imcombine/pmImageCombine.c

    r11115 r12742  
    88 *  @author GLG, MHPCC
    99 *
    10  *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2007-01-16 23:51:51 $
     10 *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2007-04-04 22:42:48 $
    1212 *
    1313 *  XXX: pmRejectPixels() has a known bug with the pmImageTransform() call.
     
    375375image, this routine determines the size of the input image which maps to that
    376376image, and returns the result in a psRegion struct.
    377  
     377
    378378XXX: Basically, this routine is only guaranteed to work if the transform is
    379379linear.
    380  
     380
    381381XXX: Shouldn't this functionality be part of psImageTransform()?
    382382 *****************************************************************************/
     
    491491pmRejectPixels(images, errors, inToOut, outToIn, rejThreshold,
    492492gradLimit)
    493  
     493
    494494XXX: Optimization: we don't need to transform the entire mask image.
    495495XXX: The inToOut and outToIn transforms are confusing.  Verify that what
     
    591591        // in other images.
    592592        //
     593
     594        psImageInterpolateOptions *interp = psImageInterpolateOptionsAlloc(PS_INTERPOLATE_BILINEAR,
     595                                                                           transformedImage, NULL, NULL,
     596                                                                           0, 0.0, 0.0, 0, 0, 0.0);
     597
    593598        for (psS32 p = 0 ; p < pixelList->n ; p++) {
    594599            inCoords->x = 0.5 + (psF32) (pixelList->data[p]).x;
    595600            inCoords->y = 0.5 + (psF32) (pixelList->data[p]).y;
    596601            psPlaneTransformApply(outCoords, myInToOut, inCoords);
    597             psF32 maskVal = (psF32) psImagePixelInterpolate(transformedImage, outCoords->x, outCoords->y,
    598                             NULL, 0, 0.0, PS_INTERPOLATE_BILINEAR);
     602            double maskVal;
     603            if (!psImageInterpolate(&maskVal, NULL, NULL, outCoords->x, outCoords->y, interp)) {
     604                psError(PS_ERR_UNKNOWN, false, "Unable to interpolate image.");
     605                psFree(interp);
     606                psFree(maskImage);
     607                psFree(maskImageF32);
     608                psFree(transformedImage);
     609                psFree(inCoords);
     610                psFree(outCoords);
     611                psFree(rejects);
     612                return NULL;
     613            }
    599614            if (maskVal > rejThreshold) {
    600615
     
    656671        }
    657672
     673        psFree(interp);
    658674        psFree(maskImage);
    659675        psFree(maskImageF32);
Note: See TracChangeset for help on using the changeset viewer.