IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 6430


Ignore:
Timestamp:
Feb 15, 2006, 9:50:16 PM (20 years ago)
Author:
magnier
Message:

fixed image / subimage / region accounting by parent

Location:
branches/rel10_ifa/psLib/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/rel10_ifa/psLib/src/imageops/psImageStats.c

    r6346 r6430  
    99 *  @author GLG, MHPCC
    1010 *
    11  *  @version $Revision: 1.90 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2006-02-07 23:14:21 $
     11 *  @version $Revision: 1.90.4.1 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2006-02-16 07:50:03 $
    1313 *
    1414 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    649649    }
    650650
    651     x0 = (int)(roundf(region.x0));
    652     x1 = (int)(roundf(region.x1));
    653     y0 = (int)(roundf(region.y0));
    654     y1 = (int)(roundf(region.y1));
     651    x0 = (int)(roundf(region.x0)) - mask->col0;
     652    x1 = (int)(roundf(region.x1)) - mask->col0;
     653    y0 = (int)(roundf(region.y0)) - mask->row0;
     654    y1 = (int)(roundf(region.y1)) - mask->row0;
    655655
    656656    type = mask->type.type;
  • branches/rel10_ifa/psLib/src/imageops/psImageStructManip.c

    r5676 r6430  
    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.7.10.1 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2006-02-16 07:50:03 $
    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    }
  • branches/rel10_ifa/psLib/src/mathtypes/psImage.c

    r6331 r6430  
    99 *  @author Ross Harman, MHPCC
    1010 *
    11  *  @version $Revision: 1.95 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2006-02-06 22:19:28 $
     11 *  @version $Revision: 1.95.4.1 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2006-02-16 07:50:16 $
    1313 *
    1414 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    178178
    179179    // convert non-positive upper-limits
    180     in.x1 = (in.x1 <= 0) ? (image->numCols + in.x1) : in.x1;
    181     in.y1 = (in.y1 <= 0) ? (image->numRows + in.y1) : in.y1;
     180    // XXX note that the upper limit in these cases is defined relative to the subimage
     181    // also note that truncation limits to the valid subimage pixels
     182    in.x1 = (in.x1 <= 0) ? (image->col0 + image->numCols + in.x1) : in.x1;
     183    in.y1 = (in.y1 <= 0) ? (image->row0 + image->numRows + in.y1) : in.y1;
    182184
    183185    // force the upper-limits to be on the image
    184     in.x1 = PS_MIN(image->numCols, in.x1);
    185     in.y1 = PS_MIN(image->numRows, in.y1);
     186    in.x1 = PS_MIN(image->col0 + image->numCols, in.x1);
     187    in.y1 = PS_MIN(image->row0 + image->numRows, in.y1);
    186188
    187189    // force the lower-limits to be on the image
    188     in.x0 = PS_MAX(0, in.x0);
    189     in.y0 = PS_MAX(0, in.y0);
    190     in.x0 = PS_MIN(image->numCols, in.x0);
    191     in.y0 = PS_MIN(image->numRows, in.y0);
     190    in.x0 = PS_MAX(image->col0, in.x0);
     191    in.y0 = PS_MAX(image->row0, in.y0);
     192    in.x0 = PS_MIN(image->col0 + image->numCols, in.x0);
     193    in.y0 = PS_MIN(image->row0 + image->numRows, in.y0);
    192194
    193195    // flip start and end if out of order
Note: See TracChangeset for help on using the changeset viewer.