% July 1992 %
% %
% %
-% Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2013 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 %
Include declarations.
*/
#include "MagickCore/studio.h"
+#include "MagickCore/attribute.h"
#include "MagickCore/blob.h"
#include "MagickCore/blob-private.h"
#include "MagickCore/cache.h"
Forward declarations.
*/
static MagickBooleanType
- WriteUILImage(const ImageInfo *,Image *);
+ WriteUILImage(const ImageInfo *,Image *,ExceptionInfo *);
\f
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% The format of the WriteUILImage method is:
%
-% MagickBooleanType WriteUILImage(const ImageInfo *image_info,Image *image)
+% MagickBooleanType WriteUILImage(const ImageInfo *image_info,
+% Image *image,ExceptionInfo *exception)
%
% A description of each parameter follows.
%
%
% o image: The image.
%
+% o exception: return any errors or warnings in this structure.
+%
*/
-static MagickBooleanType WriteUILImage(const ImageInfo *image_info,Image *image)
+static MagickBooleanType WriteUILImage(const ImageInfo *image_info,Image *image,
+ ExceptionInfo *exception)
{
#define MaxCixels 92
name[MaxTextExtent],
*symbol;
- ExceptionInfo
- *exception;
-
int
j;
status,
transparent;
- PixelInfo
- pixel;
-
MagickSizeType
number_pixels;
+ PixelInfo
+ pixel;
+
register const Quantum
*p;
assert(image->signature == MagickSignature);
if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
- status=OpenBlob(image_info,image,WriteBinaryBlobMode,&image->exception);
+ assert(exception != (ExceptionInfo *) NULL);
+ assert(exception->signature == MagickSignature);
+ status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception);
if (status == MagickFalse)
return(status);
- if (IsRGBColorspace(image->colorspace) == MagickFalse)
- (void) TransformImageColorspace(image,RGBColorspace);
- exception=(&image->exception);
+ if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
+ (void) TransformImageColorspace(image,sRGBColorspace,exception);
transparent=MagickFalse;
i=0;
p=(const Quantum *) NULL;
Convert DirectClass to PseudoClass image.
*/
matte_image=(unsigned char *) NULL;
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
{
/*
Map all the transparent pixels.
if (matte_image[i] != 0)
transparent=MagickTrue;
i++;
- p+=GetPixelComponents(image);
+ p+=GetPixelChannels(image);
}
}
}
- (void) SetImageType(image,PaletteType);
+ (void) SetImageType(image,PaletteType,exception);
colors=image->colors;
if (transparent != MagickFalse)
{
for (y=0; y < (ssize_t) image->rows; y++)
{
q=GetAuthenticPixels(image,0,y,image->columns,1,exception);
- if (q == (const Quantum *) NULL)
+ if (q == (Quantum *) NULL)
break;
for (x=0; x < (ssize_t) image->columns; x++)
{
if (matte_image[i] != 0)
SetPixelIndex(image,image->colors,q);
p++;
- q+=GetPixelComponents(image);
+ q+=GetPixelChannels(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))
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"));
(void) WriteBlobString(image,buffer);
for (y=0; y < (ssize_t) image->rows; y++)
{
- p=GetVirtualPixels(image,0,y,image->columns,1,&image->exception);
+ p=GetVirtualPixels(image,0,y,image->columns,1,exception);
if (p == (const Quantum *) NULL)
break;
(void) WriteBlobString(image," \"");
symbol[j]='\0';
(void) CopyMagickString(buffer,symbol,MaxTextExtent);
(void) WriteBlobString(image,buffer);
- p+=GetPixelComponents(image);
+ p+=GetPixelChannels(image);
}
(void) FormatLocaleString(buffer,MaxTextExtent,"\"%s\n",
(y == (ssize_t) (image->rows-1) ? ");" : ","));