IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 6750 for trunk/psLib/src/types


Ignore:
Timestamp:
Mar 31, 2006, 4:43:57 PM (20 years ago)
Author:
drobbin
Message:

Made several changes to image functions/tests w.r.t. subimage v. parent image issue.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/types/psPixels.c

    r6500 r6750  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2006-02-28 02:53:03 $
     9 *  @version $Revision: 1.23 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2006-04-01 02:43:57 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    168168    float y1 = region.y1;
    169169
     170    if ( (x0 < 0 || x1 < 0) || (y0 < 0 || y1 < 0) ) {
     171        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
     172                PS_ERRORTEXT_psPixels_REGION_INVALID,
     173                (int)y0,(int)y1,(int)x0,(int)x1);
     174        psFree(out);
     175        return NULL;
     176    }
     177
    170178    // determine the output image size
    171179    int numRows = y1-y0;
    172180    int numCols = x1-x0;
     181    numRows += 1;
     182    numCols += 1;
    173183    if (numRows < 1 || numCols < 1) {
    174184        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
     
    205215        float y = data[p].y;
    206216        // pixel in region?
    207         if (x >= x0 && x < x1 && y >= y0 && y < y1) {
     217        if (x >= x0 && x <= x1 && y >= y0 && y <= y1) {
    208218            outData[(int)(y-y0)][(int)(x-x0)] |= maskVal;
    209219        }
Note: See TracChangeset for help on using the changeset viewer.