From ed6987ec19a30ed15c39904f4b01e1875611d84a Mon Sep 17 00:00:00 2001 From: cristy Date: Tue, 19 Feb 2013 14:10:05 +0000 Subject: [PATCH] --- MagickCore/layer.c | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/MagickCore/layer.c b/MagickCore/layer.c index 1699005c6..72594fe97 100644 --- a/MagickCore/layer.c +++ b/MagickCore/layer.c @@ -178,10 +178,8 @@ static MagickBooleanType IsBoundsCleared(const Image *image1, return(MagickFalse); for (y=0; y < (ssize_t) bounds->height; y++) { - p=GetVirtualPixels(image1,bounds->x,bounds->y+y,bounds->width,1, - exception); - q=GetVirtualPixels(image2,bounds->x,bounds->y+y,bounds->width,1, - exception); + p=GetVirtualPixels(image1,bounds->x,bounds->y+y,bounds->width,1,exception); + q=GetVirtualPixels(image2,bounds->x,bounds->y+y,bounds->width,1,exception); if ((p == (const Quantum *) NULL) || (q == (Quantum *) NULL)) break; for (x=0; x < (ssize_t) bounds->width; x++) @@ -328,9 +326,9 @@ MagickExport Image *CoalesceImages(const Image *image,ExceptionInfo *exception) coalesce_image->next->previous=coalesce_image; previous=coalesce_image; coalesce_image=GetNextImageInList(coalesce_image); - (void) CompositeImage(coalesce_image,next,next->alpha_trait == BlendPixelTrait ? - OverCompositeOp : CopyCompositeOp,MagickTrue,next->page.x,next->page.y, - exception); + (void) CompositeImage(coalesce_image,next, + next->alpha_trait == BlendPixelTrait ? OverCompositeOp : CopyCompositeOp, + MagickTrue,next->page.x,next->page.y,exception); (void) CloneImageProfiles(coalesce_image,next); (void) CloneImageProperties(coalesce_image,next); (void) CloneImageArtifacts(coalesce_image,next); @@ -423,9 +421,9 @@ MagickExport Image *DisposeImages(const Image *images,ExceptionInfo *exception) dispose_image=DestroyImage(dispose_image); return((Image *) NULL); } - (void) CompositeImage(current_image,next,next->alpha_trait == BlendPixelTrait ? - OverCompositeOp : CopyCompositeOp,MagickTrue,next->page.x,next->page.y, - exception); + (void) CompositeImage(current_image,next, + next->alpha_trait == BlendPixelTrait ? OverCompositeOp : CopyCompositeOp, + MagickTrue,next->page.x,next->page.y,exception); /* Handle Background dispose: image is displayed for the delay period. */ @@ -534,16 +532,14 @@ static MagickBooleanType ComparePixels(const LayerMethod method, o1 = (p->alpha_trait == BlendPixelTrait) ? p->alpha : OpaqueAlpha; o2 = (q->alpha_trait == BlendPixelTrait) ? q->alpha : OpaqueAlpha; - /* - Pixel goes from opaque to transprency + Pixel goes from opaque to transprency. */ if (method == CompareClearLayer) return((MagickBooleanType) ( (o1 <= ((double) QuantumRange/2.0)) && (o2 > ((double) QuantumRange/2.0)) ) ); - /* - overlay would change first pixel by second + Overlay would change first pixel by second. */ if (method == CompareOverlayLayer) { @@ -589,8 +585,8 @@ static MagickBooleanType ComparePixels(const LayerMethod method, % */ -static RectangleInfo CompareImagesBounds(const Image *image1,const Image *image2, - const LayerMethod method,ExceptionInfo *exception) +static RectangleInfo CompareImagesBounds(const Image *image1, + const Image *image2,const LayerMethod method,ExceptionInfo *exception) { RectangleInfo bounds; @@ -814,7 +810,6 @@ MagickExport Image *CompareImagesLayers(const Image *image, (void) CompositeImage(image_a,next,CopyCompositeOp,MagickTrue,next->page.x, next->page.y,exception); bounds[i]=CompareImagesBounds(image_b,image_a,method,exception); - image_b=DestroyImage(image_b); i++; } @@ -947,13 +942,12 @@ static Image *OptimizeLayerFrames(const Image *image, assert(method == OptimizeLayer || method == OptimizeImageLayer || method == OptimizePlusLayer); - /* - Are we allowed to add/remove frames from animation + Are we allowed to add/remove frames from animation? */ add_frames=method == OptimizePlusLayer ? MagickTrue : MagickFalse; /* - Ensure all the images are the same size + Ensure all the images are the same size. */ curr=GetFirstImageInList(image); for (; curr != (Image *) NULL; curr=GetNextImageInList(curr)) -- 2.40.0