Index: trunk/psLib/src/image/psImage.c
===================================================================
--- trunk/psLib/src/image/psImage.c	(revision 2861)
+++ trunk/psLib/src/image/psImage.c	(revision 2879)
@@ -9,6 +9,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.55 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-12-20 21:39:42 $
+ *  @version $Revision: 1.56 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-01-04 02:34:57 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -23,4 +23,5 @@
 #include "psError.h"
 #include "psImage.h"
+#include "psString.h"
 
 #include "psImageErrors.h"
@@ -146,4 +147,21 @@
 
     return psRegionAlloc(col0,col1,row0,row1);
+}
+
+char* psRegionToString(psRegion* region)
+{
+    char tmpText[256]; // big enough to store any region as text
+
+    if (region == NULL) {
+        psError(PS_ERR_BAD_PARAMETER_NULL, true,
+                PS_ERRORTEXT_psImage_REGION_NULL);
+        return NULL;
+    }
+
+    snprintf(tmpText,256,"[%g:%g,%g:%g]",
+             region->x0, region->x1,
+             region->y0, region->y1);
+
+    return psStringCopy(tmpText);
 }
 
Index: trunk/psLib/src/image/psImage.h
===================================================================
--- trunk/psLib/src/image/psImage.h	(revision 2861)
+++ trunk/psLib/src/image/psImage.h	(revision 2879)
@@ -11,6 +11,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.43 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-11-16 20:00:21 $
+ *  @version $Revision: 1.44 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-01-04 02:34:57 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -103,10 +103,10 @@
 );
 
-/** Create an image of the specified size and type.
- *
- * Uses psLib memory allocation functions to create an image struct of the
- * specified size and type.
- *
- * @return psImage* : Pointer to psImage.
+/** Create a psRegion with the specified attributes.
+ *
+ * Uses psLib memory allocation functions to create a psRegion the
+ * specified x0, x1, y0, and y1.
+ *
+ * @return psRegion* : Pointer to psRegion.
  *
  */
@@ -118,6 +118,22 @@
 );
 
+/** Create a psRegion with the attribute values given as a string.
+ *
+ *  Create a psRegion with the attribute values given as a string.  The format
+ *  shall be of the standard IRAF form '[x0:x1,y0:y1]'
+ *
+ *  @return psRegion*:  A new psRegion struct, or NULL is not successful.
+ */
 psRegion* psRegionFromString(
     char* region                       ///< image rectangular region in the form '[x0:x1,y0:y1]'
+);
+
+/** Create a string of the standard IRAF form '[x0:x1,y0:y1]' from a psRegion.
+ *
+ *  @return char*:  A new string representing the psRegion as text, or NULL
+ *                  is not successful.
+ */
+char* psRegionToString(
+    psRegion* region                   ///< the psRegion to convert to a string
 );
 
Index: trunk/psLib/src/image/psImageErrors.dat
===================================================================
--- trunk/psLib/src/image/psImageErrors.dat	(revision 2861)
+++ trunk/psLib/src/image/psImageErrors.dat	(revision 2879)
@@ -13,4 +13,5 @@
 psImage_IMAGE_TYPE_UNSUPPORTED         Specified psImage type, %s, is not supported.
 psImage_INTERPOLATE_METHOD_INVALID     Specified interpolation method (%d) is not supported.
+psImage_REGION_NULL                    Specified psRegion is NULL.  Operation could not be performed.
 psImage_SUBSET_RANGE_INVALID           Specified subset range, [%d:%d,%d:%d], is invalid or outside input psImage's boundaries, [0:%d,0:%d].
 psImage_SUBSET_RANGE_MALFORMED         Specified subset range, [%d:%d,%d:%d], is invalid.  Ranges must be incremental.
@@ -67,5 +68,5 @@
 psImageManip_OPERATION_NULL            Operation can not be NULL.
 psImageManip_OVERLAY_TYPE_MISMATCH     Input overlay psImage type, %s, must match input psImage type, %s.
-psImageManip_CLIP_VALUE_INVALID        Specified %s value, %g%+gi, is not the the range of input psImage's valid pixel values (%s), i.e. [%g:%g].  
+psImageManip_CLIP_VALUE_INVALID        Specified %s value, %g%+gi, is not the the range of input psImage's valid pixel values (%s), i.e. [%g:%g].
 psImageManip_OVERLAY_OPERATOR_INVALID  Specified operation, '%s', is not supported.
 psImageManip_SCALE_NOT_POSITIVE        Specified scale value, %d, must be a positive value.
@@ -76,4 +77,4 @@
 psImageConvolve_FFT_FAILED             Failed to perform a fourier transform of input image.
 psImageConvolve_KERNEL_FFT_FAILED      Failed to perform a fourier transform of kernel.
-psImageConvolve_KERNEL_TOO_LARGE       Specified psKernel size, %dx%d, can not be larger than input psImage size, %dx%d. 
-psImage_COEFF_NULL                     Polynomial coefficients cannot be NULL. 
+psImageConvolve_KERNEL_TOO_LARGE       Specified psKernel size, %dx%d, can not be larger than input psImage size, %dx%d.
+psImage_COEFF_NULL                     Polynomial coefficients cannot be NULL.
Index: trunk/psLib/src/image/psImageErrors.h
===================================================================
--- trunk/psLib/src/image/psImageErrors.h	(revision 2861)
+++ trunk/psLib/src/image/psImageErrors.h	(revision 2879)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-11-16 20:00:21 $
+ *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-01-04 02:34:57 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -35,4 +35,5 @@
 #define PS_ERRORTEXT_psImage_IMAGE_TYPE_UNSUPPORTED "Specified psImage type, %s, is not supported."
 #define PS_ERRORTEXT_psImage_INTERPOLATE_METHOD_INVALID "Specified interpolation method (%d) is not supported."
+#define PS_ERRORTEXT_psImage_REGION_NULL "Specified psRegion is NULL.  Operation could not be performed."
 #define PS_ERRORTEXT_psImage_SUBSET_RANGE_INVALID "Specified subset range, [%d:%d,%d:%d], is invalid or outside input psImage's boundaries, [0:%d,0:%d]."
 #define PS_ERRORTEXT_psImage_SUBSET_RANGE_MALFORMED "Specified subset range, [%d:%d,%d:%d], is invalid.  Ranges must be incremental."
@@ -86,5 +87,5 @@
 #define PS_ERRORTEXT_psImageManip_OPERATION_NULL "Operation can not be NULL."
 #define PS_ERRORTEXT_psImageManip_OVERLAY_TYPE_MISMATCH "Input overlay psImage type, %s, must match input psImage type, %s."
-#define PS_ERRORTEXT_psImageManip_CLIP_VALUE_INVALID "Specified %s value, %g%+gi, is not the the range of input psImage's valid pixel values (%s), i.e. [%g:%g].  "
+#define PS_ERRORTEXT_psImageManip_CLIP_VALUE_INVALID "Specified %s value, %g%+gi, is not the the range of input psImage's valid pixel values (%s), i.e. [%g:%g]."
 #define PS_ERRORTEXT_psImageManip_OVERLAY_OPERATOR_INVALID "Specified operation, '%s', is not supported."
 #define PS_ERRORTEXT_psImageManip_SCALE_NOT_POSITIVE "Specified scale value, %d, must be a positive value."
@@ -95,6 +96,6 @@
 #define PS_ERRORTEXT_psImageConvolve_FFT_FAILED "Failed to perform a fourier transform of input image."
 #define PS_ERRORTEXT_psImageConvolve_KERNEL_FFT_FAILED "Failed to perform a fourier transform of kernel."
-#define PS_ERRORTEXT_psImageConvolve_KERNEL_TOO_LARGE "Specified psKernel size, %dx%d, can not be larger than input psImage size, %dx%d. "
-#define PS_ERRORTEXT_psImage_COEFF_NULL "Polynomial coefficients cannot be NULL. "
+#define PS_ERRORTEXT_psImageConvolve_KERNEL_TOO_LARGE "Specified psKernel size, %dx%d, can not be larger than input psImage size, %dx%d."
+#define PS_ERRORTEXT_psImage_COEFF_NULL "Polynomial coefficients cannot be NULL."
 //~End
 
