| 1 |
|
| |
| 2 |
|
| #line 453 "lib/PDL/PP.pm" |
| 3 |
|
| /* |
| 4 |
|
| * THIS FILE WAS GENERATED BY PDL::PP from lib/PDL/ImageND.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_ImageND |
| 21 |
|
| extern Core* PDL; /* Structure hold core C functions */ |
| 22 |
|
| |
| 23 |
|
| #line 1888 "lib/PDL/PP.pm" |
| 24 |
|
| pdl_error pdl_contour_segments_redodims(pdl_trans *__privtrans) { |
| 25 |
|
| pdl_error PDL_err = {0, NULL, 0}; |
| 26 |
|
| #line 27 "lib/PDL/ImageND-pp-contour_segments.c" |
| 27 |
2 |
| __privtrans->ind_sizes[3] = (__privtrans->ind_sizes[1]-1)*(__privtrans->ind_sizes[2]-1)*4; |
| 28 |
2 |
▶ | PDL_RETERROR(PDL_err, PDL->redodims_default(__privtrans)); |
Branch: 1 branch
| Branch | True | False | Total |
| PDL_RETERROR(PDL_err, PDL->redodims_default(__privtrans)); |
0 |
2 |
2 |
|
| 29 |
2 |
| return PDL_err; |
| 30 |
|
| } |
| 31 |
|
| |
| 32 |
|
| |
| 33 |
|
| #line 1888 "lib/PDL/PP.pm" |
| 34 |
|
| pdl_error pdl_contour_segments_readdata(pdl_trans *__privtrans) { |
| 35 |
|
| pdl_error PDL_err = {0, NULL, 0}; |
| 36 |
|
| #line 37 "lib/PDL/ImageND-pp-contour_segments.c" |
| 37 |
2 |
| register PDL_Indx __d_size = __privtrans->ind_sizes[0]; |
| 38 |
2 |
| register PDL_Indx __m_size = __privtrans->ind_sizes[1]; |
| 39 |
2 |
| register PDL_Indx __n_size = __privtrans->ind_sizes[2]; |
| 40 |
2 |
▶ | if (!__privtrans->broadcast.incs) return PDL->make_error(PDL_EUSERERROR, "Error in contour_segments:" "broadcast.incs NULL"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (!__privtrans->broadcast.incs) return PDL->make_error(PDL_EUSERERROR, "Error in contour_segments:" "broadcast.incs NULL"); |
0 |
2 |
2 |
|
| 41 |
|
| /* broadcastloop declarations */ |
| 42 |
|
| int __brcloopval; |
| 43 |
|
| register PDL_Indx __tind0,__tind1; /* counters along dim */ |
| 44 |
2 |
| register PDL_Indx __tnpdls = __privtrans->broadcast.npdls; |
| 45 |
|
| /* dims here are how many steps along those dims */ |
| 46 |
2 |
| register PDL_Indx __tinc0_c = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,0,0); |
| 47 |
2 |
| register PDL_Indx __tinc0_data = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,1,0); |
| 48 |
2 |
| register PDL_Indx __tinc0_points = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,2,0); |
| 49 |
2 |
| register PDL_Indx __tinc0_segs = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,3,0); |
| 50 |
2 |
| register PDL_Indx __tinc0_cnt = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,4,0); |
| 51 |
2 |
| register PDL_Indx __tinc1_c = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,0,1); |
| 52 |
2 |
| register PDL_Indx __tinc1_data = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,1,1); |
| 53 |
2 |
| register PDL_Indx __tinc1_points = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,2,1); |
| 54 |
2 |
| register PDL_Indx __tinc1_segs = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,3,1); |
| 55 |
2 |
| register PDL_Indx __tinc1_cnt = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,4,1); |
| 56 |
|
| #define PDL_BROADCASTLOOP_START_contour_segments_readdata PDL_BROADCASTLOOP_START( \ |
| 57 |
|
| readdata, \ |
| 58 |
|
| __privtrans->broadcast, \ |
| 59 |
|
| __privtrans->vtable, \ |
| 60 |
|
| c_datap += __offsp[0]; \ |
| 61 |
|
| data_datap += __offsp[1]; \ |
| 62 |
|
| points_datap += __offsp[2]; \ |
| 63 |
|
| segs_datap += __offsp[3]; \ |
| 64 |
|
| cnt_datap += __offsp[4]; \ |
| 65 |
|
| , \ |
| 66 |
|
| ( ,c_datap += __tinc1_c - __tinc0_c * __tdims0 \ |
| 67 |
|
| ,data_datap += __tinc1_data - __tinc0_data * __tdims0 \ |
| 68 |
|
| ,points_datap += __tinc1_points - __tinc0_points * __tdims0 \ |
| 69 |
|
| ,segs_datap += __tinc1_segs - __tinc0_segs * __tdims0 \ |
| 70 |
|
| ,cnt_datap += __tinc1_cnt - __tinc0_cnt * __tdims0 \ |
| 71 |
|
| ), \ |
| 72 |
|
| ( ,c_datap += __tinc0_c \ |
| 73 |
|
| ,data_datap += __tinc0_data \ |
| 74 |
|
| ,points_datap += __tinc0_points \ |
| 75 |
|
| ,segs_datap += __tinc0_segs \ |
| 76 |
|
| ,cnt_datap += __tinc0_cnt \ |
| 77 |
|
| ) \ |
| 78 |
|
| ) |
| 79 |
|
| #define PDL_BROADCASTLOOP_END_contour_segments_readdata PDL_BROADCASTLOOP_END( \ |
| 80 |
|
| __privtrans->broadcast, \ |
| 81 |
|
| c_datap -= __tinc1_c * __tdims1 + __offsp[0]; \ |
| 82 |
|
| data_datap -= __tinc1_data * __tdims1 + __offsp[1]; \ |
| 83 |
|
| points_datap -= __tinc1_points * __tdims1 + __offsp[2]; \ |
| 84 |
|
| segs_datap -= __tinc1_segs * __tdims1 + __offsp[3]; \ |
| 85 |
|
| cnt_datap -= __tinc1_cnt * __tdims1 + __offsp[4]; \ |
| 86 |
|
| ) |
| 87 |
2 |
| register PDL_Indx __inc_data_m = __privtrans->inc_sizes[PDL_INC_ID(__privtrans->vtable,1,0)]; (void)__inc_data_m;register PDL_Indx __inc_data_n = __privtrans->inc_sizes[PDL_INC_ID(__privtrans->vtable,1,1)]; (void)__inc_data_n; |
| 88 |
2 |
| register PDL_Indx __inc_points_d = __privtrans->inc_sizes[PDL_INC_ID(__privtrans->vtable,2,0)]; (void)__inc_points_d;register PDL_Indx __inc_points_m = __privtrans->inc_sizes[PDL_INC_ID(__privtrans->vtable,2,1)]; (void)__inc_points_m;register PDL_Indx __inc_points_n = __privtrans->inc_sizes[PDL_INC_ID(__privtrans->vtable,2,2)]; (void)__inc_points_n; |
| 89 |
2 |
| register PDL_Indx __inc_segs_d = __privtrans->inc_sizes[PDL_INC_ID(__privtrans->vtable,3,0)]; (void)__inc_segs_d;register PDL_Indx __inc_segs_q = __privtrans->inc_sizes[PDL_INC_ID(__privtrans->vtable,3,1)]; (void)__inc_segs_q; |
| 90 |
|
| #ifndef PDL_DECLARE_PARAMS_contour_segments_1 |
| 91 |
|
| #define PDL_DECLARE_PARAMS_contour_segments_1(PDL_TYPE_OP,PDL_PPSYM_OP,PDL_TYPE_PARAM_cnt,PDL_PPSYM_PARAM_cnt) \ |
| 92 |
|
| PDL_DECLARE_PARAMETER(PDL_TYPE_OP, c, (__privtrans->pdls[0]), 1, PDL_PPSYM_OP) \ |
| 93 |
|
| PDL_DECLARE_PARAMETER(PDL_TYPE_OP, data, (__privtrans->pdls[1]), 1, PDL_PPSYM_OP) \ |
| 94 |
|
| PDL_DECLARE_PARAMETER(PDL_TYPE_OP, points, (__privtrans->pdls[2]), 1, PDL_PPSYM_OP) \ |
| 95 |
|
| PDL_DECLARE_PARAMETER(PDL_TYPE_OP, segs, (__privtrans->pdls[3]), 1, PDL_PPSYM_OP) \ |
| 96 |
|
| PDL_DECLARE_PARAMETER(PDL_TYPE_PARAM_cnt, cnt, (__privtrans->pdls[4]), 1, PDL_PPSYM_PARAM_cnt) |
| 97 |
|
| #endif |
| 98 |
|
| #define PDL_IF_BAD(t,f) f |
| 99 |
2 |
▶ | switch (__privtrans->__datatype) { /* Start generic switch */ |
Branch: 1 branch
| Branch | True | False | Total |
| switch (__privtrans->__datatype) { /* Start generic switch */ |
2 |
0 |
2 |
|
| 100 |
2 |
| case PDL_F: { |
| 101 |
2 |
▶ | PDL_DECLARE_PARAMS_contour_segments_1(PDL_Float,F,PDL_Indx,N) |
Branch: 15 branches
| Branch | True | False | Total |
| PDL_DECLARE_PARAMS_contour_segments_1(PDL_Float,F,PDL_Indx,N) |
0 |
2 |
2 |
| PDL_DECLARE_PARAMS_contour_segments_1(PDL_Float,F,PDL_Indx,N) |
2 |
0 |
2 |
| PDL_DECLARE_PARAMS_contour_segments_1(PDL_Float,F,PDL_Indx,N) |
0 |
2 |
2 |
| PDL_DECLARE_PARAMS_contour_segments_1(PDL_Float,F,PDL_Indx,N) |
0 |
2 |
2 |
| PDL_DECLARE_PARAMS_contour_segments_1(PDL_Float,F,PDL_Indx,N) |
2 |
0 |
2 |
| PDL_DECLARE_PARAMS_contour_segments_1(PDL_Float,F,PDL_Indx,N) |
0 |
2 |
2 |
| PDL_DECLARE_PARAMS_contour_segments_1(PDL_Float,F,PDL_Indx,N) |
0 |
2 |
2 |
| PDL_DECLARE_PARAMS_contour_segments_1(PDL_Float,F,PDL_Indx,N) |
2 |
0 |
2 |
| PDL_DECLARE_PARAMS_contour_segments_1(PDL_Float,F,PDL_Indx,N) |
0 |
2 |
2 |
| PDL_DECLARE_PARAMS_contour_segments_1(PDL_Float,F,PDL_Indx,N) |
0 |
2 |
2 |
| PDL_DECLARE_PARAMS_contour_segments_1(PDL_Float,F,PDL_Indx,N) |
2 |
0 |
2 |
| PDL_DECLARE_PARAMS_contour_segments_1(PDL_Float,F,PDL_Indx,N) |
0 |
2 |
2 |
| PDL_DECLARE_PARAMS_contour_segments_1(PDL_Float,F,PDL_Indx,N) |
0 |
2 |
2 |
| PDL_DECLARE_PARAMS_contour_segments_1(PDL_Float,F,PDL_Indx,N) |
2 |
0 |
2 |
| PDL_DECLARE_PARAMS_contour_segments_1(PDL_Float,F,PDL_Indx,N) |
0 |
2 |
2 |
|
| 102 |
9 |
▶ | PDL_BROADCASTLOOP_START_contour_segments_readdata {PDL_Indx p=0; |
Branch: 7 branches
| Branch | True | False | Total |
| PDL_BROADCASTLOOP_START_contour_segments_readdata {PDL_Indx p=0; |
0 |
2 |
2 |
| PDL_BROADCASTLOOP_START_contour_segments_readdata {PDL_Indx p=0; |
0 |
2 |
2 |
| PDL_BROADCASTLOOP_START_contour_segments_readdata {PDL_Indx p=0; |
0 |
2 |
2 |
| PDL_BROADCASTLOOP_START_contour_segments_readdata {PDL_Indx p=0; |
0 |
2 |
2 |
| PDL_BROADCASTLOOP_START_contour_segments_readdata {PDL_Indx p=0; |
0 |
2 |
2 |
| PDL_BROADCASTLOOP_START_contour_segments_readdata {PDL_Indx p=0; |
3 |
2 |
5 |
| PDL_BROADCASTLOOP_START_contour_segments_readdata {PDL_Indx p=0; |
2 |
2 |
4 |
|
| 103 |
|
| #define PDL_DCALC(vname,c,x1,y1,x2,y2) \ |
| 104 |
|
| PDL_Float vname = (c-(data_datap)[0+(__inc_data_m*(x1))+(__inc_data_n*(y1))])/((data_datap)[0+(__inc_data_m*(x2))+(__inc_data_n*(y2))]-(data_datap)[0+(__inc_data_m*(x1))+(__inc_data_n*(y1))]) |
| 105 |
|
| #define PDL_PCALC(dname,d,x1,y1,x2,y2) \ |
| 106 |
|
| ((points_datap)[0+(__inc_points_d*(d))+(__inc_points_m*(x1))+(__inc_points_n*(y1))]+dname*((points_datap)[0+(__inc_points_d*(d))+(__inc_points_m*(x2))+(__inc_points_n*(y2))]-(points_datap)[0+(__inc_points_d*(d))+(__inc_points_m*(x1))+(__inc_points_n*(y1))])) |
| 107 |
|
| #define PDL_LINESEG(x01,y01,x02,y02,x11,y11,x12,y12,c,p) do { \ |
| 108 |
|
| PDL_DCALC(dist1,c,x01,y01,x02,y02); \ |
| 109 |
|
| PDL_DCALC(dist2,c,x11,y11,x12,y12); \ |
| 110 |
|
| {/* Open d */ PDL_EXPAND2(register PDL_Indx d=0, __d_stop=(__d_size)); for(; d<__d_stop; d+=1) { \ |
| 111 |
|
| (segs_datap)[0+(__inc_segs_d*(d))+(__inc_segs_q*(p))] = PDL_PCALC(dist1,d,x01,y01,x02,y02); \ |
| 112 |
|
| (segs_datap)[0+(__inc_segs_d*(d))+(__inc_segs_q*(p+1))] = PDL_PCALC(dist2,d,x11,y11,x12,y12); \ |
| 113 |
|
| }} /* Close d */ \ |
| 114 |
|
| p+=2; \ |
| 115 |
|
| } while (0) |
| 116 |
|
| #define PDL_CONTOUR_BREAK(x1,y1,x2,y2,c) \ |
| 117 |
|
| (((data_datap)[0+(__inc_data_m*(x1))+(__inc_data_n*(y1))] < c) != ((data_datap)[0+(__inc_data_m*(x2))+(__inc_data_n*(y2))] < c)) |
| 118 |
83 |
▶ | {/* Open n=:-1 */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size-1)); for(; n<__n_stop; n+=1) {{/* Open m=:-1 */ PDL_EXPAND2(register PDL_Indx m=0, __m_stop=(__m_size-1)); for(; m<__m_stop; m+=1) { |
Branch: 2 branches
| Branch | True | False | Total |
| {/* Open n=:-1 */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size-1)); for(; n<__n_stop; n+=1) {{/* Open m=:-1 */ PDL_EXPAND2(register PDL_Indx m=0, __m_stop=(__m_size-1)); for(; m<__m_stop; m+=1) { |
66 |
14 |
80 |
| {/* Open n=:-1 */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size-1)); for(; n<__n_stop; n+=1) {{/* Open m=:-1 */ PDL_EXPAND2(register PDL_Indx m=0, __m_stop=(__m_size-1)); for(; m<__m_stop; m+=1) { |
14 |
3 |
17 |
|
| 119 |
66 |
| PDL_Indx m1=m+1, n1=n+1; |
| 120 |
66 |
| char brk_0010 = PDL_CONTOUR_BREAK(m,n,m1,n,(c_datap)[0]), |
| 121 |
66 |
| brk_0001 = PDL_CONTOUR_BREAK(m,n,m,n1,(c_datap)[0]), |
| 122 |
66 |
| brk_1011 = PDL_CONTOUR_BREAK(m1,n,m1,n1,(c_datap)[0]), |
| 123 |
66 |
| brk_0111 = PDL_CONTOUR_BREAK(m,n1,m1,n1,(c_datap)[0]); |
| 124 |
66 |
▶ | if (brk_0010 && brk_1011) |
Branch: 2 branches
| Branch | True | False | Total |
| if (brk_0010 && brk_1011) |
16 |
50 |
66 |
| if (brk_0010 && brk_1011) |
8 |
8 |
16 |
|
| 125 |
28 |
▶ | PDL_LINESEG(m,n,m1,n,m1,n,m1,n1,(c_datap)[0],p); /* from m,n right, stretched right/down */ |
Branch: 1 branch
| Branch | True | False | Total |
| PDL_LINESEG(m,n,m1,n,m1,n,m1,n1,(c_datap)[0],p); /* from m,n right, stretched right/down */ |
20 |
8 |
28 |
|
| 126 |
66 |
▶ | if (brk_0001 && brk_0010 && !brk_1011) |
Branch: 3 branches
| Branch | True | False | Total |
| if (brk_0001 && brk_0010 && !brk_1011) |
16 |
50 |
66 |
| if (brk_0001 && brk_0010 && !brk_1011) |
8 |
8 |
16 |
| if (brk_0001 && brk_0010 && !brk_1011) |
6 |
2 |
8 |
|
| 127 |
22 |
▶ | PDL_LINESEG(m,n,m1,n,m,n,m,n1,(c_datap)[0],p); /* loop m,n, stretched right/down */ |
Branch: 1 branch
| Branch | True | False | Total |
| PDL_LINESEG(m,n,m1,n,m,n,m,n1,(c_datap)[0],p); /* loop m,n, stretched right/down */ |
16 |
6 |
22 |
|
| 128 |
66 |
▶ | if (brk_0010 && brk_0111 && !brk_0001 && !brk_1011) |
Branch: 4 branches
| Branch | True | False | Total |
| if (brk_0010 && brk_0111 && !brk_0001 && !brk_1011) |
16 |
50 |
66 |
| if (brk_0010 && brk_0111 && !brk_0001 && !brk_1011) |
4 |
12 |
16 |
| if (brk_0010 && brk_0111 && !brk_0001 && !brk_1011) |
2 |
2 |
4 |
| if (brk_0010 && brk_0111 && !brk_0001 && !brk_1011) |
2 |
0 |
2 |
|
| 129 |
6 |
▶ | PDL_LINESEG(m,n,m1,n,m,n1,m1,n1,(c_datap)[0],p); /* from m,n down, both stretched right */ |
Branch: 1 branch
| Branch | True | False | Total |
| PDL_LINESEG(m,n,m1,n,m,n1,m1,n1,(c_datap)[0],p); /* from m,n down, both stretched right */ |
4 |
2 |
6 |
|
| 130 |
66 |
▶ | if (brk_0001 && brk_0111 && !(brk_0010 && !brk_1011)) |
Branch: 4 branches
| Branch | True | False | Total |
| if (brk_0001 && brk_0111 && !(brk_0010 && !brk_1011)) |
16 |
50 |
66 |
| if (brk_0001 && brk_0111 && !(brk_0010 && !brk_1011)) |
8 |
8 |
16 |
| if (brk_0001 && brk_0111 && !(brk_0010 && !brk_1011)) |
2 |
6 |
8 |
| if (brk_0001 && brk_0111 && !(brk_0010 && !brk_1011)) |
2 |
0 |
2 |
|
| 131 |
28 |
▶ | PDL_LINESEG(m,n,m,n1,m,n1,m1,n1,(c_datap)[0],p); /* from m,n downward, stretched down/right */ |
Branch: 1 branch
| Branch | True | False | Total |
| PDL_LINESEG(m,n,m,n1,m,n1,m1,n1,(c_datap)[0],p); /* from m,n downward, stretched down/right */ |
20 |
8 |
28 |
|
| 132 |
66 |
▶ | if (brk_0001 && brk_1011 && !brk_0010 && !brk_0111) |
Branch: 4 branches
| Branch | True | False | Total |
| if (brk_0001 && brk_1011 && !brk_0010 && !brk_0111) |
16 |
50 |
66 |
| if (brk_0001 && brk_1011 && !brk_0010 && !brk_0111) |
4 |
12 |
16 |
| if (brk_0001 && brk_1011 && !brk_0010 && !brk_0111) |
2 |
2 |
4 |
| if (brk_0001 && brk_1011 && !brk_0010 && !brk_0111) |
2 |
0 |
2 |
|
| 133 |
6 |
▶ | PDL_LINESEG(m,n,m,n1,m1,n,m1,n1,(c_datap)[0],p); /* from m,n rightward, both stretched downward */ |
Branch: 1 branch
| Branch | True | False | Total |
| PDL_LINESEG(m,n,m,n1,m1,n,m1,n1,(c_datap)[0],p); /* from m,n rightward, both stretched downward */ |
4 |
2 |
6 |
|
| 134 |
66 |
▶ | if (brk_0111 && brk_1011 && !brk_0010) |
Branch: 3 branches
| Branch | True | False | Total |
| if (brk_0111 && brk_1011 && !brk_0010) |
16 |
50 |
66 |
| if (brk_0111 && brk_1011 && !brk_0010) |
8 |
8 |
16 |
| if (brk_0111 && brk_1011 && !brk_0010) |
6 |
2 |
8 |
|
| 135 |
22 |
▶ | PDL_LINESEG(m1,n,m1,n1,m,n1,m1,n1,(c_datap)[0],p); /* from m1,n down/left, stretched down/left */ |
Branch: 1 branch
| Branch | True | False | Total |
| PDL_LINESEG(m1,n,m1,n1,m,n1,m1,n1,(c_datap)[0],p); /* from m1,n down/left, stretched down/left */ |
16 |
6 |
22 |
|
| 136 |
|
| }} /* Close n=:-1 */}} /* Close m=:-1 */ |
| 137 |
|
| #undef PDL_DCALC |
| 138 |
|
| #undef PDL_PCALC |
| 139 |
|
| #undef PDL_LINESEG |
| 140 |
|
| #undef PDL_CONTOUR_BREAK |
| 141 |
3 |
| (cnt_datap)[0]=p-1; |
| 142 |
2 |
▶ | }PDL_BROADCASTLOOP_END_contour_segments_readdata |
Branch: 2 branches
| Branch | True | False | Total |
| }PDL_BROADCASTLOOP_END_contour_segments_readdata |
0 |
2 |
2 |
| }PDL_BROADCASTLOOP_END_contour_segments_readdata |
0 |
2 |
2 |
|
| 143 |
2 |
| } break; |
| 144 |
0 |
| default: return PDL->make_error(PDL_EUSERERROR, "PP INTERNAL ERROR in contour_segments: unhandled datatype(%d), only handles (F)! PLEASE MAKE A BUG REPORT\n", __privtrans->__datatype); |
| 145 |
|
| } |
| 146 |
|
| #undef PDL_IF_BAD |
| 147 |
2 |
| return PDL_err; |
| 148 |
|
| } |
| 149 |
|
| |
| 150 |
|
| static pdl_datatypes pdl_contour_segments_vtable_gentypes[] = { PDL_F, -1 }; |
| 151 |
|
| static PDL_Indx pdl_contour_segments_vtable_realdims[] = { 0, 2, 3, 2, 0 }; |
| 152 |
|
| static char *pdl_contour_segments_vtable_parnames[] = { "c","data","points","segs","cnt" }; |
| 153 |
|
| static short pdl_contour_segments_vtable_parflags[] = { |
| 154 |
|
| 0, |
| 155 |
|
| 0, |
| 156 |
|
| 0, |
| 157 |
|
| PDL_PARAM_ISCREAT|PDL_PARAM_ISOUT|PDL_PARAM_ISWRITE, |
| 158 |
|
| PDL_PARAM_ISCREAT|PDL_PARAM_ISOUT|PDL_PARAM_ISTYPED|PDL_PARAM_ISWRITE |
| 159 |
|
| }; |
| 160 |
|
| static pdl_datatypes pdl_contour_segments_vtable_partypes[] = { -1, -1, -1, -1, PDL_IND }; |
| 161 |
|
| static PDL_Indx pdl_contour_segments_vtable_realdims_starts[] = { 0, 0, 2, 5, 7 }; |
| 162 |
|
| static PDL_Indx pdl_contour_segments_vtable_realdims_ind_ids[] = { 1, 2, 0, 1, 2, 0, 3 }; |
| 163 |
|
| static char *pdl_contour_segments_vtable_indnames[] = { "d","m","n","q" }; |
| 164 |
|
| pdl_transvtable pdl_contour_segments_vtable = { |
| 165 |
|
| PDL_TRANS_DO_BROADCAST, 0, pdl_contour_segments_vtable_gentypes, 3, 5, NULL /*CORE21*/, |
| 166 |
|
| pdl_contour_segments_vtable_realdims, pdl_contour_segments_vtable_parnames, |
| 167 |
|
| pdl_contour_segments_vtable_parflags, pdl_contour_segments_vtable_partypes, |
| 168 |
|
| pdl_contour_segments_vtable_realdims_starts, pdl_contour_segments_vtable_realdims_ind_ids, 7, |
| 169 |
|
| 4, pdl_contour_segments_vtable_indnames, |
| 170 |
|
| pdl_contour_segments_redodims, pdl_contour_segments_readdata, NULL, |
| 171 |
|
| NULL, |
| 172 |
|
| 0,"PDL::ImageND::contour_segments" |
| 173 |
|
| }; |
| 174 |
|
| |
| 175 |
|
| |
| 176 |
2 |
| pdl_error pdl_run_contour_segments(pdl *c,pdl *data,pdl *points,pdl *segs,pdl *cnt) { |
| 177 |
2 |
| pdl_error PDL_err = {0, NULL, 0}; |
| 178 |
2 |
▶ | if (!PDL) return (pdl_error){PDL_EFATAL, "PDL core struct is NULL, can't continue",0}; |
Branch: 1 branch
| Branch | True | False | Total |
| if (!PDL) return (pdl_error){PDL_EFATAL, "PDL core struct is NULL, can't continue",0}; |
0 |
2 |
2 |
|
| 179 |
2 |
| pdl_trans *__privtrans = PDL->create_trans(&pdl_contour_segments_vtable); |
| 180 |
2 |
▶ | if (!__privtrans) return PDL->make_error_simple(PDL_EFATAL, "Couldn't create trans"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (!__privtrans) return PDL->make_error_simple(PDL_EFATAL, "Couldn't create trans"); |
0 |
2 |
2 |
|
| 181 |
2 |
| __privtrans->pdls[0] = c; |
| 182 |
2 |
| __privtrans->pdls[1] = data; |
| 183 |
2 |
| __privtrans->pdls[2] = points; |
| 184 |
2 |
| __privtrans->pdls[3] = segs; |
| 185 |
2 |
| __privtrans->pdls[4] = cnt; |
| 186 |
2 |
▶ | PDL_RETERROR(PDL_err, PDL->type_coerce(__privtrans)); |
Branch: 1 branch
| Branch | True | False | Total |
| PDL_RETERROR(PDL_err, PDL->type_coerce(__privtrans)); |
0 |
2 |
2 |
|
| 187 |
2 |
▶ | PDL_RETERROR(PDL_err, PDL->make_trans_mutual(__privtrans)); |
Branch: 1 branch
| Branch | True | False | Total |
| PDL_RETERROR(PDL_err, PDL->make_trans_mutual(__privtrans)); |
0 |
2 |
2 |
|
| 188 |
2 |
| return PDL_err; |
| 189 |
|
| } |