gimp r27411 - in trunk: . app/gegl



Author: martinn
Date: Sun Oct 26 13:48:19 2008
New Revision: 27411
URL: http://svn.gnome.org/viewvc/gimp?rev=27411&view=rev

Log:
* app/gegl/gimpoperationpointlayermode.c: Enable the [0..1]
clamping of the output for Dodge and Burn. Without the clamping
one gets inconsistent results when blending together identical
layers but with different opacities. Maybe we should make the
clamping configurable and introduce a HDR compositing mode or
something?


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	Sun Oct 26 13:48:19 2008
@@ -242,14 +242,14 @@
           break;
 
         case GIMP_DODGE_MODE:
-          /* SVG 1.2 color-dodge with disabled [0..1] clamping */
-          /* if (lay[R] * in[A] + in[R] * lay[A] >= lay[A] * in[A])
+          /* SVG 1.2 color-dodge */
+          if (lay[R] * in[A] + in[R] * lay[A] >= lay[A] * in[A])
             {
               out[R] = lay[A] * in[A] + lay[R] * (1 - in[A]) + in[R] * (1 - lay[A]);
-              out[R] = lay[A] * in[A] + lay[R] * (1 - in[A]) + in[R] * (1 - lay[A]);
-              out[R] = lay[A] * in[A] + lay[R] * (1 - in[A]) + in[R] * (1 - lay[A]);
+              out[G] = lay[A] * in[A] + lay[G] * (1 - in[A]) + in[G] * (1 - lay[A]);
+              out[B] = lay[A] * in[A] + lay[B] * (1 - in[A]) + in[B] * (1 - lay[A]);
             }
-          else */
+          else
             {
               out[R] = in[R] * lay[A] / (1 - lay[R] / lay[A]) + lay[R] * (1 - in[A]) + in[R] * (1 - lay[A]);
               out[G] = in[G] * lay[A] / (1 - lay[G] / lay[A]) + lay[G] * (1 - in[A]) + in[G] * (1 - lay[A]);
@@ -258,14 +258,14 @@
           break;
 
         case GIMP_BURN_MODE:
-          /* SVG 1.2 color-burn with disabled [0..1] clamping */
-          /* if (lay[R] * in[A] + in[R] * lay[A] <= lay[A] * in[A])
+          /* SVG 1.2 color-burn */
+          if (lay[R] * in[A] + in[R] * lay[A] <= lay[A] * in[A])
             {
               out[R] = lay[R] * (1 - in[A]) + in[R] * (1 - lay[A]);
               out[G] = lay[G] * (1 - in[A]) + in[G] * (1 - lay[A]);
               out[B] = lay[B] * (1 - in[A]) + in[B] * (1 - lay[A]);
             }
-          else */
+          else
             {
               out[R] = lay[A] * (lay[R] * in[A] + in[R] * lay[A] - lay[A] * in[A])/lay[R] + lay[R] * (1 - in[A]) + in[R] * (1 - lay[A]);
               out[G] = lay[A] * (lay[G] * in[A] + in[G] * lay[A] - lay[A] * in[A])/lay[G] + lay[G] * (1 - in[A]) + in[G] * (1 - lay[A]);



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