Index: /trunk/psModules/src/pmSubtractBias.c
===================================================================
--- /trunk/psModules/src/pmSubtractBias.c	(revision 4130)
+++ /trunk/psModules/src/pmSubtractBias.c	(revision 4131)
@@ -4,16 +4,12 @@
  *  in place from an input image.
  *
- *  @author George Gusciora, MHPCC
+ *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.33 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-05-25 20:28:32 $
+ *  @version $Revision: 1.34 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-06-07 22:13:42 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  *
  */
-
-
-
-
 
 #if HAVE_CONFIG_H
@@ -31,6 +27,6 @@
 place from the input image.
  *****************************************************************************/
-psReadout *psSubtractFrame(psReadout *in,
-                           const psReadout *bias)
+static psReadout *SubtractFrame(psReadout *in,
+                                const psReadout *bias)
 {
     psS32 i;
@@ -39,24 +35,25 @@
     if (bias == NULL) {
         psLogMsg(__func__, PS_LOG_WARN,
-                 "WARNING: pmSubtractBias.c: psSubtractFrame(): bias frame is NULL.  Returning original image.\n");
-        return(in);
-    }
-
-    if (((in->image)->numRows + in->row0 - bias->row0) > (bias->image)->numRows) {
+                 "WARNING: pmSubtractBias.c: SubtractFrame(): bias frame is NULL.  Returning original image.\n");
+        return(in);
+    }
+
+
+    if ((in->image->numRows + in->row0 - bias->row0) > bias->image->numRows) {
         psError(PS_ERR_UNKNOWN,true, "bias image does not have enough rows.  Returning in image\n");
         return(in);
     }
-    if (((in->image)->numCols + in->row0 - bias->row0) > (bias->image)->numCols) {
+    if ((in->image->numCols + in->col0 - bias->col0) > bias->image->numCols) {
         psError(PS_ERR_UNKNOWN,true, "bias image does not have enough columns.  Returning in image\n");
         return(in);
     }
 
-    for (i=0;i<(in->image)->numRows;i++) {
-        for (j=0;j<(in->image)->numCols;j++) {
-            (in->image)->data.F32[i][j]-=
-                (bias->image)->data.F32[i+in->row0-bias->row0][j+in->col0-bias->col0];
+    for (i=0;i<in->image->numRows;i++) {
+        for (j=0;j<in->image->numCols;j++) {
+            in->image->data.F32[i][j]-=
+                bias->image->data.F32[i+in->row0-bias->row0][j+in->col0-bias->col0];
             if ((in->mask != NULL) && (bias->mask != NULL)) {
-                ((in->mask)->data.U8[i][j])|=
-                    (bias->mask)->data.U8[i+in->row0-bias->row0][j+in->col0-bias->col0];
+                (in->mask->data.U8[i][j])|=
+                    bias->mask->data.U8[i+in->row0-bias->row0][j+in->col0-bias->col0];
             }
         }
@@ -67,12 +64,16 @@
 
 /******************************************************************************
-p_psImageSubtractScalar(): subtract a scalar from the input image.
+ImageSubtractScalar(): subtract a scalar from the input image.
+ 
+XXX: Use a psLib function for this.
+ 
+XXX: This should
  *****************************************************************************/
-psImage *p_psImageSubtractScalar(psImage *image,
-                                 psF32 scalar)
+static psImage *ImageSubtractScalar(psImage *image,
+                                    psF32 scalar)
 {
     for (psS32 i=0;i<image->numRows;i++) {
         for (psS32 j=0;j<image->numCols;j++) {
-            (image->data.F32[i][j])-= scalar;
+            image->data.F32[i][j]-= scalar;
         }
     }
@@ -87,5 +88,5 @@
 listed lower in the code.
  *****************************************************************************/
-psStatsOptions GenNewStatOptions(const psStats *stat)
+static psStatsOptions GenNewStatOptions(const psStats *stat)
 {
     psS32 numOptions = 0;
@@ -153,8 +154,8 @@
 vector?
  *****************************************************************************/
-psVector *ScaleOverscanVector(psVector *overscanVector,
-                              psS32 n,
-                              void *fitSpec,
-                              pmFit fit)
+static psVector *ScaleOverscanVector(psVector *overscanVector,
+                                     psS32 n,
+                                     void *fitSpec,
+                                     pmFit fit)
 {
     psTrace(".psModule.pmSubtracBias.ScaleOverscanVector", 4,
@@ -170,4 +171,5 @@
     //
     // If the new vector is the same size as the old, simply copy the data.
+    //
     if (n == overscanVector->n) {
         for (psS32 i = 0 ; i < n ; i++) {
@@ -320,6 +322,4 @@
 
 
-
-
     if (overScanAxis == PM_OVERSCAN_NONE) {
         if (fit != PM_FIT_NONE) {
@@ -332,5 +332,5 @@
                      "WARNING: pmSubtractBias.(): overScanAxis equals NONE and overscans does not equal NULL.  Proceeding to full fram subtraction.\n");
         }
-        return(psSubtractFrame(in, bias));
+        return(SubtractFrame(in, bias));
     }
 
@@ -361,5 +361,5 @@
                 return(in);
             }
-            p_psImageSubtractScalar(in->image, statValue);
+            ImageSubtractScalar(in->image, statValue);
 
             tmpOverscan = tmpOverscan->next;
@@ -639,5 +639,5 @@
 
     if (bias != NULL) {
-        return(psSubtractFrame(in, bias));
+        return(SubtractFrame(in, bias));
     }
     return(in);
