Subject: | getPixel |
Date: | Mon, 11 Jul 2011 09:30:17 +1000 |
To: | bug-GD-Window [...] rt.cpan.org |
From: | Kevin Ryde <user42 [...] zip.com.au> |
I noticed GD::Window doesn't have the GD getPixel(). That might be easy
to implement, perhaps directly instead of through %imWindowedFuncs,
since it might not (if I'm not mistaken) need the postRenderAdjustment()
thingie.
#!/usr/bin/perl -w
use strict;
use GD;
use GD::Window;
my $im = GD::Image->new(5, 5);
my $black = $im->colorAllocate(0,0,0);
$im->rectangle(0,0,4,4, $black);
my $win = GD::Window->new($im,
0,0, 4,4,
0,0, 4,4);
{
my $index = $im->getPixel(0,0);
print "GD direct: getPixel $index\n";
}
{
my $index = $win->getPixel(0,0);
print "Window: getPixel $index\n";
}
--
At the Sydney Olympic stadium engineers shortened the 100m track to 94m
to make room for a communications pit. Luckily someone noticed before
the Games when an under-16 schoolboys meet set a new Commonwealth record.