Index: trunk/psLib/src/imageops/psImageConvolve.c
===================================================================
--- trunk/psLib/src/imageops/psImageConvolve.c	(revision 1983)
+++ trunk/psLib/src/imageops/psImageConvolve.c	(revision 2204)
@@ -5,6 +5,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-10-06 21:31:30 $
+ *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-10-27 00:57:31 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -28,9 +28,9 @@
 static void freeKernel(psKernel* ptr);
 
-psKernel* psKernelAlloc(int xMin, int xMax, int yMin, int yMax)
+psKernel* psKernelAlloc(psS32 xMin, psS32 xMax, psS32 yMin, psS32 yMax)
 {
     psKernel* result;
-    int numRows;
-    int numCols;
+    psS32 numRows;
+    psS32 numCols;
 
     // following is explicitly spelled out in the SDRS as a requirement
@@ -40,5 +40,5 @@
                  yMin, yMax);
 
-        int temp = yMin;
+        psS32 temp = yMin;
         yMin = yMax;
         yMax = temp;
@@ -51,5 +51,5 @@
                  xMin, xMax);
 
-        int temp = xMin;
+        psS32 temp = xMin;
         xMin = xMax;
         xMax = temp;
@@ -70,5 +70,5 @@
     psKernelType** kernelRows = result->p_kernelRows;
     psKernelType** imageRows = result->image->data.PS_TYPE_KERNEL_DATA;
-    for (int i = 0; i < numRows; i++) {
+    for (psS32 i = 0; i < numRows; i++) {
         kernelRows[i] = imageRows[i] - xMin;
     }
@@ -91,17 +91,17 @@
                            const psVector* xShifts,
                            const psVector* yShifts,
-                           bool relative)
+                           psBool relative)
 {
-    int x = 0;
-    int y = 0;
-    int t = 0;
-    int deltaT;
-    int oldX;
-    int oldY;
-    int xMin = 0;
-    int xMax = 0;
-    int yMin = 0;
-    int yMax = 0;
-    int length = 0;
+    psS32 x = 0;
+    psS32 y = 0;
+    psS32 t = 0;
+    psS32 deltaT;
+    psS32 oldX;
+    psS32 oldY;
+    psS32 xMin = 0;
+    psS32 xMax = 0;
+    psS32 yMin = 0;
+    psS32 yMax = 0;
+    psS32 length = 0;
     psKernelType normalizeTime = 1.0;  // fraction of total time for each shift clock
     psKernel* result = NULL;
@@ -153,5 +153,5 @@
         y = 0; \
         t = 0; \
-        for (int lcv = 0; lcv < length; lcv++) { \
+        for (psS32 lcv = 0; lcv < length; lcv++) { \
             if (relative) { \
                 x += xShiftData[lcv]; \
@@ -181,5 +181,5 @@
         y = 0; \
         t = 0; \
-        for (int i = 0; i < length; i++) { \
+        for (psS32 i = 0; i < length; i++) { \
             deltaT = t; \
             oldX = x; \
@@ -228,5 +228,5 @@
 }
 
-psImage* psImageConvolve(psImage* out, const psImage* in, const psKernel* kernel, bool direct)
+psImage* psImageConvolve(psImage* out, const psImage* in, const psKernel* kernel, psBool direct)
 {
     if (in == NULL) {
@@ -242,13 +242,13 @@
         return NULL;
     }
-    int xMin = kernel->xMin;
-    int xMax = kernel->xMax;
-    int yMin = kernel->yMin;
-    int yMax = kernel->yMax;
+    psS32 xMin = kernel->xMin;
+    psS32 xMax = kernel->xMax;
+    psS32 yMin = kernel->yMin;
+    psS32 yMax = kernel->yMax;
     psKernelType** kData = kernel->kernel;
 
     // make the output image to the proper size and type
-    int numRows = in->numRows;
-    int numCols = in->numCols;
+    psS32 numRows = in->numRows;
+    psS32 numCols = in->numCols;
 
 
@@ -261,11 +261,11 @@
             ps##TYPE** inData = in->data.TYPE; \
             out = psImageRecycle(out, numCols, numRows, PS_TYPE_##TYPE); \
-            for (int row=0;row<numRows;row++) { \
+            for (psS32 row=0;row<numRows;row++) { \
                 ps##TYPE* outRow = out->data.TYPE[row]; \
-                for (int col=0;col<numCols;col++) { \
+                for (psS32 col=0;col<numCols;col++) { \
                     ps##TYPE pixel = 0.0; \
-                    for (int kRow = yMin; kRow < yMax; kRow++) { \
+                    for (psS32 kRow = yMin; kRow < yMax; kRow++) { \
                         if (row-kRow >= 0 && row-kRow < numRows) { \
-                            for (int kCol = xMin; kCol < xMax; kCol++) { \
+                            for (psS32 kCol = xMin; kCol < xMax; kCol++) { \
                                 if (col-kCol >= 0 && col-kCol < numCols) { \
                                     pixel += kData[kRow][kCol] * inData[row-kRow][col-kCol]; \
@@ -310,10 +310,10 @@
     } else {
         // fourier convolution
-        int paddedCols = numCols+2*FOURIER_PADDING;
-        int paddedRows = numRows+2*FOURIER_PADDING;
+        psS32 paddedCols = numCols+2*FOURIER_PADDING;
+        psS32 paddedRows = numRows+2*FOURIER_PADDING;
 
         // check to see if kernel is smaller, otherwise padding it up will fail.
-        int kRows = kernel->image->numRows;
-        int kCols = kernel->image->numCols;
+        psS32 kRows = kernel->image->numRows;
+        psS32 kCols = kernel->image->numCols;
         if (kRows >= numRows || kCols >= numCols) {
             psErrorMsg(PS_ERRORNAME_DOMAIN "psImageConvolve",
@@ -328,5 +328,5 @@
         // pad the image
         psImage* paddedImage = psImageAlloc(paddedCols,paddedRows,in->type.type);
-        int elementSize = PSELEMTYPE_SIZEOF(in->type.type);
+        psS32 elementSize = PSELEMTYPE_SIZEOF(in->type.type);
 
         // zero out padded area on top and bottom
@@ -335,8 +335,8 @@
 
         // fill in the image-containing rows.
-        int sidePaddingSize = FOURIER_PADDING*elementSize;
-        int imageRowSize = numCols*elementSize;
+        psS32 sidePaddingSize = FOURIER_PADDING*elementSize;
+        psS32 imageRowSize = numCols*elementSize;
         psU8* paddedData = paddedImage->data.U8[FOURIER_PADDING];
-        for (int row=0;row<numRows;row++) {
+        for (psS32 row=0;row<numRows;row++) {
             // zero out padded area on left edge.
             memset(paddedData,0,sidePaddingSize);
@@ -354,8 +354,8 @@
         psImage* paddedKernel = psImageAlloc(paddedCols,paddedRows,PS_TYPE_KERNEL);
         memset(paddedKernel->data.U8[0],0,sizeof(psKernelType)*numCols*numRows); // zero-out image
-        int yMax = kernel->yMax;
-        int xMax = kernel->xMax;
-        for (int row = kernel->yMin; row <= yMax;row++) {
-            int padRow = row;
+        psS32 yMax = kernel->yMax;
+        psS32 xMax = kernel->xMax;
+        for (psS32 row = kernel->yMin; row <= yMax;row++) {
+            psS32 padRow = row;
             if (padRow < 0) {
                 padRow += paddedRows;
@@ -363,5 +363,5 @@
             psKernelType* padData = paddedKernel->data.PS_TYPE_KERNEL_DATA[padRow];
             psKernelType* kernelRow = kernel->kernel[row];
-            for (int col = kernel->xMin; col <= xMax; col++) {
+            for (psS32 col = kernel->xMin; col <= xMax; col++) {
                 if (col < 0) {
                     padData[col+paddedCols] = kernelRow[col];
@@ -418,8 +418,8 @@
         out = psImageRecycle(out,numCols,numRows,PS_TYPE_F32);
         float factor = 1.0f/numCols/numRows;
-        for (int row = 0; row < numRows; row++) {
+        for (psS32 row = 0; row < numRows; row++) {
             psF32* outRow = out->data.F32[row];
             psC32* resultRow = complexOutSansPad->data.C32[row];
-            for (int col = 0; col < numCols; col++) {
+            for (psS32 col = 0; col < numCols; col++) {
                 outRow[col] = crealf(resultRow[col])*factor;
             }
