]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Thu, 27 Nov 2014 18:36:37 +0000 (18:36 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Thu, 27 Nov 2014 18:36:37 +0000 (18:36 +0000)
MagickCore/pixel-accessor.h

index b4b57bf7681378730cf520aa3e801cd0cea7d5f3..6f35e6b774957dc76e4e6e086c648da601cd899f 100644 (file)
@@ -322,7 +322,7 @@ static inline size_t GetPixelMetacontentExtent(const Image *restrict image)
 static inline Quantum GetPixelOpacity(const Image *restrict image,
   const Quantum *restrict pixel)
 {
-  if (image->channel_map[AlphaPixelChannel].traits == UndefinedPixelTrait)
+  if (image->channel_map[AlphaPixelChannel].traits != BlendPixelTrait)
     return(QuantumRange-OpaqueAlpha);
   return(QuantumRange-pixel[image->channel_map[AlphaPixelChannel].offset]);
 }
@@ -355,7 +355,7 @@ static inline void GetPixelInfoPixel(const Image *restrict image,
       pixel[image->channel_map[BlackPixelChannel].offset];
   pixel_info->alpha=(MagickRealType) OpaqueAlpha;
   pixel_info->alpha_trait=UndefinedPixelTrait;
-  if (image->channel_map[AlphaPixelChannel].traits != UndefinedPixelTrait)
+  if (image->channel_map[AlphaPixelChannel].traits == BlendPixelTrait)
     {
       pixel_info->alpha=(MagickRealType)
         pixel[image->channel_map[AlphaPixelChannel].offset];
@@ -539,7 +539,7 @@ static inline void SetPixela(const Image *restrict image,
 static inline void SetPixelAlpha(const Image *restrict image,
   const Quantum alpha,Quantum *restrict pixel)
 {
-  if (image->channel_map[AlphaPixelChannel].traits != UndefinedPixelTrait)
+  if (image->channel_map[AlphaPixelChannel].traits == BlendPixelTrait)
     pixel[image->channel_map[AlphaPixelChannel].offset]=alpha;
 }
 
@@ -572,7 +572,7 @@ static inline void SetPixelBackgoundColor(const Image *restrict image,
   if (image->channel_map[BlackPixelChannel].traits != UndefinedPixelTrait)
     pixel[image->channel_map[BlackPixelChannel].offset]=
       ClampToQuantum(image->background_color.black);
-  if (image->channel_map[AlphaPixelChannel].traits != UndefinedPixelTrait)
+  if (image->channel_map[AlphaPixelChannel].traits == BlendPixelTrait)
     pixel[image->channel_map[AlphaPixelChannel].offset]=
       image->background_color.alpha_trait == UndefinedPixelTrait ? OpaqueAlpha :
       ClampToQuantum(image->background_color.alpha);
@@ -708,7 +708,7 @@ static inline void SetPixelInfoPixel(const Image *restrict image,
   if (image->channel_map[BlackPixelChannel].traits != UndefinedPixelTrait)
     pixel[image->channel_map[BlackPixelChannel].offset]=
       ClampToQuantum(pixel_info->black);
-  if (image->channel_map[AlphaPixelChannel].traits != UndefinedPixelTrait)
+  if (image->channel_map[AlphaPixelChannel].traits == BlendPixelTrait)
     pixel[image->channel_map[AlphaPixelChannel].offset]=
       pixel_info->alpha_trait == UndefinedPixelTrait ? OpaqueAlpha :
       ClampToQuantum(pixel_info->alpha);
@@ -754,7 +754,7 @@ static inline void SetPixelMetacontentExtent(Image *image,const size_t extent)
 static inline void SetPixelOpacity(const Image *restrict image,
   const Quantum alpha,Quantum *restrict pixel)
 {
-  if (image->channel_map[AlphaPixelChannel].traits != UndefinedPixelTrait)
+  if (image->channel_map[AlphaPixelChannel].traits == BlendPixelTrait)
     pixel[image->channel_map[AlphaPixelChannel].offset]=QuantumRange-alpha;
 }