Changeset 1840 for trunk/psLib/src/imageops
- Timestamp:
- Sep 21, 2004, 12:30:19 PM (22 years ago)
- Location:
- trunk/psLib/src/imageops
- Files:
-
- 2 edited
-
psImageConvolve.c (modified) (5 diffs)
-
psImageStats.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/imageops/psImageConvolve.c
r1653 r1840 5 5 * @author Robert DeSonia, MHPCC 6 6 * 7 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $8 * @date $Date: 2004-0 8-28 01:18:28$7 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2004-09-21 22:30:19 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 16 16 #include "psLogMsg.h" 17 17 #include "psError.h" 18 19 #include "psImageErrors.h" 18 20 19 21 static void freeKernel(psKernel* ptr); … … 76 78 } 77 79 78 psKernel *psKernelGenerate(const psVector *xShifts, const psVector *yShifts)80 psKernel* psKernelGenerate(const psVector* xShifts, const psVector* yShifts) 79 81 { 80 82 int x = 0; … … 91 93 // got non-NULL vectors? 92 94 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); 94 98 return NULL; 95 99 } 96 100 101 // types match? 97 102 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); 99 111 return NULL; 100 112 } … … 158 170 KERNEL_GENERATE_CASE(C32); 159 171 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 } 162 181 } 163 182 -
trunk/psLib/src/imageops/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.
