From: Cristy Date: Sun, 2 Jul 2017 16:24:24 +0000 (-0400) Subject: Add support for auto thresholding to PerlMagick X-Git-Tag: 7.0.6-1~100 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=53353872b281d2b1524258378f4b766b62f06693;p=imagemagick Add support for auto thresholding to PerlMagick --- diff --git a/PerlMagick/Magick.xs b/PerlMagick/Magick.xs index eb5d643f3..3a703a613 100644 --- a/PerlMagick/Magick.xs +++ b/PerlMagick/Magick.xs @@ -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); diff --git a/PerlMagick/quantum/quantum.xs.in b/PerlMagick/quantum/quantum.xs.in index 9c7e071be..c587ae3c3 100644 --- a/PerlMagick/quantum/quantum.xs.in +++ b/PerlMagick/quantum/quantum.xs.in @@ -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); diff --git a/utilities/convert.1 b/utilities/convert.1 index 75345a5fd..0ad6a5c0e 100644 --- a/utilities/convert.1 +++ b/utilities/convert.1 @@ -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 diff --git a/utilities/mogrify.1 b/utilities/mogrify.1 index 274b2a7d1..9ae627de7 100644 --- a/utilities/mogrify.1 +++ b/utilities/mogrify.1 @@ -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