% July 1992 %
% %
% %
-% Copyright 1999-2012 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 %
break;
}
}
- if (pixel.colorspace == LabColorspace)
+ if (image->colorspace == LabColorspace)
{
- pixel.green+=(range+1)/2.0;
- pixel.blue+=(range+1)/2.0;
+ green+=(range+1)/2.0;
+ blue+=(range+1)/2.0;
}
pixel.red=ScaleAnyToQuantum((QuantumAny) (red+0.5),range);
pixel.green=ScaleAnyToQuantum((QuantumAny) (green+0.5),range);
colorspace[MaxTextExtent],
tuple[MaxTextExtent];
+ const char
+ *option;
+
MagickBooleanType
+ sparse_color,
status;
MagickOffsetType
status=OpenBlob(image_info,image,WriteBlobMode,exception);
if (status == MagickFalse)
return(status);
+ option=GetImageOption(image_info,"txt:sparse-color");
+ sparse_color=IsStringTrue(option);
scene=0;
do
{
break;
for (x=0; x < (ssize_t) image->columns; x++)
{
- (void) FormatLocaleString(buffer,MaxTextExtent,"%.20g,%.20g: ",(double)
- x,(double) y);
- (void) WriteBlobString(image,buffer);
GetPixelInfoPixel(image,p,&pixel);
if (pixel.colorspace == LabColorspace)
{
pixel.green-=(QuantumRange+1)/2.0;
pixel.blue-=(QuantumRange+1)/2.0;
}
+ if (sparse_color != MagickFalse)
+ {
+ /*
+ Sparse-color format.
+ */
+ if (GetPixelAlpha(image,p) == (Quantum) OpaqueAlpha)
+ {
+ (void) QueryColorname(image,&pixel,SVGCompliance,tuple,
+ exception);
+ (void) FormatLocaleString(buffer,MaxTextExtent,"%.20g,%.20g ",
+ (double) x,(double) y);
+ (void) WriteBlobString(image,buffer);
+ (void) WriteBlobString(image,tuple);
+ (void) WriteBlobString(image," ");
+ }
+ p+=GetPixelChannels(image);
+ continue;
+ }
+ (void) FormatLocaleString(buffer,MaxTextExtent,"%.20g,%.20g: ",(double)
+ x,(double) y);
+ (void) WriteBlobString(image,buffer);
(void) CopyMagickString(tuple,"(",MaxTextExtent);
if (pixel.colorspace == GRAYColorspace)
ConcatenateColorComponent(&pixel,GrayPixelChannel,X11Compliance,