IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 21, 2006, 11:10:01 AM (20 years ago)
Author:
magnier
Message:

fixed some end-point errors with regions

File:
1 edited

Legend:

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

    r5676 r6941  
    88 *  @author Robert DeSonia, MHPCC
    99 *
    10  *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2005-12-05 21:05:20 $
     10 *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2006-04-21 21:10:01 $
    1212 *
    1313 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    3333    psS32 inputColOffset;       // offset in bytes to first subset pixel in input row
    3434
    35     if ( col0 < 0 || row0 < 0 ) {
     35    if ( col0 < image->col0 || row0 < image->row0 ) {
    3636        //        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
    3737        //                PS_ERRORTEXT_psImage_SUBSET_RANGE_INVALID);
     
    5656
    5757    if (col1 < 1) {
    58         col1 = image->numCols + col1;
     58        col1 = image->col0 + image->numCols + col1;
    5959    }
    6060    if (row1 < 1) {
    61         row1 = image->numRows + row1;
     61        row1 = image->row0 + image->numRows + row1;
    6262    }
    6363
    6464    if (    col1 <= col0 ||
    6565            row1 <= row0 ||
    66             col0 >= image->numCols ||
    67             row0 >= image->numRows ||
    68             col1 > image->numCols ||
    69             row1 > image->numRows ) {
     66            col0 >= image->col0 + image->numCols ||
     67            row0 >= image->row0 + image->numRows ||
     68            col1 > image->col0 + image->numCols ||
     69            row1 > image->row0 + image->numRows ) {
    7070        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
    7171                PS_ERRORTEXT_psImage_SUBSET_RANGE_INVALID,
     
    8383
    8484    if (image->parent != NULL) { // if this is a child, we need to start working with parent.
    85         col0 += image->col0;
    86         col1 += image->col0;
    87         row0 += image->row0;
    88         row1 += image->row0;
     85        // XXX EAM : we now treat the region as parent coordinates
     86        // col0 += image->col0;
     87        // col1 += image->col0;
     88        // row0 += image->row0;
     89        // row1 += image->row0;
    8990        image = (psImage*)image->parent;
    9091    }
Note: See TracChangeset for help on using the changeset viewer.