]> granicus.if.org Git - imagemagick/commitdiff
Notes about API Resampling method order (filter before scale)
authoranthony <anthony@git.imagemagick.org>
Mon, 27 Sep 2010 13:29:00 +0000 (13:29 +0000)
committeranthony <anthony@git.imagemagick.org>
Mon, 27 Sep 2010 13:29:00 +0000 (13:29 +0000)
magick/resample.c

index b79a61fb071c5cf3975b98fefdfa29b6b994ffeb..083f89769421d3752aff44b6ea3573865afbfc60 100644 (file)
@@ -217,9 +217,6 @@ MagickExport ResampleFilter *AcquireResampleFilter(const Image *image,
   resample_filter->interpolate = resample_filter->image->interpolate;
   resample_filter->virtual_pixel=GetImageVirtualPixelMethod(image);
 
-  /* init scale to a default of a unit circle */
-  ScaleResampleFilter(resample_filter, 1.0, 0.0, 0.0, 1.0);
-
   return(resample_filter);
 }
 \f
@@ -1458,9 +1455,10 @@ static void ClampUpAxes(const double dux,
 %  equations, and not the scaling vectors. As such the middle two vaules
 %  may be swapped from what you expect.  Caution is advised.
 %
-%  It is assumed that the SetResampleFilter method has already been called,
-%  before this ScaleResampleFilter method, so that the size of the ellipse
-%  will match the support for the resampling filter being used.
+%  WARNING: It is assumed that any SetResampleFilter() method call will
+%  always be performed before the ScaleResampleFilter() method, so that the
+%  size of the ellipse will match the support for the resampling filter being
+%  used.
 %
 %  The format of the ScaleResampleFilter method is:
 %
@@ -1736,6 +1734,14 @@ MagickExport void SetResampleFilter(ResampleFilter *resample_filter,
   /* finished with the resize filter */
   resize_filter = DestroyResizeFilter(resize_filter);
 
+  /*
+    Adjust the scaling of the default unit circle
+    This assumes that any real scaling changes will always
+    take place AFTER the filter method has been initialized.
+  */
+
+  ScaleResampleFilter(resample_filter, 1.0, 0.0, 0.0, 1.0);
+
 #if 0
   This is old code kept for reference only.  It is very wrong.
   /*