IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 6805


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

Made some changes for subimages issue and region issues.

Location:
trunk/psLib
Files:
2 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,
  • trunk/psLib/test/imageops/tst_psImageGeomManip.c

    r6767 r6805  
    66 *  @author Robert DeSonia, MHPCC
    77 *
    8  *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2006-04-04 19:52:54 $
     8 *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2006-04-06 04:12:27 $
    1010 *
    1111 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    10891089        }
    10901090    }
    1091 
     1091    in->col0 = 1;
    10921092    psImage* out = psImageTransform(NULL,
    10931093                                    NULL,
     
    10961096                                    0,
    10971097                                    trans,
    1098                                     psRegionSet(0,cols*2,0,rows*2),
     1098                                    psRegionSet(1,1+cols*2,0,rows*2),
    10991099                                    NULL,
    11001100                                    PS_INTERPOLATE_FLAT,
     
    11231123        for (psS32 col=0;col<cols;col++) {
    11241124            float inValue = p_psImagePixelInterpolateFLAT_F32(in,
    1125                             col*trans->x->coeff[1][0]+trans->x->coeff[0][0],
     1125                            col*trans->x->coeff[1][0]+trans->x->coeff[0][0]+1,
    11261126                            row*trans->y->coeff[0][1]+trans->y->coeff[0][0],
    11271127                            NULL, 0,
    11281128                            -1);
    1129             if (fabsf(outRow[col] - inValue) > FLT_EPSILON*10) {
     1129            if (fabsf(outRow[col] - inValue) > 0.01) {
    11301130                psError(PS_ERR_UNKNOWN, false,
    11311131                        "out at %d,%d was %g, expected %g",
Note: See TracChangeset for help on using the changeset viewer.