PDLA
view release on metacpan or search on metacpan
Basic/Core/Core.xs view on Meta::CPAN
void
list_c(x)
pdl *x
PREINIT:
PDLA_Indx *inds;
PDLA_Indx *incs;
PDLA_Indx offs;
void *data;
int ind;
int stop = 0;
PPCODE:
pdl_make_physvaffine( x );
inds = pdl_malloc(sizeof(PDLA_Indx) * x->ndims); /* GCC -> on stack :( */
data = PDLA_REPRP(x);
incs = (PDLA_VAFFOK(x) ? x->vafftrans->incs : x->dimincs);
offs = PDLA_REPROFFS(x);
EXTEND(sp,x->nvals);
for(ind=0; ind < x->ndims; ind++) inds[ind] = 0;
while(!stop) {
PUSHs(sv_2mortal(newSVnv(pdl_at( data, x->datatype,
Basic/Core/Core.xs view on Meta::CPAN
CODE:
pdl_add_threading_magic(it,-1,-1);
MODULE = PDLA::Core PACKAGE = PDLA
SV *
initialize(class)
SV *class
PREINIT:
HV *bless_stash;
PPCODE:
if (SvROK(class)) { /* a reference to a class */
bless_stash = SvSTASH(SvRV(class));
} else { /* a class name */
bless_stash = gv_stashsv(class, 0);
}
ST(0) = sv_newmortal();
SetSV_PDLA(ST(0),pdl_null()); /* set a null PDLA to this SV * */
ST(0) = sv_bless(ST(0), bless_stash); /* bless appropriately */
XSRETURN(1);
Basic/Gen/PP.pm view on Meta::CPAN
$name(...)
PREINIT:
char *objname = "PDLA"; /* XXX maybe that class should actually depend on the value set
by pp_bless ? (CS) */
HV *bless_stash = 0;
SV *parent = 0;
int nreturn;
$svdecls
$pars
PPCODE:
{
PDLA_COMMENT("Check if you can get a package name for this input value. ")
PDLA_COMMENT("It can be either a PDLA (SVt_PVMG) or a hash which is a ")
PDLA_COMMENT("derived PDLA subclass (SVt_PVHV) ")
if (SvROK(ST(0)) && ((SvTYPE(SvRV(ST(0))) == SVt_PVMG) || (SvTYPE(SvRV(ST(0))) == SVt_PVHV))) {
parent = ST(0);
if (sv_isobject(parent)){
bless_stash = SvSTASH(SvRV(ST(0)));
Graphics/IIS/iis.pd view on Meta::CPAN
pp_addhdr(<<"EOD");
#include "pdliisdisp.c"
EOD
pp_addxs('',<<'EOD');
MODULE = PDLA::Graphics::IIS PACKAGE = PDLA::Graphics::IIS
void
_iiscur_int()
PPCODE:
STRLEN n_a;
STRLEN n_b;
float x,y;
char ch;
int frame = (int)SvIV( perl_get_sv("iisframe", FALSE) );
iis_open(SvPV(perl_get_sv("fifi",FALSE),n_a),SvPV(perl_get_sv("fifo",FALSE),n_b),
(int)SvIV( perl_get_sv("fbconfig", FALSE) ),
(int)SvIV( perl_get_sv("fb_x", FALSE) ),
(int)SvIV( perl_get_sv("fb_y", FALSE) ) );
Lib/CallExt/CallExt.xs view on Meta::CPAN
* argument below. We only seem to need the line to stop perl from
* complaining about the line being missing during build time anyway.
*/
MODULE = PDLA::CallExt PACKAGE = PDLA::CallExt
PROTOTYPES: DISABLE
void
_callext_int(...)
PPCODE:
int (*symref)(int npdl, pdlsimple **x);
int npdl = items-1;
pdlsimple **x;
pdl *t;
int i;
symref = (int(*)(int, pdlsimple**)) INT2PTR(void*,SvIV(ST(0)));
New( 42, x, npdl, pdlsimple* ); /* Ptr array */
for(i=0; i<npdl; i++) {
Lib/Image2D/image2d.pd view on Meta::CPAN
pp_addhdr('#include "rotate.c"'."\n\n");
pp_add_exported('','rotnewsz');
pp_addxs('
void
rotnewsz(m,n,angle)
int m
int n
float angle
PPCODE:
int newcols, newrows;
if (getnewsize(m,n,angle,&newcols,&newrows) != 0)
croak("wrong angle (should be between -90 and +90)");
EXTEND(sp,2);
PUSHs(sv_2mortal(newSVnv(newcols)));
PUSHs(sv_2mortal(newSVnv(newrows)));
');
pp_def('rot2d',
( run in 0.783 second using v1.01-cache-2.11-cpan-5511b514fd6 )