Index: trunk/psLib/src/imageops/psImageConvolve.c
===================================================================
--- trunk/psLib/src/imageops/psImageConvolve.c	(revision 14320)
+++ trunk/psLib/src/imageops/psImageConvolve.c	(revision 14332)
@@ -7,6 +7,6 @@
 /// @author Eugene Magnier, IfA
 ///
-/// @version $Revision: 1.52 $ $Name: not supported by cvs2svn $
-/// @date $Date: 2007-05-11 16:48:31 $
+/// @version $Revision: 1.53 $ $Name: not supported by cvs2svn $
+/// @date $Date: 2007-07-20 20:12:31 $
 ///
 /// Copyright 2004-2007 Institute for Astronomy, University of Hawaii
@@ -200,5 +200,6 @@
 }
 
-psImage *psImageConvolveDirect(const psImage *in,
+psImage *psImageConvolveDirect(psImage *out, 
+			       const psImage *in,
                                const psKernel *kernel)
 {
@@ -222,6 +223,4 @@
     int numCols = in->numCols;          // Number of columns
 
-    psImage *out;                       // Image to be returned
-
 #if 1
 
@@ -231,5 +230,5 @@
     case PS_TYPE_##TYPE: { \
         ps##TYPE **inData = in->data.TYPE; /* Dereference input data */ \
-        out = psImageAlloc(numCols, numRows, PS_TYPE_##TYPE); \
+        out = psImageRecycle(out, numCols, numRows, PS_TYPE_##TYPE); \
         for (int row = 0; row < numRows; row++) { \
             ps##TYPE *outRow = out->data.TYPE[row]; \
@@ -253,5 +252,5 @@
     case PS_TYPE_##TYPE: { \
         ps##TYPE **inData = in->data.TYPE; /* Dereference input data */ \
-        out = psImageAlloc(numCols, numRows, PS_TYPE_##TYPE); \
+        out = psImageRecycle(out, numCols, numRows, PS_TYPE_##TYPE); \
         psImageInit(out, 0.0); \
         for (int ky = yMin; ky <= yMax; ky++) { \
Index: trunk/psLib/src/imageops/psImageConvolve.h
===================================================================
--- trunk/psLib/src/imageops/psImageConvolve.h	(revision 14320)
+++ trunk/psLib/src/imageops/psImageConvolve.h	(revision 14332)
@@ -5,6 +5,6 @@
  * @author Robert DeSonia, MHPCC
  *
- * @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
- * @date $Date: 2007-04-05 03:02:21 $
+ * @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
+ * @date $Date: 2007-07-20 20:12:31 $
  * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
  */
@@ -112,4 +112,5 @@
 ///
 psImage *psImageConvolveDirect(
+    psImage *out,                       ///< return output to here
     const psImage *in,                  ///< the psImage to convolve
     const psKernel *kernel              ///< kernel to colvolve with
Index: trunk/psLib/test/imageops/convolutionBench.c
===================================================================
--- trunk/psLib/test/imageops/convolutionBench.c	(revision 14320)
+++ trunk/psLib/test/imageops/convolutionBench.c	(revision 14332)
@@ -35,5 +35,5 @@
             psKernel *kernel = generateKernel(kernelCols, kernelRows);
             psTimerStart("direct");
-            psImage *convolved = psImageConvolveDirect(image, kernel);
+            psImage *convolved = psImageConvolveDirect(NULL, image, kernel);
             direct += psTimerMark("direct");
             psFree(convolved);
Index: trunk/psLib/test/imageops/tap_psImageConvolve2.c
===================================================================
--- trunk/psLib/test/imageops/tap_psImageConvolve2.c	(revision 14320)
+++ trunk/psLib/test/imageops/tap_psImageConvolve2.c	(revision 14332)
@@ -71,5 +71,5 @@
         psKernel *kernel = generateKernel();
 
-        psImage *convolved = psImageConvolveDirect(image, kernel);
+        psImage *convolved = psImageConvolveDirect(NULL, image, kernel);
         ok(convolved, "convolution result");
         skip_start(!convolved, 3, "convolution failed");
