Index: /trunk/psLib/src/image/psImageStats.c
===================================================================
--- /trunk/psLib/src/image/psImageStats.c	(revision 2099)
+++ /trunk/psLib/src/image/psImageStats.c	(revision 2100)
@@ -10,6 +10,6 @@
 *  @author George Gusciora, MHPCC
 *
-*  @version $Revision: 1.40 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-10-05 01:46:02 $
+*  @version $Revision: 1.41 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-10-14 01:03:57 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -30,4 +30,5 @@
 #include "psFunctions.h"
 #include "psImageStats.h"
+#include "psConstants.h"
 
 #include "psImageErrors.h"
@@ -106,5 +107,8 @@
     NOTE: verify that image/mask have the, correct types and  sizes.
  *****************************************************************************/
-psHistogram* psImageHistogram(psHistogram* out, psImage* in, psImage* mask, unsigned int maskVal)
+psHistogram* psImageHistogram(psHistogram* out,
+                              psImage* in,
+                              psImage* mask,
+                              unsigned int maskVal)
 {
     psVector* junkData = NULL;
@@ -112,7 +116,6 @@
 
     // NOTE: Verify this action.
-    if ((out == NULL) || (in == NULL)) {
-        return (NULL);
-    }
+    PS_CHECK_NULL_PTR_RETURN_NULL(out);
+    PS_CHECK_NULL_PTR_RETURN_NULL(in);
 
     junkData = psAlloc(sizeof(psVector));
@@ -150,4 +153,5 @@
 }
 
+// XXX: Why do we have this function?
 float *p_psCalcScaleFactorsFit(int n)
 {
@@ -195,6 +199,10 @@
 }
 
+// XXX: Use a static array of CHebyshev polynomials.
 psPolynomial1D **p_psCreateChebyshevPolys(int maxChebyPoly)
 {
+    if (maxChebyPoly < 1) {
+        return(NULL);
+    }
     psPolynomial1D **chebPolys = NULL;
     int i = 0;
@@ -235,6 +243,9 @@
                 psPolynomial1DEval((float) y, chebPolys[j]);
         over all pixels (x,y) in the image.
+ 
+XXX: Currently we only support F32.
  *****************************************************************************/
-psPolynomial2D* psImageFitPolynomial(psPolynomial2D* coeffs, const psImage* input)
+psPolynomial2D* psImageFitPolynomial(psPolynomial2D* coeffs,
+                                     const psImage* input)
 {
     int x = 0;
@@ -352,5 +363,7 @@
 
 /*****************************************************************************
+XXX: Use static variables for chebyshev polynomials and scaling factors. 
  
+XXX: Currently we only support F32.
  *****************************************************************************/
 psImage* psImageEvalPolynomial(psImage* input, const psPolynomial2D* coeffs)
Index: /trunk/psLib/src/imageops/psImageStats.c
===================================================================
--- /trunk/psLib/src/imageops/psImageStats.c	(revision 2099)
+++ /trunk/psLib/src/imageops/psImageStats.c	(revision 2100)
@@ -10,6 +10,6 @@
 *  @author George Gusciora, MHPCC
 *
-*  @version $Revision: 1.40 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-10-05 01:46:02 $
+*  @version $Revision: 1.41 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-10-14 01:03:57 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -30,4 +30,5 @@
 #include "psFunctions.h"
 #include "psImageStats.h"
+#include "psConstants.h"
 
 #include "psImageErrors.h"
@@ -106,5 +107,8 @@
     NOTE: verify that image/mask have the, correct types and  sizes.
  *****************************************************************************/
-psHistogram* psImageHistogram(psHistogram* out, psImage* in, psImage* mask, unsigned int maskVal)
+psHistogram* psImageHistogram(psHistogram* out,
+                              psImage* in,
+                              psImage* mask,
+                              unsigned int maskVal)
 {
     psVector* junkData = NULL;
@@ -112,7 +116,6 @@
 
     // NOTE: Verify this action.
-    if ((out == NULL) || (in == NULL)) {
-        return (NULL);
-    }
+    PS_CHECK_NULL_PTR_RETURN_NULL(out);
+    PS_CHECK_NULL_PTR_RETURN_NULL(in);
 
     junkData = psAlloc(sizeof(psVector));
@@ -150,4 +153,5 @@
 }
 
+// XXX: Why do we have this function?
 float *p_psCalcScaleFactorsFit(int n)
 {
@@ -195,6 +199,10 @@
 }
 
+// XXX: Use a static array of CHebyshev polynomials.
 psPolynomial1D **p_psCreateChebyshevPolys(int maxChebyPoly)
 {
+    if (maxChebyPoly < 1) {
+        return(NULL);
+    }
     psPolynomial1D **chebPolys = NULL;
     int i = 0;
@@ -235,6 +243,9 @@
                 psPolynomial1DEval((float) y, chebPolys[j]);
         over all pixels (x,y) in the image.
+ 
+XXX: Currently we only support F32.
  *****************************************************************************/
-psPolynomial2D* psImageFitPolynomial(psPolynomial2D* coeffs, const psImage* input)
+psPolynomial2D* psImageFitPolynomial(psPolynomial2D* coeffs,
+                                     const psImage* input)
 {
     int x = 0;
@@ -352,5 +363,7 @@
 
 /*****************************************************************************
+XXX: Use static variables for chebyshev polynomials and scaling factors. 
  
+XXX: Currently we only support F32.
  *****************************************************************************/
 psImage* psImageEvalPolynomial(psImage* input, const psPolynomial2D* coeffs)
