Hi David,

Can you give a small script ( a sin function ) that is ready for me to grab get_dataref? Some to test SV to Surface pixels conversions.

Kartik Thakore

On 16-Nov-09, at 4:39 PM, David Mertens <dcmert...@gmail.com> wrote:

On Mon, Nov 16, 2009 at 1:54 PM, Kartik Thakore <thakore.kar...@gmail.com > wrote:
Hi,

So I fixed new_from to prevent it from segfaulting. Now as for direct write from PLot to Surface, where can I see the how the raw data is stored and made acessible in PDL.

Kartik Thakore

Kartik -

I've never looked too closely at the internals of PDL to know precisely how it stores the data, but as I understand, the data is typically stored in a packed scalar. The proper way to get at this data is using the get_dataref and upd_data member functions. These functions are discussed here: http://search.cpan.org/~chm/PDL-2.4.5/Basic/Core/Core.pm.PL#get_dataref

For the PDL folks, who probably don't know what's going on, I am trying to make PLplot play with SDL. I would like to quickly draw animations of plots. Doug wrote an option into PLplot that allows it to plot to a memory location, and PDL::Graphics::PLplot is capable of specifying a piddle for this purpose. His original intention was to allow him to load an image into a piddle and overlay a graph. My intention is to make an SDL surface that uses the same memory location as a PLplot output, so that I can use SDL's quick redrawing mechanisms for fast interactive plotting. I don't actually need to get PDL involved in this - SDL would do well to interact directly with PLplot - but it's probably a good idea to interface SDL::Surfaces with PDL while we're at it.

David

Reply via email to