- Timestamp:
- 09/11/11 21:37:36 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/mcore/DrsCalib.h
r12049 r12069 378 378 } 379 379 380 static void GetPixelMax(float * ptr, const float *data, uint16_t roi, int32_t first, int32_t last)381 { 382 if (roi==0 || first >=roi || last>=roi || last<first)380 static void GetPixelMax(float *max, const float *data, uint16_t roi, int32_t first, int32_t last) 381 { 382 if (roi==0 || first<0 || last<0 || first>=roi || last>=roi || last<first) 383 383 return; 384 384 385 385 for (int i=0; i<1440; i++) 386 386 { 387 const float *vec = data+i*roi; 388 389 float &max = ptr[i]; 390 391 max = vec[first]; 392 for (int j=first+1; j<=last; j++) 393 if (vec[j]>max) 394 max = vec[j]; 395 } 387 const float *beg = data+i*roi+first; 388 const float *end = data+i*roi+last; 389 390 const float *pmax = beg; 391 392 for (const float *ptr=beg+1; ptr<=end; ptr++) 393 if (*ptr>*pmax) 394 pmax = ptr; 395 396 max[i] = *pmax; 397 } 398 396 399 } 397 400
Note:
See TracChangeset
for help on using the changeset viewer.