IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 5, 2006, 6:12:27 PM (20 years ago)
Author:
drobbin
Message:

Made some changes for subimages issue and region issues.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/imageops/psImagePixelExtract.c

    r6778 r6805  
    88 *  @author Robert DeSonia, MHPCC
    99 *
    10  *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2006-04-05 01:49:40 $
     10 *  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2006-04-06 04:12:27 $
    1212 *
    1313 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    351351                region.y0, input->row0, input->row0+input->numRows-1);
    352352        return NULL;
     353    }
     354
     355    //If [0,0,0,0] specified, the whole image is to be included
     356    if (row0 == 0 && col0 == 0 && row1 == 0 && col1 == 0) {
     357        row0 = input->row0;
     358        col0 = input->col0;
     359        row1 = input->row0 + input->numRows;
     360        col1 = input->col0 + input->numCols;
    353361    }
    354362
     
    667675    float row1 = region.y1;
    668676
     677    //If [0,0,0,0] specified, the whole image is to be included
     678    if (row0 == 0 && col0 == 0 && row1 == 0 && col1 == 0) {
     679        row0 = input->row0;
     680        col0 = input->col0;
     681        row1 = input->row0 + input->numRows;
     682        col1 = input->col0 + input->numCols;
     683    }
     684
    669685    //Make sure x0 of region is inside image.  If so, set col0 to corresponding index number.
    670686    if (col0 >= input->col0 && col0 < (input->col0 + input->numCols) ) {
     
    831847    }
    832848
    833     if (x < 0 || x >= numCols ||
    834             y < 0 || y >= numRows) {
     849    //    if (x < 0 || x >= numCols ||
     850    //            y < 0 || y >= numRows) {
     851    if (x < input->col0 || x >= (input->col0 + numCols) ||
     852            y < input->row0 || y >= (input->row0 + numRows) ) {
    835853        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
    836854                PS_ERRORTEXT_psImage_CENTER_NOT_IN_IMAGE,
Note: See TracChangeset for help on using the changeset viewer.