]> granicus.if.org Git - imagemagick/commitdiff
improve EPS aliasing
authorCristy <urban-warrior@imagemagick.org>
Sat, 12 Aug 2017 11:55:19 +0000 (07:55 -0400)
committerCristy <urban-warrior@imagemagick.org>
Sat, 12 Aug 2017 11:55:19 +0000 (07:55 -0400)
24 files changed:
ChangeLog
MagickCore/attribute.c
MagickCore/cache.c
MagickCore/channel.c
MagickCore/compare.c
MagickCore/composite.c
MagickCore/decorate.c
MagickCore/effect.c
MagickCore/enhance.c
MagickCore/fx.c
MagickCore/identify.c
MagickCore/image.c
MagickCore/paint.c
MagickCore/quantum-export.c
MagickCore/quantum-import.c
MagickCore/resize.c
MagickCore/shear.c
MagickCore/signature.c
MagickCore/statistic.c
MagickCore/threshold.c
MagickCore/transform.c
coders/json.c
coders/ps.c
coders/wmf.c

index 2ad4c60977fc8319e2dc64012c134eef16d7cc9f..fd48aad50f40d2ce789b9f115ff54fe5124c8e9c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2017-08-12  7.0.6-7 Cristy  <quetzlzacatenango@image...>
+  * Improve EPS aliasing (reference
+    https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=32497).
+
 2017-08-11  7.0.6-7 Dirk Lemstra <dirk@lem.....org>
   * Added a new option called 'dds:fast-mipmaps' (reference
     https://github.com/ImageMagick/ImageMagick/issues/558)
index 0c96da62eb53018cf4f9b8706963e79ba86a3e80..1d1ffbfeab5fd29917e6eee5cfeca2e959a53aaa 100644 (file)
@@ -405,7 +405,7 @@ MagickExport size_t GetImageDepth(const Image *image,ExceptionInfo *exception)
           register ssize_t
             i;
 
-          if (GetPixelWriteMask(image,p) == 0)
+          if (GetPixelWriteMask(image,p) <= (QuantumRange/2))
             {
               p+=GetPixelChannels(image);
               continue;
@@ -465,7 +465,7 @@ MagickExport size_t GetImageDepth(const Image *image,ExceptionInfo *exception)
       register ssize_t
         i;
 
-      if (GetPixelWriteMask(image,p) == 0)
+      if (GetPixelWriteMask(image,p) <= (QuantumRange/2))
         {
           p+=GetPixelChannels(image);
           continue;
@@ -1096,7 +1096,7 @@ MagickExport MagickBooleanType SetImageDepth(Image *image,
           register ssize_t
             i;
 
-          if (GetPixelWriteMask(image,q) == 0)
+          if (GetPixelWriteMask(image,q) <= (QuantumRange/2))
             {
               q+=GetPixelChannels(image);
               continue;
@@ -1160,7 +1160,7 @@ MagickExport MagickBooleanType SetImageDepth(Image *image,
       register ssize_t
         i;
 
-      if (GetPixelWriteMask(image,q) == 0)
+      if (GetPixelWriteMask(image,q) <= (QuantumRange/2))
         {
           q+=GetPixelChannels(image);
           continue;
index 0407ff46b124d292e4f0ab51e206ac471d158717..eb2ac1684b2bd0bd1cfd295afb18aea556ffb579 100644 (file)
@@ -3860,7 +3860,7 @@ MagickExport MagickBooleanType PersistPixelCache(Image *image,
   /*
     Clone persistent pixel cache.
   */
-  clone_info=ClonePixelCache(cache_info);
+  clone_info=(CacheInfo *) ClonePixelCache(cache_info);
   clone_info->type=DiskCache;
   (void) CopyMagickString(clone_info->cache_filename,filename,MagickPathExtent);
   clone_info->file=(-1);
@@ -3880,7 +3880,7 @@ MagickExport MagickBooleanType PersistPixelCache(Image *image,
   clone_info->offset=(*offset);
   status=ClonePixelCacheRepository(clone_info,cache_info,exception);
   *offset+=cache_info->length+page_size-(cache_info->length % page_size);
-  clone_info=DestroyPixelCache(clone_info);
+  clone_info=(CacheInfo *) DestroyPixelCache(clone_info);
   return(status);
 }
 \f
index c05566e6fa7bfddb409d2cd846a7c569adde8ec3..ae0e034bdf43d2378b78a004df4afc58000eb9cc 100644 (file)
@@ -771,7 +771,7 @@ MagickExport Image *SeparateImage(const Image *image,
       register ssize_t
         i;
 
-      if (GetPixelWriteMask(image,p) == 0)
+      if (GetPixelWriteMask(image,p) <= (QuantumRange/2))
         {
           SetPixelBackgoundColor(separate_image,q);
           p+=GetPixelChannels(image);
@@ -1025,7 +1025,7 @@ MagickExport MagickBooleanType SetImageAlphaChannel(Image *image,
           register ssize_t
             i;
 
-          if (GetPixelWriteMask(image,q) == 0)
+          if (GetPixelWriteMask(image,q) <= (QuantumRange/2))
             {
               q+=GetPixelChannels(image);
               continue;
@@ -1151,7 +1151,7 @@ MagickExport MagickBooleanType SetImageAlphaChannel(Image *image,
           register ssize_t
             i;
 
-          if (GetPixelWriteMask(image,q) == 0)
+          if (GetPixelWriteMask(image,q) <= (QuantumRange/2))
             {
               q+=GetPixelChannels(image);
               continue;
index 768aa18c33a62e85427012d9c43adcfaeabd0c5c..dfd4df50e13e18fce441c011030e826891ad84f7 100644 (file)
@@ -266,7 +266,7 @@ MagickExport Image *CompareImages(Image *image,const Image *reconstruct_image,
       register ssize_t
         i;
 
-      if ((GetPixelReadMask(image,p) == 0) ||
+      if ((GetPixelReadMask(image,p) <= (QuantumRange/2)) ||
           (GetPixelReadMask(reconstruct_image,q) == 0))
         {
           SetPixelViaPixelInfo(highlight_image,&masklight,r);
@@ -424,7 +424,7 @@ static MagickBooleanType GetAbsoluteDistortion(const Image *image,
       register ssize_t
         i;
 
-      if (GetPixelWriteMask(image,p) == 0)
+      if (GetPixelWriteMask(image,p) <= (QuantumRange/2))
         {
           p+=GetPixelChannels(image);
           q+=GetPixelChannels(reconstruct_image);
@@ -533,7 +533,7 @@ static MagickBooleanType GetFuzzDistortion(const Image *image,
       register ssize_t
         i;
 
-      if ((GetPixelReadMask(image,p) == 0) ||
+      if ((GetPixelReadMask(image,p) <= (QuantumRange/2)) ||
           (GetPixelReadMask(reconstruct_image,q) == 0))
         {
           p+=GetPixelChannels(image);
@@ -644,7 +644,7 @@ static MagickBooleanType GetMeanAbsoluteDistortion(const Image *image,
       register ssize_t
         i;
 
-      if ((GetPixelReadMask(image,p) == 0) ||
+      if ((GetPixelReadMask(image,p) <= (QuantumRange/2)) ||
           (GetPixelReadMask(reconstruct_image,q) == 0))
         {
           p+=GetPixelChannels(image);
@@ -745,7 +745,7 @@ static MagickBooleanType GetMeanErrorPerPixel(Image *image,
       register ssize_t
         i;
 
-      if ((GetPixelReadMask(image,p) == 0) ||
+      if ((GetPixelReadMask(image,p) <= (QuantumRange/2)) ||
           (GetPixelReadMask(reconstruct_image,q) == 0))
         {
           p+=GetPixelChannels(image);
@@ -851,7 +851,7 @@ static MagickBooleanType GetMeanSquaredDistortion(const Image *image,
       register ssize_t
         i;
 
-      if ((GetPixelReadMask(image,p) == 0) ||
+      if ((GetPixelReadMask(image,p) <= (QuantumRange/2)) ||
           (GetPixelReadMask(reconstruct_image,q) == 0))
         {
           p+=GetPixelChannels(image);
@@ -973,7 +973,7 @@ static MagickBooleanType GetNormalizedCrossCorrelationDistortion(
       }
     for (x=0; x < (ssize_t) columns; x++)
     {
-      if ((GetPixelReadMask(image,p) == 0) ||
+      if ((GetPixelReadMask(image,p) <= (QuantumRange/2)) ||
           (GetPixelReadMask(reconstruct_image,q) == 0))
         {
           p+=GetPixelChannels(image);
@@ -1008,7 +1008,7 @@ static MagickBooleanType GetNormalizedCrossCorrelationDistortion(
         Da,
         Sa;
 
-      if ((GetPixelReadMask(image,p) == 0) ||
+      if ((GetPixelReadMask(image,p) <= (QuantumRange/2)) ||
           (GetPixelReadMask(reconstruct_image,q) == 0))
         {
           p+=GetPixelChannels(image);
@@ -1148,7 +1148,7 @@ static MagickBooleanType GetPeakAbsoluteDistortion(const Image *image,
       register ssize_t
         i;
 
-      if ((GetPixelReadMask(image,p) == 0) ||
+      if ((GetPixelReadMask(image,p) <= (QuantumRange/2)) ||
           (GetPixelReadMask(reconstruct_image,q) == 0))
         {
           p+=GetPixelChannels(image);
@@ -1621,7 +1621,7 @@ MagickExport MagickBooleanType IsImagesEqual(const Image *image,
       register ssize_t
         i;
 
-      if (GetPixelWriteMask(image,p) == 0)
+      if (GetPixelWriteMask(image,p) <= (QuantumRange/2))
         {
           p+=GetPixelChannels(image);
           q+=GetPixelChannels(reconstruct_image);
@@ -1760,7 +1760,7 @@ MagickExport MagickBooleanType SetImageColorMetric(Image *image,
       register ssize_t
         i;
 
-      if (GetPixelWriteMask(image,p) == 0)
+      if (GetPixelWriteMask(image,p) <= (QuantumRange/2))
         {
           p+=GetPixelChannels(image);
           q+=GetPixelChannels(reconstruct_image);
@@ -1978,7 +1978,7 @@ MagickExport Image *SimilarityImage(const Image *image,const Image *reference,
         }
       if (metric == PerceptualHashErrorMetric)
         similarity=MagickMin(0.01*similarity,1.0);
-      if (GetPixelWriteMask(similarity_image,q) == 0)
+      if (GetPixelWriteMask(similarity_image,q) <= (QuantumRange/2))
         {
           SetPixelBackgoundColor(similarity_image,q);
           q+=GetPixelChannels(similarity_image);
index d1e8cf26cf4d759ef20d721c4a89c28e93d14ebd..7a170105bf13f7689f611736d6856ee1628ec07d 100644 (file)
@@ -420,7 +420,7 @@ static MagickBooleanType CompositeOverImage(Image *image,
           */
           (void) GetOneVirtualPixel(source_image,x-x_offset,y-y_offset,source,
             exception);
-          if (GetPixelWriteMask(image,q) == 0)
+          if (GetPixelWriteMask(image,q) <= (QuantumRange/2))
             {
               q+=GetPixelChannels(image);
               continue;
@@ -455,7 +455,7 @@ static MagickBooleanType CompositeOverImage(Image *image,
       Sa=QuantumScale*GetPixelAlpha(source_image,p);
       Da=QuantumScale*GetPixelAlpha(image,q);
       alpha=Sa+Da-Sa*Da;
-      if (GetPixelWriteMask(image,q) == 0)
+      if (GetPixelWriteMask(image,q) <= (QuantumRange/2))
         {
           p+=GetPixelChannels(source_image);
           q+=GetPixelChannels(image);
@@ -659,7 +659,7 @@ MagickExport MagickBooleanType CompositeImage(Image *image,
           register ssize_t
             i;
 
-          if (GetPixelReadMask(source_image,p) == 0)
+          if (GetPixelReadMask(source_image,p) <= (QuantumRange/2))
             {
               p+=GetPixelChannels(source_image);
               q+=GetPixelChannels(image);
@@ -745,7 +745,7 @@ MagickExport MagickBooleanType CompositeImage(Image *image,
           }
         for (x=0; x < (ssize_t) source_image->columns; x++)
         {
-          if (GetPixelReadMask(source_image,p) == 0)
+          if (GetPixelReadMask(source_image,p) <= (QuantumRange/2))
             {
               p+=GetPixelChannels(source_image);
               q+=GetPixelChannels(image);
@@ -1341,7 +1341,7 @@ MagickExport MagickBooleanType CompositeImage(Image *image,
           */
           (void) GetOneVirtualPixel(source_image,x-x_offset,y-y_offset,source,
             exception);
-          if (GetPixelWriteMask(image,q) == 0)
+          if (GetPixelWriteMask(image,q) <= (QuantumRange/2))
             {
               q+=GetPixelChannels(image);
               continue;
@@ -1500,7 +1500,7 @@ MagickExport MagickBooleanType CompositeImage(Image *image,
           break;
         }
       }
-      if (GetPixelWriteMask(image,q) == 0)
+      if (GetPixelWriteMask(image,q) <= (QuantumRange/2))
         {
           p+=GetPixelChannels(source_image);
           q+=GetPixelChannels(image);
@@ -2503,7 +2503,7 @@ MagickExport MagickBooleanType TextureImage(Image *image,const Image *texture,
         register ssize_t
           i;
 
-        if (GetPixelWriteMask(image,q) == 0)
+        if (GetPixelWriteMask(image,q) <= (QuantumRange/2))
           {
             p+=GetPixelChannels(texture_image);
             q+=GetPixelChannels(image);
index 43f35ecb231634c747e7f8c870d9f23ec3718499..2378cbc1d2ca219e7156e9b8a8ae0225c5f48b07 100644 (file)
@@ -679,7 +679,7 @@ MagickExport MagickBooleanType RaiseImage(Image *image,
       }
     for (x=0; x < y; x++)
     {
-      if (GetPixelWriteMask(image,q) == 0)
+      if (GetPixelWriteMask(image,q) <= (QuantumRange/2))
         {
           q+=GetPixelChannels(image);
           continue;
@@ -697,7 +697,7 @@ MagickExport MagickBooleanType RaiseImage(Image *image,
     }
     for ( ; x < (ssize_t) (image->columns-y); x++)
     {
-      if (GetPixelWriteMask(image,q) == 0)
+      if (GetPixelWriteMask(image,q) <= (QuantumRange/2))
         {
           q+=GetPixelChannels(image);
           continue;
@@ -715,7 +715,7 @@ MagickExport MagickBooleanType RaiseImage(Image *image,
     }
     for ( ; x < (ssize_t) image->columns; x++)
     {
-      if (GetPixelWriteMask(image,q) == 0)
+      if (GetPixelWriteMask(image,q) <= (QuantumRange/2))
         {
           q+=GetPixelChannels(image);
           continue;
@@ -769,7 +769,7 @@ MagickExport MagickBooleanType RaiseImage(Image *image,
       }
     for (x=0; x < (ssize_t) raise_info->width; x++)
     {
-      if (GetPixelWriteMask(image,q) == 0)
+      if (GetPixelWriteMask(image,q) <= (QuantumRange/2))
         {
           q+=GetPixelChannels(image);
           continue;
@@ -789,7 +789,7 @@ MagickExport MagickBooleanType RaiseImage(Image *image,
       q+=GetPixelChannels(image);
     for ( ; x < (ssize_t) image->columns; x++)
     {
-      if (GetPixelWriteMask(image,q) == 0)
+      if (GetPixelWriteMask(image,q) <= (QuantumRange/2))
         {
           q+=GetPixelChannels(image);
           continue;
@@ -843,7 +843,7 @@ MagickExport MagickBooleanType RaiseImage(Image *image,
       }
     for (x=0; x < (ssize_t) (image->rows-y); x++)
     {
-      if (GetPixelWriteMask(image,q) == 0)
+      if (GetPixelWriteMask(image,q) <= (QuantumRange/2))
         {
           q+=GetPixelChannels(image);
           continue;
@@ -874,7 +874,7 @@ MagickExport MagickBooleanType RaiseImage(Image *image,
     }
     for ( ; x < (ssize_t) image->columns; x++)
     {
-      if (GetPixelWriteMask(image,q) == 0)
+      if (GetPixelWriteMask(image,q) <= (QuantumRange/2))
         {
           q+=GetPixelChannels(image);
           continue;
index d67ec1cdaa916b8b30afea9d75360489cc409527..169ef60f44c35e3d85758a2dd97e25de0a5546ca 100644 (file)
@@ -2136,7 +2136,7 @@ MagickExport Image *MotionBlurImage(const Image *image,const double radius,
             (blur_traits == UndefinedPixelTrait))
           continue;
         if (((blur_traits & CopyPixelTrait) != 0) ||
-            (GetPixelWriteMask(image,p) == 0))
+            (GetPixelWriteMask(image,p) <= (QuantumRange/2)))
           {
             SetPixelChannel(blur_image,channel,p[i],q);
             continue;
@@ -2938,7 +2938,7 @@ MagickExport Image *RotationalBlurImage(const Image *image,const double angle,
             (blur_traits == UndefinedPixelTrait))
           continue;
         if (((blur_traits & CopyPixelTrait) != 0) ||
-            (GetPixelWriteMask(image,p) == 0))
+            (GetPixelWriteMask(image,p) <= (QuantumRange/2)))
           {
             SetPixelChannel(blur_image,channel,p[i],q);
             continue;
@@ -3985,7 +3985,7 @@ MagickExport Image *UnsharpMaskImage(const Image *image,const double radius,
             (unsharp_traits == UndefinedPixelTrait))
           continue;
         if (((unsharp_traits & CopyPixelTrait) != 0) ||
-            (GetPixelWriteMask(image,p) == 0))
+            (GetPixelWriteMask(image,p) <= (QuantumRange/2)))
           {
             SetPixelChannel(unsharp_image,channel,p[i],q);
             continue;
index 9a4a76d86e1db292ba00c38fa3bd6476b25ce17b..8c3923f79d86d7a3172f325130039bc87fd7ef21 100644 (file)
@@ -380,7 +380,7 @@ MagickExport MagickBooleanType ClutImage(Image *image,const Image *clut_image,
       PixelTrait
         traits;
 
-      if (GetPixelWriteMask(image,q) == 0)
+      if (GetPixelWriteMask(image,q) <= (QuantumRange/2))
         {
           q+=GetPixelChannels(image);
           continue;
@@ -1235,7 +1235,7 @@ MagickExport MagickBooleanType ContrastStretchImage(Image *image,
       register ssize_t
         j;
 
-      if (GetPixelWriteMask(image,q) == 0)
+      if (GetPixelWriteMask(image,q) <= (QuantumRange/2))
         {
           q+=GetPixelChannels(image);
           continue;
@@ -1419,7 +1419,7 @@ MagickExport Image *EnhanceImage(const Image *image,ExceptionInfo *exception)
       register const Quantum
         *magick_restrict r;
 
-      if (GetPixelWriteMask(image,p) == 0)
+      if (GetPixelWriteMask(image,p) <= (QuantumRange/2))
         {
           SetPixelBackgoundColor(enhance_image,q);
           p+=GetPixelChannels(image);
@@ -1706,7 +1706,7 @@ MagickExport MagickBooleanType EqualizeImage(Image *image,
       register ssize_t
         j;
 
-      if (GetPixelWriteMask(image,q) == 0)
+      if (GetPixelWriteMask(image,q) <= (QuantumRange/2))
         {
           q+=GetPixelChannels(image);
           continue;
@@ -1888,7 +1888,7 @@ MagickExport MagickBooleanType GammaImage(Image *image,const double gamma,
       register ssize_t
         j;
 
-      if (GetPixelWriteMask(image,q) == 0)
+      if (GetPixelWriteMask(image,q) <= (QuantumRange/2))
         {
           q+=GetPixelChannels(image);
           continue;
@@ -2027,7 +2027,7 @@ MagickExport MagickBooleanType GrayscaleImage(Image *image,
         red,
         intensity;
 
-      if (GetPixelWriteMask(image,q) == 0)
+      if (GetPixelWriteMask(image,q) <= (QuantumRange/2))
         {
           q+=GetPixelChannels(image);
           continue;
@@ -2461,7 +2461,7 @@ MagickExport MagickBooleanType LevelImage(Image *image,const double black_point,
       register ssize_t
         j;
 
-      if (GetPixelWriteMask(image,q) == 0)
+      if (GetPixelWriteMask(image,q) <= (QuantumRange/2))
         {
           q+=GetPixelChannels(image);
           continue;
@@ -2617,7 +2617,7 @@ MagickExport MagickBooleanType LevelizeImage(Image *image,
       register ssize_t
         j;
 
-      if (GetPixelWriteMask(image,q) == 0)
+      if (GetPixelWriteMask(image,q) <= (QuantumRange/2))
         {
           q+=GetPixelChannels(image);
           continue;
@@ -3284,7 +3284,7 @@ MagickExport MagickBooleanType ModulateImage(Image *image,const char *modulate,
         green,
         red;
 
-      if (GetPixelWriteMask(image,q) == 0)
+      if (GetPixelWriteMask(image,q) <= (QuantumRange/2))
         {
           q+=GetPixelChannels(image);
           continue;
@@ -3471,7 +3471,7 @@ MagickExport MagickBooleanType NegateImage(Image *image,
           register ssize_t
             j;
 
-          if ((GetPixelWriteMask(image,q) == 0) ||
+          if ((GetPixelWriteMask(image,q) <= (QuantumRange/2)) ||
               IsPixelGray(image,q) != MagickFalse)
             {
               q+=GetPixelChannels(image);
@@ -3535,7 +3535,7 @@ MagickExport MagickBooleanType NegateImage(Image *image,
       register ssize_t
         j;
 
-      if (GetPixelWriteMask(image,q) == 0)
+      if (GetPixelWriteMask(image,q) <= (QuantumRange/2))
         {
           q+=GetPixelChannels(image);
           continue;
@@ -3839,7 +3839,7 @@ MagickExport MagickBooleanType SigmoidalContrastImage(Image *image,
       register ssize_t
         i;
 
-      if (GetPixelWriteMask(image,q) == 0)
+      if (GetPixelWriteMask(image,q) <= (QuantumRange/2))
         {
           q+=GetPixelChannels(image);
           continue;
index 881ec6a2e9ca16367805af702f50519039571734..4ee1299edee3421f93f68ca7db0a3906baae9d48 100644 (file)
@@ -368,7 +368,7 @@ MagickExport Image *AddNoiseImage(const Image *image,const NoiseType noise_type,
             (noise_traits == UndefinedPixelTrait))
           continue;
         if (((noise_traits & CopyPixelTrait) != 0) ||
-            (GetPixelWriteMask(image,p) == 0))
+            (GetPixelWriteMask(image,p) <= (QuantumRange/2)))
           {
             SetPixelChannel(noise_image,channel,p[i],q);
             continue;
@@ -3158,7 +3158,7 @@ MagickExport Image *FxImage(const Image *image,const char *expression,
             (fx_traits == UndefinedPixelTrait))
           continue;
         if (((fx_traits & CopyPixelTrait) != 0) ||
-            (GetPixelWriteMask(image,p) == 0))
+            (GetPixelWriteMask(image,p) <= (QuantumRange/2)))
           {
             SetPixelChannel(fx_image,channel,p[i],q);
             continue;
@@ -3352,7 +3352,7 @@ MagickExport Image *ImplodeImage(const Image *image,const double amount,
       /*
         Determine if the pixel is within an ellipse.
       */
-      if (GetPixelWriteMask(canvas,p) == 0)
+      if (GetPixelWriteMask(canvas,p) <= (QuantumRange/2))
         {
           SetPixelBackgoundColor(implode_image,q);
           p+=GetPixelChannels(canvas);
@@ -4539,7 +4539,7 @@ MagickExport Image *SketchImage(const Image *image,const double radius,
       register ssize_t
         i;
 
-      if (GetPixelWriteMask(random_image,q) == 0)
+      if (GetPixelWriteMask(random_image,q) <= (QuantumRange/2))
         {
           q+=GetPixelChannels(random_image);
           continue;
@@ -4702,7 +4702,7 @@ MagickExport MagickBooleanType SolarizeImage(Image *image,
       register ssize_t
         i;
 
-      if (GetPixelWriteMask(image,q) == 0)
+      if (GetPixelWriteMask(image,q) <= (QuantumRange/2))
         {
           q+=GetPixelChannels(image);
           continue;
@@ -5199,7 +5199,7 @@ MagickExport Image *SwirlImage(const Image *image,double degrees,
       /*
         Determine if the pixel is within an ellipse.
       */
-      if (GetPixelWriteMask(canvas,p) == 0)
+      if (GetPixelWriteMask(canvas,p) <= (QuantumRange/2))
         {
           SetPixelBackgoundColor(swirl_image,q);
           p+=GetPixelChannels(canvas);
@@ -5436,7 +5436,7 @@ MagickExport Image *TintImage(const Image *image,const char *blend,
             (tint_traits == UndefinedPixelTrait))
           continue;
         if (((tint_traits & CopyPixelTrait) != 0) ||
-            (GetPixelWriteMask(image,p) == 0))
+            (GetPixelWriteMask(image,p) <= (QuantumRange/2)))
           {
             SetPixelChannel(tint_image,channel,p[i],q);
             continue;
index 093ee47f9ab4c117ed60c7228ad88c3d3b80a8c0..ea185b0ae9bef609f0b2e98df30f5c6b6388fc21 100644 (file)
@@ -180,7 +180,7 @@ static ChannelStatistics *GetLocationStatistics(const Image *image,
       break;
     for (x=0; x < (ssize_t) image->columns; x++)
     {
-      if (GetPixelReadMask(image,p) == 0)
+      if (GetPixelReadMask(image,p) <= (QuantumRange/2))
         {
           p+=GetPixelChannels(image);
           continue;
index ebfdb856d76a6146566dcca2aaa956c7daca3f82..5e852fbdf556a75b35b06ed9714b7c23b0ee6040 100644 (file)
@@ -584,7 +584,7 @@ MagickExport Image *AppendImages(const Image *images,
       GetPixelInfo(next,&pixel);
       for (x=0; x < (ssize_t) next->columns; x++)
       {
-        if (GetPixelWriteMask(next,p) == 0)
+        if (GetPixelWriteMask(next,p) <= (QuantumRange/2))
           {
             SetPixelBackgoundColor(append_image,q);
             p+=GetPixelChannels(next);
@@ -1827,7 +1827,7 @@ MagickExport MagickBooleanType IsHighDynamicRangeImage(const Image *image,
       register ssize_t
         i;
 
-      if (GetPixelWriteMask(image,p) == 0)
+      if (GetPixelWriteMask(image,p) <= (QuantumRange/2))
         {
           p+=GetPixelChannels(image);
           continue;
@@ -2262,7 +2262,7 @@ MagickExport MagickBooleanType SetImageAlpha(Image *image,const Quantum alpha,
       }
     for (x=0; x < (ssize_t) image->columns; x++)
     {
-      if (GetPixelWriteMask(image,q) != 0)
+      if (GetPixelWriteMask(image,q) > (QuantumRange/2))
         SetPixelAlpha(image,alpha,q);
       q+=GetPixelChannels(image);
     }
index 78e5fffcf106de593748a51947db7a37c0d8ff8e..1dc15d587b7f5c6d8a7fc6e8cb789587b3dfda64 100644 (file)
@@ -970,7 +970,7 @@ MagickExport MagickBooleanType OpaquePaintImage(Image *image,
     pixel=zero;
     for (x=0; x < (ssize_t) image->columns; x++)
     {
-      if (GetPixelWriteMask(image,q) == 0)
+      if (GetPixelWriteMask(image,q) <= (QuantumRange/2))
         {
           q+=GetPixelChannels(image);
           continue;
@@ -1121,7 +1121,7 @@ MagickExport MagickBooleanType TransparentPaintImage(Image *image,
     pixel=zero;
     for (x=0; x < (ssize_t) image->columns; x++)
     {
-      if (GetPixelWriteMask(image,q) == 0)
+      if (GetPixelWriteMask(image,q) <= (QuantumRange/2))
         {
           q+=GetPixelChannels(image);
           continue;
@@ -1256,7 +1256,7 @@ MagickExport MagickBooleanType TransparentPaintImageChroma(Image *image,
     GetPixelInfo(image,&pixel);
     for (x=0; x < (ssize_t) image->columns; x++)
     {
-      if (GetPixelWriteMask(image,q) == 0)
+      if (GetPixelWriteMask(image,q) <= (QuantumRange/2))
         {
           q+=GetPixelChannels(image);
           continue;
index 19d23c46d5e9c62ada2a070995de6c8a2f479e97..a0ee51c0137c9589eee5b50477d7ed78c24be2c7 100644 (file)
@@ -3920,7 +3920,7 @@ MagickExport size_t ExportQuantumPixels(const Image *image,
         register ssize_t
           i;
 
-        if (GetPixelWriteMask(image,q) == 0)
+        if (GetPixelWriteMask(image,q) <= (QuantumRange/2))
           {
             q+=GetPixelChannels(image);
             continue;
index 68dd8c134f786a5dd7cef3251427755e95d21248..2dc348ed1bbf07995e873cd2a520c433d9e662ce 100644 (file)
@@ -4280,7 +4280,7 @@ MagickExport size_t ImportQuantumPixels(const Image *image,
         register ssize_t
           i;
 
-        if (GetPixelWriteMask(image,q) == 0)
+        if (GetPixelWriteMask(image,q) <= (QuantumRange/2))
           {
             q+=GetPixelChannels(image);
             continue;
index 772fc52b2e7ee90886f227d85d84ee4c48be52a1..70c9ce7d9fa1b7fddb80045dd5e411b60c66be30 100644 (file)
@@ -1741,7 +1741,7 @@ MagickExport Image *InterpolativeResizeImage(const Image *image,
       register ssize_t
         i;
 
-      if (GetPixelWriteMask(resize_image,q) == 0)
+      if (GetPixelWriteMask(resize_image,q) <= (QuantumRange/2))
         {
           q+=GetPixelChannels(resize_image);
           continue;
@@ -2538,7 +2538,7 @@ static MagickBooleanType HorizontalFilter(const ResizeFilter *resize_filter,
             (resize_traits == UndefinedPixelTrait))
           continue;
         if (((resize_traits & CopyPixelTrait) != 0) ||
-            (GetPixelWriteMask(resize_image,q) == 0))
+            (GetPixelWriteMask(resize_image,q) <= (QuantumRange/2)))
           {
             j=(ssize_t) (MagickMin(MagickMax(bisect,(double) start),(double)
               stop-1.0)+0.5);
@@ -2754,7 +2754,7 @@ static MagickBooleanType VerticalFilter(const ResizeFilter *resize_filter,
             (resize_traits == UndefinedPixelTrait))
           continue;
         if (((resize_traits & CopyPixelTrait) != 0) ||
-            (GetPixelWriteMask(resize_image,q) == 0))
+            (GetPixelWriteMask(resize_image,q) <= (QuantumRange/2)))
           {
             j=(ssize_t) (MagickMin(MagickMax(bisect,(double) start),(double)
               stop-1.0)+0.5);
@@ -3089,7 +3089,7 @@ MagickExport Image *SampleImage(const Image *image,const size_t columns,
       register ssize_t
         i;
 
-      if (GetPixelWriteMask(sample_image,q) == 0)
+      if (GetPixelWriteMask(sample_image,q) <= (QuantumRange/2))
         {
           q+=GetPixelChannels(sample_image);
           continue;
@@ -3296,7 +3296,7 @@ MagickExport Image *ScaleImage(const Image *image,const size_t columns,
           }
         for (x=0; x < (ssize_t) image->columns; x++)
         {
-          if (GetPixelWriteMask(image,p) == 0)
+          if (GetPixelWriteMask(image,p) <= (QuantumRange/2))
             {
               p+=GetPixelChannels(image);
               continue;
@@ -3339,7 +3339,7 @@ MagickExport Image *ScaleImage(const Image *image,const size_t columns,
                 }
               for (x=0; x < (ssize_t) image->columns; x++)
               {
-                if (GetPixelWriteMask(image,p) == 0)
+                if (GetPixelWriteMask(image,p) <= (QuantumRange/2))
                   {
                     p+=GetPixelChannels(image);
                     continue;
@@ -3383,7 +3383,7 @@ MagickExport Image *ScaleImage(const Image *image,const size_t columns,
               }
             for (x=0; x < (ssize_t) image->columns; x++)
             {
-              if (GetPixelWriteMask(image,p) == 0)
+              if (GetPixelWriteMask(image,p) <= (QuantumRange/2))
                 {
                   p+=GetPixelChannels(image);
                   continue;
@@ -3431,7 +3431,7 @@ MagickExport Image *ScaleImage(const Image *image,const size_t columns,
         */
         for (x=0; x < (ssize_t) scale_image->columns; x++)
         {
-          if (GetPixelWriteMask(scale_image,q) == 0)
+          if (GetPixelWriteMask(scale_image,q) <= (QuantumRange/2))
             {
               q+=GetPixelChannels(scale_image);
               continue;
@@ -3527,7 +3527,7 @@ MagickExport Image *ScaleImage(const Image *image,const size_t columns,
       */
       for (x=0; x < (ssize_t) scale_image->columns; x++)
       {
-        if (GetPixelWriteMask(scale_image,q) == 0)
+        if (GetPixelWriteMask(scale_image,q) <= (QuantumRange/2))
           {
             q+=GetPixelChannels(scale_image);
             continue;
index 6a2740c645a9963f2d810edad3a060b7170a4bb1..0d0ea1f3be1c73fc5f6a6f37cff5095d2d0cce71 100644 (file)
@@ -830,7 +830,7 @@ MagickExport Image *IntegralRotateImage(const Image *image,size_t rotations,
               register ssize_t
                 i;
 
-              if (GetPixelWriteMask(image,tile_pixels) == 0)
+              if (GetPixelWriteMask(image,tile_pixels) <= (QuantumRange/2))
                 {
                   tile_pixels-=width*GetPixelChannels(image);
                   q+=GetPixelChannels(rotate_image);
@@ -920,7 +920,7 @@ MagickExport Image *IntegralRotateImage(const Image *image,size_t rotations,
             i;
 
           q-=GetPixelChannels(rotate_image);
-          if (GetPixelWriteMask(image,p) == 0)
+          if (GetPixelWriteMask(image,p) <= (QuantumRange/2))
             {
               p+=GetPixelChannels(image);
               continue;
@@ -1043,7 +1043,7 @@ MagickExport Image *IntegralRotateImage(const Image *image,size_t rotations,
               register ssize_t
                 i;
 
-              if (GetPixelWriteMask(image,tile_pixels) == 0)
+              if (GetPixelWriteMask(image,tile_pixels) <= (QuantumRange/2))
                 {
                   tile_pixels+=width*GetPixelChannels(image);
                   q+=GetPixelChannels(rotate_image);
index 4c3af381b6c11044079c5a73b2d635440804cb98..fbdaf04035747d29f8f545dd18f9b7bbb085654d 100644 (file)
@@ -520,7 +520,7 @@ MagickExport MagickBooleanType SignatureImage(Image *image,
       register ssize_t
         i;
 
-      if (GetPixelReadMask(image,p) == 0)
+      if (GetPixelReadMask(image,p) <= (QuantumRange/2))
         {
           p+=GetPixelChannels(image);
           continue;
index 1dbd40ba1a8ff11b22e1e7ed670090e521b53ad4..9eeab8b7921670cf79d8ba18d36efab85e0899a7 100644 (file)
@@ -646,7 +646,7 @@ MagickExport Image *EvaluateImages(const Image *images,
             register ssize_t
               i;
 
-            if (GetPixelWriteMask(next,p) == 0)
+            if (GetPixelWriteMask(next,p) <= (QuantumRange/2))
               {
                 p+=GetPixelChannels(next);
                 continue;
@@ -711,7 +711,7 @@ MagickExport Image *EvaluateImages(const Image *images,
           register ssize_t
             i;
 
-          if (GetPixelWriteMask(image,q) == 0)
+          if (GetPixelWriteMask(image,q) <= (QuantumRange/2))
             {
               q+=GetPixelChannels(image);
               continue;
@@ -827,7 +827,7 @@ MagickExport MagickBooleanType EvaluateImage(Image *image,
         if (traits == UndefinedPixelTrait)
           continue;
         if (((traits & CopyPixelTrait) != 0) ||
-            (GetPixelWriteMask(image,q) == 0))
+            (GetPixelWriteMask(image,q) <= (QuantumRange/2)))
           continue;
         if ((traits & UpdatePixelTrait) == 0)
           continue;
@@ -1049,7 +1049,7 @@ MagickExport MagickBooleanType FunctionImage(Image *image,
       register ssize_t
         i;
 
-      if (GetPixelWriteMask(image,q) == 0)
+      if (GetPixelWriteMask(image,q) <= (QuantumRange/2))
         {
           q+=GetPixelChannels(image);
           continue;
@@ -1402,7 +1402,7 @@ MagickExport ChannelMoments *GetImageMoments(const Image *image,
       register ssize_t
         i;
 
-      if (GetPixelWriteMask(image,p) == 0)
+      if (GetPixelWriteMask(image,p) <= (QuantumRange/2))
         {
           p+=GetPixelChannels(image);
           continue;
@@ -1460,7 +1460,7 @@ MagickExport ChannelMoments *GetImageMoments(const Image *image,
       register ssize_t
         i;
 
-      if (GetPixelWriteMask(image,p) == 0)
+      if (GetPixelWriteMask(image,p) <= (QuantumRange/2))
         {
           p+=GetPixelChannels(image);
           continue;
@@ -1831,7 +1831,7 @@ MagickExport MagickBooleanType GetImageRange(const Image *image,double *minima,
       register ssize_t
         i;
 
-      if (GetPixelWriteMask(image,p) == 0)
+      if (GetPixelWriteMask(image,p) <= (QuantumRange/2))
         {
           p+=GetPixelChannels(image);
           continue;
@@ -1989,7 +1989,7 @@ MagickExport ChannelStatistics *GetImageStatistics(const Image *image,
       register ssize_t
         i;
 
-      if (GetPixelWriteMask(image,p) == 0)
+      if (GetPixelWriteMask(image,p) <= (QuantumRange/2))
         {
           p+=GetPixelChannels(image);
           continue;
@@ -2272,7 +2272,7 @@ MagickExport Image *PolynomialImage(const Image *images,
         register ssize_t
           i;
 
-        if (GetPixelWriteMask(next,p) == 0)
+        if (GetPixelWriteMask(next,p) <= (QuantumRange/2))
           {
             p+=GetPixelChannels(next);
             continue;
@@ -2306,7 +2306,7 @@ MagickExport Image *PolynomialImage(const Image *images,
       register ssize_t
         i;
 
-      if (GetPixelWriteMask(image,q) == 0)
+      if (GetPixelWriteMask(image,q) <= (QuantumRange/2))
         {
           q+=GetPixelChannels(image);
           continue;
@@ -2949,7 +2949,7 @@ MagickExport Image *StatisticImage(const Image *image,const StatisticType type,
             (statistic_traits == UndefinedPixelTrait))
           continue;
         if (((statistic_traits & CopyPixelTrait) != 0) ||
-            (GetPixelWriteMask(image,p) == 0))
+            (GetPixelWriteMask(image,p) <= (QuantumRange/2)))
           {
             SetPixelChannel(statistic_image,channel,p[center+i],q);
             continue;
index 149226cdbc1bb12a66a94015f2f46e7c45aaf0bb..834de2de72e24e0b578c0bdebbbdcb539e625130 100644 (file)
@@ -275,7 +275,7 @@ MagickExport Image *AdaptiveThresholdImage(const Image *image,
           (threshold_traits == UndefinedPixelTrait))
         continue;
       if (((threshold_traits & CopyPixelTrait) != 0) ||
-          (GetPixelWriteMask(image,p) == 0))
+          (GetPixelWriteMask(image,p) <= (QuantumRange/2)))
         {
           SetPixelChannel(threshold_image,channel,p[center+i],q);
           continue;
@@ -310,7 +310,7 @@ MagickExport Image *AdaptiveThresholdImage(const Image *image,
             (threshold_traits == UndefinedPixelTrait))
           continue;
         if (((threshold_traits & CopyPixelTrait) != 0) ||
-            (GetPixelWriteMask(image,p) == 0))
+            (GetPixelWriteMask(image,p) <= (QuantumRange/2)))
           {
             SetPixelChannel(threshold_image,channel,p[center+i],q);
             continue;
@@ -857,7 +857,7 @@ MagickExport MagickBooleanType BilevelImage(Image *image,const double threshold,
       register ssize_t
         i;
 
-      if (GetPixelWriteMask(image,q) == 0)
+      if (GetPixelWriteMask(image,q) <= (QuantumRange/2))
         {
           q+=GetPixelChannels(image);
           continue;
@@ -1022,7 +1022,7 @@ MagickExport MagickBooleanType BlackThresholdImage(Image *image,
       register ssize_t
         i;
 
-      if (GetPixelWriteMask(image,q) == 0)
+      if (GetPixelWriteMask(image,q) <= (QuantumRange/2))
         {
           q+=GetPixelChannels(image);
           continue;
@@ -1158,7 +1158,7 @@ MagickExport MagickBooleanType ClampImage(Image *image,ExceptionInfo *exception)
       register ssize_t
         i;
 
-      if (GetPixelWriteMask(image,q) == 0)
+      if (GetPixelWriteMask(image,q) <= (QuantumRange/2))
         {
           q+=GetPixelChannels(image);
           continue;
@@ -1799,7 +1799,7 @@ MagickExport MagickBooleanType OrderedDitherImage(Image *image,
         n;
 
       n=0;
-      if (GetPixelWriteMask(image,q) == 0)
+      if (GetPixelWriteMask(image,q) <= (QuantumRange/2))
         {
           q+=GetPixelChannels(image);
           continue;
@@ -1966,7 +1966,7 @@ MagickExport MagickBooleanType PerceptibleImage(Image *image,
       register ssize_t
         i;
 
-      if (GetPixelWriteMask(image,q) == 0)
+      if (GetPixelWriteMask(image,q) <= (QuantumRange/2))
         {
           q+=GetPixelChannels(image);
           continue;
@@ -2103,7 +2103,7 @@ MagickExport MagickBooleanType RandomThresholdImage(Image *image,
       register ssize_t
         i;
 
-      if (GetPixelWriteMask(image,q) == 0)
+      if (GetPixelWriteMask(image,q) <= (QuantumRange/2))
         {
           q+=GetPixelChannels(image);
           continue;
@@ -2277,7 +2277,7 @@ MagickExport MagickBooleanType WhiteThresholdImage(Image *image,
       register ssize_t
         i;
 
-      if (GetPixelWriteMask(image,q) == 0)
+      if (GetPixelWriteMask(image,q) <= (QuantumRange/2))
         {
           q+=GetPixelChannels(image);
           continue;
index d767563a849e41a73fa1e1eb7ebe51c5d9be2f76..773e1d1803c8c07537a483778b2c77dc4fd0f94e 100644 (file)
@@ -698,7 +698,7 @@ MagickExport Image *CropImage(const Image *image,const RectangleInfo *geometry,
       register ssize_t
         i;
 
-      if (GetPixelWriteMask(image,p) == 0)
+      if (GetPixelWriteMask(image,p) <= (QuantumRange/2))
         {
           SetPixelBackgoundColor(crop_image,q);
           p+=GetPixelChannels(image);
@@ -1051,7 +1051,7 @@ MagickExport Image *ExcerptImage(const Image *image,
       register ssize_t
         i;
 
-      if (GetPixelWriteMask(image,p) == 0)
+      if (GetPixelWriteMask(image,p) <= (QuantumRange/2))
         {
           SetPixelBackgoundColor(excerpt_image,q);
           p+=GetPixelChannels(image);
@@ -1249,7 +1249,7 @@ MagickExport Image *FlipImage(const Image *image,ExceptionInfo *exception)
       register ssize_t
         i;
 
-      if (GetPixelWriteMask(image,p) == 0)
+      if (GetPixelWriteMask(image,p) <= (QuantumRange/2))
         {
           SetPixelBackgoundColor(flip_image,q);
           p+=GetPixelChannels(image);
@@ -1392,7 +1392,7 @@ MagickExport Image *FlopImage(const Image *image,ExceptionInfo *exception)
         i;
 
       q-=GetPixelChannels(flop_image);
-      if (GetPixelWriteMask(image,p) == 0)
+      if (GetPixelWriteMask(image,p) <= (QuantumRange/2))
         {
           p+=GetPixelChannels(image);
           continue;
@@ -1518,7 +1518,7 @@ static MagickBooleanType CopyImageRegion(Image *destination,const Image *source,
       register ssize_t
         i;
 
-      if (GetPixelWriteMask(source,p) == 0)
+      if (GetPixelWriteMask(source,p) <= (QuantumRange/2))
         {
           SetPixelBackgoundColor(destination,q);
           p+=GetPixelChannels(source);
@@ -1846,7 +1846,7 @@ MagickExport Image *SpliceImage(const Image *image,
       register ssize_t
         i;
 
-      if (GetPixelWriteMask(image,p) == 0)
+      if (GetPixelWriteMask(image,p) <= (QuantumRange/2))
         {
           SetPixelBackgoundColor(splice_image,q);
           p+=GetPixelChannels(image);
@@ -1877,7 +1877,7 @@ MagickExport Image *SpliceImage(const Image *image,
       register ssize_t
         i;
 
-      if (GetPixelWriteMask(image,p) == 0)
+      if (GetPixelWriteMask(image,p) <= (QuantumRange/2))
         {
           SetPixelBackgoundColor(splice_image,q);
           p+=GetPixelChannels(image);
@@ -1951,7 +1951,7 @@ MagickExport Image *SpliceImage(const Image *image,
       register ssize_t
         i;
 
-      if (GetPixelWriteMask(image,q) == 0)
+      if (GetPixelWriteMask(image,q) <= (QuantumRange/2))
         {
           SetPixelBackgoundColor(splice_image,q);
           p+=GetPixelChannels(image);
@@ -1982,7 +1982,7 @@ MagickExport Image *SpliceImage(const Image *image,
       register ssize_t
         i;
 
-      if (GetPixelWriteMask(image,q) == 0)
+      if (GetPixelWriteMask(image,q) <= (QuantumRange/2))
         {
           SetPixelBackgoundColor(splice_image,q);
           p+=GetPixelChannels(image);
@@ -2225,7 +2225,7 @@ MagickExport Image *TransposeImage(const Image *image,ExceptionInfo *exception)
       register ssize_t
         i;
 
-      if (GetPixelWriteMask(image,q) == 0)
+      if (GetPixelWriteMask(image,q) <= (QuantumRange/2))
         {
           SetPixelBackgoundColor(transpose_image,q);
           p+=GetPixelChannels(image);
@@ -2374,7 +2374,7 @@ MagickExport Image *TransverseImage(const Image *image,ExceptionInfo *exception)
         i;
 
       q-=GetPixelChannels(transverse_image);
-      if (GetPixelWriteMask(image,p) == 0)
+      if (GetPixelWriteMask(image,p) <= (QuantumRange/2))
         {
           p+=GetPixelChannels(image);
           continue;
index 13a2928cbcff6a4c6f3b6883f9b8adbb1e522712..164591252ff6c8e6853fb4d5f9a27d20e647971d 100644 (file)
@@ -321,7 +321,7 @@ static ChannelStatistics *GetLocationStatistics(const Image *image,
       register ssize_t
         i;
 
-      if (GetPixelReadMask(image,p) == 0)
+      if (GetPixelReadMask(image,p) <= (QuantumRange/2))
         {
           p+=GetPixelChannels(image);
           continue;
index 95834c3797896770e5537b8c24c6ba3f681e62d9..57032275724ceed31955e038ee0e845455c04fc4 100644 (file)
@@ -633,7 +633,7 @@ static Image *ReadPSImage(const ImageInfo *image_info,ExceptionInfo *exception)
         datum=GetStringInfoDatum(profile);
         for (i=0; (c=ProfileInteger(image,hex_digits)) != EOF; i++)
         {
-          if (i >= GetStringInfoLength(profile))
+          if (i >= (ssize_t) GetStringInfoLength(profile))
             {
               SetStringInfoLength(profile,(size_t) i << 1);
               datum=GetStringInfoDatum(profile);
index e5913372b58f1afffbeb77163d0bcef581661c06..fa7f5bb9fc45066c75b7c784571d5902a1d8ebce 100644 (file)
@@ -819,7 +819,7 @@ static void ipa_device_close(wmfAPI * API)
       ddata->draw_info=(DrawInfo *)NULL;
     }
   if (WMF_MAGICK_GetFontData(API)->ps_name)
-    WMF_MAGICK_GetFontData(API)->ps_name=RelinquishMagickMemory(
+    WMF_MAGICK_GetFontData(API)->ps_name=(char *) RelinquishMagickMemory(
       WMF_MAGICK_GetFontData(API)->ps_name);
 }