From 9237533f557dba8e8ab02f1be43effa6c0e3a97b Mon Sep 17 00:00:00 2001 From: nicolas Date: Tue, 21 Sep 2010 00:32:38 +0000 Subject: [PATCH] Changed macro name MagickPIL to MagickRealTypePI --- ChangeLog | 7 ++++--- magick/resize.c | 20 ++++++++++---------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index a84238b36..d9af87186 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,8 @@ 2010-09-20 6.6.4-5 Nicolas Robidoux - * Modified "magick/resize.c" so that PIL is a MagickRealType number. Earlier, - some computations were needlessly done in long double precision because PIL - forced an automatic upcast wherever it appeared. + * Modified "magick/resize.c" so that MagickPIL is a MagickRealType number. + Earlier, some computations were needlessly done in long double precision + because PIL forced an automatic upcast wherever it appeared. Changed its + name to MagickRealTypePI. * Modified "magick/resize.c" so that Bohman uses one trig call + one sqrt call instead of two trig calls. diff --git a/magick/resize.c b/magick/resize.c index 3457f0038..7f24af2c9 100644 --- a/magick/resize.c +++ b/magick/resize.c @@ -133,7 +133,7 @@ static MagickRealType % */ -#define MagickPIL ((MagickRealType) 3.14159265358979323846264338327950288420L) +#define MagickREALTYPEPI ((MagickRealType) 3.14159265358979323846264338327950288420L) static MagickRealType Bessel(const MagickRealType x, const ResizeFilter *magick_unused(resize_filter)) @@ -145,8 +145,8 @@ static MagickRealType Bessel(const MagickRealType x, http://www.ph.ed.ac.uk/%7ewjh/teaching/mo/slides/lens/lens.pdf. */ if (x == 0.0) - return((MagickRealType) (0.25*MagickPIL)); - return(BesselOrderOne((MagickRealType) (MagickPIL*x))/(x+x)); + return((MagickRealType) (0.25*MagickREALTYPEPI)); + return(BesselOrderOne((MagickRealType) (MagickREALTYPEPI*x))/(x+x)); } static MagickRealType Blackman(const MagickRealType x, @@ -158,7 +158,7 @@ static MagickRealType Blackman(const MagickRealType x, Refactored by Chantal Racette and Nicolas Robidoux to one trig call and five flops. */ - const MagickRealType cospix = cos((double) (MagickPIL*x)); + const MagickRealType cospix = cos((double) (MagickREALTYPEPI*x)); return(0.34+cospix*(0.5+cospix*0.16)); } @@ -172,9 +172,9 @@ static MagickRealType Bohman(const MagickRealType x, and 7 flops, taking advantage of the fact that the support of Bohman is 1 (so that we know that sin(pi x) >= 0). */ - const double cospix = cos((double) (MagickPIL*x)); + const double cospix = cos((double) (MagickREALTYPEPI*x)); const double sinpix = sqrt(1.0-cospix*cospix); - return((MagickRealType) ((1.0-x)*cospix+(1.0/MagickPIL)*sinpix)); + return((MagickRealType) ((1.0-x)*cospix+(1.0/MagickREALTYPEPI)*sinpix)); } static MagickRealType Box(const MagickRealType x, @@ -246,7 +246,7 @@ static MagickRealType Hanning(const MagickRealType x, /* Cosine window function: .5 + .5 cos(pi x). */ - const MagickRealType cospix = cos((double) (MagickPIL*x)); + const MagickRealType cospix = cos((double) (MagickREALTYPEPI*x)); return(0.5+0.5*cospix); } @@ -256,7 +256,7 @@ static MagickRealType Hamming(const MagickRealType x, /* Offset cosine window function: .54 + .46 cos(pi x). */ - const MagickRealType cospix = cos((double) (MagickPIL*x)); + const MagickRealType cospix = cos((double) (MagickREALTYPEPI*x)); return(0.54+0.46*cospix); } @@ -333,7 +333,7 @@ static MagickRealType Sinc(const MagickRealType x, */ if (x != 0.0) { - const MagickRealType pix = (MagickRealType) (MagickPIL*x); + const MagickRealType pix = (MagickRealType) (MagickREALTYPEPI*x); return(sin((double) pix)/pix); } return(1.0); @@ -373,7 +373,7 @@ static MagickRealType SincFast(const MagickRealType x, */ if (x > 4.0) { - const MagickRealType pix = (MagickRealType) (MagickPIL*x); + const MagickRealType pix = (MagickRealType) (MagickREALTYPEPI*x); return(sin((double) pix)/pix); } { -- 2.40.0