IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 12, 2007, 5:01:24 PM (20 years ago)
Author:
Paul Price
Message:

Fixing bug 843 by modifying functions that (unnecessarily) returned an input to return a bool.

Location:
trunk/psLib/src/imageops
Files:
2 edited

Legend:

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

    r10999 r11759  
    99 *  @author GLG, MHPCC
    1010 *
    11  *  @version $Revision: 1.103 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2007-01-09 22:38:52 $
     11 *  @version $Revision: 1.104 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2007-02-13 03:01:23 $
    1313 *
    1414 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
    … …  
    4444order to do so, we create dummy psVectors and set their "data" pointer to that
    4545of the input psImages.
    46  
     46
    4747XXX: use static psVectors
    48  
     48
    4949XXX: optimize this.  2k vs 4k, sample mean, takes8 seconds on Gene's machine.
    5050Should take .2.
    5151 *****************************************************************************/
    52 psStats* psImageStats(psStats* stats,
     52bool psImageStats(psStats* stats,
    5353                      const psImage* in,
    5454                      const psImage* mask,
    … …  
    5858    psVector *junkMask = NULL;
    5959
    60     PS_ASSERT_PTR_NON_NULL(stats, NULL);
    61     PS_ASSERT_INT_NONZERO(stats->options, NULL);
    62     PS_ASSERT_IMAGE_NON_NULL(in, NULL)
     60    PS_ASSERT_PTR_NON_NULL(stats, false);
     61    PS_ASSERT_INT_NONZERO(stats->options, false);
     62    PS_ASSERT_IMAGE_NON_NULL(in, false)
    6363    if (mask != NULL) {
    64         PS_ASSERT_IMAGE_TYPE(mask, PS_TYPE_U8, NULL);
    65         PS_ASSERT_IMAGES_SIZE_EQUAL(in, mask, NULL);
     64        PS_ASSERT_IMAGE_TYPE(mask, PS_TYPE_U8, false);
     65        PS_ASSERT_IMAGES_SIZE_EQUAL(in, mask, false);
    6666    }
    6767
    … …  
    116116    psFree(junkMask);
    117117    psFree(junkData);
    118     return(stats);
     118    return true;
    119119}
    120120
    … …  
    123123and initialized.
    124124 *****************************************************************************/
    125 psHistogram* psImageHistogram(psHistogram* out,
     125bool psImageHistogram(psHistogram* out,
    126126                              const psImage* in,
    127127                              const psImage* mask,
    128128                              psMaskType maskVal)
    129129{
    130     PS_ASSERT_PTR_NON_NULL(out, NULL);
    131     PS_ASSERT_PTR_NON_NULL(in, NULL);
     130    PS_ASSERT_PTR_NON_NULL(out, false);
     131    PS_ASSERT_PTR_NON_NULL(in, false);
    132132    if (mask != NULL) {
    133         PS_ASSERT_IMAGE_TYPE(mask, PS_TYPE_U8, NULL);
    134         PS_ASSERT_IMAGES_SIZE_EQUAL(in, mask, NULL);
     133        PS_ASSERT_IMAGE_TYPE(mask, PS_TYPE_U8, false);
     134        PS_ASSERT_IMAGES_SIZE_EQUAL(in, mask, false);
    135135    }
    136136    psVector* junkData = NULL;
    … …  
    188188    psFree(junkData);
    189189
    190     return (out);
     190    return true;
    191191}
    192192
    … …  
    1971970:512 to -1:1.  This routine takes as input an integer N and produces as
    198198output a vector of evenly spaced floating point values between -1.0:1.0.
    199  
     199
    200200XXX: Use the p_psNormalizeVector here?
    201201 *****************************************************************************/
    202 double* calcScaleFactors(psS32 n)
     202static double* calcScaleFactors(psS32 n)
    203203{
    204204    PS_ASSERT_INT_NONNEGATIVE(n, NULL);
    … …  
    235235        over all pixels (x,y) in the image.
    236236  *****************************************************************************/
    237 psPolynomial2D* psImageFitPolynomial(psPolynomial2D* coeffs,
     237bool psImageFitPolynomial(psPolynomial2D* coeffs,
    238238                                     const psImage* input)
    239239{
    240     PS_ASSERT_IMAGE_NON_NULL(input, NULL);
    241     PS_ASSERT_IMAGE_NON_EMPTY(input, NULL);
     240    PS_ASSERT_IMAGE_NON_NULL(input, false);
     241    PS_ASSERT_IMAGE_NON_EMPTY(input, false);
    242242    if ((input->type.type != PS_TYPE_S8) &&
    243243            (input->type.type != PS_TYPE_U16) &&
    … …  
    245245            (input->type.type != PS_TYPE_F64)) {
    246246        psError(PS_ERR_BAD_PARAMETER_TYPE, true, "Unallowable image type.\n");
    247     }
    248     PS_ASSERT_POLY_NON_NULL(coeffs, NULL);
    249     PS_ASSERT_POLY_TYPE(coeffs, PS_POLYNOMIAL_CHEB, NULL);
     247        return false;
     248    }
     249    PS_ASSERT_POLY_NON_NULL(coeffs, false);
     250    PS_ASSERT_POLY_TYPE(coeffs, PS_POLYNOMIAL_CHEB, false);
    250251    psS32 x = 0;
    251252    psS32 y = 0;
    … …  
    338339    psFree(rScalingFactors);
    339340
    340     return (coeffs);
     341    return true;
    341342}
    342343
  • trunk/psLib/src/imageops/psImageStats.h

    r11248 r11759  
    99 * @author GLG, MHPCC
    1010 *
    11  * @version $Revision: 1.30 $ $Name: not supported by cvs2svn $
    12  * @date $Date: 2007-01-23 22:47:23 $
     11 * @version $Revision: 1.31 $ $Name: not supported by cvs2svn $
     12 * @date $Date: 2007-02-13 03:01:23 $
    1313 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
    1414 */
    … …  
    3636 *  psF64.
    3737 *
    38  *  @return psStats*    the resulting statistics result(s)
     38 *  @return bool   Successful operation?
    3939 */
    40 psStats* psImageStats(
     40bool psImageStats(
    4141    psStats* stats,                    ///< defines statistics to be calculated
    4242    const psImage* in,                 ///< image (or subimage) to calculate stats
    … …  
    5151 *  psS8, psU16, psF32, psF64.
    5252 *
    53  *  @return psHistogram*     the resulting histogram
     53 *  @return bool   Successful operation?
    5454 */
    55 psHistogram* psImageHistogram(
     55bool psImageHistogram(
    5656    psHistogram* out,                  ///< input histogram description & target
    5757    const psImage* in,                 ///< Image data to be histogramed.
    … …  
    6666 *  psU16, psF32, psF64.
    6767 *
    68  *  @return psPolynomial2D*     fitted polynomial result
     68 *  @return bool   Successful operation?
    6969 *
    7070 */
    71 psPolynomial2D* psImageFitPolynomial(
     71bool psImageFitPolynomial(
    7272    psPolynomial2D* coeffs,            ///< coefficient structure carries in desired terms & target
    7373    const psImage* input               ///< input image
Note: See TracChangeset for help on using the changeset viewer.