[gimp] Bug 728607 - Patch to make divide blend mode work at 32-bit floating point



commit 3915ac01b4be62dec26c3e19c18c60f23ebd724d
Author: Elle Stone <ellestone ninedegreesbelow com>
Date:   Sun Apr 20 08:39:23 2014 -0400

    Bug 728607 - Patch to make divide blend mode work at 32-bit floating point
    
    Properly port divide mode to 32-bit float.

 app/operations/gimpoperationdividemode.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/app/operations/gimpoperationdividemode.c b/app/operations/gimpoperationdividemode.c
index 4e1b038..70dbf64 100644
--- a/app/operations/gimpoperationdividemode.c
+++ b/app/operations/gimpoperationdividemode.c
@@ -108,8 +108,8 @@ gimp_operation_divide_mode_process_pixels (gfloat              *in,
 
           for (b = RED; b < ALPHA; b++)
             {
-              gfloat comp = (256.0 / 255.0 * in[b]) / (1.0 / 255.0 + layer[b]);
-              comp = MIN (comp, 1.0);
+              gfloat comp = (4294967296.0 / 4294967295.0 * in[b]) / (1.0 / 4294967295.0 + layer[b]);
+              comp = CLAMP (comp, 0.0, 1.0);
 
               out[b] = comp * ratio + in[b] * (1.0 - ratio);
             }


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