gimp r25568 - in branches/gimp-2-4: . plug-ins/common



Author: neo
Date: Mon May  5 14:04:38 2008
New Revision: 25568
URL: http://svn.gnome.org/viewvc/gimp?rev=25568&view=rev

Log:
2008-05-05  Sven Neumann  <sven gimp org>

	Merged from trunk:

	* plug-ins/common/unsharp-mask.c (gen_convolve_matrix): fixed
	algorithm to calculate the center value. Fixes bug #530077.


Modified:
   branches/gimp-2-4/ChangeLog
   branches/gimp-2-4/plug-ins/common/unsharp.c

Modified: branches/gimp-2-4/plug-ins/common/unsharp.c
==============================================================================
--- branches/gimp-2-4/plug-ins/common/unsharp.c	(original)
+++ branches/gimp-2-4/plug-ins/common/unsharp.c	Mon May  5 14:04:38 2008
@@ -571,8 +571,10 @@
       sum = 0;
       for (j = 1; j <= 50; j++)
         {
-          if (base_x + 0.02 * j <= radius)
-            sum += exp (- SQR (base_x + 0.02 * j) / (2 * SQR (std_dev)));
+          gdouble r = base_x + 0.02 * j;
+
+          if (r <= radius)
+            sum += exp (- SQR (r) / (2 * SQR (std_dev)));
         }
 
       cmatrix[i] = sum / 50;
@@ -586,7 +588,7 @@
    * even if the center point is weighted slightly higher than others. */
   sum = 0;
   for (j = 0; j <= 50; j++)
-    sum += exp (- SQR (0.5 + 0.02 * j) / (2 * SQR (std_dev)));
+    sum += exp (- SQR (- 0.5 + 0.02 * j) / (2 * SQR (std_dev)));
 
   cmatrix[matrix_length / 2] = sum / 51;
 



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