[babl] extensions/gggl-lies: bump up accuracy of a conversion



commit 57a18b8f93b155396060a4828e61cd063a9e54ec
Author: Øyvind Kolås <pippin gimp org>
Date:   Thu Nov 17 13:09:54 2016 +0100

    extensions/gggl-lies: bump up accuracy of a conversion

 extensions/gggl-lies.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
---
diff --git a/extensions/gggl-lies.c b/extensions/gggl-lies.c
index 22d0fee..5d50f5b 100644
--- a/extensions/gggl-lies.c
+++ b/extensions/gggl-lies.c
@@ -46,8 +46,6 @@
  * need this piece of code for projects where GPL compatibility
  * was a must.
  *
- * TODO: error diffusion,
- *       gamma correction  (not really,. gamma correction belongs in seperate ops,.
  */
 
 static long
@@ -635,7 +633,7 @@ conv_rgbA8_rgba8 (unsigned char *src, unsigned char *dst, long samples)
         }
       else
         {
-          unsigned int aa = ((255 << 16) + (src[3] >> 1)) / src[3];
+          unsigned int aa = ((255 << 16) - 255) / src[3];
           *dst++ = (src[0] * aa + 0x8000) >> 16;
           *dst++ = (src[1] * aa + 0x8000) >> 16;
           *dst++ = (src[2] * aa + 0x8000) >> 16;


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