IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 1951


Ignore:
Timestamp:
Oct 4, 2004, 3:03:11 PM (22 years ago)
Author:
evanalst
Message:

Fix psImageFitPolynomial to check input argument validity.

Location:
trunk/psLib/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/image/psImageErrors.dat

    r1929 r1951  
    7373psImageConvolve_FFT_FAILED             Failed to perform a fourier transform of input image.
    7474psImageConvolve_KERNEL_FFT_FAILED      Failed to perform a fourier transform of kernel.
    75 psImageConvolve_KERNEL_TOO_LARGE       Specified psKernel size, %dx%d, can not be larger than input psImage size, %dx%d. 
     75psImageConvolve_KERNEL_TOO_LARGE       Specified psKernel size, %dx%d, can not be larger than input psImage size, %dx%d.
     76psImage_COEFF_NULL                     Polynomial coefficients cannot be NULL.
  • trunk/psLib/src/image/psImageStats.c

    r1939 r1951  
    1010*  @author George Gusciora, MHPCC
    1111*
    12 *  @version $Revision: 1.38 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2004-09-30 23:06:36 $
     12*  @version $Revision: 1.39 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2004-10-05 01:03:11 $
    1414*
    1515*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    236236        over all pixels (x,y) in the image.
    237237 *****************************************************************************/
    238 psPolynomial2D* psImageFitPolynomial(const psImage* input, psPolynomial2D* coeffs)
     238psPolynomial2D* psImageFitPolynomial(psPolynomial2D* coeffs, const psImage* input)
    239239{
    240240    int x = 0;
     
    247247    float *cScalingFactors = NULL;
    248248    float *rScalingFactors = NULL;
     249
     250    // Check for null inputs
     251    if (input == NULL) {
     252        psErrorMsg(PS_ERRORNAME_DOMAIN "psImageFitPolynomial",
     253                   PS_ERR_BAD_PARAMETER_NULL, true,
     254                   PS_ERRORTEXT_psImage_IMAGE_NULL);
     255        return NULL;
     256    }
     257
     258    if (coeffs == NULL) {
     259        psErrorMsg(PS_ERRORNAME_DOMAIN "psImageFitPolynomial",
     260                   PS_ERR_BAD_PARAMETER_NULL, true,
     261                   PS_ERRORTEXT_psImage_COEFF_NULL);
     262        return NULL;
     263    }
    249264
    250265    // Create the sums[][] data structure.  This
  • trunk/psLib/src/image/psImageStats.h

    r1448 r1951  
    99*  @author George Gusciora, MHPCC
    1010*
    11 *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
    12 *  @date $Date: 2004-08-10 01:55:34 $
     11*  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
     12*  @date $Date: 2004-10-05 01:03:11 $
    1313*
    1414*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    6868 */
    6969psPolynomial2D* psImageFitPolynomial(
    70     const psImage* input,              ///< image to fit
    71     psPolynomial2D* coeffs             ///< coefficient structure carries in desired terms & target
     70    psPolynomial2D* coeffs,            ///< coefficient structure carries in desired terms & target
     71    const psImage* input
    7272);
    7373
  • trunk/psLib/src/imageops/psImageStats.c

    r1939 r1951  
    1010*  @author George Gusciora, MHPCC
    1111*
    12 *  @version $Revision: 1.38 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2004-09-30 23:06:36 $
     12*  @version $Revision: 1.39 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2004-10-05 01:03:11 $
    1414*
    1515*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    236236        over all pixels (x,y) in the image.
    237237 *****************************************************************************/
    238 psPolynomial2D* psImageFitPolynomial(const psImage* input, psPolynomial2D* coeffs)
     238psPolynomial2D* psImageFitPolynomial(psPolynomial2D* coeffs, const psImage* input)
    239239{
    240240    int x = 0;
     
    247247    float *cScalingFactors = NULL;
    248248    float *rScalingFactors = NULL;
     249
     250    // Check for null inputs
     251    if (input == NULL) {
     252        psErrorMsg(PS_ERRORNAME_DOMAIN "psImageFitPolynomial",
     253                   PS_ERR_BAD_PARAMETER_NULL, true,
     254                   PS_ERRORTEXT_psImage_IMAGE_NULL);
     255        return NULL;
     256    }
     257
     258    if (coeffs == NULL) {
     259        psErrorMsg(PS_ERRORNAME_DOMAIN "psImageFitPolynomial",
     260                   PS_ERR_BAD_PARAMETER_NULL, true,
     261                   PS_ERRORTEXT_psImage_COEFF_NULL);
     262        return NULL;
     263    }
    249264
    250265    // Create the sums[][] data structure.  This
  • trunk/psLib/src/imageops/psImageStats.h

    r1448 r1951  
    99*  @author George Gusciora, MHPCC
    1010*
    11 *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
    12 *  @date $Date: 2004-08-10 01:55:34 $
     11*  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
     12*  @date $Date: 2004-10-05 01:03:11 $
    1313*
    1414*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    6868 */
    6969psPolynomial2D* psImageFitPolynomial(
    70     const psImage* input,              ///< image to fit
    71     psPolynomial2D* coeffs             ///< coefficient structure carries in desired terms & target
     70    psPolynomial2D* coeffs,            ///< coefficient structure carries in desired terms & target
     71    const psImage* input
    7272);
    7373
Note: See TracChangeset for help on using the changeset viewer.