From 4cc99bd67611f9de0cf149a33519be389b0699f9 Mon Sep 17 00:00:00 2001 From: cristy Date: Sat, 17 Dec 2011 15:30:17 +0000 Subject: [PATCH] --- MagickCore/image.c | 8 ++------ MagickCore/pixel-accessor.h | 17 ----------------- coders/xc.c | 13 +++---------- 3 files changed, 5 insertions(+), 33 deletions(-) diff --git a/MagickCore/image.c b/MagickCore/image.c index 12acbb7e5..5fac59d89 100644 --- a/MagickCore/image.c +++ b/MagickCore/image.c @@ -2581,9 +2581,6 @@ MagickExport MagickBooleanType SetImageBackgroundColor(Image *image, MagickBooleanType status; - PixelInfo - background; - PixelInfo pixel; @@ -2598,12 +2595,11 @@ MagickExport MagickBooleanType SetImageBackgroundColor(Image *image, return(MagickFalse); if (image->background_color.alpha != OpaqueAlpha) image->matte=MagickTrue; - background=image->background_color; - SetPixelInfo(image,&background,&pixel); /* Set image background color. */ status=MagickTrue; + pixel=image->background_color; pixel.black=0; image_view=AcquireCacheView(image); for (y=0; y < (ssize_t) image->rows; y++) @@ -2624,7 +2620,7 @@ MagickExport MagickBooleanType SetImageBackgroundColor(Image *image, } for (x=0; x < (ssize_t) image->columns; x++) { - SetPixelInfoPixel(image,&background,q); + SetPixelInfoPixel(image,&pixel,q); q+=GetPixelChannels(image); } if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse) diff --git a/MagickCore/pixel-accessor.h b/MagickCore/pixel-accessor.h index ed53ba5bb..0956598c5 100644 --- a/MagickCore/pixel-accessor.h +++ b/MagickCore/pixel-accessor.h @@ -552,23 +552,6 @@ static inline void SetPixelIndexTraits(Image *image,const PixelTrait traits) image->channel_map[IndexPixelChannel].traits=traits; } -static inline void SetPixelInfo(const Image *restrict image, - const PixelInfo *restrict p,PixelInfo *restrict q) -{ - q->red=p->red; - q->green=p->green; - q->blue=p->blue; - q->black=0; - if (image->channel_map[BlackPixelChannel].traits != UndefinedPixelTrait) - q->black=p->black; - q->alpha=OpaqueAlpha; - if (image->channel_map[AlphaPixelChannel].traits != UndefinedPixelTrait) - q->alpha=p->alpha; - q->index=0; - if (image->channel_map[IndexPixelChannel].traits != UndefinedPixelTrait) - q->index=p->index; -} - static inline void SetPixelInfoPixel(const Image *restrict image, const PixelInfo *restrict pixel_info,Quantum *restrict pixel) { diff --git a/coders/xc.c b/coders/xc.c index fa8c5ea75..93ef92c72 100644 --- a/coders/xc.c +++ b/coders/xc.c @@ -96,9 +96,6 @@ static Image *ReadXCImage(const ImageInfo *image_info,ExceptionInfo *exception) MagickBooleanType status; - PixelInfo - color; - PixelInfo pixel; @@ -128,16 +125,14 @@ static Image *ReadXCImage(const ImageInfo *image_info,ExceptionInfo *exception) image->rows=1; (void) CopyMagickString(image->filename,image_info->filename,MaxTextExtent); status=QueryColorCompliance((char *) image_info->filename,AllCompliance, - &color,exception); + &pixel,exception); if (status == MagickFalse) { image=DestroyImage(image); return((Image *) NULL); } - image->colorspace=color.colorspace; - image->matte=color.matte; - GetPixelInfo(image,&pixel); - SetPixelInfo(image,&color,&pixel); + image->colorspace=pixel.colorspace; + image->matte=pixel.matte; for (y=0; y < (ssize_t) image->rows; y++) { q=QueueAuthenticPixels(image,0,y,image->columns,1,exception); @@ -146,8 +141,6 @@ static Image *ReadXCImage(const ImageInfo *image_info,ExceptionInfo *exception) for (x=0; x < (ssize_t) image->columns; x++) { SetPixelInfoPixel(image,&pixel,q); - if (image->colorspace == CMYKColorspace) - SetPixelBlack(image,pixel.black,q); q+=GetPixelChannels(image); } if (SyncAuthenticPixels(image,exception) == MagickFalse) -- 2.40.0