Index: trunk/psModules/test/tst_pmReadoutCombine.c
===================================================================
--- trunk/psModules/test/tst_pmReadoutCombine.c	(revision 2287)
+++ trunk/psModules/test/tst_pmReadoutCombine.c	(revision 2590)
@@ -1,12 +1,10 @@
 /** @file tst_pmReadoutCombine.c
  *
- *  @brief This file contains the tests for pmReadoutCombine.c:
- *
  *  test00() This routine will test the basic functionality.
  *
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-11-05 04:49:47 $
+ *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-12-01 22:08:32 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -27,4 +25,5 @@
 #define OUTPUT_COLS_NUM  32
 #define NUM_READOUTS  10
+#define OUT_IMAGE_SIZE 10
 
 int main(int argc, char* argv[])
@@ -54,8 +53,8 @@
     psVector *scale = psVectorAlloc(NUM_READOUTS, PS_TYPE_F32);
     for (i=0;i<NUM_READOUTS;i++) {
-        zero->data.F32[i] = 0.0;
+        zero->data.F32[i] = 1.0;
     }
     for (i=0;i<NUM_READOUTS;i++) {
-        scale->data.F32[i] = 1.0;
+        scale->data.F32[i] = 2.0;
     }
 
@@ -86,4 +85,5 @@
                 tmpImage->data.F32[i][j] = (float) (i + j);
                 tmpImage->data.F32[i][j] = 1.0;
+                tmpImage->data.F32[i][j] = (float) r;
             }
         }
@@ -134,4 +134,100 @@
 }
 
+#define EIGHT 8
+int quarters()
+{
+    int i;
+    int j;
+    int r;
+    psList *list = NULL;
+    int baseRowsReadout[EIGHT];
+    int baseColsReadout[EIGHT];
+    int baseRows[EIGHT];
+    int baseCols[EIGHT];
+    int numRows[EIGHT];
+    int numCols[EIGHT];
+    int minOutRow = 10000;
+    int minOutCol = 10000;
+    int maxOutRow = -1;
+    int maxOutCol = -1;
+    psImage *output = NULL;
+    psCombineParams *params = (psCombineParams *) psAlloc(sizeof(psCombineParams));
+    psVector *zero = psVectorAlloc(EIGHT, PS_TYPE_F32);
+    psVector *scale = psVectorAlloc(EIGHT, PS_TYPE_F32);
+    for (i=0;i<EIGHT;i++) {
+        zero->data.F32[i] = 1.0;
+    }
+    for (i=0;i<EIGHT;i++) {
+        scale->data.F32[i] = 2.0;
+    }
+
+    params->stats = psStatsAlloc(PS_STAT_SAMPLE_MEAN);
+    params->maskVal = 1;
+    params->fracLow = 0.0;
+    params->fracHigh = 10000.0;
+    params->nKeep = 0;
+
+    for (r=0;r<EIGHT;r++) {
+        baseRowsReadout[r] = 0;
+        baseColsReadout[r] = 0;
+        baseRows[r] = 0;
+        baseCols[r] = 0;
+        numRows[r] = 10;
+        numCols[r] = 10;
+
+        psImage *tmpImage = psImageAlloc(numCols[r], numRows[r], PS_TYPE_F32);
+        for (i=0;i<numRows[r];i++) {
+            for (j=0;j<numCols[r];j++) {
+                tmpImage->data.F32[i][j] = (float) (i + j);
+                tmpImage->data.F32[i][j] = 1.0;
+                tmpImage->data.F32[i][j] = (float) r;
+            }
+        }
+
+        *(int *) (& (tmpImage->row0)) = baseRows[r];
+        *(int *) (& (tmpImage->col0)) = baseCols[r];
+        psReadout *tmpReadout = psReadoutAlloc(baseColsReadout[r],
+                                               baseRowsReadout[r],
+                                               tmpImage);
+        minOutRow = PS_MIN(minOutRow, (baseRowsReadout[r] + baseRows[r]));
+        minOutCol = PS_MIN(minOutCol, (baseColsReadout[r] + baseCols[r]));
+        maxOutRow = PS_MAX(maxOutRow, (baseRowsReadout[r] + baseRows[r] + numRows[r]));
+        maxOutCol = PS_MAX(maxOutCol, (baseColsReadout[r] + baseCols[r] + numCols[r]));
+
+        if (r == 0) {
+            list = psListAlloc(tmpReadout);
+        } else {
+            psListAdd(list, PS_LIST_HEAD, tmpReadout);
+        }
+    }
+    printf("tst_pmReadoutCombine(): (minOutRow, minOutCol) to (maxOutRow, maxOutCol) is (%d, %d) (%d, %d)\n",
+           minOutRow, minOutCol, maxOutRow, maxOutCol);
+
+    output = pmReadoutCombine(output, list, params, zero, scale, true, 1.0, 0.0);
+
+    for (i=output->row0; i < (output->row0 + output->numRows) ; i++) {
+        for (j=output->col0; j < (output->col0 + output->numCols) ; j++) {
+            printf("%.1f ", output->data.F32[i-output->row0][j-output->col0]);
+        }
+        printf("\n");
+    }
+
+    psFree(params->stats);
+    psFree(params);
+    psFree(output);
+    psFree(zero);
+    psFree(scale);
+
+    psListElem *tmpInput = (psListElem *) list->head;
+    while (NULL != tmpInput) {
+        psReadout *tmpReadout = (psReadout *) tmpInput->data;
+        psFree(tmpReadout);
+        tmpInput = tmpInput->next;
+    }
+    psFree(list);
+
+    return(0);
+}
+
 int test00( void )
 {
