IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 21, 2004, 12:30:19 PM (22 years ago)
Author:
desonia
Message:

Changed the image code to the new psErrorMsg error handling specification.

File:
1 edited

Legend:

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

    r1719 r1840  
    1010*  @author George Gusciora, MHPCC
    1111*
    12 *  @version $Revision: 1.34 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2004-09-08 06:02:47 $
     12*  @version $Revision: 1.35 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2004-09-21 22:30:19 $
    1414*
    1515*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3232#include "psImageStats.h"
    3333
     34#include "psImageErrors.h"
     35
    3436/// This routine must determine the various statistics for the image.
    3537
     
    4345
    4446    if (stats == NULL) {
    45         psError(__func__, "The input psStats struct can not be NULL.");
     47        psErrorMsg(PS_ERRORNAME_DOMAIN "psImageStats",
     48                   PS_ERR_BAD_PARAMETER_NULL, true,
     49                   PS_ERRORTEXT_psImage_STAT_NULL);
    4650        return NULL;
    4751    }
    4852
    4953    if (in == NULL) {
    50         psError(__func__, "The input image can not be NULL.");
     54        psErrorMsg(PS_ERRORNAME_DOMAIN "psImageStats",
     55                   PS_ERR_BAD_PARAMETER_NULL, true,
     56                   PS_ERRORTEXT_psImage_IMAGE_NULL);
    5157        return NULL;
    5258    }
    5359
    5460    if (stats->options == 0) {
    55         psError(__func__, "No statistic option/operation was specified.");
     61        psErrorMsg(PS_ERRORNAME_DOMAIN "psImageStats",
     62                   PS_ERR_BAD_PARAMETER_VALUE, true,
     63                   PS_ERRORTEXT_psImage_NO_STAT_OPTIONS);
    5664        return stats;
    5765    }
     
    6270    junkData->nalloc = in->numRows * in->numCols;
    6371    junkData->n = junkData->nalloc;
    64     junkData->data.V = in->data.V[0];      // since
    65     // psImage
    66     // data
    67     // is
    68     // contiguous...
     72    junkData->data.V = in->data.V[0];      // since psImage data is contiguous...
    6973
    7074    if (mask != NULL) {
    7175        if (mask->type.type != PS_TYPE_MASK) {
    72             psError(__func__, "Expected the mask image type not found (type=%x)", mask->type.type);
     76            char* typeStr;
     77            PS_TYPE_NAME(typeStr,mask->type.type);
     78            psErrorMsg(PS_ERRORNAME_DOMAIN "psImageStats",
     79                       PS_ERR_BAD_PARAMETER_TYPE, true,
     80                       PS_ERRORTEXT_psImage_IMAGE_MASK_TYPE,
     81                       typeStr, PS_TYPE_MASK_NAME);
    7382            psFree(junkData);
    7483            return NULL;
     
    109118    junkData->nalloc = in->numRows * in->numCols;
    110119    junkData->n = junkData->nalloc;
    111     junkData->data.V = in->data.V[0];      // since
    112     // psImage
    113     // data
    114     // is
    115     // contiguous...
     120    junkData->data.V = in->data.V[0];  // since psImage data is contiguous...
    116121
    117122    if (mask != NULL) {
    118123        if (mask->type.type != PS_TYPE_MASK) {
    119             psError(__func__, "Expected the mask image type not found (type=%x)", mask->type.type);
     124            char* typeStr;
     125            PS_TYPE_NAME(typeStr,mask->type.type);
     126            psErrorMsg(PS_ERRORNAME_DOMAIN "psImageHistogram",
     127                       PS_ERR_BAD_PARAMETER_TYPE, true,
     128                       PS_ERRORTEXT_psImage_IMAGE_MASK_TYPE,
     129                       typeStr, PS_TYPE_MASK_NAME);
     130            psFree(out);
    120131            psFree(junkData);
    121132            return NULL;
    122133        }
    123         // stuff the mask data into a psVector
    124         // struct.
     134        // stuff the mask data into a psVector struct.
    125135        junkMask = psAlloc(sizeof(psVector));
    126136        junkMask->type = mask->type;
Note: See TracChangeset for help on using the changeset viewer.