gimp r27541 - in trunk: . app/gegl



Author: martinn
Date: Mon Nov  3 23:00:40 2008
New Revision: 27541
URL: http://svn.gnome.org/viewvc/gimp?rev=27541&view=rev

Log:
* app/gegl/gimpoperationpointlayermode.c
(gimp_operation_point_layer_mode_process): Reuse the blending
formula from the legacy Soft light. (Actually the formula comes
from legacy Overlay but legacy Overlay and Soft light blends
pixels exactly the same.) I hereby declare the porting of the
layer modes to this GEGL operation complete. Summary:

Completely works the same:

  Normal, Dissolve, Behind, Color Erase, Erase, Anti Erase

Works the same for 100% opaque layers:

  Lighten only, Screen, Dodge, Addition, Darken only, Multiply,
  Dodge, Soft light, Hard light, Difference, Subtract, Grain
  extract, Grain merge, Divide, Hue, Saturation, Color, Value

Works different but similar:

  Overlay now uses the SVG 1.2 overlay formula which is different
  but similar to legacy Overlay

  Replace needs to be externally masked to not replace too much,
  but that is outside the scope of the layer mode porting.


Modified:
   trunk/ChangeLog
   trunk/app/gegl/gimpoperationpointlayermode.c

Modified: trunk/app/gegl/gimpoperationpointlayermode.c
==============================================================================
--- trunk/app/gegl/gimpoperationpointlayermode.c	(original)
+++ trunk/app/gegl/gimpoperationpointlayermode.c	Mon Nov  3 23:00:40 2008
@@ -491,17 +491,12 @@
           break;
 
         case GIMP_SOFTLIGHT_MODE:
-          /* SVG 1.2 soft-light */
-          /* FIXME: This exactly like in the SVG 1.2 draft but it is
-           * buggy and we need sort this out
+          /* Custom SVG 1.2:
+           *
+           * f(Sc, Dc) = Dc * (Dc + (2 * Sc * (1 - Dc)))
            */
           EACH_CHANNEL (
-          if (2 * layCa < layA)
-            outCa = inCa * (layA - (1 - inC) * (2 * layCa - layA)) + layCa * (1 - inA) + inCa * (1 - layA);
-          else if (8 * inCa <= inA)
-            outCa = inCa * (layA - (1 - inC) * (2 * layCa - layA) * (3 - 8 * inC)) + layCa * (1 - inA) + inCa * (1 - layA);
-          else
-            outCa = (inCa * layA + (sqrt (inC) * inA - inCa) * (2 * layCa - layA)) + layCa * (1 - inA) + inCa * (1 - layA));
+          outCa = inCa * (layA * inC + (2 * layCa * (1 - inC))) + layCa * (1 - inA) + inCa * (1 - layA));
           break;
 
         case GIMP_ADDITION_MODE:



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