gimp r27269 - in trunk: . app/gegl
- From: martinn svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r27269 - in trunk: . app/gegl
- Date: Mon, 13 Oct 2008 19:27:43 +0000 (UTC)
Author: martinn
Date: Mon Oct 13 19:27:43 2008
New Revision: 27269
URL: http://svn.gnome.org/viewvc/gimp?rev=27269&view=rev
Log:
* app/gegl/gimpoperationadditionmode.c
(gimp_operation_addition_mode_process): Update with a new version
that is the best known so far (maybe it's even correct?).
Modified:
trunk/ChangeLog
trunk/app/gegl/gimpoperationadditionmode.c
Modified: trunk/app/gegl/gimpoperationadditionmode.c
==============================================================================
--- trunk/app/gegl/gimpoperationadditionmode.c (original)
+++ trunk/app/gegl/gimpoperationadditionmode.c Mon Oct 13 19:27:43 2008
@@ -72,11 +72,21 @@
while (samples--)
{
#if 1
+ // Best so far (maybe even correct?)
+ dest[RED_PIX] = src[RED_PIX] + aux[RED_PIX] * aux[ALPHA_PIX];
+ dest[GREEN_PIX] = src[GREEN_PIX] + aux[GREEN_PIX] * aux[ALPHA_PIX];
+ dest[BLUE_PIX] = src[BLUE_PIX] + aux[BLUE_PIX] * aux[ALPHA_PIX];
+ dest[ALPHA_PIX] = src[ALPHA_PIX];
+#else
+ // Wrong, doesn't take layer opacity of Addition-mode layer into
+ // account
dest[RED_PIX] = src[RED_PIX] + aux[RED_PIX];
dest[GREEN_PIX] = src[GREEN_PIX] + aux[GREEN_PIX];
dest[BLUE_PIX] = src[BLUE_PIX] + aux[BLUE_PIX];
dest[ALPHA_PIX] = src[ALPHA_PIX];
-#else
+
+ // Wrong, toggling visibility of completely transparent
+ // Addition-mode layer changes projection
dest[RED_PIX] = src[RED_PIX] * src[ALPHA_PIX] + aux[RED_PIX] * aux[ALPHA_PIX];
dest[GREEN_PIX] = src[GREEN_PIX] * src[ALPHA_PIX] + aux[GREEN_PIX] * aux[ALPHA_PIX];
dest[BLUE_PIX] = src[BLUE_PIX] * src[ALPHA_PIX] + aux[BLUE_PIX] * aux[ALPHA_PIX];
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]