]> granicus.if.org Git - imagemagick/commitdiff
Add support for auto thresholding to PerlMagick
authorCristy <urban-warrior@imagemagick.org>
Sun, 2 Jul 2017 16:24:24 +0000 (12:24 -0400)
committerCristy <urban-warrior@imagemagick.org>
Sun, 2 Jul 2017 16:24:24 +0000 (12:24 -0400)
PerlMagick/Magick.xs
PerlMagick/quantum/quantum.xs.in
utilities/convert.1
utilities/mogrify.1

index eb5d643f3a66f2b63b542f6dc19cf60837d32d40..3a703a613b7f90579c0d3c55fb1c8176597366c9 100644 (file)
@@ -564,6 +564,7 @@ static struct
       {"threshold", RealReference}, {"softness", RealReference},
       {"channel", MagickChannelOptions} } },
     { "Colorspace", { {"colorspace", MagickColorspaceOptions} } },
+    { "AutoThreshold", { {"method", MagickAutoThresholdOptions} } },
   };
 
 static SplayTreeInfo
@@ -7631,6 +7632,8 @@ Mogrify(ref,...)
     WaveletDenoiseImage= 290
     Colorspace         = 291
     ColorspaceImage    = 292
+    AutoThreshold      = 293
+    AutoThresholdImage = 294
     MogrifyRegion      = 666
   PPCODE:
   {
@@ -11408,6 +11411,17 @@ Mogrify(ref,...)
           (void) TransformImageColorspace(image,colorspace,exception);
           break;
         }
+        case 147:  /* AutoThreshold */
+        {
+          AutoThresholdMethod
+            method;
+
+          method=UndefinedThresholdMethod;
+          if (attribute_flag[0] != 0)
+            method=(AuthoThresholdMethod) argument_list[0].integer_reference;
+          (void) AutoThresholdImage(image,method,exception);
+          break;
+        }
       }
       if (next != (Image *) NULL)
         (void) CatchImageException(next);
index 9c7e071bea00ff15e1675bc9fe7e93e2c4626c25..c587ae3c333f6e3b2ef7d9150f60277c5b0c17cc 100644 (file)
@@ -564,6 +564,7 @@ static struct
       {"threshold", RealReference}, {"softness", RealReference}, 
       {"channel", MagickChannelOptions} } },
     { "Colorspace", { {"colorspace", MagickColorspaceOptions} } },
+    { "AutoThreshold", { {"method", MagickAutoThresholdOptions} } }
   };
 
 static SplayTreeInfo
@@ -7628,6 +7629,8 @@ Mogrify(ref,...)
     WaveletDenoiseImage= 290
     Colorspace         = 291
     ColorspaceImage    = 292
+    AutoThreshold      = 293
+    AutoThresholdImage = 294
     MogrifyRegion      = 666
   PPCODE:
   {
@@ -11405,6 +11408,17 @@ Mogrify(ref,...)
           (void) TransformImageColorspace(image,colorspace,exception);
           break;
         }
+        case 147:  /* AutoThreshold */
+        {
+          AutoThresholdMethod
+            method;
+
+          method=UndefinedThresholdMethod;
+          if (attribute_flag[0] != 0)
+            method=(AuthoThresholdMethod) argument_list[0].integer_reference;
+          (void) AutoThresholdImage(image,method,exception);
+          break;
+        }
       }
       if (next != (Image *) NULL)
         (void) CatchImageException(next);
index 75345a5fd386a74798f9856a0da4ecbf5ec89c5d..0ad6a5c0e148ff770881c16f9177e44c9774c5ba 100644 (file)
@@ -127,6 +127,8 @@ Image Operators:
   \-auto-gamma          automagically adjust gamma level of image
   \-auto-level          automagically adjust color levels of image
   \-auto-orient         automatically orient image
+  \-auto-threshold method
+                       automatically perform image thresholding
   \-bench iterations    measure performance
   \-black-threshold value
                        force all pixels below the threshold into black
index 274b2a7d1bb6a5e646ae9aa3b7b7a6fdeabee0da..9ae627de75d886ddf4acb2a2dcb5515412bba946 100644 (file)
@@ -125,6 +125,8 @@ Image Operators:
   \-auto-gamma          automagically adjust gamma level of image
   \-auto-level          automagically adjust color levels of image
   \-auto-orient         automatically orient image
+  \-auto-threshold method
+                       automatically perform image thresholding
   \-bench iterations    measure performance
   \-black-threshold value
                        force all pixels below the threshold into black