Index: trunk/psLib/src/imageops/psImageStats.c
===================================================================
--- trunk/psLib/src/imageops/psImageStats.c	(revision 2262)
+++ trunk/psLib/src/imageops/psImageStats.c	(revision 2265)
@@ -9,6 +9,6 @@
 *  @author GLG, MHPCC
 *
-*  @version $Revision: 1.48 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-11-02 02:03:56 $
+*  @version $Revision: 1.49 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-11-02 03:57:21 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -149,35 +149,4 @@
 }
 
-double *CalcScaleFactors(psS32 n)
-{
-    psS32 i = 0;
-    double tmp = 0.0;
-    double *scalingFactors = (double *)psAlloc(n * sizeof(double));
-
-    for (i = 0; i < n; i++) {
-        tmp = (double)(n - i);
-        tmp = (M_PI * (tmp - 0.5)) / ((double)n);
-        scalingFactors[i] = cos(tmp);
-    }
-
-    return (scalingFactors);
-}
-
-// XXX: Why do we have this function?
-double *CalcScaleFactorsFit(psS32 n)
-{
-    psS32 i = 0;
-    double tmp = 0.0;
-    double *scalingFactors = (double *)psAlloc(n * sizeof(double));
-
-    for (i = 0; i < n; i++) {
-        tmp = (double)(n - i);
-        tmp = (M_PI * (tmp - 0.5)) / ((double)n);
-        scalingFactors[i] = cos(tmp);
-    }
-
-    return (scalingFactors);
-}
-
 /*****************************************************************************
 CalcScaleFactorsEval(n): The Chebyshev polynomials are defined over the
@@ -187,11 +156,9 @@
 output a vector of evenly spaced floating point values between -1.0:1.0.
  *****************************************************************************/
-double *CalcScaleFactorsEval(psS32 n)
-{
+double *CalcScaleFactors(psS32 n)
+{
+    PS_INT_CHEC_NON_NEGATIVE(n, NULL);
     psS32 i = 0;
     double tmp = 0.0;
-
-    return(CalcScaleFactorsFit(n));
-
     double *scalingFactors = (double *)psAlloc(n * sizeof(double));
 
@@ -201,8 +168,26 @@
         scalingFactors[i] = cos(tmp);
     }
+
     return (scalingFactors);
 }
 
-// XXX: Use a static array of CHebyshev polynomials.
+psVector *VecCalcScaleFactors(psVector *scalingFactors, psS32 n)
+{
+    PS_VECTOR_CHECK_NULL(scalingFactors, NULL);
+    PS_VECTOR_CHECK_TYPE(scalingFactors, PS_TYPE_F64, NULL);
+    PS_INT_CHEC_NON_NEGATIVE(n, NULL);
+    psS32 i = 0;
+    double tmp = 0.0;
+
+    for (i = 0; i < n; i++) {
+        tmp = (double)(n - i);
+        tmp = (M_PI * (tmp - 0.5)) / ((double)n);
+        scalingFactors->data.F64[i] = cos(tmp);
+    }
+
+    return (scalingFactors);
+}
+
+// XXX: Use a static array of Chebyshev polynomials.
 psPolynomial1D **p_psCreateChebyshevPolys(psS32 maxChebyPoly)
 {
