IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 14762


Ignore:
Timestamp:
Sep 5, 2007, 1:52:11 PM (19 years ago)
Author:
Paul Price
Message:

Adding assertion on kernel sizes.

File:
1 edited

Legend:

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

    r14736 r14762  
    55 * @author Robert DeSonia, MHPCC
    66 *
    7  * @version $Revision: 1.27 $ $Name: not supported by cvs2svn $
    8  * @date $Date: 2007-09-04 23:29:43 $
     7 * @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
     8 * @date $Date: 2007-09-05 23:52:11 $
    99 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
    1010 */
     
    4343    } \
    4444    PS_ASSERT_IMAGE_NON_NULL((KERNEL)->image, RETURNVALUE);
     45
     46#define PS_ASSERT_KERNELS_SIZE_EQUAL(KERNEL1, KERNEL2, RETURNVALUE) \
     47    if ((KERNEL1)->xMin != (KERNEL2)->xMin || \
     48        (KERNEL1)->xMax != (KERNEL2)->xMax || \
     49        (KERNEL1)->yMin != (KERNEL2)->yMin || \
     50        (KERNEL1)->yMax != (KERNEL2)->yMax) { \
     51        psError(PS_ERR_BAD_PARAMETER_NULL, true, \
     52                "Unallowable operation: Kernels %s and %s are not the same size.", \
     53                #KERNEL1, #KERNEL2); \
     54        return RETURNVALUE; \
     55    } \
     56    PS_ASSERT_IMAGES_SIZE_EQUAL((KERNEL1)->image, (KERNEL2)->image, RETURNVALUE);
    4557
    4658/// Allocates a convolution kernel of the given range
Note: See TracChangeset for help on using the changeset viewer.