comparison Core/Images/PixelTraits.h @ 3671:3c4269229566

Added functions to retrieve min and max possible values for floating-point pixels
author Benjamin Golinvaux <bgo@osimis.io>
date Fri, 14 Feb 2020 14:56:06 +0100
parents 94f4a18a79cc
children
comparison
equal deleted inserted replaced
3669:445bda258245 3671:3c4269229566
381 381
382 return tmp <= std::numeric_limits<float>::epsilon(); 382 return tmp <= std::numeric_limits<float>::epsilon();
383 } 383 }
384 384
385 ORTHANC_FORCE_INLINE 385 ORTHANC_FORCE_INLINE
386 static void SetMinValue(PixelType& target)
387 {
388 // std::numeric_limits<float>::lowest is not supported on
389 // all compilers (for instance, Visual Studio 9.0 2008)
390 target = -std::numeric_limits<float>::max();
391 }
392
393 ORTHANC_FORCE_INLINE
394 static void SetMaxValue(PixelType& target)
395 {
396 target = std::numeric_limits<float>::max();
397 }
398
399 ORTHANC_FORCE_INLINE
386 static void FloatToPixel(PixelType& target, 400 static void FloatToPixel(PixelType& target,
387 float value) 401 float value)
388 { 402 {
389 target = value; 403 target = value;
390 } 404 }