IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 31, 2006, 4:43:57 PM (20 years ago)
Author:
drobbin
Message:

Made several changes to image functions/tests w.r.t. subimage v. parent image issue.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/mathtypes/psImage.c

    r6631 r6750  
    99 *  @author Ross Harman, MHPCC
    1010 *
    11  *  @version $Revision: 1.99 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2006-03-17 20:38:19 $
     11 *  @version $Revision: 1.100 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2006-04-01 02:43:57 $
    1313 *
    1414 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    173173{
    174174
    175     if (image == NULL) {
    176         return in;
     175    //    if (image == NULL) {
     176    //        return in;
     177    //    }
     178    PS_ASSERT_IMAGE_NON_NULL(image, in);
     179    //if the region is [0,0,0,0], the whole image (or subimage) is to be included.
     180    if (in.x0 == 0 && in.x1 == 0 && in.y0 == 0 && in.y1 == 0) {
     181        in.x0 = image->col0;
     182        in.x1 = image->col0 + image->numCols - 1;
     183        in.y0 = image->row0;
     184        in.y1 = image->row0 + image->numRows - 1;
     185        return (in);
    177186    }
    178187
     
    195204    // flip start and end if out of order
    196205    if (in.x0 > in.x1) {
     206        psError (PS_ERR_BAD_PARAMETER_VALUE, true,
     207                 "Invalid region in psRegionForImage.  x0 > x1.  Values have been swapped.\n");
    197208        PS_SWAP (in.x0, in.x1);
    198209    }
    199210    if (in.y0 > in.y1) {
     211        psError (PS_ERR_BAD_PARAMETER_VALUE, true,
     212                 "Invalid region in psRegionForImage.  y0 > y1.  Values have been swapped.\n");
    200213        PS_SWAP (in.y0, in.y1);
    201214    }
     
    717730{
    718731
    719     if (input == NULL) {
    720         psError(PS_ERR_BAD_PARAMETER_NULL,true,
    721                 PS_ERRORTEXT_psImage_IMAGE_NULL);
    722         return unexposedValue;
     732    /*    if (input == NULL) {
     733            psError(PS_ERR_BAD_PARAMETER_NULL,true,
     734                    PS_ERRORTEXT_psImage_IMAGE_NULL);
     735            return unexposedValue;
     736        }
     737    */
     738    PS_ASSERT_IMAGE_NON_NULL(input, unexposedValue);
     739    if (input->row0 != 0 || input->col0 != 0) {
     740        x += input->col0;
     741        y += input->row0;
    723742    }
    724743
Note: See TracChangeset for help on using the changeset viewer.