]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Sat, 17 Dec 2011 15:30:17 +0000 (15:30 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Sat, 17 Dec 2011 15:30:17 +0000 (15:30 +0000)
MagickCore/image.c
MagickCore/pixel-accessor.h
coders/xc.c

index 12acbb7e592e9ee9375f35a0334d73dea0a8525b..5fac59d89a343c5a4dae19e3f3ec0306e82ac41c 100644 (file)
@@ -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)
index ed53ba5bbcefce3de05961ebc4f7376a695fa9bd..0956598c5a4a491382d6cd699174a87d6a94a77b 100644 (file)
@@ -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)
 {
index fa8c5ea75320a3172cd079f85e632f565b34777f..93ef92c72a1cc8e8946b0cccdffd7bac079eb286 100644 (file)
@@ -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)