diff --git a/coders/aai.c b/coders/aai.c
index 5cf8dcb..3ae10a9 100644
--- a/coders/aai.c
+++ b/coders/aai.c
@@ -182,7 +182,7 @@
*p=255;
SetPixelAlpha(image,ScaleCharToQuantum(*p++),q);
if (GetPixelAlpha(image,q) != OpaqueAlpha)
- image->matte=MagickTrue;
+ image->alpha_trait=BlendPixelTrait;
q+=GetPixelChannels(image);
}
if (SyncAuthenticPixels(image,exception) == MagickFalse)
@@ -389,7 +389,7 @@
*q++=ScaleQuantumToChar(GetPixelBlue(image,p));
*q++=ScaleQuantumToChar(GetPixelGreen(image,p));
*q++=ScaleQuantumToChar(GetPixelRed(image,p));
- *q=ScaleQuantumToChar((Quantum) (image->matte != MagickFalse ?
+ *q=ScaleQuantumToChar((Quantum) (image->alpha_trait == BlendPixelTrait ?
GetPixelAlpha(image,p) : OpaqueAlpha));
if (*q == 255)
*q=254;
diff --git a/coders/avs.c b/coders/avs.c
index 0cf6d42..1f4d4fc 100644
--- a/coders/avs.c
+++ b/coders/avs.c
@@ -141,7 +141,7 @@
/*
Read AVS X image.
*/
- image->matte=MagickTrue;
+ image->alpha_trait=BlendPixelTrait;
width=ReadBlobMSBLong(image);
height=ReadBlobMSBLong(image);
if (EOFBlob(image) != MagickFalse)
@@ -382,7 +382,7 @@
q=pixels;
for (x=0; x < (ssize_t) image->columns; x++)
{
- *q++=ScaleQuantumToChar((Quantum) (image->matte != MagickFalse ?
+ *q++=ScaleQuantumToChar((Quantum) (image->alpha_trait == BlendPixelTrait ?
GetPixelAlpha(image,p) : OpaqueAlpha));
*q++=ScaleQuantumToChar(GetPixelRed(image,p));
*q++=ScaleQuantumToChar(GetPixelGreen(image,p));
diff --git a/coders/bgr.c b/coders/bgr.c
index 7c4cb84..a800ff2 100644
--- a/coders/bgr.c
+++ b/coders/bgr.c
@@ -168,7 +168,7 @@
if (LocaleCompare(image_info->magick,"BGRA") == 0)
{
quantum_type=BGRAQuantum;
- image->matte=MagickTrue;
+ image->alpha_trait=BlendPixelTrait;
}
if (image_info->number_scenes != 0)
while (image->scene < image_info->scene)
@@ -250,7 +250,7 @@
SetPixelGreen(image,GetPixelGreen(canvas_image,p),q);
SetPixelBlue(image,GetPixelBlue(canvas_image,p),q);
SetPixelAlpha(image,OpaqueAlpha,q);
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
SetPixelAlpha(image,GetPixelAlpha(canvas_image,p),q);
p+=GetPixelChannels(canvas_image);
q+=GetPixelChannels(image);
@@ -305,7 +305,7 @@
"UnexpectedEndOfFile",image->filename);
break;
}
- for (i=0; i < (ssize_t) (image->matte != MagickFalse ? 4 : 3); i++)
+ for (i=0; i < (ssize_t) (image->alpha_trait == BlendPixelTrait ? 4 : 3); i++)
{
quantum_type=quantum_types[i];
q=GetAuthenticPixels(canvas_image,0,0,canvas_image->columns,1,
@@ -548,7 +548,7 @@
if (status == MagickFalse)
break;
}
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
{
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
@@ -832,7 +832,7 @@
if (status == MagickFalse)
break;
}
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
{
(void) CloseBlob(image);
AppendImageFormat("A",image->filename);
@@ -1097,7 +1097,7 @@
if (LocaleCompare(image_info->magick,"BGRA") == 0)
{
quantum_type=BGRAQuantum;
- image->matte=MagickTrue;
+ image->alpha_trait=BlendPixelTrait;
}
scene=0;
do
@@ -1108,7 +1108,7 @@
if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
(void) TransformImageColorspace(image,sRGBColorspace,exception);
if ((LocaleCompare(image_info->magick,"BGRA") == 0) &&
- (image->matte == MagickFalse))
+ (image->alpha_trait != BlendPixelTrait))
(void) SetImageAlphaChannel(image,OpaqueAlphaChannel,exception);
quantum_info=AcquireQuantumInfo(image_info,image);
if (quantum_info == (QuantumInfo *) NULL)
diff --git a/coders/bmp.c b/coders/bmp.c
index 4cc7eb6..a99115b 100644
--- a/coders/bmp.c
+++ b/coders/bmp.c
@@ -841,7 +841,7 @@
image->rows=(size_t) MagickAbsoluteValue(bmp_info.height);
image->depth=bmp_info.bits_per_pixel <= 8 ? bmp_info.bits_per_pixel : 8;
if ((bmp_info.bits_per_pixel == 16) || (bmp_info.bits_per_pixel == 32))
- image->matte=bmp_info.alpha_mask != 0 ? MagickTrue : MagickFalse;
+ image->alpha_trait=bmp_info.alpha_mask != 0 ? MagickTrue : MagickFalse;
if ((bmp_info.number_colors != 0) || (bmp_info.bits_per_pixel < 16))
{
size_t
@@ -1171,7 +1171,7 @@
SetPixelGreen(image,ScaleShortToQuantum((unsigned short) green),q);
SetPixelBlue(image,ScaleShortToQuantum((unsigned short) blue),q);
SetPixelAlpha(image,OpaqueAlpha,q);
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
SetPixelAlpha(image,
ScaleShortToQuantum((unsigned short) opacity),q);
q+=GetPixelChannels(image);
@@ -1266,7 +1266,7 @@
SetPixelGreen(image,ScaleShortToQuantum((unsigned short) green),q);
SetPixelBlue(image,ScaleShortToQuantum((unsigned short) blue),q);
SetPixelAlpha(image,OpaqueAlpha,q);
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
SetPixelAlpha(image,
ScaleShortToQuantum((unsigned short) opacity),q);
q+=GetPixelChannels(image);
@@ -1550,7 +1550,7 @@
if (image_info->compression == RLECompression)
bmp_info.bits_per_pixel=8;
bmp_info.number_colors=1U << bmp_info.bits_per_pixel;
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
(void) SetImageStorageClass(image,DirectClass,exception);
else
if ((size_t) bmp_info.number_colors < image->colors)
@@ -1573,9 +1573,9 @@
*/
bmp_info.number_colors=0;
bmp_info.bits_per_pixel=(unsigned short)
- ((type > 3) && (image->matte != MagickFalse) ? 32 : 24);
+ ((type > 3) && (image->alpha_trait == BlendPixelTrait) ? 32 : 24);
bmp_info.compression=(unsigned int) ((type > 3) &&
- (image->matte != MagickFalse) ? BI_BITFIELDS : BI_RGB);
+ (image->alpha_trait == BlendPixelTrait) ? BI_BITFIELDS : BI_RGB);
}
bytes_per_line=4*((image->columns*bmp_info.bits_per_pixel+31)/32);
bmp_info.ba_offset=0;
@@ -1586,7 +1586,7 @@
if (type == 2)
bmp_info.size=12;
else
- if ((type == 3) || ((image->matte == MagickFalse) &&
+ if ((type == 3) || ((image->alpha_trait != BlendPixelTrait) &&
(have_color_info == MagickFalse)))
{
type=3;
@@ -1872,7 +1872,7 @@
" Storage class=PseudoClass");
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" Image depth=%.20g",(double) image->depth);
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" Matte=True");
else
@@ -1946,7 +1946,7 @@
(void) WriteBlobLSBLong(image,bmp_info.number_colors);
(void) WriteBlobLSBLong(image,bmp_info.colors_important);
}
- if ((type > 3) && ((image->matte != MagickFalse) ||
+ if ((type > 3) && ((image->alpha_trait == BlendPixelTrait) ||
(have_color_info != MagickFalse)))
{
/*
diff --git a/coders/cmyk.c b/coders/cmyk.c
index f93498a..a4609af 100644
--- a/coders/cmyk.c
+++ b/coders/cmyk.c
@@ -168,7 +168,7 @@
if (LocaleCompare(image_info->magick,"CMYKA") == 0)
{
quantum_type=CMYKAQuantum;
- image->matte=MagickTrue;
+ image->alpha_trait=BlendPixelTrait;
}
if (image_info->number_scenes != 0)
while (image->scene < image_info->scene)
@@ -252,7 +252,7 @@
SetPixelBlue(image,GetPixelBlue(canvas_image,p),q);
SetPixelBlack(image,GetPixelBlack(canvas_image,p),q);
SetPixelAlpha(image,OpaqueAlpha,q);
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
SetPixelAlpha(image,GetPixelAlpha(canvas_image,p),q);
p+=GetPixelChannels(canvas_image);
q+=GetPixelChannels(image);
@@ -308,7 +308,7 @@
"UnexpectedEndOfFile",image->filename);
break;
}
- for (i=0; i < (image->matte != MagickFalse ? 5 : 4); i++)
+ for (i=0; i < (image->alpha_trait == BlendPixelTrait ? 5 : 4); i++)
{
quantum_type=quantum_types[i];
q=GetAuthenticPixels(canvas_image,0,0,canvas_image->columns,1,
@@ -597,7 +597,7 @@
if (status == MagickFalse)
break;
}
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
{
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
@@ -952,7 +952,7 @@
if (status == MagickFalse)
break;
}
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
{
(void) CloseBlob(image);
AppendImageFormat("A",image->filename);
@@ -1224,7 +1224,7 @@
if (LocaleCompare(image_info->magick,"CMYKA") == 0)
{
quantum_type=CMYKAQuantum;
- if (image->matte == MagickFalse)
+ if (image->alpha_trait != BlendPixelTrait)
(void) SetImageAlphaChannel(image,OpaqueAlphaChannel,exception);
}
quantum_info=AcquireQuantumInfo(image_info,image);
diff --git a/coders/dds.c b/coders/dds.c
index 51217d7..5039245 100644
--- a/coders/dds.c
+++ b/coders/dds.c
@@ -379,7 +379,7 @@
image=SyncNextImageInList(image);
}
- image->matte = matte;
+ image->alpha_trait = matte;
image->compression = compression;
image->columns = dds_info.width;
image->rows = dds_info.height;
@@ -549,8 +549,8 @@
SetPixelGreen(image,ScaleCharToQuantum(colors.g[code]),q);
SetPixelBlue(image,ScaleCharToQuantum(colors.b[code]),q);
SetPixelAlpha(image,ScaleCharToQuantum(colors.a[code]),q);
- if (colors.a[code] && (image->matte == MagickFalse))
- image->matte=MagickTrue; /* Correct matte */
+ if (colors.a[code] && (image->alpha_trait != BlendPixelTrait))
+ image->alpha_trait=BlendPixelTrait; /* Correct matte */
q+=GetPixelChannels(image);
}
}
diff --git a/coders/debug.c b/coders/debug.c
index d8be337..e5ca24e 100644
--- a/coders/debug.c
+++ b/coders/debug.c
@@ -208,7 +208,7 @@
MagickColorspaceOptions,(ssize_t) image->colorspace),MaxTextExtent);
LocaleLower(colorspace);
image->depth=GetImageQuantumDepth(image,MagickTrue);
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
(void) ConcatenateMagickString(colorspace,"a",MaxTextExtent);
(void) FormatLocaleString(buffer,MaxTextExtent,
"# ImageMagick pixel debugging: %.20g,%.20g,%.20g,%s\n",(double)
@@ -238,7 +238,7 @@
(double) pixel.black);
(void) ConcatenateMagickString(tuple,black,MaxTextExtent);
}
- if (pixel.matte != MagickFalse)
+ if (pixel.alpha_trait == BlendPixelTrait)
{
char
alpha[MaxTextExtent];
diff --git a/coders/dib.c b/coders/dib.c
index 3214830..0872aae 100644
--- a/coders/dib.c
+++ b/coders/dib.c
@@ -535,7 +535,7 @@
dib_info.green_mask=ReadBlobLSBLong(image);
dib_info.blue_mask=ReadBlobLSBLong(image);
}
- image->matte=dib_info.bits_per_pixel == 32 ? MagickTrue : MagickFalse;
+ image->alpha_trait=dib_info.bits_per_pixel == 32 ? MagickTrue : MagickFalse;
image->columns=(size_t) MagickAbsoluteValue(dib_info.width);
image->rows=(size_t) MagickAbsoluteValue(dib_info.height);
image->depth=8;
@@ -828,7 +828,7 @@
SetPixelBlue(image,ScaleCharToQuantum(*p++),q);
SetPixelGreen(image,ScaleCharToQuantum(*p++),q);
SetPixelRed(image,ScaleCharToQuantum(*p++),q);
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
SetPixelAlpha(image,ScaleCharToQuantum(*p++),q);
q+=GetPixelChannels(image);
}
@@ -1018,7 +1018,7 @@
Full color DIB raster.
*/
dib_info.number_colors=0;
- dib_info.bits_per_pixel=(unsigned short) (image->matte ? 32 : 24);
+ dib_info.bits_per_pixel=(unsigned short) (image->alpha_trait ? 32 : 24);
}
else
{
@@ -1189,7 +1189,7 @@
*q++=ScaleQuantumToChar(GetPixelBlue(image,p));
*q++=ScaleQuantumToChar(GetPixelGreen(image,p));
*q++=ScaleQuantumToChar(GetPixelRed(image,p));
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
*q++=ScaleQuantumToChar(GetPixelAlpha(image,p));
p+=GetPixelChannels(image);
}
diff --git a/coders/djvu.c b/coders/djvu.c
index 5abe9c6..5074b0d 100644
--- a/coders/djvu.c
+++ b/coders/djvu.c
@@ -662,7 +662,7 @@
/* fixme: MAGICKCORE_QUANTUM_DEPTH ?*/
image->depth = 8UL; /* i only support that? */
- image->matte = MagickTrue;
+ image->alpha_trait = MagickTrue;
/* is this useful? */
}
#if DEBUG
diff --git a/coders/dps.c b/coders/dps.c
index 1498ed8..f4f529c 100644
--- a/coders/dps.c
+++ b/coders/dps.c
@@ -490,7 +490,7 @@
if (matte_image != (XImage *) NULL)
{
image->storage_class=DirectClass;
- image->matte=MagickTrue;
+ image->alpha_trait=BlendPixelTrait;
for (y=0; y < (ssize_t) image->rows; y++)
{
q=QueueAuthenticPixels(image,0,y,image->columns,1,exception);
diff --git a/coders/dpx.c b/coders/dpx.c
index 3b3b2ef..7ce0381 100644
--- a/coders/dpx.c
+++ b/coders/dpx.c
@@ -1033,7 +1033,7 @@
case ABGRComponentType:
case RGBAComponentType:
{
- image->matte=MagickTrue;
+ image->alpha_trait=BlendPixelTrait;
samples_per_pixel=4;
quantum_type=RGBAQuantum;
break;
@@ -1468,17 +1468,17 @@
case YCbCrColorspace:
{
dpx.image.image_element[i].descriptor=CbYCr444ComponentType;
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
dpx.image.image_element[i].descriptor=CbYCrA4444ComponentType;
break;
}
default:
{
dpx.image.image_element[i].descriptor=RGBComponentType;
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
dpx.image.image_element[i].descriptor=RGBAComponentType;
if ((image_info->type != TrueColorType) &&
- (image->matte == MagickFalse) &&
+ (image->alpha_trait != BlendPixelTrait) &&
(IsImageGray(image,exception) != MagickFalse))
dpx.image.image_element[i].descriptor=LumaComponentType;
break;
@@ -1799,19 +1799,19 @@
SetQuantumPack(quantum_info,dpx.image.image_element[0].packing == 0 ?
MagickTrue : MagickFalse);
quantum_type=RGBQuantum;
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
quantum_type=RGBAQuantum;
if (image->colorspace == YCbCrColorspace)
{
quantum_type=CbYCrQuantum;
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
quantum_type=CbYCrAQuantum;
if ((horizontal_factor == 2) || (vertical_factor == 2))
quantum_type=CbYCrYQuantum;
}
- extent=GetBytesPerRow(image->columns,image->matte != MagickFalse ? 4UL : 3UL,
+ extent=GetBytesPerRow(image->columns,image->alpha_trait == BlendPixelTrait ? 4UL : 3UL,
image->depth,MagickTrue);
- if ((image_info->type != TrueColorType) && (image->matte == MagickFalse) &&
+ if ((image_info->type != TrueColorType) && (image->alpha_trait != BlendPixelTrait) &&
(IsImageGray(image,exception) != MagickFalse))
{
quantum_type=GrayQuantum;
diff --git a/coders/exr.c b/coders/exr.c
index 1d72f67..fa89ca8 100644
--- a/coders/exr.c
+++ b/coders/exr.c
@@ -199,7 +199,7 @@
ImfHeaderDisplayWindow(hdr_info,&min_x,&min_y,&max_x,&max_y);
image->columns=max_x-min_x+1UL;
image->rows=max_y-min_y+1UL;
- image->matte=MagickTrue;
+ image->alpha_trait=BlendPixelTrait;
SetImageColorspace(image,RGBColorspace,exception);
image->gamma=1.0;
if (image_info->ping != MagickFalse)
@@ -447,7 +447,7 @@
scanline[x].g=half_quantum;
ImfFloatToHalf(QuantumScale*GetPixelBlue(image,p),&half_quantum);
scanline[x].b=half_quantum;
- if (image->matte == MagickFalse)
+ if (image->alpha_trait != BlendPixelTrait)
ImfFloatToHalf(1.0,&half_quantum);
else
ImfFloatToHalf(QuantumScale*GetPixelAlpha(image,p),&half_quantum);
diff --git a/coders/fpx.c b/coders/fpx.c
index 643585e..e1a775a 100644
--- a/coders/fpx.c
+++ b/coders/fpx.c
@@ -366,7 +366,7 @@
image->columns=width;
image->rows=height;
if ((colorspace.numberOfComponents % 2) == 0)
- image->matte=MagickTrue;
+ image->alpha_trait=BlendPixelTrait;
if (colorspace.numberOfComponents == 1)
{
/*
@@ -473,7 +473,7 @@
SetPixelBlue(image,index,q);
}
SetPixelAlpha(image,OpaqueAlpha,q);
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
SetPixelAlpha(image,ScaleCharToQuantum(*a),q);
q+=GetPixelChannels(image);
r+=red_component->columnStride;
@@ -867,7 +867,7 @@
tile_width=64;
tile_height=64;
colorspace.numberOfComponents=3;
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
colorspace.numberOfComponents=4;
if ((image_info->type != TrueColorType) &&
(IsImageGray(image,exception) != MagickFalse))
@@ -987,7 +987,7 @@
Write image pixelss.
*/
quantum_type=RGBQuantum;
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
quantum_type=RGBAQuantum;
if (fpx_info.numberOfComponents == 1)
quantum_type=GrayQuantum;
diff --git a/coders/gif.c b/coders/gif.c
index f830ed8..0ba987f 100644
--- a/coders/gif.c
+++ b/coders/gif.c
@@ -1253,7 +1253,7 @@
image->ticks_per_second=100;
image->dispose=(DisposeType) dispose;
image->iterations=iterations;
- image->matte=opacity >= 0 ? MagickTrue : MagickFalse;
+ image->alpha_trait=opacity >= 0 ? MagickTrue : MagickFalse;
delay=0;
dispose=0;
iterations=1;
diff --git a/coders/gradient.c b/coders/gradient.c
index d1330fb..3104ae6 100644
--- a/coders/gradient.c
+++ b/coders/gradient.c
@@ -158,7 +158,7 @@
image=DestroyImageList(image);
return((Image *) NULL);
}
- if ((start_color.matte == MagickFalse) && (stop_color.matte == MagickFalse))
+ if ((start_color.alpha_trait != BlendPixelTrait) && (stop_color.alpha_trait != BlendPixelTrait))
(void) SetImageAlphaChannel(image,DeactivateAlphaChannel,exception);
return(GetFirstImageInList(image));
}
diff --git a/coders/icon.c b/coders/icon.c
index 744cc74..2914a7a 100644
--- a/coders/icon.c
+++ b/coders/icon.c
@@ -314,7 +314,7 @@
icon_info.y_pixels=ReadBlobLSBLong(image);
icon_info.number_colors=ReadBlobLSBLong(image);
icon_info.colors_important=ReadBlobLSBLong(image);
- image->matte=MagickTrue;
+ image->alpha_trait=BlendPixelTrait;
image->columns=(size_t) icon_file.directory[i].width;
if ((ssize_t) image->columns > icon_info.width)
image->columns=(size_t) icon_info.width;
@@ -1134,7 +1134,7 @@
*q++=ScaleQuantumToChar(GetPixelBlue(next,p));
*q++=ScaleQuantumToChar(GetPixelGreen(next,p));
*q++=ScaleQuantumToChar(GetPixelRed(next,p));
- if (next->matte == MagickFalse)
+ if (next->alpha_trait != BlendPixelTrait)
*q++=ScaleQuantumToChar(QuantumRange);
else
*q++=ScaleQuantumToChar(GetPixelAlpha(next,p));
@@ -1224,7 +1224,7 @@
for (x=0; x < (ssize_t) next->columns; x++)
{
byte<<=1;
- if ((next->matte == MagickTrue) &&
+ if ((next->alpha_trait == BlendPixelTrait) &&
(GetPixelAlpha(next,p) == (Quantum) TransparentAlpha))
byte|=0x01;
bit++;
diff --git a/coders/jp2.c b/coders/jp2.c
index 86f5666..d9c3008 100644
--- a/coders/jp2.c
+++ b/coders/jp2.c
@@ -423,7 +423,7 @@
components[3]=jas_image_getcmptbytype(jp2_image,3);
if (components[3] > 0)
{
- image->matte=MagickTrue;
+ image->alpha_trait=BlendPixelTrait;
number_components++;
}
break;
@@ -457,7 +457,7 @@
components[3]=jas_image_getcmptbytype(jp2_image,JAS_IMAGE_CT_UNKNOWN);
if (components[3] > 0)
{
- image->matte=MagickTrue;
+ image->alpha_trait=BlendPixelTrait;
number_components++;
}
break;
@@ -478,7 +478,7 @@
components[3]=jas_image_getcmptbytype(jp2_image,JAS_IMAGE_CT_UNKNOWN);
if (components[3] > 0)
{
- image->matte=MagickTrue;
+ image->alpha_trait=BlendPixelTrait;
number_components++;
}
break;
@@ -499,7 +499,7 @@
components[3]=jas_image_getcmptbytype(jp2_image,JAS_IMAGE_CT_UNKNOWN);
if (components[3] > 0)
{
- image->matte=MagickTrue;
+ image->alpha_trait=BlendPixelTrait;
number_components++;
}
break;
@@ -536,7 +536,7 @@
/*
Convert JPEG 2000 pixels.
*/
- image->matte=number_components > 3 ? MagickTrue : MagickFalse;
+ image->alpha_trait=number_components > 3 ? MagickTrue : MagickFalse;
maximum_component_depth=0;
for (i=0; i < (ssize_t) number_components; i++)
{
@@ -916,7 +916,7 @@
jp2_stream=JP2StreamManager(image);
if (jp2_stream == (jas_stream_t *) NULL)
ThrowWriterException(DelegateError,"UnableToManageJP2Stream");
- number_components=image->matte ? 4UL : 3UL;
+ number_components=image->alpha_trait ? 4UL : 3UL;
if (IsGrayColorspace(image->colorspace) != MagickFalse)
number_components=1;
if ((image->columns != (unsigned int) image->columns) ||
diff --git a/coders/matte.c b/coders/matte.c
index a666d92..b8b6f86 100644
--- a/coders/matte.c
+++ b/coders/matte.c
@@ -175,13 +175,13 @@
ssize_t
y;
- if (image->matte == MagickFalse)
+ if (image->alpha_trait != BlendPixelTrait)
ThrowWriterException(CoderError,"ImageDoesNotHaveAAlphaChannel");
matte_image=CloneImage(image,image->columns,image->rows,MagickTrue,exception);
if (matte_image == (Image *) NULL)
return(MagickFalse);
(void) SetImageType(matte_image,TrueColorMatteType,exception);
- matte_image->matte=MagickFalse;
+ matte_image->alpha_trait=UndefinedPixelTrait;
/*
Convert image to matte pixels.
*/
diff --git a/coders/miff.c b/coders/miff.c
index 30b4b4d..445fd11 100644
--- a/coders/miff.c
+++ b/coders/miff.c
@@ -242,7 +242,7 @@
unsigned char
quantum;
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
{
p=PushCharPixel(p,&quantum);
pixel->alpha=ScaleCharToQuantum(quantum);
@@ -254,7 +254,7 @@
unsigned short
quantum;
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
{
p=PushShortPixel(MSBEndian,p,&quantum);
pixel->alpha=(Quantum) (quantum >> (image->depth-
@@ -267,7 +267,7 @@
unsigned int
quantum;
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
{
p=PushLongPixel(MSBEndian,p,&quantum);
pixel->alpha=(Quantum) (quantum >> (image->depth-
@@ -305,7 +305,7 @@
p=PushCharPixel(p,&quantum);
pixel->black=ScaleCharToQuantum(quantum);
}
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
{
p=PushCharPixel(p,&quantum);
pixel->alpha=ScaleCharToQuantum(quantum);
@@ -333,7 +333,7 @@
p=PushShortPixel(MSBEndian,p,&quantum);
pixel->black=quantum >> (image->depth-MAGICKCORE_QUANTUM_DEPTH);
}
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
{
p=PushShortPixel(MSBEndian,p,&quantum);
pixel->alpha=quantum >> (image->depth-MAGICKCORE_QUANTUM_DEPTH);
@@ -361,7 +361,7 @@
p=PushLongPixel(MSBEndian,p,&quantum);
pixel->black=quantum >> (image->depth-MAGICKCORE_QUANTUM_DEPTH);
}
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
{
p=PushLongPixel(MSBEndian,p,&quantum);
pixel->alpha=quantum >> (image->depth-MAGICKCORE_QUANTUM_DEPTH);
@@ -621,8 +621,7 @@
if (*options != '{')
if (isspace((int) ((unsigned char) c)) != 0)
break;
- }
- }
+ } }
*p='\0';
if (*options == '{')
(void) strcpy(options,options+1);
@@ -631,6 +630,24 @@
*/
switch (*keyword)
{
+ case 'a':
+ case 'A':
+ {
+ if (LocaleCompare(keyword,"alpha-trait") == 0)
+ {
+ ssize_t
+ alpha_trait;
+
+ alpha_trait=ParseCommandOption(MagickPixelTraitOptions,
+ MagickFalse,options);
+ if (alpha_trait < 0)
+ break;
+ image->alpha_trait=(PixelTrait) alpha_trait;
+ break;
+ }
+ (void) SetImageProperty(image,keyword,options,exception);
+ break;
+ }
case 'b':
case 'B':
{
@@ -818,7 +835,8 @@
options);
if (matte < 0)
break;
- image->matte=(MagickBooleanType) matte;
+ image->alpha_trait=matte == 0 ? UndefinedPixelTrait :
+ BlendPixelTrait;
break;
}
if (LocaleCompare(keyword,"matte-color") == 0)
@@ -838,18 +856,6 @@
case 'o':
case 'O':
{
- if (LocaleCompare(keyword,"opaque") == 0)
- {
- ssize_t
- matte;
-
- matte=ParseCommandOption(MagickBooleanOptions,MagickFalse,
- options);
- if (matte < 0)
- break;
- image->matte=(MagickBooleanType) matte;
- break;
- }
if (LocaleCompare(keyword,"orientation") == 0)
{
ssize_t
@@ -1239,7 +1245,7 @@
packet_size=(size_t) (3*quantum_info->depth/8);
if (IsGrayColorspace(image->colorspace) != MagickFalse)
packet_size=quantum_info->depth/8;
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
packet_size+=quantum_info->depth/8;
if (image->colorspace == CMYKColorspace)
packet_size+=quantum_info->depth/8;
@@ -1257,24 +1263,24 @@
Read image pixels.
*/
quantum_type=RGBQuantum;
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
quantum_type=RGBAQuantum;
if (image->colorspace == CMYKColorspace)
{
quantum_type=CMYKQuantum;
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
quantum_type=CMYKAQuantum;
}
if (IsGrayColorspace(image->colorspace) != MagickFalse)
{
quantum_type=GrayQuantum;
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
quantum_type=GrayAlphaQuantum;
}
if (image->storage_class == PseudoClass)
{
quantum_type=IndexQuantum;
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
quantum_type=IndexAlphaQuantum;
}
status=MagickTrue;
@@ -1456,7 +1462,7 @@
if (image->colorspace == CMYKColorspace)
SetPixelBlack(image,ClampToQuantum(pixel.black),q);
}
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
SetPixelAlpha(image,ClampToQuantum(pixel.alpha),q);
q+=GetPixelChannels(image);
}
@@ -1722,7 +1728,7 @@
unsigned int
value;
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
{
value=ScaleQuantumToLong(ClampToQuantum(pixel->alpha));
pixels=PopLongPixel(MSBEndian,value,pixels);
@@ -1734,7 +1740,7 @@
unsigned short
value;
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
{
value=ScaleQuantumToShort(ClampToQuantum(pixel->alpha));
pixels=PopShortPixel(MSBEndian,value,pixels);
@@ -1746,7 +1752,7 @@
unsigned char
value;
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
{
value=(unsigned char) ScaleQuantumToChar(ClampToQuantum(
pixel->alpha));
@@ -1782,7 +1788,7 @@
value=ScaleQuantumToLong(ClampToQuantum(pixel->black));
pixels=PopLongPixel(MSBEndian,value,pixels);
}
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
{
value=ScaleQuantumToLong(ClampToQuantum(pixel->alpha));
pixels=PopLongPixel(MSBEndian,value,pixels);
@@ -1808,7 +1814,7 @@
value=ScaleQuantumToShort(ClampToQuantum(pixel->black));
pixels=PopShortPixel(MSBEndian,value,pixels);
}
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
{
value=ScaleQuantumToShort(ClampToQuantum(pixel->alpha));
pixels=PopShortPixel(MSBEndian,value,pixels);
@@ -1836,7 +1842,7 @@
pixel->black));
pixels=PopCharPixel(value,pixels);
}
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
{
value=(unsigned char) ScaleQuantumToChar(ClampToQuantum(
pixel->alpha));
@@ -1983,7 +1989,7 @@
packet_size=(size_t) (3*quantum_info->depth/8);
if (IsGrayColorspace(image->colorspace) != MagickFalse)
packet_size=(size_t) (quantum_info->depth/8);
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
packet_size+=quantum_info->depth/8;
if (image->colorspace == CMYKColorspace)
packet_size+=quantum_info->depth/8;
@@ -2004,9 +2010,10 @@
*/
(void) WriteBlobString(image,"id=ImageMagick version=1.0\n");
(void) FormatLocaleString(buffer,MaxTextExtent,
- "class=%s colors=%.20g matte=%s\n",CommandOptionToMnemonic(
+ "class=%s colors=%.20g alpha-trait=%s\n",CommandOptionToMnemonic(
MagickClassOptions,image->storage_class),(double) image->colors,
- CommandOptionToMnemonic(MagickBooleanOptions,(ssize_t) image->matte));
+ CommandOptionToMnemonic(MagickPixelTraitOptions,(ssize_t)
+ image->alpha_trait));
(void) WriteBlobString(image,buffer);
(void) FormatLocaleString(buffer,MaxTextExtent,"columns=%.20g rows=%.20g "
"depth=%.20g\n",(double) image->columns,(double) image->rows,(double)
diff --git a/coders/mpc.c b/coders/mpc.c
index 429ce79..4ad636d 100644
--- a/coders/mpc.c
+++ b/coders/mpc.c
@@ -331,6 +331,24 @@
*/
switch (*keyword)
{
+ case 'a':
+ case 'A':
+ {
+ if (LocaleCompare(keyword,"alpha-trait") == 0)
+ {
+ ssize_t
+ alpha_trait;
+
+ alpha_trait=ParseCommandOption(MagickPixelTraitOptions,
+ MagickFalse,options);
+ if (alpha_trait < 0)
+ break;
+ image->alpha_trait=(PixelTrait) alpha_trait;
+ break;
+ }
+ (void) SetImageProperty(image,keyword,options,exception);
+ break;
+ }
case 'b':
case 'B':
{
@@ -503,18 +521,6 @@
case 'm':
case 'M':
{
- if (LocaleCompare(keyword,"matte") == 0)
- {
- ssize_t
- matte;
-
- matte=ParseCommandOption(MagickBooleanOptions,MagickFalse,
- options);
- if (matte < 0)
- break;
- image->matte=(MagickBooleanType) matte;
- break;
- }
if (LocaleCompare(keyword,"matte-color") == 0)
{
(void) QueryColorCompliance(options,AllCompliance,
@@ -544,18 +550,6 @@
case 'o':
case 'O':
{
- if (LocaleCompare(keyword,"opaque") == 0)
- {
- ssize_t
- matte;
-
- matte=ParseCommandOption(MagickBooleanOptions,MagickFalse,
- options);
- if (matte < 0)
- break;
- image->matte=(MagickBooleanType) matte;
- break;
- }
if (LocaleCompare(keyword,"orientation") == 0)
{
ssize_t
@@ -1101,9 +1095,10 @@
MAGICKCORE_QUANTUM_DEPTH);
(void) WriteBlobString(image,buffer);
(void) FormatLocaleString(buffer,MaxTextExtent,
- "class=%s colors=%.20g matte=%s\n",CommandOptionToMnemonic(
+ "class=%s colors=%.20g alpha-trait=%s\n",CommandOptionToMnemonic(
MagickClassOptions,image->storage_class),(double) image->colors,
- CommandOptionToMnemonic(MagickBooleanOptions,(ssize_t) image->matte));
+ CommandOptionToMnemonic(MagickPixelTraitOptions,(ssize_t)
+ image->alpha_trait));
(void) WriteBlobString(image,buffer);
(void) FormatLocaleString(buffer,MaxTextExtent,
"columns=%.20g rows=%.20g depth=%.20g\n",(double) image->columns,
diff --git a/coders/msl.c b/coders/msl.c
index af33f89..ba3b828 100644
--- a/coders/msl.c
+++ b/coders/msl.c
@@ -1952,7 +1952,7 @@
}
(void) SetImageArtifact(msl_info->image[n],
"compose:args",value);
- if (composite_image->matte != MagickTrue)
+ if (composite_image->alpha_trait == UndefinedPixelTrait)
(void) SetImageAlpha(composite_image,OpaqueAlpha,
&exception);
composite_view=AcquireAuthenticCacheView(composite_image,
diff --git a/coders/null.c b/coders/null.c
index 454cf68..5770b9c 100644
--- a/coders/null.c
+++ b/coders/null.c
@@ -126,7 +126,7 @@
image->columns=1;
if (image->rows == 0)
image->rows=1;
- image->matte=MagickTrue;
+ image->alpha_trait=BlendPixelTrait;
GetPixelInfo(image,&background);
background.alpha=(double) TransparentAlpha;
if (image->colorspace == CMYKColorspace)
diff --git a/coders/pcx.c b/coders/pcx.c
index c93fa6c..38c107b 100644
--- a/coders/pcx.c
+++ b/coders/pcx.c
@@ -431,7 +431,7 @@
}
}
if (image->storage_class == DirectClass)
- image->matte=pcx_info.planes > 3 ? MagickTrue : MagickFalse;
+ image->alpha_trait=pcx_info.planes > 3 ? MagickTrue : MagickFalse;
else
if ((pcx_info.version == 5) ||
((pcx_info.bits_per_pixel*pcx_info.planes) == 1))
@@ -607,7 +607,7 @@
SetPixelRed(image,ScaleCharToQuantum(*r++),q);
SetPixelGreen(image,ScaleCharToQuantum(*r++),q);
SetPixelBlue(image,ScaleCharToQuantum(*r++),q);
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
SetPixelAlpha(image,ScaleCharToQuantum(*r++),q);
}
q+=GetPixelChannels(image);
@@ -940,7 +940,7 @@
if ((image->storage_class == DirectClass) || (image->colors > 256))
{
pcx_info.planes=3;
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
pcx_info.planes++;
}
pcx_info.bytes_per_line=(unsigned short) (((size_t) image->columns*
diff --git a/coders/pdf.c b/coders/pdf.c
index 3055eaf..db9d06c 100644
--- a/coders/pdf.c
+++ b/coders/pdf.c
@@ -1089,7 +1089,7 @@
if (image_info->compression == JPEG2000Compression)
version=(size_t) MagickMax(version,5);
for (next=image; next != (Image *) NULL; next=GetNextImageInList(next))
- if (next->matte != MagickFalse)
+ if (next->alpha_trait == BlendPixelTrait)
version=(size_t) MagickMax(version,4);
if (LocaleCompare(image_info->magick,"PDFA") == 0)
version=(size_t) MagickMax(version,6);
@@ -1218,7 +1218,7 @@
case Group4Compression:
{
if ((IsImageMonochrome(image,exception) == MagickFalse) ||
- (image->matte != MagickFalse))
+ (image->alpha_trait == BlendPixelTrait))
compression=RLECompression;
break;
}
@@ -1554,7 +1554,7 @@
(compression == FaxCompression) || (compression == Group4Compression) ?
1 : 8);
(void) WriteBlobString(image,buffer);
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
{
(void) FormatLocaleString(buffer,MaxTextExtent,"/SMask %.20g 0 R\n",
(double) object+7);
@@ -2393,7 +2393,7 @@
object);
(void) WriteBlobString(image,buffer);
(void) WriteBlobString(image,"<<\n");
- if (image->matte == MagickFalse)
+ if (image->alpha_trait != BlendPixelTrait)
(void) WriteBlobString(image,">>\n");
else
{
diff --git a/coders/pict.c b/coders/pict.c
index 09ba705..8b3e77a 100644
--- a/coders/pict.c
+++ b/coders/pict.c
@@ -470,7 +470,7 @@
}
else
if (bits_per_pixel == 32)
- width*=image->matte ? 4 : 3;
+ width*=image->alpha_trait ? 4 : 3;
if (bytes_per_line == 0)
bytes_per_line=width;
row_bytes=(size_t) (image->columns | 0x8000);
@@ -1075,13 +1075,13 @@
{
ReadPixmap(pixmap);
tile_image->depth=1UL*pixmap.component_size;
- tile_image->matte=pixmap.component_count == 4 ?
+ tile_image->alpha_trait=pixmap.component_count == 4 ?
MagickTrue : MagickFalse;
tile_image->resolution.x=(double) pixmap.horizontal_resolution;
tile_image->resolution.y=(double) pixmap.vertical_resolution;
tile_image->units=PixelsPerInchResolution;
- if (tile_image->matte != MagickFalse)
- image->matte=tile_image->matte;
+ if (tile_image->alpha_trait == BlendPixelTrait)
+ image->alpha_trait=tile_image->alpha_trait;
}
if ((code != 0x9a) && (code != 0x9b))
{
@@ -1196,7 +1196,7 @@
(unsigned char) ((j & 0x1f) << 3)),q);
}
else
- if (tile_image->matte == MagickFalse)
+ if (tile_image->alpha_trait != BlendPixelTrait)
{
if (p > (pixels+extent+2*image->columns))
ThrowReaderException(CorruptImageError,
@@ -1640,9 +1640,9 @@
storage_class=image->storage_class;
if (image_info->compression == JPEGCompression)
storage_class=DirectClass;
- if ((storage_class == DirectClass) || (image->matte != MagickFalse))
+ if ((storage_class == DirectClass) || (image->alpha_trait == BlendPixelTrait))
{
- pixmap.component_count=image->matte ? 4 : 3;
+ pixmap.component_count=image->alpha_trait ? 4 : 3;
pixmap.pixel_type=16;
pixmap.bits_per_pixel=32;
pixmap.pack_type=0x04;
@@ -1653,8 +1653,8 @@
Allocate memory.
*/
bytes_per_line=image->columns;
- if ((storage_class == DirectClass) || (image->matte != MagickFalse))
- bytes_per_line*=image->matte ? 4 : 3;
+ if ((storage_class == DirectClass) || (image->alpha_trait == BlendPixelTrait))
+ bytes_per_line*=image->alpha_trait ? 4 : 3;
buffer=(unsigned char *) AcquireQuantumMemory(PictInfoSize,sizeof(*buffer));
packed_scanline=(unsigned char *) AcquireQuantumMemory((size_t)
(row_bytes+MaxCount),sizeof(*packed_scanline));
@@ -1877,7 +1877,7 @@
Write picture data.
*/
count=0;
- if ((storage_class == PseudoClass) && (image->matte == MagickFalse))
+ if ((storage_class == PseudoClass) && (image->alpha_trait != BlendPixelTrait))
for (y=0; y < (ssize_t) image->rows; y++)
{
p=GetVirtualPixels(image,0,y,image->columns,1,exception);
@@ -1926,7 +1926,7 @@
red=scanline;
green=scanline+image->columns;
blue=scanline+2*image->columns;
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
{
opacity=scanline;
red=scanline+image->columns;
@@ -1938,7 +1938,7 @@
*red++=ScaleQuantumToChar(GetPixelRed(image,p));
*green++=ScaleQuantumToChar(GetPixelGreen(image,p));
*blue++=ScaleQuantumToChar(GetPixelBlue(image,p));
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
*opacity++=ScaleQuantumToChar((Quantum) (GetPixelAlpha(image,p)));
p+=GetPixelChannels(image);
}
diff --git a/coders/png.c b/coders/png.c
index 28b4c59..2fb2231 100644
--- a/coders/png.c
+++ b/coders/png.c
@@ -2143,7 +2143,7 @@
if (logging != MagickFalse)
{
(void)LogMagickEvent(CoderEvent,GetMagickModule(),
- " image->matte=%d",(int) image->matte);
+ " image->alpha_trait=%d",(int) image->alpha_trait);
(void)LogMagickEvent(CoderEvent,GetMagickModule(),
" image->rendering_intent=%d",(int) image->rendering_intent);
@@ -2723,7 +2723,7 @@
" Ignoring PNG tRNS chunk with out-of-range sample.");
png_free_data(ping, ping_info, PNG_FREE_TRNS, 0);
png_set_invalid(ping,ping_info,PNG_INFO_tRNS);
- image->matte=MagickFalse;
+ image->alpha_trait=UndefinedPixelTrait;
}
else
{
@@ -3012,7 +3012,7 @@
depth=(ssize_t) ping_bit_depth;
#endif
- image->matte=(((int) ping_color_type == PNG_COLOR_TYPE_RGB_ALPHA) ||
+ image->alpha_trait=(((int) ping_color_type == PNG_COLOR_TYPE_RGB_ALPHA) ||
((int) ping_color_type == PNG_COLOR_TYPE_GRAY_ALPHA) ||
(png_get_valid(ping,ping_info,PNG_INFO_tRNS))) ?
MagickTrue : MagickFalse;
@@ -3128,11 +3128,11 @@
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" Converting grayscale pixels to pixel packets");
- image->matte=ping_color_type == PNG_COLOR_TYPE_GRAY_ALPHA ?
+ image->alpha_trait=ping_color_type == PNG_COLOR_TYPE_GRAY_ALPHA ?
MagickTrue : MagickFalse;
quantum_scanline=(Quantum *) AcquireQuantumMemory(image->columns,
- (image->matte ? 2 : 1)*sizeof(*quantum_scanline));
+ (image->alpha_trait ? 2 : 1)*sizeof(*quantum_scanline));
if (quantum_scanline == (Quantum *) NULL)
png_error(ping,"Memory allocation failed");
@@ -3322,7 +3322,7 @@
quantum_scanline=(Quantum *) RelinquishMagickMemory(quantum_scanline);
}
- image->matte=found_transparent_pixel;
+ image->alpha_trait=found_transparent_pixel;
if (logging != MagickFalse)
{
@@ -3347,10 +3347,10 @@
MagickBooleanType
matte;
- matte=image->matte;
- image->matte=MagickFalse;
+ matte=image->alpha_trait;
+ image->alpha_trait=UndefinedPixelTrait;
(void) SyncImage(image,exception);
- image->matte=matte;
+ image->alpha_trait=matte;
}
png_read_end(ping,end_info);
@@ -3380,7 +3380,7 @@
Image has a transparent background.
*/
storage_class=image->storage_class;
- image->matte=MagickTrue;
+ image->alpha_trait=BlendPixelTrait;
/* Balfour fix from imagemagick discourse server, 5 Feb 2010 */
@@ -3390,7 +3390,7 @@
{
for (x=0; x < ping_num_trans; x++)
{
- image->colormap[x].matte=MagickTrue;
+ image->colormap[x].alpha_trait=BlendPixelTrait;
image->colormap[x].alpha =
ScaleCharToQuantum((unsigned char)ping_trans_alpha[x]);
}
@@ -3403,7 +3403,7 @@
if (ScaleQuantumToShort(image->colormap[x].red) ==
transparent_color.alpha)
{
- image->colormap[x].matte=MagickTrue;
+ image->colormap[x].alpha_trait=BlendPixelTrait;
image->colormap[x].alpha = (Quantum) TransparentAlpha;
}
}
@@ -3604,11 +3604,11 @@
}
#endif
- /* Set image->matte to MagickTrue if the input colortype supports
+ /* Set image->alpha_trait to MagickTrue if the input colortype supports
* alpha or if a valid tRNS chunk is present, no matter whether there
* is actual transparency present.
*/
- image->matte=(((int) ping_color_type == PNG_COLOR_TYPE_RGB_ALPHA) ||
+ image->alpha_trait=(((int) ping_color_type == PNG_COLOR_TYPE_RGB_ALPHA) ||
((int) ping_color_type == PNG_COLOR_TYPE_GRAY_ALPHA) ||
(png_get_valid(ping,ping_info,PNG_INFO_tRNS))) ?
MagickTrue : MagickFalse;
@@ -3845,7 +3845,7 @@
if (LocaleCompare(image_info->magick,"PNG24") == 0)
{
(void) SetImageType(image,TrueColorType,exception);
- image->matte=MagickFalse;
+ image->alpha_trait=UndefinedPixelTrait;
}
if (LocaleCompare(image_info->magick,"PNG32") == 0)
@@ -4518,7 +4518,7 @@
exception);
q=GetAuthenticPixels(image,0,y,image->columns,1,exception);
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
for (x=(ssize_t) image->columns; x != 0; x--)
{
SetPixelAlpha(image,GetPixelRed(jng_image,s),q);
@@ -4531,7 +4531,7 @@
{
SetPixelAlpha(image,GetPixelRed(jng_image,s),q);
if (GetPixelAlpha(image,q) != OpaqueAlpha)
- image->matte=MagickTrue;
+ image->alpha_trait=BlendPixelTrait;
q+=GetPixelChannels(image);
s+=GetPixelChannels(jng_image);
}
@@ -5503,7 +5503,7 @@
image->page.x=mng_info->clip.left;
image->page.y=mng_info->clip.top;
image->background_color=mng_background_color;
- image->matte=MagickFalse;
+ image->alpha_trait=UndefinedPixelTrait;
image->delay=0;
(void) SetImageBackgroundColor(image,exception);
@@ -6111,7 +6111,7 @@
image->page.x=mng_info->clip.left;
image->page.y=mng_info->clip.top;
image->background_color=mng_background_color;
- image->matte=MagickFalse;
+ image->alpha_trait=UndefinedPixelTrait;
(void) SetImageBackgroundColor(image,exception);
if (logging != MagickFalse)
@@ -6374,7 +6374,7 @@
#define QM Quantum
#endif
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
(void) SetImageBackgroundColor(large_image,exception);
else
@@ -6513,7 +6513,7 @@
((ssize_t) (m*2))
+GetPixelBlue(image,pixels)))),q);
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
SetPixelAlpha(large_image, ((QM) (((ssize_t)
(2*i*(GetPixelAlpha(image,n)
-GetPixelAlpha(image,pixels)+m))
@@ -6670,7 +6670,7 @@
-GetPixelBlue(image,pixels))+m)
/((ssize_t) (m*2))+
GetPixelBlue(image,pixels)),q);
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
SetPixelAlpha(image,(QM) ((2*i*(
GetPixelAlpha(image,n)
-GetPixelAlpha(image,pixels))+m)
@@ -6921,7 +6921,7 @@
image->page.x=0;
image->page.y=0;
image->background_color=mng_background_color;
- image->matte=MagickFalse;
+ image->alpha_trait=UndefinedPixelTrait;
if (image_info->ping == MagickFalse)
(void) SetImageBackgroundColor(image,exception);
@@ -8117,7 +8117,7 @@
* This code will delete the colormap and change the image to
* DirectClass.
*
- * If image->matte is MagickFalse, we ignore the alpha channel
+ * If image->alpha_trait is MagickFalse, we ignore the alpha channel
* even though it sometimes contains left-over non-opaque values.
*
* Also we gather some information (number of opaque, transparent,
@@ -8154,7 +8154,7 @@
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" image->rows=%.20g",(double) image->rows);
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
- " image->matte=%.20g",(double) image->matte);
+ " image->alpha_trait=%.20g",(double) image->alpha_trait);
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" image->depth=%.20g",(double) image->depth);
@@ -8217,7 +8217,7 @@
for (x=0; x < (ssize_t) image->columns; x++)
{
- if (image->matte == MagickFalse ||
+ if (image->alpha_trait != BlendPixelTrait ||
GetPixelAlpha(image,q) == OpaqueAlpha)
{
if (number_opaque < 259)
@@ -8532,7 +8532,7 @@
{
for (i=0; i< (ssize_t) image_colors; i++)
{
- if ((image->matte == MagickFalse ||
+ if ((image->alpha_trait != BlendPixelTrait ||
image->colormap[i].alpha == GetPixelAlpha(image,q)) &&
image->colormap[i].red == GetPixelRed(image,q) &&
image->colormap[i].green == GetPixelGreen(image,q) &&
@@ -8991,7 +8991,7 @@
quantum_info = (QuantumInfo *) NULL;
number_colors=0;
image_colors=(int) image->colors;
- image_matte=image->matte;
+ image_matte=image->alpha_trait;
mng_info->IsPalette=image->storage_class == PseudoClass &&
image_colors <= 256 && image->colormap != NULL;
@@ -9124,7 +9124,7 @@
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" height=%.20g",(double) ping_height);
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
- " image_matte=%.20g",(double) image->matte);
+ " image_matte=%.20g",(double) image->alpha_trait);
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" image->depth=%.20g",(double) image->depth);
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
@@ -9423,7 +9423,7 @@
if (ping_color_type == PNG_COLOR_TYPE_GRAY)
{
- if (image->matte == MagickFalse && ping_have_non_bw == MagickFalse)
+ if (image->alpha_trait != BlendPixelTrait && ping_have_non_bw == MagickFalse)
ping_bit_depth=1;
}
@@ -10230,10 +10230,10 @@
"Cannot write image with defined png:bit-depth or png:color-type.");
}
- if (image_matte != MagickFalse && image->matte == MagickFalse)
+ if (image_matte != MagickFalse && image->alpha_trait != BlendPixelTrait)
{
/* Add an opaque matte channel */
- image->matte = MagickTrue;
+ image->alpha_trait = MagickTrue;
(void) SetImageAlpha(image,OpaqueAlpha,exception);
if (logging != MagickFalse)
@@ -11169,7 +11169,7 @@
mng_info->write_png_depth = 8;
image->depth = 8;
- if (image->matte == MagickTrue)
+ if (image->alpha_trait == BlendPixelTrait)
(void) SetImageType(image,TrueColorMatteType,exception);
else
@@ -11184,7 +11184,7 @@
mng_info->write_png_depth = 8;
image->depth = 8;
- if (image->matte == MagickTrue)
+ if (image->alpha_trait == BlendPixelTrait)
(void) SetImageType(image,TrueColorMatteType,exception);
else
@@ -11815,7 +11815,7 @@
status=MagickTrue;
transparent=image_info->type==GrayscaleMatteType ||
- image_info->type==TrueColorMatteType || image->matte != MagickFalse;
+ image_info->type==TrueColorMatteType || image->alpha_trait == BlendPixelTrait;
jng_quality=image_info->quality == 0UL ? 75UL : image_info->quality%1000;
@@ -11849,7 +11849,7 @@
if (jpeg_image == (Image *) NULL)
ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed");
(void) CopyMagickString(jpeg_image->magick,"JPEG",MaxTextExtent);
- jpeg_image->matte=MagickFalse;
+ jpeg_image->alpha_trait=UndefinedPixelTrait;
jpeg_image->quality=jng_alpha_quality;
jpeg_image_info->type=GrayscaleType;
(void) SetImageType(jpeg_image,GrayscaleType,exception);
@@ -12530,7 +12530,7 @@
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" Image depth: %.20g",(double) p->depth);
- if (p->matte)
+ if (p->alpha_trait)
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" Matte: True");
@@ -12624,11 +12624,11 @@
if (next_image->page.x || next_image->page.y)
need_defi=MagickTrue;
- if (next_image->matte)
+ if (next_image->alpha_trait)
need_matte=MagickTrue;
if ((int) next_image->dispose >= BackgroundDispose)
- if (next_image->matte || next_image->page.x || next_image->page.y ||
+ if (next_image->alpha_trait || next_image->page.x || next_image->page.y ||
((next_image->columns < mng_info->page.width) &&
(next_image->rows < mng_info->page.height)))
mng_info->need_fram=MagickTrue;
@@ -12647,7 +12647,7 @@
/*
check for global palette possibility.
*/
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
need_local_plte=MagickTrue;
if (need_local_plte == 0)
@@ -13000,7 +13000,7 @@
Write MNG BACK chunk and global bKGD chunk, if the image is transparent
or does not cover the entire frame.
*/
- if (write_mng && (image->matte || image->page.x > 0 ||
+ if (write_mng && (image->alpha_trait || image->page.x > 0 ||
image->page.y > 0 || (image->page.width &&
(image->page.width+image->page.x < mng_info->page.width))
|| (image->page.height && (image->page.height+image->page.y
diff --git a/coders/pnm.c b/coders/pnm.c
index 0162ad1..8a4a087 100644
--- a/coders/pnm.c
+++ b/coders/pnm.c
@@ -379,7 +379,7 @@
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)
@@ -390,12 +390,12 @@
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)
@@ -406,7 +406,7 @@
if (LocaleCompare(value,"CMYK_ALPHA") == 0)
{
SetImageColorspace(image,CMYKColorspace,exception);
- image->matte=MagickTrue;
+ image->alpha_trait=BlendPixelTrait;
quantum_type=CMYKAQuantum;
}
}
@@ -926,7 +926,7 @@
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);
@@ -999,7 +999,7 @@
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);
@@ -1017,7 +1017,7 @@
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);
@@ -1046,7 +1046,7 @@
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);
@@ -1070,7 +1070,7 @@
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);
@@ -1096,7 +1096,7 @@
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);
@@ -1118,7 +1118,7 @@
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);
@@ -1577,14 +1577,14 @@
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);
@@ -2018,7 +2018,7 @@
{
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);
@@ -2031,7 +2031,7 @@
{
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);
@@ -2055,7 +2055,7 @@
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);
@@ -2073,7 +2073,7 @@
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);
@@ -2093,7 +2093,7 @@
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);
@@ -2109,7 +2109,7 @@
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);
diff --git a/coders/ps.c b/coders/ps.c
index fba33ec..fb563c8 100644
--- a/coders/ps.c
+++ b/coders/ps.c
@@ -1050,7 +1050,7 @@
{
#define WriteRunlengthPacket(image,pixel,length,p) \
{ \
- if ((image->matte != MagickFalse) && \
+ if ((image->alpha_trait == BlendPixelTrait) && \
(GetPixelAlpha(image,p) == (Quantum) TransparentAlpha)) \
{ \
q=PopHexPixel(hex_digits,0xff,q); \
@@ -1880,7 +1880,7 @@
}
else
if ((image->storage_class == DirectClass) ||
- (image->colors > 256) || (image->matte != MagickFalse))
+ (image->colors > 256) || (image->alpha_trait == BlendPixelTrait))
{
/*
Dump DirectClass image.
@@ -1965,7 +1965,7 @@
break;
for (x=0; x < (ssize_t) image->columns; x++)
{
- if ((image->matte != MagickFalse) &&
+ if ((image->alpha_trait == BlendPixelTrait) &&
(GetPixelAlpha(image,p) == (Quantum) TransparentAlpha))
{
q=PopHexPixel(hex_digits,0xff,q);
diff --git a/coders/ps2.c b/coders/ps2.c
index ea668f4..06e19c3 100644
--- a/coders/ps2.c
+++ b/coders/ps2.c
@@ -841,7 +841,7 @@
}
else
if ((image->storage_class == DirectClass) || (image->colors > 256) ||
- (compression == JPEGCompression) || (image->matte != MagickFalse))
+ (compression == JPEGCompression) || (image->alpha_trait == BlendPixelTrait))
{
(void) FormatLocaleString(buffer,MaxTextExtent,"%.20g %.20g\n0\n%d\n",
(double) image->columns,(double) image->rows,(int)
@@ -888,7 +888,7 @@
break;
for (x=0; x < (ssize_t) image->columns; x++)
{
- if ((image->matte != MagickFalse) &&
+ if ((image->alpha_trait == BlendPixelTrait) &&
(GetPixelAlpha(image,p) == (Quantum) TransparentAlpha))
{
*q++=ScaleQuantumToChar(QuantumRange);
@@ -942,7 +942,7 @@
break;
for (x=0; x < (ssize_t) image->columns; x++)
{
- if ((image->matte != MagickFalse) &&
+ if ((image->alpha_trait == BlendPixelTrait) &&
(GetPixelAlpha(image,p) == (Quantum) TransparentAlpha))
{
Ascii85Encode(image,ScaleQuantumToChar((Quantum)
diff --git a/coders/ps3.c b/coders/ps3.c
index f87ff55..3cf1f45 100644
--- a/coders/ps3.c
+++ b/coders/ps3.c
@@ -460,7 +460,7 @@
assert(image->signature == MagickSignature);
if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
- assert(image->matte != MagickFalse);
+ assert(image->alpha_trait == BlendPixelTrait);
status=MagickTrue;
/*
Note BeginData DSC comment for update later.
@@ -521,7 +521,7 @@
ThrowWriterException(CoderError,exception->reason);
(void) SetImageType(mask_image,BilevelType,exception);
(void) SetImageType(mask_image,PaletteType,exception);
- mask_image->matte=MagickFalse;
+ mask_image->alpha_trait=UndefinedPixelTrait;
pixels=(unsigned char *) NULL;
length=0;
switch (compression)
@@ -881,7 +881,7 @@
case Group4Compression:
{
if ((IsImageMonochrome(image,exception) == MagickFalse) ||
- (image->matte != MagickFalse))
+ (image->alpha_trait == BlendPixelTrait))
compression=RLECompression;
break;
}
@@ -1150,7 +1150,7 @@
/*
Image mask.
*/
- if ((image->matte != MagickFalse) &&
+ if ((image->alpha_trait == BlendPixelTrait) &&
(WritePS3MaskImage(image_info,image,compression,exception) == MagickFalse))
{
(void) CloseBlob(image);
@@ -1224,7 +1224,7 @@
/*
Masked image?
*/
- (void) WriteBlobString(image,image->matte != MagickFalse ?
+ (void) WriteBlobString(image,image->alpha_trait == BlendPixelTrait ?
"true\n" : "false\n");
/*
Render with imagemask operator?
diff --git a/coders/psd.c b/coders/psd.c
index 4c89e28..4e8040b 100644
--- a/coders/psd.c
+++ b/coders/psd.c
@@ -697,7 +697,7 @@
if (image->colorspace == CMYKColorspace)
SetPixelBlack(image,pixel,q);
else
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
SetPixelAlpha(image,pixel,q);
break;
}
@@ -706,7 +706,7 @@
if ((IssRGBCompatibleColorspace(image->colorspace) != MagickFalse) &&
(channels > 3))
break;
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
SetPixelAlpha(image,pixel,q);
break;
}
@@ -832,7 +832,7 @@
image=DestroyImageList(image);
return((Image *) NULL);
}
- image->matte=psd_info.channels >= 4 ? MagickTrue : MagickFalse;
+ image->alpha_trait=psd_info.channels >= 4 ? MagickTrue : MagickFalse;
if (psd_info.mode == LabMode)
SetImageColorspace(image,LabColorspace,exception);
psd_info.color_channels=3;
@@ -840,7 +840,7 @@
{
psd_info.color_channels=4;
SetImageColorspace(image,CMYKColorspace,exception);
- image->matte=psd_info.channels >= 5 ? MagickTrue : MagickFalse;
+ image->alpha_trait=psd_info.channels >= 5 ? MagickTrue : MagickFalse;
}
if ((psd_info.mode == BitmapMode) || (psd_info.mode == GrayscaleMode) ||
(psd_info.mode == DuotoneMode))
@@ -848,13 +848,13 @@
psd_info.color_channels=1;
if (AcquireImageColormap(image,256,exception) == MagickFalse)
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
- image->matte=psd_info.channels >= 2 ? MagickTrue : MagickFalse;
+ image->alpha_trait=psd_info.channels >= 2 ? MagickTrue : MagickFalse;
if (image->debug != MagickFalse)
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" Image colormap allocated");
SetImageColorspace(image,GRAYColorspace,exception);
}
- image->matte=MagickFalse;
+ image->alpha_trait=UndefinedPixelTrait;
/*
Read PSD raster colormap only present for indexed and duotone images.
*/
@@ -892,7 +892,7 @@
for (i=0; i < (ssize_t) image->colors; i++)
image->colormap[i].blue=ScaleCharToQuantum((unsigned char)
ReadBlobByte(image));
- image->matte=MagickFalse;
+ image->alpha_trait=UndefinedPixelTrait;
}
}
length=ReadBlobMSBLong(image);
@@ -989,11 +989,11 @@
MagickOffsetType
layer_offset;
- image->matte=psd_info.channels > psd_info.color_channels ? MagickTrue : MagickFalse;
+ image->alpha_trait=psd_info.channels > psd_info.color_channels ? MagickTrue : MagickFalse;
if (image->debug != MagickFalse)
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
- image->matte ? " image has matte" : " image has no matte");
+ image->alpha_trait ? " image has matte" : " image has no matte");
layer_offset=offset+length;
number_layers=(short) ReadBlobMSBShort(image);
@@ -1045,7 +1045,7 @@
quantum;
if (layer_info[i].channels == psd_info.color_channels)
- image->matte=MagickFalse;
+ image->alpha_trait=UndefinedPixelTrait;
quantum=psd_info.version == 1 ? 4UL : 8UL;
if (DiscardBlobBytes(image,length-20-quantum) == MagickFalse)
ThrowFileException(exception,CorruptImageError,
@@ -1242,7 +1242,7 @@
SetImageColorspace(layer_info[i].image,GRAYColorspace,exception);
for (j=0; j < (ssize_t) layer_info[i].channels; j++)
if (layer_info[i].channel_info[j].type == -1)
- layer_info[i].image->matte=MagickTrue;
+ layer_info[i].image->alpha_trait=BlendPixelTrait;
/*
Set up some hidden attributes for folks that need them.
*/
@@ -1831,14 +1831,14 @@
(void) WriteBlobMSBShort(image,1);
WritePackbitsLength(psd_info,image_info,image,next_image,
compact_pixels,GrayQuantum,exception);
- if (next_image->matte != MagickFalse)
+ if (next_image->alpha_trait == BlendPixelTrait)
WritePackbitsLength(psd_info,image_info,image,next_image,
compact_pixels,AlphaQuantum,exception);
}
WriteOneChannel(psd_info,image_info,image,next_image,compact_pixels,
GrayQuantum,(i++ == 0) || (separate != MagickFalse) ? MagickTrue :
MagickFalse,exception);
- if (next_image->matte != MagickFalse)
+ if (next_image->alpha_trait == BlendPixelTrait)
WriteOneChannel(psd_info,image_info,image,next_image,compact_pixels,
AlphaQuantum,(i++ == 0) || (separate != MagickFalse) ? MagickTrue :
MagickFalse,exception);
@@ -1855,14 +1855,14 @@
(void) WriteBlobMSBShort(image,1);
WritePackbitsLength(psd_info,image_info,image,next_image,
compact_pixels,IndexQuantum,exception);
- if (next_image->matte != MagickFalse)
+ if (next_image->alpha_trait == BlendPixelTrait)
WritePackbitsLength(psd_info,image_info,image,next_image,
compact_pixels,AlphaQuantum,exception);
}
WriteOneChannel(psd_info,image_info,image,next_image,compact_pixels,
IndexQuantum,(i++ == 0) || (separate != MagickFalse) ? MagickTrue :
MagickFalse,exception);
- if (next_image->matte != MagickFalse)
+ if (next_image->alpha_trait == BlendPixelTrait)
WriteOneChannel(psd_info,image_info,image,next_image,compact_pixels,
AlphaQuantum,(i++ == 0) || (separate != MagickFalse) ? MagickTrue :
MagickFalse,exception);
@@ -1887,7 +1887,7 @@
if (next_image->colorspace == CMYKColorspace)
WritePackbitsLength(psd_info,image_info,image,next_image,
compact_pixels,BlackQuantum,exception);
- if (next_image->matte != MagickFalse)
+ if (next_image->alpha_trait == BlendPixelTrait)
WritePackbitsLength(psd_info,image_info,image,next_image,
compact_pixels,AlphaQuantum,exception);
}
@@ -1909,7 +1909,7 @@
BlackQuantum,(i++ == 0) || (separate != MagickFalse) ? MagickTrue :
MagickFalse,exception);
(void) SetImageProgress(image,SaveImagesTag,4,6);
- if (next_image->matte != MagickFalse)
+ if (next_image->alpha_trait == BlendPixelTrait)
WriteOneChannel(psd_info,image_info,image,next_image,compact_pixels,
AlphaQuantum,(i++ == 0) || (separate != MagickFalse) ? MagickTrue :
MagickFalse,exception);
@@ -2127,7 +2127,7 @@
if (status == MagickFalse)
return(status);
packet_size=(size_t) (image->depth > 8 ? 6 : 3);
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
packet_size+=image->depth > 8 ? 2 : 1;
psd_info.version=1;
if ((LocaleCompare(image_info->magick,"PSB") == 0) ||
@@ -2138,16 +2138,16 @@
for (i=1; i <= 6; i++)
(void) WriteBlobByte(image, 0); /* 6 bytes of reserved */
if (IsImageGray(image,exception) != MagickFalse)
- num_channels=(image->matte != MagickFalse ? 2UL : 1UL);
+ num_channels=(image->alpha_trait == BlendPixelTrait ? 2UL : 1UL);
else
if (image->storage_class == PseudoClass)
- num_channels=(image->matte != MagickFalse ? 2UL : 1UL);
+ num_channels=(image->alpha_trait == BlendPixelTrait ? 2UL : 1UL);
else
{
if (image->colorspace != CMYKColorspace)
- num_channels=(image->matte != MagickFalse ? 4UL : 3UL);
+ num_channels=(image->alpha_trait == BlendPixelTrait ? 4UL : 3UL);
else
- num_channels=(image->matte != MagickFalse ? 5UL : 4UL);
+ num_channels=(image->alpha_trait == BlendPixelTrait ? 5UL : 4UL);
}
(void) WriteBlobMSBShort(image,(unsigned short) num_channels);
(void) WriteBlobMSBLong(image,(unsigned int) image->rows);
@@ -2250,22 +2250,22 @@
layer_count=0;
layer_info_size=2;
base_image=GetNextImageInList(image);
- if ((image->matte != MagickFalse) && (base_image == (Image *) NULL))
+ if ((image->alpha_trait == BlendPixelTrait) && (base_image == (Image *) NULL))
base_image=image;
next_image=base_image;
while ( next_image != NULL )
{
packet_size=next_image->depth > 8 ? 2UL : 1UL;
if (IsImageGray(next_image,exception) != MagickFalse)
- num_channels=next_image->matte != MagickFalse ? 2UL : 1UL;
+ num_channels=next_image->alpha_trait == BlendPixelTrait ? 2UL : 1UL;
else
if (next_image->storage_class == PseudoClass)
- num_channels=next_image->matte != MagickFalse ? 2UL : 1UL;
+ num_channels=next_image->alpha_trait == BlendPixelTrait ? 2UL : 1UL;
else
if (next_image->colorspace != CMYKColorspace)
- num_channels=next_image->matte != MagickFalse ? 4UL : 3UL;
+ num_channels=next_image->alpha_trait == BlendPixelTrait ? 4UL : 3UL;
else
- num_channels=next_image->matte != MagickFalse ? 5UL : 4UL;
+ num_channels=next_image->alpha_trait == BlendPixelTrait ? 5UL : 4UL;
channelLength=(size_t) (next_image->columns*next_image->rows*packet_size+2);
layer_info_size+=(size_t) (4*4+2+num_channels*6+(psd_info.version == 1 ? 8 :
16)+4*1+4+num_channels*channelLength);
@@ -2317,10 +2317,10 @@
(next_image->storage_class == PseudoClass))
{
(void) WriteBlobMSBShort(image,(unsigned short)
- (next_image->matte != MagickFalse ? 2 : 1));
+ (next_image->alpha_trait == BlendPixelTrait ? 2 : 1));
(void) WriteBlobMSBShort(image,0);
(void) SetPSDSize(&psd_info,image,channel_size);
- if (next_image->matte != MagickFalse)
+ if (next_image->alpha_trait == BlendPixelTrait)
{
(void) WriteBlobMSBShort(image,(unsigned short) -1);
(void) SetPSDSize(&psd_info,image,channel_size);
@@ -2330,14 +2330,14 @@
if (next_image->colorspace != CMYKColorspace)
{
(void) WriteBlobMSBShort(image,(unsigned short)
- (next_image->matte != MagickFalse ? 4 : 3));
+ (next_image->alpha_trait == BlendPixelTrait ? 4 : 3));
(void) WriteBlobMSBShort(image,0);
(void) SetPSDSize(&psd_info,image,channel_size);
(void) WriteBlobMSBShort(image,1);
(void) SetPSDSize(&psd_info,image,channel_size);
(void) WriteBlobMSBShort(image,2);
(void) SetPSDSize(&psd_info,image,channel_size);
- if (next_image->matte!= MagickFalse )
+ if (next_image->alpha_trait == BlendPixelTrait)
{
(void) WriteBlobMSBShort(image,(unsigned short) -1);
(void) SetPSDSize(&psd_info,image,channel_size);
@@ -2346,7 +2346,7 @@
else
{
(void) WriteBlobMSBShort(image,(unsigned short)
- (next_image->matte ? 5 : 4));
+ (next_image->alpha_trait ? 5 : 4));
(void) WriteBlobMSBShort(image,0);
(void) SetPSDSize(&psd_info,image,channel_size);
(void) WriteBlobMSBShort(image,1);
@@ -2355,7 +2355,7 @@
(void) SetPSDSize(&psd_info,image,channel_size);
(void) WriteBlobMSBShort(image,3);
(void) SetPSDSize(&psd_info,image,channel_size);
- if (next_image->matte)
+ if (next_image->alpha_trait)
{
(void) WriteBlobMSBShort(image,(unsigned short) -1);
(void) SetPSDSize(&psd_info,image,channel_size);
diff --git a/coders/rgb.c b/coders/rgb.c
index 0859a0d..6412699 100644
--- a/coders/rgb.c
+++ b/coders/rgb.c
@@ -167,13 +167,13 @@
if (LocaleCompare(image_info->magick,"RGBA") == 0)
{
quantum_type=RGBAQuantum;
- image->matte=MagickTrue;
- canvas_image->matte=MagickTrue;
+ image->alpha_trait=BlendPixelTrait;
+ canvas_image->alpha_trait=BlendPixelTrait;
}
if (LocaleCompare(image_info->magick,"RGBO") == 0)
{
quantum_type=RGBOQuantum;
- canvas_image->matte=MagickTrue;
+ canvas_image->alpha_trait=BlendPixelTrait;
}
if (image_info->number_scenes != 0)
while (image->scene < image_info->scene)
@@ -254,7 +254,7 @@
SetPixelGreen(image,GetPixelGreen(canvas_image,p),q);
SetPixelBlue(image,GetPixelBlue(canvas_image,p),q);
SetPixelAlpha(image,OpaqueAlpha,q);
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
SetPixelAlpha(image,GetPixelAlpha(canvas_image,p),q);
p+=GetPixelChannels(canvas_image);
q+=GetPixelChannels(image);
@@ -311,7 +311,7 @@
"UnexpectedEndOfFile",image->filename);
break;
}
- for (i=0; i < (ssize_t) (image->matte != MagickFalse ? 4 : 3); i++)
+ for (i=0; i < (ssize_t) (image->alpha_trait == BlendPixelTrait ? 4 : 3); i++)
{
quantum_type=quantum_types[i];
q=GetAuthenticPixels(canvas_image,0,0,canvas_image->columns,1,
@@ -550,7 +550,7 @@
if (status == MagickFalse)
break;
}
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
{
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
@@ -830,7 +830,7 @@
if (status == MagickFalse)
break;
}
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
{
(void) CloseBlob(image);
AppendImageFormat("A",image->filename);
@@ -1111,7 +1111,7 @@
if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
(void) TransformImageColorspace(image,sRGBColorspace,exception);
if ((LocaleCompare(image_info->magick,"RGBA") == 0) &&
- (image->matte == MagickFalse))
+ (image->alpha_trait != BlendPixelTrait))
(void) SetImageAlphaChannel(image,OpaqueAlphaChannel,exception);
quantum_info=AcquireQuantumInfo(image_info,image);
if (quantum_info == (QuantumInfo *) NULL)
diff --git a/coders/rla.c b/coders/rla.c
index 843fd6f..1579a0d 100644
--- a/coders/rla.c
+++ b/coders/rla.c
@@ -252,7 +252,7 @@
/*
Initialize image structure.
*/
- image->matte=rla_info.number_matte_channels != 0 ? MagickTrue : MagickFalse;
+ image->alpha_trait=rla_info.number_matte_channels != 0 ? MagickTrue : MagickFalse;
image->columns=1UL*rla_info.active_window.right-rla_info.active_window.left+1;
image->rows=1UL*rla_info.active_window.top-rla_info.active_window.bottom+1;
if (image_info->ping != MagickFalse)
diff --git a/coders/rle.c b/coders/rle.c
index f28a967..506447d 100644
--- a/coders/rle.c
+++ b/coders/rle.c
@@ -212,7 +212,7 @@
image->columns=ReadBlobLSBShort(image);
image->rows=ReadBlobLSBShort(image);
flags=(MagickStatusType) ReadBlobByte(image);
- image->matte=flags & 0x04 ? MagickTrue : MagickFalse;
+ image->alpha_trait=flags & 0x04 ? MagickTrue : MagickFalse;
number_planes=1UL*ReadBlobByte(image);
bits_per_pixel=1UL*ReadBlobByte(image);
number_colormaps=1UL*ReadBlobByte(image);
@@ -287,7 +287,7 @@
/*
Allocate RLE pixels.
*/
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
number_planes++;
number_pixels=(MagickSizeType) image->columns*image->rows;
if ((number_pixels*number_planes) != (size_t) (number_pixels*number_planes))
@@ -307,7 +307,7 @@
p=rle_pixels;
for (i=0; i < (ssize_t) number_pixels; i++)
{
- if (image->matte == MagickFalse)
+ if (image->alpha_trait != BlendPixelTrait)
for (j=0; j < (ssize_t) number_planes; j++)
*p++=background_color[j];
else
@@ -445,7 +445,7 @@
SetPixelRed(image,ScaleCharToQuantum(*p++),q);
SetPixelGreen(image,ScaleCharToQuantum(*p++),q);
SetPixelBlue(image,ScaleCharToQuantum(*p++),q);
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
SetPixelAlpha(image,ScaleCharToQuantum(*p++),q);
q+=GetPixelChannels(image);
}
@@ -490,7 +490,7 @@
p++;
}
p=rle_pixels;
- if (image->matte == MagickFalse)
+ if (image->alpha_trait != BlendPixelTrait)
{
/*
Convert raster image to PseudoClass pixel packets.
diff --git a/coders/sgi.c b/coders/sgi.c
index 83db3a8..bfcd702 100644
--- a/coders/sgi.c
+++ b/coders/sgi.c
@@ -530,7 +530,7 @@
/*
Initialize image structure.
*/
- image->matte=iris_info.depth == 4 ? MagickTrue : MagickFalse;
+ image->alpha_trait=iris_info.depth == 4 ? MagickTrue : MagickFalse;
image->columns=iris_info.columns;
image->rows=iris_info.rows;
/*
@@ -558,7 +558,7 @@
SetPixelBlue(image,ScaleShortToQuantum((unsigned short)
((*(p+4) << 8) | (*(p+5)))),q);
SetPixelAlpha(image,OpaqueAlpha,q);
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
SetPixelAlpha(image,ScaleShortToQuantum((unsigned short)
((*(p+6) << 8) | (*(p+7)))),q);
p+=8;
@@ -588,7 +588,7 @@
SetPixelGreen(image,ScaleCharToQuantum(*(p+1)),q);
SetPixelBlue(image,ScaleCharToQuantum(*(p+2)),q);
SetPixelAlpha(image,OpaqueAlpha,q);
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
SetPixelAlpha(image,ScaleCharToQuantum(*(p+3)),q);
p+=4;
q+=GetPixelChannels(image);
@@ -924,7 +924,7 @@
iris_info.dimension=3;
iris_info.columns=(unsigned short) image->columns;
iris_info.rows=(unsigned short) image->rows;
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
iris_info.depth=4;
else
{
diff --git a/coders/sun.c b/coders/sun.c
index 56f4a64..e5b220f 100644
--- a/coders/sun.c
+++ b/coders/sun.c
@@ -383,7 +383,7 @@
default:
ThrowReaderException(CoderError,"ColormapTypeNotSupported");
}
- image->matte=sun_info.depth == 32 ? MagickTrue : MagickFalse;
+ image->alpha_trait=sun_info.depth == 32 ? MagickTrue : MagickFalse;
image->columns=sun_info.width;
image->rows=sun_info.height;
if (image_info->ping != MagickFalse)
@@ -510,7 +510,7 @@
bytes_per_pixel;
bytes_per_pixel=3;
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
bytes_per_pixel++;
length=image->rows*((bytes_per_line*image->columns)+
image->columns % 2);
@@ -525,7 +525,7 @@
break;
for (x=0; x < (ssize_t) image->columns; x++)
{
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
SetPixelAlpha(image,ScaleCharToQuantum(*p++),q);
if (sun_info.type == RT_STANDARD)
{
@@ -781,8 +781,8 @@
/*
Full color SUN raster.
*/
- sun_info.depth=(unsigned int) image->matte ? 32U : 24U;
- sun_info.length=(unsigned int) ((image->matte ? 4 : 3)*number_pixels);
+ sun_info.depth=(unsigned int) image->alpha_trait ? 32U : 24U;
+ sun_info.length=(unsigned int) ((image->alpha_trait ? 4 : 3)*number_pixels);
sun_info.length+=sun_info.length & 0x01 ? (unsigned int) image->rows :
0;
}
@@ -842,7 +842,7 @@
Allocate memory for pixels.
*/
bytes_per_pixel=3;
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
bytes_per_pixel++;
length=image->columns;
pixels=(unsigned char *) AcquireQuantumMemory(length,4*sizeof(*pixels));
@@ -859,7 +859,7 @@
q=pixels;
for (x=0; x < (ssize_t) image->columns; x++)
{
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
*q++=ScaleQuantumToChar(GetPixelAlpha(image,p));
*q++=ScaleQuantumToChar(GetPixelRed(image,p));
*q++=ScaleQuantumToChar(GetPixelGreen(image,p));
diff --git a/coders/svg.c b/coders/svg.c
index ab6d4a7..0b2a0f4 100644
--- a/coders/svg.c
+++ b/coders/svg.c
@@ -2935,7 +2935,7 @@
image->columns=gdk_pixbuf_get_width(pixel_info);
image->rows=gdk_pixbuf_get_height(pixel_info);
#endif
- image->matte=MagickTrue;
+ image->alpha_trait=BlendPixelTrait;
SetImageProperty(image,"svg:base-uri",
rsvg_handle_get_base_uri(svg_handle),exception);
if ((image->columns == 0) || (image->rows == 0))
diff --git a/coders/tga.c b/coders/tga.c
index 34c4563..b2e7e46 100644
--- a/coders/tga.c
+++ b/coders/tga.c
@@ -227,7 +227,7 @@
image->columns=tga_info.width;
image->rows=tga_info.height;
alpha_bits=(tga_info.attributes & 0x0FU);
- image->matte=(alpha_bits > 0) || (tga_info.bits_per_pixel == 32) ?
+ image->alpha_trait=(alpha_bits > 0) || (tga_info.bits_per_pixel == 32) ?
MagickTrue : MagickFalse;
if ((tga_info.image_type != TGAColormap) &&
(tga_info.image_type != TGARLEColormap))
@@ -423,7 +423,7 @@
pixel.green=ScaleAnyToQuantum((1UL*(k & 0x03) << 3)+
(1UL*(j & 0xe0) >> 5),range);
pixel.blue=ScaleAnyToQuantum(1UL*(j & 0x1f),range);
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
pixel.alpha=(k & 0x80) == 0 ? (Quantum) OpaqueAlpha : (Quantum)
TransparentAlpha;
if (image->storage_class == PseudoClass)
@@ -463,7 +463,7 @@
SetPixelRed(image,pixel.red,q);
SetPixelGreen(image,pixel.green,q);
SetPixelBlue(image,pixel.blue,q);
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
SetPixelAlpha(image,pixel.alpha,q);
q+=GetPixelChannels(image);
}
@@ -717,7 +717,7 @@
if ((image_info->type != TrueColorType) &&
(image_info->type != TrueColorMatteType) &&
(image_info->type != PaletteType) &&
- (image->matte == MagickFalse) &&
+ (image->alpha_trait != BlendPixelTrait) &&
(IsImageGray(image,exception) != MagickFalse))
targa_info.image_type=TargaMonochrome;
else
@@ -728,7 +728,7 @@
*/
targa_info.image_type=TargaRGB;
targa_info.bits_per_pixel=24;
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
{
targa_info.bits_per_pixel=32;
targa_info.attributes=8; /* # of alpha bits */
@@ -811,7 +811,7 @@
*q++=ScaleQuantumToChar(GetPixelBlue(image,p));
*q++=ScaleQuantumToChar(GetPixelGreen(image,p));
*q++=ScaleQuantumToChar(GetPixelRed(image,p));
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
*q++=(unsigned char) ScaleQuantumToChar(GetPixelAlpha(image,p));
}
p+=GetPixelChannels(image);
diff --git a/coders/thumbnail.c b/coders/thumbnail.c
index 2ae47db..8c044b9 100644
--- a/coders/thumbnail.c
+++ b/coders/thumbnail.c
@@ -205,7 +205,7 @@
length,exception);
if (thumbnail_image == (Image *) NULL)
return(MagickFalse);
- (void) SetImageType(thumbnail_image,thumbnail_image->matte == MagickFalse ?
+ (void) SetImageType(thumbnail_image,thumbnail_image->alpha_trait != BlendPixelTrait ?
TrueColorType : TrueColorMatteType,exception);
(void) CopyMagickString(thumbnail_image->filename,image->filename,
MaxTextExtent);
diff --git a/coders/tiff.c b/coders/tiff.c
index 73a88fb..302219d 100644
--- a/coders/tiff.c
+++ b/coders/tiff.c
@@ -1204,12 +1204,12 @@
if (extra_samples == 0)
{
if ((samples_per_pixel == 4) && (photometric == PHOTOMETRIC_RGB))
- image->matte=MagickTrue;
+ image->alpha_trait=BlendPixelTrait;
}
else
for (i=0; i < extra_samples; i++)
{
- image->matte=MagickTrue;
+ image->alpha_trait=BlendPixelTrait;
if (sample_info[i] == EXTRASAMPLE_ASSOCALPHA)
SetQuantumAlphaType(quantum_info,DisassociatedQuantumAlpha);
}
@@ -1217,7 +1217,7 @@
if (option != (const char *) NULL)
associated_alpha=LocaleCompare(option,"associated") == 0 ? MagickTrue :
MagickFalse;
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
(void) SetImageProperty(image,"tiff:alpha",
associated_alpha != MagickFalse ? "associated" : "unassociated",
exception);
@@ -1331,7 +1331,7 @@
}
quantum_type=IndexQuantum;
pad=(size_t) MagickMax((size_t) samples_per_pixel-1,0);
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
{
if (image->storage_class != PseudoClass)
{
@@ -1394,7 +1394,7 @@
*/
pad=(size_t) MagickMax((size_t) samples_per_pixel-3,0);
quantum_type=RGBQuantum;
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
{
quantum_type=RGBAQuantum;
pad=(size_t) MagickMax((size_t) samples_per_pixel-4,0);
@@ -1403,7 +1403,7 @@
{
pad=(size_t) MagickMax((size_t) samples_per_pixel-4,0);
quantum_type=CMYKQuantum;
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
{
quantum_type=CMYKAQuantum;
pad=(size_t) MagickMax((size_t) samples_per_pixel-5,0);
@@ -1538,7 +1538,7 @@
(TIFFGetG(*p))),q);
SetPixelBlue(image,ScaleCharToQuantum((unsigned char)
(TIFFGetB(*p))),q);
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
SetPixelAlpha(image,ScaleCharToQuantum((unsigned char)
(TIFFGetA(*p))),q);
p++;
@@ -1623,7 +1623,7 @@
x);
for (row=rows_remaining; row > 0; row--)
{
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
for (column=columns_remaining; column > 0; column--)
{
SetPixelRed(image,ScaleCharToQuantum((unsigned char)
@@ -1718,7 +1718,7 @@
TIFFGetG(*p)),q);
SetPixelBlue(image,ScaleCharToQuantum((unsigned char)
TIFFGetB(*p)),q);
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
SetPixelAlpha(image,ScaleCharToQuantum((unsigned char)
TIFFGetA(*p)),q);
p--;
@@ -2932,7 +2932,7 @@
MagickFalse ? PHOTOMETRIC_MINISWHITE :
PHOTOMETRIC_MINISBLACK);
(void) TIFFSetField(tiff,TIFFTAG_SAMPLESPERPIXEL,1);
- if ((image_info->depth == 0) && (image->matte == MagickFalse) &&
+ if ((image_info->depth == 0) && (image->alpha_trait != BlendPixelTrait) &&
(IsImageMonochrome(image,exception) != MagickFalse))
{
status=SetQuantumDepth(image,quantum_info,1);
@@ -3008,7 +3008,7 @@
(void) TIFFSetField(tiff,TIFFTAG_COMPRESSION,compress_tag);
(void) TIFFSetField(tiff,TIFFTAG_FILLORDER,endian);
(void) TIFFSetField(tiff,TIFFTAG_BITSPERSAMPLE,quantum_info->depth);
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
{
uint16
extra_samples,
@@ -3272,7 +3272,7 @@
default:
{
quantum_type=RGBQuantum;
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
quantum_type=RGBAQuantum;
for (y=0; y < (ssize_t) image->rows; y++)
{
@@ -3360,7 +3360,7 @@
if (status == MagickFalse)
break;
}
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
for (y=0; y < (ssize_t) image->rows; y++)
{
register const Quantum
@@ -3391,7 +3391,7 @@
CMYK TIFF image.
*/
quantum_type=CMYKQuantum;
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
quantum_type=CMYKAQuantum;
if (image->colorspace != CMYKColorspace)
(void) TransformImageColorspace(image,CMYKColorspace,exception);
@@ -3456,7 +3456,7 @@
Convert PseudoClass packets to contiguous grayscale scanlines.
*/
quantum_type=IndexQuantum;
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
{
if (photometric != PHOTOMETRIC_PALETTE)
quantum_type=GrayAlphaQuantum;
diff --git a/coders/tile.c b/coders/tile.c
index 224a171..1a2f281 100644
--- a/coders/tile.c
+++ b/coders/tile.c
@@ -117,8 +117,8 @@
if (*image_info->filename == '\0')
ThrowReaderException(OptionError,"MustSpecifyAnImageName");
image->colorspace=tile_image->colorspace;
- image->matte=tile_image->matte;
- if (image->matte != MagickFalse)
+ image->alpha_trait=tile_image->alpha_trait;
+ if (image->alpha_trait == BlendPixelTrait)
(void) SetImageBackgroundColor(image,exception);
(void) CopyMagickString(image->filename,image_info->filename,MaxTextExtent);
if (LocaleCompare(tile_image->magick,"PATTERN") == 0)
diff --git a/coders/txt.c b/coders/txt.c
index db31a0d..0ea542e 100644
--- a/coders/txt.c
+++ b/coders/txt.c
@@ -432,11 +432,11 @@
image->depth=depth;
LocaleLower(colorspace);
i=(ssize_t) strlen(colorspace)-1;
- image->matte=MagickFalse;
+ image->alpha_trait=UndefinedPixelTrait;
if ((i > 0) && (colorspace[i] == 'a'))
{
colorspace[i]='\0';
- image->matte=MagickTrue;
+ image->alpha_trait=BlendPixelTrait;
}
type=ParseCommandOption(MagickColorspaceOptions,MagickFalse,colorspace);
if (type < 0)
@@ -455,7 +455,7 @@
{
case GRAYColorspace:
{
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
{
count=(ssize_t) sscanf(text,"%ld,%ld: (%lf,%lf",&x_offset,
&y_offset,&pixel.red,&pixel.alpha);
@@ -471,7 +471,7 @@
}
case CMYKColorspace:
{
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
{
count=(ssize_t) sscanf(text,"%ld,%ld: (%lf,%lf,%lf,%lf,%lf",
&x_offset,&y_offset,&pixel.red,&pixel.green,&pixel.blue,
@@ -484,7 +484,7 @@
}
default:
{
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
{
count=(ssize_t) sscanf(text,"%ld,%ld: (%lf,%lf,%lf,%lf",
&x_offset,&y_offset,&pixel.red,&pixel.green,&pixel.blue,
@@ -675,7 +675,7 @@
MagickColorspaceOptions,(ssize_t) image->colorspace),MaxTextExtent);
LocaleLower(colorspace);
image->depth=GetImageQuantumDepth(image,MagickTrue);
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
(void) ConcatenateMagickString(colorspace,"a",MaxTextExtent);
(void) FormatLocaleString(buffer,MaxTextExtent,
"# ImageMagick pixel enumeration: %.20g,%.20g,%.20g,%s\n",(double)
@@ -715,7 +715,7 @@
ConcatenateColorComponent(&pixel,BlackPixelChannel,X11Compliance,
tuple);
}
- if (pixel.matte != MagickFalse)
+ if (pixel.alpha_trait == BlendPixelTrait)
{
(void) ConcatenateMagickString(tuple,",",MaxTextExtent);
ConcatenateColorComponent(&pixel,AlphaPixelChannel,X11Compliance,
diff --git a/coders/uil.c b/coders/uil.c
index cd1077d..6dd1945 100644
--- a/coders/uil.c
+++ b/coders/uil.c
@@ -230,7 +230,7 @@
Convert DirectClass to PseudoClass image.
*/
matte_image=(unsigned char *) NULL;
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
{
/*
Map all the transparent pixels.
diff --git a/coders/viff.c b/coders/viff.c
index 2f15101..11d8f7e 100644
--- a/coders/viff.c
+++ b/coders/viff.c
@@ -485,7 +485,7 @@
/*
Initialize image structure.
*/
- image->matte=viff_info.number_data_bands == 4 ? MagickTrue : MagickFalse;
+ image->alpha_trait=viff_info.number_data_bands == 4 ? MagickTrue : MagickFalse;
image->storage_class=
(viff_info.number_data_bands < 3 ? PseudoClass : DirectClass);
image->columns=viff_info.rows;
@@ -706,7 +706,7 @@
SetPixelBlue(image,image->colormap[(ssize_t)
GetPixelBlue(image,q)].blue,q);
}
- SetPixelAlpha(image,image->matte != MagickFalse ?
+ SetPixelAlpha(image,image->alpha_trait == BlendPixelTrait ?
ScaleCharToQuantum(*(p+number_pixels*3)) : OpaqueAlpha,q);
p++;
q+=GetPixelChannels(image);
@@ -1010,7 +1010,7 @@
/*
Full color VIFF raster.
*/
- viff_info.number_data_bands=image->matte ? 4UL : 3UL;
+ viff_info.number_data_bands=image->alpha_trait ? 4UL : 3UL;
viff_info.color_space_model=VFF_CM_genericRGB;
viff_info.data_storage_type=VFF_TYP_1_BYTE;
packets=viff_info.number_data_bands*number_pixels;
@@ -1103,7 +1103,7 @@
*q=ScaleQuantumToChar(GetPixelRed(image,p));
*(q+number_pixels)=ScaleQuantumToChar(GetPixelGreen(image,p));
*(q+number_pixels*2)=ScaleQuantumToChar(GetPixelBlue(image,p));
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
*(q+number_pixels*3)=ScaleQuantumToChar((Quantum)
(GetPixelAlpha(image,p)));
p+=GetPixelChannels(image);
diff --git a/coders/webp.c b/coders/webp.c
index 49cfb23..e231600 100644
--- a/coders/webp.c
+++ b/coders/webp.c
@@ -163,7 +163,7 @@
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
image->columns=(size_t) width;
image->rows=(size_t) height;
- image->matte=MagickTrue;
+ image->alpha_trait=BlendPixelTrait;
p=pixels;
for (y=0; y < (ssize_t) image->rows; y++)
{
@@ -376,7 +376,7 @@
*q++=ScaleQuantumToChar(GetPixelRed(image,p));
*q++=ScaleQuantumToChar(GetPixelGreen(image,p));
*q++=ScaleQuantumToChar(GetPixelBlue(image,p));
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
*q++=ScaleQuantumToChar(GetPixelAlpha(image,p));
p+=GetPixelChannels(image);
}
@@ -385,7 +385,7 @@
if (status == MagickFalse)
break;
}
- if (image->matte == MagickFalse)
+ if (image->alpha_trait != BlendPixelTrait)
webp_status=WebPPictureImportRGB(&picture,pixels,3*picture.width);
else
webp_status=WebPPictureImportRGBA(&picture,pixels,4*picture.width);
diff --git a/coders/wmf.c b/coders/wmf.c
index 77ca0bd..76314ba 100644
--- a/coders/wmf.c
+++ b/coders/wmf.c
@@ -2863,7 +2863,7 @@
{
image->background_color = image_info->background_color;
if (image->background_color.alpha != OpaqueAlpha)
- image->matte = MagickTrue;
+ image->alpha_trait = MagickTrue;
(void) SetImageBackgroundColor(image,exception);
}
/*
diff --git a/coders/xc.c b/coders/xc.c
index 914b912..2267abc 100644
--- a/coders/xc.c
+++ b/coders/xc.c
@@ -137,7 +137,7 @@
}
}
SetImageColorspace(image,pixel.colorspace,exception);
- image->matte=pixel.matte;
+ image->alpha_trait=pixel.alpha_trait;
for (y=0; y < (ssize_t) image->rows; y++)
{
q=QueueAuthenticPixels(image,0,y,image->columns,1,exception);
diff --git a/coders/xcf.c b/coders/xcf.c
index cd82957..7dce50e 100644
--- a/coders/xcf.c
+++ b/coders/xcf.c
@@ -1063,7 +1063,7 @@
if (image_type == GIMP_INDEXED)
ThrowReaderException(CoderError,"ColormapTypeNotSupported");
(void) SetImageBackgroundColor(image,exception);
- image->matte=MagickTrue;
+ image->alpha_trait=BlendPixelTrait;
/*
Read properties.
*/
diff --git a/coders/xpm.c b/coders/xpm.c
index 940a419..dd21e10 100644
--- a/coders/xpm.c
+++ b/coders/xpm.c
@@ -376,7 +376,7 @@
if (LocaleCompare(target,"none") == 0)
{
image->storage_class=DirectClass;
- image->matte=MagickTrue;
+ image->alpha_trait=BlendPixelTrait;
}
status=QueryColorCompliance(target,AllCompliance,&image->colormap[j],
exception);
@@ -657,7 +657,7 @@
if (picon->storage_class == PseudoClass)
{
(void) CompressImageColormap(picon,exception);
- if (picon->matte != MagickFalse)
+ if (picon->alpha_trait == BlendPixelTrait)
transparent=MagickTrue;
}
else
@@ -665,7 +665,7 @@
/*
Convert DirectClass to PseudoClass picon.
*/
- if (picon->matte != MagickFalse)
+ if (picon->alpha_trait == BlendPixelTrait)
{
/*
Map all the transparent pixels.
@@ -881,7 +881,7 @@
if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
(void) TransformImageColorspace(image,sRGBColorspace,exception);
opacity=(-1);
- if (image->matte == MagickFalse)
+ if (image->alpha_trait != BlendPixelTrait)
{
if ((image->storage_class == DirectClass) || (image->colors > 256))
(void) SetImageType(image,PaletteType,exception);
diff --git a/coders/ycbcr.c b/coders/ycbcr.c
index a983d0e..9056d9c 100644
--- a/coders/ycbcr.c
+++ b/coders/ycbcr.c
@@ -175,7 +175,7 @@
if (LocaleCompare(image_info->magick,"YCbCrA") == 0)
{
quantum_type=RGBAQuantum;
- image->matte=MagickTrue;
+ image->alpha_trait=BlendPixelTrait;
}
if (image_info->number_scenes != 0)
while (image->scene < image_info->scene)
@@ -248,7 +248,7 @@
SetPixelRed(image,GetPixelRed(canvas_image,p),q);
SetPixelGreen(image,GetPixelGreen(canvas_image,p),q);
SetPixelBlue(image,GetPixelBlue(canvas_image,p),q);
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
SetPixelAlpha(image,GetPixelAlpha(canvas_image,p),q);
p+=GetPixelChannels(canvas_image);
q+=GetPixelChannels(image);
@@ -288,7 +288,7 @@
}
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
- for (i=0; i < (image->matte != MagickFalse ? 4 : 3); i++)
+ for (i=0; i < (image->alpha_trait == BlendPixelTrait ? 4 : 3); i++)
{
if (count != (ssize_t) length)
{
@@ -499,7 +499,7 @@
if (status == MagickFalse)
break;
}
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
{
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
@@ -747,7 +747,7 @@
if (status == MagickFalse)
break;
}
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
{
(void) CloseBlob(image);
AppendImageFormat("A",image->filename);
@@ -1006,7 +1006,7 @@
if (LocaleCompare(image_info->magick,"YCbCrA") == 0)
{
quantum_type=RGBAQuantum;
- image->matte=MagickTrue;
+ image->alpha_trait=BlendPixelTrait;
}
scene=0;
do
@@ -1017,7 +1017,7 @@
if (image->colorspace != YCbCrColorspace)
(void) TransformImageColorspace(image,YCbCrColorspace,exception);
if ((LocaleCompare(image_info->magick,"YCbCrA") == 0) &&
- (image->matte == MagickFalse))
+ (image->alpha_trait != BlendPixelTrait))
(void) SetImageAlphaChannel(image,OpaqueAlphaChannel,exception);
quantum_info=AcquireQuantumInfo(image_info,image);
if (quantum_info == (QuantumInfo *) NULL)