IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 3, 2005, 4:34:58 PM (22 years ago)
Author:
desonia
Message:

added tests for psRegion functions.

File:
1 edited

Legend:

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

    r2762 r2879  
    99 *  @author Ross Harman, MHPCC
    1010 *
    11  *  @version $Revision: 1.55 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2004-12-20 21:39:42 $
     11 *  @version $Revision: 1.56 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2005-01-04 02:34:57 $
    1313 *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2323#include "psError.h"
    2424#include "psImage.h"
     25#include "psString.h"
    2526
    2627#include "psImageErrors.h"
     
    146147
    147148    return psRegionAlloc(col0,col1,row0,row1);
     149}
     150
     151char* psRegionToString(psRegion* region)
     152{
     153    char tmpText[256]; // big enough to store any region as text
     154
     155    if (region == NULL) {
     156        psError(PS_ERR_BAD_PARAMETER_NULL, true,
     157                PS_ERRORTEXT_psImage_REGION_NULL);
     158        return NULL;
     159    }
     160
     161    snprintf(tmpText,256,"[%g:%g,%g:%g]",
     162             region->x0, region->x1,
     163             region->y0, region->y1);
     164
     165    return psStringCopy(tmpText);
    148166}
    149167
Note: See TracChangeset for help on using the changeset viewer.