AlphaChannel = 0x0008,
OpacityChannel = 0x0008,
BlackChannel = 0x0010,
- IndexChannel = 0x0010,
+ IndexChannel = 0x0020,
CompositeChannels = 0x002F,
AllChannels = ~0L,
/*
RGBChannels = 0x0080, /* set alpha from grayscale mask in RGB */
GrayChannels = 0x0080,
SyncChannels = 0x0100, /* channels should be modified equally */
- DefaultChannels = ((AllChannels | SyncChannels) &~ (AlphaChannel || IndexChannel))
+ DefaultChannels = ((AllChannels | SyncChannels) &~ AlphaChannel)
} ChannelType;
typedef enum
image->number_channels+=image->number_meta_channels;
for ( ; i < (ssize_t) image->number_channels; i++)
SetPixelChannelMapTraits(image,(PixelChannel) i,CopyPixelTrait);
- SetPixelChannelMap(image,image->channel_mask);
}
\f
/*
*/
MagickExport void SetPixelChannelMap(Image *image,const ChannelType mask)
{
-#define GetChannelBit(alpha,i) (((size_t) (alpha) >> (size_t) (i)) & 0x01)
+#define GetChannelBit(mask,bit) (((size_t) (mask) >> (size_t) (bit)) & 0x01)
register ssize_t
i;
image->sync=mask == DefaultChannels ? MagickTrue : MagickFalse;
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
- SetPixelChannelMapTraits(image,(PixelChannel) i,GetChannelBit(mask,i) ?
+ SetPixelChannelMapTraits(image,(PixelChannel) i,GetChannelBit(mask,i) != 0 ?
UpdatePixelTrait : CopyPixelTrait);
for ( ; i < MaxPixelChannels; i++)
SetPixelChannelMapTraits(image,(PixelChannel) i,UndefinedPixelTrait);
+ SetPixelChannelMapTraits(image,IndexPixelChannel,CopyPixelTrait);
}
\f
/*