[gimp] Reintroduce a cleaner version of the linear light fix



commit 5c873bd93fed09913b3cf298f21818cfd0ae26ca
Author: Alexandre Prokoudine <alexandre prokoudine gmail com>
Date:   Sun Feb 5 03:25:14 2017 +0300

    Reintroduce a cleaner version of the linear light fix

 .../layer-modes/gimpoperationlayermode.c           |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/app/operations/layer-modes/gimpoperationlayermode.c 
b/app/operations/layer-modes/gimpoperationlayermode.c
index 9b11bcf..bfc62b2 100644
--- a/app/operations/layer-modes/gimpoperationlayermode.c
+++ b/app/operations/layer-modes/gimpoperationlayermode.c
@@ -1766,7 +1766,7 @@ blendfun_vivid_light (const float *dest,
 
 
 /* added according to:
-    http://www.simplefilter.de/en/basics/mixmods.html */
+    http://www.deepskycolors.com/archivo/2010/04/21/formulas-for-Photoshop-blending-modes.html */
 static inline void
 blendfun_linear_light (const float *dest,
                        const float *src,
@@ -1782,7 +1782,14 @@ blendfun_linear_light (const float *dest,
           for (c = 0; c < 3; c++)
             {
               gfloat comp;
-              comp = dest[c] + 2.0f * src[c] - 1.0f;
+              if (src[c] <= 0.5f)
+                {
+                  comp = dest[c] + 2.0 * src[c] - 1.0f;
+                }
+              else
+                {
+                  comp = dest[c] + 2.0 * (src[c] - 0.5f);
+                }
               out[c] = comp;
             }
         }


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