[babl] extensions: align rounding of R'G'B'A u8 -> cairo-ARGB32 with reference conversion



commit 16908d115a877d7654bf0e86982db211aa234bd4
Author: Simon Budig <simon budig de>
Date:   Tue Nov 15 02:34:27 2016 +0100

    extensions: align rounding of R'G'B'A u8 -> cairo-ARGB32 with reference conversion

 extensions/cairo.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/extensions/cairo.c b/extensions/cairo.c
index 64af7be..0c4ca78 100644
--- a/extensions/cairo.c
+++ b/extensions/cairo.c
@@ -78,7 +78,7 @@ conv_rgbA8_cairo32_le (unsigned char *src, unsigned char *dst, long samples)
   long n = samples;
   while (n--)
     {
-#define div_255(a) ((((a)+127)+(((a)+127)>>8))>>8)
+#define div_255(a) ((((a)+128)+(((a)+128)>>8))>>8)
       dst[0] = div_255 (src[2] * src[3]);
       dst[1] = div_255 (src[1] * src[3]);
       dst[2] = div_255 (src[0] * src[3]);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]