# HG changeset patch # User Benjamin Golinvaux # Date 1581688566 -3600 # Node ID 3c4269229566fc9ebb56dbb0ae382e71492ed3d2 # Parent 445bda258245777cf4c9574b8013b557e056c126 Added functions to retrieve min and max possible values for floating-point pixels diff -r 445bda258245 -r 3c4269229566 Core/Images/PixelTraits.h --- a/Core/Images/PixelTraits.h Fri Feb 14 09:04:40 2020 +0100 +++ b/Core/Images/PixelTraits.h Fri Feb 14 14:56:06 2020 +0100 @@ -383,6 +383,20 @@ } ORTHANC_FORCE_INLINE + static void SetMinValue(PixelType& target) + { + // std::numeric_limits::lowest is not supported on + // all compilers (for instance, Visual Studio 9.0 2008) + target = -std::numeric_limits::max(); + } + + ORTHANC_FORCE_INLINE + static void SetMaxValue(PixelType& target) + { + target = std::numeric_limits::max(); + } + + ORTHANC_FORCE_INLINE static void FloatToPixel(PixelType& target, float value) {