]> granicus.if.org Git - imagemagick/commitdiff
Output Scaling of Horizon anti-aliasing in Perspective Distortions
authoranthony <anthony@git.imagemagick.org>
Sun, 3 Oct 2010 06:16:09 +0000 (06:16 +0000)
committeranthony <anthony@git.imagemagick.org>
Sun, 3 Oct 2010 06:16:09 +0000 (06:16 +0000)
ChangeLog
magick/distort.c

index 230b41ae532417dd80f5e4ed81b666cad79e7ab3..32f3be34635d9ab65ff9173daaeb70764a9443a0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,7 @@
     However it is still a very blury filter for default use in EWA.
   * Adjusted Variable Mapping Blur Composition so user arguments actual
     relate properly to the sigma of the blur for a maximum mapping value.
+  * Fix horizon anti-alising for output scaled perspective distortions.
 
 2010-09-28  6.6.4-8 Nicolas Robidoux <nicolas.robidoux@gmail...>
   * Chantal Racette double checked the bounding parallelogram computation
index aacc3a1062f454573256aaeaa00786e90689afad..b67ed22d13bc63424ad1db4a7f2bed5db6e1e9a1 100644 (file)
@@ -2062,11 +2062,11 @@ MagickExport Image *DistortImage(const Image *image,DistortImageMethod method,
             abs_c6 = fabs(coeff[6]);
             abs_c7 = fabs(coeff[7]);
             if ( abs_c6 > abs_c7 ) {
-              if ( abs_r < abs_c6 )
-                validity = 0.5 - coeff[8]*r/coeff[6];
+              if ( abs_r < abs_c6*output_scaling )
+                validity = 0.5 - coeff[8]*r/(coeff[6]*output_scaling);
             }
-            else if ( abs_r < abs_c7 )
-              validity = 0.5 - coeff[8]*r/coeff[7];
+            else if ( abs_r < abs_c7*output_scaling )
+              validity = 0.5 - coeff[8]*r/(coeff[7]*output_scaling);
             /* Perspective Sampling Point (if valid) */
             if ( validity > 0.0 ) {
               /* divide by r affine, for perspective scaling */
@@ -2614,7 +2614,7 @@ MagickExport Image *SparseColorImage(const Image *image,
             break;
           }
           case ShepardsColorInterpolate:
-          { /* Shepards Method,uses its own input arguments as coefficients.
+          { /* Shepards Method, uses its own input arguments as coefficients.
             */
             size_t
               k;