Kaj Wiik wrote:
> Hi!
>
> Contouring with user-supplied translation function (mypltr) is very
> very slow probably because of the perl calling overheads. Is there a
> simple way to speed things up using Inline::C or Inline::Pdlpp?
> Looking at the pp code of pdlcont, it clearly expects ref to a perl
> sub, not C, so it is not trivial. Of course I could write a custom
> stub for plcont just for this purpose but it does not sound very
> elegant..
>
> One possibility would be to ask the PLplot developers to add this
> universal tr to the library:
>
> mypltr(PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, void *pltr_data)
> {
> *tx = tr[0] * x + tr[1] * y + tr[2];
> *ty = tr[3] * x + tr[4] * y + tr[5];
> }
>
> Any ideas?
>
Did you look at this PLplot example?
http://plplot.sourceforge.net/examples.php?demo=16&lbind=PerlDL
I believe that you can accomplish this using the built-in function
pltr2. It maps the x,y matrix index to a user defined x,y point. You'd
have to compute two (possibly large) matrices to defining the transform,
but once these are created there would be no need for the Perl callback.
-Hazen
_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl