% 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 %
if (LocaleCompare(value,"BLACKANDWHITE_ALPHA") == 0)
{
SetImageColorspace(image,GRAYColorspace,exception);
- image->matte=MagickTrue;
+ image->alpha_trait=BlendPixelTrait;
quantum_type=GrayAlphaQuantum;
}
if (LocaleCompare(value,"GRAYSCALE") == 0)
if (LocaleCompare(value,"GRAYSCALE_ALPHA") == 0)
{
SetImageColorspace(image,GRAYColorspace,exception);
- image->matte=MagickTrue;
+ image->alpha_trait=BlendPixelTrait;
quantum_type=GrayAlphaQuantum;
}
if (LocaleCompare(value,"RGB_ALPHA") == 0)
{
- image->matte=MagickTrue;
+ image->alpha_trait=BlendPixelTrait;
quantum_type=RGBAQuantum;
}
if (LocaleCompare(value,"CMYK") == 0)
if (LocaleCompare(value,"CMYK_ALPHA") == 0)
{
SetImageColorspace(image,CMYKColorspace,exception);
- image->matte=MagickTrue;
+ image->alpha_trait=BlendPixelTrait;
quantum_type=CMYKAQuantum;
}
}
break;
for (x=0; x < (ssize_t) image->columns; x++)
{
- pixel.red=(MagickRealType) PNMInteger(image,10,exception);
- pixel.green=(MagickRealType) PNMInteger(image,10,exception);
- pixel.blue=(MagickRealType) PNMInteger(image,10,exception);
+ pixel.red=(double) PNMInteger(image,10,exception);
+ pixel.green=(double) PNMInteger(image,10,exception);
+ pixel.blue=(double) PNMInteger(image,10,exception);
if (scale != (Quantum *) NULL)
{
- pixel.red=(MagickRealType) scale[ConstrainPixel(image,(ssize_t)
+ pixel.red=(double) scale[ConstrainPixel(image,(ssize_t)
pixel.red,max_value,exception)];
- pixel.green=(MagickRealType) scale[ConstrainPixel(image,
+ pixel.green=(double) scale[ConstrainPixel(image,
(ssize_t) pixel.green,max_value,exception)];
- pixel.blue=(MagickRealType) scale[ConstrainPixel(image,(ssize_t)
+ pixel.blue=(double) scale[ConstrainPixel(image,(ssize_t)
pixel.blue,max_value,exception)];
}
SetPixelRed(image,ClampToQuantum(pixel.red),q);
quantum_info=AcquireQuantumInfo(image_info,image);
if (quantum_info == (QuantumInfo *) NULL)
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
+ (void) SetQuantumEndian(image,quantum_info,MSBEndian);
for (y=0; y < (ssize_t) image->rows; y++)
{
MagickBooleanType
break;
}
}
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
channels++;
extent=channels*(image->depth <= 8 ? 1 : 2)*image->columns;
quantum_info=AcquireQuantumInfo(image_info,image);
p=PushCharPixel(p,&pixel);
SetPixelGray(image,ScaleAnyToQuantum(pixel,range),q);
SetPixelAlpha(image,OpaqueAlpha,q);
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
{
p=PushCharPixel(p,&pixel);
SetPixelAlpha(image,ScaleAnyToQuantum(pixel,range),q);
p=PushShortPixel(MSBEndian,p,&pixel);
SetPixelGray(image,ScaleAnyToQuantum(pixel,range),q);
SetPixelAlpha(image,OpaqueAlpha,q);
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
{
p=PushShortPixel(MSBEndian,p,&pixel);
SetPixelAlpha(image,ScaleAnyToQuantum(pixel,range),q);
p=PushCharPixel(p,&pixel);
SetPixelBlack(image,ScaleAnyToQuantum(pixel,range),q);
SetPixelAlpha(image,OpaqueAlpha,q);
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
{
p=PushCharPixel(p,&pixel);
SetPixelAlpha(image,ScaleAnyToQuantum(pixel,range),q);
p=PushShortPixel(MSBEndian,p,&pixel);
SetPixelBlack(image,ScaleAnyToQuantum(pixel,range),q);
SetPixelAlpha(image,OpaqueAlpha,q);
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
{
p=PushShortPixel(MSBEndian,p,&pixel);
SetPixelAlpha(image,ScaleAnyToQuantum(pixel,range),q);
p=PushCharPixel(p,&pixel);
SetPixelBlue(image,ScaleAnyToQuantum(pixel,range),q);
SetPixelAlpha(image,OpaqueAlpha,q);
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
{
p=PushCharPixel(p,&pixel);
SetPixelAlpha(image,ScaleAnyToQuantum(pixel,range),q);
p=PushShortPixel(MSBEndian,p,&pixel);
SetPixelBlue(image,ScaleAnyToQuantum(pixel,range),q);
SetPixelAlpha(image,OpaqueAlpha,q);
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
{
p=PushShortPixel(MSBEndian,p,&pixel);
SetPixelAlpha(image,ScaleAnyToQuantum(pixel,range),q);
status=SetQuantumFormat(image,quantum_info,FloatingPointQuantumFormat);
if (status == MagickFalse)
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
- SetQuantumScale(quantum_info,(MagickRealType) QuantumRange*
- fabs(quantum_scale));
+ SetQuantumScale(quantum_info,(double) QuantumRange*fabs(quantum_scale));
extent=GetQuantumExtent(image,quantum_info,quantum_type);
for (y=0; y < (ssize_t) image->rows; y++)
{
default:
{
quantum_type=RGBQuantum;
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
quantum_type=RGBAQuantum;
packet_size=3;
(void) CopyMagickString(type,"RGB",MaxTextExtent);
break;
}
}
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
{
packet_size++;
(void) ConcatenateMagickString(type,"_ALPHA",MaxTextExtent);
quantum_info=AcquireQuantumInfo((const ImageInfo *) NULL,image);
if (quantum_info == (QuantumInfo *) NULL)
ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed");
+ (void) SetQuantumEndian(image,quantum_info,MSBEndian);
pixels=GetQuantumPixels(quantum_info);
extent=GetQuantumExtent(image,quantum_info,quantum_type);
range=GetQuantumRange(image->depth);
{
pixel=ScaleQuantumToAny(GetPixelIntensity(image,p),range);
q=PopCharPixel((unsigned char) pixel,q);
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
{
pixel=(unsigned char) ScaleQuantumToAny(
GetPixelAlpha(image,p),range);
{
pixel=ScaleQuantumToAny(GetPixelIntensity(image,p),range);
q=PopShortPixel(MSBEndian,(unsigned short) pixel,q);
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
{
pixel=(unsigned char) ScaleQuantumToAny(
GetPixelAlpha(image,p),range);
q=PopCharPixel((unsigned char) pixel,q);
pixel=ScaleQuantumToAny(GetPixelBlack(image,p),range);
q=PopCharPixel((unsigned char) pixel,q);
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
{
pixel=ScaleQuantumToAny(GetPixelAlpha(image,p),range);
q=PopCharPixel((unsigned char) pixel,q);
q=PopShortPixel(MSBEndian,(unsigned short) pixel,q);
pixel=ScaleQuantumToAny(GetPixelBlack(image,p),range);
q=PopShortPixel(MSBEndian,(unsigned short) pixel,q);
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
{
pixel=ScaleQuantumToAny(GetPixelAlpha(image,p),range);
q=PopShortPixel(MSBEndian,(unsigned short) pixel,q);
q=PopCharPixel((unsigned char) pixel,q);
pixel=ScaleQuantumToAny(GetPixelBlue(image,p),range);
q=PopCharPixel((unsigned char) pixel,q);
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
{
pixel=ScaleQuantumToAny(GetPixelAlpha(image,p),range);
q=PopCharPixel((unsigned char) pixel,q);
q=PopShortPixel(MSBEndian,(unsigned short) pixel,q);
pixel=ScaleQuantumToAny(GetPixelBlue(image,p),range);
q=PopShortPixel(MSBEndian,(unsigned short) pixel,q);
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
{
pixel=ScaleQuantumToAny(GetPixelAlpha(image,p),range);
q=PopShortPixel(MSBEndian,(unsigned short) pixel,q);
case 'F':
case 'f':
{
- (void) WriteBlobString(image,image->endian != LSBEndian ? "1.0\n" :
- "-1.0\n");
+ (void) WriteBlobString(image,image->endian == LSBEndian ? "-1.0\n" :
+ "1.0\n");
image->depth=32;
quantum_type=format == 'f' ? GrayQuantum : RGBQuantum;
quantum_info=AcquireQuantumInfo((const ImageInfo *) NULL,image);