]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Sun, 9 Nov 2014 17:00:16 +0000 (17:00 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Sun, 9 Nov 2014 17:00:16 +0000 (17:00 +0000)
80 files changed:
MagickCore/accelerate.c
MagickCore/annotate.c
MagickCore/attribute.c
MagickCore/cache.c
MagickCore/channel.c
MagickCore/color.c
MagickCore/colorspace.c
MagickCore/composite.c
MagickCore/decorate.c
MagickCore/display.c
MagickCore/distort.c
MagickCore/draw.c
MagickCore/enhance.c
MagickCore/feature.c
MagickCore/fourier.c
MagickCore/fx.c
MagickCore/histogram.c
MagickCore/identify.c
MagickCore/image.c
MagickCore/layer.c
MagickCore/paint.c
MagickCore/pixel-accessor.h
MagickCore/pixel.c
MagickCore/profile.c
MagickCore/property.c
MagickCore/quantize.c
MagickCore/quantum.c
MagickCore/resample.c
MagickCore/resize.c
MagickCore/shear.c
MagickCore/transform.c
MagickCore/xwindow.c
MagickWand/compare.c
MagickWand/magick-image.c
MagickWand/mogrify.c
MagickWand/operation.c
MagickWand/pixel-wand.c
PerlMagick/Magick.xs
PerlMagick/quantum/quantum.xs.in
coders/aai.c
coders/bgr.c
coders/bmp.c
coders/cmyk.c
coders/dds.c
coders/debug.c
coders/dib.c
coders/dpx.c
coders/exr.c
coders/fpx.c
coders/gradient.c
coders/icon.c
coders/jp2.c
coders/json.c
coders/matte.c
coders/miff.c
coders/pcx.c
coders/pdf.c
coders/pict.c
coders/png.c
coders/pnm.c
coders/ps.c
coders/ps2.c
coders/ps3.c
coders/psd.c
coders/rgb.c
coders/rle.c
coders/sgi.c
coders/sixel.c
coders/sun.c
coders/tga.c
coders/thumbnail.c
coders/tiff.c
coders/tile.c
coders/txt.c
coders/uil.c
coders/viff.c
coders/vips.c
coders/webp.c
coders/xpm.c
coders/ycbcr.c

index 83959405b30f2a64694f64d71fa0d38b0e7bb829..f952207d99d7db0b08dd612ca41e0482b776d34a 100644 (file)
@@ -455,7 +455,7 @@ static Image *ComputeConvolveImage(const Image* image,
     filterHeight = (unsigned int) kernel->height;
     clStatus|=clEnv->library->clSetKernelArg(clkernel,i++,sizeof(unsigned int),(void *)&filterWidth);
     clStatus|=clEnv->library->clSetKernelArg(clkernel,i++,sizeof(unsigned int),(void *)&filterHeight);
-    matte = (image->alpha_trait==BlendPixelTrait)?1:0;
+    matte = (image->alpha_trait == UndefinedPixelTrait)?1:0;
     clStatus|=clEnv->library->clSetKernelArg(clkernel,i++,sizeof(unsigned int),(void *)&matte);
     clStatus|=clEnv->library->clSetKernelArg(clkernel,i++,sizeof(ChannelType),(void *)&channel);
     clStatus|=clEnv->library->clSetKernelArg(clkernel,i++, (localGroupSize[0] + kernel->width-1)*(localGroupSize[1] + kernel->height-1)*sizeof(CLPixelPacket),NULL);
@@ -501,7 +501,7 @@ static Image *ComputeConvolveImage(const Image* image,
     filterHeight = (unsigned int) kernel->height;
     clStatus|=clEnv->library->clSetKernelArg(clkernel,i++,sizeof(unsigned int),(void *)&filterWidth);
     clStatus|=clEnv->library->clSetKernelArg(clkernel,i++,sizeof(unsigned int),(void *)&filterHeight);
-    matte = (image->alpha_trait==BlendPixelTrait)?1:0;
+    matte = (image->alpha_trait == UndefinedPixelTrait)?1:0;
     clStatus|=clEnv->library->clSetKernelArg(clkernel,i++,sizeof(unsigned int),(void *)&matte);
     clStatus|=clEnv->library->clSetKernelArg(clkernel,i++,sizeof(ChannelType),(void *)&channel);
     if (clStatus != CL_SUCCESS)
@@ -1844,7 +1844,7 @@ static Image* ComputeRotationalBlurImage(const Image *image,
   clStatus|=clEnv->library->clSetKernelArg(rotationalBlurKernel,i++,sizeof(cl_float4), &biasPixel);
   clStatus|=clEnv->library->clSetKernelArg(rotationalBlurKernel,i++,sizeof(ChannelType), &channel);
 
-  matte = (image->alpha_trait==BlendPixelTrait)?1:0;
+  matte = (image->alpha_trait == UndefinedPixelTrait)?1:0;
   clStatus|=clEnv->library->clSetKernelArg(rotationalBlurKernel,i++,sizeof(unsigned int), &matte);
 
   clStatus=clEnv->library->clSetKernelArg(rotationalBlurKernel,i++,sizeof(cl_float2), &blurCenter);
@@ -3660,14 +3660,14 @@ static Image *ComputeResizeImage(const Image* image,
       goto cleanup;
     }
     
-    status = resizeHorizontalFilter(imageBuffer, (unsigned int) image->columns, (unsigned int) image->rows, (image->alpha_trait==BlendPixelTrait)?1:0
+    status = resizeHorizontalFilter(imageBuffer, (unsigned int) image->columns, (unsigned int) image->rows, (image->alpha_trait == UndefinedPixelTrait)?1:0
           , tempImageBuffer, (unsigned int) resizedColumns, (unsigned int) image->rows
           , resizeFilter, cubicCoefficientsBuffer
           , xFactor, clEnv, queue, exception);
     if (status != MagickTrue)
       goto cleanup;
     
-    status = resizeVerticalFilter(tempImageBuffer, (unsigned int) resizedColumns, (unsigned int) image->rows, (image->alpha_trait==BlendPixelTrait)?1:0
+    status = resizeVerticalFilter(tempImageBuffer, (unsigned int) resizedColumns, (unsigned int) image->rows, (image->alpha_trait == UndefinedPixelTrait)?1:0
        , filteredImageBuffer, (unsigned int) resizedColumns, (unsigned int) resizedRows
        , resizeFilter, cubicCoefficientsBuffer
        , yFactor, clEnv, queue, exception);
@@ -3684,14 +3684,14 @@ static Image *ComputeResizeImage(const Image* image,
       goto cleanup;
     }
 
-    status = resizeVerticalFilter(imageBuffer, (unsigned int) image->columns, (unsigned int) image->rows, (image->alpha_trait==BlendPixelTrait)?1:0
+    status = resizeVerticalFilter(imageBuffer, (unsigned int) image->columns, (unsigned int) image->rows, (image->alpha_trait == UndefinedPixelTrait)?1:0
        , tempImageBuffer, (unsigned int) image->columns, (unsigned int) resizedRows
        , resizeFilter, cubicCoefficientsBuffer
        , yFactor, clEnv, queue, exception);
     if (status != MagickTrue)
       goto cleanup;
 
-    status = resizeHorizontalFilter(tempImageBuffer, (unsigned int) image->columns, (unsigned int) resizedRows, (image->alpha_trait==BlendPixelTrait)?1:0
+    status = resizeHorizontalFilter(tempImageBuffer, (unsigned int) image->columns, (unsigned int) resizedRows, (image->alpha_trait == UndefinedPixelTrait)?1:0
        , filteredImageBuffer, (unsigned int) resizedColumns, (unsigned int) resizedRows
        , resizeFilter, cubicCoefficientsBuffer
        , xFactor, clEnv, queue, exception);
@@ -5769,7 +5769,7 @@ static Image *ComputeDespeckleImage(const Image *image,
   clStatus |=clEnv->library->clSetKernelArg(hullPass1,2,sizeof(unsigned int),(void *)&imageWidth);
   imageHeight = (unsigned int) image->rows;
   clStatus |=clEnv->library->clSetKernelArg(hullPass1,3,sizeof(unsigned int),(void *)&imageHeight);
-  matte = (image->alpha_trait==BlendPixelTrait)?0:1;
+  matte = (image->alpha_trait == UndefinedPixelTrait)?0:1;
   clStatus |=clEnv->library->clSetKernelArg(hullPass1,6,sizeof(int),(void *)&matte);
   if (clStatus != CL_SUCCESS)
   {
@@ -5783,7 +5783,7 @@ static Image *ComputeDespeckleImage(const Image *image,
   clStatus |=clEnv->library->clSetKernelArg(hullPass2,2,sizeof(unsigned int),(void *)&imageWidth);
   imageHeight = (unsigned int) image->rows;
   clStatus |=clEnv->library->clSetKernelArg(hullPass2,3,sizeof(unsigned int),(void *)&imageHeight);
-  matte = (image->alpha_trait==BlendPixelTrait)?0:1;
+  matte = (image->alpha_trait == UndefinedPixelTrait)?0:1;
   clStatus |=clEnv->library->clSetKernelArg(hullPass2,6,sizeof(int),(void *)&matte);
   if (clStatus != CL_SUCCESS)
   {
@@ -6723,7 +6723,7 @@ static Image* ComputeMotionBlurImage(const Image *image,
   clStatus|=clEnv->library->clSetKernelArg(motionBlurKernel,i++,sizeof(cl_float4), &biasPixel);
 
   clStatus|=clEnv->library->clSetKernelArg(motionBlurKernel,i++,sizeof(ChannelType), &channel);
-  matte = (image->alpha_trait==BlendPixelTrait)?1:0;
+  matte = (image->alpha_trait == UndefinedPixelTrait)?1:0;
   clStatus|=clEnv->library->clSetKernelArg(motionBlurKernel,i++,sizeof(unsigned int), &matte);
   if (clStatus != CL_SUCCESS)
   {
@@ -6991,7 +6991,7 @@ static MagickBooleanType ComputeCompositeImage(Image *image,
   status = LaunchCompositeKernel(clEnv,queue,imageBuffer,
            (unsigned int) image->columns,
            (unsigned int) image->rows,
-           (unsigned int) (image->alpha_trait==BlendPixelTrait) ? 1 : 0,
+           (unsigned int) (image->alpha_trait == UndefinedPixelTrait) ? 1 : 0,
            channel, compose, compositeImageBuffer,
            (unsigned int) compositeImage->columns,
            (unsigned int) compositeImage->rows,
index c58101d26b9233ea37e33eef2fb4c4e8de1987e3..1316c8cd1e8b8a3b7345f6d709e0f85cb4e88fb8 100644 (file)
@@ -1292,7 +1292,7 @@ static MagickBooleanType RenderFreetype(Image *image,const DrawInfo *draw_info,
     {
       if (image->storage_class != DirectClass)
         (void) SetImageStorageClass(image,DirectClass,exception);
-      if (image->alpha_trait != BlendPixelTrait)
+      if (image->alpha_trait == UndefinedPixelTrait)
         (void) SetImageAlphaChannel(image,OpaqueAlphaChannel,exception);
     }
   direction=1.0;
@@ -1819,9 +1819,9 @@ static MagickBooleanType RenderPostscript(Image *image,
       /*
         Render fill color.
       */
-      if (image->alpha_trait != BlendPixelTrait)
+      if (image->alpha_trait == UndefinedPixelTrait)
         (void) SetImageAlphaChannel(image,OpaqueAlphaChannel,exception);
-      if (annotate_image->alpha_trait != BlendPixelTrait)
+      if (annotate_image->alpha_trait == UndefinedPixelTrait)
         (void) SetImageAlphaChannel(annotate_image,OpaqueAlphaChannel,
           exception);
       fill_color=draw_info->fill;
index f443503b131a88698e4459edfe4ffa13165495a9..d8e5367038664b8e095cd136d5524c7a393b08e7 100644 (file)
@@ -305,7 +305,7 @@ MagickExport size_t GetImageDepth(const Image *image,ExceptionInfo *exception)
   status=MagickTrue;
   for (i=0; i < (ssize_t) number_threads; i++)
     current_depth[i]=1;
-  if ((image->storage_class == PseudoClass) && (image->alpha_trait != BlendPixelTrait))
+  if ((image->storage_class == PseudoClass) && (image->alpha_trait == UndefinedPixelTrait))
     {
 #if defined(MAGICKCORE_OPENMP_SUPPORT)
       #pragma omp parallel for schedule(static,4) shared(status) \
@@ -604,7 +604,7 @@ MagickExport ImageType GetImageType(const Image *image,ExceptionInfo *exception)
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
   if (image->colorspace == CMYKColorspace)
     {
-      if (image->alpha_trait != BlendPixelTrait)
+      if (image->alpha_trait == UndefinedPixelTrait)
         return(ColorSeparationType);
       return(ColorSeparationMatteType);
     }
@@ -612,17 +612,17 @@ MagickExport ImageType GetImageType(const Image *image,ExceptionInfo *exception)
     return(BilevelType);
   if (IsImageGray(image,exception) != MagickFalse)
     {
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         return(GrayscaleMatteType);
       return(GrayscaleType);
     }
   if (IsPaletteImage(image,exception) != MagickFalse)
     {
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         return(PaletteMatteType);
       return(PaletteType);
     }
-  if (image->alpha_trait == BlendPixelTrait)
+  if (image->alpha_trait != UndefinedPixelTrait)
     return(TrueColorMatteType);
   return(TrueColorType);
 }
@@ -710,7 +710,7 @@ MagickExport MagickBooleanType IsImageGray(const Image *image,
   if (SyncImagePixelCache((Image *) image,exception) == MagickFalse)
     return(MagickFalse);
   ((Image *) image)->type=type;
-  if ((type == GrayscaleType) && (image->alpha_trait == BlendPixelTrait))
+  if ((type == GrayscaleType) && (image->alpha_trait != UndefinedPixelTrait))
     ((Image *) image)->type=GrayscaleMatteType;
   return(MagickTrue);
 }
@@ -848,7 +848,7 @@ MagickExport MagickBooleanType IsImageOpaque(const Image *image,
   assert(image->signature == MagickSignature);
   if (image->debug != MagickFalse)
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
-  if (image->alpha_trait != BlendPixelTrait)
+  if (image->alpha_trait == UndefinedPixelTrait)
     return(MagickTrue);
   image_view=AcquireVirtualCacheView(image,exception);
   for (y=0; y < (ssize_t) image->rows; y++)
@@ -1193,7 +1193,7 @@ MagickExport MagickBooleanType SetImageType(Image *image,const ImageType type,
     {
       if (IsImageGray(image,exception) == MagickFalse)
         status=TransformImageColorspace(image,GRAYColorspace,exception);
-      if (image->alpha_trait != BlendPixelTrait)
+      if (image->alpha_trait == UndefinedPixelTrait)
         (void) SetImageAlphaChannel(image,OpaqueAlphaChannel,exception);
       break;
     }
@@ -1218,7 +1218,7 @@ MagickExport MagickBooleanType SetImageType(Image *image,const ImageType type,
 
       if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
         status=TransformImageColorspace(image,sRGBColorspace,exception);
-      if (image->alpha_trait != BlendPixelTrait)
+      if (image->alpha_trait == UndefinedPixelTrait)
         (void) SetImageAlphaChannel(image,OpaqueAlphaChannel,exception);
       channel_mask=SetImageChannelMask(image,AlphaChannel);
       (void) BilevelImage(image,(double) QuantumRange/2.0,exception);
@@ -1232,7 +1232,7 @@ MagickExport MagickBooleanType SetImageType(Image *image,const ImageType type,
     {
       if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
         status=TransformImageColorspace(image,sRGBColorspace,exception);
-      if (image->alpha_trait != BlendPixelTrait)
+      if (image->alpha_trait == UndefinedPixelTrait)
         (void) SetImageAlphaChannel(image,OpaqueAlphaChannel,exception);
       quantize_info=AcquireQuantizeInfo(image_info);
       quantize_info->colorspace=TransparentColorspace;
@@ -1255,7 +1255,7 @@ MagickExport MagickBooleanType SetImageType(Image *image,const ImageType type,
         status=TransformImageColorspace(image,sRGBColorspace,exception);
       if (image->storage_class != DirectClass)
         status=SetImageStorageClass(image,DirectClass,exception);
-      if (image->alpha_trait != BlendPixelTrait)
+      if (image->alpha_trait == UndefinedPixelTrait)
         (void) SetImageAlphaChannel(image,OpaqueAlphaChannel,exception);
       break;
     }
@@ -1282,7 +1282,7 @@ MagickExport MagickBooleanType SetImageType(Image *image,const ImageType type,
         }
       if (image->storage_class != DirectClass)
         status=SetImageStorageClass(image,DirectClass,exception);
-      if (image->alpha_trait != BlendPixelTrait)
+      if (image->alpha_trait == UndefinedPixelTrait)
         status=SetImageAlphaChannel(image,OpaqueAlphaChannel,exception);
       break;
     }
index 317bc60ea6cb5c9dcfc8ef4e29dab62b854facc1..ce1cfbf7b6fd7fe8d8729e43b38cb2ced0038994 100644 (file)
@@ -4771,8 +4771,8 @@ MagickPrivate VirtualPixelMethod SetPixelCacheVirtualMethod(Image *image,
     {
       case BackgroundVirtualPixelMethod:
       {
-        if ((image->background_color.alpha_trait == BlendPixelTrait) &&
-            (image->alpha_trait != BlendPixelTrait))
+        if ((image->background_color.alpha_trait != UndefinedPixelTrait) &&
+            (image->alpha_trait == UndefinedPixelTrait))
           (void) SetCacheAlphaChannel(image,OpaqueAlpha,exception);
         if ((IsPixelInfoGray(&image->background_color) == MagickFalse) &&
             (IsGrayColorspace(image->colorspace) != MagickFalse))
@@ -4781,7 +4781,7 @@ MagickPrivate VirtualPixelMethod SetPixelCacheVirtualMethod(Image *image,
       }
       case TransparentVirtualPixelMethod:
       {
-        if (image->alpha_trait != BlendPixelTrait)
+        if (image->alpha_trait == UndefinedPixelTrait)
           (void) SetCacheAlphaChannel(image,OpaqueAlpha,exception);
         break;
       }
index 659b6c1bab4d3b7ec96593299a4ecfb06c0bee34..c312a1666e4151dc729d5cb433acb8bbbfeefec3 100644 (file)
@@ -626,7 +626,7 @@ MagickExport MagickBooleanType GetImageAlphaChannel(const Image *image)
   if (image->debug != MagickFalse)
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
   assert(image->signature == MagickSignature);
-  return(image->alpha_trait == BlendPixelTrait ? MagickTrue : MagickFalse);
+  return(image->alpha_trait != UndefinedPixelTrait ? MagickTrue : MagickFalse);
 }
 \f
 /*
@@ -1017,7 +1017,7 @@ MagickExport MagickBooleanType SetImageAlphaChannel(Image *image,
       /*
         Set transparent pixels to background color.
       */
-      if (image->alpha_trait != BlendPixelTrait)
+      if (image->alpha_trait == UndefinedPixelTrait)
         break;
       status=SetImageStorageClass(image,DirectClass,exception);
       if (status == MagickFalse)
@@ -1164,7 +1164,7 @@ MagickExport MagickBooleanType SetImageAlphaChannel(Image *image,
       /*
         Remove transparency.
       */
-      if (image->alpha_trait != BlendPixelTrait)
+      if (image->alpha_trait == UndefinedPixelTrait)
         break;
       status=SetImageStorageClass(image,DirectClass,exception);
       if (status == MagickFalse)
@@ -1207,7 +1207,7 @@ MagickExport MagickBooleanType SetImageAlphaChannel(Image *image,
     }
     case SetAlphaChannel:
     {
-      if (image->alpha_trait != BlendPixelTrait)
+      if (image->alpha_trait == UndefinedPixelTrait)
         status=SetImageAlpha(image,OpaqueAlpha,exception);
       break;
     }
index 4412795ab4eb42c69e1f61c7af5c67f31c43571c..3146330032d9e8331e09ab2f2d5ad089edac249f 100644 (file)
@@ -1522,7 +1522,7 @@ MagickExport void GetColorTuple(const PixelInfo *pixel,
       ConcatentateHexColorComponent(pixel,BluePixelChannel,tuple);
       if (pixel->colorspace == CMYKColorspace)
         ConcatentateHexColorComponent(pixel,BlackPixelChannel,tuple);
-      if ((pixel->alpha_trait == BlendPixelTrait) &&
+      if ((pixel->alpha_trait != UndefinedPixelTrait) &&
           (pixel->alpha != OpaqueAlpha))
         ConcatentateHexColorComponent(pixel,AlphaPixelChannel,tuple);
       return;
@@ -1551,7 +1551,7 @@ MagickExport void GetColorTuple(const PixelInfo *pixel,
       if (color.colorspace-CMYKColorspace)
         status&=IsMagickTrue(fabs(color.black-SVGCompliant(color.black))
              < MagickEpsilon);
-      if (color.alpha_trait == BlendPixelTrait)
+      if (color.alpha_trait != UndefinedPixelTrait)
         status&=IsMagickTrue(fabs(color.alpha-SVGCompliant(color.alpha))
              < MagickEpsilon);
       if (IfMagickTrue(status))
@@ -1559,7 +1559,7 @@ MagickExport void GetColorTuple(const PixelInfo *pixel,
     }
   (void) ConcatenateMagickString(tuple,CommandOptionToMnemonic(
     MagickColorspaceOptions,(ssize_t) color.colorspace),MaxTextExtent);
-  if (color.alpha_trait == BlendPixelTrait)
+  if (color.alpha_trait != UndefinedPixelTrait)
     (void) ConcatenateMagickString(tuple,"a",MaxTextExtent);
   (void) ConcatenateMagickString(tuple,"(",MaxTextExtent);
   if (color.colorspace == GRAYColorspace)
@@ -1577,7 +1577,7 @@ MagickExport void GetColorTuple(const PixelInfo *pixel,
       (void) ConcatenateMagickString(tuple,",",MaxTextExtent);
       ConcatenateColorComponent(&color,BlackPixelChannel,SVGCompliance,tuple);
     }
-  if (color.alpha_trait == BlendPixelTrait)
+  if (color.alpha_trait != UndefinedPixelTrait)
     {
       (void) ConcatenateMagickString(tuple,",",MaxTextExtent);
       ConcatenateColorComponent(&color,AlphaPixelChannel,SVGCompliance,tuple);
@@ -1671,7 +1671,7 @@ MagickPrivate MagickBooleanType IsEquivalentAlpha(const Image *image,
   register double
     distance;
 
-  if (image->alpha_trait != BlendPixelTrait)
+  if (image->alpha_trait == UndefinedPixelTrait)
     return(MagickTrue);
   if (p->alpha == q->alpha)
     return(MagickTrue);
@@ -2412,12 +2412,12 @@ MagickExport MagickBooleanType QueryColorCompliance(const char *name,
                 color->black=(double) ClampToQuantum(scale*
                   geometry_info.psi);
               else
-                if (color->alpha_trait == BlendPixelTrait)
+                if (color->alpha_trait != UndefinedPixelTrait)
                   color->alpha=(double) ClampToQuantum(QuantumRange*
                     geometry_info.psi);
             }
           if (((flags & ChiValue) != 0) &&
-              (color->alpha_trait == BlendPixelTrait))
+              (color->alpha_trait != UndefinedPixelTrait))
             color->alpha=(double) ClampToQuantum(QuantumRange*
               geometry_info.chi);
           if (color->colorspace == LabColorspace)
@@ -2435,7 +2435,7 @@ MagickExport MagickBooleanType QueryColorCompliance(const char *name,
               color->green=color->red;
               color->blue=color->red;
               if (((flags & SigmaValue) != 0) &&
-                  (color->alpha_trait == BlendPixelTrait))
+                  (color->alpha_trait != UndefinedPixelTrait))
                 color->alpha=(double) ClampToQuantum(QuantumRange*
                   geometry_info.sigma);
             }
@@ -2576,7 +2576,7 @@ MagickExport MagickBooleanType QueryColorname(
   GetColorTuple(&pixel,IsMagickTrue(compliance != SVGCompliance),name);
   if (IfMagickFalse(IssRGBColorspace(pixel.colorspace)))
     return(MagickFalse);
-  alpha=color->alpha_trait == BlendPixelTrait ? color->alpha : OpaqueAlpha;
+  alpha=color->alpha_trait != UndefinedPixelTrait ? color->alpha : OpaqueAlpha;
   (void) GetColorInfo("*",exception);
   ResetLinkedListIterator(color_cache);
   p=(const ColorInfo *) GetNextValueInLinkedList(color_cache);
index f7e9e9e67dbc23139b25767d0040bf2e7f29ba14..36dfb4d5e8969b5fe3118d7c0b5a1207806fe8c9 100644 (file)
@@ -317,7 +317,7 @@ static MagickBooleanType sRGBTransformImage(Image *image,
           status=MagickFalse;
       }
       image_view=DestroyCacheView(image_view);
-      image->type=image->alpha_trait != BlendPixelTrait ? ColorSeparationType :
+      image->type=image->alpha_trait == UndefinedPixelTrait ? ColorSeparationType :
         ColorSeparationMatteType;
       if (SetImageColorspace(image,colorspace,exception) == MagickFalse)
         return(MagickFalse);
index e93f53d00b372098e1d925a6b4bc8cbbc7b9a085..c12f4fd1dd7950b80a0547efcc7dd6511d254802 100644 (file)
@@ -568,8 +568,8 @@ MagickExport MagickBooleanType CompositeImage(Image *image,
   if (IsGrayColorspace(image->colorspace) != MagickFalse)
     (void) SetImageColorspace(image,sRGBColorspace,exception);
   (void) SetImageColorspace(composite_image,image->colorspace,exception);
-  if ((image->alpha_trait == BlendPixelTrait) &&
-      (composite_image->alpha_trait != BlendPixelTrait))
+  if ((image->alpha_trait != UndefinedPixelTrait) &&
+      (composite_image->alpha_trait == UndefinedPixelTrait))
     (void) SetImageAlphaChannel(composite_image,SetAlphaChannel,exception);
   if ((compose == OverCompositeOp) || (compose == SrcOverCompositeOp))
     {
@@ -682,7 +682,7 @@ MagickExport MagickBooleanType CompositeImage(Image *image,
         Modify destination outside the overlaid region and require an alpha
         channel to exist, to add transparency.
       */
-      if (image->alpha_trait != BlendPixelTrait)
+      if (image->alpha_trait == UndefinedPixelTrait)
         (void) SetImageAlphaChannel(image,OpaqueAlphaChannel,exception);
       SetPixelAlphaTraits(image,CopyPixelTrait);
       break;
@@ -1559,7 +1559,7 @@ MagickExport MagickBooleanType CompositeImage(Image *image,
               case CopyAlphaCompositeOp:
               {
                 pixel=QuantumRange*Sa;
-                if (composite_image->alpha_trait != BlendPixelTrait)
+                if (composite_image->alpha_trait == UndefinedPixelTrait)
                   pixel=GetPixelIntensity(composite_image,p);
                 break;
               }
@@ -2353,8 +2353,8 @@ MagickExport MagickBooleanType TextureImage(Image *image,const Image *texture,
   status=MagickTrue;
   if ((image->compose != CopyCompositeOp) &&
       ((image->compose != OverCompositeOp) ||
-       (image->alpha_trait == BlendPixelTrait) ||
-       (texture_image->alpha_trait == BlendPixelTrait)))
+       (image->alpha_trait != UndefinedPixelTrait) ||
+       (texture_image->alpha_trait != UndefinedPixelTrait)))
     {
       /*
         Tile texture onto the image background.
index fc7faa2c836ce4af2dfaeb8a04b10e8e120c3459..80d2c05489d0f185813d7f5b995dd6894d5e41ba 100644 (file)
@@ -233,8 +233,8 @@ MagickExport Image *FrameImage(const Image *image,const FrameInfo *frame_info,
   if ((IsPixelInfoGray(&frame_image->border_color) == MagickFalse) &&
       (IsGrayColorspace(frame_image->colorspace) != MagickFalse))
     (void) SetImageColorspace(frame_image,sRGBColorspace,exception);
-  if ((frame_image->matte_color.alpha_trait == BlendPixelTrait) &&
-      (frame_image->alpha_trait != BlendPixelTrait))
+  if ((frame_image->matte_color.alpha_trait != UndefinedPixelTrait) &&
+      (frame_image->alpha_trait == UndefinedPixelTrait))
     (void) SetImageAlpha(frame_image,OpaqueAlpha,exception);
   frame_image->page=image->page;
   if ((image->page.width != 0) && (image->page.height != 0))
@@ -429,7 +429,7 @@ MagickExport Image *FrameImage(const Image *image,const FrameInfo *frame_info,
       Set frame interior to interior color.
     */
     if ((compose != CopyCompositeOp) && ((compose != OverCompositeOp) ||
-        (image->alpha_trait == BlendPixelTrait)))
+        (image->alpha_trait != UndefinedPixelTrait)))
       for (x=0; x < (ssize_t) image->columns; x++)
       {
         SetPixelInfoPixel(frame_image,&interior,q);
@@ -606,7 +606,7 @@ MagickExport Image *FrameImage(const Image *image,const FrameInfo *frame_info,
   frame_view=DestroyCacheView(frame_view);
   image_view=DestroyCacheView(image_view);
   if ((compose != CopyCompositeOp) && ((compose != OverCompositeOp) ||
-      (image->alpha_trait == BlendPixelTrait)))
+      (image->alpha_trait != UndefinedPixelTrait)))
     {
       x=(ssize_t) (frame_info->outer_bevel+(frame_info->x-bevel_width)+
         frame_info->inner_bevel);
index 5a6f61379572feaa7be525b5c738d612f4372076..a9de3d3dac7182b52531d4308d9063f0f37c9b1b 100644 (file)
@@ -8008,7 +8008,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       */
       XSetCursorState(display,windows,MagickTrue);
       XCheckRefreshWindows(display,windows);
-      (void) SetImageType(*image,(*image)->alpha_trait != BlendPixelTrait ?
+      (void) SetImageType(*image,(*image)->alpha_trait == UndefinedPixelTrait ?
         GrayscaleType : GrayscaleMatteType,exception);
       XSetCursorState(display,windows,MagickFalse);
       if (IfMagickTrue(windows->image.orphan) )
@@ -9163,7 +9163,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       Image
         *matte_image;
 
-      if ((*image)->alpha_trait != BlendPixelTrait)
+      if ((*image)->alpha_trait == UndefinedPixelTrait)
         {
           XNoticeWidget(display,windows,
             "Image does not have any matte information",(*image)->filename);
@@ -10096,7 +10096,7 @@ static MagickBooleanType XMatteEditImage(Display *display,
           continue;
         if (IfMagickFalse(SetImageStorageClass(*image,DirectClass,exception)) )
           return(MagickFalse);
-        if ((*image)->alpha_trait != BlendPixelTrait)
+        if ((*image)->alpha_trait == UndefinedPixelTrait)
           (void) SetImageAlphaChannel(*image,OpaqueAlphaChannel,exception);
         image_view=AcquireAuthenticCacheView(*image,exception);
         switch (method)
index d20ec57d74b7f6b78827cbae0af738fdd396dfa5..08ece355ed4a16d7ad84d9bd2f61759012cf1e64 100644 (file)
@@ -1519,7 +1519,7 @@ MagickExport Image *DistortResizeImage(const Image *image,
     exception);
   tmp_image->image_info=image->image_info; /* preserve global options */
 
-  if (image->alpha_trait != BlendPixelTrait)
+  if (image->alpha_trait == UndefinedPixelTrait)
     {
       /*
         Image has not transparency channel, so we free to use it
@@ -2295,7 +2295,7 @@ MagickExport Image *DistortImage(const Image *image,DistortImageMethod method,
   if ((IsPixelInfoGray(&distort_image->background_color) == MagickFalse) &&
       (IsGrayColorspace(distort_image->colorspace) != MagickFalse))
     (void) SetImageColorspace(distort_image,sRGBColorspace,exception);
-  if (distort_image->background_color.alpha_trait == BlendPixelTrait)
+  if (distort_image->background_color.alpha_trait != UndefinedPixelTrait)
     distort_image->alpha_trait=BlendPixelTrait;
   distort_image->page.x=geometry.x;
   distort_image->page.y=geometry.y;
@@ -2928,7 +2928,7 @@ MagickExport Image *SparseColorImage(const Image *image,
       (image->colorspace == CMYKColorspace))
     number_colors++;
   if (((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0) &&
-      (image->alpha_trait == BlendPixelTrait))
+      (image->alpha_trait != UndefinedPixelTrait))
     number_colors++;
 
   /*
@@ -2980,7 +2980,7 @@ MagickExport Image *SparseColorImage(const Image *image,
           (void) FormatLocaleFile(stderr, "  -channel K -fx '%+lf*i %+lf*j %+lf' \\\n",
               coeff[x], coeff[x+1], coeff[x+2]),x+=3;
         if (((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0) &&
-            (image->alpha_trait == BlendPixelTrait))
+            (image->alpha_trait != UndefinedPixelTrait))
           (void) FormatLocaleFile(stderr, "  -channel A -fx '%+lf*i %+lf*j %+lf' \\\n",
               coeff[x], coeff[x+1], coeff[x+2]),x+=3;
         break;
@@ -3007,7 +3007,7 @@ MagickExport Image *SparseColorImage(const Image *image,
               coeff[ x ], coeff[x+1],
               coeff[x+2], coeff[x+3]),x+=4;
         if (((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0) &&
-            (image->alpha_trait == BlendPixelTrait))
+            (image->alpha_trait != UndefinedPixelTrait))
           (void) FormatLocaleFile(stderr, "   -channel A -fx '%+lf*i %+lf*j %+lf*i*j %+lf;\n",
               coeff[ x ], coeff[x+1],
               coeff[x+2], coeff[x+3]),x+=4;
@@ -3097,7 +3097,7 @@ MagickExport Image *SparseColorImage(const Image *image,
               pixel.black   = coeff[x]*i +coeff[x+1]*j
                               +coeff[x+2], x+=3;
             if (((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0) &&
-                (image->alpha_trait == BlendPixelTrait))
+                (image->alpha_trait != UndefinedPixelTrait))
               pixel.alpha = coeff[x]*i +coeff[x+1]*j
                               +coeff[x+2], x+=3;
             break;
@@ -3119,7 +3119,7 @@ MagickExport Image *SparseColorImage(const Image *image,
               pixel.black   = coeff[x]*i     + coeff[x+1]*j +
                               coeff[x+2]*i*j + coeff[x+3], x+=4;
             if (((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0) &&
-                (image->alpha_trait == BlendPixelTrait))
+                (image->alpha_trait != UndefinedPixelTrait))
               pixel.alpha = coeff[x]*i     + coeff[x+1]*j +
                               coeff[x+2]*i*j + coeff[x+3], x+=4;
             break;
@@ -3142,7 +3142,7 @@ MagickExport Image *SparseColorImage(const Image *image,
                 (image->colorspace == CMYKColorspace))
               pixel.black=0.0;
             if (((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0) &&
-                (image->alpha_trait == BlendPixelTrait))
+                (image->alpha_trait != UndefinedPixelTrait))
               pixel.alpha=0.0;
             denominator = 0.0;
             for(k=0; k<number_arguments; k+=2+number_colors) {
@@ -3162,7 +3162,7 @@ MagickExport Image *SparseColorImage(const Image *image,
                   (image->colorspace == CMYKColorspace))
                 pixel.black   += arguments[x++]*weight;
               if (((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0) &&
-                  (image->alpha_trait == BlendPixelTrait))
+                  (image->alpha_trait != UndefinedPixelTrait))
                 pixel.alpha += arguments[x++]*weight;
               denominator += weight;
             }
@@ -3176,7 +3176,7 @@ MagickExport Image *SparseColorImage(const Image *image,
                 (image->colorspace == CMYKColorspace))
               pixel.black/=denominator;
             if (((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0) &&
-                (image->alpha_trait == BlendPixelTrait))
+                (image->alpha_trait != UndefinedPixelTrait))
               pixel.alpha/=denominator;
             break;
           }
@@ -3208,7 +3208,7 @@ MagickExport Image *SparseColorImage(const Image *image,
                     (image->colorspace == CMYKColorspace))
                   pixel.black=arguments[x++];
                 if (((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0) &&
-                    (image->alpha_trait == BlendPixelTrait))
+                    (image->alpha_trait != UndefinedPixelTrait))
                   pixel.alpha=arguments[x++];
                 minimum = distance;
               }
@@ -3227,7 +3227,7 @@ MagickExport Image *SparseColorImage(const Image *image,
             (image->colorspace == CMYKColorspace))
           pixel.black*=QuantumRange;
         if (((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0) &&
-            (image->alpha_trait == BlendPixelTrait))
+            (image->alpha_trait != UndefinedPixelTrait))
           pixel.alpha*=QuantumRange;
         SetPixelInfoPixel(sparse_image,&pixel,q);
         q+=GetPixelChannels(sparse_image);
index 4f4dbf7e35b8a1a1b615ed760d55b261b2541287..6c2973e133a18a08975d019c683cb819ddc32e0f 100644 (file)
@@ -3936,7 +3936,7 @@ RestoreMSCWarning
   /*
     Draw polygon or line.
   */
-  if (image->alpha_trait != BlendPixelTrait)
+  if (image->alpha_trait == UndefinedPixelTrait)
     (void) SetImageAlphaChannel(image,OpaqueAlphaChannel,exception);
   start=(ssize_t) ceil(bounds.y1-0.5);
   stop=(ssize_t) floor(bounds.y2+0.5);
@@ -4316,7 +4316,7 @@ MagickExport MagickBooleanType DrawPrimitive(Image *image,
     }
     case MattePrimitive:
     {
-      if (image->alpha_trait != BlendPixelTrait)
+      if (image->alpha_trait == UndefinedPixelTrait)
         (void) SetImageAlphaChannel(image,OpaqueAlphaChannel,exception);
       switch (primitive_info->method)
       {
@@ -4512,7 +4512,7 @@ MagickExport MagickBooleanType DrawPrimitive(Image *image,
           (void) TransformImage(&composite_image,(char *) NULL,geometry,
             exception);
         }
-      if (composite_image->alpha_trait != BlendPixelTrait)
+      if (composite_image->alpha_trait == UndefinedPixelTrait)
         (void) SetImageAlphaChannel(composite_image,OpaqueAlphaChannel,
           exception);
       if (draw_info->alpha != OpaqueAlpha)
index bdbf2ad0acc6e0da6342153eb917c5d21a09ac27..9d5145368973563d3d7b04859724bd07f99de6db 100644 (file)
@@ -411,7 +411,7 @@ MagickExport MagickBooleanType ClutImage(Image *image,const Image *clut_image,
   }
   image_view=DestroyCacheView(image_view);
   clut_map=(PixelInfo *) RelinquishMagickMemory(clut_map);
-  if ((clut_image->alpha_trait == BlendPixelTrait) &&
+  if ((clut_image->alpha_trait != UndefinedPixelTrait) &&
       ((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0))
     (void) SetImageAlphaChannel(image,ActivateAlphaChannel,exception);
   return(status);
@@ -2195,7 +2195,7 @@ MagickExport MagickBooleanType HaldClutImage(Image *image,
   assert(hald_image->signature == MagickSignature);
   if( IfMagickFalse(SetImageStorageClass(image,DirectClass,exception)) )
     return(MagickFalse);
-  if (image->alpha_trait != BlendPixelTrait)
+  if (image->alpha_trait == UndefinedPixelTrait)
     (void) SetImageAlphaChannel(image,OpaqueAlphaChannel,exception);
   /*
     Hald clut image.
@@ -2283,7 +2283,7 @@ MagickExport MagickBooleanType HaldClutImage(Image *image,
           (image->colorspace == CMYKColorspace))
         SetPixelBlack(image,ClampToQuantum(pixel.black),q);
       if (((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0) &&
-          (image->alpha_trait == BlendPixelTrait))
+          (image->alpha_trait != UndefinedPixelTrait))
         SetPixelAlpha(image,ClampToQuantum(pixel.alpha),q);
       q+=GetPixelChannels(image);
     }
@@ -2726,7 +2726,7 @@ MagickExport MagickBooleanType LevelImageColors(Image *image,
           (void) SetImageChannelMask(image,channel_mask);
         }
       if (((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0) &&
-          (image->alpha_trait == BlendPixelTrait))
+          (image->alpha_trait != UndefinedPixelTrait))
         {
           channel_mask=SetImageChannelMask(image,AlphaChannel);
           status&=LevelImage(image,black_color->alpha,white_color->alpha,1.0,
@@ -2766,7 +2766,7 @@ MagickExport MagickBooleanType LevelImageColors(Image *image,
           (void) SetImageChannelMask(image,channel_mask);
         }
       if (((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0) &&
-          (image->alpha_trait == BlendPixelTrait))
+          (image->alpha_trait != UndefinedPixelTrait))
         {
           channel_mask=SetImageChannelMask(image,AlphaChannel);
           status&=LevelizeImage(image,black_color->alpha,white_color->alpha,1.0,
index 7dc3faa086f9c7fbd28ec78d7f47e68c7c80cfe9..b903032fc9ac070d7fe914fec38c27df51a8e1fc 100644 (file)
@@ -742,7 +742,7 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image,
       if (image->colorspace == CMYKColorspace)
         grays[ScaleQuantumToMap(GetPixelBlack(image,p))].black=
           ScaleQuantumToMap(GetPixelBlack(image,p));
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         grays[ScaleQuantumToMap(GetPixelAlpha(image,p))].alpha=
           ScaleQuantumToMap(GetPixelAlpha(image,p));
       p+=GetPixelChannels(image);
@@ -768,7 +768,7 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image,
     if (image->colorspace == CMYKColorspace)
       if (grays[i].black != ~0U)
         grays[gray.black++].black=grays[i].black;
-    if (image->alpha_trait == BlendPixelTrait)
+    if (image->alpha_trait != UndefinedPixelTrait)
       if (grays[i].alpha != ~0U)
         grays[gray.alpha++].alpha=grays[i].alpha;
   }
@@ -783,7 +783,7 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image,
   if (image->colorspace == CMYKColorspace)
     if (gray.black > number_grays)
       number_grays=gray.black;
-  if (image->alpha_trait == BlendPixelTrait)
+  if (image->alpha_trait != UndefinedPixelTrait)
     if (gray.alpha > number_grays)
       number_grays=gray.alpha;
   cooccurrence=(ChannelStatistics **) AcquireQuantumMemory(number_grays,
@@ -985,7 +985,7 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image,
             cooccurrence[u][v].direction[i].black++;
             cooccurrence[v][u].direction[i].black++;
           }
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           {
             u=0;
             v=0;
@@ -1074,7 +1074,7 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image,
         cooccurrence[x][y].direction[i].blue*=normalize;
         if (image->colorspace == CMYKColorspace)
           cooccurrence[x][y].direction[i].black*=normalize;
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           cooccurrence[x][y].direction[i].alpha*=normalize;
       }
     }
@@ -1114,7 +1114,7 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image,
           channel_features[BlackPixelChannel].angular_second_moment[i]+=
             cooccurrence[x][y].direction[i].black*
             cooccurrence[x][y].direction[i].black;
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           channel_features[AlphaPixelChannel].angular_second_moment[i]+=
             cooccurrence[x][y].direction[i].alpha*
             cooccurrence[x][y].direction[i].alpha;
@@ -1126,7 +1126,7 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image,
         sum[y].direction[i].blue+=cooccurrence[x][y].direction[i].blue;
         if (image->colorspace == CMYKColorspace)
           sum[y].direction[i].black+=cooccurrence[x][y].direction[i].black;
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           sum[y].direction[i].alpha+=cooccurrence[x][y].direction[i].alpha;
         correlation.direction[i].red+=x*y*cooccurrence[x][y].direction[i].red;
         correlation.direction[i].green+=x*y*
@@ -1136,7 +1136,7 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image,
         if (image->colorspace == CMYKColorspace)
           correlation.direction[i].black+=x*y*
             cooccurrence[x][y].direction[i].black;
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           correlation.direction[i].alpha+=x*y*
             cooccurrence[x][y].direction[i].alpha;
         /*
@@ -1151,7 +1151,7 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image,
         if (image->colorspace == CMYKColorspace)
           channel_features[BlackPixelChannel].inverse_difference_moment[i]+=
             cooccurrence[x][y].direction[i].black/((y-x)*(y-x)+1);
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           channel_features[AlphaPixelChannel].inverse_difference_moment[i]+=
             cooccurrence[x][y].direction[i].alpha/((y-x)*(y-x)+1);
         /*
@@ -1166,7 +1166,7 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image,
         if (image->colorspace == CMYKColorspace)
           density_xy[y+x+2].direction[i].black+=
             cooccurrence[x][y].direction[i].black;
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           density_xy[y+x+2].direction[i].alpha+=
             cooccurrence[x][y].direction[i].alpha;
         /*
@@ -1185,7 +1185,7 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image,
           channel_features[BlackPixelChannel].entropy[i]-=
             cooccurrence[x][y].direction[i].black*
             MagickLog10(cooccurrence[x][y].direction[i].black);
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           channel_features[AlphaPixelChannel].entropy[i]-=
             cooccurrence[x][y].direction[i].alpha*
             MagickLog10(cooccurrence[x][y].direction[i].alpha);
@@ -1195,7 +1195,7 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image,
         density_x[x].direction[i].red+=cooccurrence[x][y].direction[i].red;
         density_x[x].direction[i].green+=cooccurrence[x][y].direction[i].green;
         density_x[x].direction[i].blue+=cooccurrence[x][y].direction[i].blue;
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           density_x[x].direction[i].alpha+=
             cooccurrence[x][y].direction[i].alpha;
         if (image->colorspace == CMYKColorspace)
@@ -1207,7 +1207,7 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image,
         if (image->colorspace == CMYKColorspace)
           density_y[y].direction[i].black+=
             cooccurrence[x][y].direction[i].black;
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           density_y[y].direction[i].alpha+=
             cooccurrence[x][y].direction[i].alpha;
       }
@@ -1222,7 +1222,7 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image,
           mean.direction[i].black+=y*sum[y].direction[i].black;
           sum_squares.direction[i].black+=y*y*sum[y].direction[i].black;
         }
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         {
           mean.direction[i].alpha+=y*sum[y].direction[i].alpha;
           sum_squares.direction[i].alpha+=y*y*sum[y].direction[i].alpha;
@@ -1256,7 +1256,7 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image,
         (mean.direction[i].black*mean.direction[i].black))*sqrt(
         sum_squares.direction[i].black-(mean.direction[i].black*
         mean.direction[i].black)));
-    if (image->alpha_trait == BlendPixelTrait)
+    if (image->alpha_trait != UndefinedPixelTrait)
       channel_features[AlphaPixelChannel].correlation[i]=
         (correlation.direction[i].alpha-mean.direction[i].alpha*
         mean.direction[i].alpha)/(sqrt(sum_squares.direction[i].alpha-
@@ -1290,7 +1290,7 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image,
       if (image->colorspace == CMYKColorspace)
         channel_features[BlackPixelChannel].sum_average[i]+=
           x*density_xy[x].direction[i].black;
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         channel_features[AlphaPixelChannel].sum_average[i]+=
           x*density_xy[x].direction[i].alpha;
       /*
@@ -1309,7 +1309,7 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image,
         channel_features[BlackPixelChannel].sum_entropy[i]-=
           density_xy[x].direction[i].black*
           MagickLog10(density_xy[x].direction[i].black);
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         channel_features[AlphaPixelChannel].sum_entropy[i]-=
           density_xy[x].direction[i].alpha*
           MagickLog10(density_xy[x].direction[i].alpha);
@@ -1333,7 +1333,7 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image,
           (x-channel_features[BlackPixelChannel].sum_entropy[i])*
           (x-channel_features[BlackPixelChannel].sum_entropy[i])*
           density_xy[x].direction[i].black;
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         channel_features[AlphaPixelChannel].sum_variance[i]+=
           (x-channel_features[AlphaPixelChannel].sum_entropy[i])*
           (x-channel_features[AlphaPixelChannel].sum_entropy[i])*
@@ -1371,7 +1371,7 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image,
         if (image->colorspace == CMYKColorspace)
           variance.direction[i].black+=(y-mean.direction[i].black+1)*
             (y-mean.direction[i].black+1)*cooccurrence[x][y].direction[i].black;
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           variance.direction[i].alpha+=(y-mean.direction[i].alpha+1)*
             (y-mean.direction[i].alpha+1)*
             cooccurrence[x][y].direction[i].alpha;
@@ -1387,7 +1387,7 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image,
         if (image->colorspace == CMYKColorspace)
           density_xy[MagickAbsoluteValue(y-x)].direction[i].black+=
             cooccurrence[x][y].direction[i].black;
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           density_xy[MagickAbsoluteValue(y-x)].direction[i].alpha+=
             cooccurrence[x][y].direction[i].alpha;
         /*
@@ -1402,7 +1402,7 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image,
         if (image->colorspace == CMYKColorspace)
           entropy_xy.direction[i].black-=cooccurrence[x][y].direction[i].black*
             MagickLog10(cooccurrence[x][y].direction[i].black);
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           entropy_xy.direction[i].alpha-=
             cooccurrence[x][y].direction[i].alpha*MagickLog10(
             cooccurrence[x][y].direction[i].alpha);
@@ -1417,7 +1417,7 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image,
           entropy_xy1.direction[i].black-=(
             cooccurrence[x][y].direction[i].black*MagickLog10(
             density_x[x].direction[i].black*density_y[y].direction[i].black));
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           entropy_xy1.direction[i].alpha-=(
             cooccurrence[x][y].direction[i].alpha*MagickLog10(
             density_x[x].direction[i].alpha*density_y[y].direction[i].alpha));
@@ -1434,7 +1434,7 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image,
           entropy_xy2.direction[i].black-=(density_x[x].direction[i].black*
             density_y[y].direction[i].black*MagickLog10(
             density_x[x].direction[i].black*density_y[y].direction[i].black));
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           entropy_xy2.direction[i].alpha-=(density_x[x].direction[i].alpha*
             density_y[y].direction[i].alpha*MagickLog10(
             density_x[x].direction[i].alpha*density_y[y].direction[i].alpha));
@@ -1449,7 +1449,7 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image,
     if (image->colorspace == CMYKColorspace)
       channel_features[BlackPixelChannel].variance_sum_of_squares[i]=
         variance.direction[i].black;
-    if (image->alpha_trait == BlendPixelTrait)
+    if (image->alpha_trait != UndefinedPixelTrait)
       channel_features[AlphaPixelChannel].variance_sum_of_squares[i]=
         variance.direction[i].alpha;
   }
@@ -1477,7 +1477,7 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image,
       variance.direction[i].blue+=density_xy[x].direction[i].blue;
       if (image->colorspace == CMYKColorspace)
         variance.direction[i].black+=density_xy[x].direction[i].black;
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         variance.direction[i].alpha+=density_xy[x].direction[i].alpha;
       sum_squares.direction[i].red+=density_xy[x].direction[i].red*
         density_xy[x].direction[i].red;
@@ -1488,7 +1488,7 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image,
       if (image->colorspace == CMYKColorspace)
         sum_squares.direction[i].black+=density_xy[x].direction[i].black*
           density_xy[x].direction[i].black;
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         sum_squares.direction[i].alpha+=density_xy[x].direction[i].alpha*
           density_xy[x].direction[i].alpha;
       /*
@@ -1507,7 +1507,7 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image,
         channel_features[BlackPixelChannel].difference_entropy[i]-=
           density_xy[x].direction[i].black*
           MagickLog10(density_xy[x].direction[i].black);
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         channel_features[AlphaPixelChannel].difference_entropy[i]-=
           density_xy[x].direction[i].alpha*
           MagickLog10(density_xy[x].direction[i].alpha);
@@ -1523,7 +1523,7 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image,
       if (image->colorspace == CMYKColorspace)
         entropy_x.direction[i].black-=(density_x[x].direction[i].black*
           MagickLog10(density_x[x].direction[i].black));
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         entropy_x.direction[i].alpha-=(density_x[x].direction[i].alpha*
           MagickLog10(density_x[x].direction[i].alpha));
       entropy_y.direction[i].red-=(density_y[x].direction[i].red*
@@ -1535,7 +1535,7 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image,
       if (image->colorspace == CMYKColorspace)
         entropy_y.direction[i].black-=(density_y[x].direction[i].black*
           MagickLog10(density_y[x].direction[i].black));
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         entropy_y.direction[i].alpha-=(density_y[x].direction[i].alpha*
           MagickLog10(density_y[x].direction[i].alpha));
     }
@@ -1559,7 +1559,7 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image,
         (((double) number_grays*number_grays*sum_squares.direction[i].black)-
         (variance.direction[i].black*variance.direction[i].black))/
         ((double) number_grays*number_grays*number_grays*number_grays);
-    if (image->alpha_trait == BlendPixelTrait)
+    if (image->alpha_trait != UndefinedPixelTrait)
       channel_features[AlphaPixelChannel].difference_variance[i]=
         (((double) number_grays*number_grays*sum_squares.direction[i].alpha)-
         (variance.direction[i].alpha*variance.direction[i].alpha))/
@@ -1584,7 +1584,7 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image,
         (entropy_xy.direction[i].black-entropy_xy1.direction[i].black)/
         (entropy_x.direction[i].black > entropy_y.direction[i].black ?
          entropy_x.direction[i].black : entropy_y.direction[i].black);
-    if (image->alpha_trait == BlendPixelTrait)
+    if (image->alpha_trait != UndefinedPixelTrait)
       channel_features[AlphaPixelChannel].measure_of_correlation_1[i]=
         (entropy_xy.direction[i].alpha-entropy_xy1.direction[i].alpha)/
         (entropy_x.direction[i].alpha > entropy_y.direction[i].alpha ?
@@ -1602,7 +1602,7 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image,
       channel_features[BlackPixelChannel].measure_of_correlation_2[i]=
         (sqrt(fabs(1.0-exp(-2.0*(entropy_xy2.direction[i].black-
         entropy_xy.direction[i].black)))));
-    if (image->alpha_trait == BlendPixelTrait)
+    if (image->alpha_trait != UndefinedPixelTrait)
       channel_features[AlphaPixelChannel].measure_of_correlation_2[i]=
         (sqrt(fabs(1.0-exp(-2.0*(entropy_xy2.direction[i].alpha-
         entropy_xy.direction[i].alpha)))));
@@ -1645,7 +1645,7 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image,
               pixel.direction[i].blue+=cooccurrence[x][y].direction[i].blue;
               if (image->colorspace == CMYKColorspace)
                 pixel.direction[i].black+=cooccurrence[x][y].direction[i].black;
-              if (image->alpha_trait == BlendPixelTrait)
+              if (image->alpha_trait != UndefinedPixelTrait)
                 pixel.direction[i].alpha+=
                   cooccurrence[x][y].direction[i].alpha;
             }
@@ -1665,7 +1665,7 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image,
             Q[z][y].direction[i].black+=cooccurrence[z][x].direction[i].black*
               cooccurrence[y][x].direction[i].black/
               density_x[z].direction[i].black/density_y[x].direction[i].black;
-          if (image->alpha_trait == BlendPixelTrait)
+          if (image->alpha_trait != UndefinedPixelTrait)
             Q[z][y].direction[i].alpha+=
               cooccurrence[z][x].direction[i].alpha*
               cooccurrence[y][x].direction[i].alpha/
@@ -1682,7 +1682,7 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image,
       if (image->colorspace == CMYKColorspace)
         channel_features[BlackPixelChannel].contrast[i]+=z*z*
           pixel.direction[i].black;
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         channel_features[AlphaPixelChannel].contrast[i]+=z*z*
           pixel.direction[i].alpha;
     }
@@ -1699,7 +1699,7 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image,
     if (image->colorspace == CMYKColorspace)
       channel_features[BlackPixelChannel].maximum_correlation_coefficient[i]=
         sqrt((double) -1.0);
-    if (image->alpha_trait == BlendPixelTrait)
+    if (image->alpha_trait != UndefinedPixelTrait)
       channel_features[AlphaPixelChannel].maximum_correlation_coefficient[i]=
         sqrt((double) -1.0);
   }
index a649eca2f53c54d77987d1ba80e19eca51fcdeea..72b5be4da0ab3c80c569edf8ec841d1ee08ad390 100644 (file)
@@ -1017,7 +1017,7 @@ MagickExport Image *ForwardFourierTransformImage(const Image *image,
                   thread_status;
 
                 thread_status=MagickTrue;
-                if (image->alpha_trait == BlendPixelTrait)
+                if (image->alpha_trait != UndefinedPixelTrait)
                   thread_status=ForwardFourierTransformChannel(image,
                     AlphaPixelChannel,modulus,fourier_image,exception);
                 if (thread_status == MagickFalse)
@@ -1584,7 +1584,7 @@ MagickExport Image *InverseFourierTransformImage(const Image *magnitude_image,
               thread_status;
 
             thread_status=MagickTrue;
-            if (magnitude_image->alpha_trait == BlendPixelTrait)
+            if (magnitude_image->alpha_trait != UndefinedPixelTrait)
               thread_status=InverseFourierTransformChannel(magnitude_image,
                 phase_image,AlphaPixelChannel,modulus,fourier_image,exception);
             if (thread_status == MagickFalse)
index 1c2450bd89bcf7b273e3ada99574815c1c88e671..8f17107c188efb718d922107df55e120eb72c6ea 100644 (file)
@@ -701,8 +701,8 @@ MagickExport Image *ColorizeImage(const Image *image,const char *blend,
   if ((IsGrayColorspace(image->colorspace) != MagickFalse) ||
       (IsPixelInfoGray(colorize) != MagickFalse))
     (void) SetImageColorspace(colorize_image,sRGBColorspace,exception);
-  if ((colorize_image->alpha_trait != BlendPixelTrait) &&
-      (colorize->alpha_trait == BlendPixelTrait))
+  if ((colorize_image->alpha_trait == UndefinedPixelTrait) &&
+      (colorize->alpha_trait != UndefinedPixelTrait))
     (void) SetImageAlpha(colorize_image,OpaqueAlpha,exception);
   if (blend == (const char *) NULL)
     return(colorize_image);
@@ -993,7 +993,7 @@ MagickExport Image *ColorMatrixImage(const Image *image,
           GetPixelGreen(image,p)+ColorMatrix[v][2]*GetPixelBlue(image,p);
         if (image->colorspace == CMYKColorspace)
           sum+=ColorMatrix[v][3]*GetPixelBlack(image,p);
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           sum+=ColorMatrix[v][4]*GetPixelAlpha(image,p);
         sum+=QuantumRange*ColorMatrix[v][5];
         switch (v)
@@ -1487,7 +1487,7 @@ static double FxGetSymbol(FxInfo *fx_info,const PixelChannel channel,
           double
             alpha;
 
-          if (pixel.alpha_trait != BlendPixelTrait)
+          if (pixel.alpha_trait == UndefinedPixelTrait)
             return(1.0);
           alpha=(double) (QuantumScale*pixel.alpha);
           return(alpha);
@@ -4292,7 +4292,7 @@ MagickExport Image *ShadowImage(const Image *image,const double alpha,
   clone_image=DestroyImage(clone_image);
   if (border_image == (Image *) NULL)
     return((Image *) NULL);
-  if (border_image->alpha_trait != BlendPixelTrait)
+  if (border_image->alpha_trait == UndefinedPixelTrait)
     (void) SetImageAlphaChannel(border_image,OpaqueAlphaChannel,exception);
   /*
     Shadow image.
@@ -4323,7 +4323,7 @@ MagickExport Image *ShadowImage(const Image *image,const double alpha,
     background_color.alpha_trait=BlendPixelTrait;
     for (x=0; x < (ssize_t) border_image->columns; x++)
     {
-      if (border_image->alpha_trait == BlendPixelTrait)
+      if (border_image->alpha_trait != UndefinedPixelTrait)
         background_color.alpha=GetPixelAlpha(border_image,q)*alpha/100.0;
       SetPixelInfoPixel(border_image,&background_color,q);
       q+=GetPixelChannels(border_image);
index f16f18063b9d396e167c3078a811df717ba240b4..467a853cdc5ec36bd4d7a6d0b491b018079ef60d 100644 (file)
@@ -166,7 +166,7 @@ static inline size_t ColorToNodeId(const Image *image,
     ((ScaleQuantumToChar(ClampToQuantum(pixel->red)) >> index) & 0x01) |
     ((ScaleQuantumToChar(ClampToQuantum(pixel->green)) >> index) & 0x01) << 1 |
     ((ScaleQuantumToChar(ClampToQuantum(pixel->blue)) >> index) & 0x01) << 2);
-  if (image->alpha_trait == BlendPixelTrait)
+  if (image->alpha_trait != UndefinedPixelTrait)
     id|=((ScaleQuantumToChar(ClampToQuantum(pixel->alpha)) >> index) &
       0x01) << 3;
   return(id);
@@ -342,7 +342,7 @@ static void DefineImageHistogram(const Image *image,NodeInfo *node_info,
   /*
     Traverse any children.
   */
-  number_children=image->alpha_trait != BlendPixelTrait ? 8UL : 16UL;
+  number_children=image->alpha_trait == UndefinedPixelTrait ? 8UL : 16UL;
   for (i=0; i < (ssize_t) number_children; i++)
     if (node_info->child[i] != (NodeInfo *) NULL)
       DefineImageHistogram(image,node_info->child[i],histogram);
@@ -441,7 +441,7 @@ static void DestroyColorCube(const Image *image,NodeInfo *node_info)
   /*
     Traverse any children.
   */
-  number_children=image->alpha_trait != BlendPixelTrait ? 8UL : 16UL;
+  number_children=image->alpha_trait == UndefinedPixelTrait ? 8UL : 16UL;
   for (i=0; i < (ssize_t) number_children; i++)
     if (node_info->child[i] != (NodeInfo *) NULL)
       DestroyColorCube(image,node_info->child[i]);
@@ -1142,7 +1142,7 @@ MagickExport size_t GetNumberColors(const Image *image,FILE *file,
         ConcatenateColorComponent(&pixel,BlackPixelChannel,X11Compliance,
           tuple);
       }
-    if (pixel.alpha_trait == BlendPixelTrait)
+    if (pixel.alpha_trait != UndefinedPixelTrait)
       {
         (void) ConcatenateMagickString(tuple,",",MaxTextExtent);
         ConcatenateColorComponent(&pixel,AlphaPixelChannel,X11Compliance,
@@ -1215,7 +1215,7 @@ static void UniqueColorsToImage(Image *unique_image,CacheView *unique_view,
   /*
     Traverse any children.
   */
-  number_children=unique_image->alpha_trait != BlendPixelTrait ? 8UL : 16UL;
+  number_children=unique_image->alpha_trait == UndefinedPixelTrait ? 8UL : 16UL;
   for (i=0; i < (ssize_t) number_children; i++)
     if (node_info->child[i] != (NodeInfo *) NULL)
       UniqueColorsToImage(unique_image,unique_view,cube_info,
index 85523ee5e884e57c3f0c54cc6a7ad73f3bc9b6c2..ea03968eec1cb8b637100f9e2408d1272623a7f3 100644 (file)
@@ -549,7 +549,7 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file,
           break;
         }
       }
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         (void) PrintChannelLocations(file,image,AlphaPixelChannel,"Alpha",
           type,max_locations,channel_statistics);
       channel_statistics=(ChannelStatistics *) RelinquishMagickMemory(
@@ -756,7 +756,7 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file,
           break;
         }
       }
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         (void) FormatLocaleFile(file,"    Alpha: %.20g-bit\n",(double)
           channel_statistics[AlphaPixelChannel].depth);
       scale=1.0;
@@ -801,7 +801,7 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file,
           break;
         }
       }
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         (void) PrintChannelStatistics(file,AlphaPixelChannel,"Alpha",1.0/
           scale,channel_statistics);
       if (colorspace != GRAYColorspace)
@@ -849,7 +849,7 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file,
           break;
         }
       }
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         (void) PrintChannelMoments(file,AlphaPixelChannel,"Alpha",scale,
           channel_moments);
       if (colorspace != GRAYColorspace)
@@ -870,7 +870,7 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file,
         channel_phash);
       (void) PrintChannelPerceptualHash(file,BluePixelChannel,"Blue, Luma",
         channel_phash);
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         (void) PrintChannelPerceptualHash(file,AlphaPixelChannel,"Alpha, Alpha",
           channel_phash);
       channel_phash=(ChannelPerceptualHash *) RelinquishMagickMemory(
@@ -912,7 +912,7 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file,
           break;
         }
       }
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         (void) PrintChannelFeatures(file,AlphaPixelChannel,"Alpha",
           channel_features);
       channel_features=(ChannelFeatures *) RelinquishMagickMemory(
@@ -925,7 +925,7 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file,
           GetMagickPrecision(),100.0*GetImageTotalInkDensity(image,exception)/
           (double) QuantumRange);
       x=0;
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         {
           register const Quantum
             *p;
@@ -1015,7 +1015,7 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file,
                 ConcatenateColorComponent(&pixel,BlackPixelChannel,
                   X11Compliance,tuple);
               }
-            if (pixel.alpha_trait == BlendPixelTrait)
+            if (pixel.alpha_trait != UndefinedPixelTrait)
               {
                 (void) ConcatenateMagickString(tuple,",",MaxTextExtent);
                 ConcatenateColorComponent(&pixel,AlphaPixelChannel,
index 90fc91d90d22c611d974bff58046c909339af93c..1f496bac654d9aa656255f5e9cf6090211287a15 100644 (file)
@@ -489,7 +489,7 @@ MagickExport Image *AppendImages(const Image *images,
   next=GetNextImageInList(images);
   for ( ; next != (Image *) NULL; next=GetNextImageInList(next))
   {
-    if (next->alpha_trait == BlendPixelTrait)
+    if (next->alpha_trait != UndefinedPixelTrait)
       alpha_trait=BlendPixelTrait;
     number_images++;
     if (stack != MagickFalse)
@@ -3168,7 +3168,7 @@ MagickExport Image *SmushImages(const Image *images,
   next=GetNextImageInList(image);
   for ( ; next != (Image *) NULL; next=GetNextImageInList(next))
   {
-    if (next->alpha_trait == BlendPixelTrait)
+    if (next->alpha_trait != UndefinedPixelTrait)
       alpha_trait=BlendPixelTrait;
     number_images++;
     if (stack != MagickFalse)
index 9b5834926d121ee645bc07ea32c62018446160aa..8ae53a207a8b599d70b6e010650b5e0ccdd0edeb 100644 (file)
@@ -105,7 +105,7 @@ static void ClearBounds(Image *image,RectangleInfo *bounds,
 
   if (bounds->x < 0)
     return;
-  if (image->alpha_trait != BlendPixelTrait)
+  if (image->alpha_trait == UndefinedPixelTrait)
     (void) SetImageAlphaChannel(image,OpaqueAlphaChannel,exception);
   for (y=0; y < (ssize_t) bounds->height; y++)
   {
@@ -328,7 +328,7 @@ MagickExport Image *CoalesceImages(const Image *image,ExceptionInfo *exception)
     previous=coalesce_image;
     coalesce_image=GetNextImageInList(coalesce_image);
     (void) CompositeImage(coalesce_image,next,
-      next->alpha_trait == BlendPixelTrait ? OverCompositeOp : CopyCompositeOp,
+      next->alpha_trait != UndefinedPixelTrait ? OverCompositeOp : CopyCompositeOp,
       MagickTrue,next->page.x,next->page.y,exception);
     (void) CloneImageProfiles(coalesce_image,next);
     (void) CloneImageProperties(coalesce_image,next);
@@ -423,7 +423,7 @@ MagickExport Image *DisposeImages(const Image *images,ExceptionInfo *exception)
         return((Image *) NULL);
       }
     (void) CompositeImage(current_image,next,
-      next->alpha_trait == BlendPixelTrait ? OverCompositeOp : CopyCompositeOp,
+      next->alpha_trait != UndefinedPixelTrait ? OverCompositeOp : CopyCompositeOp,
       MagickTrue,next->page.x,next->page.y,exception);
     /*
       Handle Background dispose: image is displayed for the delay period.
@@ -531,8 +531,8 @@ static MagickBooleanType ComparePixels(const LayerMethod method,
   if (method == CompareAnyLayer)
     return((MagickBooleanType)(IsFuzzyEquivalencePixelInfo(p,q) == MagickFalse));
 
-  o1 = (p->alpha_trait == BlendPixelTrait) ? p->alpha : OpaqueAlpha;
-  o2 = (q->alpha_trait == BlendPixelTrait) ? q->alpha : OpaqueAlpha;
+  o1 = (p->alpha_trait != UndefinedPixelTrait) ? p->alpha : OpaqueAlpha;
+  o2 = (q->alpha_trait != UndefinedPixelTrait) ? q->alpha : OpaqueAlpha;
   /*
     Pixel goes from opaque to transprency.
   */
@@ -1494,7 +1494,7 @@ MagickExport void OptimizeImageTransparency(const Image *image,
         dispose_image=DestroyImage(dispose_image);
         return;
       }
-    (void) CompositeImage(current_image,next,next->alpha_trait == BlendPixelTrait ?
+    (void) CompositeImage(current_image,next,next->alpha_trait != UndefinedPixelTrait ?
       OverCompositeOp : CopyCompositeOp,MagickTrue,next->page.x,next->page.y,
       exception);
     /*
index b87686633f99a4117f5dca58e5770d3cdc86b41c..47a8c1ae264c901d8c12977634133c69e8f1f700 100644 (file)
@@ -178,8 +178,8 @@ MagickExport MagickBooleanType FloodfillPaintImage(Image *image,
     return(MagickFalse);
   if (IsGrayColorspace(image->colorspace) != MagickFalse)
     (void) SetImageColorspace(image,sRGBColorspace,exception);
-  if ((image->alpha_trait != BlendPixelTrait) &&
-      (draw_info->fill.alpha_trait == BlendPixelTrait))
+  if ((image->alpha_trait == UndefinedPixelTrait) &&
+      (draw_info->fill.alpha_trait != UndefinedPixelTrait))
     (void) SetImageAlpha(image,OpaqueAlpha,exception);
   /*
     Set floodfill state.
@@ -913,7 +913,7 @@ MagickExport MagickBooleanType TransparentPaintImage(Image *image,
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
   if (SetImageStorageClass(image,DirectClass,exception) == MagickFalse)
     return(MagickFalse);
-  if (image->alpha_trait != BlendPixelTrait)
+  if (image->alpha_trait == UndefinedPixelTrait)
     (void) SetImageAlphaChannel(image,OpaqueAlphaChannel,exception);
   /*
     Make image color transparent.
@@ -1041,7 +1041,7 @@ MagickExport MagickBooleanType TransparentPaintImageChroma(Image *image,
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
   if (SetImageStorageClass(image,DirectClass,exception) == MagickFalse)
     return(MagickFalse);
-  if (image->alpha_trait != BlendPixelTrait)
+  if (image->alpha_trait == UndefinedPixelTrait)
     (void) SetImageAlphaChannel(image,OpaqueAlphaChannel,exception);
   /*
     Make image color transparent.
index 8a1d5a6049472b04c5c71108ed2822a4f0f1f449..977b9c1b3c16c0f198f413974b09a1dde1fc8437 100644 (file)
@@ -454,16 +454,16 @@ static inline MagickBooleanType IsPixelGray(const Image *restrict image,
 static inline MagickBooleanType IsPixelInfoEquivalent(
   const PixelInfo *restrict p,const PixelInfo *restrict q)
 {
-  if ((p->alpha_trait == BlendPixelTrait) &&
-      (q->alpha_trait != BlendPixelTrait) &&
+  if ((p->alpha_trait != UndefinedPixelTrait) &&
+      (q->alpha_trait == UndefinedPixelTrait) &&
       (AbsolutePixelValue(p->alpha-OpaqueAlpha) >= MagickEpsilon))
     return(MagickFalse);
-  if ((q->alpha_trait == BlendPixelTrait) &&
-      (p->alpha_trait != BlendPixelTrait) &&
+  if ((q->alpha_trait != UndefinedPixelTrait) &&
+      (p->alpha_trait == UndefinedPixelTrait) &&
       (AbsolutePixelValue(q->alpha-OpaqueAlpha)) >= MagickEpsilon)
     return(MagickFalse);
-  if ((p->alpha_trait == BlendPixelTrait) &&
-      (q->alpha_trait == BlendPixelTrait))
+  if ((p->alpha_trait != UndefinedPixelTrait) &&
+      (q->alpha_trait != UndefinedPixelTrait))
     {
       if (AbsolutePixelValue(p->alpha-q->alpha) >= MagickEpsilon)
         return(MagickFalse);
@@ -574,7 +574,7 @@ static inline void SetPixelBackgoundColor(const Image *restrict image,
       ClampToQuantum(image->background_color.black);
   if (image->channel_map[AlphaPixelChannel].traits != UndefinedPixelTrait)
     pixel[image->channel_map[AlphaPixelChannel].offset]=
-      image->background_color.alpha_trait != BlendPixelTrait ? OpaqueAlpha :
+      image->background_color.alpha_trait == UndefinedPixelTrait ? OpaqueAlpha :
       ClampToQuantum(image->background_color.alpha);
 }
 
@@ -710,7 +710,7 @@ static inline void SetPixelInfoPixel(const Image *restrict image,
       ClampToQuantum(pixel_info->black);
   if (image->channel_map[AlphaPixelChannel].traits != UndefinedPixelTrait)
     pixel[image->channel_map[AlphaPixelChannel].offset]=
-      pixel_info->alpha_trait != BlendPixelTrait ? OpaqueAlpha :
+      pixel_info->alpha_trait == UndefinedPixelTrait ? OpaqueAlpha :
       ClampToQuantum(pixel_info->alpha);
 }
 
index b6b3e262733e97707d1d5a01aa9b99ee2afd94b8..34c43bd2660cc0eeb840c3d916188baf7b724711 100644 (file)
@@ -237,8 +237,8 @@ MagickExport void ConformPixelInfo(Image *image,const PixelInfo *source,
       (IsGrayColorspace(image->colorspace) != MagickFalse))
     (void) TransformImageColorspace(image,sRGBColorspace,exception);
 #endif
-  if ((destination->alpha_trait == BlendPixelTrait) &&
-      (image->alpha_trait != BlendPixelTrait))
+  if ((destination->alpha_trait != UndefinedPixelTrait) &&
+      (image->alpha_trait == UndefinedPixelTrait))
     (void) SetImageAlpha(image,OpaqueAlpha,exception);
 }
 \f
@@ -4316,7 +4316,7 @@ MagickExport void InitializePixelChannelMap(Image *image)
   (void) ResetMagickMemory(image->channel_map,0,MaxPixelChannels*
     sizeof(*image->channel_map));
   trait=UpdatePixelTrait;
-  if (image->alpha_trait == BlendPixelTrait)
+  if (image->alpha_trait != UndefinedPixelTrait)
     trait=(PixelTrait) (trait | BlendPixelTrait);
   n=0;
   if (image->colorspace == GRAYColorspace)
@@ -5421,7 +5421,7 @@ MagickExport MagickBooleanType InterpolatePixelChannels(const Image *source,
 static inline void AlphaBlendPixelInfo(const Image *image,
   const Quantum *pixel,PixelInfo *pixel_info,double *alpha)
 {
-  if (image->alpha_trait != BlendPixelTrait)
+  if (image->alpha_trait == UndefinedPixelTrait)
     {
       *alpha=1.0;
       pixel_info->red=(double) GetPixelRed(image,pixel);
@@ -5931,7 +5931,7 @@ MagickExport MagickBooleanType IsFuzzyEquivalencePixel(const Image *source,
     destination->fuzz,(MagickRealType) MagickSQ1_2);
   scale=1.0;
   distance=0.0;
-  if (source->alpha_trait == BlendPixelTrait)
+  if (source->alpha_trait != UndefinedPixelTrait)
     {
       /*
         Transparencies are involved - set alpha distance
@@ -6049,14 +6049,14 @@ MagickExport MagickBooleanType IsFuzzyEquivalencePixelInfo(const PixelInfo *p,
       MagickMax(q->fuzz,(MagickRealType) MagickSQ1_2);
   scale=1.0;
   distance=0.0;
-  if ((p->alpha_trait == BlendPixelTrait) ||
-      (q->alpha_trait == BlendPixelTrait))
+  if ((p->alpha_trait != UndefinedPixelTrait) ||
+      (q->alpha_trait != UndefinedPixelTrait))
     {
       /*
         Transparencies are involved - set alpha distance.
       */
-      pixel=(p->alpha_trait == BlendPixelTrait ? p->alpha : OpaqueAlpha)-
-        (q->alpha_trait == BlendPixelTrait ? q->alpha : OpaqueAlpha);
+      pixel=(p->alpha_trait != UndefinedPixelTrait ? p->alpha : OpaqueAlpha)-
+        (q->alpha_trait != UndefinedPixelTrait ? q->alpha : OpaqueAlpha);
       distance=pixel*pixel;
       if (distance > fuzz)
         return(MagickFalse);
@@ -6064,9 +6064,9 @@ MagickExport MagickBooleanType IsFuzzyEquivalencePixelInfo(const PixelInfo *p,
         Generate a alpha scaling factor to generate a 4D cone on colorspace.
         If one color is transparent, distance has no color component.
       */
-      if (p->alpha_trait == BlendPixelTrait)
+      if (p->alpha_trait != UndefinedPixelTrait)
         scale=(QuantumScale*p->alpha);
-      if (q->alpha_trait == BlendPixelTrait)
+      if (q->alpha_trait != UndefinedPixelTrait)
         scale*=(QuantumScale*q->alpha);
       if (scale <= MagickEpsilon )
         return(MagickTrue);
@@ -6157,13 +6157,13 @@ MagickExport void SetPixelChannelMask(Image *image,
     PixelChannel channel=GetPixelChannelChannel(image,i);
     SetPixelChannelTraits(image,channel,
       GetChannelBit(channel_mask,channel) == 0 ? CopyPixelTrait :
-      (image->alpha_trait == BlendPixelTrait) &&
+      (image->alpha_trait != UndefinedPixelTrait) &&
       (channel != AlphaPixelChannel) ?  (PixelTrait)
       (UpdatePixelTrait | BlendPixelTrait) : UpdatePixelTrait);
   }
   if (image->storage_class == PseudoClass)
     SetPixelChannelTraits(image,IndexPixelChannel,CopyPixelTrait);
-  if (image->alpha_trait != BlendPixelTrait)
+  if (image->alpha_trait == UndefinedPixelTrait)
     SetPixelChannelTraits(image,AlphaPixelChannel,image->alpha_trait);
   if (image->read_mask != MagickFalse)
     SetPixelChannelTraits(image,ReadMaskPixelChannel,CopyPixelTrait);
index ef1a570fd2c48b57e93b2d4dafffd6a4456d210d..d73261a84884e9991903e2c7703cc744c76c4441 100644 (file)
@@ -1236,19 +1236,19 @@ MagickExport MagickBooleanType ProfileImage(Image *image,const char *name,
             {
               case cmsSigRgbData:
               {
-                image->type=image->alpha_trait != BlendPixelTrait ?
+                image->type=image->alpha_trait == UndefinedPixelTrait ?
                   TrueColorType : TrueColorMatteType;
                 break;
               }
               case cmsSigCmykData:
               {
-                image->type=image->alpha_trait != BlendPixelTrait ?
+                image->type=image->alpha_trait == UndefinedPixelTrait ?
                   ColorSeparationType : ColorSeparationMatteType;
                 break;
               }
               case cmsSigGrayData:
               {
-                image->type=image->alpha_trait != BlendPixelTrait ?
+                image->type=image->alpha_trait == UndefinedPixelTrait ?
                   GrayscaleType : GrayscaleMatteType;
                 break;
               }
index 046a8ccf38dd7003679d21b0f802e01033410f1c..0885e179e14f49071aa65a1a92d0e8bb3cb41177 100644 (file)
@@ -2366,7 +2366,7 @@ static const char *GetMagickPropertyLetter(ImageInfo *image_info,
       (void) FormatLocaleString(value,MaxTextExtent,"%s %s %s",
         CommandOptionToMnemonic(MagickClassOptions,(ssize_t) image->storage_class),
         CommandOptionToMnemonic(MagickColorspaceOptions,(ssize_t) colorspace),
-        image->alpha_trait == BlendPixelTrait ? "Alpha" : "");
+        image->alpha_trait != UndefinedPixelTrait ? "Alpha" : "");
       break;
     }
     case 's': /* Image scene number */
@@ -2644,7 +2644,7 @@ MagickExport const char *GetMagickProperty(ImageInfo *image_info,
             CommandOptionToMnemonic(MagickColorspaceOptions,(ssize_t)
             image->colorspace));
           LocaleLower(value);
-          if( image->alpha_trait == BlendPixelTrait )
+          if( image->alpha_trait != UndefinedPixelTrait )
             (void) ConcatenateMagickString(value,"a",MaxTextExtent);
           break;
         }
index 03995fd8448f0dc6c60d36af015f65160e2ea7f1..c107113a8d309c260cc4af08c38891788ef4f0b6 100644 (file)
@@ -755,7 +755,7 @@ static inline void SetAssociatedAlpha(const Image *image,CubeInfo *cube_info)
   MagickBooleanType
     associate_alpha;
 
-  associate_alpha=image->alpha_trait == BlendPixelTrait ? MagickTrue :
+  associate_alpha=image->alpha_trait != UndefinedPixelTrait ? MagickTrue :
     MagickFalse;
   if ((cube_info->quantize_info->number_colors == 2) &&
       (cube_info->quantize_info->colorspace == GRAYColorspace))
@@ -2246,7 +2246,7 @@ MagickExport MagickBooleanType GetImageQuantizeError(Image *image,
     for (x=0; x < (ssize_t) image->columns; x++)
     {
       index=1UL*GetPixelIndex(image,p);
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         {
           alpha=(double) (QuantumScale*GetPixelAlpha(image,p));
           beta=(double) (QuantumScale*image->colormap[index].alpha);
@@ -2447,7 +2447,7 @@ MagickExport MagickBooleanType PosterizeImage(Image *image,const size_t levels,
           (image->colorspace == CMYKColorspace))
         SetPixelBlack(image,PosterizePixel(GetPixelBlack(image,q)),q);
       if (((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0) &&
-          (image->alpha_trait == BlendPixelTrait))
+          (image->alpha_trait != UndefinedPixelTrait))
         SetPixelAlpha(image,PosterizePixel(GetPixelAlpha(image,q)),q);
       q+=GetPixelChannels(image);
     }
@@ -2750,7 +2750,7 @@ MagickExport MagickBooleanType QuantizeImage(const QuantizeInfo *quantize_info,
     maximum_colors=MaxColormapSize;
   if (maximum_colors > MaxColormapSize)
     maximum_colors=MaxColormapSize;
-  if (image->alpha_trait != BlendPixelTrait)
+  if (image->alpha_trait == UndefinedPixelTrait)
     {
       if ((image->columns*image->rows) <= maximum_colors)
         (void) DirectToColormapImage(image,exception);
@@ -2774,7 +2774,7 @@ MagickExport MagickBooleanType QuantizeImage(const QuantizeInfo *quantize_info,
         colors>>=2;
       if ((quantize_info->dither_method != NoDitherMethod) && (depth > 2))
         depth--;
-      if ((image->alpha_trait == BlendPixelTrait) && (depth > 5))
+      if ((image->alpha_trait != UndefinedPixelTrait) && (depth > 5))
         depth--;
       if (IsImageGray(image,exception) != MagickFalse)
         depth=MaxTreeDepth;
index b1659fd5b68dda9559727b62cd57b627fcd72ac1..e8fd9dedc861d477e27d29bf93d14acd1c40d68a 100644 (file)
@@ -514,24 +514,24 @@ MagickExport QuantumType GetQuantumType(Image *image,ExceptionInfo *exception)
   if (image->debug != MagickFalse)
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
   quantum_type=RGBQuantum;
-  if (image->alpha_trait == BlendPixelTrait)
+  if (image->alpha_trait != UndefinedPixelTrait)
     quantum_type=RGBAQuantum;
   if (image->colorspace == CMYKColorspace)
     {
       quantum_type=CMYKQuantum;
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         quantum_type=CMYKAQuantum;
     }
   if (IsImageGray(image,exception) != MagickFalse)
     {
       quantum_type=GrayQuantum;
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         quantum_type=GrayAlphaQuantum;
     }
   if (image->storage_class == PseudoClass)
     {
       quantum_type=IndexQuantum;
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         quantum_type=IndexAlphaQuantum;
     }
   return(quantum_type);
index 44eb2785bb783a29fbca1313549b4966f91f97ef..04f4025ca09fbb68e950b31fc20cb68f865ce36f 100644 (file)
@@ -545,7 +545,7 @@ MagickExport MagickBooleanType ResamplePixelColor(
   pixel->red = pixel->green = pixel->blue = 0.0;
   if (pixel->colorspace == CMYKColorspace)
     pixel->black = 0.0;
-  if (pixel->alpha_trait == BlendPixelTrait)
+  if (pixel->alpha_trait != UndefinedPixelTrait)
     pixel->alpha = 0.0;
 
   /*
@@ -610,7 +610,7 @@ MagickExport MagickBooleanType ResamplePixelColor(
         pixel->alpha  += weight*GetPixelAlpha(resample_filter->image,pixels);
         divisor_m += weight;
 
-        if (pixel->alpha_trait == BlendPixelTrait)
+        if (pixel->alpha_trait != UndefinedPixelTrait)
           weight *= QuantumScale*((double) GetPixelAlpha(resample_filter->image,pixels));
         pixel->red   += weight*GetPixelRed(resample_filter->image,pixels);
         pixel->green += weight*GetPixelGreen(resample_filter->image,pixels);
index 0ca83891c3acc73127ce2582fb5d55e79f71d197..e3be9b331c2b03d81d79ab89561d2116c8790634 100644 (file)
@@ -2892,7 +2892,7 @@ MagickExport Image *ResizeImage(const Image *image,const size_t columns,
       filter_type=PointFilter;
     else
       if ((image->storage_class == PseudoClass) ||
-          (image->alpha_trait == BlendPixelTrait) ||
+          (image->alpha_trait != UndefinedPixelTrait) ||
           ((x_factor*y_factor) > 1.0))
         filter_type=MitchellFilter;
   resize_filter=AcquireResizeFilter(image,filter_type,MagickFalse,exception);
@@ -3697,7 +3697,7 @@ MagickExport Image *ThumbnailImage(const Image *image,const size_t columns,
   if (thumbnail_image == (Image *) NULL)
     return(thumbnail_image);
   (void) ParseAbsoluteGeometry("0x0+0+0",&thumbnail_image->page);
-  if (thumbnail_image->alpha_trait != BlendPixelTrait)
+  if (thumbnail_image->alpha_trait == UndefinedPixelTrait)
     (void) SetImageAlphaChannel(thumbnail_image,OpaqueAlphaChannel,exception);
   thumbnail_image->depth=8;
   thumbnail_image->interlace=NoInterlace;
index 56e9ceaf9dd62e0f1f1ee1e1e871310ee56861a7..e46d004d7186058f3370ecca30c66b225b3a26a7 100644 (file)
@@ -1624,7 +1624,7 @@ MagickExport Image *ShearImage(const Image *image,const double x_shear,
       integral_image=DestroyImage(integral_image);
       return(integral_image);
     }
-  if (integral_image->alpha_trait != BlendPixelTrait)
+  if (integral_image->alpha_trait == UndefinedPixelTrait)
     (void) SetImageAlphaChannel(integral_image,OpaqueAlphaChannel,exception);
   /*
     Compute image size.
@@ -1648,7 +1648,7 @@ MagickExport Image *ShearImage(const Image *image,const double x_shear,
   /*
     Shear the image.
   */
-  if (shear_image->alpha_trait != BlendPixelTrait)
+  if (shear_image->alpha_trait == UndefinedPixelTrait)
     (void) SetImageAlphaChannel(shear_image,OpaqueAlphaChannel,exception);
   status=XShearImage(shear_image,shear.x,image->columns,image->rows,bounds.x,
     (ssize_t) (shear_image->rows-image->rows)/2,exception);
@@ -1769,7 +1769,7 @@ MagickExport Image *ShearRotateImage(const Image *image,const double degrees,
       integral_image=DestroyImage(integral_image);
       return(integral_image);
     }
-  if (integral_image->alpha_trait != BlendPixelTrait)
+  if (integral_image->alpha_trait == UndefinedPixelTrait)
     (void) SetImageAlphaChannel(integral_image,OpaqueAlphaChannel,exception);
   /*
     Compute maximum bounds for 3 shear operations.
index cab89da7ebf316a67e03cb2fcbcf49c8dda56a93..eabb8ad334992cbe518fd9a14d099e78af8a4906 100644 (file)
@@ -1748,8 +1748,8 @@ MagickExport Image *SpliceImage(const Image *image,
   if ((IsPixelInfoGray(&splice_image->background_color) == MagickFalse) &&
       (IsGrayColorspace(splice_image->colorspace) != MagickFalse))
     (void) SetImageColorspace(splice_image,sRGBColorspace,exception);
-  if ((splice_image->background_color.alpha_trait == BlendPixelTrait) &&
-      (splice_image->alpha_trait != BlendPixelTrait))
+  if ((splice_image->background_color.alpha_trait != UndefinedPixelTrait) &&
+      (splice_image->alpha_trait == UndefinedPixelTrait))
     (void) SetImageAlpha(splice_image,OpaqueAlpha,exception);
   (void) SetImageBackgroundColor(splice_image,exception);
   /*
index e877be8753e3f7cc3e549dd9affb5f933575e3e8..27b2a4b30e52b30d0f5c6b43d2532343567dee5f 100644 (file)
@@ -697,7 +697,7 @@ MagickPrivate MagickBooleanType XAnnotateImage(Display *display,
   (void) XParseGeometry(annotate_info->geometry,&x,&y,&width,&height);
   alpha_trait=image->alpha_trait;
   (void) CompositeImage(image,annotate_image,
-    annotate_image->alpha_trait == BlendPixelTrait ? OverCompositeOp :
+    annotate_image->alpha_trait != UndefinedPixelTrait ? OverCompositeOp :
     CopyCompositeOp,MagickTrue,(ssize_t) x,(ssize_t) y,exception);
   image->alpha_trait=alpha_trait;
   annotate_image=DestroyImage(annotate_image);
@@ -5728,7 +5728,7 @@ MagickPrivate MagickBooleanType XMakeImage(Display *display,
   window->ximage=ximage;
   matte_image=(XImage *) NULL;
   if ((window->shape != MagickFalse) && (window->image != (Image *) NULL))
-    if ((window->image->alpha_trait == BlendPixelTrait) &&
+    if ((window->image->alpha_trait != UndefinedPixelTrait) &&
         ((int) width <= XDisplayWidth(display,window->screen)) &&
         ((int) height <= XDisplayHeight(display,window->screen)))
       {
@@ -5914,7 +5914,7 @@ static void XMakeImageLSBFirst(const XResourceInfo *resource_info,
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
   canvas=image;
   if ((window->immutable == MagickFalse) &&
-      (image->storage_class == DirectClass) && (image->alpha_trait == BlendPixelTrait))
+      (image->storage_class == DirectClass) && (image->alpha_trait != UndefinedPixelTrait))
     {
       char
         size[MaxTextExtent];
@@ -6530,7 +6530,7 @@ static void XMakeImageMSBFirst(const XResourceInfo *resource_info,
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
   canvas=image;
   if ((window->immutable != MagickFalse) &&
-      (image->storage_class == DirectClass) && (image->alpha_trait == BlendPixelTrait))
+      (image->storage_class == DirectClass) && (image->alpha_trait != UndefinedPixelTrait))
     {
       char
         size[MaxTextExtent];
@@ -7514,7 +7514,7 @@ MagickPrivate void XMakeMagnifyImage(Display *display,XWindows *windows,
       (void) ConcatenateMagickString(tuple,",",MaxTextExtent);
       ConcatenateColorComponent(&pixel,BlackPixelChannel,X11Compliance,tuple);
     }
-  if (pixel.alpha_trait == BlendPixelTrait)
+  if (pixel.alpha_trait != UndefinedPixelTrait)
     {
       (void) ConcatenateMagickString(tuple,",",MaxTextExtent);
       ConcatenateColorComponent(&pixel,AlphaPixelChannel,X11Compliance,tuple);
@@ -7771,7 +7771,7 @@ MagickPrivate void XMakeStandardColormap(Display *display,
       number_colors=(unsigned int) (map_info->base_pixel+
         (map_info->red_max+1)*(map_info->green_max+1)*(map_info->blue_max+1));
       if ((map_info->red_max*map_info->green_max*map_info->blue_max) != 0)
-        if ((image->alpha_trait != BlendPixelTrait) &&
+        if ((image->alpha_trait == UndefinedPixelTrait) &&
             (resource_info->color_recovery == MagickFalse) &&
             (resource_info->quantize_info->dither_method != NoDitherMethod) &&
             (number_colors < MaxColormapSize))
index 4c48e430a904d3a718d3e2eebd13191b197b3d28..9a64b7ca12b25a14ce549aa07c085abc73801f7a 100644 (file)
@@ -1097,7 +1097,7 @@ WandExport MagickBooleanType CompareImagesCommand(ImageInfo *image_info,
                   (void) FormatLocaleFile(stderr,"    blue: %g (%g)\n",
                     QuantumRange*channel_distortion[BluePixelChannel],
                     channel_distortion[BluePixelChannel]);
-                  if (image->alpha_trait == BlendPixelTrait)
+                  if (image->alpha_trait != UndefinedPixelTrait)
                     (void) FormatLocaleFile(stderr,"    alpha: %g (%g)\n",
                       QuantumRange*channel_distortion[AlphaPixelChannel],
                       channel_distortion[AlphaPixelChannel]);
@@ -1117,7 +1117,7 @@ WandExport MagickBooleanType CompareImagesCommand(ImageInfo *image_info,
                   (void) FormatLocaleFile(stderr,"    black: %g (%g)\n",
                     QuantumRange*channel_distortion[BlackPixelChannel],
                     channel_distortion[BlackPixelChannel]);
-                  if (image->alpha_trait == BlendPixelTrait)
+                  if (image->alpha_trait != UndefinedPixelTrait)
                     (void) FormatLocaleFile(stderr,"    alpha: %g (%g)\n",
                       QuantumRange*channel_distortion[AlphaPixelChannel],
                       channel_distortion[AlphaPixelChannel]);
@@ -1128,7 +1128,7 @@ WandExport MagickBooleanType CompareImagesCommand(ImageInfo *image_info,
                   (void) FormatLocaleFile(stderr,"    gray: %g (%g)\n",
                     QuantumRange*channel_distortion[GrayPixelChannel],
                     channel_distortion[GrayPixelChannel]);
-                  if (image->alpha_trait == BlendPixelTrait)
+                  if (image->alpha_trait != UndefinedPixelTrait)
                     (void) FormatLocaleFile(stderr,"    alpha: %g (%g)\n",
                       QuantumRange*channel_distortion[AlphaPixelChannel],
                       channel_distortion[AlphaPixelChannel]);
@@ -1156,7 +1156,7 @@ WandExport MagickBooleanType CompareImagesCommand(ImageInfo *image_info,
                     channel_distortion[GreenPixelChannel]);
                   (void) FormatLocaleFile(stderr,"    blue: %g\n",
                     channel_distortion[BluePixelChannel]);
-                  if (image->alpha_trait == BlendPixelTrait)
+                  if (image->alpha_trait != UndefinedPixelTrait)
                     (void) FormatLocaleFile(stderr,"    alpha: %g\n",
                       channel_distortion[AlphaPixelChannel]);
                   break;
@@ -1171,7 +1171,7 @@ WandExport MagickBooleanType CompareImagesCommand(ImageInfo *image_info,
                     channel_distortion[YellowPixelChannel]);
                   (void) FormatLocaleFile(stderr,"    black: %g\n",
                     channel_distortion[BlackPixelChannel]);
-                  if (image->alpha_trait == BlendPixelTrait)
+                  if (image->alpha_trait != UndefinedPixelTrait)
                     (void) FormatLocaleFile(stderr,"    alpha: %g\n",
                       channel_distortion[AlphaPixelChannel]);
                   break;
@@ -1180,7 +1180,7 @@ WandExport MagickBooleanType CompareImagesCommand(ImageInfo *image_info,
                 {
                   (void) FormatLocaleFile(stderr,"    gray: %g\n",
                     channel_distortion[GrayPixelChannel]);
-                  if (image->alpha_trait == BlendPixelTrait)
+                  if (image->alpha_trait != UndefinedPixelTrait)
                     (void) FormatLocaleFile(stderr,"    alpha: %g\n",
                       channel_distortion[AlphaPixelChannel]);
                   break;
index 468678ea247aef3c89f7377e03677f3bcebd3c8f..46780e08a4e20e7876d7718d968c58346d9dc3f8 100644 (file)
@@ -9851,7 +9851,7 @@ WandExport MagickBooleanType MagickSetImageMatte(MagickWand *wand,
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   if (wand->images == (Image *) NULL)
     ThrowWandException(WandError,"ContainsNoImages",wand->name);
-  if ((wand->images->alpha_trait != BlendPixelTrait) && IsMagickTrue(matte))
+  if ((wand->images->alpha_trait == UndefinedPixelTrait) && IsMagickTrue(matte))
     (void) SetImageAlpha(wand->images,OpaqueAlpha,wand->exception);
   wand->images->alpha_trait=matte != MagickFalse ? BlendPixelTrait :
     UndefinedPixelTrait;
index 13b582a8a28eb799feb309b20b4e825f29aafbfa..ef6c6828cbd80a9ad8a0794d15a447a10022316e 100644 (file)
@@ -482,7 +482,7 @@ static Image *SparseColorOption(const Image *image,
       (image->colorspace == CMYKColorspace))
     number_colors++;
   if (((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0) &&
-      (image->alpha_trait == BlendPixelTrait))
+      (image->alpha_trait != UndefinedPixelTrait))
     number_colors++;
 
   /*
@@ -585,7 +585,7 @@ static Image *SparseColorOption(const Image *image,
             (image->colorspace == CMYKColorspace))
           sparse_arguments[x++] = QuantumScale*color.black;
         if (((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0) &&
-            (image->alpha_trait == BlendPixelTrait))
+            (image->alpha_trait != UndefinedPixelTrait))
           sparse_arguments[x++] = QuantumScale*color.alpha;
       }
       else {
@@ -625,7 +625,7 @@ static Image *SparseColorOption(const Image *image,
           token[0] = ','; /* used this token - get another */
         }
         if (((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0) &&
-            (image->alpha_trait == BlendPixelTrait))
+            (image->alpha_trait != UndefinedPixelTrait))
           {
           while ( token[0] == ',' ) GetMagickToken(p,&p,token);
           if ( token[0] == '\0' || isalpha((int)token[0]) || token[0] == '#' )
@@ -1114,7 +1114,7 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc,
                 break;
               for (x=0; x < (ssize_t) mask_image->columns; x++)
               {
-                if (mask_image->alpha_trait != BlendPixelTrait)
+                if (mask_image->alpha_trait == UndefinedPixelTrait)
                   SetPixelAlpha(mask_image,(Quantum)
                     GetPixelIntensity(mask_image,q),q);
                 SetPixelRed(mask_image,GetPixelAlpha(mask_image,q),q);
@@ -2527,7 +2527,7 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc,
                   Composite region.
                 */
                 (void) CompositeImage(region_image,*image,
-                   region_image->alpha_trait == BlendPixelTrait ?
+                   region_image->alpha_trait != UndefinedPixelTrait ?
                    CopyCompositeOp : OverCompositeOp,MagickTrue,
                    region_geometry.x,region_geometry.y,exception);
                 *image=DestroyImage(*image);
@@ -3280,7 +3280,7 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc,
       */
       (void) SyncImageSettings(mogrify_info,*image,exception);
       (void) CompositeImage(region_image,*image,
-         region_image->alpha_trait == BlendPixelTrait ? CopyCompositeOp :
+         region_image->alpha_trait != UndefinedPixelTrait ? CopyCompositeOp :
          OverCompositeOp,MagickTrue,region_geometry.x,region_geometry.y,
          exception);
       *image=DestroyImage(*image);
index ba8e3c3b437229b9fbe85227a36e4b2b8704ac1c..40be42a513db6a70dbb8f796f92fe17d408ce1a2 100644 (file)
@@ -219,7 +219,7 @@ static Image *SparseColorOption(const Image *image,
       (image->colorspace == CMYKColorspace))
     number_colors++;
   if (((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0) &&
-      image->alpha_trait == BlendPixelTrait)
+      image->alpha_trait != UndefinedPixelTrait)
     number_colors++;
 
   /*
@@ -298,7 +298,7 @@ static Image *SparseColorOption(const Image *image,
           (image->colorspace == CMYKColorspace))
         sparse_arguments[x++] = QuantumScale*color.black;
       if (((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0) &&
-          image->alpha_trait == BlendPixelTrait)
+          image->alpha_trait != UndefinedPixelTrait)
         sparse_arguments[x++] = QuantumScale*color.alpha;
     }
     else {
@@ -338,7 +338,7 @@ static Image *SparseColorOption(const Image *image,
         token[0] = ','; /* used this token - get another */
       }
       if (((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0) &&
-          image->alpha_trait == BlendPixelTrait)
+          image->alpha_trait != UndefinedPixelTrait)
         {
         while ( token[0] == ',' ) GetMagickToken(p,&p,token);
         if ( token[0] == '\0' || isalpha((int)token[0]) || token[0] == '#' )
@@ -2028,7 +2028,7 @@ static MagickBooleanType CLISimpleOperatorImage(MagickCLI *cli_wand,
               break;
             for (x=0; x < (ssize_t) mask_image->columns; x++)
             {
-              if (mask_image->alpha_trait != BlendPixelTrait)
+              if (mask_image->alpha_trait == UndefinedPixelTrait)
                 SetPixelAlpha(mask_image,(Quantum)
                   GetPixelIntensity(mask_image,q),q);
               SetPixelGray(mask_image,GetPixelAlpha(mask_image,q),q);
index 7a1e520ed90fd3bd891505576fa6d1e2243f1401..99eb184ee3d401eb7480622462228e176f028537 100644 (file)
@@ -754,7 +754,7 @@ WandExport char *PixelGetColorAsNormalizedString(const PixelWand *wand)
   if (wand->pixel.colorspace == CMYKColorspace)
     (void) FormatLocaleString(color+strlen(color),MaxTextExtent,",%g",
       (double) (QuantumScale*wand->pixel.black));
-  if (wand->pixel.alpha_trait == BlendPixelTrait)
+  if (wand->pixel.alpha_trait != UndefinedPixelTrait)
     (void) FormatLocaleString(color+strlen(color),MaxTextExtent,",%g",
       (double) (QuantumScale*wand->pixel.alpha));
   return(ConstantString(color));
index c85e9a6055609f69036c7a4ad936452e906ef9f3..777fb31dbb615577f3525d3380a1bf58098aa2ab 100644 (file)
@@ -4202,7 +4202,7 @@ Features(ref,...)
         ChannelFeatures(BlueChannel,i);
         if (image->colorspace == CMYKColorspace)
           ChannelFeatures(BlackChannel,i);
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           ChannelFeatures(AlphaChannel,i);
       }
       channel_features=(ChannelFeatures *)
@@ -5324,7 +5324,7 @@ Get(ref,...)
           if (LocaleCompare(attribute,"matte") == 0)
             {
               if (image != (Image *) NULL)
-                s=newSViv((ssize_t) image->alpha_trait == BlendPixelTrait ?
+                s=newSViv((ssize_t) image->alpha_trait != UndefinedPixelTrait ?
                   1 : 0);
               PUSHs(s ? sv_2mortal(s) : &sv_undef);
               continue;
@@ -6640,12 +6640,12 @@ GetPixels(ref,...)
         goto PerlException;
       }
     map="RGB";
-    if (image->alpha_trait == BlendPixelTrait)
+    if (image->alpha_trait != UndefinedPixelTrait)
       map="RGBA";
     if (image->colorspace == CMYKColorspace)
       {
         map="CMYK";
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           map="CMYKA";
       }
     normalize=MagickFalse;
@@ -8154,8 +8154,8 @@ Mogrify(ref,...)
             {
               QueryColorCompliance(argument_list[1].string_reference,
                 AllCompliance,&image->background_color,exception);
-              if ((image->background_color.alpha_trait == BlendPixelTrait) &&
-                  (image->alpha_trait != BlendPixelTrait))
+              if ((image->background_color.alpha_trait != UndefinedPixelTrait) &&
+                  (image->alpha_trait == UndefinedPixelTrait))
                 (void) SetImageAlpha(image,OpaqueAlpha,exception);
             }
           image=RotateImage(image,argument_list[0].real_reference,exception);
@@ -8619,7 +8619,7 @@ Mogrify(ref,...)
                   opacity=(Quantum) StringToDoubleInterval(
                     argument_list[6].string_reference,(double) QuantumRange+
                     1.0);
-                  if (composite_image->alpha_trait == BlendPixelTrait)
+                  if (composite_image->alpha_trait != UndefinedPixelTrait)
                     (void) SetImageAlpha(composite_image,OpaqueAlpha,exception);
                   composite_view=AcquireAuthenticCacheView(composite_image,exception);
                   for (y=0; y < (ssize_t) composite_image->rows ; y++)
@@ -9112,7 +9112,7 @@ Mogrify(ref,...)
             geometry.x=argument_list[1].integer_reference;
           if (attribute_flag[2] != 0)
             geometry.y=argument_list[2].integer_reference;
-          if (image->alpha_trait != BlendPixelTrait)
+          if (image->alpha_trait == UndefinedPixelTrait)
             (void) SetImageAlpha(image,OpaqueAlpha,exception);
           (void) GetOneVirtualPixelInfo(image,UndefinedVirtualPixelMethod,
             geometry.x,geometry.y,&target,exception);
@@ -12286,7 +12286,7 @@ QueryColor(ref,...)
       PUSHs(sv_2mortal(newSViv((size_t) floor(color.blue+0.5))));
       if (color.colorspace == CMYKColorspace)
         PUSHs(sv_2mortal(newSViv((size_t) floor(color.black+0.5))));
-      if (color.alpha_trait == BlendPixelTrait)
+      if (color.alpha_trait != UndefinedPixelTrait)
         PUSHs(sv_2mortal(newSViv((size_t) floor(color.alpha+0.5))));
     }
 
@@ -14280,7 +14280,7 @@ Statistics(ref,...)
       ChannelStatistics(BlueChannel);
       if (image->colorspace == CMYKColorspace)
         ChannelStatistics(BlackChannel);
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         ChannelStatistics(AlphaChannel);
       channel_statistics=(ChannelStatistics *)
         RelinquishMagickMemory(channel_statistics);
index 60f531f98181e0db793415a22218b4108beb4445..d74ab53b6cd8210346ab66e7dd40846aa076ac9c 100644 (file)
@@ -4202,7 +4202,7 @@ Features(ref,...)
         ChannelFeatures(BlueChannel,i);
         if (image->colorspace == CMYKColorspace)
           ChannelFeatures(BlackChannel,i);
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           ChannelFeatures(AlphaChannel,i);
       }
       channel_features=(ChannelFeatures *)
@@ -5324,7 +5324,7 @@ Get(ref,...)
           if (LocaleCompare(attribute,"matte") == 0)
             {
               if (image != (Image *) NULL)
-                s=newSViv((ssize_t) image->alpha_trait == BlendPixelTrait ?
+                s=newSViv((ssize_t) image->alpha_trait != UndefinedPixelTrait ?
                   1 : 0);
               PUSHs(s ? sv_2mortal(s) : &sv_undef);
               continue;
@@ -6640,12 +6640,12 @@ GetPixels(ref,...)
         goto PerlException;
       }
     map="RGB";
-    if (image->alpha_trait == BlendPixelTrait)
+    if (image->alpha_trait != UndefinedPixelTrait)
       map="RGBA";
     if (image->colorspace == CMYKColorspace)
       {
         map="CMYK";
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           map="CMYKA";
       }
     normalize=MagickFalse;
@@ -8154,8 +8154,8 @@ Mogrify(ref,...)
             {
               QueryColorCompliance(argument_list[1].string_reference,
                 AllCompliance,&image->background_color,exception);
-              if ((image->background_color.alpha_trait == BlendPixelTrait) &&
-                  (image->alpha_trait != BlendPixelTrait))
+              if ((image->background_color.alpha_trait != UndefinedPixelTrait) &&
+                  (image->alpha_trait == UndefinedPixelTrait))
                 (void) SetImageAlpha(image,OpaqueAlpha,exception);
             }
           image=RotateImage(image,argument_list[0].real_reference,exception);
@@ -8619,7 +8619,7 @@ Mogrify(ref,...)
                   opacity=(Quantum) StringToDoubleInterval(
                     argument_list[6].string_reference,(double) QuantumRange+
                     1.0);
-                  if (composite_image->alpha_trait == BlendPixelTrait)
+                  if (composite_image->alpha_trait != UndefinedPixelTrait)
                     (void) SetImageAlpha(composite_image,OpaqueAlpha,exception);
                   composite_view=AcquireAuthenticCacheView(composite_image,exception);
                   for (y=0; y < (ssize_t) composite_image->rows ; y++)
@@ -9112,7 +9112,7 @@ Mogrify(ref,...)
             geometry.x=argument_list[1].integer_reference;
           if (attribute_flag[2] != 0)
             geometry.y=argument_list[2].integer_reference;
-          if (image->alpha_trait != BlendPixelTrait)
+          if (image->alpha_trait == UndefinedPixelTrait)
             (void) SetImageAlpha(image,OpaqueAlpha,exception);
           (void) GetOneVirtualPixelInfo(image,UndefinedVirtualPixelMethod,
             geometry.x,geometry.y,&target,exception);
@@ -12284,7 +12284,7 @@ QueryColor(ref,...)
       PUSHs(sv_2mortal(newSViv((size_t) floor(color.blue+0.5))));
       if (color.colorspace == CMYKColorspace)
         PUSHs(sv_2mortal(newSViv((size_t) floor(color.black+0.5))));
-      if (color.alpha_trait == BlendPixelTrait)
+      if (color.alpha_trait != UndefinedPixelTrait)
         PUSHs(sv_2mortal(newSViv((size_t) floor(color.alpha+0.5))));
     }
 
@@ -14278,7 +14278,7 @@ Statistics(ref,...)
       ChannelStatistics(BlueChannel);
       if (image->colorspace == CMYKColorspace)
         ChannelStatistics(BlackChannel);
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         ChannelStatistics(AlphaChannel);
       channel_statistics=(ChannelStatistics *)
         RelinquishMagickMemory(channel_statistics);
index 53d3de419a1d6c46cebcfe15c09adfe8b2698266..b761fc08473e0aa5085e71a0884e1f62239fb543 100644 (file)
@@ -388,7 +388,7 @@ static MagickBooleanType WriteAAIImage(const ImageInfo *image_info,Image *image,
         *q++=ScaleQuantumToChar(GetPixelBlue(image,p));
         *q++=ScaleQuantumToChar(GetPixelGreen(image,p));
         *q++=ScaleQuantumToChar(GetPixelRed(image,p));
-        *q=ScaleQuantumToChar((Quantum) (image->alpha_trait == BlendPixelTrait ?
+        *q=ScaleQuantumToChar((Quantum) (image->alpha_trait != UndefinedPixelTrait ?
           GetPixelAlpha(image,p) : OpaqueAlpha));
         if (*q == 255)
           *q=254;
index ce0b81c0cba1f8e8b99ea6a2a87b1af3deb8c2a8..4501f3f06f44f7e5da27cb43a1af4e732fbc3cca 100644 (file)
@@ -251,7 +251,7 @@ static Image *ReadBGRImage(const ImageInfo *image_info,
                 SetPixelGreen(image,GetPixelGreen(canvas_image,p),q);
                 SetPixelBlue(image,GetPixelBlue(canvas_image,p),q);
                 SetPixelAlpha(image,OpaqueAlpha,q);
-                if (image->alpha_trait == BlendPixelTrait)
+                if (image->alpha_trait != UndefinedPixelTrait)
                   SetPixelAlpha(image,GetPixelAlpha(canvas_image,p),q);
                 p+=GetPixelChannels(canvas_image);
                 q+=GetPixelChannels(image);
@@ -306,7 +306,7 @@ static Image *ReadBGRImage(const ImageInfo *image_info,
                 "UnexpectedEndOfFile",image->filename);
               break;
             }
-          for (i=0; i < (ssize_t) (image->alpha_trait == BlendPixelTrait ? 4 : 3); i++)
+          for (i=0; i < (ssize_t) (image->alpha_trait != UndefinedPixelTrait ? 4 : 3); i++)
           {
             quantum_type=quantum_types[i];
             q=GetAuthenticPixels(canvas_image,0,0,canvas_image->columns,1,
@@ -549,7 +549,7 @@ static Image *ReadBGRImage(const ImageInfo *image_info,
             if (status == MagickFalse)
               break;
           }
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           {
             for (y=0; y < (ssize_t) image->extract_info.height; y++)
             {
@@ -833,7 +833,7 @@ static Image *ReadBGRImage(const ImageInfo *image_info,
             if (status == MagickFalse)
               break;
           }
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           {
             (void) CloseBlob(image);
             AppendImageFormat("A",image->filename);
@@ -1108,7 +1108,7 @@ static MagickBooleanType WriteBGRImage(const ImageInfo *image_info,Image *image,
     */
     (void) TransformImageColorspace(image,sRGBColorspace,exception);
     if ((LocaleCompare(image_info->magick,"BGRA") == 0) &&
-        (image->alpha_trait != BlendPixelTrait))
+        (image->alpha_trait == UndefinedPixelTrait))
       (void) SetImageAlphaChannel(image,OpaqueAlphaChannel,exception);
     quantum_info=AcquireQuantumInfo(image_info,image);
     if (quantum_info == (QuantumInfo *) NULL)
index 069f9c4763fa073e0efb07c088de4a8f5d6da087..7993a4bbe401a12178c1f2618c52ba46edaf54b1 100644 (file)
@@ -968,7 +968,7 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception)
     */
     if (bmp_info.compression == BI_RGB)
       {
-        bmp_info.alpha_mask=image->alpha_trait == BlendPixelTrait ?
+        bmp_info.alpha_mask=image->alpha_trait != UndefinedPixelTrait ?
           0xff000000U : 0U;
         bmp_info.red_mask=0x00ff0000U;
         bmp_info.green_mask=0x0000ff00U;
@@ -1194,7 +1194,7 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception)
             SetPixelGreen(image,ScaleShortToQuantum((unsigned short) green),q);
             SetPixelBlue(image,ScaleShortToQuantum((unsigned short) blue),q);
             SetPixelAlpha(image,OpaqueAlpha,q);
-            if (image->alpha_trait == BlendPixelTrait)
+            if (image->alpha_trait != UndefinedPixelTrait)
               SetPixelAlpha(image,ScaleShortToQuantum((unsigned short)
                 opacity),q);
             q+=GetPixelChannels(image);
@@ -1289,7 +1289,7 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception)
             SetPixelGreen(image,ScaleShortToQuantum((unsigned short) green),q);
             SetPixelBlue(image,ScaleShortToQuantum((unsigned short) blue),q);
             SetPixelAlpha(image,OpaqueAlpha,q);
-            if (image->alpha_trait == BlendPixelTrait)
+            if (image->alpha_trait != UndefinedPixelTrait)
               SetPixelAlpha(image,ScaleShortToQuantum((unsigned short)
                 opacity),q);
             q+=GetPixelChannels(image);
@@ -1594,7 +1594,7 @@ static MagickBooleanType WriteBMPImage(const ImageInfo *image_info,Image *image,
         if (image_info->compression == RLECompression)
           bmp_info.bits_per_pixel=8;
         bmp_info.number_colors=1U << bmp_info.bits_per_pixel;
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           (void) SetImageStorageClass(image,DirectClass,exception);
         else
           if ((size_t) bmp_info.number_colors < image->colors)
@@ -1617,9 +1617,9 @@ static MagickBooleanType WriteBMPImage(const ImageInfo *image_info,Image *image,
         */
         bmp_info.number_colors=0;
         bmp_info.bits_per_pixel=(unsigned short)
-          ((type > 3) && (image->alpha_trait == BlendPixelTrait) ? 32 : 24);
+          ((type > 3) && (image->alpha_trait != UndefinedPixelTrait) ? 32 : 24);
         bmp_info.compression=(unsigned int) ((type > 3) &&
-          (image->alpha_trait == BlendPixelTrait) ?  BI_BITFIELDS : BI_RGB);
+          (image->alpha_trait != UndefinedPixelTrait) ?  BI_BITFIELDS : BI_RGB);
       }
     bytes_per_line=4*((image->columns*bmp_info.bits_per_pixel+31)/32);
     bmp_info.ba_offset=0;
@@ -1630,7 +1630,7 @@ static MagickBooleanType WriteBMPImage(const ImageInfo *image_info,Image *image,
     if (type == 2)
       bmp_info.size=12;
     else
-      if ((type == 3) || ((image->alpha_trait != BlendPixelTrait) &&
+      if ((type == 3) || ((image->alpha_trait == UndefinedPixelTrait) &&
           (have_color_info == MagickFalse)))
         {
           type=3;
@@ -1918,7 +1918,7 @@ static MagickBooleanType WriteBMPImage(const ImageInfo *image_info,Image *image,
             "   Storage class=PseudoClass");
         (void) LogMagickEvent(CoderEvent,GetMagickModule(),
           "   Image depth=%.20g",(double) image->depth);
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           (void) LogMagickEvent(CoderEvent,GetMagickModule(),
             "   Matte=True");
         else
@@ -1992,7 +1992,7 @@ static MagickBooleanType WriteBMPImage(const ImageInfo *image_info,Image *image,
         (void) WriteBlobLSBLong(image,bmp_info.number_colors);
         (void) WriteBlobLSBLong(image,bmp_info.colors_important);
       }
-    if ((type > 3) && ((image->alpha_trait == BlendPixelTrait) ||
+    if ((type > 3) && ((image->alpha_trait != UndefinedPixelTrait) ||
         (have_color_info != MagickFalse)))
       {
         /*
index e06c4d404931152433572693e93ca82eed6bfadc..32560873639e1e720d11698b7e2633ad61fafb2b 100644 (file)
@@ -253,7 +253,7 @@ static Image *ReadCMYKImage(const ImageInfo *image_info,
                 SetPixelBlue(image,GetPixelBlue(canvas_image,p),q);
                 SetPixelBlack(image,GetPixelBlack(canvas_image,p),q);
                 SetPixelAlpha(image,OpaqueAlpha,q);
-                if (image->alpha_trait == BlendPixelTrait)
+                if (image->alpha_trait != UndefinedPixelTrait)
                   SetPixelAlpha(image,GetPixelAlpha(canvas_image,p),q);
                 p+=GetPixelChannels(canvas_image);
                 q+=GetPixelChannels(image);
@@ -309,7 +309,7 @@ static Image *ReadCMYKImage(const ImageInfo *image_info,
                 "UnexpectedEndOfFile",image->filename);
               break;
             }
-          for (i=0; i < (image->alpha_trait == BlendPixelTrait ? 5 : 4); i++)
+          for (i=0; i < (image->alpha_trait != UndefinedPixelTrait ? 5 : 4); i++)
           {
             quantum_type=quantum_types[i];
             q=GetAuthenticPixels(canvas_image,0,0,canvas_image->columns,1,
@@ -598,7 +598,7 @@ static Image *ReadCMYKImage(const ImageInfo *image_info,
             if (status == MagickFalse)
               break;
           }
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           {
             for (y=0; y < (ssize_t) image->extract_info.height; y++)
             {
@@ -953,7 +953,7 @@ static Image *ReadCMYKImage(const ImageInfo *image_info,
             if (status == MagickFalse)
               break;
           }
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           {
             (void) CloseBlob(image);
             AppendImageFormat("A",image->filename);
@@ -1225,7 +1225,7 @@ static MagickBooleanType WriteCMYKImage(const ImageInfo *image_info,
     if (LocaleCompare(image_info->magick,"CMYKA") == 0)
       {
         quantum_type=CMYKAQuantum;
-        if (image->alpha_trait != BlendPixelTrait)
+        if (image->alpha_trait == UndefinedPixelTrait)
           (void) SetImageAlphaChannel(image,OpaqueAlphaChannel,exception);
       }
     quantum_info=AcquireQuantumInfo(image_info,image);
index 7109064a1fdae39842a3704e3e96493034f981c3..4e8ecaf6b55b99e23078020d1461b0cdf14131b7 100644 (file)
@@ -1963,7 +1963,7 @@ static MagickBooleanType ReadDXT1(Image *image, DDSInfo *dds_info,
               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->alpha_trait != BlendPixelTrait))
+              if (colors.a[code] && (image->alpha_trait == UndefinedPixelTrait))
                 image->alpha_trait=BlendPixelTrait;  /* Correct matte */
               q+=GetPixelChannels(image);
             }
@@ -2649,7 +2649,7 @@ static MagickBooleanType WriteDDSImage(const ImageInfo *image_info,
   pixelFormat=DDPF_FOURCC;
   compression=FOURCC_DXT5;
 
-  if (image->alpha_trait != BlendPixelTrait)
+  if (image->alpha_trait == UndefinedPixelTrait)
     compression=FOURCC_DXT1;
 
   if (LocaleCompare(image_info->magick,"dxt1") == 0)
@@ -2742,7 +2742,7 @@ static void WriteDDSInfo(Image *image, const size_t pixelFormat,
       caps=caps | (unsigned int) (DDSCAPS_MIPMAP | DDSCAPS_COMPLEX);
     }
 
-  if (format != DDPF_FOURCC && image->alpha_trait == BlendPixelTrait)
+  if (format != DDPF_FOURCC && image->alpha_trait != UndefinedPixelTrait)
     format=format | DDPF_ALPHAPIXELS;
 
   (void) WriteBlob(image,4,(unsigned char *) "DDS ");
@@ -2776,7 +2776,7 @@ static void WriteDDSInfo(Image *image, const size_t pixelFormat,
   else
     {
       (void) WriteBlobLSBLong(image,0x00);
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         {
           (void) WriteBlobLSBLong(image,32);
           (void) WriteBlobLSBLong(image,0xff0000);
@@ -3096,7 +3096,7 @@ static void WriteUncompressed(Image *image, ExceptionInfo *exception)
       (void) WriteBlobByte(image,ScaleQuantumToChar(GetPixelBlue(image,p)));
       (void) WriteBlobByte(image,ScaleQuantumToChar(GetPixelGreen(image,p)));
       (void) WriteBlobByte(image,ScaleQuantumToChar(GetPixelRed(image,p)));
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         (void) WriteBlobByte(image,ScaleQuantumToChar(GetPixelAlpha(image,p)));
       p+=GetPixelChannels(image);
     }
index 979cc2fc393d48166bdeb66579df5537c94d5ce2..a897c474465f155d877c72d632690ff68a25e0d4 100644 (file)
@@ -208,7 +208,7 @@ static MagickBooleanType WriteDEBUGImage(const ImageInfo *image_info,
       MagickColorspaceOptions,(ssize_t) image->colorspace),MaxTextExtent);
     LocaleLower(colorspace);
     image->depth=GetImageQuantumDepth(image,MagickTrue);
-    if (image->alpha_trait == BlendPixelTrait)
+    if (image->alpha_trait != UndefinedPixelTrait)
       (void) ConcatenateMagickString(colorspace,"a",MaxTextExtent);
     (void) FormatLocaleString(buffer,MaxTextExtent,
       "# ImageMagick pixel debugging: %.20g,%.20g,%.20g,%s\n",(double)
@@ -238,7 +238,7 @@ static MagickBooleanType WriteDEBUGImage(const ImageInfo *image_info,
               (double) pixel.black);
             (void) ConcatenateMagickString(tuple,black,MaxTextExtent);
           }
-        if (pixel.alpha_trait == BlendPixelTrait)
+        if (pixel.alpha_trait != UndefinedPixelTrait)
           {
             char
               alpha[MaxTextExtent];
index cd310498f2af1de60a260454a969c52b31cf7030..339bf7c43ba702c3d5dc5fdee9897762c6fd50f6 100644 (file)
@@ -833,7 +833,7 @@ static Image *ReadDIBImage(const ImageInfo *image_info,ExceptionInfo *exception)
           SetPixelBlue(image,ScaleCharToQuantum(*p++),q);
           SetPixelGreen(image,ScaleCharToQuantum(*p++),q);
           SetPixelRed(image,ScaleCharToQuantum(*p++),q);
-          if (image->alpha_trait == BlendPixelTrait)
+          if (image->alpha_trait != UndefinedPixelTrait)
             SetPixelAlpha(image,ScaleCharToQuantum(*p++),q);
           q+=GetPixelChannels(image);
         }
@@ -1193,7 +1193,7 @@ static MagickBooleanType WriteDIBImage(const ImageInfo *image_info,Image *image,
           *q++=ScaleQuantumToChar(GetPixelBlue(image,p));
           *q++=ScaleQuantumToChar(GetPixelGreen(image,p));
           *q++=ScaleQuantumToChar(GetPixelRed(image,p));
-          if (image->alpha_trait == BlendPixelTrait)
+          if (image->alpha_trait != UndefinedPixelTrait)
             *q++=ScaleQuantumToChar(GetPixelAlpha(image,p));
           p+=GetPixelChannels(image);
         }
index 8a77f335e027671cd8d00eebbec5f55bd947ef7a..abe8300f760557eb7c225b2678f3788b842974f4 100644 (file)
@@ -1611,17 +1611,17 @@ static MagickBooleanType WriteDPXImage(const ImageInfo *image_info,Image *image,
         case YCbCrColorspace:
         {
           dpx.image.image_element[i].descriptor=CbYCr444ComponentType;
-          if (image->alpha_trait == BlendPixelTrait)
+          if (image->alpha_trait != UndefinedPixelTrait)
             dpx.image.image_element[i].descriptor=CbYCrA4444ComponentType;
           break;
         }
         default:
         {
           dpx.image.image_element[i].descriptor=RGBComponentType;
-          if (image->alpha_trait == BlendPixelTrait)
+          if (image->alpha_trait != UndefinedPixelTrait)
             dpx.image.image_element[i].descriptor=RGBAComponentType;
           if ((image_info->type != TrueColorType) &&
-              (image->alpha_trait != BlendPixelTrait) &&
+              (image->alpha_trait == UndefinedPixelTrait) &&
               (IsImageGray(image,exception) != MagickFalse))
             dpx.image.image_element[i].descriptor=LumaComponentType;
           break;
@@ -1941,20 +1941,20 @@ static MagickBooleanType WriteDPXImage(const ImageInfo *image_info,Image *image,
   SetQuantumPack(quantum_info,dpx.image.image_element[0].packing == 0 ?
     MagickTrue : MagickFalse);
   quantum_type=RGBQuantum;
-  if (image->alpha_trait == BlendPixelTrait)
+  if (image->alpha_trait != UndefinedPixelTrait)
     quantum_type=RGBAQuantum;
   if (image->colorspace == YCbCrColorspace)
     {
       quantum_type=CbYCrQuantum;
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         quantum_type=CbYCrAQuantum;
       if ((horizontal_factor == 2) || (vertical_factor == 2))
         quantum_type=CbYCrYQuantum;
     }
-  extent=GetBytesPerRow(image->columns,image->alpha_trait == BlendPixelTrait ?
+  extent=GetBytesPerRow(image->columns,image->alpha_trait != UndefinedPixelTrait ?
     4UL : 3UL,image->depth,MagickTrue);
   if ((image_info->type != TrueColorType) &&
-      (image->alpha_trait != BlendPixelTrait) &&
+      (image->alpha_trait == UndefinedPixelTrait) &&
       (IsImageGray(image,exception) != MagickFalse))
     {
       quantum_type=GrayQuantum;
index e7ac4f48d94fb94f80a7db837f8f668100aa4009..56e26d3abb73cfdf79457b8da2c383db73de9995 100644 (file)
@@ -457,7 +457,7 @@ static MagickBooleanType WriteEXRImage(const ImageInfo *image_info,Image *image,
       scanline[x].g=half_quantum;
       ImfFloatToHalf(QuantumScale*GetPixelBlue(image,p),&half_quantum);
       scanline[x].b=half_quantum;
-      if (image->alpha_trait != BlendPixelTrait)
+      if (image->alpha_trait == UndefinedPixelTrait)
         ImfFloatToHalf(1.0,&half_quantum);
       else
         ImfFloatToHalf(QuantumScale*GetPixelAlpha(image,p),&half_quantum);
index e3b25507c5a897f2c2c1d75fee6a062d6bc75b99..e9c879573699f52a3a3b29cbb997c04736ca884f 100644 (file)
@@ -439,7 +439,7 @@ static Image *ReadFPXImage(const ImageInfo *image_info,ExceptionInfo *exception)
           SetPixelBlue(image,index,q);
         }
       SetPixelAlpha(image,OpaqueAlpha,q);
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         SetPixelAlpha(image,ScaleCharToQuantum(*a),q);
       q+=GetPixelChannels(image);
       r+=red_component->columnStride;
@@ -831,7 +831,7 @@ static MagickBooleanType WriteFPXImage(const ImageInfo *image_info,Image *image,
   tile_width=64;
   tile_height=64;
   colorspace.numberOfComponents=3;
-  if (image->alpha_trait == BlendPixelTrait)
+  if (image->alpha_trait != UndefinedPixelTrait)
     colorspace.numberOfComponents=4;
   if ((image_info->type != TrueColorType) &&
       (IsImageGray(image,exception) != MagickFalse))
@@ -952,7 +952,7 @@ static MagickBooleanType WriteFPXImage(const ImageInfo *image_info,Image *image,
     Write image pixelss.
   */
   quantum_type=RGBQuantum;
-  if (image->alpha_trait == BlendPixelTrait)
+  if (image->alpha_trait != UndefinedPixelTrait)
     quantum_type=RGBAQuantum;
   if (fpx_info.numberOfComponents == 1)
     quantum_type=GrayQuantum;
index 8773d9071c5daaf5c35eb6e3e04b3247ed6a89d1..34c6529ee758bb36adf68c9396ebd05aa1a89af9 100644 (file)
@@ -169,8 +169,8 @@ static Image *ReadGRADIENTImage(const ImageInfo *image_info,
       image=DestroyImageList(image);
       return((Image *) NULL);
     }
-  if ((start_color.alpha_trait != BlendPixelTrait) &&
-      (stop_color.alpha_trait != BlendPixelTrait))
+  if ((start_color.alpha_trait == UndefinedPixelTrait) &&
+      (stop_color.alpha_trait == UndefinedPixelTrait))
     (void) SetImageAlphaChannel(image,DeactivateAlphaChannel,exception);
   return(GetFirstImageInList(image));
 }
index 2423409ececbd8f30a4fd997b03b03df5155ca7f..9485ede5792c568eb68e3cf1668cf874bcca9068 100644 (file)
@@ -1220,7 +1220,7 @@ static MagickBooleanType WriteICONImage(const ImageInfo *image_info,
                 *q++=ScaleQuantumToChar(GetPixelBlue(next,p));
                 *q++=ScaleQuantumToChar(GetPixelGreen(next,p));
                 *q++=ScaleQuantumToChar(GetPixelRed(next,p));
-                if (next->alpha_trait != BlendPixelTrait)
+                if (next->alpha_trait == UndefinedPixelTrait)
                   *q++=ScaleQuantumToChar(QuantumRange);
                 else
                   *q++=ScaleQuantumToChar(GetPixelAlpha(next,p));
@@ -1314,7 +1314,7 @@ static MagickBooleanType WriteICONImage(const ImageInfo *image_info,
           for (x=0; x < (ssize_t) next->columns; x++)
           {
             byte<<=1;
-            if ((next->alpha_trait == BlendPixelTrait) &&
+            if ((next->alpha_trait != UndefinedPixelTrait) &&
                 (GetPixelAlpha(next,p) == (Quantum) TransparentAlpha))
               byte|=0x01;
             bit++;
index 1d94bc246b8869276ab8b594243d1b53eac9e1e3..c9cab4bc92b95a76055e988dc68473b0a1f934b0 100644 (file)
@@ -934,7 +934,7 @@ static MagickBooleanType WriteJP2Image(const ImageInfo *image_info,Image *image,
           channels=1;
           jp2_colorspace=OPJ_CLRSPC_GRAY;
         }
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         channels++;
     }
   parameters.tcp_mct=channels == 3 ? 1 : 0;
index 7984205c6db76339f2285ec6907428fd982707af..593c3533f978cc0f72e39f56f763013408444905 100644 (file)
@@ -653,7 +653,7 @@ static MagickBooleanType EncodeImageAttributes(Image *image,FILE *file,
           break;
         }
       }
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         (void) PrintChannelLocations(file,image,AlphaPixelChannel,"Alpha",
           type,max_locations,channel_statistics);
       channel_statistics=(ChannelStatistics *) RelinquishMagickMemory(
@@ -736,7 +736,7 @@ static MagickBooleanType EncodeImageAttributes(Image *image,FILE *file,
           break;
         }
       }
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         (void) FormatLocaleFile(file,"    alpha: %.20g-bit\n",(double)
           channel_statistics[AlphaPixelChannel].depth);
       scale=1;
@@ -781,7 +781,7 @@ static MagickBooleanType EncodeImageAttributes(Image *image,FILE *file,
           break;
         }
       }
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         (void) PrintChannelStatistics(file,AlphaPixelChannel,"Alpha",1.0/
           scale,channel_statistics);
       if (colorspace != GRAYColorspace)
@@ -828,7 +828,7 @@ static MagickBooleanType EncodeImageAttributes(Image *image,FILE *file,
           break;
         }
       }
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         (void) PrintChannelMoments(file,AlphaPixelChannel,"Alpha",
           channel_moments);
       channel_moments=(ChannelMoments *) RelinquishMagickMemory(
@@ -837,7 +837,7 @@ static MagickBooleanType EncodeImageAttributes(Image *image,FILE *file,
   if (channel_phash != (ChannelPerceptualHash *) NULL)
     {
       (void) FormatLocaleFile(file,"    \"channelPerceptualHash\": {\n");
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         (void) PrintChannelPerceptualHash(file,AlphaChannel,"alphaAlpha",
           MagickTrue,channel_phash);
       (void) PrintChannelPerceptualHash(file,RedChannel,"redHue",MagickTrue,
@@ -886,7 +886,7 @@ static MagickBooleanType EncodeImageAttributes(Image *image,FILE *file,
           break;
         }
       }
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         (void) PrintChannelFeatures(file,AlphaPixelChannel,"Alpha",
           channel_features);
       channel_features=(ChannelFeatures *) RelinquishMagickMemory(
@@ -898,7 +898,7 @@ static MagickBooleanType EncodeImageAttributes(Image *image,FILE *file,
         (void) FormatLocaleFile(file,"  Total ink density: %.0f%%\n",100.0*
           GetImageTotalInkDensity(image,exception)/(double) QuantumRange);
       x=0;
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         {
           register const Quantum
             *p;
@@ -974,7 +974,7 @@ static MagickBooleanType EncodeImageAttributes(Image *image,FILE *file,
                 ConcatenateColorComponent(&pixel,BlackPixelChannel,
                   X11Compliance,tuple);
               }
-            if (pixel.alpha_trait == BlendPixelTrait)
+            if (pixel.alpha_trait != UndefinedPixelTrait)
               {
                 (void) ConcatenateMagickString(tuple,",",MaxTextExtent);
                 ConcatenateColorComponent(&pixel,AlphaPixelChannel,
index f0e2e186f69b8a6a98ccc60acc1a10621fd5da1a..edfc84779c3d582b381a85bc816393f419afa947 100644 (file)
@@ -175,7 +175,7 @@ static MagickBooleanType WriteMATTEImage(const ImageInfo *image_info,
   ssize_t
     y;
 
-  if (image->alpha_trait != BlendPixelTrait)
+  if (image->alpha_trait == UndefinedPixelTrait)
     ThrowWriterException(CoderError,"ImageDoesNotHaveAnAlphaChannel");
   matte_image=CloneImage(image,image->columns,image->rows,MagickTrue,exception);
   if (matte_image == (Image *) NULL)
index 61e43211656e291d0ed59d87387a183e79f1acc4..020d7ce3580aed7b00f0dd1089673a85aa68879e 100644 (file)
@@ -243,7 +243,7 @@ static void PushRunlengthPacket(Image *image,const unsigned char *pixels,
           unsigned char
             quantum;
 
-          if (image->alpha_trait == BlendPixelTrait)
+          if (image->alpha_trait != UndefinedPixelTrait)
             {
               p=PushCharPixel(p,&quantum);
               pixel->alpha=ScaleCharToQuantum(quantum);
@@ -255,7 +255,7 @@ static void PushRunlengthPacket(Image *image,const unsigned char *pixels,
           unsigned short
             quantum;
 
-          if (image->alpha_trait == BlendPixelTrait)
+          if (image->alpha_trait != UndefinedPixelTrait)
             {
               p=PushShortPixel(MSBEndian,p,&quantum);
               pixel->alpha=(Quantum) (quantum >> (image->depth-
@@ -268,7 +268,7 @@ static void PushRunlengthPacket(Image *image,const unsigned char *pixels,
           unsigned int
             quantum;
 
-          if (image->alpha_trait == BlendPixelTrait)
+          if (image->alpha_trait != UndefinedPixelTrait)
             {
               p=PushLongPixel(MSBEndian,p,&quantum);
               pixel->alpha=(Quantum) (quantum >> (image->depth-
@@ -306,7 +306,7 @@ static void PushRunlengthPacket(Image *image,const unsigned char *pixels,
           p=PushCharPixel(p,&quantum);
           pixel->black=ScaleCharToQuantum(quantum);
         }
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         {
           p=PushCharPixel(p,&quantum);
           pixel->alpha=ScaleCharToQuantum(quantum);
@@ -334,7 +334,7 @@ static void PushRunlengthPacket(Image *image,const unsigned char *pixels,
           p=PushShortPixel(MSBEndian,p,&quantum);
           pixel->black=quantum >> (image->depth-MAGICKCORE_QUANTUM_DEPTH);
         }
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         {
           p=PushShortPixel(MSBEndian,p,&quantum);
           pixel->alpha=quantum >> (image->depth-MAGICKCORE_QUANTUM_DEPTH);
@@ -362,7 +362,7 @@ static void PushRunlengthPacket(Image *image,const unsigned char *pixels,
           p=PushLongPixel(MSBEndian,p,&quantum);
           pixel->black=quantum >> (image->depth-MAGICKCORE_QUANTUM_DEPTH);
         }
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         {
           p=PushLongPixel(MSBEndian,p,&quantum);
           pixel->alpha=quantum >> (image->depth-MAGICKCORE_QUANTUM_DEPTH);
@@ -1258,7 +1258,7 @@ static Image *ReadMIFFImage(const ImageInfo *image_info,
       packet_size=(size_t) (3*quantum_info->depth/8);
     if (IsGrayColorspace(image->colorspace) != MagickFalse)
       packet_size=quantum_info->depth/8;
-    if (image->alpha_trait == BlendPixelTrait)
+    if (image->alpha_trait != UndefinedPixelTrait)
       packet_size+=quantum_info->depth/8;
     if (image->colorspace == CMYKColorspace)
       packet_size+=quantum_info->depth/8;
@@ -1276,24 +1276,24 @@ static Image *ReadMIFFImage(const ImageInfo *image_info,
       Read image pixels.
     */
     quantum_type=RGBQuantum;
-    if (image->alpha_trait == BlendPixelTrait)
+    if (image->alpha_trait != UndefinedPixelTrait)
       quantum_type=RGBAQuantum;
     if (image->colorspace == CMYKColorspace)
       {
         quantum_type=CMYKQuantum;
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           quantum_type=CMYKAQuantum;
       }
     if (IsGrayColorspace(image->colorspace) != MagickFalse)
       {
         quantum_type=GrayQuantum;
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           quantum_type=GrayAlphaQuantum;
       }
     if (image->storage_class == PseudoClass)
       {
         quantum_type=IndexQuantum;
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           quantum_type=IndexAlphaQuantum;
       }
     status=MagickTrue;
@@ -1479,7 +1479,7 @@ static Image *ReadMIFFImage(const ImageInfo *image_info,
                 if (image->colorspace == CMYKColorspace)
                   SetPixelBlack(image,ClampToQuantum(pixel.black),q);
               }
-            if (image->alpha_trait == BlendPixelTrait)
+            if (image->alpha_trait != UndefinedPixelTrait)
               SetPixelAlpha(image,ClampToQuantum(pixel.alpha),q);
             q+=GetPixelChannels(image);
           }
@@ -1747,7 +1747,7 @@ static unsigned char *PopRunlengthPacket(Image *image,unsigned char *pixels,
           unsigned int
             value;
 
-          if (image->alpha_trait == BlendPixelTrait)
+          if (image->alpha_trait != UndefinedPixelTrait)
             {
               value=ScaleQuantumToLong(ClampToQuantum(pixel->alpha));
               pixels=PopLongPixel(MSBEndian,value,pixels);
@@ -1759,7 +1759,7 @@ static unsigned char *PopRunlengthPacket(Image *image,unsigned char *pixels,
           unsigned short
             value;
 
-          if (image->alpha_trait == BlendPixelTrait)
+          if (image->alpha_trait != UndefinedPixelTrait)
             {
               value=ScaleQuantumToShort(ClampToQuantum(pixel->alpha));
               pixels=PopShortPixel(MSBEndian,value,pixels);
@@ -1771,7 +1771,7 @@ static unsigned char *PopRunlengthPacket(Image *image,unsigned char *pixels,
           unsigned char
             value;
 
-          if (image->alpha_trait == BlendPixelTrait)
+          if (image->alpha_trait != UndefinedPixelTrait)
             {
               value=(unsigned char) ScaleQuantumToChar(ClampToQuantum(
                 pixel->alpha));
@@ -1807,7 +1807,7 @@ static unsigned char *PopRunlengthPacket(Image *image,unsigned char *pixels,
           value=ScaleQuantumToLong(ClampToQuantum(pixel->black));
           pixels=PopLongPixel(MSBEndian,value,pixels);
         }
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         {
           value=ScaleQuantumToLong(ClampToQuantum(pixel->alpha));
           pixels=PopLongPixel(MSBEndian,value,pixels);
@@ -1833,7 +1833,7 @@ static unsigned char *PopRunlengthPacket(Image *image,unsigned char *pixels,
           value=ScaleQuantumToShort(ClampToQuantum(pixel->black));
           pixels=PopShortPixel(MSBEndian,value,pixels);
         }
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         {
           value=ScaleQuantumToShort(ClampToQuantum(pixel->alpha));
           pixels=PopShortPixel(MSBEndian,value,pixels);
@@ -1861,7 +1861,7 @@ static unsigned char *PopRunlengthPacket(Image *image,unsigned char *pixels,
             pixel->black));
           pixels=PopCharPixel(value,pixels);
         }
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         {
           value=(unsigned char) ScaleQuantumToChar(ClampToQuantum(
             pixel->alpha));
@@ -2017,7 +2017,7 @@ static MagickBooleanType WriteMIFFImage(const ImageInfo *image_info,
       packet_size=(size_t) (3*quantum_info->depth/8);
     if (IsGrayColorspace(image->colorspace) != MagickFalse)
       packet_size=(size_t) (quantum_info->depth/8);
-    if (image->alpha_trait == BlendPixelTrait)
+    if (image->alpha_trait != UndefinedPixelTrait)
       packet_size+=quantum_info->depth/8;
     if (image->colorspace == CMYKColorspace)
       packet_size+=quantum_info->depth/8;
index 06740b8d9d319a817fa2e9d8a0254dea3357f60c..c06044af0e73a1beb88d5ac1a85ed002a3b0da5a 100644 (file)
@@ -626,7 +626,7 @@ static Image *ReadPCXImage(const ImageInfo *image_info,ExceptionInfo *exception)
             SetPixelRed(image,ScaleCharToQuantum(*r++),q);
             SetPixelGreen(image,ScaleCharToQuantum(*r++),q);
             SetPixelBlue(image,ScaleCharToQuantum(*r++),q);
-            if (image->alpha_trait == BlendPixelTrait)
+            if (image->alpha_trait != UndefinedPixelTrait)
               SetPixelAlpha(image,ScaleCharToQuantum(*r++),q);
           }
         q+=GetPixelChannels(image);
@@ -959,7 +959,7 @@ static MagickBooleanType WritePCXImage(const ImageInfo *image_info,Image *image,
     if ((image->storage_class == DirectClass) || (image->colors > 256))
       {
         pcx_info.planes=3;
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           pcx_info.planes++;
       }
     pcx_info.bytes_per_line=(unsigned short) (((size_t) image->columns*
index 80355850039bfcf7769deebd11a27cc76a37a107..344c3a0e88e22185040a45b2ed8b13176eaeb457 100644 (file)
@@ -1190,7 +1190,7 @@ RestoreMSCWarning
   if (image_info->compression == JPEG2000Compression)
     version=(size_t) MagickMax(version,5);
   for (next=image; next != (Image *) NULL; next=GetNextImageInList(next))
-    if (next->alpha_trait == BlendPixelTrait)
+    if (next->alpha_trait != UndefinedPixelTrait)
       version=(size_t) MagickMax(version,4);
   if (LocaleCompare(image_info->magick,"PDFA") == 0)
     version=(size_t) MagickMax(version,6);
@@ -1326,7 +1326,7 @@ RestoreMSCWarning
       case Group4Compression:
       {
         if ((IsImageMonochrome(image,exception) == MagickFalse) ||
-            (image->alpha_trait == BlendPixelTrait))
+            (image->alpha_trait != UndefinedPixelTrait))
           compression=RLECompression;
         break;
       }
@@ -1659,7 +1659,7 @@ RestoreMSCWarning
       (compression == FaxCompression) || (compression == Group4Compression) ?
       1 : 8);
     (void) WriteBlobString(image,buffer);
-    if (image->alpha_trait == BlendPixelTrait)
+    if (image->alpha_trait != UndefinedPixelTrait)
       {
         (void) FormatLocaleString(buffer,MaxTextExtent,"/SMask %.20g 0 R\n",
           (double) object+7);
@@ -2522,7 +2522,7 @@ RestoreMSCWarning
       object);
     (void) WriteBlobString(image,buffer);
     (void) WriteBlobString(image,"<<\n");
-    if (image->alpha_trait != BlendPixelTrait)
+    if (image->alpha_trait == UndefinedPixelTrait)
       (void) WriteBlobString(image,">>\n");
     else
       {
index 1c9ea4b6f893aa931a2d5aa1acdcb5b9d69818a1..8a1a2360a0921a2b24d74f684bdd4b26e068161f 100644 (file)
@@ -1104,7 +1104,7 @@ static Image *ReadPICTImage(const ImageInfo *image_info,
                 tile_image->resolution.x=(double) pixmap.horizontal_resolution;
                 tile_image->resolution.y=(double) pixmap.vertical_resolution;
                 tile_image->units=PixelsPerInchResolution;
-                if (tile_image->alpha_trait == BlendPixelTrait)
+                if (tile_image->alpha_trait != UndefinedPixelTrait)
                   image->alpha_trait=tile_image->alpha_trait;
               }
             if ((code != 0x9a) && (code != 0x9b))
@@ -1222,7 +1222,7 @@ static Image *ReadPICTImage(const ImageInfo *image_info,
                           (unsigned char) ((j & 0x1f) << 3)),q);
                       }
                     else
-                      if (tile_image->alpha_trait != BlendPixelTrait)
+                      if (tile_image->alpha_trait == UndefinedPixelTrait)
                         {
                           if (p > (pixels+extent+2*image->columns))
                             ThrowReaderException(CorruptImageError,
@@ -1676,7 +1676,7 @@ static MagickBooleanType WritePICTImage(const ImageInfo *image_info,
     storage_class=DirectClass;
   if (storage_class == DirectClass)
     {
-      pixmap.component_count=image->alpha_trait == BlendPixelTrait ? 4 : 3;
+      pixmap.component_count=image->alpha_trait != UndefinedPixelTrait ? 4 : 3;
       pixmap.pixel_type=16;
       pixmap.bits_per_pixel=32;
       pixmap.pack_type=0x04;
@@ -1688,7 +1688,7 @@ static MagickBooleanType WritePICTImage(const ImageInfo *image_info,
   */
   bytes_per_line=image->columns;
   if (storage_class == DirectClass)
-    bytes_per_line*=image->alpha_trait == BlendPixelTrait ? 4 : 3;
+    bytes_per_line*=image->alpha_trait != UndefinedPixelTrait ? 4 : 3;
   buffer=(unsigned char *) AcquireQuantumMemory(PictInfoSize,sizeof(*buffer));
   packed_scanline=(unsigned char *) AcquireQuantumMemory((size_t)
    (row_bytes+MaxCount),sizeof(*packed_scanline));
@@ -1960,7 +1960,7 @@ static MagickBooleanType WritePICTImage(const ImageInfo *image_info,
           red=scanline;
           green=scanline+image->columns;
           blue=scanline+2*image->columns;
-          if (image->alpha_trait == BlendPixelTrait)
+          if (image->alpha_trait != UndefinedPixelTrait)
             {
               opacity=scanline;
               red=scanline+image->columns;
@@ -1972,7 +1972,7 @@ static MagickBooleanType WritePICTImage(const ImageInfo *image_info,
             *red++=ScaleQuantumToChar(GetPixelRed(image,p));
             *green++=ScaleQuantumToChar(GetPixelGreen(image,p));
             *blue++=ScaleQuantumToChar(GetPixelBlue(image,p));
-            if (image->alpha_trait == BlendPixelTrait)
+            if (image->alpha_trait != UndefinedPixelTrait)
               *opacity++=ScaleQuantumToChar((Quantum) (GetPixelAlpha(image,p)));
             p+=GetPixelChannels(image);
           }
index 0ca0088175d1cf7750334fd6d2c3d338122ff9cb..33b960f33c81641e1aedd203fa976eaf433bc049 100644 (file)
@@ -3776,7 +3776,7 @@ static Image *ReadOnePNGImage(MngInfo *mng_info,
         BlendPixelTrait : UndefinedPixelTrait;
 
 #if 0  /* I'm not sure what's wrong here but it does not work. */
-    if (image->alpha_trait == BlendPixelTrait)
+    if (image->alpha_trait != UndefinedPixelTrait)
     {
       if (ping_color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
         (void) SetImageType(image,GrayscaleMatteType,exception);
@@ -4701,7 +4701,7 @@ static Image *ReadOneJNGImage(MngInfo *mng_info,
                exception);
              q=GetAuthenticPixels(image,0,y,image->columns,1,exception);
 
-             if (image->alpha_trait == BlendPixelTrait)
+             if (image->alpha_trait != UndefinedPixelTrait)
                for (x=(ssize_t) image->columns; x != 0; x--)
                {
                   SetPixelAlpha(image,GetPixelRed(jng_image,s),q);
@@ -6549,7 +6549,7 @@ static Image *ReadMNGImage(const ImageInfo *image_info,ExceptionInfo *exception)
 #define QM Quantum
 #endif
 
-                if (image->alpha_trait == BlendPixelTrait)
+                if (image->alpha_trait != UndefinedPixelTrait)
                    (void) SetImageBackgroundColor(large_image,exception);
 
                 else
@@ -6688,7 +6688,7 @@ static Image *ReadMNGImage(const ImageInfo *image_info,ExceptionInfo *exception)
                                  ((ssize_t) (m*2))
                                  +GetPixelBlue(image,pixels)))),q);
 
-                              if (image->alpha_trait == BlendPixelTrait)
+                              if (image->alpha_trait != UndefinedPixelTrait)
                                  SetPixelAlpha(large_image, ((QM) (((ssize_t)
                                     (2*i*(GetPixelAlpha(image,n)
                                     -GetPixelAlpha(image,pixels)+m))
@@ -6845,7 +6845,7 @@ static Image *ReadMNGImage(const ImageInfo *image_info,ExceptionInfo *exception)
                                  -GetPixelBlue(image,pixels))+m)
                                  /((ssize_t) (m*2))+
                                  GetPixelBlue(image,pixels)),q);
-                              if (image->alpha_trait == BlendPixelTrait)
+                              if (image->alpha_trait != UndefinedPixelTrait)
                                  SetPixelAlpha(image,(QM) ((2*i*(
                                    GetPixelAlpha(image,n)
                                    -GetPixelAlpha(image,pixels))+m)
@@ -8385,7 +8385,7 @@ static MagickBooleanType WriteOnePNGImage(MngInfo *mng_info,
   if (mng_info->write_png_colortype &&
      (mng_info->write_png_colortype > 4 || (mng_info->write_png_depth >= 8 &&
      mng_info->write_png_colortype < 4 &&
-     image->alpha_trait != BlendPixelTrait)))
+     image->alpha_trait == UndefinedPixelTrait)))
   {
      /* Avoid the expensive BUILD_PALETTE operation if we're sure that we
       * are not going to need the result.
@@ -8394,7 +8394,7 @@ static MagickBooleanType WriteOnePNGImage(MngInfo *mng_info,
         mng_info->write_png_colortype == 5)
        ping_have_color=MagickFalse;
 
-     if (image->alpha_trait == BlendPixelTrait)
+     if (image->alpha_trait != UndefinedPixelTrait)
        {
          number_transparent = 2;
          number_semitransparent = 1;
@@ -8530,7 +8530,7 @@ static MagickBooleanType WriteOnePNGImage(MngInfo *mng_info,
 
        for (x=0; x < (ssize_t) image->columns; x++)
        {
-           if (image->alpha_trait != BlendPixelTrait ||
+           if (image->alpha_trait == UndefinedPixelTrait ||
               GetPixelAlpha(image,q) == OpaqueAlpha)
              {
                if (number_opaque < 259)
@@ -8834,7 +8834,7 @@ static MagickBooleanType WriteOnePNGImage(MngInfo *mng_info,
               {
                 for (i=0; i< (ssize_t) image_colors; i++)
                 {
-                  if ((image->alpha_trait != BlendPixelTrait ||
+                  if ((image->alpha_trait == UndefinedPixelTrait ||
                       image->colormap[i].alpha == GetPixelAlpha(image,q)) &&
                       image->colormap[i].red == GetPixelRed(image,q) &&
                       image->colormap[i].green == GetPixelGreen(image,q) &&
@@ -9301,7 +9301,7 @@ static MagickBooleanType WriteOnePNGImage(MngInfo *mng_info,
   quantum_info = (QuantumInfo *) NULL;
   number_colors=0;
   image_colors=(int) image->colors;
-  image_matte=image->alpha_trait == BlendPixelTrait ? MagickTrue : MagickFalse;
+  image_matte=image->alpha_trait != UndefinedPixelTrait ? MagickTrue : MagickFalse;
 
   if (mng_info->write_png_colortype < 5)
     mng_info->IsPalette=image->storage_class == PseudoClass &&
@@ -9750,7 +9750,7 @@ static MagickBooleanType WriteOnePNGImage(MngInfo *mng_info,
 
       if (ping_color_type == PNG_COLOR_TYPE_GRAY)
         {
-          if (image->alpha_trait != BlendPixelTrait && ping_have_non_bw == MagickFalse)
+          if (image->alpha_trait == UndefinedPixelTrait && ping_have_non_bw == MagickFalse)
              ping_bit_depth=1;
         }
 
@@ -10426,7 +10426,7 @@ static MagickBooleanType WriteOnePNGImage(MngInfo *mng_info,
         "Cannot write image with defined png:bit-depth or png:color-type.");
     }
 
-  if (image_matte != MagickFalse && image->alpha_trait != BlendPixelTrait)
+  if (image_matte != MagickFalse && image->alpha_trait == UndefinedPixelTrait)
     {
       /* Add an opaque matte channel */
       image->alpha_trait = BlendPixelTrait;
@@ -11613,7 +11613,7 @@ static MagickBooleanType WritePNGImage(const ImageInfo *image_info,
       mng_info->write_png_depth = 8;
       image->depth = 8;
 
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         (void) SetImageType(image,TrueColorMatteType,exception);
 
       else
@@ -11639,7 +11639,7 @@ static MagickBooleanType WritePNGImage(const ImageInfo *image_info,
       mng_info->write_png_depth = 16;
       image->depth = 16;
 
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         (void) SetImageType(image,TrueColorMatteType,exception);
 
       else
@@ -12184,7 +12184,7 @@ static MagickBooleanType WriteOneJNGImage(MngInfo *mng_info,
 
   status=MagickTrue;
   transparent=image_info->type==GrayscaleMatteType ||
-     image_info->type==TrueColorMatteType || image->alpha_trait == BlendPixelTrait;
+     image_info->type==TrueColorMatteType || image->alpha_trait != UndefinedPixelTrait;
 
   jng_alpha_sample_depth = 0;
 
@@ -12896,7 +12896,7 @@ static MagickBooleanType WriteMNGImage(const ImageInfo *image_info,Image *image,
            "    Scene: %.20g\n,   Image depth: %.20g",
            (double) scene++, (double) p->depth);
 
-        if (p->alpha_trait == BlendPixelTrait)
+        if (p->alpha_trait != UndefinedPixelTrait)
           (void) LogMagickEvent(CoderEvent,GetMagickModule(),
             "      Matte: True");
 
@@ -12990,11 +12990,11 @@ static MagickBooleanType WriteMNGImage(const ImageInfo *image_info,Image *image,
         if (next_image->page.x || next_image->page.y)
           need_defi=MagickTrue;
 
-        if (next_image->alpha_trait == BlendPixelTrait)
+        if (next_image->alpha_trait != UndefinedPixelTrait)
           need_matte=MagickTrue;
 
         if ((int) next_image->dispose >= BackgroundDispose)
-          if ((next_image->alpha_trait == BlendPixelTrait) ||
+          if ((next_image->alpha_trait != UndefinedPixelTrait) ||
                next_image->page.x || next_image->page.y ||
               ((next_image->columns < mng_info->page.width) &&
                (next_image->rows < mng_info->page.height)))
@@ -13014,7 +13014,7 @@ static MagickBooleanType WriteMNGImage(const ImageInfo *image_info,Image *image,
         /*
           check for global palette possibility.
         */
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
            need_local_plte=MagickTrue;
 
         if (need_local_plte == 0)
@@ -13367,7 +13367,7 @@ static MagickBooleanType WriteMNGImage(const ImageInfo *image_info,Image *image,
        Write MNG BACK chunk and global bKGD chunk, if the image is transparent
        or does not cover the entire frame.
      */
-     if (write_mng && ((image->alpha_trait == BlendPixelTrait) ||
+     if (write_mng && ((image->alpha_trait != UndefinedPixelTrait) ||
          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
index 35b40efc6fb144c2eb068961dc4f0baff55a199e..b7e325438dfd76b7b31a75b9f42d80717e4ceb46 100644 (file)
@@ -938,7 +938,7 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
             break;
           }
         }
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           channels++;
         if (image->depth <= 8)
           extent=channels*image->columns;
@@ -1028,7 +1028,7 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
                         p=PushCharPixel(p,&pixel);
                         SetPixelGray(image,ScaleAnyToQuantum(pixel,max_value),q);
                         SetPixelAlpha(image,OpaqueAlpha,q);
-                        if (image->alpha_trait == BlendPixelTrait)
+                        if (image->alpha_trait != UndefinedPixelTrait)
                           {
                             p=PushCharPixel(p,&pixel);
                             if (image->depth != 1)
@@ -1053,7 +1053,7 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
                         SetPixelGray(image,ScaleAnyToQuantum(pixel,max_value),
                           q);
                         SetPixelAlpha(image,OpaqueAlpha,q);
-                        if (image->alpha_trait == BlendPixelTrait)
+                        if (image->alpha_trait != UndefinedPixelTrait)
                           {
                             p=PushShortPixel(MSBEndian,p,&pixel);
                             SetPixelAlpha(image,ScaleAnyToQuantum(pixel,
@@ -1068,7 +1068,7 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
                     p=PushLongPixel(MSBEndian,p,&pixel);
                     SetPixelGray(image,ScaleAnyToQuantum(pixel,max_value),q);
                     SetPixelAlpha(image,OpaqueAlpha,q);
-                    if (image->alpha_trait == BlendPixelTrait)
+                    if (image->alpha_trait != UndefinedPixelTrait)
                       {
                         p=PushLongPixel(MSBEndian,p,&pixel);
                         SetPixelAlpha(image,ScaleAnyToQuantum(pixel,max_value),q);
@@ -1099,7 +1099,7 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
                         p=PushCharPixel(p,&pixel);
                         SetPixelBlack(image,ScaleAnyToQuantum(pixel,max_value),q);
                         SetPixelAlpha(image,OpaqueAlpha,q);
-                        if (image->alpha_trait == BlendPixelTrait)
+                        if (image->alpha_trait != UndefinedPixelTrait)
                           {
                             p=PushCharPixel(p,&pixel);
                             SetPixelAlpha(image,ScaleAnyToQuantum(pixel,
@@ -1125,7 +1125,7 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
                         p=PushShortPixel(MSBEndian,p,&pixel);
                         SetPixelBlack(image,ScaleAnyToQuantum(pixel,max_value),q);
                         SetPixelAlpha(image,OpaqueAlpha,q);
-                        if (image->alpha_trait == BlendPixelTrait)
+                        if (image->alpha_trait != UndefinedPixelTrait)
                           {
                             p=PushShortPixel(MSBEndian,p,&pixel);
                             SetPixelAlpha(image,ScaleAnyToQuantum(pixel,
@@ -1145,7 +1145,7 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
                     p=PushLongPixel(MSBEndian,p,&pixel);
                     SetPixelBlack(image,ScaleAnyToQuantum(pixel,max_value),q);
                     SetPixelAlpha(image,OpaqueAlpha,q);
-                    if (image->alpha_trait == BlendPixelTrait)
+                    if (image->alpha_trait != UndefinedPixelTrait)
                       {
                         p=PushLongPixel(MSBEndian,p,&pixel);
                         SetPixelAlpha(image,ScaleAnyToQuantum(pixel,max_value),q);
@@ -1173,7 +1173,7 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
                         p=PushCharPixel(p,&pixel);
                         SetPixelBlue(image,ScaleAnyToQuantum(pixel,max_value),q);
                         SetPixelAlpha(image,OpaqueAlpha,q);
-                        if (image->alpha_trait == BlendPixelTrait)
+                        if (image->alpha_trait != UndefinedPixelTrait)
                           {
                             p=PushCharPixel(p,&pixel);
                             SetPixelAlpha(image,ScaleAnyToQuantum(pixel,max_value),q);
@@ -1196,7 +1196,7 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
                         p=PushShortPixel(MSBEndian,p,&pixel);
                         SetPixelBlue(image,ScaleAnyToQuantum(pixel,max_value),q);
                         SetPixelAlpha(image,OpaqueAlpha,q);
-                        if (image->alpha_trait == BlendPixelTrait)
+                        if (image->alpha_trait != UndefinedPixelTrait)
                           {
                             p=PushShortPixel(MSBEndian,p,&pixel);
                             SetPixelAlpha(image,ScaleAnyToQuantum(pixel,
@@ -1215,7 +1215,7 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception)
                     p=PushLongPixel(MSBEndian,p,&pixel);
                     SetPixelBlue(image,ScaleAnyToQuantum(pixel,max_value),q);
                     SetPixelAlpha(image,OpaqueAlpha,q);
-                    if (image->alpha_trait == BlendPixelTrait)
+                    if (image->alpha_trait != UndefinedPixelTrait)
                       {
                         p=PushLongPixel(MSBEndian,p,&pixel);
                         SetPixelAlpha(image,ScaleAnyToQuantum(pixel,max_value),q);
@@ -1681,14 +1681,14 @@ static MagickBooleanType WritePNMImage(const ImageInfo *image_info,Image *image,
           default:
           {
             quantum_type=RGBQuantum;
-            if (image->alpha_trait == BlendPixelTrait)
+            if (image->alpha_trait != UndefinedPixelTrait)
               quantum_type=RGBAQuantum;
             packet_size=3;
             (void) CopyMagickString(type,"RGB",MaxTextExtent);
             break;
           }
         }
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           {
             packet_size++;
             (void) ConcatenateMagickString(type,"_ALPHA",MaxTextExtent);
@@ -2190,7 +2190,7 @@ static MagickBooleanType WritePNMImage(const ImageInfo *image_info,Image *image,
                         pixel=ScaleQuantumToAny(ClampToQuantum(GetPixelLuma(
                           image,p)),max_value);
                         q=PopCharPixel((unsigned char) pixel,q);
-                        if (image->alpha_trait == BlendPixelTrait)
+                        if (image->alpha_trait != UndefinedPixelTrait)
                           {
                             pixel=(unsigned char) ScaleQuantumToAny(
                               GetPixelAlpha(image,p),max_value);
@@ -2207,7 +2207,7 @@ static MagickBooleanType WritePNMImage(const ImageInfo *image_info,Image *image,
                         pixel=ScaleQuantumToAny(ClampToQuantum(GetPixelLuma(
                           image,p)),max_value);
                         q=PopShortPixel(MSBEndian,(unsigned short) pixel,q);
-                        if (image->alpha_trait == BlendPixelTrait)
+                        if (image->alpha_trait != UndefinedPixelTrait)
                           {
                             pixel=(unsigned char) ScaleQuantumToAny(
                               GetPixelAlpha(image,p),max_value);
@@ -2222,7 +2222,7 @@ static MagickBooleanType WritePNMImage(const ImageInfo *image_info,Image *image,
                     pixel=ScaleQuantumToAny(ClampToQuantum(GetPixelLuma(image,
                       p)),max_value);
                     q=PopLongPixel(MSBEndian,(unsigned int) pixel,q);
-                    if (image->alpha_trait == BlendPixelTrait)
+                    if (image->alpha_trait != UndefinedPixelTrait)
                       {
                         pixel=(unsigned char) ScaleQuantumToAny(
                           GetPixelAlpha(image,p),max_value);
@@ -2250,7 +2250,7 @@ static MagickBooleanType WritePNMImage(const ImageInfo *image_info,Image *image,
                         pixel=ScaleQuantumToAny(GetPixelBlack(image,p),
                           max_value);
                         q=PopCharPixel((unsigned char) pixel,q);
-                        if (image->alpha_trait == BlendPixelTrait)
+                        if (image->alpha_trait != UndefinedPixelTrait)
                           {
                             pixel=ScaleQuantumToAny(GetPixelAlpha(image,p),
                               max_value);
@@ -2275,7 +2275,7 @@ static MagickBooleanType WritePNMImage(const ImageInfo *image_info,Image *image,
                         pixel=ScaleQuantumToAny(GetPixelBlack(image,p),
                           max_value);
                         q=PopShortPixel(MSBEndian,(unsigned short) pixel,q);
-                        if (image->alpha_trait == BlendPixelTrait)
+                        if (image->alpha_trait != UndefinedPixelTrait)
                           {
                             pixel=ScaleQuantumToAny(GetPixelAlpha(image,p),
                               max_value);
@@ -2295,7 +2295,7 @@ static MagickBooleanType WritePNMImage(const ImageInfo *image_info,Image *image,
                     q=PopLongPixel(MSBEndian,(unsigned int) pixel,q);
                     pixel=ScaleQuantumToAny(GetPixelBlack(image,p),max_value);
                     q=PopLongPixel(MSBEndian,(unsigned int) pixel,q);
-                    if (image->alpha_trait == BlendPixelTrait)
+                    if (image->alpha_trait != UndefinedPixelTrait)
                       {
                         pixel=ScaleQuantumToAny(GetPixelAlpha(image,p),
                           max_value);
@@ -2319,7 +2319,7 @@ static MagickBooleanType WritePNMImage(const ImageInfo *image_info,Image *image,
                         pixel=ScaleQuantumToAny(GetPixelBlue(image,p),
                           max_value);
                         q=PopCharPixel((unsigned char) pixel,q);
-                        if (image->alpha_trait == BlendPixelTrait)
+                        if (image->alpha_trait != UndefinedPixelTrait)
                           {
                             pixel=ScaleQuantumToAny(GetPixelAlpha(image,p),
                               max_value);
@@ -2341,7 +2341,7 @@ static MagickBooleanType WritePNMImage(const ImageInfo *image_info,Image *image,
                         pixel=ScaleQuantumToAny(GetPixelBlue(image,p),
                           max_value);
                         q=PopShortPixel(MSBEndian,(unsigned short) pixel,q);
-                        if (image->alpha_trait == BlendPixelTrait)
+                        if (image->alpha_trait != UndefinedPixelTrait)
                           {
                             pixel=ScaleQuantumToAny(GetPixelAlpha(image,p),
                               max_value);
@@ -2359,7 +2359,7 @@ static MagickBooleanType WritePNMImage(const ImageInfo *image_info,Image *image,
                     q=PopLongPixel(MSBEndian,(unsigned int) pixel,q);
                     pixel=ScaleQuantumToAny(GetPixelBlue(image,p),max_value);
                     q=PopLongPixel(MSBEndian,(unsigned int) pixel,q);
-                    if (image->alpha_trait == BlendPixelTrait)
+                    if (image->alpha_trait != UndefinedPixelTrait)
                       {
                         pixel=ScaleQuantumToAny(GetPixelAlpha(image,p),
                           max_value);
index d9444956988c999834212ca6e773010672db024f..d8c54a65f0a58d03d8040524101ccdd858ed1922 100644 (file)
@@ -1164,7 +1164,7 @@ static MagickBooleanType WritePSImage(const ImageInfo *image_info,Image *image,
 {
 #define WriteRunlengthPacket(image,pixel,length,p) \
 { \
-  if ((image->alpha_trait == BlendPixelTrait) && \
+  if ((image->alpha_trait != UndefinedPixelTrait) && \
       (GetPixelAlpha(image,p) == (Quantum) TransparentAlpha)) \
     { \
       q=PopHexPixel(hex_digits,0xff,q); \
@@ -2002,7 +2002,7 @@ RestoreMSCWarning
       }
     else
       if ((image->storage_class == DirectClass) ||
-          (image->colors > 256) || (image->alpha_trait == BlendPixelTrait))
+          (image->colors > 256) || (image->alpha_trait != UndefinedPixelTrait))
         {
           /*
             Dump DirectClass image.
@@ -2087,7 +2087,7 @@ RestoreMSCWarning
                   break;
                 for (x=0; x < (ssize_t) image->columns; x++)
                 {
-                  if ((image->alpha_trait == BlendPixelTrait) &&
+                  if ((image->alpha_trait != UndefinedPixelTrait) &&
                       (GetPixelAlpha(image,p) == (Quantum) TransparentAlpha))
                     {
                       q=PopHexPixel(hex_digits,0xff,q);
index 623af8c17ce8c7db931030b9da2ca63de69d4115..8e4e2cc3980ece143eb8549346709aff559d25da 100644 (file)
@@ -849,7 +849,7 @@ static MagickBooleanType WritePS2Image(const ImageInfo *image_info,Image *image,
       }
     else
       if ((image->storage_class == DirectClass) || (image->colors > 256) ||
-          (compression == JPEGCompression) || (image->alpha_trait == BlendPixelTrait))
+          (compression == JPEGCompression) || (image->alpha_trait != UndefinedPixelTrait))
         {
           (void) FormatLocaleString(buffer,MaxTextExtent,"%.20g %.20g\n0\n%d\n",
             (double) image->columns,(double) image->rows,(int)
@@ -899,7 +899,7 @@ static MagickBooleanType WritePS2Image(const ImageInfo *image_info,Image *image,
                   break;
                 for (x=0; x < (ssize_t) image->columns; x++)
                 {
-                  if ((image->alpha_trait == BlendPixelTrait) &&
+                  if ((image->alpha_trait != UndefinedPixelTrait) &&
                       (GetPixelAlpha(image,p) == (Quantum) TransparentAlpha))
                     {
                       *q++=ScaleQuantumToChar(QuantumRange);
@@ -953,7 +953,7 @@ static MagickBooleanType WritePS2Image(const ImageInfo *image_info,Image *image,
                   break;
                 for (x=0; x < (ssize_t) image->columns; x++)
                 {
-                  if ((image->alpha_trait == BlendPixelTrait) &&
+                  if ((image->alpha_trait != UndefinedPixelTrait) &&
                       (GetPixelAlpha(image,p) == (Quantum) TransparentAlpha))
                     {
                       Ascii85Encode(image,ScaleQuantumToChar((Quantum)
index 0ed724474e84ac55496adf1649a9a4738e4b6f85..e6fb0f42ce8b8244824587aecf6200210cfcd93b 100644 (file)
@@ -466,7 +466,7 @@ static MagickBooleanType WritePS3MaskImage(const ImageInfo *image_info,
   assert(image->signature == MagickSignature);
   if (image->debug != MagickFalse)
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
-  assert(image->alpha_trait == BlendPixelTrait);
+  assert(image->alpha_trait != UndefinedPixelTrait);
   status=MagickTrue;
   /*
     Note BeginData DSC comment for update later.
@@ -894,7 +894,7 @@ static MagickBooleanType WritePS3Image(const ImageInfo *image_info,Image *image,
     case Group4Compression:
     { 
       if ((IsImageMonochrome(image,exception) == MagickFalse) ||
-          (image->alpha_trait == BlendPixelTrait))
+          (image->alpha_trait != UndefinedPixelTrait))
         compression=RLECompression;
       break;
     }
@@ -1166,7 +1166,7 @@ static MagickBooleanType WritePS3Image(const ImageInfo *image_info,Image *image,
     /*
       Image mask.
     */
-    if ((image->alpha_trait == BlendPixelTrait) &&
+    if ((image->alpha_trait != UndefinedPixelTrait) &&
         (WritePS3MaskImage(image_info,image,compression,exception) == MagickFalse))
       {
         (void) CloseBlob(image);
@@ -1240,7 +1240,7 @@ static MagickBooleanType WritePS3Image(const ImageInfo *image_info,Image *image,
     /*
       Masked image?
     */
-    (void) WriteBlobString(image,image->alpha_trait == BlendPixelTrait ?
+    (void) WriteBlobString(image,image->alpha_trait != UndefinedPixelTrait ?
       "true\n" : "false\n");
     /*
       Render with imagemask operator?
index 6b37a103c9a0e93b4fc16095e912b0dd58809d9c..f62f232a239401032cc4d8b898140921bb133e47 100644 (file)
@@ -750,7 +750,7 @@ static MagickStatusType ReadPSDChannelPixels(Image *image,
         if (image->colorspace == CMYKColorspace)
           SetPixelBlack(image,pixel,q);
         else
-          if (image->alpha_trait == BlendPixelTrait)
+          if (image->alpha_trait != UndefinedPixelTrait)
             SetPixelOpacity(image,pixel,q);
         break;
       }
@@ -759,7 +759,7 @@ static MagickStatusType ReadPSDChannelPixels(Image *image,
         if ((IssRGBCompatibleColorspace(image->colorspace) != MagickFalse) &&
             (channels > 3))
           break;
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           SetPixelOpacity(image,pixel,q);
         break;
       }
@@ -2190,14 +2190,14 @@ static MagickBooleanType WriteImageChannels(const PSDInfo *psd_info,
           (void) WriteBlobMSBShort(image,1);
           WritePackbitsLength(psd_info,image_info,image,next_image,
             compact_pixels,GrayQuantum,exception);
-          if (next_image->alpha_trait == BlendPixelTrait)
+          if (next_image->alpha_trait != UndefinedPixelTrait)
             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->alpha_trait == BlendPixelTrait)
+      if (next_image->alpha_trait != UndefinedPixelTrait)
         WriteOneChannel(psd_info,image_info,image,next_image,compact_pixels,
           AlphaQuantum,(i++ == 0) || (separate != MagickFalse) ? MagickTrue :
           MagickFalse,exception);
@@ -2214,14 +2214,14 @@ static MagickBooleanType WriteImageChannels(const PSDInfo *psd_info,
             (void) WriteBlobMSBShort(image,1);
             WritePackbitsLength(psd_info,image_info,image,next_image,
               compact_pixels,IndexQuantum,exception);
-            if (next_image->alpha_trait == BlendPixelTrait)
+            if (next_image->alpha_trait != UndefinedPixelTrait)
               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->alpha_trait == BlendPixelTrait)
+        if (next_image->alpha_trait != UndefinedPixelTrait)
           WriteOneChannel(psd_info,image_info,image,next_image,compact_pixels,
             AlphaQuantum,(i++ == 0) || (separate != MagickFalse) ? MagickTrue :
             MagickFalse,exception);
@@ -2246,7 +2246,7 @@ static MagickBooleanType WriteImageChannels(const PSDInfo *psd_info,
             if (next_image->colorspace == CMYKColorspace)
               WritePackbitsLength(psd_info,image_info,image,next_image,
                 compact_pixels,BlackQuantum,exception);
-            if (next_image->alpha_trait == BlendPixelTrait)
+            if (next_image->alpha_trait != UndefinedPixelTrait)
               WritePackbitsLength(psd_info,image_info,image,next_image,
                 compact_pixels,AlphaQuantum,exception);
           }
@@ -2268,7 +2268,7 @@ static MagickBooleanType WriteImageChannels(const PSDInfo *psd_info,
             BlackQuantum,(i++ == 0) || (separate != MagickFalse) ? MagickTrue :
             MagickFalse,exception);
         (void) SetImageProgress(image,SaveImagesTag,4,6);
-        if (next_image->alpha_trait == BlendPixelTrait)
+        if (next_image->alpha_trait != UndefinedPixelTrait)
           WriteOneChannel(psd_info,image_info,image,next_image,compact_pixels,
             AlphaQuantum,(i++ == 0) || (separate != MagickFalse) ? MagickTrue :
             MagickFalse,exception);
@@ -2483,7 +2483,7 @@ static MagickBooleanType WritePSDImage(const ImageInfo *image_info,Image *image,
   if (status == MagickFalse)
     return(status);
   packet_size=(size_t) (image->depth > 8 ? 6 : 3);
-  if (image->alpha_trait == BlendPixelTrait)
+  if (image->alpha_trait != UndefinedPixelTrait)
     packet_size+=image->depth > 8 ? 2 : 1;
   psd_info.version=1;
   if ((LocaleCompare(image_info->magick,"PSB") == 0) ||
@@ -2494,16 +2494,16 @@ static MagickBooleanType WritePSDImage(const ImageInfo *image_info,Image *image,
   for (i=1; i <= 6; i++)
     (void) WriteBlobByte(image, 0);  /* 6 bytes of reserved */
   if (IsImageGray(image,exception) != MagickFalse)
-    num_channels=(image->alpha_trait == BlendPixelTrait ? 2UL : 1UL);
+    num_channels=(image->alpha_trait != UndefinedPixelTrait ? 2UL : 1UL);
   else
     if (image->storage_class == PseudoClass)
-      num_channels=(image->alpha_trait == BlendPixelTrait ? 2UL : 1UL);
+      num_channels=(image->alpha_trait != UndefinedPixelTrait ? 2UL : 1UL);
     else
       {
         if (image->colorspace != CMYKColorspace)
-          num_channels=(image->alpha_trait == BlendPixelTrait ? 4UL : 3UL);
+          num_channels=(image->alpha_trait != UndefinedPixelTrait ? 4UL : 3UL);
         else
-          num_channels=(image->alpha_trait == BlendPixelTrait ? 5UL : 4UL);
+          num_channels=(image->alpha_trait != UndefinedPixelTrait ? 5UL : 4UL);
       }
   (void) WriteBlobMSBShort(image,(unsigned short) num_channels);
   (void) WriteBlobMSBLong(image,(unsigned int) image->rows);
@@ -2605,22 +2605,22 @@ static MagickBooleanType WritePSDImage(const ImageInfo *image_info,Image *image,
   layer_count=0;
   layer_info_size=2;
   base_image=GetNextImageInList(image);
-  if ((image->alpha_trait == BlendPixelTrait) && (base_image == (Image *) NULL))
+  if ((image->alpha_trait != UndefinedPixelTrait) && (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->alpha_trait == BlendPixelTrait ? 2UL : 1UL;
+      num_channels=next_image->alpha_trait != UndefinedPixelTrait ? 2UL : 1UL;
     else
       if (next_image->storage_class == PseudoClass)
-        num_channels=next_image->alpha_trait == BlendPixelTrait ? 2UL : 1UL;
+        num_channels=next_image->alpha_trait != UndefinedPixelTrait ? 2UL : 1UL;
       else
         if (next_image->colorspace != CMYKColorspace)
-          num_channels=next_image->alpha_trait == BlendPixelTrait ? 4UL : 3UL;
+          num_channels=next_image->alpha_trait != UndefinedPixelTrait ? 4UL : 3UL;
         else
-          num_channels=next_image->alpha_trait == BlendPixelTrait ? 5UL : 4UL;
+          num_channels=next_image->alpha_trait != UndefinedPixelTrait ? 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);
@@ -2652,7 +2652,7 @@ static MagickBooleanType WritePSDImage(const ImageInfo *image_info,Image *image,
       else
         rounded_layer_info_size=layer_info_size;
       (void) SetPSDSize(&psd_info,image,rounded_layer_info_size);
-      if (base_image->alpha_trait == BlendPixelTrait)
+      if (base_image->alpha_trait != UndefinedPixelTrait)
         (void) WriteBlobMSBShort(image,-(unsigned short) layer_count);
       else
         (void) WriteBlobMSBShort(image,(unsigned short) layer_count);
@@ -2674,10 +2674,10 @@ static MagickBooleanType WritePSDImage(const ImageInfo *image_info,Image *image,
             (next_image->storage_class == PseudoClass))
           {
              (void) WriteBlobMSBShort(image,(unsigned short)
-               (next_image->alpha_trait == BlendPixelTrait ? 2 : 1));
+               (next_image->alpha_trait != UndefinedPixelTrait ? 2 : 1));
              (void) WriteBlobMSBShort(image,0);
              (void) SetPSDSize(&psd_info,image,channel_size);
-             if (next_image->alpha_trait == BlendPixelTrait)
+             if (next_image->alpha_trait != UndefinedPixelTrait)
                {
                  (void) WriteBlobMSBShort(image,(unsigned short) -1);
                  (void) SetPSDSize(&psd_info,image,channel_size);
@@ -2687,14 +2687,14 @@ static MagickBooleanType WritePSDImage(const ImageInfo *image_info,Image *image,
             if (next_image->colorspace != CMYKColorspace)
               {
                 (void) WriteBlobMSBShort(image,(unsigned short)
-                  (next_image->alpha_trait == BlendPixelTrait ? 4 : 3));
+                  (next_image->alpha_trait != UndefinedPixelTrait ? 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->alpha_trait == BlendPixelTrait)
+               if (next_image->alpha_trait != UndefinedPixelTrait)
                  {
                    (void) WriteBlobMSBShort(image,(unsigned short) -1);
                    (void) SetPSDSize(&psd_info,image,channel_size);
index 0b929ba473dd16de0826762ae2f9dbcc0790f388..91de5b41781a9f5d904ec33661ddffc1cd97397e 100644 (file)
@@ -255,7 +255,7 @@ static Image *ReadRGBImage(const ImageInfo *image_info,ExceptionInfo *exception)
                 SetPixelGreen(image,GetPixelGreen(canvas_image,p),q);
                 SetPixelBlue(image,GetPixelBlue(canvas_image,p),q);
                 SetPixelAlpha(image,OpaqueAlpha,q);
-                if (image->alpha_trait == BlendPixelTrait)
+                if (image->alpha_trait != UndefinedPixelTrait)
                   SetPixelAlpha(image,GetPixelAlpha(canvas_image,p),q);
                 p+=GetPixelChannels(canvas_image);
                 q+=GetPixelChannels(image);
@@ -312,7 +312,7 @@ static Image *ReadRGBImage(const ImageInfo *image_info,ExceptionInfo *exception)
                 "UnexpectedEndOfFile",image->filename);
               break;
             }
-          for (i=0; i < (ssize_t) (image->alpha_trait == BlendPixelTrait ? 4 : 3); i++)
+          for (i=0; i < (ssize_t) (image->alpha_trait != UndefinedPixelTrait ? 4 : 3); i++)
           {
             quantum_type=quantum_types[i];
             q=GetAuthenticPixels(canvas_image,0,0,canvas_image->columns,1,
@@ -551,7 +551,7 @@ static Image *ReadRGBImage(const ImageInfo *image_info,ExceptionInfo *exception)
             if (status == MagickFalse)
               break;
           }
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           {
             for (y=0; y < (ssize_t) image->extract_info.height; y++)
             {
@@ -831,7 +831,7 @@ static Image *ReadRGBImage(const ImageInfo *image_info,ExceptionInfo *exception)
             if (status == MagickFalse)
               break;
           }
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           {
             (void) CloseBlob(image);
             AppendImageFormat("A",image->filename);
@@ -1111,7 +1111,7 @@ static MagickBooleanType WriteRGBImage(const ImageInfo *image_info,
     */
     (void) TransformImageColorspace(image,sRGBColorspace,exception);
     if ((LocaleCompare(image_info->magick,"RGBA") == 0) &&
-        (image->alpha_trait != BlendPixelTrait))
+        (image->alpha_trait == UndefinedPixelTrait))
       (void) SetImageAlphaChannel(image,OpaqueAlphaChannel,exception);
     quantum_info=AcquireQuantumInfo(image_info,image);
     if (quantum_info == (QuantumInfo *) NULL)
index 24b44f00eab21c731d572abff5442c5c64b11956..b1fd777adcd21dcad4d7bb0742442e8787cecd89 100644 (file)
@@ -293,7 +293,7 @@ static Image *ReadRLEImage(const ImageInfo *image_info,ExceptionInfo *exception)
     /*
       Allocate RLE pixels.
     */
-    if (image->alpha_trait == BlendPixelTrait)
+    if (image->alpha_trait != UndefinedPixelTrait)
       number_planes++;
     number_pixels=(MagickSizeType) image->columns*image->rows;
     if ((number_pixels*number_planes) != (size_t) (number_pixels*number_planes))
@@ -314,7 +314,7 @@ static Image *ReadRLEImage(const ImageInfo *image_info,ExceptionInfo *exception)
         p=pixels;
         for (i=0; i < (ssize_t) number_pixels; i++)
         {
-          if (image->alpha_trait != BlendPixelTrait)
+          if (image->alpha_trait == UndefinedPixelTrait)
             for (j=0; j < (ssize_t) number_planes; j++)
               *p++=background_color[j];
           else
@@ -452,7 +452,7 @@ static Image *ReadRLEImage(const ImageInfo *image_info,ExceptionInfo *exception)
             SetPixelRed(image,ScaleCharToQuantum(*p++),q);
             SetPixelGreen(image,ScaleCharToQuantum(*p++),q);
             SetPixelBlue(image,ScaleCharToQuantum(*p++),q);
-            if (image->alpha_trait == BlendPixelTrait)
+            if (image->alpha_trait != UndefinedPixelTrait)
               SetPixelAlpha(image,ScaleCharToQuantum(*p++),q);
             q+=GetPixelChannels(image);
           }
@@ -497,7 +497,7 @@ static Image *ReadRLEImage(const ImageInfo *image_info,ExceptionInfo *exception)
               p++;
             }
         p=pixels;
-        if (image->alpha_trait != BlendPixelTrait)
+        if (image->alpha_trait == UndefinedPixelTrait)
           {
             /*
               Convert raster image to PseudoClass pixel packets.
index 8ece34cd513595ecc20454c6c3c33d52aecdeff4..c42f73fdccc3c076707eb9041c6cdfce8830e770 100644 (file)
@@ -575,7 +575,7 @@ static Image *ReadSGIImage(const ImageInfo *image_info,ExceptionInfo *exception)
                 SetPixelBlue(image,ScaleShortToQuantum((unsigned short)
                   ((*(p+4) << 8) | (*(p+5)))),q);
                 SetPixelAlpha(image,OpaqueAlpha,q);
-                if (image->alpha_trait == BlendPixelTrait)
+                if (image->alpha_trait != UndefinedPixelTrait)
                   SetPixelAlpha(image,ScaleShortToQuantum((unsigned short)
                     ((*(p+6) << 8) | (*(p+7)))),q);
                 p+=8;
@@ -605,7 +605,7 @@ static Image *ReadSGIImage(const ImageInfo *image_info,ExceptionInfo *exception)
               SetPixelGreen(image,ScaleCharToQuantum(*(p+1)),q);
               SetPixelBlue(image,ScaleCharToQuantum(*(p+2)),q);
               SetPixelAlpha(image,OpaqueAlpha,q);
-              if (image->alpha_trait == BlendPixelTrait)
+              if (image->alpha_trait != UndefinedPixelTrait)
                 SetPixelAlpha(image,ScaleCharToQuantum(*(p+3)),q);
               p+=4;
               q+=GetPixelChannels(image);
@@ -943,7 +943,7 @@ static MagickBooleanType WriteSGIImage(const ImageInfo *image_info,Image *image,
     iris_info.dimension=3;
     iris_info.columns=(unsigned short) image->columns;
     iris_info.rows=(unsigned short) image->rows;
-    if (image->alpha_trait == BlendPixelTrait)
+    if (image->alpha_trait != UndefinedPixelTrait)
       iris_info.depth=4;
     else
       {
index a0225c6a9786e6342f0f52921d031bc3cf7f167a..50d3d743b1d7d4f59b05d127c6962c5554aff491 100644 (file)
@@ -1211,7 +1211,7 @@ static MagickBooleanType WriteSIXELImage(const ImageInfo *image_info,Image *imag
   if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
     (void) TransformImageColorspace(image,sRGBColorspace,exception);
   opacity=(-1);
-  if (image->alpha_trait != BlendPixelTrait)
+  if (image->alpha_trait == UndefinedPixelTrait)
     {
       if ((image->storage_class == DirectClass) || (image->colors > 256))
         (void) SetImageType(image,PaletteType,exception);
index 4cdc1ea4db7aecb089b67fea704676b532395167..52d7aec759c9a46b495b23fa57ef9fc8d1f75a30 100644 (file)
@@ -511,7 +511,7 @@ static Image *ReadSUNImage(const ImageInfo *image_info,ExceptionInfo *exception)
             bytes_per_pixel;
 
           bytes_per_pixel=3;
-          if (image->alpha_trait == BlendPixelTrait)
+          if (image->alpha_trait != UndefinedPixelTrait)
             bytes_per_pixel++;
           length=image->rows*((bytes_per_line*image->columns)+
             image->columns % 2);
@@ -526,7 +526,7 @@ static Image *ReadSUNImage(const ImageInfo *image_info,ExceptionInfo *exception)
               break;
             for (x=0; x < (ssize_t) image->columns; x++)
             {
-              if (image->alpha_trait == BlendPixelTrait)
+              if (image->alpha_trait != UndefinedPixelTrait)
                 SetPixelAlpha(image,ScaleCharToQuantum(*p++),q);
               if (sun_info.type == RT_STANDARD)
                 {
@@ -781,9 +781,9 @@ static MagickBooleanType WriteSUNImage(const ImageInfo *image_info,Image *image,
         /*
           Full color SUN raster.
         */
-        sun_info.depth=(unsigned int) image->alpha_trait == BlendPixelTrait ?
+        sun_info.depth=(unsigned int) image->alpha_trait != UndefinedPixelTrait ?
           32U : 24U;
-        sun_info.length=(unsigned int) ((image->alpha_trait == BlendPixelTrait ?
+        sun_info.length=(unsigned int) ((image->alpha_trait != UndefinedPixelTrait ?
           4 : 3)*number_pixels);
         sun_info.length+=sun_info.length & 0x01 ? (unsigned int) image->rows :
           0;
@@ -844,7 +844,7 @@ static MagickBooleanType WriteSUNImage(const ImageInfo *image_info,Image *image,
           Allocate memory for pixels.
         */
         bytes_per_pixel=3;
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           bytes_per_pixel++;
         length=image->columns;
         pixels=(unsigned char *) AcquireQuantumMemory(length,4*sizeof(*pixels));
@@ -861,7 +861,7 @@ static MagickBooleanType WriteSUNImage(const ImageInfo *image_info,Image *image,
           q=pixels;
           for (x=0; x < (ssize_t) image->columns; x++)
           {
-            if (image->alpha_trait == BlendPixelTrait)
+            if (image->alpha_trait != UndefinedPixelTrait)
               *q++=ScaleQuantumToChar(GetPixelAlpha(image,p));
             *q++=ScaleQuantumToChar(GetPixelRed(image,p));
             *q++=ScaleQuantumToChar(GetPixelGreen(image,p));
index 308cfb267f5d0bef14c830d2d35a3bc41ccaafcb..22a509e392cd59782cb0eee99078c4faf90be97b 100644 (file)
@@ -463,7 +463,7 @@ static Image *ReadTGAImage(const ImageInfo *image_info,
             pixel.green=(MagickRealType) ScaleAnyToQuantum((1UL*(k & 0x03)
               << 3)+(1UL*(j & 0xe0) >> 5),range);
             pixel.blue=(MagickRealType) ScaleAnyToQuantum(1UL*(j & 0x1f),range);
-            if (image->alpha_trait == BlendPixelTrait)
+            if (image->alpha_trait != UndefinedPixelTrait)
               pixel.alpha=(MagickRealType) ((k & 0x80) == 0 ? (Quantum)
                 OpaqueAlpha : (Quantum) TransparentAlpha); 
             if (image->storage_class == PseudoClass)
@@ -503,7 +503,7 @@ static Image *ReadTGAImage(const ImageInfo *image_info,
       SetPixelRed(image,ClampToQuantum(pixel.red),q);
       SetPixelGreen(image,ClampToQuantum(pixel.green),q);
       SetPixelBlue(image,ClampToQuantum(pixel.blue),q);
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         SetPixelAlpha(image,ClampToQuantum(pixel.alpha),q);
       q+=GetPixelChannels(image);
     }
@@ -673,7 +673,7 @@ static inline void WriteTGAPixel(Image *image,TGAImageType image_type,
           (void) WriteBlobByte(image,ScaleQuantumToChar(GetPixelGreen(image,
             p)));
           (void) WriteBlobByte(image,ScaleQuantumToChar(GetPixelRed(image,p)));
-          if (image->alpha_trait == BlendPixelTrait)
+          if (image->alpha_trait != UndefinedPixelTrait)
             (void) WriteBlobByte(image,ScaleQuantumToChar(GetPixelAlpha(image,
               p)));
         }
@@ -754,7 +754,7 @@ static MagickBooleanType WriteTGAImage(const ImageInfo *image_info,Image *image,
   if ((image_info->type != TrueColorType) &&
       (image_info->type != TrueColorMatteType) &&
       (image_info->type != PaletteType) &&
-      (image->alpha_trait != BlendPixelTrait) &&
+      (image->alpha_trait == UndefinedPixelTrait) &&
       (IsImageGray(image,exception) != MagickFalse))
     tga_info.image_type=compression == RLECompression ? TGARLEMonochrome :
       TGAMonochrome;
@@ -767,7 +767,7 @@ static MagickBooleanType WriteTGAImage(const ImageInfo *image_info,Image *image,
         tga_info.image_type=compression == RLECompression ? TGARLERGB :
           TGARGB;
         tga_info.bits_per_pixel=24;
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           {
             tga_info.bits_per_pixel=32;
             tga_info.attributes=8;  /* # of alpha bits */
@@ -865,7 +865,7 @@ static MagickBooleanType WriteTGAImage(const ImageInfo *image_info,Image *image,
                     (GetPixelRed(image,p+(i*channels)) !=
                      GetPixelRed(image,p+((i-1)*channels))))
                   break;
-                if ((image->alpha_trait == BlendPixelTrait) &&
+                if ((image->alpha_trait != UndefinedPixelTrait) &&
                     (GetPixelAlpha(image,p+(i*channels)) !=
                      GetPixelAlpha(image,p+(i-1)*channels)))
                   break;
index 58e7e11a26f089d64c948a0eff616bad34fe3de0..9fb99929e4d815e0487df3d8f67cacfe95dfec79 100644 (file)
@@ -205,7 +205,7 @@ static MagickBooleanType WriteTHUMBNAILImage(const ImageInfo *image_info,
     length,exception);
   if (thumbnail_image == (Image *) NULL)
     return(MagickFalse);
-  (void) SetImageType(thumbnail_image,thumbnail_image->alpha_trait != BlendPixelTrait ?
+  (void) SetImageType(thumbnail_image,thumbnail_image->alpha_trait == UndefinedPixelTrait ?
     TrueColorType : TrueColorMatteType,exception);
   (void) CopyMagickString(thumbnail_image->filename,image->filename,
     MaxTextExtent);
index 80834102d159f6b7c949e2df97210309208a34e7..1a4d57fa8365190ae8bd420f76dda2f400f618b4 100644 (file)
@@ -1496,7 +1496,7 @@ RestoreMSCWarning
           }
         quantum_type=IndexQuantum;
         pad=(size_t) MagickMax((size_t) samples_per_pixel-1,0);
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           {
             if (image->storage_class != PseudoClass)
               {
@@ -1558,7 +1558,7 @@ RestoreMSCWarning
         */
         pad=(size_t) MagickMax((size_t) samples_per_pixel-3,0);
         quantum_type=RGBQuantum;
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           {
             quantum_type=RGBAQuantum;
             pad=(size_t) MagickMax((size_t) samples_per_pixel-4,0);
@@ -1567,7 +1567,7 @@ RestoreMSCWarning
           {
             pad=(size_t) MagickMax((size_t) samples_per_pixel-4,0);
             quantum_type=CMYKQuantum;
-            if (image->alpha_trait == BlendPixelTrait)
+            if (image->alpha_trait != UndefinedPixelTrait)
               {
                 quantum_type=CMYKAQuantum;
                 pad=(size_t) MagickMax((size_t) samples_per_pixel-5,0);
@@ -1751,7 +1751,7 @@ RestoreMSCWarning
               (TIFFGetG(*p))),q);
             SetPixelBlue(image,ScaleCharToQuantum((unsigned char)
               (TIFFGetB(*p))),q);
-            if (image->alpha_trait == BlendPixelTrait)
+            if (image->alpha_trait != UndefinedPixelTrait)
               SetPixelAlpha(image,ScaleCharToQuantum((unsigned char)
                 (TIFFGetA(*p))),q);
             p++;
@@ -1836,7 +1836,7 @@ RestoreMSCWarning
               x);
             for (row=rows_remaining; row > 0; row--)
             {
-              if (image->alpha_trait == BlendPixelTrait)
+              if (image->alpha_trait != UndefinedPixelTrait)
                 for (column=columns_remaining; column > 0; column--)
                 {
                   SetPixelRed(image,ScaleCharToQuantum((unsigned char)
@@ -1934,7 +1934,7 @@ RestoreMSCWarning
               TIFFGetG(*p)),q);
             SetPixelBlue(image,ScaleCharToQuantum((unsigned char) TIFFGetB(*p)),
               q);
-            if (image->alpha_trait == BlendPixelTrait)
+            if (image->alpha_trait != UndefinedPixelTrait)
               SetPixelAlpha(image,ScaleCharToQuantum((unsigned char)
                 TIFFGetA(*p)),q);
             p--;
@@ -3228,7 +3228,7 @@ static MagickBooleanType WriteTIFFImage(const ImageInfo *image_info,
                   PHOTOMETRIC_MINISBLACK);
                 (void) TIFFSetField(tiff,TIFFTAG_SAMPLESPERPIXEL,1);
                 if ((image_info->depth == 0) &&
-                    (image->alpha_trait != BlendPixelTrait) &&
+                    (image->alpha_trait == UndefinedPixelTrait) &&
                     (IsImageMonochrome(image,exception) != MagickFalse))
                   {
                     status=SetQuantumDepth(image,quantum_info,1);
@@ -3283,7 +3283,7 @@ static MagickBooleanType WriteTIFFImage(const ImageInfo *image_info,
     (void) TIFFSetField(tiff,TIFFTAG_COMPRESSION,compress_tag);
     (void) TIFFSetField(tiff,TIFFTAG_FILLORDER,endian);
     (void) TIFFSetField(tiff,TIFFTAG_BITSPERSAMPLE,quantum_info->depth);
-    if (image->alpha_trait == BlendPixelTrait)
+    if (image->alpha_trait != UndefinedPixelTrait)
       {
         uint16
           extra_samples,
@@ -3562,7 +3562,7 @@ RestoreMSCWarning
           default:
           {
             quantum_type=RGBQuantum;
-            if (image->alpha_trait == BlendPixelTrait)
+            if (image->alpha_trait != UndefinedPixelTrait)
               quantum_type=RGBAQuantum;
             for (y=0; y < (ssize_t) image->rows; y++)
             {
@@ -3650,7 +3650,7 @@ RestoreMSCWarning
                 if (status == MagickFalse)
                   break;
               }
-            if (image->alpha_trait == BlendPixelTrait)
+            if (image->alpha_trait != UndefinedPixelTrait)
               for (y=0; y < (ssize_t) image->rows; y++)
               {
                 register const Quantum
@@ -3681,7 +3681,7 @@ RestoreMSCWarning
           CMYK TIFF image.
         */
         quantum_type=CMYKQuantum;
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           quantum_type=CMYKAQuantum;
         if (image->colorspace != CMYKColorspace)
           (void) TransformImageColorspace(image,CMYKColorspace,exception);
@@ -3746,7 +3746,7 @@ RestoreMSCWarning
           Convert PseudoClass packets to contiguous grayscale scanlines.
         */
         quantum_type=IndexQuantum;
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           {
             if (photometric != PHOTOMETRIC_PALETTE)
               quantum_type=GrayAlphaQuantum;
index 6a9f6d5f26019631f4c4230fe264c43ab7d31e5d..81532bd50b2cbd17a8aa2a88380f64a8446af471 100644 (file)
@@ -118,7 +118,7 @@ static Image *ReadTILEImage(const ImageInfo *image_info,
     ThrowReaderException(OptionError,"MustSpecifyAnImageName");
   image->colorspace=tile_image->colorspace;
   image->alpha_trait=tile_image->alpha_trait;
-  if (image->alpha_trait == BlendPixelTrait)
+  if (image->alpha_trait != UndefinedPixelTrait)
     (void) SetImageBackgroundColor(image,exception);
   (void) CopyMagickString(image->filename,image_info->filename,MaxTextExtent);
   if (LocaleCompare(tile_image->magick,"PATTERN") == 0)
index 0d23dd68d2be6ce99b4ca82388d9870bda11cb3e..11bfb516179df123f7dd807d0b5219e51f149a1f 100644 (file)
@@ -470,7 +470,7 @@ static Image *ReadTXTImage(const ImageInfo *image_info,ExceptionInfo *exception)
         {
           case GRAYColorspace:
           {
-            if (image->alpha_trait == BlendPixelTrait)
+            if (image->alpha_trait != UndefinedPixelTrait)
               {
                 count=(ssize_t) sscanf(text,"%ld,%ld: (%lf%*[%,]%lf%*[%,]",
                   &x_offset,&y_offset,&red,&alpha);
@@ -486,7 +486,7 @@ static Image *ReadTXTImage(const ImageInfo *image_info,ExceptionInfo *exception)
           }
           case CMYKColorspace:
           {
-            if (image->alpha_trait == BlendPixelTrait)
+            if (image->alpha_trait != UndefinedPixelTrait)
               {
                 count=(ssize_t) sscanf(text,
                   "%ld,%ld: (%lf%*[%,]%lf%*[%,]%lf%*[%,]%lf%*[%,]%lf%*[%,]",
@@ -500,7 +500,7 @@ static Image *ReadTXTImage(const ImageInfo *image_info,ExceptionInfo *exception)
           }
           default:
           {
-            if (image->alpha_trait == BlendPixelTrait)
+            if (image->alpha_trait != UndefinedPixelTrait)
               {
                 count=(ssize_t) sscanf(text,
                   "%ld,%ld: (%lf%*[%,]%lf%*[%,]%lf%*[%,]%lf%*[%,]",
@@ -716,7 +716,7 @@ static MagickBooleanType WriteTXTImage(const ImageInfo *image_info,Image *image,
       MagickColorspaceOptions,(ssize_t) image->colorspace),MaxTextExtent);
     LocaleLower(colorspace);
     image->depth=GetImageQuantumDepth(image,MagickTrue);
-    if (image->alpha_trait == BlendPixelTrait)
+    if (image->alpha_trait != UndefinedPixelTrait)
       (void) ConcatenateMagickString(colorspace,"a",MaxTextExtent);
     compliance=NoCompliance;
     if (LocaleCompare(image_info->magick,"SPARSE-COLOR") != 0)
@@ -781,7 +781,7 @@ static MagickBooleanType WriteTXTImage(const ImageInfo *image_info,Image *image,
             ConcatenateColorComponent(&pixel,BlackPixelChannel,compliance,
               tuple);
           }
-        if (pixel.alpha_trait == BlendPixelTrait)
+        if (pixel.alpha_trait != UndefinedPixelTrait)
           {
             (void) ConcatenateMagickString(tuple,",",MaxTextExtent);
             ConcatenateColorComponent(&pixel,AlphaPixelChannel,compliance,
index 8496adee348bdea15b6ec41d4a43e51299c949d1..ee50aaaa44d82387c6dc8decbf3d5d54c27f0c42 100644 (file)
@@ -229,7 +229,7 @@ static MagickBooleanType WriteUILImage(const ImageInfo *image_info,Image *image,
         Convert DirectClass to PseudoClass image.
       */
       matte_image=(unsigned char *) NULL;
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         {
           /*
             Map all the transparent pixels.
index 7c5855a1a3b625e3e2a53c789121cc7cc264b6d7..70c7ccb70085545580ee836c628fa706f473ebfa 100644 (file)
@@ -704,7 +704,7 @@ static Image *ReadVIFFImage(const ImageInfo *image_info,
                   SetPixelBlue(image,image->colormap[(ssize_t)
                     GetPixelBlue(image,q)].blue,q);
                 }
-              SetPixelAlpha(image,image->alpha_trait == BlendPixelTrait ?
+              SetPixelAlpha(image,image->alpha_trait != UndefinedPixelTrait ?
                 ScaleCharToQuantum(*(p+number_pixels*3)) : OpaqueAlpha,q);
               p++;
               q+=GetPixelChannels(image);
@@ -1105,7 +1105,7 @@ RestoreMSCWarning
             *q=ScaleQuantumToChar(GetPixelRed(image,p));
             *(q+number_pixels)=ScaleQuantumToChar(GetPixelGreen(image,p));
             *(q+number_pixels*2)=ScaleQuantumToChar(GetPixelBlue(image,p));
-            if (image->alpha_trait == BlendPixelTrait)
+            if (image->alpha_trait != UndefinedPixelTrait)
               *(q+number_pixels*3)=ScaleQuantumToChar((Quantum)
                 (GetPixelAlpha(image,p)));
             p+=GetPixelChannels(image);
index da380e0d3f47fc0afd77d5520782206fe4c5de82..e736ddb46f18c0a09ae22953e72ccb4b893055bb 100644 (file)
@@ -648,11 +648,11 @@ static MagickBooleanType WriteVIPSImage(const ImageInfo *image_info,
   (void) WriteBlobLong(image,(unsigned int) image->columns);
   (void) WriteBlobLong(image,(unsigned int) image->rows);
   (void) SetImageStorageClass(image,DirectClass,exception);
-  channels=image->alpha_trait == BlendPixelTrait ? 4 : 3;
+  channels=image->alpha_trait != UndefinedPixelTrait ? 4 : 3;
   if (IsImageGray(image,exception) != MagickFalse)
-    channels=image->alpha_trait == BlendPixelTrait ? 2 : 1;
+    channels=image->alpha_trait != UndefinedPixelTrait ? 2 : 1;
   else if (image->colorspace == CMYKColorspace)
-    channels=image->alpha_trait == BlendPixelTrait ? 5 : 4;
+    channels=image->alpha_trait != UndefinedPixelTrait ? 5 : 4;
   (void) WriteBlobLong(image,channels);
   (void) WriteBlobLong(image,0);
   if (image->depth == 16)
index f56453a395d99ada0dba595507378b9ed1404e70..2a93b145b0f37a2b713ff9605dd455daddce2936 100644 (file)
@@ -668,7 +668,7 @@ static MagickBooleanType WriteWEBPImage(const ImageInfo *image_info,
       break;
     for (x=0; x < (ssize_t) image->columns; x++)
     {
-      *q++=(uint32_t) (image->alpha_trait == BlendPixelTrait ?
+      *q++=(uint32_t) (image->alpha_trait != UndefinedPixelTrait ?
         ScaleQuantumToChar(GetPixelAlpha(image,p)) << 24 : 0xff000000) |
         (ScaleQuantumToChar(GetPixelRed(image,p)) << 16) |
         (ScaleQuantumToChar(GetPixelGreen(image,p)) << 8) |
index 3c3e38eaf439d8893f2bbf35b2b93ad418f42fc8..983d571ceaaf18cf70c9704ab1471ff54a0d9851 100644 (file)
@@ -684,7 +684,7 @@ static MagickBooleanType WritePICONImage(const ImageInfo *image_info,
   if (picon->storage_class == PseudoClass)
     {
       (void) CompressImageColormap(picon,exception);
-      if (picon->alpha_trait == BlendPixelTrait)
+      if (picon->alpha_trait != UndefinedPixelTrait)
         transparent=MagickTrue;
     }
   else
@@ -692,7 +692,7 @@ static MagickBooleanType WritePICONImage(const ImageInfo *image_info,
       /*
         Convert DirectClass to PseudoClass picon.
       */
-      if (picon->alpha_trait == BlendPixelTrait)
+      if (picon->alpha_trait != UndefinedPixelTrait)
         {
           /*
             Map all the transparent pixels.
@@ -908,7 +908,7 @@ static MagickBooleanType WriteXPMImage(const ImageInfo *image_info,Image *image,
   if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
     (void) TransformImageColorspace(image,sRGBColorspace,exception);
   opacity=(-1);
-  if (image->alpha_trait != BlendPixelTrait)
+  if (image->alpha_trait == UndefinedPixelTrait)
     {
       if ((image->storage_class == DirectClass) || (image->colors > 256))
         (void) SetImageType(image,PaletteType,exception);
index fa1ad047c399d824657bca015d911642dba2a2a1..061020b13dd0815d65f8399d83245511fdf798c7 100644 (file)
@@ -249,7 +249,7 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info,
                 SetPixelRed(image,GetPixelRed(canvas_image,p),q);
                 SetPixelGreen(image,GetPixelGreen(canvas_image,p),q);
                 SetPixelBlue(image,GetPixelBlue(canvas_image,p),q);
-                if (image->alpha_trait == BlendPixelTrait)
+                if (image->alpha_trait != UndefinedPixelTrait)
                   SetPixelAlpha(image,GetPixelAlpha(canvas_image,p),q);
                 p+=GetPixelChannels(canvas_image);
                 q+=GetPixelChannels(image);
@@ -289,7 +289,7 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info,
           }
         for (y=0; y < (ssize_t) image->extract_info.height; y++)
         {
-          for (i=0; i < (image->alpha_trait == BlendPixelTrait ? 4 : 3); i++)
+          for (i=0; i < (image->alpha_trait != UndefinedPixelTrait ? 4 : 3); i++)
           {
             if (count != (ssize_t) length)
               {
@@ -500,7 +500,7 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info,
             if (status == MagickFalse)
               break;
           }
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           {
             for (y=0; y < (ssize_t) image->extract_info.height; y++)
             {
@@ -748,7 +748,7 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info,
             if (status == MagickFalse)
               break;
           }
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           {
             (void) CloseBlob(image);
             AppendImageFormat("A",image->filename);
@@ -1018,7 +1018,7 @@ static MagickBooleanType WriteYCBCRImage(const ImageInfo *image_info,
     if (image->colorspace != YCbCrColorspace)
       (void) TransformImageColorspace(image,YCbCrColorspace,exception);
     if ((LocaleCompare(image_info->magick,"YCbCrA") == 0) &&
-        (image->alpha_trait != BlendPixelTrait))
+        (image->alpha_trait == UndefinedPixelTrait))
       (void) SetImageAlphaChannel(image,OpaqueAlphaChannel,exception);
     quantum_info=AcquireQuantumInfo(image_info,image);
     if (quantum_info == (QuantumInfo *) NULL)