changeset 3263:f58553a98204

fix rounding
author am@osimis.io
date Wed, 20 Feb 2019 12:34:22 +0100
parents 345f86fd1ac3
children 3af3b74fbd5c
files Core/Images/PixelTraits.h
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/Core/Images/PixelTraits.h	Tue Feb 19 08:43:23 2019 +0100
+++ b/Core/Images/PixelTraits.h	Wed Feb 20 12:34:22 2019 +0100
@@ -103,6 +103,7 @@
     static void FloatToPixel(PixelType& target,
                              float value)
     {
+      value += 0.5f;
       if (value < static_cast<float>(std::numeric_limits<PixelType>::min()))
       {
         target = std::numeric_limits<PixelType>::min();