From: Cristy Date: Sat, 13 Feb 2016 19:07:50 +0000 (-0500) Subject: Support Color() method X-Git-Tag: 7.0.1-0~231 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5488c98b811f22cb127739eced4b5bf7ec7476ca;p=imagemagick Support Color() method --- diff --git a/PerlMagick/Magick.xs b/PerlMagick/Magick.xs index b2fb4b5ab..b81cf4de5 100644 --- a/PerlMagick/Magick.xs +++ b/PerlMagick/Magick.xs @@ -531,8 +531,6 @@ static struct { "Morphology", { {"kernel", StringReference}, {"channel", MagickChannelOptions}, {"method", MagickMorphologyOptions}, {"iterations", IntegerReference} } }, - { "Sans", { {"matrix", ArrayReference} } }, - { "Color", { {"color", StringReference} } }, { "Mode", { {"geometry", StringReference}, {"width", IntegerReference},{"height", IntegerReference}, {"channel", MagickChannelOptions} } }, @@ -561,6 +559,7 @@ static struct {"x", IntegerReference}, {"y", IntegerReference}, {"gravity", MagickGravityOptions}, {"offset", StringReference}, {"dx", IntegerReference}, {"dy", IntegerReference} } }, + { "Color", { {"color", StringReference} } }, }; static SplayTreeInfo @@ -7581,6 +7580,8 @@ Mogrify(ref,...) ConnectedComponentImage = 284 CopyPixels = 285 CopyImagePixels = 286 + Color = 287 + ColorImage = 288 MogrifyRegion = 666 PPCODE: { @@ -11308,6 +11309,18 @@ Mogrify(ref,...) exception); break; } + case 144: /* Color */ + { + PixelInfo + color; + + (void) QueryMagickColor("none",&color,exception); + if (attribute_flag[0] != 0) + (void) QueryMagickColor(argument_list[0].string_reference, + &color,exception); + (void) SetImageColor(image,&color,exception); + break; + } } if (next != (Image *) NULL) (void) CatchImageException(next); diff --git a/PerlMagick/demo/demo.pl b/PerlMagick/demo/demo.pl index 62c6b1225..6da27b178 100644 --- a/PerlMagick/demo/demo.pl +++ b/PerlMagick/demo/demo.pl @@ -185,7 +185,7 @@ $example->Label('Equalize'); $example->Equalize(); push(@$images,$example); -print "Implode...\n"; +print "Explode...\n"; $example=$model->Clone(); $example->Label('Explode'); $example->Implode(-1); @@ -246,6 +246,12 @@ $example->Label('Implode'); $example->Implode(0.5); push(@$images,$example); +print "Kuwahara...\n"; +$example=$model->Clone(); +$example->Label('Kuwahara'); +$example->Kuwahara('0x1'); +push(@$images,$example); + print "Level...\n"; $example=$model->Clone(); $example->Label('Level'); diff --git a/PerlMagick/quantum/quantum.xs.in b/PerlMagick/quantum/quantum.xs.in index 7e387af7c..32154789d 100644 --- a/PerlMagick/quantum/quantum.xs.in +++ b/PerlMagick/quantum/quantum.xs.in @@ -531,8 +531,6 @@ static struct { "Morphology", { {"kernel", StringReference}, {"channel", MagickChannelOptions}, {"method", MagickMorphologyOptions}, {"iterations", IntegerReference} } }, - { "Sans", { {"matrix", ArrayReference} } }, - { "Color", { {"color", StringReference} } }, { "Mode", { {"geometry", StringReference}, {"width", IntegerReference},{"height", IntegerReference}, {"channel", MagickChannelOptions} } }, @@ -561,6 +559,7 @@ static struct {"x", IntegerReference}, {"y", IntegerReference}, {"gravity", MagickGravityOptions}, {"offset", StringReference}, {"dx", IntegerReference}, {"dy", IntegerReference} } }, + { "Color", { {"color", StringReference} } }, }; static SplayTreeInfo @@ -7581,6 +7580,8 @@ Mogrify(ref,...) ConnectedComponentImage = 284 CopyPixels = 285 CopyImagePixels = 286 + Color = 287 + ColorImage = 288 MogrifyRegion = 666 PPCODE: { @@ -11308,6 +11309,18 @@ Mogrify(ref,...) exception); break; } + case 144: /* Color */ + { + PixelInfo + color; + + (void) QueryMagickColor("none",&color,exception); + if (attribute_flag[0] != 0) + (void) QueryMagickColor(argument_list[0].string_reference, + &color,exception); + (void) SetImageColor(image,&color,exception); + break; + } } if (next != (Image *) NULL) (void) CatchImageException(next);