Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/imbuf/intern/filter.c')
-rw-r--r--source/blender/imbuf/intern/filter.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/imbuf/intern/filter.c b/source/blender/imbuf/intern/filter.c
index 12f90f27309..cce264624ce 100644
--- a/source/blender/imbuf/intern/filter.c
+++ b/source/blender/imbuf/intern/filter.c
@@ -22,6 +22,8 @@
* \ingroup imbuf
*/
+#include <math.h>
+
#include "MEM_guardedalloc.h"
#include "BLI_math_base.h"
@@ -527,7 +529,7 @@ void IMB_filter_extend(struct ImBuf *ibuf, char *mask, int filter)
else {
for (c = 0; c < depth; c++) {
((unsigned char *)dstbuf)[depth * index + c] =
- acc[c] > 255 ? 255 : (acc[c] < 0 ? 0 : ((unsigned char)(acc[c] + 0.5f)));
+ acc[c] > 255 ? 255 : (acc[c] < 0 ? 0 : (unsigned char)roundf(acc[c]));
}
}