Prima plotting in the works

From: David Mertens <dcmertens.perl_at_gmail.com>
Date: Fri, 14 Jan 2011 23:50:25 -0600
To: prima_at_prima.eu.org

Greetings -

I sat down this evening and took the first step in getting a Prima
plotting widget/library going. That first step was creating a PDL
interface to Prima::Drawable::polyline. I work with datasets that have
thousands of points and the thought of repackaging PDL data into a
Perl array ref (polyline's current argument) looked like it would be a
terrible bottleneck. So, I dug out my PDL::PP notes, as well as the
PDL::PrimaImage source as a starting point, and got to work.

My hat's off to the Prima devs for designing and implementing a very
clean codebase. It took me less than an hour to go spelunking into the
source code and find the headers for the C function I wanted to
interface. I now have a working PDL method that draws on a
Prima::Drawable object with code like this:

  use PDL::PrimaPoly;
  prima_polyline($x, $y, $widget);

$x and $y are the pixel indices. A better approach (which I will wrap
into a widget) will be to take arbitrary data and scale it to fit. I
will keep you posted with developments as they come along.

David

-- 
Sent via my carrier pigeon.
Received on Sat 15 Jan 2011 - 07:00:22 CET

This archive was generated by hypermail 2.2.0 : Sat 19 Mar 2011 - 18:35:07 CET