diff --git a/coders/aai.c b/coders/aai.c
index d2af8aa..234e143 100644
--- a/coders/aai.c
+++ b/coders/aai.c
@@ -177,8 +177,7 @@
SetRedPixelComponent(q,ScaleCharToQuantum(*p++));
if (*p == 254)
*p=255;
- SetOpacityPixelComponent(q,(QuantumRange-
- ScaleCharToQuantum(*p++)));
+ SetAlphaPixelComponent(q,ScaleCharToQuantum(*p++));
if (q->opacity != OpaqueOpacity)
image->matte=MagickTrue;
q++;
diff --git a/coders/avs.c b/coders/avs.c
index 4bd35f1..11bd2ab 100644
--- a/coders/avs.c
+++ b/coders/avs.c
@@ -172,8 +172,7 @@
break;
for (x=0; x < (ssize_t) image->columns; x++)
{
- SetOpacityPixelComponent(q,(QuantumRange-
- ScaleCharToQuantum(*p++)));
+ SetAlphaPixelComponent(q,ScaleCharToQuantum(*p++));
SetRedPixelComponent(q,ScaleCharToQuantum(*p++));
SetGreenPixelComponent(q,ScaleCharToQuantum(*p++));
SetBluePixelComponent(q,ScaleCharToQuantum(*p++));
diff --git a/coders/dcm.c b/coders/dcm.c
index 265c2fe..c67a004 100644
--- a/coders/dcm.c
+++ b/coders/dcm.c
@@ -3747,9 +3747,8 @@
}
case 3:
{
- SetOpacityPixelComponent(q,(QuantumRange-
- ScaleCharToQuantum((unsigned char) ReadDCMByte(stream_info,
- image))));
+ SetAlphaPixelComponent(q,ScaleCharToQuantum((unsigned char)
+ ReadDCMByte(stream_info,image)));
break;
}
default:
diff --git a/coders/exr.c b/coders/exr.c
index ccd9c97..7393221 100644
--- a/coders/exr.c
+++ b/coders/exr.c
@@ -230,8 +230,8 @@
ImfHalfToFloat(scanline[x].g)));
SetBluePixelComponent(q,ClampToQuantum((MagickRealType) QuantumRange*
ImfHalfToFloat(scanline[x].b)));
- SetOpacityPixelComponent(q,ClampToQuantum((MagickRealType) QuantumRange-
- QuantumRange*ImfHalfToFloat(scanline[x].a)));
+ SetAlphaPixelComponent(q,ClampToQuantum((MagickRealType) QuantumRange*
+ ImfHalfToFloat(scanline[x].a)));
q++;
}
if (SyncAuthenticPixels(image,exception) == MagickFalse)
diff --git a/coders/icon.c b/coders/icon.c
index 8f0c3d1..4cfd35d 100644
--- a/coders/icon.c
+++ b/coders/icon.c
@@ -550,8 +550,8 @@
SetRedPixelComponent(q,ScaleCharToQuantum((unsigned char)
ReadBlobByte(image)));
if (icon_info.bits_per_pixel == 32)
- SetOpacityPixelComponent(q,(QuantumRange-ScaleCharToQuantum(
- (unsigned char) ReadBlobByte(image))));
+ SetAlphaPixelComponent(q,ScaleCharToQuantum((unsigned char)
+ ReadBlobByte(image)));
q++;
}
if (icon_info.bits_per_pixel == 24)
diff --git a/coders/jp2.c b/coders/jp2.c
index 5585cff..a70d091 100644
--- a/coders/jp2.c
+++ b/coders/jp2.c
@@ -581,8 +581,8 @@
SetBluePixelComponent(q,ScaleAnyToQuantum((QuantumAny) pixel,
range[2]));
pixel=(QuantumAny) jas_matrix_getv(pixels[3],x/x_step[3]);
- SetOpacityPixelComponent(q,(QuantumRange-
- ScaleAnyToQuantum((QuantumAny) pixel,range[3])));
+ SetAlphaPixelComponent(q,ScaleAnyToQuantum((QuantumAny) pixel,
+ range[3]));
q++;
}
break;
diff --git a/coders/pcx.c b/coders/pcx.c
index 70ced85..e197188 100644
--- a/coders/pcx.c
+++ b/coders/pcx.c
@@ -609,7 +609,7 @@
SetGreenPixelComponent(q,ScaleCharToQuantum(*r++));
SetBluePixelComponent(q,ScaleCharToQuantum(*r++));
if (image->matte != MagickFalse)
- SetOpacityPixelComponent(q,QuantumRange-ScaleCharToQuantum(*r++));
+ SetAlphaPixelComponent(q,ScaleCharToQuantum(*r++));
}
q++;
}
diff --git a/coders/pict.c b/coders/pict.c
index 9ddf918..9b857cd 100644
--- a/coders/pict.c
+++ b/coders/pict.c
@@ -1213,8 +1213,7 @@
if (p > (pixels+extent+3*image->columns))
ThrowReaderException(CorruptImageError,
"NotEnoughPixelData");
- SetOpacityPixelComponent(q,(Quantum) (QuantumRange-
- ScaleCharToQuantum(*p)));
+ SetAlphaPixelComponent(q,ScaleCharToQuantum(*p));
SetRedPixelComponent(q,ScaleCharToQuantum(
*(p+tile_image->columns)));
SetGreenPixelComponent(q,ScaleCharToQuantum(
diff --git a/coders/png.c b/coders/png.c
index 528c961..93a28d4 100644
--- a/coders/png.c
+++ b/coders/png.c
@@ -3107,7 +3107,7 @@
{
quantum=((*p++) << 8);
quantum|=(*p++);
- SetOpacityPixelComponent(q,(Quantum) (QuantumRange-quantum));
+ SetAlphaPixelComponent(q,quantum);
if (GetOpacityPixelComponent(q) != OpaqueOpacity)
found_transparent_pixel = MagickTrue;
q++;
@@ -3146,7 +3146,7 @@
if (ping_color_type == 4)
{
- SetOpacityPixelComponent(q,(Quantum) (QuantumRange-(*p++)));
+ SetAlphaPixelComponent(q,*p++);
if (GetOpacityPixelComponent(q) != OpaqueOpacity)
found_transparent_pixel = MagickTrue;
p++;
@@ -4383,8 +4383,7 @@
else
for (x=(ssize_t) image->columns; x != 0; x--,q++,s++)
{
- SetOpacityPixelComponent(q,(Quantum) QuantumRange-
- GetRedPixelComponent(s));
+ SetAlphaPixelComponent(q,GetRedPixelComponent(s));
if (GetOpacityPixelComponent(q) != OpaqueOpacity)
image->matte=MagickTrue;
}
diff --git a/coders/psd.c b/coders/psd.c
index 5f35693..a25f245 100644
--- a/coders/psd.c
+++ b/coders/psd.c
@@ -636,7 +636,7 @@
{
case -1:
{
- SetOpacityPixelComponent(q,QuantumRange-pixel);
+ SetAlphaPixelComponent(q,pixel);
break;
}
case 0:
@@ -682,7 +682,7 @@
case 1:
{
if (image->storage_class == PseudoClass)
- SetOpacityPixelComponent(q,QuantumRange-pixel);
+ SetAlphaPixelComponent(q,pixel);
else
SetGreenPixelComponent(q,pixel);
break;
@@ -690,7 +690,7 @@
case 2:
{
if (image->storage_class == PseudoClass)
- SetOpacityPixelComponent(q,QuantumRange-pixel);
+ SetAlphaPixelComponent(q,pixel);
else
SetBluePixelComponent(q,pixel);
break;
@@ -700,14 +700,14 @@
if (image->colorspace == CMYKColorspace)
SetIndexPixelComponent(indexes+x,pixel);
else
- SetOpacityPixelComponent(q,QuantumRange-pixel);
+ SetAlphaPixelComponent(q,pixel);
break;
}
case 4:
{
if ((image->colorspace == RGBColorspace) && (channels > 3))
break;
- SetOpacityPixelComponent(q,QuantumRange-pixel);
+ SetAlphaPixelComponent(q,pixel);
break;
}
default:
diff --git a/coders/rla.c b/coders/rla.c
index 8480b91..d950571 100644
--- a/coders/rla.c
+++ b/coders/rla.c
@@ -320,8 +320,7 @@
case 3:
default:
{
- SetOpacityPixelComponent(q,QuantumRange-
- ScaleCharToQuantum(byte));
+ SetAlphaPixelComponent(q,ScaleCharToQuantum(byte));
break;
}
}
@@ -361,7 +360,7 @@
case 3:
default:
{
- SetOpacityPixelComponent(q,QuantumRange-ScaleCharToQuantum(byte));
+ SetAlphaPixelComponent(q,ScaleCharToQuantum(byte));
break;
}
}
diff --git a/coders/rle.c b/coders/rle.c
index f036d5c..08d165b 100644
--- a/coders/rle.c
+++ b/coders/rle.c
@@ -448,7 +448,7 @@
SetGreenPixelComponent(q,ScaleCharToQuantum(*p++));
SetBluePixelComponent(q,ScaleCharToQuantum(*p++));
if (image->matte != MagickFalse)
- SetOpacityPixelComponent(q,QuantumRange-ScaleCharToQuantum(*p++));
+ SetAlphaPixelComponent(q,ScaleCharToQuantum(*p++));
q++;
}
if (SyncAuthenticPixels(image,exception) == MagickFalse)
@@ -532,8 +532,7 @@
SetRedPixelComponent(q,image->colormap[*p++].red);
SetGreenPixelComponent(q,image->colormap[*p++].green);
SetBluePixelComponent(q,image->colormap[*p++].blue);
- SetOpacityPixelComponent(q,QuantumRange-
- ScaleCharToQuantum(*p++));
+ SetAlphaPixelComponent(q,ScaleCharToQuantum(*p++));
q++;
}
if (SyncAuthenticPixels(image,exception) == MagickFalse)
@@ -546,8 +545,8 @@
break;
}
}
- image->colormap=(PixelPacket *)
- RelinquishMagickMemory(image->colormap);
+ image->colormap=(PixelPacket *) RelinquishMagickMemory(
+ image->colormap);
image->storage_class=DirectClass;
image->colors=0;
}
diff --git a/coders/sgi.c b/coders/sgi.c
index eb5e2d7..da85fdb 100644
--- a/coders/sgi.c
+++ b/coders/sgi.c
@@ -559,8 +559,8 @@
((*(p+4) << 8) | (*(p+5)))));
SetOpacityPixelComponent(q,OpaqueOpacity);
if (image->matte != MagickFalse)
- SetOpacityPixelComponent(q,QuantumRange-ScaleShortToQuantum(
- (unsigned short) ((*(p+6) << 8) | (*(p+7)))));
+ SetAlphaPixelComponent(q,ScaleShortToQuantum((unsigned short)
+ ((*(p+6) << 8) | (*(p+7)))));
p+=8;
q++;
}
@@ -589,8 +589,7 @@
q->blue=ScaleCharToQuantum(*(p+2));
SetOpacityPixelComponent(q,OpaqueOpacity);
if (image->matte != MagickFalse)
- SetOpacityPixelComponent(q,QuantumRange-
- ScaleCharToQuantum(*(p+3)));
+ SetAlphaPixelComponent(q,ScaleCharToQuantum(*(p+3)));
p+=4;
q++;
}
diff --git a/coders/sun.c b/coders/sun.c
index 95b0736..901f222 100644
--- a/coders/sun.c
+++ b/coders/sun.c
@@ -521,8 +521,7 @@
for (x=0; x < (ssize_t) image->columns; x++)
{
if (image->matte != MagickFalse)
- SetOpacityPixelComponent(q,(QuantumRange-
- ScaleCharToQuantum(*p++)));
+ SetAlphaPixelComponent(q,ScaleCharToQuantum(*p++));
if (sun_info.type == RT_STANDARD)
{
SetBluePixelComponent(q,ScaleCharToQuantum(*p++));
diff --git a/coders/tiff.c b/coders/tiff.c
index 02916f8..f2e538c 100644
--- a/coders/tiff.c
+++ b/coders/tiff.c
@@ -1503,8 +1503,8 @@
TIFFGetG(*p)));
SetBluePixelComponent(q,ScaleCharToQuantum((unsigned char)
TIFFGetB(*p)));
- SetOpacityPixelComponent(q,QuantumRange-ScaleCharToQuantum(
- (unsigned char) TIFFGetA(*p)));
+ SetAlphaPixelComponent(q,ScaleCharToQuantum((unsigned char)
+ TIFFGetA(*p)));
q++;
p++;
}
@@ -1590,8 +1590,8 @@
SetGreenPixelComponent(q,ScaleCharToQuantum((unsigned char)
TIFFGetB(*p)));
if (image->matte != MagickFalse)
- SetOpacityPixelComponent(q,QuantumRange-ScaleCharToQuantum(
- (unsigned char) TIFFGetA(*p)));
+ SetAlphaPixelComponent(q,ScaleCharToQuantum((unsigned char)
+ TIFFGetA(*p)));
p--;
q--;
}
diff --git a/coders/txt.c b/coders/txt.c
index e14c09c..6126333 100644
--- a/coders/txt.c
+++ b/coders/txt.c
@@ -486,8 +486,7 @@
range));
}
if (image->matte != MagickFalse)
- SetOpacityPixelComponent(q,QuantumRange-ScaleAnyToQuantum(
- pixel.opacity,range));
+ SetAlphaPixelComponent(q,ScaleAnyToQuantum(pixel.opacity,range));
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
diff --git a/coders/webp.c b/coders/webp.c
index 7795140..8bb52ba 100644
--- a/coders/webp.c
+++ b/coders/webp.c
@@ -173,7 +173,7 @@
SetRedPixelComponent(q,ScaleCharToQuantum(*p++));
SetGreenPixelComponent(q,ScaleCharToQuantum(*p++));
SetBluePixelComponent(q,ScaleCharToQuantum(*p++));
- SetOpacityPixelComponent(q,(QuantumRange-ScaleCharToQuantum(*p++)));
+ SetAlphaPixelComponent(q,ScaleCharToQuantum(*p++));
if (q->opacity != OpaqueOpacity)
image->matte=MagickTrue;
q++;