CallExt.pm (PDL-2.074) | : | CallExt.pm (PDL-2.075) | ||
---|---|---|---|---|
skipping to change at line 75 | skipping to change at line 75 | |||
int datatype; /* whether byte/int/float etc. */ | int datatype; /* whether byte/int/float etc. */ | |||
void *data; /* Generic pointer to the data block */ | void *data; /* Generic pointer to the data block */ | |||
PDL_Indx nvals; /* Number of data values */ | PDL_Indx nvals; /* Number of data values */ | |||
PDL_Indx *dims; /* Array of data dimensions */ | PDL_Indx *dims; /* Array of data dimensions */ | |||
PDL_Indx ndims; /* Number of data dimensions */ | PDL_Indx ndims; /* Number of data dimensions */ | |||
}; | }; | |||
(PDL_Indx is 32- or 64-bit depending on architecture and is defined in pdlsimple .h) | (PDL_Indx is 32- or 64-bit depending on architecture and is defined in pdlsimple .h) | |||
This is a simplification of the internal representation of ndarrays in PDL which is | This is a simplification of the internal representation of ndarrays in PDL which is | |||
more complicated because of threading, dataflow, etc. It will usually be found | more complicated because of broadcasting, dataflow, etc. It will usually be foun d | |||
somewhere like /usr/local/lib/perl5/site_perl/PDL/pdlsimple.h | somewhere like /usr/local/lib/perl5/site_perl/PDL/pdlsimple.h | |||
Thus to actually use this to call real functions one would need to write a wrapp er. | Thus to actually use this to call real functions one would need to write a wrapp er. | |||
e.g. to call a 2D image processing routine: | e.g. to call a 2D image processing routine: | |||
void myimage_processer(double* image, int nx, int ny); | void myimage_processer(double* image, int nx, int ny); | |||
int foofunc(int nargs, pdlsimple **args) { | int foofunc(int nargs, pdlsimple **args) { | |||
pdlsimple* image = pdlsimple[0]; | pdlsimple* image = pdlsimple[0]; | |||
myimage_processer( image->data, *(image->dims), *(image->dims+1) ); | myimage_processer( image->data, *(image->dims), *(image->dims+1) ); | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added |