From: cristy Date: Wed, 29 Aug 2012 00:06:25 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~5043 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5a5e4d97bc9afa4660902954d2eed4f23582dfec;p=imagemagick --- diff --git a/MagickCore/image.c b/MagickCore/image.c index d58a7714f..ec4388ede 100644 --- a/MagickCore/image.c +++ b/MagickCore/image.c @@ -441,13 +441,15 @@ MagickExport Image *AppendImages(const Image *images, *append_image; MagickBooleanType - matte, proceed, status; MagickOffsetType n; + PixelTrait + alpha_trait; + RectangleInfo geometry; @@ -473,7 +475,7 @@ MagickExport Image *AppendImages(const Image *images, (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",images->filename); assert(exception != (ExceptionInfo *) NULL); assert(exception->signature == MagickSignature); - matte=images->alpha_trait; + alpha_trait=images->alpha_trait; number_images=1; width=images->columns; height=images->rows; @@ -481,7 +483,7 @@ MagickExport Image *AppendImages(const Image *images, for ( ; next != (Image *) NULL; next=GetNextImageInList(next)) { if (next->alpha_trait == BlendPixelTrait) - matte=MagickTrue; + alpha_trait=BlendPixelTrait; number_images++; if (stack != MagickFalse) { @@ -505,7 +507,7 @@ MagickExport Image *AppendImages(const Image *images, append_image=DestroyImage(append_image); return((Image *) NULL); } - append_image->alpha_trait=matte; + append_image->alpha_trait=alpha_trait; (void) SetImageBackgroundColor(append_image,exception); status=MagickTrue; x_offset=0; @@ -1167,7 +1169,7 @@ MagickExport MagickBooleanType GetImageAlphaChannel(const Image *image) if (image->debug != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"..."); assert(image->signature == MagickSignature); - return(image->alpha_trait); + return(image->alpha_trait == BlendPixelTrait ? MagickTrue : MagickFalse); } /* @@ -3387,13 +3389,15 @@ MagickExport Image *SmushImages(const Image *images, *smush_image; MagickBooleanType - matte, proceed, status; MagickOffsetType n; + PixelTrait + alpha_trait; + RectangleInfo geometry; @@ -3419,7 +3423,7 @@ MagickExport Image *SmushImages(const Image *images, assert(exception != (ExceptionInfo *) NULL); assert(exception->signature == MagickSignature); image=images; - matte=image->alpha_trait; + alpha_trait=image->alpha_trait; number_images=1; width=image->columns; height=image->rows; @@ -3427,7 +3431,7 @@ MagickExport Image *SmushImages(const Image *images, for ( ; next != (Image *) NULL; next=GetNextImageInList(next)) { if (next->alpha_trait == BlendPixelTrait) - matte=MagickTrue; + alpha_trait=BlendPixelTrait; number_images++; if (stack != MagickFalse) { @@ -3455,7 +3459,7 @@ MagickExport Image *SmushImages(const Image *images, smush_image=DestroyImage(smush_image); return((Image *) NULL); } - smush_image->alpha_trait=matte; + smush_image->alpha_trait=alpha_trait; (void) SetImageBackgroundColor(smush_image,exception); status=MagickTrue; x_offset=0; diff --git a/MagickCore/pixel.c b/MagickCore/pixel.c index a1856c49b..1d88162dd 100644 --- a/MagickCore/pixel.c +++ b/MagickCore/pixel.c @@ -3992,38 +3992,39 @@ static inline double MagickMax(const double x,const double y) return(y); } -static inline void CatromWeights(const double x, - double (*weights)[4]) +static inline void CatromWeights(const double x,double **weights) { - /* - Nicolas Robidoux' 10 flops (4* + 5- + 1+) refactoring of the - computation of the standard four 1D Catmull-Rom weights. The - sampling location is assumed between the second and third input - pixel locations, and x is the position relative to the second - input pixel location. Formulas originally derived for the VIPS - (Virtual Image Processing System) library. - */ double alpha, beta, gamma; + /* + Nicolas Robidoux' 10 flops (4* + 5- + 1+) refactoring of the computation + of the standard four 1D Catmull-Rom weights. The sampling location is + assumed between the second and third input pixel locations, and x is the + position relative to the second input pixel location. Formulas originally + derived for the VIPS (Virtual Image Processing System) library. + */ alpha=(double) 1.0-x; beta=(double) (-0.5)*x*alpha; (*weights)[0]=alpha*beta; (*weights)[3]=x*beta; /* - The following computation of the inner weights from the outer ones - works for all Keys cubics. + The following computation of the inner weights from the outer ones work + for all Keys cubics. */ gamma=(*weights)[3]-(*weights)[0]; (*weights)[1]=alpha-(*weights)[0]+gamma; (*weights)[2]=x-(*weights)[3]-gamma; } -static inline void SplineWeights(const double x, - double (*weights)[4]) +static inline void SplineWeights(const double x,double **weights) { + double + alpha, + beta; + /* Nicolas Robidoux' 12 flops (6* + 5- + 1+) refactoring of the computation of the standard four 1D cubic B-spline smoothing @@ -4031,10 +4032,6 @@ static inline void SplineWeights(const double x, third input pixel locations, and x is the position relative to the second input pixel location. */ - double - alpha, - beta; - alpha=(double) 1.0-x; (*weights)[3]=(double) (1.0/6.0)*x*x*x; (*weights)[0]=(double) (1.0/6.0)*alpha*alpha*alpha;