]> granicus.if.org Git - imagemagick/blobdiff - coders/uil.c
(no commit message)
[imagemagick] / coders / uil.c
index 7a86a5904e634afce40216e9118c262fda3dfb4a..6811499b175ae4e822f2faad3a2dd7a969079852 100644 (file)
 %                          Write X-Motif UIL Table.                           %
 %                                                                             %
 %                              Software Design                                %
-%                                John Cristy                                  %
+%                                   Cristy                                    %
 %                                 July 1992                                   %
 %                                                                             %
 %                                                                             %
-%  Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization      %
+%  Copyright 1999-2014 ImageMagick Studio LLC, a non-profit organization      %
 %  dedicated to making software imaging solutions freely available.           %
 %                                                                             %
 %  You may not use this file except in compliance with the License.  You may  %
@@ -40,6 +40,7 @@
   Include declarations.
 */
 #include "MagickCore/studio.h"
+#include "MagickCore/attribute.h"
 #include "MagickCore/blob.h"
 #include "MagickCore/blob-private.h"
 #include "MagickCore/cache.h"
@@ -174,12 +175,12 @@ static MagickBooleanType WriteUILImage(const ImageInfo *image_info,Image *image,
     status,
     transparent;
 
-  PixelInfo
-    pixel;
-
   MagickSizeType
     number_pixels;
 
+  PixelInfo
+    pixel;
+
   register const Quantum
     *p;
 
@@ -213,8 +214,7 @@ static MagickBooleanType WriteUILImage(const ImageInfo *image_info,Image *image,
   status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception);
   if (status == MagickFalse)
     return(status);
-  if (IsRGBColorspace(image->colorspace) == MagickFalse)
-    (void) TransformImageColorspace(image,RGBColorspace);
+  (void) TransformImageColorspace(image,sRGBColorspace,exception);
   transparent=MagickFalse;
   i=0;
   p=(const Quantum *) NULL;
@@ -229,7 +229,7 @@ static MagickBooleanType WriteUILImage(const ImageInfo *image_info,Image *image,
         Convert DirectClass to PseudoClass image.
       */
       matte_image=(unsigned char *) NULL;
-      if (image->matte != MagickFalse)
+      if (image->alpha_trait == BlendPixelTrait)
         {
           /*
             Map all the transparent pixels.
@@ -303,10 +303,10 @@ static MagickBooleanType WriteUILImage(const ImageInfo *image_info,Image *image,
     /*
       Define UIL color.
     */
-    SetPixelInfoPacket(image,image->colormap+i,&pixel);
-    pixel.colorspace=RGBColorspace;
+    pixel=image->colormap[i];
+    pixel.colorspace=sRGBColorspace;
     pixel.depth=8;
-    pixel.alpha=(MagickRealType) OpaqueAlpha;
+    pixel.alpha=(double) OpaqueAlpha;
     GetColorTuple(&pixel,MagickTrue,name);
     if (transparent != MagickFalse)
       if (i == (ssize_t) (colors-1))
@@ -329,8 +329,8 @@ static MagickBooleanType WriteUILImage(const ImageInfo *image_info,Image *image,
     else
       (void) FormatLocaleString(buffer,MaxTextExtent,
         "    color('%s',%s) = '%s'",name,
-        GetPixelPacketIntensity(image->colormap+i) <
-        ((Quantum) QuantumRange/2) ? "background" : "foreground",symbol);
+        GetPixelInfoIntensity(image->colormap+i) <
+        (QuantumRange/2) ? "background" : "foreground",symbol);
     (void) WriteBlobString(image,buffer);
     (void) FormatLocaleString(buffer,MaxTextExtent,"%s",
       (i == (ssize_t) (colors-1) ? ");\n" : ",\n"));