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.

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

Legend:

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

    r1653 r1840  
    55 *  @author Robert DeSonia, MHPCC
    66 *
    7  *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    8  *  @date $Date: 2004-08-28 01:18:28 $
     7 *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     8 *  @date $Date: 2004-09-21 22:30:19 $
    99 *
    1010 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    1616#include "psLogMsg.h"
    1717#include "psError.h"
     18
     19#include "psImageErrors.h"
    1820
    1921static void freeKernel(psKernel* ptr);
     
    7678}
    7779
    78 psKernel *psKernelGenerate(const psVector *xShifts, const psVector *yShifts)
     80psKernel* psKernelGenerate(const psVector* xShifts, const psVector* yShifts)
    7981{
    8082    int x = 0;
     
    9193    // got non-NULL vectors?
    9294    if (xShifts == NULL || yShifts == NULL) {
    93         psError(__func__,"Shift vectors can not be NULL.");
     95        psErrorMsg(PS_ERRORNAME_DOMAIN "psKernelGenerate",
     96                   PS_ERR_BAD_PARAMETER_NULL, true,
     97                   PS_ERRORTEXT_psImageConvolve_SHIFT_NULL);
    9498        return NULL;
    9599    }
    96100
     101    // types match?
    97102    if (xShifts->type.type != yShifts->type.type) {
    98         psError(__func__,"Shift vectors can not be different data types.");
     103        char* typeXStr;
     104        char* typeYStr;
     105        PS_TYPE_NAME(typeXStr,xShifts->type.type);
     106        PS_TYPE_NAME(typeYStr,yShifts->type.type);
     107        psErrorMsg(PS_ERRORNAME_DOMAIN "psKernelGenerate",
     108                   PS_ERR_BAD_PARAMETER_TYPE, true,
     109                   PS_ERRORTEXT_psImageConvolve_SHIFT_TYPE_MISMATCH,
     110                   typeXStr, typeYStr);
    99111        return NULL;
    100112    }
     
    158170        KERNEL_GENERATE_CASE(C32);
    159171        KERNEL_GENERATE_CASE(C64);
    160     default:
    161         psError(__func__,"Shift vector datatype not supported.");
     172
     173    default: {
     174            char* typeStr;
     175            PS_TYPE_NAME(typeStr,xShifts->type.type);
     176            psErrorMsg(PS_ERRORNAME_DOMAIN "psKernelGenerate",
     177                       PS_ERR_BAD_PARAMETER_TYPE, true,
     178                       PS_ERRORTEXT_psImage_IMAGE_TYPE_UNSUPPORTED,
     179                       typeStr);
     180        }
    162181    }
    163182
  • 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.