IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 4, 2006, 3:49:41 PM (20 years ago)
Author:
drobbin
Message:

Edited functions wrt subimage v parent image issue.

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

Legend:

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

    r6750 r6778  
    1010 *  @author Ross Harman, MHPCC
    1111 *
    12  *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2006-04-01 02:43:57 $
     12 *  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2006-04-05 01:49:40 $
    1414 *
    1515 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/src/imageops/psImagePixelExtract.c

    r6770 r6778  
    88 *  @author Robert DeSonia, MHPCC
    99 *
    10  *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2006-04-04 22:04:45 $
     10 *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2006-04-05 01:49:40 $
    1212 *
    1313 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    333333        return NULL;
    334334    }
    335     /*
    336         if (col1 < 1) {
    337             col1 += input->numCols;
    338         }
    339 
    340         if (row1 < 1) {
    341             row1 += input->numRows;
    342         }
    343 
    344         if (    col0 < 0 ||
    345                 row0 < 0 ||
    346                 col1 > input->numCols ||
    347                 row1 > input->numRows ||
    348                 col0 >= col1 ||
    349                 row0 >= row1) {
    350             psError(PS_ERR_BAD_PARAMETER_VALUE, true,
    351                     PS_ERRORTEXT_psImage_SUBSET_RANGE_INVALID,
    352                     col0, col1, row0, row1,
    353                     input->numCols, input->numRows);
    354             psFree(out);
    355             return NULL;
    356         }
    357     */
     335
    358336    //Make sure x0 of region is inside image.  If so, set col0 to corresponding index number.
    359337    if (col0 >= input->col0 && col0 < (input->col0 + input->numCols) ) {
     
    709687        return NULL;
    710688    }
    711     /*
    712         //Make sure x1 of region is valid.  If negative, index from tail (if valid).
    713         if (col1 < 0) {
    714             col1 += input->numCols;
    715             if (col1 < 0) {
    716                 psError(PS_ERR_BAD_PARAMETER_VALUE, true,
    717                         "Specified psRegion parameter, x1=%f=%f, is out of range [%d,%d].\n",
    718                         region.x1, col1+input->col0, input->col0, input->col0+input->numCols);
    719                 psFree(out);
    720                 return NULL;
    721             }
    722         } else if (col1 >= input->col0 && col1 < (input->col0 + input->numCols) ) {
    723             col1 -= input->col0;
    724         } else {
    725             psError(PS_ERR_BAD_PARAMETER_VALUE, true,
    726                     "Specified psRegion parameter, x1=%f=%f, is out of range [%d,%d].\n",
    727                     region.x1, col1, input->col0, input->col0+input->numCols);
    728             psFree(out);
    729             return NULL;
    730         }
    731         //Make sure y1 of region is valid.  If negative, index from tail (if valid).
    732         if (row1 < 0) {
    733             row1 += input->numRows;
    734             if (row1 < 0) {
    735                 psError(PS_ERR_BAD_PARAMETER_VALUE, true,
    736                         "Specified psRegion parameter, y1=%f=%f, is out of range [%d,%d].\n",
    737                         region.y1, row1+input->row0, input->row0, input->row0+input->numRows);
    738                 psFree(out);
    739                 return NULL;
    740             }
    741         } else if (row1 >= input->row0 && row1 < (input->row0 + input->numRows) ) {
    742             row1 -= input->row0;
    743         } else {
    744             psError(PS_ERR_BAD_PARAMETER_VALUE, true,
    745                     "Specified psRegion parameter, y1=%f=%f, is out of range [%d,%d].\n",
    746                     region.y1, row1, input->row0, input->row0+input->numRows);
    747             psFree(out);
    748             return NULL;
    749         }
    750     */
    751     /*    //Now make sure that the region makes sense.
    752         if (col0 > col1 || row0 > row1) {
    753             if (col0 > col1) {
    754                 psError(PS_ERR_BAD_PARAMETER_VALUE, true,
    755                         "Invalid psRegion specified.  x0=%f=%f is greater than x1=%f=%f.\n",
    756                         region.x0, col0, region.x1, col1);
    757             } else {
    758                 psError(PS_ERR_BAD_PARAMETER_VALUE, true,
    759                         "Invalid psRegion specified.  y0=%f=%f is greater than y1=%f=%f.\n",
    760                         region.y0, row0, region.y1, row1);
    761             }
    762             psFree(out);
    763             return NULL;
    764         } else if (col0 == col1 && row0 == row1) {
    765             psError(PS_ERR_BAD_PARAMETER_VALUE, true,
    766                     "Invalid psRegion specified.  Region contains only 1 pixel.\n");
    767             psFree(out);
    768             return NULL;
    769         }
    770     */
    771689    if (col1 < 0 || row1 < 0 || col0 < 0 || row0 < 0 || col0 >= numCols || col1 >= numCols ||
    772690            row0 >= numRows || row1 >= numRows) {
     
    778696    float endCol = col1;
    779697    float endRow = row1;
    780     /*
    781         float startCol = region.x0;
    782         float startRow = region.y0;
    783         float endCol = region.x1;
    784         float endRow = region.y1;
    785         if (startCol < 0 || startCol >= numCols ||
    786                 startRow < 0 || startRow >= numRows ||
    787                 endCol < 0 || endCol >= numCols ||
    788                 endRow < 0 || endRow >= numRows) {
    789             psError(PS_ERR_BAD_PARAMETER_VALUE, true,
    790                     PS_ERRORTEXT_psImage_LINE_NOT_IN_IMAGE,
    791                     startCol,startRow,endCol,endRow,
    792                     numCols-1,numRows-1);
    793             psFree(out);
    794             return NULL;
    795         }
    796     */
    797698
    798699    if (mode < PS_INTERPOLATE_FLAT ) {
  • trunk/psLib/src/imageops/psImageStats.c

    r6750 r6778  
    99 *  @author GLG, MHPCC
    1010 *
    11  *  @version $Revision: 1.91 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2006-04-01 02:43:57 $
     11 *  @version $Revision: 1.92 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2006-04-05 01:49:40 $
    1313 *
    1414 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    657657        }
    658658        region = psRegionForImage(mask, region);
    659      
     659
    660660        if (region.x0 == region.x1 || region.y0 == region.y1) {
    661661            psError(PS_ERR_BAD_PARAMETER_SIZE, true,
     
    670670    PS_ASSERT_INT_POSITIVE(mask->numRows, -1);
    671671
    672     /*    x0 = (int)(roundf(region.x0));
    673         x1 = (int)(roundf(region.x1));
    674         y0 = (int)(roundf(region.y0));
    675         y1 = (int)(roundf(region.y1));
    676     */
    677672    int col0 = (int)(roundf(region.x0));
    678673    int col1 = (int)(roundf(region.x1));
     
    753748        return -1;
    754749    }/* else if (col0 == col1 && row0 == row1) {
    755             psError(PS_ERR_BAD_PARAMETER_VALUE, true,
    756                     "Invalid psRegion specified.  Region contains only 1 pixel.\n");
    757             return -1;
    758         }
    759     */
     750                psError(PS_ERR_BAD_PARAMETER_VALUE, true,
     751                        "Invalid psRegion specified.  Region contains only 1 pixel.\n");
     752                return -1;
     753            }
     754        */
    760755    x0 = col0;
    761756    x1 = col1;
Note: See TracChangeset for help on using the changeset viewer.