Index: trunk/psastro/src/psastroAstromGuess.c
===================================================================
--- trunk/psastro/src/psastroAstromGuess.c	(revision 21052)
+++ trunk/psastro/src/psastroAstromGuess.c	(revision 21183)
@@ -267,5 +267,5 @@
     psVector *cornerDn = psVectorAllocEmpty (100, PS_TYPE_F32);
 
-    psVector *cornerMK = psVectorAllocEmpty (100, PS_TYPE_U8);
+    psVector *cornerMK = psVectorAllocEmpty (100, PS_TYPE_VECTOR_MASK);
 
     if (DEBUG) psastroDumpCorners ("corners.up.guess3.dat", "corners.dn.guess3.dat", fpa);
Index: trunk/psastro/src/psastroFixChips.c
===================================================================
--- trunk/psastro/src/psastroFixChips.c	(revision 21052)
+++ trunk/psastro/src/psastroFixChips.c	(revision 21183)
@@ -160,5 +160,5 @@
     psPlaneTransform *map = psPlaneTransformAlloc (1, 1);
   
-    psVector *mask = psVectorAlloc (nPts, PS_TYPE_U8);
+    psVector *mask = psVectorAlloc (nPts, PS_TYPE_VECTOR_MASK);
     psVectorInit (mask, 0);
 
Index: trunk/psastro/src/psastroLuminosityFunction.c
===================================================================
--- trunk/psastro/src/psastroLuminosityFunction.c	(revision 21052)
+++ trunk/psastro/src/psastroLuminosityFunction.c	(revision 21183)
@@ -91,5 +91,5 @@
     psLogMsg ("psastro", 4, "fitting %d points to luminosity function\n", n);
 
-    psVector *mask = psVectorAlloc (Mag->n, PS_TYPE_MASK);
+    psVector *mask = psVectorAlloc (Mag->n, PS_TYPE_VECTOR_MASK);
     psVectorInit (mask, 0);
 
@@ -108,5 +108,5 @@
     double mMaxValid = NAN;
     for (int i = 0; i < Mag->n; i++) {
-        if (mask->data.U8[i]) continue;
+        if (mask->data.PS_TYPE_VECTOR_MASK_DATA[i]) continue;
         if (isnan(mMinValid) || (Mag->data.F32[i] < mMinValid)) {
             mMinValid = Mag->data.F32[i];
Index: trunk/psastro/src/psastroMaskUpdates.Mosaic.c
===================================================================
--- trunk/psastro/src/psastroMaskUpdates.Mosaic.c	(revision 21052)
+++ trunk/psastro/src/psastroMaskUpdates.Mosaic.c	(revision 21183)
@@ -9,9 +9,9 @@
 pmCell *pmCellInChip (pmChip *chip, float x, float y);
 bool pmCellCoordsForChip (float *xCell, float *yCell, pmCell *cell, float xChip, float yChip);
-bool psastroMaskCircle (psImage *mask, char value, float x0, float y0, float dX, float dY);
-bool psastroMaskBox (psImage *mask, char value, float x0, float y0, float dL, float dW, float theta);
-void psastroMaskLine (psImage *mask, char value, double x1, double y1, double x2, double y2, int dW);
-void psastroMaskLineBresen (psImage *mask, char value, int X1, int Y1, int X2, int Y2, int dW, int swapcoords);
-void psastroMaskRectangle (psImage *mask, char value, int x0, int y0, int x1, int y1);
+bool psastroMaskCircle (psImage *mask, psImageMaskType value, float x0, float y0, float dX, float dY);
+bool psastroMaskBox (psImage *mask, psImageMaskType value, float x0, float y0, float dL, float dW, float theta);
+void psastroMaskLine (psImage *mask, psImageMaskType value, double x1, double y1, double x2, double y2, int dW);
+void psastroMaskLineBresen (psImage *mask, psImageMaskType value, int X1, int Y1, int X2, int Y2, int dW, int swapcoords);
+void psastroMaskRectangle (psImage *mask, psImageMaskType value, int x0, int y0, int x1, int y1);
 
 // create a mask or mask regions based on the collection of reference stars that are 
@@ -25,6 +25,6 @@
     float zeropt, exptime;
 
-    psMaskType maskValue  = pmConfigMaskGet("GHOST", config); // Mask value for ghost pixels
-    psMaskType maskBlank  = pmConfigMaskGet("BLANK", config); // Mask value for blank pixels
+    psImageMaskType maskValue  = pmConfigMaskGet("GHOST", config); // Mask value for ghost pixels
+    psImageMaskType maskBlank  = pmConfigMaskGet("BLANK", config); // Mask value for blank pixels
 
     // select the current recipe
@@ -342,5 +342,5 @@
 
 // XXX should be doing an OR
-bool psastroMaskCircle (psImage *mask, char value, float x0, float y0, float dX, float dY) {
+bool psastroMaskCircle (psImage *mask, psImageMaskType value, float x0, float y0, float dX, float dY) {
 
     // XXX need to worry about row0, col0
@@ -357,5 +357,5 @@
 	    if (r2 > 1.0) continue;
 	    
-	    mask->data.U8[jy][jx] |= value;
+	    mask->data.PS_TYPE_IMAGE_MASK_DATA[jy][jx] |= value;
 	}
     }
@@ -364,5 +364,5 @@
 
 // XXX should be doing an OR
-bool psastroMaskBox (psImage *mask, char value, float x0, float y0, float dL, float dW, float theta) {
+bool psastroMaskBox (psImage *mask, psImageMaskType value, float x0, float y0, float dL, float dW, float theta) {
 
     // draw a series of lines (from -0.5*dW to +0.5*dW) of length dL, starting at x0, y0, angle theta
@@ -379,5 +379,5 @@
 
 // identify the quadrant and draw the correct line
-void psastroMaskLine (psImage *mask, char value, double x1, double y1, double x2, double y2, int dW) {
+void psastroMaskLine (psImage *mask, psImageMaskType value, double x1, double y1, double x2, double y2, int dW) {
 
   int FlipDirect, FlipCoords;
@@ -408,5 +408,5 @@
 // use the Bresenham line drawing technique
 // integer-only Bresenham line-draw version which is fast
-void psastroMaskLineBresen (psImage *mask, char value, int X1, int Y1, int X2, int Y2, int dW, int swapcoords) {
+void psastroMaskLineBresen (psImage *mask, psImageMaskType value, int X1, int Y1, int X2, int Y2, int dW, int swapcoords) {
 
     int X, Y, dX, dY;
@@ -425,5 +425,5 @@
 		    if (y < 0) continue;
 		    if (y >= mask->numCols) continue;
-		    mask->data.U8[X][y] |= value;
+		    mask->data.PS_TYPE_IMAGE_MASK_DATA[X][y] |= value;
 		}
 	    } else {
@@ -432,5 +432,5 @@
 		    if (y < 0) continue;
 		    if (y >= mask->numRows) continue;
-		    mask->data.U8[y][X] |= value;
+		    mask->data.PS_TYPE_IMAGE_MASK_DATA[y][X] |= value;
 		}
 	    }
@@ -450,10 +450,10 @@
 }
 
-void psastroMaskRectangle (psImage *mask, char value, int x0, int y0, int x1, int y1) {
+void psastroMaskRectangle (psImage *mask, psImageMaskType value, int x0, int y0, int x1, int y1) {
     for (int iy = PS_MAX(0,y0); iy < PS_MIN(y1,mask->numRows); iy++) {
 	for (int ix = PS_MAX(0,x0); ix < PS_MIN(x1,mask->numCols); ix++) {
-	    mask->data.U8[iy][ix] |= value;
-	}
-    }
-}
-
+	    mask->data.PS_TYPE_IMAGE_MASK_DATA[iy][ix] |= value;
+	}
+    }
+}
+
Index: trunk/psastro/src/psastroMaskUpdates.c
===================================================================
--- trunk/psastro/src/psastroMaskUpdates.c	(revision 21052)
+++ trunk/psastro/src/psastroMaskUpdates.c	(revision 21183)
@@ -11,9 +11,9 @@
 bool pmChipCoordsForCell (float *xChip, float *yChip, pmCell *cell, float xCell, float yCell);
 
-bool psastroMaskCircle (psImage *mask, char value, float x0, float y0, float dX, float dY);
-bool psastroMaskBox (psImage *mask, char value, float x0, float y0, float dL, float dW, float theta);
-void psastroMaskLine (psImage *mask, char value, double x1, double y1, double x2, double y2, int dW);
-void psastroMaskLineBresen (psImage *mask, char value, int X1, int Y1, int X2, int Y2, int dW, int swapcoords);
-void psastroMaskRectangle (psImage *mask, char value, int x0, int y0, int x1, int y1);
+bool psastroMaskCircle (psImage *mask, psImageMaskType value, float x0, float y0, float dX, float dY);
+bool psastroMaskBox (psImage *mask, psImageMaskType value, float x0, float y0, float dL, float dW, float theta);
+void psastroMaskLine (psImage *mask, psImageMaskType value, double x1, double y1, double x2, double y2, int dW);
+void psastroMaskLineBresen (psImage *mask, psImageMaskType value, int X1, int Y1, int X2, int Y2, int dW, int swapcoords);
+void psastroMaskRectangle (psImage *mask, psImageMaskType value, int x0, int y0, int x1, int y1);
 
 // create a mask or mask regions based on the collection of reference stars that are
@@ -27,7 +27,7 @@
     float zeropt, exptime;
 
-    psMaskType maskValue  = pmConfigMaskGet("GHOST", config); // Mask value for ghost pixels
-
-    // psMaskType maskBlank  = pmConfigMaskGet("BLANK", config); // Mask value for blank pixels
+    psImageMaskType maskValue  = pmConfigMaskGet("GHOST", config); // Mask value for ghost pixels
+
+    // psImageMaskType maskBlank  = pmConfigMaskGet("BLANK", config); // Mask value for blank pixels
 
     // select the current recipe
@@ -376,5 +376,5 @@
 
 // XXX should be doing an OR
-bool psastroMaskCircle (psImage *mask, char value, float x0, float y0, float dX, float dY) {
+bool psastroMaskCircle (psImage *mask, psImageMaskType value, float x0, float y0, float dX, float dY) {
 
     // XXX need to worry about row0, col0
@@ -391,5 +391,5 @@
             if (r2 > 1.0) continue;
 
-            mask->data.U8[jy][jx] |= value;
+            mask->data.PS_TYPE_IMAGE_MASK_DATA[jy][jx] |= value;
         }
     }
@@ -398,5 +398,5 @@
 
 // XXX should be doing an OR
-bool psastroMaskBox (psImage *mask, char value, float x0, float y0, float dL, float dW, float theta) {
+bool psastroMaskBox (psImage *mask, psImageMaskType value, float x0, float y0, float dL, float dW, float theta) {
 
     // draw a series of lines (from -0.5*dW to +0.5*dW) of length dL, starting at x0, y0, angle theta
@@ -413,5 +413,5 @@
 
 // identify the quadrant and draw the correct line
-void psastroMaskLine (psImage *mask, char value, double x1, double y1, double x2, double y2, int dW) {
+void psastroMaskLine (psImage *mask, psImageMaskType value, double x1, double y1, double x2, double y2, int dW) {
 
   int FlipDirect, FlipCoords;
@@ -442,5 +442,5 @@
 // use the Bresenham line drawing technique
 // integer-only Bresenham line-draw version which is fast
-void psastroMaskLineBresen (psImage *mask, char value, int X1, int Y1, int X2, int Y2, int dW, int swapcoords) {
+void psastroMaskLineBresen (psImage *mask, psImageMaskType value, int X1, int Y1, int X2, int Y2, int dW, int swapcoords) {
 
     int X, Y, dX, dY;
@@ -459,5 +459,5 @@
                     if (y < 0) continue;
                     if (y >= mask->numCols) continue;
-                    mask->data.U8[X][y] |= value;
+                    mask->data.PS_TYPE_IMAGE_MASK_DATA[X][y] |= value;
                 }
             } else {
@@ -466,5 +466,5 @@
                     if (y < 0) continue;
                     if (y >= mask->numRows) continue;
-                    mask->data.U8[y][X] |= value;
+                    mask->data.PS_TYPE_IMAGE_MASK_DATA[y][X] |= value;
                 }
             }
@@ -484,5 +484,5 @@
 }
 
-void psastroMaskRectangle (psImage *mask, char value, int x0, int y0, int x1, int y1) {
+void psastroMaskRectangle (psImage *mask, psImageMaskType value, int x0, int y0, int x1, int y1) {
 
     int xs = PS_MAX (0, PS_MIN (mask->numCols, PS_MIN (x0, x1)));
@@ -493,7 +493,7 @@
     for (int iy = ys; iy < ye; iy++) {
         for (int ix = xs; ix < xe; ix++) {
-            mask->data.U8[iy][ix] |= value;
-        }
-    }
-}
-
+            mask->data.PS_TYPE_IMAGE_MASK_DATA[iy][ix] |= value;
+        }
+    }
+}
+
Index: trunk/psastro/src/psastroMosaicFPtoTP.c
===================================================================
--- trunk/psastro/src/psastroMosaicFPtoTP.c	(revision 21052)
+++ trunk/psastro/src/psastroMosaicFPtoTP.c	(revision 21183)
@@ -74,5 +74,5 @@
 
     // constant errors
-    psVector *mask = psVectorAlloc (X->n, PS_TYPE_U8);
+    psVector *mask = psVectorAlloc (X->n, PS_TYPE_VECTOR_MASK);
     psVectorInit (mask, 0);
 
