Puneet, I am fairly certain that your guess is correct:

On Tue, Apr 20, 2010 at 12:09 AM, P Kishor <[email protected]> wrote:

> what is $x(pdl)? Is that a 1D pdl of all the x coords in the image,
> essentially a list of x coords? I have gone through the source code of your
> module, and I don't see anything except the following --
> <snip>
>

Automatically generated code can make writing bindings a cinch, but grocking
what was intended is not trivial. I'm 99% sure that a correct calling
convention for gdImageSetPixels is as you described, in which the $x, $y,
and $color values are piddles.

Now here's the really cool part about threading. Suppose you want a column
of dots. You only need to supply a scalar value for $x, and PDL will thread
over it:

my $x = 4;
my $ys = sequence(10) * 2;  # position at 0, 2, 4, ...
my $color = 0;   # black?
$image->gdImageSetPixel( $x, $ys, $color );

Hope that helps.
David
_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to