From: Tony Cook Date: Thu, 2 Jun 2005 13:26:58 +0000 (+0000) Subject: - give the colorcount() and maxcolors() methods their own entries and X-Git-Tag: Imager-0.48^2~130 X-Git-Url: http://git.imager.perl.org/imager.git/commitdiff_plain/feac660cec40f6b261881fe3072b8220cdc13c9a?ds=sidebyside - give the colorcount() and maxcolors() methods their own entries and add them to the method index. --- diff --git a/Changes b/Changes index f66be2f8..e5d3f6bc 100644 --- a/Changes +++ b/Changes @@ -1113,6 +1113,10 @@ Revision history for Perl extension Imager. 0.45 Mon 30 May 2005 - t/t105gif.t wasn't handling buggy giflibs correctly +0.45_01 +- give the colorcount() and maxcolors() methods their own entries and + add them to the method index. + ================================================================= For latest versions check the Imager-devel pages: diff --git a/Imager.pm b/Imager.pm index 8cc3fe68..fd4280e6 100644 --- a/Imager.pm +++ b/Imager.pm @@ -2925,6 +2925,8 @@ box() - L circle() - L +colorcount() - L + convert() - L - transform the color space @@ -2971,6 +2973,8 @@ masked() - L - make a masked image matrix_transform() - L +maxcolors() - L + new() - L open() - L - an alias for read() diff --git a/lib/Imager/ImageTypes.pod b/lib/Imager/ImageTypes.pod index d24333fc..b86c6bcc 100644 --- a/lib/Imager/ImageTypes.pod +++ b/lib/Imager/ImageTypes.pod @@ -52,9 +52,10 @@ Imager::ImageTypes - Internal image representation information print "\n"; } else { - + # palette info + my $count = $img->colorcount; @colors = $img->getcolors(); - print "Palette size: ".@colors."\n"; + print "Palette size: $count\n"; my $mx = @colors > 4 ? 4 : 0+@colors; print "First $mx entries:\n"; for (@colors[0..$mx-1]) { @@ -291,8 +292,17 @@ To quickly find a color in the palette use findcolor(): which returns undef on failure, or the index of the color. -You can get the current palette size with $img->colorcount, and the -maximum size of the palette with $img->maxcolors. +=item colorcount + +Returns the number of colors in the image's palette: + + my $count = $img->colorcount; + +=item maxcolors + +Returns the maximum size of the image's palette. + + my $maxcount = $img->maxcolors; =back