| 1 |
|
| |
| 2 |
|
| #line 453 "lib/PDL/PP.pm" |
| 3 |
|
| /* |
| 4 |
|
| * THIS FILE WAS GENERATED BY PDL::PP from lib/PDL/Image2D.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_Image2D |
| 21 |
|
| extern Core* PDL; /* Structure hold core C functions */ |
| 22 |
|
| #line 23 "lib/PDL/Image2D.xs" |
| 23 |
|
| pdl_error pdl_run_polyfill_pp(pdl *im,pdl *ps,pdl *col); |
| 24 |
|
| pdl_error pdl_run_pnpoly_pp(pdl *a,pdl *ps,pdl *msk); |
| 25 |
|
| pdl_error pdl_run_pnpolyfill_pp(pdl *a,pdl *ps,pdl *col); |
| 26 |
|
| |
| 27 |
|
| |
| 28 |
|
| /* Fast Modulus with proper negative behaviour */ |
| 29 |
|
| |
| 30 |
|
| #define REALMOD(a,b) {while ((a)>=(b)) (a) -= (b); while ((a)<0) (a) += (b);} |
| 31 |
|
| |
| 32 |
|
| #define X(symbol, ctype, ppsym, ...) \ |
| 33 |
|
| ctype quick_select_ ## ppsym(ctype arr[], int n); |
| 34 |
|
| PDL_TYPELIST_REAL(X) |
| 35 |
|
| #undef X |
| 36 |
|
| pdl_error pdl_run_conv2d(pdl *a,pdl *kern,pdl *b,int opt); |
| 37 |
|
| pdl_error pdl_run_med2d(pdl *a,pdl *kern,pdl *b,int opt); |
| 38 |
|
| pdl_error pdl_run_med2df(pdl *a,pdl *b,IV p_size,IV q_size,int opt); |
| 39 |
|
| #define EZ(x) ez ? 0 : (x) |
| 40 |
|
| pdl_error pdl_run_box2d(pdl *a,pdl *b,int wx,int wy,int edgezero); |
| 41 |
|
| pdl_error pdl_run_patch2d(pdl *a,pdl *bad,pdl *b); |
| 42 |
|
| pdl_error pdl_run_patchbad2d(pdl *a,pdl *b); |
| 43 |
|
| pdl_error pdl_run_max2d_ind(pdl *a,pdl *val,pdl *x,pdl *y); |
| 44 |
|
| pdl_error pdl_run_centroid2d(pdl *im,pdl *x,pdl *y,pdl *box,pdl *xcen,pdl *ycen); |
| 45 |
|
| pdl_error pdl_run_ccNcompt(pdl *a,pdl *b,int con); |
| 46 |
|
| int getnewsize(PDL_Indx cols, PDL_Indx rows, float fangle, PDL_Indx *newcols, PDL_Indx *newrows); |
| 47 |
|
| typedef unsigned char imT; /* image type */ |
| 48 |
|
| int rotate(imT *im, imT *out, int cols, int rows, int nc, int nr, |
| 49 |
|
| float fangle, imT bgval, int antialias); |
| 50 |
|
| pdl_error pdl_run_rot2d(pdl *im,pdl *angle,pdl *bg,pdl *aa,pdl *om); |
| 51 |
|
| pdl_error pdl_run_bilin2d(pdl *Int,pdl *O); |
| 52 |
|
| pdl_error pdl_run_rescale2d(pdl *Int,pdl *O); |
| 53 |
|
| #include "resample.h" |
| 54 |
|
| pdl_error pdl_run_warp2d(pdl *img,pdl *px,pdl *py,pdl *warp,char *kernel_type,double noval,IV nsamples); |
| 55 |
|
| pdl_error pdl_run_warp2d_kernel(pdl *x,pdl *k,char *name,PDL_Indx nsize); |
| 56 |
|
| |
| 57 |
|
| #line 449 "lib/PDL/PP.pm" |
| 58 |
|
| #include "pdlperl.h" |
| 59 |
|
| #line 60 "lib/PDL/Image2D.xs" |
| 60 |
|
| |
| 61 |
|
| Core* PDL = NULL; /* Structure hold core C functions */ |
| 62 |
|
| |
| 63 |
|
| MODULE = PDL::Image2D PACKAGE = PDL PREFIX=pdl_run_ |
| 64 |
|
| |
| 65 |
|
| PROTOTYPES: DISABLE |
| 66 |
|
| |
| 67 |
|
| |
| 68 |
|
| void |
| 69 |
|
| pdl_run_polyfill_pp(im, ps, col) |
| 70 |
|
| pdl *im |
| 71 |
|
| pdl *ps |
| 72 |
|
| pdl *col |
| 73 |
|
| PPCODE: |
| 74 |
2 |
▶ | if (PDL_IS_INPLACE(im)) PDL->pdl_barf("polyfill_pp: im->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(im)) PDL->pdl_barf("polyfill_pp: im->inplace but not supported"); |
0 |
2 |
2 |
|
| 75 |
2 |
▶ | if (PDL_IS_INPLACE(ps)) PDL->pdl_barf("polyfill_pp: ps->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(ps)) PDL->pdl_barf("polyfill_pp: ps->inplace but not supported"); |
0 |
2 |
2 |
|
| 76 |
2 |
▶ | if (PDL_IS_INPLACE(col)) PDL->pdl_barf("polyfill_pp: col->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(col)) PDL->pdl_barf("polyfill_pp: col->inplace but not supported"); |
0 |
2 |
2 |
|
| 77 |
2 |
| PDL->barf_if_error(pdl_run_polyfill_pp(im,ps,col)); |
| 78 |
|
| |
| 79 |
|
| void |
| 80 |
|
| pdl_run_pnpoly_pp(a, ps, msk=PDL_XS_PERLINIT_initsv(msk_SV)) |
| 81 |
|
| SV *msk_SV = items > 2 ? ST(2) : NULL; |
| 82 |
|
| PREINIT: |
| 83 |
2 |
▶ | PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
Branch: 10 branches
| Branch | True | False | Total |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
2 |
0 |
2 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
0 |
2 |
2 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
2 |
0 |
2 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
2 |
0 |
2 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
2 |
0 |
2 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
0 |
2 |
2 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
2 |
0 |
2 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
0 |
2 |
2 |
|
| 84 |
|
| INPUT: |
| 85 |
|
| pdl *a |
| 86 |
|
| pdl *ps |
| 87 |
|
| pdl *msk |
| 88 |
|
| PPCODE: |
| 89 |
2 |
▶ | if (PDL_IS_INPLACE(a)) PDL->pdl_barf("pnpoly_pp: a->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(a)) PDL->pdl_barf("pnpoly_pp: a->inplace but not supported"); |
0 |
2 |
2 |
|
| 90 |
2 |
▶ | if (PDL_IS_INPLACE(ps)) PDL->pdl_barf("pnpoly_pp: ps->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(ps)) PDL->pdl_barf("pnpoly_pp: ps->inplace but not supported"); |
0 |
2 |
2 |
|
| 91 |
2 |
| PDL->barf_if_error(pdl_run_pnpoly_pp(a,ps,msk)); |
| 92 |
2 |
▶ | PDL_XS_RETURN(ST(0) = msk_SV) |
Branch: 5 branches
| Branch | True | False | Total |
| PDL_XS_RETURN(ST(0) = msk_SV) |
2 |
0 |
2 |
| PDL_XS_RETURN(ST(0) = msk_SV) |
2 |
0 |
2 |
| PDL_XS_RETURN(ST(0) = msk_SV) |
2 |
0 |
2 |
| PDL_XS_RETURN(ST(0) = msk_SV) |
0 |
2 |
2 |
| PDL_XS_RETURN(ST(0) = msk_SV) |
0 |
0 |
0 |
|
| 93 |
|
| |
| 94 |
|
| void |
| 95 |
|
| pdl_run_pnpolyfill_pp(a, ps, col) |
| 96 |
|
| pdl *a |
| 97 |
|
| pdl *ps |
| 98 |
|
| pdl *col |
| 99 |
|
| PPCODE: |
| 100 |
1 |
▶ | if (PDL_IS_INPLACE(a)) PDL->pdl_barf("pnpolyfill_pp: a->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(a)) PDL->pdl_barf("pnpolyfill_pp: a->inplace but not supported"); |
0 |
1 |
1 |
|
| 101 |
1 |
▶ | if (PDL_IS_INPLACE(ps)) PDL->pdl_barf("pnpolyfill_pp: ps->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(ps)) PDL->pdl_barf("pnpolyfill_pp: ps->inplace but not supported"); |
0 |
1 |
1 |
|
| 102 |
1 |
▶ | if (PDL_IS_INPLACE(col)) PDL->pdl_barf("pnpolyfill_pp: col->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(col)) PDL->pdl_barf("pnpolyfill_pp: col->inplace but not supported"); |
0 |
1 |
1 |
|
| 103 |
1 |
| PDL->barf_if_error(pdl_run_pnpolyfill_pp(a,ps,col)); |
| 104 |
|
| |
| 105 |
|
| void |
| 106 |
|
| _conv2d_int(a,kern,b,opt) |
| 107 |
|
| pdl *a |
| 108 |
|
| pdl *kern |
| 109 |
|
| pdl *b |
| 110 |
|
| int opt |
| 111 |
|
| CODE: |
| 112 |
12 |
| PDL->barf_if_error(pdl_run_conv2d(a,kern,b,opt)); |
| 113 |
|
| |
| 114 |
|
| void |
| 115 |
|
| _med2d_int(a,kern,b,opt) |
| 116 |
|
| pdl *a |
| 117 |
|
| pdl *kern |
| 118 |
|
| pdl *b |
| 119 |
|
| int opt |
| 120 |
|
| CODE: |
| 121 |
2 |
| PDL->barf_if_error(pdl_run_med2d(a,kern,b,opt)); |
| 122 |
|
| |
| 123 |
|
| void |
| 124 |
|
| _med2df_int(a,b,p_size,q_size,opt) |
| 125 |
|
| pdl *a |
| 126 |
|
| pdl *b |
| 127 |
|
| IV p_size |
| 128 |
|
| IV q_size |
| 129 |
|
| int opt |
| 130 |
|
| CODE: |
| 131 |
1 |
| PDL->barf_if_error(pdl_run_med2df(a,b,p_size,q_size,opt)); |
| 132 |
|
| |
| 133 |
|
| void |
| 134 |
|
| pdl_run_box2d(a, b=b, wx=wx, wy=wy, edgezero=edgezero) |
| 135 |
|
| SV *b_SV = (items == 5) ? ST(1) : NULL; |
| 136 |
|
| SV *wx_SV = (items == 5) ? ST(2) : ST(1); |
| 137 |
|
| SV *wy_SV = (items == 5) ? ST(3) : ST(2); |
| 138 |
|
| SV *edgezero_SV = (items == 5) ? ST(4) : ST(3); |
| 139 |
|
| PREINIT: |
| 140 |
2 |
▶ | PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
Branch: 10 branches
| Branch | True | False | Total |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
2 |
0 |
2 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
0 |
2 |
2 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
2 |
0 |
2 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
2 |
0 |
2 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
2 |
0 |
2 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
0 |
2 |
2 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
2 |
0 |
2 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
0 |
2 |
2 |
|
| 141 |
2 |
▶ | if (!((items == 4) || (items == 5))) |
Branch: 2 branches
| Branch | True | False | Total |
| if (!((items == 4) || (items == 5))) |
0 |
2 |
2 |
| if (!((items == 4) || (items == 5))) |
0 |
0 |
0 |
|
| 142 |
0 |
| croak("Usage: PDL::box2d(a,[b],wx,wy,edgezero) (you may leave [outputs] and values with =defaults out of list)"); |
| 143 |
|
| INPUT: |
| 144 |
|
| pdl *a |
| 145 |
|
| pdl *b=NO_INIT |
| 146 |
|
| int wx; { wx = (int)SvIV(wx_SV); } |
| 147 |
|
| int wy; { wy = (int)SvIV(wy_SV); } |
| 148 |
|
| int edgezero; { edgezero = (int)SvIV(edgezero_SV); } |
| 149 |
|
| PPCODE: |
| 150 |
2 |
▶ | 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 |
2 |
2 |
| if (b_SV) { b = PDL_CORE_(SvPDLV)(b_SV); } else b = PDL_XS_PERLINIT_initsv(b_SV); |
0 |
2 |
2 |
|
| 151 |
2 |
▶ | if (PDL_IS_INPLACE(a)) PDL->pdl_barf("box2d: a->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(a)) PDL->pdl_barf("box2d: a->inplace but not supported"); |
0 |
2 |
2 |
|
| 152 |
2 |
| PDL->barf_if_error(pdl_run_box2d(a,b,wx,wy,edgezero)); |
| 153 |
2 |
▶ | PDL_XS_RETURN(ST(0) = b_SV) |
Branch: 5 branches
| Branch | True | False | Total |
| PDL_XS_RETURN(ST(0) = b_SV) |
2 |
0 |
2 |
| PDL_XS_RETURN(ST(0) = b_SV) |
2 |
0 |
2 |
| PDL_XS_RETURN(ST(0) = b_SV) |
2 |
0 |
2 |
| PDL_XS_RETURN(ST(0) = b_SV) |
0 |
2 |
2 |
| PDL_XS_RETURN(ST(0) = b_SV) |
0 |
0 |
0 |
|
| 154 |
|
| |
| 155 |
|
| void |
| 156 |
|
| pdl_run_patch2d(a, bad, b=PDL_XS_PERLINIT_initsv(b_SV)) |
| 157 |
|
| SV *b_SV = items > 2 ? ST(2) : NULL; |
| 158 |
|
| PREINIT: |
| 159 |
3 |
▶ | PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
Branch: 10 branches
| Branch | True | False | Total |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
3 |
0 |
3 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
0 |
3 |
3 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
3 |
0 |
3 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
3 |
0 |
3 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
3 |
0 |
3 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
0 |
3 |
3 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
3 |
0 |
3 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
0 |
3 |
3 |
|
| 160 |
|
| INPUT: |
| 161 |
|
| pdl *a |
| 162 |
|
| pdl *bad |
| 163 |
|
| pdl *b |
| 164 |
|
| PPCODE: |
| 165 |
3 |
▶ | if (PDL_IS_INPLACE(a)) PDL->pdl_barf("patch2d: a->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(a)) PDL->pdl_barf("patch2d: a->inplace but not supported"); |
0 |
3 |
3 |
|
| 166 |
3 |
▶ | if (PDL_IS_INPLACE(bad)) PDL->pdl_barf("patch2d: bad->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(bad)) PDL->pdl_barf("patch2d: bad->inplace but not supported"); |
0 |
3 |
3 |
|
| 167 |
3 |
| PDL->barf_if_error(pdl_run_patch2d(a,bad,b)); |
| 168 |
3 |
▶ | PDL_XS_RETURN(ST(0) = b_SV) |
Branch: 5 branches
| Branch | True | False | Total |
| PDL_XS_RETURN(ST(0) = b_SV) |
3 |
0 |
3 |
| PDL_XS_RETURN(ST(0) = b_SV) |
3 |
0 |
3 |
| PDL_XS_RETURN(ST(0) = b_SV) |
3 |
0 |
3 |
| PDL_XS_RETURN(ST(0) = b_SV) |
0 |
3 |
3 |
| PDL_XS_RETURN(ST(0) = b_SV) |
0 |
0 |
0 |
|
| 169 |
|
| |
| 170 |
|
| void |
| 171 |
|
| pdl_run_patchbad2d(a, b=PDL_XS_PERLINIT_initsv(b_SV)) |
| 172 |
|
| SV *b_SV = items > 1 ? ST(1) : NULL; |
| 173 |
|
| PREINIT: |
| 174 |
2 |
▶ | PDL_XS_PREAMBLE((items == 2) ? 0 : 1); |
Branch: 10 branches
| Branch | True | False | Total |
| PDL_XS_PREAMBLE((items == 2) ? 0 : 1); |
2 |
0 |
2 |
| PDL_XS_PREAMBLE((items == 2) ? 0 : 1); |
0 |
2 |
2 |
| PDL_XS_PREAMBLE((items == 2) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 2) ? 0 : 1); |
2 |
0 |
2 |
| PDL_XS_PREAMBLE((items == 2) ? 0 : 1); |
2 |
0 |
2 |
| PDL_XS_PREAMBLE((items == 2) ? 0 : 1); |
2 |
0 |
2 |
| PDL_XS_PREAMBLE((items == 2) ? 0 : 1); |
0 |
2 |
2 |
| PDL_XS_PREAMBLE((items == 2) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 2) ? 0 : 1); |
2 |
0 |
2 |
| PDL_XS_PREAMBLE((items == 2) ? 0 : 1); |
0 |
2 |
2 |
|
| 175 |
|
| INPUT: |
| 176 |
|
| pdl *a |
| 177 |
|
| pdl *b |
| 178 |
|
| PPCODE: |
| 179 |
2 |
▶ | if (PDL_IS_INPLACE(a)) PDL->pdl_barf("patchbad2d: a->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(a)) PDL->pdl_barf("patchbad2d: a->inplace but not supported"); |
0 |
2 |
2 |
|
| 180 |
2 |
| PDL->barf_if_error(pdl_run_patchbad2d(a,b)); |
| 181 |
2 |
▶ | PDL_XS_RETURN(ST(0) = b_SV) |
Branch: 5 branches
| Branch | True | False | Total |
| PDL_XS_RETURN(ST(0) = b_SV) |
2 |
0 |
2 |
| PDL_XS_RETURN(ST(0) = b_SV) |
2 |
0 |
2 |
| PDL_XS_RETURN(ST(0) = b_SV) |
2 |
0 |
2 |
| PDL_XS_RETURN(ST(0) = b_SV) |
0 |
2 |
2 |
| PDL_XS_RETURN(ST(0) = b_SV) |
0 |
0 |
0 |
|
| 182 |
|
| |
| 183 |
|
| void |
| 184 |
|
| pdl_run_max2d_ind(a, val=PDL_XS_PERLINIT_initsv(val_SV), x=PDL_XS_PERLINIT_initsv(x_SV), y=PDL_XS_PERLINIT_initsv(y_SV)) |
| 185 |
|
| SV *val_SV = items > 1 ? ST(1) : NULL; |
| 186 |
|
| SV *x_SV = items > 2 ? ST(2) : NULL; |
| 187 |
|
| SV *y_SV = items > 3 ? ST(3) : NULL; |
| 188 |
|
| PREINIT: |
| 189 |
2 |
▶ | PDL_XS_PREAMBLE((items == 4) ? 0 : 3); |
Branch: 11 branches
| Branch | True | False | Total |
| PDL_XS_PREAMBLE((items == 4) ? 0 : 3); |
0 |
2 |
2 |
| PDL_XS_PREAMBLE((items == 4) ? 0 : 3); |
2 |
0 |
2 |
| PDL_XS_PREAMBLE((items == 4) ? 0 : 3); |
0 |
2 |
2 |
| PDL_XS_PREAMBLE((items == 4) ? 0 : 3); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 4) ? 0 : 3); |
2 |
0 |
2 |
| PDL_XS_PREAMBLE((items == 4) ? 0 : 3); |
2 |
0 |
2 |
| PDL_XS_PREAMBLE((items == 4) ? 0 : 3); |
2 |
0 |
2 |
| PDL_XS_PREAMBLE((items == 4) ? 0 : 3); |
0 |
2 |
2 |
| PDL_XS_PREAMBLE((items == 4) ? 0 : 3); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 4) ? 0 : 3); |
2 |
0 |
2 |
| PDL_XS_PREAMBLE((items == 4) ? 0 : 3); |
0 |
2 |
2 |
|
| 190 |
|
| INPUT: |
| 191 |
|
| pdl *a |
| 192 |
|
| pdl *val |
| 193 |
|
| pdl *x |
| 194 |
|
| pdl *y |
| 195 |
|
| PPCODE: |
| 196 |
2 |
▶ | if (PDL_IS_INPLACE(a)) PDL->pdl_barf("max2d_ind: a->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(a)) PDL->pdl_barf("max2d_ind: a->inplace but not supported"); |
0 |
2 |
2 |
|
| 197 |
2 |
| PDL->barf_if_error(pdl_run_max2d_ind(a,val,x,y)); |
| 198 |
2 |
▶ | PDL_XS_RETURN(ST(0) = val_SV;ST(1) = x_SV;ST(2) = y_SV) |
Branch: 5 branches
| Branch | True | False | Total |
| PDL_XS_RETURN(ST(0) = val_SV;ST(1) = x_SV;ST(2) = y_SV) |
2 |
0 |
2 |
| PDL_XS_RETURN(ST(0) = val_SV;ST(1) = x_SV;ST(2) = y_SV) |
2 |
0 |
2 |
| PDL_XS_RETURN(ST(0) = val_SV;ST(1) = x_SV;ST(2) = y_SV) |
2 |
0 |
2 |
| PDL_XS_RETURN(ST(0) = val_SV;ST(1) = x_SV;ST(2) = y_SV) |
0 |
2 |
2 |
| PDL_XS_RETURN(ST(0) = val_SV;ST(1) = x_SV;ST(2) = y_SV) |
0 |
0 |
0 |
|
| 199 |
|
| |
| 200 |
|
| void |
| 201 |
|
| pdl_run_centroid2d(im, x, y, box, xcen=PDL_XS_PERLINIT_initsv(xcen_SV), ycen=PDL_XS_PERLINIT_initsv(ycen_SV)) |
| 202 |
|
| SV *xcen_SV = items > 4 ? ST(4) : NULL; |
| 203 |
|
| SV *ycen_SV = items > 5 ? ST(5) : NULL; |
| 204 |
|
| PREINIT: |
| 205 |
2 |
▶ | PDL_XS_PREAMBLE((items == 6) ? 0 : 2); |
Branch: 11 branches
| Branch | True | False | Total |
| PDL_XS_PREAMBLE((items == 6) ? 0 : 2); |
0 |
2 |
2 |
| PDL_XS_PREAMBLE((items == 6) ? 0 : 2); |
2 |
0 |
2 |
| PDL_XS_PREAMBLE((items == 6) ? 0 : 2); |
0 |
2 |
2 |
| PDL_XS_PREAMBLE((items == 6) ? 0 : 2); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 6) ? 0 : 2); |
2 |
0 |
2 |
| PDL_XS_PREAMBLE((items == 6) ? 0 : 2); |
2 |
0 |
2 |
| PDL_XS_PREAMBLE((items == 6) ? 0 : 2); |
2 |
0 |
2 |
| PDL_XS_PREAMBLE((items == 6) ? 0 : 2); |
0 |
2 |
2 |
| PDL_XS_PREAMBLE((items == 6) ? 0 : 2); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 6) ? 0 : 2); |
2 |
0 |
2 |
| PDL_XS_PREAMBLE((items == 6) ? 0 : 2); |
0 |
2 |
2 |
|
| 206 |
|
| INPUT: |
| 207 |
|
| pdl *im |
| 208 |
|
| pdl *x |
| 209 |
|
| pdl *y |
| 210 |
|
| pdl *box |
| 211 |
|
| pdl *xcen |
| 212 |
|
| pdl *ycen |
| 213 |
|
| PPCODE: |
| 214 |
2 |
▶ | if (PDL_IS_INPLACE(im)) PDL->pdl_barf("centroid2d: im->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(im)) PDL->pdl_barf("centroid2d: im->inplace but not supported"); |
0 |
2 |
2 |
|
| 215 |
2 |
▶ | if (PDL_IS_INPLACE(x)) PDL->pdl_barf("centroid2d: x->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(x)) PDL->pdl_barf("centroid2d: x->inplace but not supported"); |
0 |
2 |
2 |
|
| 216 |
2 |
▶ | if (PDL_IS_INPLACE(y)) PDL->pdl_barf("centroid2d: y->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(y)) PDL->pdl_barf("centroid2d: y->inplace but not supported"); |
0 |
2 |
2 |
|
| 217 |
2 |
▶ | if (PDL_IS_INPLACE(box)) PDL->pdl_barf("centroid2d: box->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(box)) PDL->pdl_barf("centroid2d: box->inplace but not supported"); |
0 |
2 |
2 |
|
| 218 |
2 |
| PDL->barf_if_error(pdl_run_centroid2d(im,x,y,box,xcen,ycen)); |
| 219 |
2 |
▶ | PDL_XS_RETURN(ST(0) = xcen_SV;ST(1) = ycen_SV) |
Branch: 5 branches
| Branch | True | False | Total |
| PDL_XS_RETURN(ST(0) = xcen_SV;ST(1) = ycen_SV) |
2 |
0 |
2 |
| PDL_XS_RETURN(ST(0) = xcen_SV;ST(1) = ycen_SV) |
2 |
0 |
2 |
| PDL_XS_RETURN(ST(0) = xcen_SV;ST(1) = ycen_SV) |
2 |
0 |
2 |
| PDL_XS_RETURN(ST(0) = xcen_SV;ST(1) = ycen_SV) |
0 |
2 |
2 |
| PDL_XS_RETURN(ST(0) = xcen_SV;ST(1) = ycen_SV) |
0 |
0 |
0 |
|
| 220 |
|
| |
| 221 |
|
| void |
| 222 |
|
| pdl_run_ccNcompt(a, b=b, con=con) |
| 223 |
|
| SV *b_SV = (items == 3) ? ST(1) : NULL; |
| 224 |
|
| SV *con_SV = (items == 3) ? ST(2) : ST(1); |
| 225 |
|
| PREINIT: |
| 226 |
6 |
▶ | PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
Branch: 10 branches
| Branch | True | False | Total |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
6 |
0 |
6 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
0 |
6 |
6 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
6 |
0 |
6 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
6 |
0 |
6 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
6 |
0 |
6 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
0 |
6 |
6 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
6 |
0 |
6 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
0 |
6 |
6 |
|
| 227 |
6 |
▶ | if (!((items == 2) || (items == 3))) |
Branch: 2 branches
| Branch | True | False | Total |
| if (!((items == 2) || (items == 3))) |
0 |
6 |
6 |
| if (!((items == 2) || (items == 3))) |
0 |
0 |
0 |
|
| 228 |
0 |
| croak("Usage: PDL::ccNcompt(a,[b],con) (you may leave [outputs] and values with =defaults out of list)"); |
| 229 |
|
| INPUT: |
| 230 |
|
| pdl *a |
| 231 |
|
| pdl *b=NO_INIT |
| 232 |
|
| int con; { con = (int)SvIV(con_SV); } |
| 233 |
|
| PPCODE: |
| 234 |
6 |
▶ | 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 |
6 |
6 |
| if (b_SV) { b = PDL_CORE_(SvPDLV)(b_SV); } else b = PDL_XS_PERLINIT_initsv(b_SV); |
0 |
6 |
6 |
|
| 235 |
6 |
▶ | if (PDL_IS_INPLACE(a)) PDL->pdl_barf("ccNcompt: a->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(a)) PDL->pdl_barf("ccNcompt: a->inplace but not supported"); |
0 |
6 |
6 |
|
| 236 |
6 |
| PDL->barf_if_error(pdl_run_ccNcompt(a,b,con)); |
| 237 |
5 |
▶ | PDL_XS_RETURN(ST(0) = b_SV) |
Branch: 5 branches
| Branch | True | False | Total |
| PDL_XS_RETURN(ST(0) = b_SV) |
5 |
0 |
5 |
| PDL_XS_RETURN(ST(0) = b_SV) |
5 |
0 |
5 |
| PDL_XS_RETURN(ST(0) = b_SV) |
5 |
0 |
5 |
| PDL_XS_RETURN(ST(0) = b_SV) |
0 |
5 |
5 |
| PDL_XS_RETURN(ST(0) = b_SV) |
0 |
0 |
0 |
|
| 238 |
|
| |
| 239 |
|
| MODULE = PDL::Image2D PACKAGE = PDL::Image2D |
| 240 |
|
| |
| 241 |
|
| |
| 242 |
|
| |
| 243 |
|
| void |
| 244 |
|
| rotnewsz(m,n,angle) |
| 245 |
|
| int m |
| 246 |
|
| int n |
| 247 |
|
| float angle |
| 248 |
|
| PPCODE: |
| 249 |
|
| PDL_Indx newcols, newrows; |
| 250 |
|
| |
| 251 |
0 |
▶ | if (getnewsize(m,n,angle,&newcols,&newrows) != 0) |
Branch: 1 branch
| Branch | True | False | Total |
| if (getnewsize(m,n,angle,&newcols,&newrows) != 0) |
0 |
0 |
0 |
|
| 252 |
0 |
| croak("wrong angle (should be between -90 and +90)"); |
| 253 |
0 |
▶ | EXTEND(sp,2); |
Branch: 1 branch
| Branch | True | False | Total |
| EXTEND(sp,2); |
0 |
0 |
0 |
|
| 254 |
0 |
| PUSHs(sv_2mortal(newSVnv(newcols))); |
| 255 |
0 |
| PUSHs(sv_2mortal(newSVnv(newrows))); |
| 256 |
|
| |
| 257 |
|
| MODULE = PDL::Image2D PACKAGE = PDL PREFIX=pdl_run_ |
| 258 |
|
| |
| 259 |
|
| |
| 260 |
|
| void |
| 261 |
|
| pdl_run_rot2d(im, angle, bg, aa, om=PDL_XS_PERLINIT_initsv(om_SV)) |
| 262 |
|
| SV *om_SV = items > 4 ? ST(4) : NULL; |
| 263 |
|
| PREINIT: |
| 264 |
0 |
▶ | PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
Branch: 10 branches
| Branch | True | False | Total |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
0 |
0 |
0 |
|
| 265 |
|
| INPUT: |
| 266 |
|
| pdl *im |
| 267 |
|
| pdl *angle |
| 268 |
|
| pdl *bg |
| 269 |
|
| pdl *aa |
| 270 |
|
| pdl *om |
| 271 |
|
| PPCODE: |
| 272 |
0 |
▶ | if (PDL_IS_INPLACE(im)) PDL->pdl_barf("rot2d: im->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(im)) PDL->pdl_barf("rot2d: im->inplace but not supported"); |
0 |
0 |
0 |
|
| 273 |
0 |
▶ | if (PDL_IS_INPLACE(angle)) PDL->pdl_barf("rot2d: angle->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(angle)) PDL->pdl_barf("rot2d: angle->inplace but not supported"); |
0 |
0 |
0 |
|
| 274 |
0 |
▶ | if (PDL_IS_INPLACE(bg)) PDL->pdl_barf("rot2d: bg->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(bg)) PDL->pdl_barf("rot2d: bg->inplace but not supported"); |
0 |
0 |
0 |
|
| 275 |
0 |
▶ | if (PDL_IS_INPLACE(aa)) PDL->pdl_barf("rot2d: aa->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(aa)) PDL->pdl_barf("rot2d: aa->inplace but not supported"); |
0 |
0 |
0 |
|
| 276 |
0 |
| PDL->barf_if_error(pdl_run_rot2d(im,angle,bg,aa,om)); |
| 277 |
0 |
▶ | PDL_XS_RETURN(ST(0) = om_SV) |
Branch: 5 branches
| Branch | True | False | Total |
| PDL_XS_RETURN(ST(0) = om_SV) |
0 |
0 |
0 |
| PDL_XS_RETURN(ST(0) = om_SV) |
0 |
0 |
0 |
| PDL_XS_RETURN(ST(0) = om_SV) |
0 |
0 |
0 |
| PDL_XS_RETURN(ST(0) = om_SV) |
0 |
0 |
0 |
| PDL_XS_RETURN(ST(0) = om_SV) |
0 |
0 |
0 |
|
| 278 |
|
| |
| 279 |
|
| void |
| 280 |
|
| pdl_run_bilin2d(Int, O) |
| 281 |
|
| pdl *Int |
| 282 |
|
| pdl *O |
| 283 |
|
| PPCODE: |
| 284 |
0 |
▶ | if (PDL_IS_INPLACE(Int)) PDL->pdl_barf("bilin2d: Int->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(Int)) PDL->pdl_barf("bilin2d: Int->inplace but not supported"); |
0 |
0 |
0 |
|
| 285 |
0 |
▶ | if (PDL_IS_INPLACE(O)) PDL->pdl_barf("bilin2d: O->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(O)) PDL->pdl_barf("bilin2d: O->inplace but not supported"); |
0 |
0 |
0 |
|
| 286 |
0 |
| PDL->barf_if_error(pdl_run_bilin2d(Int,O)); |
| 287 |
|
| |
| 288 |
|
| void |
| 289 |
|
| pdl_run_rescale2d(Int, O) |
| 290 |
|
| pdl *Int |
| 291 |
|
| pdl *O |
| 292 |
|
| PPCODE: |
| 293 |
0 |
▶ | if (PDL_IS_INPLACE(Int)) PDL->pdl_barf("rescale2d: Int->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(Int)) PDL->pdl_barf("rescale2d: Int->inplace but not supported"); |
0 |
0 |
0 |
|
| 294 |
0 |
▶ | if (PDL_IS_INPLACE(O)) PDL->pdl_barf("rescale2d: O->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(O)) PDL->pdl_barf("rescale2d: O->inplace but not supported"); |
0 |
0 |
0 |
|
| 295 |
0 |
| PDL->barf_if_error(pdl_run_rescale2d(Int,O)); |
| 296 |
|
| |
| 297 |
|
| void |
| 298 |
|
| _warp2d_int(img,px,py,warp,kernel_type,noval,nsamples) |
| 299 |
|
| pdl *img |
| 300 |
|
| pdl *px |
| 301 |
|
| pdl *py |
| 302 |
|
| pdl *warp |
| 303 |
|
| char *kernel_type |
| 304 |
|
| double noval |
| 305 |
|
| IV nsamples |
| 306 |
|
| CODE: |
| 307 |
6 |
| PDL->barf_if_error(pdl_run_warp2d(img,px,py,warp,kernel_type,noval,nsamples)); |
| 308 |
|
| |
| 309 |
|
| MODULE = PDL::Image2D PACKAGE = PDL::Image2D |
| 310 |
|
| |
| 311 |
|
| |
| 312 |
|
| |
| 313 |
|
| int |
| 314 |
|
| _get_kernel_size() |
| 315 |
|
| PROTOTYPE: |
| 316 |
|
| CODE: |
| 317 |
6 |
▶ | RETVAL = KERNEL_SAMPLES; |
Branch: 1 branch
| Branch | True | False | Total |
| RETVAL = KERNEL_SAMPLES; |
5 |
1 |
6 |
|
| 318 |
|
| OUTPUT: |
| 319 |
|
| RETVAL |
| 320 |
|
| |
| 321 |
|
| |
| 322 |
|
| MODULE = PDL::Image2D PACKAGE = PDL PREFIX=pdl_run_ |
| 323 |
|
| |
| 324 |
|
| |
| 325 |
|
| void |
| 326 |
|
| _warp2d_kernel_int(x,k,name,nsize) |
| 327 |
|
| pdl *x |
| 328 |
|
| pdl *k |
| 329 |
|
| char *name |
| 330 |
|
| PDL_Indx nsize |
| 331 |
|
| CODE: |
| 332 |
0 |
| PDL->barf_if_error(pdl_run_warp2d_kernel(x,k,name,nsize)); |
| 333 |
|
| |
| 334 |
|
| |
| 335 |
|
| #line 483 "lib/PDL/PP.pm" |
| 336 |
|
| BOOT: |
| 337 |
|
| /* Get pointer to structure of core shared C routines */ |
| 338 |
|
| /* make sure PDL::Core is loaded */ |
| 339 |
|
| #line 340 "lib/PDL/Image2D.xs" |
| 340 |
1 |
| perl_require_pv ("PDL/Core.pm"); /* make sure PDL::Core is loaded */ |
| 341 |
|
| #ifndef aTHX_ |
| 342 |
|
| #define aTHX_ |
| 343 |
|
| #endif |
| 344 |
1 |
▶ | 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)); |
1 |
0 |
1 |
| if (SvTRUE (ERRSV)) Perl_croak(aTHX_ "%s",SvPV_nolen (ERRSV)); |
0 |
1 |
1 |
| if (SvTRUE (ERRSV)) Perl_croak(aTHX_ "%s",SvPV_nolen (ERRSV)); |
0 |
0 |
0 |
|
| 345 |
1 |
| SV* CoreSV = perl_get_sv("PDL::SHARE",FALSE); /* var with core structure */ |
| 346 |
1 |
▶ | if (!CoreSV) |
Branch: 1 branch
| Branch | True | False | Total |
| if (!CoreSV) |
0 |
1 |
1 |
|
| 347 |
0 |
| Perl_croak(aTHX_ "We require the PDL::Core module, which was not found"); |
| 348 |
1 |
▶ | if (!(PDL = INT2PTR(Core*,SvIV( CoreSV )))) /* Core* value */ |
Branch: 1 branch
| Branch | True | False | Total |
| if (!(PDL = INT2PTR(Core*,SvIV( CoreSV )))) /* Core* value */ |
0 |
1 |
1 |
|
| 349 |
0 |
| Perl_croak(aTHX_ "Got NULL pointer for PDL"); |
| 350 |
1 |
▶ | if (PDL->Version != PDL_CORE_VERSION) |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL->Version != PDL_CORE_VERSION) |
0 |
1 |
1 |
|
| 351 |
0 |
| Perl_croak(aTHX_ "[PDL->Version: %ld PDL_CORE_VERSION: %ld XS_VERSION: %s] PDL::Image2D needs to be recompiled against the newly installed PDL", (long int)PDL->Version, (long int)PDL_CORE_VERSION, XS_VERSION); |