| 1 |
|
| |
| 2 |
|
| #line 453 "lib/PDL/PP.pm" |
| 3 |
|
| /* |
| 4 |
|
| * THIS FILE WAS GENERATED BY PDL::PP from lib/PDL/ImageRGB.pd! Do not modify! |
| 5 |
|
| */ |
| 6 |
|
| |
| 7 |
|
| #define PDL_FREE_CODE(trans, destroy, comp_free_code, ntpriv_free_code) \ |
| 8 |
|
| if (destroy) { \ |
| 9 |
|
| comp_free_code \ |
| 10 |
|
| } \ |
| 11 |
|
| if ((trans)->dims_redone) { \ |
| 12 |
|
| ntpriv_free_code \ |
| 13 |
|
| } |
| 14 |
|
| |
| 15 |
|
| #include "EXTERN.h" |
| 16 |
|
| #include "perl.h" |
| 17 |
|
| #include "XSUB.h" |
| 18 |
|
| #include "pdl.h" |
| 19 |
|
| #include "pdlcore.h" |
| 20 |
|
| #define PDL PDL_ImageRGB |
| 21 |
|
| extern Core* PDL; /* Structure hold core C functions */ |
| 22 |
|
| #line 23 "lib/PDL/ImageRGB.xs" |
| 23 |
|
| |
| 24 |
|
| #include "pdlppm.h" /* Local decs */ |
| 25 |
|
| pdl_error pdl_run_cquant_c(pdl *a,pdl *b,pdl *c,int psz); |
| 26 |
|
| |
| 27 |
|
| #line 449 "lib/PDL/PP.pm" |
| 28 |
|
| #include "pdlperl.h" |
| 29 |
|
| #line 30 "lib/PDL/ImageRGB.xs" |
| 30 |
|
| |
| 31 |
|
| Core* PDL = NULL; /* Structure hold core C functions */ |
| 32 |
|
| |
| 33 |
|
| MODULE = PDL::ImageRGB PACKAGE = PDL PREFIX=pdl_run_ |
| 34 |
|
| |
| 35 |
|
| PROTOTYPES: DISABLE |
| 36 |
|
| |
| 37 |
|
| |
| 38 |
|
| void |
| 39 |
|
| pdl_run_cquant_c(a, b=b, c=c, psz=psz) |
| 40 |
|
| SV *b_SV = (items == 4) ? ST(1) : NULL; |
| 41 |
|
| SV *c_SV = (items == 4) ? ST(2) : NULL; |
| 42 |
|
| SV *psz_SV = (items == 4) ? ST(3) : ST(1); |
| 43 |
|
| PREINIT: |
| 44 |
0 |
▶ | PDL_XS_PREAMBLE((items == 4) ? 0 : 2); |
Branch: 11 branches
| Branch | True | False | Total |
| PDL_XS_PREAMBLE((items == 4) ? 0 : 2); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 4) ? 0 : 2); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 4) ? 0 : 2); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 4) ? 0 : 2); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 4) ? 0 : 2); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 4) ? 0 : 2); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 4) ? 0 : 2); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 4) ? 0 : 2); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 4) ? 0 : 2); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 4) ? 0 : 2); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 4) ? 0 : 2); |
0 |
0 |
0 |
|
| 45 |
0 |
▶ | if (!((items == 2) || (items == 4))) |
Branch: 2 branches
| Branch | True | False | Total |
| if (!((items == 2) || (items == 4))) |
0 |
0 |
0 |
| if (!((items == 2) || (items == 4))) |
0 |
0 |
0 |
|
| 46 |
0 |
| croak("Usage: PDL::cquant_c(a,[b],[c],psz) (you may leave [outputs] and values with =defaults out of list)"); |
| 47 |
|
| INPUT: |
| 48 |
|
| pdl *a |
| 49 |
|
| pdl *b=NO_INIT |
| 50 |
|
| pdl *c=NO_INIT |
| 51 |
|
| int psz; { psz = (int)SvIV(psz_SV); } |
| 52 |
|
| PPCODE: |
| 53 |
0 |
▶ | if (b_SV) { b = PDL_CORE_(SvPDLV)(b_SV); } else b = PDL_XS_PERLINIT_initsv(b_SV); |
Branch: 2 branches
| Branch | True | False | Total |
| if (b_SV) { b = PDL_CORE_(SvPDLV)(b_SV); } else b = PDL_XS_PERLINIT_initsv(b_SV); |
0 |
0 |
0 |
| if (b_SV) { b = PDL_CORE_(SvPDLV)(b_SV); } else b = PDL_XS_PERLINIT_initsv(b_SV); |
0 |
0 |
0 |
|
| 54 |
0 |
▶ | if (c_SV) { c = PDL_CORE_(SvPDLV)(c_SV); } else c = PDL_XS_PERLINIT_initsv(c_SV); |
Branch: 2 branches
| Branch | True | False | Total |
| if (c_SV) { c = PDL_CORE_(SvPDLV)(c_SV); } else c = PDL_XS_PERLINIT_initsv(c_SV); |
0 |
0 |
0 |
| if (c_SV) { c = PDL_CORE_(SvPDLV)(c_SV); } else c = PDL_XS_PERLINIT_initsv(c_SV); |
0 |
0 |
0 |
|
| 55 |
0 |
▶ | if (PDL_IS_INPLACE(a)) PDL->pdl_barf("cquant_c: a->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(a)) PDL->pdl_barf("cquant_c: a->inplace but not supported"); |
0 |
0 |
0 |
|
| 56 |
0 |
| PDL->barf_if_error(pdl_run_cquant_c(a,b,c,psz)); |
| 57 |
0 |
▶ | PDL_XS_RETURN(ST(0) = b_SV;ST(1) = c_SV) |
Branch: 5 branches
| Branch | True | False | Total |
| PDL_XS_RETURN(ST(0) = b_SV;ST(1) = c_SV) |
0 |
0 |
0 |
| PDL_XS_RETURN(ST(0) = b_SV;ST(1) = c_SV) |
0 |
0 |
0 |
| PDL_XS_RETURN(ST(0) = b_SV;ST(1) = c_SV) |
0 |
0 |
0 |
| PDL_XS_RETURN(ST(0) = b_SV;ST(1) = c_SV) |
0 |
0 |
0 |
| PDL_XS_RETURN(ST(0) = b_SV;ST(1) = c_SV) |
0 |
0 |
0 |
|
| 58 |
|
| |
| 59 |
|
| |
| 60 |
|
| #line 483 "lib/PDL/PP.pm" |
| 61 |
|
| BOOT: |
| 62 |
|
| /* Get pointer to structure of core shared C routines */ |
| 63 |
|
| /* make sure PDL::Core is loaded */ |
| 64 |
|
| #line 65 "lib/PDL/ImageRGB.xs" |
| 65 |
15 |
| perl_require_pv ("PDL/Core.pm"); /* make sure PDL::Core is loaded */ |
| 66 |
|
| #ifndef aTHX_ |
| 67 |
|
| #define aTHX_ |
| 68 |
|
| #endif |
| 69 |
15 |
▶ | if (SvTRUE (ERRSV)) Perl_croak(aTHX_ "%s",SvPV_nolen (ERRSV)); |
Branch: 3 branches
| Branch | True | False | Total |
| if (SvTRUE (ERRSV)) Perl_croak(aTHX_ "%s",SvPV_nolen (ERRSV)); |
15 |
0 |
15 |
| if (SvTRUE (ERRSV)) Perl_croak(aTHX_ "%s",SvPV_nolen (ERRSV)); |
0 |
15 |
15 |
| if (SvTRUE (ERRSV)) Perl_croak(aTHX_ "%s",SvPV_nolen (ERRSV)); |
0 |
0 |
0 |
|
| 70 |
15 |
| SV* CoreSV = perl_get_sv("PDL::SHARE",FALSE); /* var with core structure */ |
| 71 |
15 |
▶ | if (!CoreSV) |
Branch: 1 branch
| Branch | True | False | Total |
| if (!CoreSV) |
0 |
15 |
15 |
|
| 72 |
0 |
| Perl_croak(aTHX_ "We require the PDL::Core module, which was not found"); |
| 73 |
15 |
▶ | if (!(PDL = INT2PTR(Core*,SvIV( CoreSV )))) /* Core* value */ |
Branch: 1 branch
| Branch | True | False | Total |
| if (!(PDL = INT2PTR(Core*,SvIV( CoreSV )))) /* Core* value */ |
0 |
15 |
15 |
|
| 74 |
0 |
| Perl_croak(aTHX_ "Got NULL pointer for PDL"); |
| 75 |
15 |
▶ | if (PDL->Version != PDL_CORE_VERSION) |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL->Version != PDL_CORE_VERSION) |
0 |
15 |
15 |
|
| 76 |
0 |
| Perl_croak(aTHX_ "[PDL->Version: %ld PDL_CORE_VERSION: %ld XS_VERSION: %s] PDL::ImageRGB needs to be recompiled against the newly installed PDL", (long int)PDL->Version, (long int)PDL_CORE_VERSION, XS_VERSION); |