Reuse the blending formula from the legacy Soft light. (Actually the

* 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.

svn path=/trunk/; revision=27541
This commit is contained in:
Martin Nordholts 2008-11-03 23:00:40 +00:00
parent 052a86548e
commit 3cd7f45a2b
2 changed files with 31 additions and 9 deletions

View File

@ -1,3 +1,30 @@
2008-11-03 Martin Nordholts <martinn@svn.gnome.org>
* 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.
2008-11-03 Martin Nordholts <martinn@svn.gnome.org>
* app/widgets/gimpwidgets-constructors.c

View File

@ -491,17 +491,12 @@ gimp_operation_point_layer_mode_process (GeglOperation *operation,
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: