IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 1929 for trunk/psLib/src/image


Ignore:
Timestamp:
Sep 29, 2004, 10:17:58 AM (22 years ago)
Author:
desonia
Message:

changes associated with the testing of psImageSubsection.

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

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/image/psImageErrors.dat

    r1918 r1929  
    1414psImage_INTERPOLATE_METHOD_INVALID     Specified interpolation method (%d) is not supported.
    1515psImage_SUBSET_RANGE_INVALID           Specified subset range, [%d:%d,%d:%d], is invalid or outside input psImage's boundaries, [0:%d,0:%d].
     16psImage_SUBSET_RANGE_MALFORMED         Specified subset range, [%d:%d,%d:%d], is invalid.  Ranges must be incremental.
    1617psImage_SUBSECTION_NULL                Specified subsection string can not be NULL.
    1718psImage_SUBSECTION_INVALID             Specified subsection string, '%s', can not be parsed.  Must be in the form '[x1:x2,y1:y2]'.
  • trunk/psLib/src/image/psImageErrors.h

    r1918 r1929  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2004-09-28 02:27:58 $
     9 *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2004-09-29 20:17:58 $
    1111 *
    1212 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3636#define PS_ERRORTEXT_psImage_INTERPOLATE_METHOD_INVALID "Specified interpolation method (%d) is not supported."
    3737#define PS_ERRORTEXT_psImage_SUBSET_RANGE_INVALID "Specified subset range, [%d:%d,%d:%d], is invalid or outside input psImage's boundaries, [0:%d,0:%d]."
     38#define PS_ERRORTEXT_psImage_SUBSET_RANGE_MALFORMED "Specified subset range, [%d:%d,%d:%d], is invalid.  Ranges must be incremental."
    3839#define PS_ERRORTEXT_psImage_SUBSECTION_NULL "Specified subsection string can not be NULL."
    3940#define PS_ERRORTEXT_psImage_SUBSECTION_INVALID "Specified subsection string, '%s', can not be parsed.  Must be in the form '[x1:x2,y1:y2]'."
  • trunk/psLib/src/image/psImageExtraction.c

    r1924 r1929  
    99 *  @author Robert DeSonia, MHPCC
    1010 *
    11  *  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2004-09-29 01:10:27 $
     11 *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2004-09-29 20:17:58 $
    1313 *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    6565                   PS_ERR_BAD_PARAMETER_VALUE, true,
    6666                   PS_ERRORTEXT_psImage_SUBSET_RANGE_INVALID,
    67                    col0, col1, row0, row1,
    68                    image->numCols, image->numRows);
     67                   col0, col1-1, row0, row1-1,
     68                   image->numCols-1, image->numRows-1);
    6969        return NULL;
    7070    }
     
    166166        return NULL;
    167167    }
    168     return imageSubset(NULL,image,col0,row0,col1,row1);
     168
     169    if (col0 > col1 || row0 > row1) {
     170        psErrorMsg(PS_ERRORNAME_DOMAIN "psImageSubsection",
     171                   PS_ERR_BAD_PARAMETER_VALUE, true,
     172                   PS_ERRORTEXT_psImage_SUBSET_RANGE_MALFORMED,
     173                   col0,col1,row0,row1);
     174        return NULL;
     175    }
     176
     177    return imageSubset(NULL,image,col0,row0,col1+1,row1+1);
    169178}
    170179
Note: See TracChangeset for help on using the changeset viewer.