Index: /trunk/psLib/src/mathtypes/psImage.c
===================================================================
--- /trunk/psLib/src/mathtypes/psImage.c	(revision 5100)
+++ /trunk/psLib/src/mathtypes/psImage.c	(revision 5101)
@@ -9,6 +9,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.83 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-09-16 23:56:51 $
+ *  @version $Revision: 1.84 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-09-23 00:04:36 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -267,4 +267,117 @@
 }
 
+bool psImageSet(const psImage *image,
+                int x,
+                int y,
+                complex value)
+{
+    if (image == NULL)
+        return false;
+    if (x >= image->numRows || y >= image->numCols)
+        return false;
+    if(x < 0)
+        x += image->numRows;
+    if(y < 0)
+        y += image->numCols;
+
+    switch (image->type.type) {
+    case PS_TYPE_U8:
+        *(psU8*)&image->data.U8[x][y] = value;
+        break;
+    case PS_TYPE_U16:
+        *(psU16*)&image->data.U16[x][y] = value;
+        break;
+    case PS_TYPE_U32:
+        *(psU32*)&image->data.U32[x][y] = value;
+        break;
+    case PS_TYPE_U64:
+        *(psU64*)&image->data.U64[x][y] = value;
+        break;
+    case PS_TYPE_S8:
+        *(psS8*)&image->data.S8[x][y] = value;
+        break;
+    case PS_TYPE_S16:
+        *(psS16*)&image->data.S16[x][y] = value;
+        break;
+    case PS_TYPE_S32:
+        *(psS32*)&image->data.S32[x][y] = value;
+        break;
+    case PS_TYPE_S64:
+        *(psS64*)&image->data.S64[x][y] = value;
+        break;
+    case PS_TYPE_F32:
+        *(psF32*)&image->data.F32[x][y] = value;
+        break;
+    case PS_TYPE_F64:
+        *(psF64*)&image->data.F64[x][y] = value;
+        break;
+    case PS_TYPE_C32:
+        *(psC32*)&image->data.C32[x][y] = value;
+        break;
+    case PS_TYPE_C64:
+        *(psC64*)&image->data.C64[x][y] = value;
+        break;
+    default:
+        psError(PS_ERR_BAD_PARAMETER_TYPE, true, "Invalid psImage Data Type\n");
+        return false;
+    }
+
+    return true;
+}
+
+complex psImageGet(const psImage *image,
+                   int x,
+                   int y)
+{
+    if (image == NULL)
+        return NAN;
+    if (x >= image->numRows || y >= image->numCols)
+        return NAN;
+    if(x < 0)
+        x += image->numRows;
+    if(y < 0)
+        y += image->numCols;
+
+    switch (image->type.type) {
+    case PS_TYPE_U8:
+        return image->data.U8[x][y];
+        break;
+    case PS_TYPE_U16:
+        return image->data.U16[x][y];
+        break;
+    case PS_TYPE_U32:
+        return image->data.U32[x][y];
+        break;
+    case PS_TYPE_U64:
+        return image->data.U64[x][y];
+        break;
+    case PS_TYPE_S8:
+        return image->data.S8[x][y];
+        break;
+    case PS_TYPE_S16:
+        return image->data.S16[x][y];
+        break;
+    case PS_TYPE_S32:
+        return image->data.S32[x][y];
+        break;
+    case PS_TYPE_S64:
+        return image->data.S64[x][y];
+        break;
+    case PS_TYPE_F32:
+        return image->data.F32[x][y];
+        break;
+    case PS_TYPE_F64:
+        return image->data.F64[x][y];
+        break;
+    case PS_TYPE_C32:
+        return image->data.C32[x][y];
+        break;
+    case PS_TYPE_C64:
+        return image->data.C64[x][y];
+        break;
+    default:
+        return NAN;
+    }
+}
 
 psImage* psImageRecycle(psImage* old,
Index: /trunk/psLib/src/mathtypes/psImage.h
===================================================================
--- /trunk/psLib/src/mathtypes/psImage.h	(revision 5100)
+++ /trunk/psLib/src/mathtypes/psImage.h	(revision 5101)
@@ -11,6 +11,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.70 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-09-19 22:50:29 $
+ *  @version $Revision: 1.71 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-09-23 00:04:36 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -193,4 +193,29 @@
 );
 
+/** Sets the value of the image at the specified x,y position to value.
+ *
+ *  A negative value for the x or y positions means index from the end.
+ *
+ *  @return bool:       True on success, otherwise false.
+ */
+bool psImageSet(
+    const psImage *image,              ///< the image to set
+    int x,                             ///< x-position
+    int y,                             ///< y-position
+    complex value                      ///< specified value to set
+);
+
+/** Returns the value of the image at the specified x,y position.
+ *
+ *  A negative value for the x or y positions means index from the end.
+ *
+ *  @return complex:        The value at the specified x,y position.
+ */
+complex psImageGet(
+    const psImage *image,              ///< the image from which to get
+    int x,                             ///< x-position
+    int y                              ///< y-position
+);
+
 /** Resize a given image to the given size/type.
  *
Index: /trunk/psLib/src/mathtypes/psVector.c
===================================================================
--- /trunk/psLib/src/mathtypes/psVector.c	(revision 5100)
+++ /trunk/psLib/src/mathtypes/psVector.c	(revision 5101)
@@ -9,6 +9,6 @@
 *  @author Robert DeSonia, MHPCC
 *
-*  @version $Revision: 1.54 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-09-22 02:32:00 $
+*  @version $Revision: 1.55 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-09-23 00:04:36 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -863,4 +863,5 @@
     default:
         psError(PS_ERR_BAD_PARAMETER_TYPE, true, "Invalid psVector Data Type\n");
+        return false;
     }
 
Index: /trunk/psLib/src/types/psPixels.c
===================================================================
--- /trunk/psLib/src/types/psPixels.c	(revision 5100)
+++ /trunk/psLib/src/types/psPixels.c	(revision 5101)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-08-30 01:14:13 $
+ *  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-09-23 00:04:36 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -332,2 +332,45 @@
     return (true);
 }
+
+bool psPixelsSet(psPixels *pixels,
+                 long position,
+                 psPixelCoord value)
+{
+    if (pixels == NULL)
+        return false;
+    if (position > pixels->n)
+        return false;
+    if(position < 0)
+        position += pixels->n;
+    if (position == pixels->n) {
+        if (position >= pixels->nalloc)
+            return false;
+        pixels->n++;
+    }
+    pixels->data[position].x = value.x;
+    pixels->data[position].y = value.y;
+
+    return true;
+}
+
+psPixelCoord psPixelsGet(const psPixels *pixels,
+                         long position)
+{
+    psPixelCoord out;
+    if (pixels == NULL) {
+        out.x = 0; //XXX: should be NAN when changed to float
+        out.y = 0; //XXX: should be NAN when changed to float
+        return out;
+    }
+    if (position >= pixels->n) {
+        out.x = 0; //XXX: should be NAN when changed to float
+        out.y = 0; //XXX: should be NAN when changed to float
+        return out;
+    }
+    if (position < 0)
+        position += pixels->n;
+    out.x = pixels->data[position].x;
+    out.y = pixels->data[position].y;
+    return out;
+}
+
Index: /trunk/psLib/src/types/psPixels.h
===================================================================
--- /trunk/psLib/src/types/psPixels.h	(revision 5100)
+++ /trunk/psLib/src/types/psPixels.h	(revision 5101)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-08-30 01:14:13 $
+ *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-09-23 00:04:36 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -161,3 +161,26 @@
 );
 
+/** Sets the value of the the pixels array at the specified position to value.
+ *
+ *  A negative position means index from the end.
+ *
+ *  @return bool:       True if Successful, otherwise false.
+*/
+bool psPixelsSet(
+    psPixels *pixels,                  ///< pixels to set
+    long position,                     ///< position to set
+    psPixelCoord value                 ///< pixels value to be set
+);
+
+/** Returns the value of the pixels array at the specified position.
+ *
+ *  A negative position means index from the end.
+ *
+ *  @return psPixelCoord:       The value of the pixels at the specified position.
+*/
+psPixelCoord psPixelsGet(
+    const psPixels *pixels,            ///< input pixels from which to get
+    long position                      ///< position to get
+);
+
 #endif // #ifndef PS_PIXELS_H
Index: /trunk/psLib/test/mathtypes/tst_psImage.c
===================================================================
--- /trunk/psLib/test/mathtypes/tst_psImage.c	(revision 5100)
+++ /trunk/psLib/test/mathtypes/tst_psImage.c	(revision 5101)
@@ -6,6 +6,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-09-16 23:56:51 $
+ *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-09-23 00:04:36 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -26,4 +26,5 @@
 static psS32 testRegion3(void);
 static psS32 testImageInit(void);
+static psS32 testImageGetSet(void);
 
 testDescription tests[] = {
@@ -35,4 +36,5 @@
                               {testRegion3,793,"psRegionForSquare",0,false},
                               {testImageInit,794,"psImageInit",0,false},
+                              {testImageGetSet,795,"psImageInit",0,false},
                               {NULL}
                           };
@@ -354,2 +356,21 @@
 }
 
+static psS32 testImageGetSet(void)
+{
+    psImage *image = NULL;
+    image = psImageAlloc(5, 5, PS_TYPE_S32);
+
+    if ( !psImageSet(image, 0, 0, 10) )
+        fprintf(stderr, "ImageSet failed to set S32 at position 0\n");
+    if ( psImageSet(image, 10, 10, 100) )
+        fprintf(stderr, "ImageSet Improperly set S32 at out of range position\n");
+    if ( !psImageSet(image, -1, -1, 4) )
+        fprintf(stderr, "ImageSet Failed to set S32 at position 4,4\n");
+    if ( (psS32)psImageGet(image, 0, 0) != 10 )
+        fprintf(stderr, "ImageGet Failed to return the correct S32 from position 0,0\n");
+    if ( (psS32)psImageGet(image, -1, -1) != 4 )
+        fprintf(stderr, "ImageGet Failed to return the correct S32 from tail using -1,-1\n");
+
+    psFree(image);
+    return 0;
+}
Index: /trunk/psLib/test/mathtypes/verified/tst_psImage.stderr
===================================================================
--- /trunk/psLib/test/mathtypes/verified/tst_psImage.stderr	(revision 5100)
+++ /trunk/psLib/test/mathtypes/verified/tst_psImage.stderr	(revision 5101)
@@ -132,2 +132,11 @@
 ---> TESTPOINT PASSED (psImage{psImageInit} | tst_psImage.c)
 
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_psImage.c                                              *
+*            TestPoint: psImage{psImageInit}                                       *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (psImage{psImageInit} | tst_psImage.c)
+
Index: /trunk/psLib/test/types/tst_psPixels.c
===================================================================
--- /trunk/psLib/test/types/tst_psPixels.c	(revision 5100)
+++ /trunk/psLib/test/types/tst_psPixels.c	(revision 5101)
@@ -5,7 +5,7 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.1 $
+ *  @version $Revision: 1.2 $
  *           $Name: not supported by cvs2svn $
- *  @date $Date: 2005-07-13 02:47:01 $
+ *  @date $Date: 2005-09-23 00:04:36 $
  *
  *  Copyright 2005 Maui High Performance Computing Center, University of Hawaii
@@ -21,4 +21,5 @@
 static int testPixelsFromMask(void);
 static int testPixelsConcatenate(void);
+static psS32 testPixelsGetSet(void);
 
 testDescription tests[] = {
@@ -29,4 +30,5 @@
                               {testPixelsFromMask,865,"psPixelsFromMask",0,false},
                               {testPixelsConcatenate,866,"psPixelsConcatenate",0,false},
+                              {testPixelsGetSet,867,"psPixelsGet/Set",0,false},
                               {NULL}
                           };
@@ -502,2 +504,44 @@
 }
 
+psS32 testPixelsGetSet(void)
+{
+    psPixels *in = psPixelsAlloc(5);
+    in->n = 0;
+    psPixelCoord value;
+    psPixelCoord out;
+    value.x = 3;
+    value.y = 13;
+    if ( psPixelsSet(in, 2, value) ) {
+        psError(PS_ERR_LOCATION_INVALID, true, "psPixelSet set to Invalid location\n");
+        return 1;
+    }
+    if ( !psPixelsSet(in, 0, value) ) {
+        psError(PS_ERR_UNKNOWN, true, "psPixelsSet failed to set pixels at location 0\n");
+        return 2;
+    }
+    if ( !psPixelsSet(in, 1, value) ) {
+        psError(PS_ERR_UNKNOWN, true, "psPixelsSet failed to set pixels at location 0\n");
+        return 3;
+    }
+    out = psPixelsGet(in, 1);
+    if ( out.x != 3 || out.y != 13 ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psPixelsGet return incorrect values %d,%d",
+                out.x, out.y);
+        return 4;
+    }
+    value.x = 1;
+    value.y = 2;
+    if ( !psPixelsSet(in, 0, value) ) {
+        psError(PS_ERR_UNKNOWN, true, "psPixelsSet failed to set pixels at location 0\n");
+        return 5;
+    }
+    out = psPixelsGet(in, 0);
+    if (out.x != 1 || out.y != 2) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psPixelsGet return incorrect values %d,%d",
+                out.x, out.y);
+        return 6;
+    }
+    psFree(in);
+    return 0;
+}
+
Index: /trunk/psLib/test/types/verified/tst_psPixels.stderr
===================================================================
--- /trunk/psLib/test/types/verified/tst_psPixels.stderr	(revision 5100)
+++ /trunk/psLib/test/types/verified/tst_psPixels.stderr	(revision 5101)
@@ -73,2 +73,11 @@
 ---> TESTPOINT PASSED (psPixels{psPixelsConcatenate} | tst_psPixels.c)
 
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_psPixels.c                                             *
+*            TestPoint: psPixels{psPixelsGet/Set}                                  *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (psPixels{psPixelsGet/Set} | tst_psPixels.c)
+
