IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 30, 2007, 10:32:17 AM (19 years ago)
Author:
Paul Price
Message:

Adding assertion for kernels.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/imageops/psImageConvolve.h

    r14478 r14705  
    55 * @author Robert DeSonia, MHPCC
    66 *
    7  * @version $Revision: 1.23 $ $Name: not supported by cvs2svn $
    8  * @date $Date: 2007-08-14 02:06:32 $
     7 * @version $Revision: 1.24 $ $Name: not supported by cvs2svn $
     8 * @date $Date: 2007-08-30 20:32:17 $
    99 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
    1010 */
     
    2525
    2626/// A convolution kernel
    27 typedef struct
    28 {
     27typedef struct {
    2928    psImage *image;                    ///< Kernel data, in the form of an image
    3029    int xMin;                          ///< Most negative x index
     
    3433    float **kernel;                    ///< Pointer to the kernel data
    3534    float **p_kernelRows;              ///< Pointer to the rows of the kernel data; not intended for user use.
    36 }
    37 psKernel;
     35} psKernel;
     36
     37#define PS_ASSERT_KERNEL_NON_NULL(KERNEL, RETURNVALUE) \
     38    if ((NAME) == NULL || (NAME)->KERNEL == NULL) { \
     39        psError(PS_ERR_BAD_PARAMETER_NULL, true, \
     40                "Unallowable operation: psKernel %s or its data is NULL.", \
     41                #NAME); \
     42        return RETURNVALUE; \
     43    } \
     44    PS_ASSERT_IMAGE_NON_NULL((KERNEL)->image, RETURNVALUE);
    3845
    3946/// Allocates a convolution kernel of the given range
Note: See TracChangeset for help on using the changeset viewer.