IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 2088


Ignore:
Timestamp:
Oct 13, 2004, 12:05:03 PM (22 years ago)
Author:
desonia
Message:

misc fixes.

Location:
trunk/psLib/src/image
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/image/psImageExtraction.c

    r2074 r2088  
    99 *  @author Robert DeSonia, MHPCC
    1010 *
    11  *  @version $Revision: 1.23 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2004-10-13 02:40:13 $
     11 *  @version $Revision: 1.24 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2004-10-13 22:05:03 $
    1313 *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    508508                     float endCol,
    509509                     float endRow,
    510                      float nSamples,
     510                     unsigned int nSamples,
    511511                     psImageInterpolateMode mode)
    512512{
     
    538538                   PS_ERRORTEXT_psImage_LINE_NOT_IN_IMAGE,
    539539                   startCol,startRow,endCol,endRow,
    540                    numCols,numRows);
    541         psFree(out);
     540                   numCols-1,numRows-1);
     541        psFree(out);
     542        return NULL;
    542543    }
    543544
     
    548549                       PS_ERRORTEXT_psImage_IMAGE_MASK_SIZE,
    549550                       mask->numCols,mask->numRows,
    550                        numCols, numRows);
     551                       numCols-1, numRows);
    551552            psFree(out);
     553            return NULL;
    552554        }
    553555        if (mask->type.type != PS_TYPE_MASK) {
     
    559561                       typeStr, PS_TYPE_MASK_NAME);
    560562            psFree(out);
     563            return NULL;
    561564        }
    562565    }
     
    574577    }
    575578
    576     out = psVectorRecycle(out,nSamples,in->type.type);
    577 
    578     float dX = (endCol - startCol) / (nSamples-1);
    579     float dY = (endRow - startRow) / (nSamples-1);
    580 
    581     float x = startCol;
    582     float y = startRow;
     579    out = psVectorRecycle(out, nSamples, in->type.type);
     580
     581    float dX = (endCol - startCol) / (float)(nSamples-1);
     582    float dY = (endRow - startRow) / (float)(nSamples-1);
    583583
    584584    #define LINEAR_CUT_CASE(TYPE) \
     
    586586        ps##TYPE* outData = out->data.TYPE; \
    587587        for (int i = 0; i < nSamples; i++) { \
     588            float x = startCol + (float)i*dX; \
     589            float y = startRow + (float)i*dY; \
    588590            /* store off the location of the sample. */ \
    589591            if (cutColsData != NULL) { \
     
    594596            } \
    595597            outData[i] = psImagePixelInterpolate(in,x,y,mask,maskVal,0,mode); \
    596             x += dX; \
    597             y += dY; \
    598598        } \
    599599    } \
  • trunk/psLib/src/image/psImageExtraction.h

    r2067 r2088  
    1010*  @author Robert DeSonia, MHPCC
    1111*
    12 *  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2004-10-13 00:10:50 $
     12*  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2004-10-13 22:05:03 $
    1414*
    1515*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    166166    float endCol,                      ///< the column of the end of the cut line
    167167    float endRow,                      ///< the row of the end of the cut line
    168     float nSamples,                    ///< the number of samples along the cut
     168    unsigned int nSamples,             ///< the number of samples along the cut
    169169    psImageInterpolateMode mode        ///< the interpolation method to use
    170170);
Note: See TracChangeset for help on using the changeset viewer.