PDL-Graphics-PLplot
view release on metacpan or search on metacpan
# Linear interpolation from doubly dimensioned coord arrays
for my $t ([qw(pltr0 SV*)], [qw(pltr1 PLcGridPtr)], [qw(pltr2 PLcGrid2Ptr)]) {
my ($func, $type) = @$t;
pp_addxs (<<"EOC");
void
$func(x, y, grid)
double x
double y
$type grid
PPCODE:
PLFLT tx, ty;
$func(x, y, &tx, &ty, (PLPointer) grid);
EXTEND (SP, 2);
PUSHs(sv_2mortal(newSVnv((double) tx)));
PUSHs(sv_2mortal(newSVnv((double) ty)));
EOC
pp_add_exported($func);
}
pp_def ('plAllocGrid',
$COMP(grid) = (PLcGridPtr__OUT)grid;'
);
# Free a PLcGrid object
pp_addxs (<<"EOC");
void
plFreeGrid (pg)
PLcGridPtr pg
PPCODE:
PLPTR_RECEIVE_IN(PLcGrid, grid, pg)
Safefree(grid->xg);
Safefree(grid->yg);
Safefree(grid);
EOC
pp_add_exported (plFreeGrid);
pp_def ('plAlloc2dGrid',
NoPthread => 1,
$COMP(grid) = grid;'
);
# Free a PLcGrid2 object
pp_addxs (<<"EOC");
void
plFree2dGrid(pg)
PLcGrid2Ptr pg
PPCODE:
PLPTR_RECEIVE_IN(PLcGrid2, grid, pg)
plFree2dGrid(grid->xg, grid->nx, grid->ny);
plFree2dGrid(grid->yg, grid->nx, grid->ny);
free(grid);
EOC
pp_add_exported (plFree2dGrid);
pp_addhdr (<<'EOH');
wX, wY: world coordinates of pointer
Returns an empty hash if no translation to world coordinates is possible.
=cut
EOPM
pp_addxs (<<"EOC");
void
plGetCursor ()
PPCODE:
PLGraphicsIn gin;
if (plGetCursor (&gin)) {
EXTEND (SP, 24);
PUSHs (sv_2mortal (newSVpv ("type", 0)));
PUSHs (sv_2mortal (newSViv ((IV) gin.type)));
PUSHs (sv_2mortal (newSVpv ("state", 0)));
PUSHs (sv_2mortal (newSVuv ((UV) gin.state)));
PUSHs (sv_2mortal (newSVpv ("keysym", 0)));
PUSHs (sv_2mortal (newSVuv ((UV) gin.keysym)));
PUSHs (sv_2mortal (newSVpv ("button", 0)));
SV* box_patterns_rv
SV* box_scales_rv
SV* box_line_widths_rv
SV* line_colors_rv
SV* line_styles_rv
SV* line_widths_rv
SV* symbol_colors_rv
SV* symbol_scales_rv
SV* symbol_numbers_rv
SV* symbols_rv
PPCODE:
int i;
double p_legend_width;
double p_legend_height;
int opt_array[nlegend];
int text_colors[nlegend];
char *text[nlegend];
int box_colors[nlegend];
int box_patterns[nlegend];
double box_scales[nlegend];
$width_type box_line_widths[nlegend];
Set color palette 0 from the input .pal file. See the PLplot manual for more details.
=cut
EOPM
pp_addxs (<<"EOC");
int
plspal0 (filename)
char* filename
PPCODE:
plspal0((const char *)filename);
EOC
pp_add_exported ('plspal0');
#----------------------------------------------------------------------------
pp_addpm (<<'EOPM');
=head2 plspal1
=for sig
Set color palette 1 from the input .pal file. See the PLplot manual for more details.
=cut
EOPM
pp_addxs (<<"EOC");
int
plspal1 (filename, interpolate)
char* filename
int interpolate
PPCODE:
plspal1((const char *)filename, (PLBOOL)interpolate);
EOC
pp_add_exported ('plspal1');
pp_addpm (<<'EOPM');
=head2 plbtime
=for sig
my ($year, $month, $day, $hour, $min, $sec) = plbtime($ctime);
Calculate broken-down time from continuous time for current stream.
=cut
EOPM
pp_addxs (<<"EOC");
void
plbtime (ctime)
double ctime
PPCODE:
PLINT year;
PLINT month;
PLINT day;
PLINT hour;
PLINT min;
PLFLT sec;
c_plbtime(&year, &month, &day, &hour, &min, &sec, ctime);
EXTEND (SP, 6);
PUSHs (sv_2mortal (newSViv (year)));
PUSHs (sv_2mortal (newSViv (month)));
double offset1
double offset2
int ccontrol
int ifbtime_offset
int year
int month
int day
int hour
int min
double sec
PPCODE:
c_plconfigtime((PLFLT) scale, (PLFLT) offset1, (PLFLT) offset2,
(PLINT) ccontrol, (PLBOOL) ifbtime_offset, (PLINT) year,
(PLINT) month, (PLINT) day, (PLINT) hour, (PLINT) min, (PLFLT) sec);
EOC
pp_add_exported ('plconfigtime');
pp_addpm (<<'EOPM');
=head2 plctime
=for sig
pp_addxs (<<"EOC");
void
plctime(year, month, day, hour, min, sec)
int year
int month
int day
int hour
int min
double sec
PPCODE:
PLFLT ctime;
c_plctime(year, month, day, hour, min, sec, &ctime);
EXTEND (SP, 1);
PUSHs (sv_2mortal (newSVnv (ctime)));
EOC
pp_add_exported ('plctime');
pp_addpm (<<'EOPM');
=head2 pltimefmt
consistent with the POSIX strpformat/strftime flags, but see the PLplot manual
for details.
=cut
EOPM
pp_addxs (<<"EOC");
void
pltimefmt(fmt)
char *fmt
PPCODE:
c_pltimefmt((const char *)fmt);
EOC
pp_add_exported ('pltimefmt');
pp_addpm (<<'EOPM');
=head2 plsesc
=for sig
plsesc($esc);
Set the escape character for text strings. See the PLplot manual for more details.
=cut
EOPM
pp_addxs (<<"EOC");
void
plsesc (esc)
SV* esc
PPCODE:
char *esc_c;
esc_c = (char *)SvPV_nolen(esc);
c_plsesc((char)*esc_c);
EOC
pp_add_exported ('plsesc');
pp_def ('plvect',
NoPthread => 1,
GenericTypes => [D],
( run in 1.307 second using v1.01-cache-2.11-cpan-5511b514fd6 )