comparison Core/Images/ImageProcessing.cpp @ 3505:b2d4dd16dae8

removed C++11 primitive
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 28 Aug 2019 12:21:23 +0200
parents 18566f9e1831
children 8c66c9c2257b
comparison
equal deleted inserted replaced
3504:18566f9e1831 3505:b2d4dd16dae8
376 376
377 for (unsigned int x = 0; x < width; x++, p++) 377 for (unsigned int x = 0; x < width; x++, p++)
378 { 378 {
379 float v = (static_cast<float>(*p) + offset) * scaling; 379 float v = (static_cast<float>(*p) + offset) * scaling;
380 380
381 if (v > maxFloatValue) 381 if (v >= maxFloatValue)
382 { 382 {
383 *p = maxPixelValue; 383 *p = maxPixelValue;
384 } 384 }
385 else if (v < minFloatValue) 385 else if (v <= minFloatValue)
386 { 386 {
387 *p = minPixelValue; 387 *p = minPixelValue;
388 } 388 }
389 else if (UseRound) 389 else if (UseRound)
390 { 390 {
1085 ShiftScaleInternal<int16_t, true>(image, offset, scaling); 1085 ShiftScaleInternal<int16_t, true>(image, offset, scaling);
1086 } 1086 }
1087 else 1087 else
1088 { 1088 {
1089 ShiftScaleInternal<int16_t, false>(image, offset, scaling); 1089 ShiftScaleInternal<int16_t, false>(image, offset, scaling);
1090 }
1091 return;
1092
1093 case PixelFormat_Float32:
1094 if (useRound)
1095 {
1096 ShiftScaleInternal<float, true>(image, offset, scaling);
1097 }
1098 else
1099 {
1100 ShiftScaleInternal<float, false>(image, offset, scaling);
1090 } 1101 }
1091 return; 1102 return;
1092 1103
1093 default: 1104 default:
1094 throw OrthancException(ErrorCode_NotImplemented); 1105 throw OrthancException(ErrorCode_NotImplemented);