Index: /trunk/psLib/src/image/psPixels.c
===================================================================
--- /trunk/psLib/src/image/psPixels.c	(revision 3745)
+++ /trunk/psLib/src/image/psPixels.c	(revision 3746)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-04-21 23:28:39 $
+ *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-04-22 00:06:41 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -19,4 +19,11 @@
 #include "psMemory.h"
 
+typedef struct
+{
+    psS32 x;
+    psS32 y;
+}
+p_psPixelCoord;
+
 typedef int(*qsortCompareFcn)(const void *, const void *);
 
@@ -24,10 +31,11 @@
 {
     if (pixels != NULL) {
-        psFree(pixels->data);
+        psFree(pixels->x);
+        psFree(pixels->y);
     }
 }
 
 // for use by qsort, etc.
-static int comparePixelCoord(psPixelCoord* coord1, psPixelCoord* coord2)
+static int comparePixelCoord(p_psPixelCoord* coord1, p_psPixelCoord* coord2)
 {
     // check row first
@@ -57,7 +65,9 @@
 
     if (size > 0) {
-        out->data = psAlloc(sizeof(psPixelCoord)*size);
+        out->x = psVectorAlloc(size, PS_TYPE_S32);
+        out->y = psVectorAlloc(size, PS_TYPE_S32);
     } else {
-        out->data = NULL;
+        out->x = NULL;
+        out->y = NULL;
     }
 
@@ -73,5 +83,6 @@
     }
 
-    pixels->data = psRealloc(pixels->data, sizeof(psPixelCoord)*size);
+    pixels->x = psVectorRealloc(pixels->x, size);
+    pixels->y = psVectorRealloc(pixels->y, size);
 
     return pixels;
@@ -86,6 +97,17 @@
         return NULL;
     }
-    psPixelCoord* data = pixels->data;
-    if (data == NULL) {
+    psVector* xVec = pixels->x;
+    psVector* yVec = pixels->y;
+    if (xVec == NULL || yVec == NULL) {
+        // XXX: Error message
+        psFree(out);
+        return NULL;
+    }
+    if (xVec->type.type != PS_TYPE_S32) {
+        // XXX: Error message
+        psFree(out);
+        return NULL;
+    }
+    if (yVec->type.type != PS_TYPE_S32) {
         // XXX: Error message
         psFree(out);
@@ -129,11 +151,17 @@
 
     // determine the length of the pixel vector
-    int length = pixels->n;
+    int length = pixels->x->n;
+    if (pixels->y->n != length) {
+        // XXX: warning message
+        if (pixels->y->n < length) {
+            length = pixels->y->n;
+        }
+    }
 
     // cycle through the vector of pixels and insert pixels into image
     psMaskType** outData = out->data.PS_TYPE_MASK_DATA;
     for (int p = 0; p < length; p++) {
-        psS32 x = data[p].x;
-        psS32 y = data[p].y;
+        psS32 x = xVec->data.S32[p];
+        psS32 y = yVec->data.S32[p];
         // pixel in region?
         if (x >= x0 && x < x1 && y >= y0 && y < y1) {
@@ -170,5 +198,6 @@
         out = psPixelsAlloc(minPixels);
     }
-    psPixelCoord* data = out->data;
+    psVector* xVec = out->x;
+    psVector* yVec = out->y;
 
     // check the x and y vector validity (type/minimum size)
Index: /trunk/psLib/src/image/psPixels.h
===================================================================
--- /trunk/psLib/src/image/psPixels.h	(revision 3745)
+++ /trunk/psLib/src/image/psPixels.h	(revision 3746)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-04-21 23:28:39 $
+ *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-04-22 00:06:41 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -20,11 +20,4 @@
 /// @addtogroup Image
 /// @{
-
-typedef struct
-{
-    psS32 x;
-    psS32 y;
-}
-psPixelCoord;
 
 /** list of pixel coordinates
@@ -40,7 +33,6 @@
 typedef struct
 {
-    int n;
-    int nalloc;
-    psPixelCoord* data;
+    psVector *x;                       ///< x coordinate
+    psVector *y;                       ///< y coordinate
 }
 psPixels;
