IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 13, 2004, 3:03:57 PM (22 years ago)
Author:
gusciora
Message:

Added some error-checking.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/image/psImageStats.c

    r1955 r2100  
    1010*  @author George Gusciora, MHPCC
    1111*
    12 *  @version $Revision: 1.40 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2004-10-05 01:46:02 $
     12*  @version $Revision: 1.41 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2004-10-14 01:03:57 $
    1414*
    1515*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3030#include "psFunctions.h"
    3131#include "psImageStats.h"
     32#include "psConstants.h"
    3233
    3334#include "psImageErrors.h"
     
    106107    NOTE: verify that image/mask have the, correct types and  sizes.
    107108 *****************************************************************************/
    108 psHistogram* psImageHistogram(psHistogram* out, psImage* in, psImage* mask, unsigned int maskVal)
     109psHistogram* psImageHistogram(psHistogram* out,
     110                              psImage* in,
     111                              psImage* mask,
     112                              unsigned int maskVal)
    109113{
    110114    psVector* junkData = NULL;
     
    112116
    113117    // NOTE: Verify this action.
    114     if ((out == NULL) || (in == NULL)) {
    115         return (NULL);
    116     }
     118    PS_CHECK_NULL_PTR_RETURN_NULL(out);
     119    PS_CHECK_NULL_PTR_RETURN_NULL(in);
    117120
    118121    junkData = psAlloc(sizeof(psVector));
     
    150153}
    151154
     155// XXX: Why do we have this function?
    152156float *p_psCalcScaleFactorsFit(int n)
    153157{
     
    195199}
    196200
     201// XXX: Use a static array of CHebyshev polynomials.
    197202psPolynomial1D **p_psCreateChebyshevPolys(int maxChebyPoly)
    198203{
     204    if (maxChebyPoly < 1) {
     205        return(NULL);
     206    }
    199207    psPolynomial1D **chebPolys = NULL;
    200208    int i = 0;
     
    235243                psPolynomial1DEval((float) y, chebPolys[j]);
    236244        over all pixels (x,y) in the image.
     245 
     246XXX: Currently we only support F32.
    237247 *****************************************************************************/
    238 psPolynomial2D* psImageFitPolynomial(psPolynomial2D* coeffs, const psImage* input)
     248psPolynomial2D* psImageFitPolynomial(psPolynomial2D* coeffs,
     249                                     const psImage* input)
    239250{
    240251    int x = 0;
     
    352363
    353364/*****************************************************************************
     365XXX: Use static variables for chebyshev polynomials and scaling factors.
    354366 
     367XXX: Currently we only support F32.
    355368 *****************************************************************************/
    356369psImage* psImageEvalPolynomial(psImage* input, const psPolynomial2D* coeffs)
Note: See TracChangeset for help on using the changeset viewer.