From afa27fc5556aa9b9214e09aaf260fde67f9f2145 Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Thu, 11 Nov 2021 15:36:05 +0900 Subject: [PATCH] Round values when creating image from rankings --- src/blue_noise.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/blue_noise.hpp b/src/blue_noise.hpp index 75d76f4..16527b9 100644 --- a/src/blue_noise.hpp +++ b/src/blue_noise.hpp @@ -15,6 +15,7 @@ #include #include #include +#include #include @@ -419,7 +420,7 @@ namespace internal { && "New image::Bl size too small (values' size is not a multiple of width)"); for(unsigned int i = 0; i < values.size(); ++i) { - grImage.getData()[i] = ((float)((int)(values[i]) - min) / (float)max) * 255.0F; + grImage.getData()[i] = std::round(((float)((int)(values[i]) - min) / (float)max) * 255.0F); } return grImage;