From 50be538de7d724dfbd0cba7d434d1404b49ce90d Mon Sep 17 00:00:00 2001 From: dirk Date: Mon, 14 Mar 2016 12:42:50 +0100 Subject: [PATCH] Changed return type of GetFillColor and GetStrokeColor. --- MagickCore/annotate.c | 5 ++--- MagickCore/draw-private.h | 24 ++++++++---------------- MagickCore/draw.c | 20 ++++++++++---------- MagickCore/paint.c | 2 +- 4 files changed, 21 insertions(+), 30 deletions(-) diff --git a/MagickCore/annotate.c b/MagickCore/annotate.c index 0d61a6d91..757894276 100644 --- a/MagickCore/annotate.c +++ b/MagickCore/annotate.c @@ -1635,8 +1635,7 @@ static MagickBooleanType RenderFreetype(Image *image,const DrawInfo *draw_info, if (q == (Quantum *) NULL) continue; GetPixelInfo(image,&fill_color); - (void) GetFillColor(draw_info,x_offset,y_offset,&fill_color, - exception); + GetFillColor(draw_info,x_offset,y_offset,&fill_color,exception); fill_opacity=fill_opacity*fill_color.alpha; CompositePixelOver(image,&fill_color,fill_opacity,q, GetPixelAlpha(image,q),q); @@ -2015,7 +2014,7 @@ static MagickBooleanType RenderPostscript(Image *image, break; for (x=0; x < (ssize_t) annotate_image->columns; x++) { - (void) GetFillColor(draw_info,x,y,&fill_color,exception); + GetFillColor(draw_info,x,y,&fill_color,exception); SetPixelAlpha(annotate_image,ClampToQuantum((((double) QuantumScale* GetPixelIntensity(annotate_image,q)*fill_color.alpha))),q); SetPixelRed(annotate_image,fill_color.red,q); diff --git a/MagickCore/draw-private.h b/MagickCore/draw-private.h index 665bdc946..b3d87a03b 100644 --- a/MagickCore/draw-private.h +++ b/MagickCore/draw-private.h @@ -26,47 +26,39 @@ extern "C" { #endif -static inline MagickBooleanType GetFillColor(const DrawInfo *draw_info, - const ssize_t x,const ssize_t y,PixelInfo *fill,ExceptionInfo *exception) +static inline void GetFillColor(const DrawInfo *draw_info,const ssize_t x, + const ssize_t y,PixelInfo *fill,ExceptionInfo *exception) { if (draw_info->fill_pattern == (Image *) NULL) { *fill=draw_info->fill; - return(MagickTrue); + return; } { Image *pattern; - MagickBooleanType - status; - pattern=draw_info->fill_pattern; - status=GetOneVirtualPixelInfo(pattern,TileVirtualPixelMethod,x+ + (void) GetOneVirtualPixelInfo(pattern,TileVirtualPixelMethod,x+ pattern->tile_offset.x,y+pattern->tile_offset.y,fill,exception); - return(status); } } -static inline MagickBooleanType GetStrokeColor(const DrawInfo *draw_info, - const ssize_t x,const ssize_t y,PixelInfo *stroke,ExceptionInfo *exception) +static inline void GetStrokeColor(const DrawInfo *draw_info,const ssize_t x, + const ssize_t y,PixelInfo *stroke,ExceptionInfo *exception) { if (draw_info->stroke_pattern == (Image *) NULL) { *stroke=draw_info->stroke; - return(MagickTrue); + return; } { Image *pattern; - MagickBooleanType - status; - pattern=draw_info->stroke_pattern; - status=GetOneVirtualPixelInfo(pattern,TileVirtualPixelMethod,x+ + (void) GetOneVirtualPixelInfo(pattern,TileVirtualPixelMethod,x+ pattern->tile_offset.x,y+pattern->tile_offset.y,stroke,exception); - return(status); } } diff --git a/MagickCore/draw.c b/MagickCore/draw.c index 1dd1a3c20..f62e851bd 100644 --- a/MagickCore/draw.c +++ b/MagickCore/draw.c @@ -3977,7 +3977,7 @@ RestoreMSCWarning if ((x == (ssize_t) ceil(primitive_info->point.x-0.5)) && (y == (ssize_t) ceil(primitive_info->point.y-0.5))) { - (void) GetFillColor(draw_info,x-start_x,y-start_y,&pixel,exception); + GetFillColor(draw_info,x-start_x,y-start_y,&pixel,exception); SetPixelViaPixelInfo(image,&pixel,q); } q+=GetPixelChannels(image); @@ -4050,11 +4050,11 @@ RestoreMSCWarning fill_alpha=fill_alpha > 0.25 ? 1.0 : 0.0; stroke_alpha=stroke_alpha > 0.25 ? 1.0 : 0.0; } - (void) GetFillColor(draw_info,x-start_x,y-start_y,&fill_color,exception); + GetFillColor(draw_info,x-start_x,y-start_y,&fill_color,exception); fill_alpha=fill_alpha*fill_color.alpha; CompositePixelOver(image,&fill_color,fill_alpha,q,(double) GetPixelAlpha(image,q),q); - (void) GetStrokeColor(draw_info,x-start_x,y-start_y,&stroke_color,exception); + GetStrokeColor(draw_info,x-start_x,y-start_y,&stroke_color,exception); stroke_alpha=stroke_alpha*stroke_color.alpha; CompositePixelOver(image,&stroke_color,stroke_alpha,q,(double) GetPixelAlpha(image,q),q); @@ -4256,7 +4256,7 @@ MagickExport MagickBooleanType DrawPrimitive(Image *image, q=GetCacheViewAuthenticPixels(image_view,x,y,1,1,exception); if (q == (Quantum *) NULL) break; - (void) GetFillColor(draw_info,x,y,&pixel,exception); + GetFillColor(draw_info,x,y,&pixel,exception); SetPixelAlpha(image,ClampToQuantum(pixel.alpha),q); (void) SyncCacheViewAuthenticPixels(image_view,exception); break; @@ -4290,7 +4290,7 @@ MagickExport MagickBooleanType DrawPrimitive(Image *image, q+=GetPixelChannels(image); continue; } - (void) GetFillColor(draw_info,x,y,&pixel,exception); + GetFillColor(draw_info,x,y,&pixel,exception); SetPixelAlpha(image,ClampToQuantum(pixel.alpha),q); q+=GetPixelChannels(image); } @@ -4343,7 +4343,7 @@ MagickExport MagickBooleanType DrawPrimitive(Image *image, break; for (x=0; x < (ssize_t) image->columns; x++) { - (void) GetFillColor(draw_info,x,y,&pixel,exception); + GetFillColor(draw_info,x,y,&pixel,exception); SetPixelAlpha(image,ClampToQuantum(pixel.alpha),q); q+=GetPixelChannels(image); } @@ -4373,7 +4373,7 @@ MagickExport MagickBooleanType DrawPrimitive(Image *image, if (q == (Quantum *) NULL) break; GetPixelInfo(image,&pixel); - (void) GetFillColor(draw_info,x,y,&pixel,exception); + GetFillColor(draw_info,x,y,&pixel,exception); SetPixelViaPixelInfo(image,&pixel,q); (void) SyncCacheViewAuthenticPixels(image_view,exception); break; @@ -4406,7 +4406,7 @@ MagickExport MagickBooleanType DrawPrimitive(Image *image, q+=GetPixelChannels(image); continue; } - (void) GetFillColor(draw_info,x,y,&pixel,exception); + GetFillColor(draw_info,x,y,&pixel,exception); SetPixelViaPixelInfo(image,&pixel,q); q+=GetPixelChannels(image); } @@ -4455,7 +4455,7 @@ MagickExport MagickBooleanType DrawPrimitive(Image *image, break; for (x=0; x < (ssize_t) image->columns; x++) { - (void) GetFillColor(draw_info,x,y,&pixel,exception); + GetFillColor(draw_info,x,y,&pixel,exception); SetPixelViaPixelInfo(image,&pixel,q); q+=GetPixelChannels(image); } @@ -4560,7 +4560,7 @@ MagickExport MagickBooleanType DrawPrimitive(Image *image, q=GetCacheViewAuthenticPixels(image_view,x,y,1,1,exception); if (q == (Quantum *) NULL) break; - (void) GetFillColor(draw_info,x,y,&fill_color,exception); + GetFillColor(draw_info,x,y,&fill_color,exception); CompositePixelOver(image,&fill_color,(double) fill_color.alpha,q, (double) GetPixelAlpha(image,q),q); (void) SyncCacheViewAuthenticPixels(image_view,exception); diff --git a/MagickCore/paint.c b/MagickCore/paint.c index 7e6dea8e7..d0cf78870 100644 --- a/MagickCore/paint.c +++ b/MagickCore/paint.c @@ -351,7 +351,7 @@ MagickExport MagickBooleanType FloodfillPaintImage(Image *image, { if (GetPixelGray(floodplane_image,p) != 0) { - (void) GetFillColor(draw_info,x,y,&fill_color,exception); + GetFillColor(draw_info,x,y,&fill_color,exception); SetPixelViaPixelInfo(image,&fill_color,q); } p+=GetPixelChannels(floodplane_image); -- 2.40.0