Changeset 23187 for trunk/psModules/src/objects/pmPeaks.c
- Timestamp:
- Mar 4, 2009, 5:29:50 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/objects/pmPeaks.c (modified) (19 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/objects/pmPeaks.c
r21514 r23187 37 37 pmPeakType type) 38 38 { 39 psTrace("psModules.objects", 5, "---- begin ----\n");39 psTrace("psModules.objects", 10, "---- begin ----\n"); 40 40 41 41 if (peaks == NULL) { … … 82 82 psFree (peak); 83 83 84 psTrace("psModules.objects", 5, "---- end ----\n");84 psTrace("psModules.objects", 10, "---- end ----\n"); 85 85 return(peaks); 86 86 } … … 96 96 psU32 row) 97 97 { 98 psTrace("psModules.objects", 4, "---- %s() begin ----\n", __func__);98 psTrace("psModules.objects", 10, "---- %s() begin ----\n", __func__); 99 99 PS_ASSERT_IMAGE_NON_NULL(image, NULL); 100 100 PS_ASSERT_IMAGE_TYPE(image, PS_TYPE_F32, NULL); … … 104 104 tmpVector->data.F32[col] = image->data.F32[row][col]; 105 105 } 106 psTrace("psModules.objects", 4, "---- %s() end ----\n", __func__);106 psTrace("psModules.objects", 10, "---- %s() end ----\n", __func__); 107 107 return(tmpVector); 108 108 } … … 117 117 psS32 y) 118 118 { 119 psTrace("psModules.objects", 4, "---- %s() begin ----\n", __func__);119 psTrace("psModules.objects", 10, "---- %s() begin ----\n", __func__); 120 120 if ((x >= valid.x0) && 121 121 (x <= valid.x1) && 122 122 (y >= valid.y0) && 123 123 (y <= valid.y1)) { 124 psTrace("psModules.objects", 4, "---- %s(true) end ----\n", __func__);124 psTrace("psModules.objects", 10, "---- %s(true) end ----\n", __func__); 125 125 return(true); 126 126 } 127 psTrace("psModules.objects", 4, "---- %s(false) end ----\n", __func__);127 psTrace("psModules.objects", 10, "---- %s(false) end ----\n", __func__); 128 128 return(false); 129 129 } … … 140 140 pmPeakType type) 141 141 { 142 psTrace("psModules.objects", 3, "---- %s() begin ----\n", __func__);142 psTrace("psModules.objects", 10, "---- %s() begin ----\n", __func__); 143 143 static int id = 1; 144 144 pmPeak *tmp = (pmPeak *) psAlloc(sizeof(pmPeak)); … … 157 157 psMemSetDeallocator(tmp, (psFreeFunc) peakFree); 158 158 159 psTrace("psModules.objects", 3, "---- %s() end ----\n", __func__);159 psTrace("psModules.objects", 10, "---- %s() end ----\n", __func__); 160 160 return(tmp); 161 161 } … … 172 172 int pmPeaksCompareAscend (const void **a, const void **b) 173 173 { 174 psTrace("psModules.objects", 3, "---- %s() begin ----\n", __func__);174 psTrace("psModules.objects", 10, "---- %s() begin ----\n", __func__); 175 175 pmPeak *A = *(pmPeak **)a; 176 176 pmPeak *B = *(pmPeak **)b; … … 180 180 diff = A->value - B->value; 181 181 if (diff < FLT_EPSILON) { 182 psTrace("psModules.objects", 3, "---- %s(-1) end ----\n", __func__);182 psTrace("psModules.objects", 10, "---- %s(-1) end ----\n", __func__); 183 183 return (-1); 184 184 } else if (diff > FLT_EPSILON) { 185 psTrace("psModules.objects", 3, "---- %s(+1) end ----\n", __func__);185 psTrace("psModules.objects", 10, "---- %s(+1) end ----\n", __func__); 186 186 return (+1); 187 187 } 188 psTrace("psModules.objects", 3, "---- %s(0) end ----\n", __func__);188 psTrace("psModules.objects", 10, "---- %s(0) end ----\n", __func__); 189 189 return (0); 190 190 } … … 194 194 int pmPeaksCompareDescend (const void **a, const void **b) 195 195 { 196 psTrace("psModules.objects", 3, "---- %s() begin ----\n", __func__);196 psTrace("psModules.objects", 10, "---- %s() begin ----\n", __func__); 197 197 pmPeak *A = *(pmPeak **)a; 198 198 pmPeak *B = *(pmPeak **)b; … … 202 202 diff = A->value - B->value; 203 203 if (diff < FLT_EPSILON) { 204 psTrace("psModules.objects", 3, "---- %s(+1) end ----\n", __func__);204 psTrace("psModules.objects", 10, "---- %s(+1) end ----\n", __func__); 205 205 return (+1); 206 206 } else if (diff > FLT_EPSILON) { 207 psTrace("psModules.objects", 3, "---- %s(-1) end ----\n", __func__);207 psTrace("psModules.objects", 10, "---- %s(-1) end ----\n", __func__); 208 208 return (-1); 209 209 } 210 psTrace("psModules.objects", 3, "---- %s(0) end ----\n", __func__);210 psTrace("psModules.objects", 10, "---- %s(0) end ----\n", __func__); 211 211 return (0); 212 212 } … … 258 258 psF32 threshold) 259 259 { 260 psTrace("psModules.objects", 3, "---- %s() begin ----\n", __func__);260 psTrace("psModules.objects", 10, "---- %s() begin ----\n", __func__); 261 261 PS_ASSERT_VECTOR_NON_NULL(vector, NULL); 262 262 PS_ASSERT_VECTOR_NON_EMPTY(vector, NULL); … … 276 276 tmpVector = psVectorAlloc(0, PS_TYPE_U32); 277 277 } 278 psTrace("psModules.objects", 3, "---- %s() end ----\n", __func__);278 psTrace("psModules.objects", 10, "---- %s() end ----\n", __func__); 279 279 return(tmpVector); 280 280 } … … 341 341 } 342 342 343 psTrace("psModules.objects", 3, "---- %s() end ----\n", __func__);343 psTrace("psModules.objects", 10, "---- %s() end ----\n", __func__); 344 344 return(tmpVector); 345 345 } … … 363 363 psArray *pmPeaksInImage(const psImage *image, psF32 threshold) 364 364 { 365 psTrace("psModules.objects", 3, "---- %s() begin ----\n", __func__);365 psTrace("psModules.objects", 10, "---- %s() begin ----\n", __func__); 366 366 PS_ASSERT_IMAGE_NON_NULL(image, NULL); 367 367 PS_ASSERT_IMAGE_TYPE(image, PS_TYPE_F32, NULL); 368 368 if ((image->numRows == 1) || (image->numCols == 1)) { 369 369 psError(PS_ERR_UNKNOWN, true, "Currently, input image must have at least 2 rows and 2 columns."); 370 psTrace("psModules.objects", 3, "---- %s(NULL) end ----\n", __func__);370 psTrace("psModules.objects", 10, "---- %s(NULL) end ----\n", __func__); 371 371 return(NULL); 372 372 } … … 425 425 // 426 426 if (image->numRows == 1) { 427 psTrace("psModules.objects", 3, "---- %s() end ----\n", __func__);427 psTrace("psModules.objects", 10, "---- %s() end ----\n", __func__); 428 428 return(list); 429 429 } … … 549 549 psFree (tmpRow); 550 550 psFree (row1); 551 psTrace("psModules.objects", 3, "---- %s() end ----\n", __func__);551 psTrace("psModules.objects", 10, "---- %s() end ----\n", __func__); 552 552 return(list); 553 553 } … … 560 560 const psRegion valid) 561 561 { 562 psTrace("psModules.objects", 3, "---- %s() begin ----\n", __func__);562 psTrace("psModules.objects", 10, "---- %s() begin ----\n", __func__); 563 563 PS_ASSERT_PTR_NON_NULL(peaks, NULL); 564 564 … … 575 575 psArrayAdd (output, 200, tmpPeak); 576 576 } 577 psTrace("psModules.objects", 3, "---- %s() end ----\n", __func__);577 psTrace("psModules.objects", 10, "---- %s() end ----\n", __func__); 578 578 return(output); 579 579 }
Note:
See TracChangeset
for help on using the changeset viewer.
