IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 16, 2004, 8:51:32 AM (22 years ago)
Author:
desonia
Message:

more psError -> psErrorMsg conversions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/image/psImage.c

    r1653 r1818  
    1010 *  @author Ross Harman, MHPCC
    1111 *
    12  *  @version $Revision: 1.42 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2004-08-28 01:18:28 $
     12 *  @version $Revision: 1.43 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2004-09-16 18:51:31 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2525#include "psError.h"
    2626#include "psImage.h"
     27
     28#include "psImageErrors.h"
    2729
    2830static void imageFree(psImage* image);
     
    3941
    4042    if (area < 1) {
    41         psError(__func__,
    42                 "Invalid value for number of rows or columns "
    43                 "(numRows=%d, numCols=%d).",
    44                 numRows, numCols);
     43        psErrorMsg(PS_ERRORNAME_DOMAIN "psImageAlloc",
     44                   PS_ERR_BAD_PARAMETER_VALUE, true,
     45                   PS_ERRORTEXT_psImage_AREA_NEGATIVE,
     46                   numRows, numCols);
    4547        return NULL;
    4648    }
     
    128130
    129131    if (old->type.dimen != PS_DIMEN_IMAGE) {
    130         psError(__func__,
    131                 "Can not realloc image because input is not an image.");
     132        psFree(old);
     133        psErrorMsg(PS_ERRORNAME_DOMAIN "psImageRecycle",
     134                   PS_ERR_BAD_PARAMETER_TYPE, true,
     135                   PS_ERRORTEXT_psImage_NOT_AN_IMAGE);
    132136        return NULL;
    133137    }
     
    214218
    215219    if (input == NULL) {
    216         psError(__func__, "Image can not be NULL.");
     220        psErrorMsg(PS_ERRORNAME_DOMAIN "psImagePixelInterpolate",
     221                   PS_ERR_BAD_PARAMETER_NULL,true,
     222                   PS_ERRORTEXT_psImage_IMAGE_NULL);
    217223        return unexposedValue;
    218224    }
    219     #define PSIMAGE_PIXEL_INTERPOLATE_CASE(TYPE) \
    220 case PS_TYPE_##TYPE: \
    221     switch (mode) { \
    222     case PS_INTERPOLATE_FLAT: \
    223         return p_psImagePixelInterpolateFLAT_##TYPE(input,x,y,unexposedValue); \
    224         break; \
    225     case PS_INTERPOLATE_BILINEAR: \
    226         return p_psImagePixelInterpolateBILINEAR_##TYPE(input,x,y,unexposedValue); \
    227         break; \
    228     default: \
    229         psError(__func__,"Unsupported interpolation mode (#%d)",mode); \
    230     } \
     225
     226    #define PSIMAGE_PIXEL_INTERPOLATE_CASE(TYPE)                             \
     227case PS_TYPE_##TYPE:                                                 \
     228    switch (mode) {                                                  \
     229    case PS_INTERPOLATE_FLAT:                                        \
     230        return p_psImagePixelInterpolateFLAT_##TYPE(input, x, y,     \
     231                unexposedValue);                                     \
     232        break;                                                       \
     233    case PS_INTERPOLATE_BILINEAR:                                    \
     234        return p_psImagePixelInterpolateBILINEAR_##TYPE(input,x,y,   \
     235                unexposedValue);                                     \
     236        break;                                                       \
     237    default:                                                         \
     238        psErrorMsg(PS_ERRORNAME_DOMAIN "psImagePixelInterpolate",    \
     239                   PS_ERR_BAD_PARAMETER_VALUE,true,                     \
     240                   PS_ERRORTEXT_psImage_INTERPOLATE_METHOD_INVALID,     \
     241                   mode);                                               \
     242    }                                                                    \
    231243    break
    232244
     
    245257        PSIMAGE_PIXEL_INTERPOLATE_CASE(C64);
    246258    default:
    247         psError(__func__, "Unsupported image datatype (%d)", input->type.type);
     259        psErrorMsg(PS_ERRORNAME_DOMAIN "psImagePixelInterpolate",
     260                   PS_ERR_BAD_PARAMETER_TYPE,true,
     261                   PS_ERRORTEXT_psImage_IMAGE_TYPE_UNSUPPORTED,
     262                   input->type.type);
    248263    }
    249264
Note: See TracChangeset for help on using the changeset viewer.