Changeset 1840 for trunk/psLib/src/image/psImageStats.c
- Timestamp:
- Sep 21, 2004, 12:30:19 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/image/psImageStats.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/image/psImageStats.c
r1719 r1840 10 10 * @author George Gusciora, MHPCC 11 11 * 12 * @version $Revision: 1.3 4$ $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 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 32 32 #include "psImageStats.h" 33 33 34 #include "psImageErrors.h" 35 34 36 /// This routine must determine the various statistics for the image. 35 37 … … 43 45 44 46 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); 46 50 return NULL; 47 51 } 48 52 49 53 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); 51 57 return NULL; 52 58 } 53 59 54 60 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); 56 64 return stats; 57 65 } … … 62 70 junkData->nalloc = in->numRows * in->numCols; 63 71 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... 69 73 70 74 if (mask != NULL) { 71 75 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); 73 82 psFree(junkData); 74 83 return NULL; … … 109 118 junkData->nalloc = in->numRows * in->numCols; 110 119 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... 116 121 117 122 if (mask != NULL) { 118 123 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); 120 131 psFree(junkData); 121 132 return NULL; 122 133 } 123 // stuff the mask data into a psVector 124 // struct. 134 // stuff the mask data into a psVector struct. 125 135 junkMask = psAlloc(sizeof(psVector)); 126 136 junkMask->type = mask->type;
Note:
See TracChangeset
for help on using the changeset viewer.
