IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 18890


Ignore:
Timestamp:
Aug 4, 2008, 11:50:51 AM (18 years ago)
Author:
Paul Price
Message:

Bounds for iteration were broken: was getting SEGV when running with no threads.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pswarp/src/pswarpTransformTile.c

    r18839 r18890  
    3434    int outCol0 = args->output->image->col0;
    3535    int outRow0 = args->output->image->row0;
    36     // int outNcol = args->output->image->numCols;
    37     // int outNrow = args->output->image->numRows;
     36    int outNcol = args->output->image->numCols;
     37    int outNrow = args->output->image->numRows;
    3838
    3939    // get the coordinate range for this grid tile
     
    5656    psMaskType maskValue;
    5757
     58    // Bounds for iteration
     59    int xMin = PS_MAX(minPt.x, 0);
     60    int xMax = PS_MIN(maxPt.x, outNcol);
     61    int yMin = PS_MAX(minPt.y, 0);
     62    int yMax = PS_MIN(maxPt.y, outNrow);
     63
     64
    5865    // Iterate over the output image pixels (parent frame)
    5966    long goodPixels = 0;                // Number of input pixels landing on the output image
    60     for (int y = minPt.y; y < maxPt.y; y++) {
    61         for (int x = minPt.x; x < maxPt.x; x++) {
     67    for (int y = yMin; y < yMax; y++) {
     68        for (int x = xMin; x < xMax; x++) {
    6269
    6370            // Only transform those pixels requested
     
    6875            pswarpMapApply (&xInRaw, &yInRaw, map, x + 0.5, y + 0.5);
    6976
    70             double xIn = xInRaw - outCol0;      // Position on input image
    71             double yIn = yInRaw - outRow0;      // Position on input image
     77            double xIn = xInRaw - outCol0;      // Position on input image
     78            double yIn = yInRaw - outRow0;      // Position on input image
    7279
    7380            if (xIn < 0) continue;
     
    8592
    8693            int xOut = x - outCol0;     // Position on output image
    87             int yOut = y - outRow0;     // Position on output image
     94            int yOut = y - outRow0;     // Position on output image
    8895
    89             // not all images need be transformed
    90             if (outImageData) {
    91                 outImageData[yOut][xOut] = imageValue;
    92             }
     96            // not all images need be transformed
     97            if (outImageData) {
     98                outImageData[yOut][xOut] = imageValue;
     99            }
    93100            if (outVarData) {
    94101                outVarData[yOut][xOut] = varValue;
Note: See TracChangeset for help on using the changeset viewer.