X-Git-Url: http://git.imager.perl.org/imager.git/blobdiff_plain/e7b95388c97c408e81a492c3cca86a2941949409..dc96e46cbbdfd9f0997dc12ddac6dfcf55412ff2:/Imager.pm diff --git a/Imager.pm b/Imager.pm index b4d15e42..0f684aec 100644 --- a/Imager.pm +++ b/Imager.pm @@ -146,7 +146,7 @@ use Imager::Font; BEGIN { require Exporter; @ISA = qw(Exporter); - $VERSION = '0.47'; + $VERSION = '0.48'; eval { require XSLoader; XSLoader::load(Imager => $VERSION); @@ -241,11 +241,26 @@ BEGIN { } }; - $filters{nearest_color} ={ - callseq => ['image', 'xo', 'yo', 'colors', 'dist'], - defaults => { }, - callsub => sub { my %hsh=@_; i_nearest_color($hsh{image}, $hsh{xo}, $hsh{yo}, $hsh{colors}, $hsh{dist}); } - }; + $filters{nearest_color} = + { + callseq => ['image', 'xo', 'yo', 'colors', 'dist'], + defaults => { }, + callsub => + sub { + my %hsh=@_; + # make sure the segments are specified with colors + my @colors; + for my $color (@{$hsh{colors}}) { + my $new_color = _color($color) + or die $Imager::ERRSTR."\n"; + push @colors, $new_color; + } + + i_nearest_color($hsh{image}, $hsh{xo}, $hsh{yo}, \@colors, + $hsh{dist}) + or die Imager->_error_as_msg() . "\n"; + }, + }; $filters{gaussian} = { callseq => [ 'image', 'stddev' ], defaults => { }, @@ -372,7 +387,8 @@ BEGIN { i_fountain($hsh{image}, $hsh{xa}, $hsh{ya}, $hsh{xb}, $hsh{yb}, $hsh{ftype}, $hsh{repeat}, $hsh{combine}, $hsh{super_sample}, - $hsh{ssample_param}, \@segments); + $hsh{ssample_param}, \@segments) + or die Imager->_error_as_msg() . "\n"; }, }; $filters{unsharpmask} = @@ -3373,7 +3389,7 @@ channel values masked() - L - make a masked image -matrix_transform() - L +matrix_transform() - L maxcolors() - L @@ -3399,8 +3415,6 @@ image and use the alpha channel scale() - L -setscanline() - L - scaleX() - L scaleY() - L @@ -3410,6 +3424,10 @@ a paletted image setpixel() - L +setscanline() - L + +settag() - L + set_file_limits() - L string() - L - draw text on an image