extract_curves 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CVS/Entries +4 -0
- data/CVS/Repository +1 -0
- data/CVS/Root +1 -0
- data/bin/CVS/Entries +5 -0
- data/bin/CVS/Repository +1 -0
- data/bin/CVS/Root +1 -0
- data/bin/ec_rect2polar.rb +22 -0
- data/bin/ec_rev_lines.rb +5 -0
- data/bin/ec_sph_area.rb +30 -0
- data/bin/extract_curves.rb +2145 -0
- data/ruby_ext/CVS/Entries +1 -0
- data/ruby_ext/CVS/Repository +1 -0
- data/ruby_ext/CVS/Root +1 -0
- data/ruby_ext/pav/CVS/Entries +14 -0
- data/ruby_ext/pav/CVS/Repository +1 -0
- data/ruby_ext/pav/CVS/Root +1 -0
- data/ruby_ext/pav/cstr.c +82 -0
- data/ruby_ext/pav/cstr.h +17 -0
- data/ruby_ext/pav/extconf.rb +22 -0
- data/ruby_ext/pav/pav.c +162 -0
- data/ruby_ext/pav/pgtk.c +40 -0
- data/ruby_ext/pav/pgtk.h +14 -0
- data/ruby_ext/pav/pix.c +806 -0
- data/ruby_ext/pav/pix.h +236 -0
- data/ruby_ext/pav/t.rb +35 -0
- data/ruby_ext/pav/t1.rb +35 -0
- data/ruby_libs/CVS/Entries +1 -0
- data/ruby_libs/CVS/Repository +1 -0
- data/ruby_libs/CVS/Root +1 -0
- data/ruby_libs/pav/CVS/Entries +20 -0
- data/ruby_libs/pav/CVS/Repository +1 -0
- data/ruby_libs/pav/CVS/Root +1 -0
- data/ruby_libs/pav/attr_cache.rb +211 -0
- data/ruby_libs/pav/attr_cache.t1.rb +32 -0
- data/ruby_libs/pav/cache.rb +31 -0
- data/ruby_libs/pav/dbg_log.rb +458 -0
- data/ruby_libs/pav/floatsio.rb +53 -0
- data/ruby_libs/pav/generator_cache.rb +165 -0
- data/ruby_libs/pav/gtk/CVS/Entries +4 -0
- data/ruby_libs/pav/gtk/CVS/Repository +1 -0
- data/ruby_libs/pav/gtk/CVS/Root +1 -0
- data/ruby_libs/pav/gtk/button.rb +130 -0
- data/ruby_libs/pav/gtk/icons.rb +87 -0
- data/ruby_libs/pav/gtk/toolbar.rb +192 -0
- data/ruby_libs/pav/heap.rb +54 -0
- data/ruby_libs/pav/icons/CVS/Entries +17 -0
- data/ruby_libs/pav/icons/CVS/Repository +1 -0
- data/ruby_libs/pav/icons/CVS/Root +1 -0
- data/ruby_libs/pav/icons/alt_handle.xcf +0 -0
- data/ruby_libs/pav/icons/alt_handle.xpm +3832 -0
- data/ruby_libs/pav/icons/alt_handle_hover.xcf +0 -0
- data/ruby_libs/pav/icons/alt_handle_hover.xpm +3368 -0
- data/ruby_libs/pav/icons/alt_handle_pressed.xcf +0 -0
- data/ruby_libs/pav/icons/alt_handle_pressed.xpm +3828 -0
- data/ruby_libs/pav/icons/extract_curves/CVS/Entries +6 -0
- data/ruby_libs/pav/icons/extract_curves/CVS/Repository +1 -0
- data/ruby_libs/pav/icons/extract_curves/CVS/Root +1 -0
- data/ruby_libs/pav/icons/extract_curves/extract_curves-icon-rgb.ppm +14 -0
- data/ruby_libs/pav/icons/extract_curves/extract_curves-logo-rgb.gif +0 -0
- data/ruby_libs/pav/icons/extract_curves/extract_curves-logo-rgb.xcf +0 -0
- data/ruby_libs/pav/icons/extract_curves/trace_mark.xcf +0 -0
- data/ruby_libs/pav/icons/extract_curves/trace_mark.xpm +38 -0
- data/ruby_libs/pav/icons/handle.xcf +0 -0
- data/ruby_libs/pav/icons/handle.xpm +213 -0
- data/ruby_libs/pav/icons/next.xpm +29 -0
- data/ruby_libs/pav/icons/next_hover.xpm +315 -0
- data/ruby_libs/pav/icons/next_pressed.xpm +144 -0
- data/ruby_libs/pav/icons/prev.xpm +29 -0
- data/ruby_libs/pav/icons/prev_hover.xpm +315 -0
- data/ruby_libs/pav/icons/prev_pressed.xpm +144 -0
- data/ruby_libs/pav/icons/vnext.xpm +29 -0
- data/ruby_libs/pav/icons/vprev.xpm +29 -0
- data/ruby_libs/pav/numeric/CVS/Entries +2 -0
- data/ruby_libs/pav/numeric/CVS/Repository +1 -0
- data/ruby_libs/pav/numeric/CVS/Root +1 -0
- data/ruby_libs/pav/numeric/ext.rb +13 -0
- data/ruby_libs/pav/pav_find.rb +90 -0
- data/ruby_libs/pav/pix.rb +402 -0
- data/ruby_libs/pav/pix/CVS/Entries +11 -0
- data/ruby_libs/pav/pix/CVS/Repository +1 -0
- data/ruby_libs/pav/pix/CVS/Root +1 -0
- data/ruby_libs/pav/pix/aapix.rb +378 -0
- data/ruby_libs/pav/pix/blob.rb +543 -0
- data/ruby_libs/pav/pix/circle.rb +73 -0
- data/ruby_libs/pav/pix/contour.rb +644 -0
- data/ruby_libs/pav/pix/contour/CVS/Entries +5 -0
- data/ruby_libs/pav/pix/contour/CVS/Repository +1 -0
- data/ruby_libs/pav/pix/contour/CVS/Root +1 -0
- data/ruby_libs/pav/pix/contour/calc_situations.rb +9 -0
- data/ruby_libs/pav/pix/contour/carp_calc.rb +212 -0
- data/ruby_libs/pav/pix/contour/situations.dmp +0 -0
- data/ruby_libs/pav/pix/contour/situations.rb +21 -0
- data/ruby_libs/pav/pix/curve.rb +1508 -0
- data/ruby_libs/pav/pix/img_obj.rb +751 -0
- data/ruby_libs/pav/pix/node.rb +712 -0
- data/ruby_libs/pav/pix/node_grp.rb +853 -0
- data/ruby_libs/pav/pix/shaved_core.rb +534 -0
- data/ruby_libs/pav/pix/subpix.rb +212 -0
- data/ruby_libs/pav/rand_accessible.rb +16 -0
- data/ruby_libs/pav/rangeset.rb +63 -0
- data/ruby_libs/pav/search.rb +210 -0
- data/ruby_libs/pav/set.rb +20 -0
- data/ruby_libs/pav/string/CVS/Entries +6 -0
- data/ruby_libs/pav/string/CVS/Repository +1 -0
- data/ruby_libs/pav/string/CVS/Root +1 -0
- data/ruby_libs/pav/string/bits.rb +523 -0
- data/ruby_libs/pav/string/ext.rb +58 -0
- data/ruby_libs/pav/string/observable.rb +155 -0
- data/ruby_libs/pav/string/text.rb +79 -0
- data/ruby_libs/pav/string/words.rb +42 -0
- data/ruby_libs/pav/sub_arr.rb +55 -0
- data/ruby_libs/pav/traced_obj.rb +79 -0
- metadata +161 -0
data/ruby_ext/pav/pix.h
ADDED
@@ -0,0 +1,236 @@
|
|
1
|
+
#ifndef PAV_PIX_H
|
2
|
+
#define PAV_PIX_H
|
3
|
+
|
4
|
+
#include <ruby.h>
|
5
|
+
#include <gdk-pixbuf/gdk-pixbuf.h>
|
6
|
+
|
7
|
+
#define PRB_2_PASS_SORTED(val1,val2,reciever,...) \
|
8
|
+
( (val1) <= (val2) ? (reciever((val1), (val2), __VA_ARGS__)) : \
|
9
|
+
(reciever((val2), (val1), __VA_ARGS__)) )
|
10
|
+
#define PRB_2_SORTED_PASS_3_SORTED(srt_val1,srt_val2,val3,reciever,...)\
|
11
|
+
( (val3)<=(srt_val1) ? (reciever((val3),(srt_val1),(srt_val2),__VA_ARGS__)) :\
|
12
|
+
( (val3)<=(srt_val2) ? (reciever((srt_val1),(val3),(srt_val2),__VA_ARGS__)) :\
|
13
|
+
(reciever((srt_val1),(srt_val2),(val3),__VA_ARGS__)) ))
|
14
|
+
#define PRB_3_PASS_SORTED(val1,val2,val3,reciever,...) \
|
15
|
+
PRB_2_PASS_SORTED((val1),(val2),PRB_2_SORTED_PASS_3_SORTED,(val3),__VA_ARGS__)
|
16
|
+
|
17
|
+
#define PRB_2_PASS_SORTED_WITH_PROPS(val1,prop1,val2,prop2,reciever,...) \
|
18
|
+
( (val1)<=(val2) ? (reciever((val1),(prop1),(val2),(prop2),__VA_ARGS__)) : \
|
19
|
+
(reciever((val2),(prop2),(val1),(prop1),__VA_ARGS__)) )
|
20
|
+
#define PRB_2_SORTED_PASS_3_SORTED_WITH_PROPS(srt_val1,prop1,srt_val2,prop2,\
|
21
|
+
val3,prop3,reciever,...)\
|
22
|
+
( (val3)<=(srt_val1) ? (reciever((val3), prop3, (srt_val1), prop1,\
|
23
|
+
(srt_val2), prop2, __VA_ARGS__)) :\
|
24
|
+
( (val3)<=(srt_val2) ? (reciever((srt_val1), prop1, (val3), prop3,\
|
25
|
+
(srt_val2), prop2, __VA_ARGS__)) :\
|
26
|
+
(reciever((srt_val1), prop1, (srt_val2), prop2,\
|
27
|
+
(val3), prop3, __VA_ARGS__)) ))
|
28
|
+
#define PRB_3_PASS_SORTED_WITH_PROPS(val1,prop1,val2,prop2,val3,prop3,\
|
29
|
+
reciever,...) \
|
30
|
+
PRB_2_PASS_SORTED_WITH_PROPS((val1), prop1, (val2), prop2, \
|
31
|
+
PRB_2_SORTED_PASS_3_SORTED_WITH_PROPS,(val3),prop3,reciever,__VA_ARGS__)
|
32
|
+
|
33
|
+
#define PRB_2_FPASS_SORTED_WITH_PROPS(val1,prop1,val2,prop2,reciever,...) \
|
34
|
+
if ( (val1)<=(val2) ) { \
|
35
|
+
reciever((val1), prop1, (val2), prop2, __VA_ARGS__) \
|
36
|
+
} else { \
|
37
|
+
reciever((val2), prop2, (val1), prop1, __VA_ARGS__) \
|
38
|
+
}
|
39
|
+
#define PRB_2_SORTED_FPASS_3_SORTED_WITH_PROPS(srt_val1,prop1,srt_val2,prop2,\
|
40
|
+
val3,prop3,reciever,...)\
|
41
|
+
if ( (val3)<=(srt_val1) ) { \
|
42
|
+
reciever((val3), prop3, (srt_val1), prop1, \
|
43
|
+
(srt_val2), prop2, __VA_ARGS__) \
|
44
|
+
} else if ( (val3)<=(srt_val2) ) { \
|
45
|
+
reciever((srt_val1), prop1, (val3), prop3, \
|
46
|
+
(srt_val2), prop2, __VA_ARGS__) \
|
47
|
+
} else { \
|
48
|
+
reciever((srt_val1), prop1, (srt_val2), prop2, \
|
49
|
+
(val3), prop3, __VA_ARGS__) \
|
50
|
+
}
|
51
|
+
#define PRB_3_FPASS_SORTED_WITH_PROPS(val1,prop1,val2,prop2,val3,prop3,\
|
52
|
+
reciever,...)\
|
53
|
+
PRB_2_FPASS_SORTED_WITH_PROPS((val1), prop1, (val2), prop2, \
|
54
|
+
PRB_2_SORTED_FPASS_3_SORTED_WITH_PROPS,(val3),prop3,reciever,__VA_ARGS__)
|
55
|
+
|
56
|
+
#define PRB_PIXELS_GET_PIX_PTR(pixels,x,y,ofs0,rowstride,pix_len) \
|
57
|
+
((pixels) + (ofs0) + (y)*(rowstride) + (x)*(pix_len))
|
58
|
+
#define PRB_PIXELS_GET_PIX(pixels,x,y,ofs0,rowstride,pix_len,mask) \
|
59
|
+
((*((long*) PRB_PIXELS_GET_PIX_PTR(pixels,x,y,ofs0,rowstride,pix_len)))\
|
60
|
+
& (mask))
|
61
|
+
|
62
|
+
#define PRB_PIXBUF_GET_PIX_PTR(pixbuf,x,y) \
|
63
|
+
(PRB_PIXELS_GET_PIX_PTR( RSTRING(rb_iv_get(pixbuf,"@pixels"))->ptr,x,y,\
|
64
|
+
NUM2INT(rb_iv_get(pixbuf, "@ofs0")), \
|
65
|
+
NUM2INT(rb_funcall(pixbuf, rb_intern("rowstride"), 0)), \
|
66
|
+
NUM2INT(rb_iv_get(pixbuf, "@pix_length")) ))
|
67
|
+
#define PRB_PIXBUF_GET_PIX(pixbuf,x,y) \
|
68
|
+
((*((long*) PRB_PIXBUF_GET_PIX_PTR(pixbuf,x,y))) & \
|
69
|
+
NUM2LONG(rb_iv_get(pixbuf, "@pix_mask")))
|
70
|
+
|
71
|
+
#define PRB_PIX_ON_BORDER_TOUCH_D(y,end_y,none,all) \
|
72
|
+
( (y) >= (end_y) ? (all) : (none) )
|
73
|
+
#define PRB_PIX_ON_BORDER_TOUCH_UD(y,start_y,end_y,none,up,down,all) \
|
74
|
+
( (y) <= (start_y) ? PRB_PIX_ON_BORDER_TOUCH_D(y,end_y,up,all) : \
|
75
|
+
PRB_PIX_ON_BORDER_TOUCH_D(y,end_y,none,down) )
|
76
|
+
#define PRB_PIX_ON_BORDER_TOUCH_RUD(x,y,start_y,end_x,end_y,none,right,up,down,\
|
77
|
+
up_down,right_up,right_down,all) \
|
78
|
+
( (x) >= (end_x) ? PRB_PIX_ON_BORDER_TOUCH_UD(y,start_y,\
|
79
|
+
end_y,right,right_up,right_down,all) : \
|
80
|
+
PRB_PIX_ON_BORDER_TOUCH_UD(y,start_y,end_y,none,up,down,\
|
81
|
+
up_down) )
|
82
|
+
#define PRB_PIX_ON_BORDER_TOUCH(x,y,start_x,start_y,end_x,end_y,none,up,down,\
|
83
|
+
left,right,up_down,left_right,left_up,left_down,right_up,right_down,\
|
84
|
+
left_right_up,left_right_down,left_up_down,right_up_down,all) \
|
85
|
+
( (x) <= (start_x) ? PRB_PIX_ON_BORDER_TOUCH_RUD(x,y,start_y,\
|
86
|
+
end_x,end_y,left,left_right,left_up,left_down,\
|
87
|
+
left_up_down,left_right_up,left_right_down,all) : \
|
88
|
+
PRB_PIX_ON_BORDER_TOUCH_RUD(x,y,start_y,end_x,end_y,none,\
|
89
|
+
right,up,down,up_down,right_up,right_down,\
|
90
|
+
right_up_down) )
|
91
|
+
|
92
|
+
#define PRB_PIX_ADJS8(x,y,start_x,start_y,end_x,end_y,adjs_var) \
|
93
|
+
(PRB_PIX_ON_BORDER_TOUCH(x,y,start_x,start_y,end_x,end_y,\
|
94
|
+
((adjs_var)=prb_PixAdjs,8), ((adjs_var)=prb_PixAdjs_NoUp,5),\
|
95
|
+
((adjs_var)=prb_PixAdjs_NoDown,5), \
|
96
|
+
((adjs_var)=prb_PixAdjs_NoLeft,5), \
|
97
|
+
((adjs_var)=prb_PixAdjs_NoRight,5), \
|
98
|
+
((adjs_var)=prb_PixAdjs_NoUpDown,2), \
|
99
|
+
((adjs_var)=prb_PixAdjs_NoLeftRight,2), \
|
100
|
+
((adjs_var)=prb_PixAdjs_NoLeftUp,3), \
|
101
|
+
((adjs_var)=prb_PixAdjs_NoLeftDown,3), \
|
102
|
+
((adjs_var)=prb_PixAdjs_NoRightUp,3), \
|
103
|
+
((adjs_var)=prb_PixAdjs_NoRightDown,3), \
|
104
|
+
((adjs_var)=prb_PixAdjs_NoLeftRightUp,1), \
|
105
|
+
((adjs_var)=prb_PixAdjs_NoLeftRightDown,1), \
|
106
|
+
((adjs_var)=prb_PixAdjs_NoLeftUpDown,1), \
|
107
|
+
((adjs_var)=prb_PixAdjs_NoRightUpDown,1), \
|
108
|
+
((adjs_var)=NULL, 0) ))
|
109
|
+
|
110
|
+
#define PRB_PIX_ADJS4(x,y,start_x,start_y,end_x,end_y,adjs_var) \
|
111
|
+
(PRB_PIX_ON_BORDER_TOUCH(x,y,start_x,start_y,end_x,end_y,\
|
112
|
+
((adjs_var)=prb_PixAdjs,4), ((adjs_var)=prb_PixAdjs_NoUp,3),\
|
113
|
+
((adjs_var)=prb_PixAdjs_NoDown,3), \
|
114
|
+
((adjs_var)=prb_PixAdjs_NoLeft,3), \
|
115
|
+
((adjs_var)=prb_PixAdjs_NoRight,3), \
|
116
|
+
((adjs_var)=prb_PixAdjs_NoUpDown,2), \
|
117
|
+
((adjs_var)=prb_PixAdjs_NoLeftRight,2), \
|
118
|
+
((adjs_var)=prb_PixAdjs_NoLeftUp,2), \
|
119
|
+
((adjs_var)=prb_PixAdjs_NoLeftDown,2), \
|
120
|
+
((adjs_var)=prb_PixAdjs_NoRightUp,2), \
|
121
|
+
((adjs_var)=prb_PixAdjs_NoRightDown,2), \
|
122
|
+
((adjs_var)=prb_PixAdjs_NoLeftRightUp,1), \
|
123
|
+
((adjs_var)=prb_PixAdjs_NoLeftRightDown,1), \
|
124
|
+
((adjs_var)=prb_PixAdjs_NoLeftUpDown,1), \
|
125
|
+
((adjs_var)=prb_PixAdjs_NoRightUpDown,1), \
|
126
|
+
((adjs_var)=NULL, 0) ))
|
127
|
+
|
128
|
+
#define PRB_PIX_RB_ADJS8(x,y,start_x,start_y,end_x,end_y) \
|
129
|
+
(PRB_PIX_ON_BORDER_TOUCH(x,y,start_x,start_y,end_x,end_y,\
|
130
|
+
prb_rbPixAdjs8, prb_rbPixAdjs8_NoUp, prb_rbPixAdjs8_NoDown, \
|
131
|
+
prb_rbPixAdjs8_NoLeft, prb_rbPixAdjs8_NoRight, \
|
132
|
+
prb_rbPixAdjs8_NoUpDown, prb_rbPixAdjs8_NoLeftRight, \
|
133
|
+
prb_rbPixAdjs8_NoLeftUp, prb_rbPixAdjs8_NoLeftDown, \
|
134
|
+
prb_rbPixAdjs8_NoRightUp, prb_rbPixAdjs8_NoRightDown, \
|
135
|
+
prb_rbPixAdjs8_NoLeftRightUp, prb_rbPixAdjs8_NoLeftRightDown,\
|
136
|
+
prb_rbPixAdjs8_NoLeftUpDown, prb_rbPixAdjs8_NoRightUpDown, \
|
137
|
+
prb_rbPixAdjs8_None ))
|
138
|
+
|
139
|
+
#define PRB_PIX_RB_ADJS4(x,y,start_x,start_y,end_x,end_y) \
|
140
|
+
(PRB_PIX_ON_BORDER_TOUCH(x,y,start_x,start_y,end_x,end_y,\
|
141
|
+
prb_rbPixAdjs4, prb_rbPixAdjs4_NoUp, prb_rbPixAdjs4_NoDown, \
|
142
|
+
prb_rbPixAdjs4_NoLeft, prb_rbPixAdjs4_NoRight, \
|
143
|
+
prb_rbPixAdjs4_NoUpDown, prb_rbPixAdjs4_NoLeftRight, \
|
144
|
+
prb_rbPixAdjs4_NoLeftUp, prb_rbPixAdjs4_NoLeftDown, \
|
145
|
+
prb_rbPixAdjs4_NoRightUp, prb_rbPixAdjs4_NoRightDown, \
|
146
|
+
prb_rbPixAdjs4_NoLeftRightUp, prb_rbPixAdjs4_NoLeftRightDown,\
|
147
|
+
prb_rbPixAdjs4_NoLeftUpDown, prb_rbPixAdjs4_NoRightUpDown, \
|
148
|
+
prb_rbPixAdjs4_None ))
|
149
|
+
|
150
|
+
const int prb_PixAdjs[16], prb_PixAdjs_NoUp[10], prb_PixAdjs_NoDown[10],
|
151
|
+
prb_PixAdjs_NoLeft[10], prb_PixAdjs_NoRight[10],
|
152
|
+
prb_PixAdjs_NoUpDown[4], prb_PixAdjs_NoLeftRight[4],
|
153
|
+
prb_PixAdjs_NoLeftUp[6], prb_PixAdjs_NoLeftDown[6],
|
154
|
+
prb_PixAdjs_NoRightUp[6], prb_PixAdjs_NoRightDown[6],
|
155
|
+
prb_PixAdjs_NoLeftRightUp[2], prb_PixAdjs_NoLeftRightDown[2],
|
156
|
+
prb_PixAdjs_NoLeftUpDown[2], prb_PixAdjs_NoRightUpDown[2];
|
157
|
+
VALUE prb_rbPixAdjs8, prb_rbPixAdjs8_NoUp, prb_rbPixAdjs8_NoDown,
|
158
|
+
prb_rbPixAdjs8_NoLeft, prb_rbPixAdjs8_NoRight, prb_rbPixAdjs8_NoUpDown,
|
159
|
+
prb_rbPixAdjs8_NoLeftRight, prb_rbPixAdjs8_NoLeftUp,
|
160
|
+
prb_rbPixAdjs8_NoLeftDown, prb_rbPixAdjs8_NoRightUp,
|
161
|
+
prb_rbPixAdjs8_NoRightDown, prb_rbPixAdjs8_NoLeftRightUp,
|
162
|
+
prb_rbPixAdjs8_NoLeftRightDown, prb_rbPixAdjs8_NoLeftUpDown,
|
163
|
+
prb_rbPixAdjs8_NoRightUpDown, prb_rbPixAdjs8_None;
|
164
|
+
VALUE prb_rbPixAdjs4, prb_rbPixAdjs4_NoUp, prb_rbPixAdjs4_NoDown,
|
165
|
+
prb_rbPixAdjs4_NoLeft, prb_rbPixAdjs4_NoRight, prb_rbPixAdjs4_NoUpDown,
|
166
|
+
prb_rbPixAdjs4_NoLeftRight, prb_rbPixAdjs4_NoLeftUp,
|
167
|
+
prb_rbPixAdjs4_NoLeftDown, prb_rbPixAdjs4_NoRightUp,
|
168
|
+
prb_rbPixAdjs4_NoRightDown, prb_rbPixAdjs4_NoLeftRightUp,
|
169
|
+
prb_rbPixAdjs4_NoLeftRightDown, prb_rbPixAdjs4_NoLeftUpDown,
|
170
|
+
prb_rbPixAdjs4_NoRightUpDown, prb_rbPixAdjs4_None;
|
171
|
+
|
172
|
+
VALUE prb_cPPix_Xy,
|
173
|
+
prb_mPPix_MPixbufPix,
|
174
|
+
prb_cPPix_PixbufPix,
|
175
|
+
prb_cPPix_Pixbuf;
|
176
|
+
|
177
|
+
void prb_color_rgb_to_hsv(int r, int g, int b, double *h, double *s, double *v);
|
178
|
+
|
179
|
+
VALUE prb_xy_init(VALUE self, VALUE x, VALUE y);
|
180
|
+
VALUE prb_xy_new(VALUE klass, VALUE x, VALUE y);
|
181
|
+
VALUE prb_xy_x(VALUE self);
|
182
|
+
VALUE prb_xy_y(VALUE self);
|
183
|
+
VALUE prb_xy_yx(VALUE self);
|
184
|
+
VALUE prb_xy_hash(VALUE self);
|
185
|
+
VALUE prb_xy_to_s(VALUE self);
|
186
|
+
|
187
|
+
VALUE prb_pixbuf_pix_rgb_to_hsv(VALUE klass, VALUE r, VALUE g, VALUE b);
|
188
|
+
VALUE prb_pixbuf_pix_pixbuf(VALUE self);
|
189
|
+
VALUE prb_pixbuf_pix_color_id(VALUE self);
|
190
|
+
VALUE prb_pixbuf_pix_color_rgb(VALUE self);
|
191
|
+
VALUE prb_pixbuf_pix_color_hsv(VALUE self);
|
192
|
+
VALUE prb_pixbuf_pix_is_virtual(VALUE self);
|
193
|
+
VALUE prb_pixbuf_pix_is_border(VALUE self, VALUE adjacents);
|
194
|
+
VALUE prb_pixbuf_pix_is_border_in_8(VALUE self, unsigned int neighbs_cnt);
|
195
|
+
VALUE prb_pixbuf_pix_is_border8(VALUE self);
|
196
|
+
VALUE prb_pixbuf_pix_is_border4(VALUE self);
|
197
|
+
VALUE prb_pixbuf_pix_adj(VALUE self, VALUE adjacents);
|
198
|
+
VALUE prb_pixbuf_pix_adj8(VALUE self);
|
199
|
+
VALUE prb_pixbuf_pix_adj4(VALUE self);
|
200
|
+
VALUE prb_pixbuf_pix_adj_cocolor(VALUE self, VALUE adjacents);
|
201
|
+
VALUE prb_pixbuf_pix_adj_cocolor8(VALUE self);
|
202
|
+
VALUE prb_pixbuf_pix_adj_cocolor4(VALUE self);
|
203
|
+
VALUE prb_pixbuf_pix_adj_fuzzy_rgb_cocolor
|
204
|
+
(VALUE self, VALUE adjacents, VALUE rb_r_toler, VALUE rb_g_toler,
|
205
|
+
VALUE rb_b_toler);
|
206
|
+
VALUE prb_pixbuf_pix_adj_fuzzy_hsv_cocolor
|
207
|
+
(VALUE self, VALUE adjacents, VALUE rb_h_toler, VALUE rb_s_toler,
|
208
|
+
VALUE rb_v_toler);
|
209
|
+
|
210
|
+
VALUE prb_pixbuf_pix_init(VALUE self, VALUE pixbuf, VALUE x, VALUE y);
|
211
|
+
|
212
|
+
VALUE prb_pixbuf_pixels_ptr(VALUE self);
|
213
|
+
VALUE prb_pixbuf_pixels(VALUE self);
|
214
|
+
VALUE prb_pixbuf_sample_length(VALUE self);
|
215
|
+
VALUE prb_pixbuf_pix_length(VALUE self);
|
216
|
+
VALUE prb_pixbuf_picture_width(VALUE self);
|
217
|
+
VALUE prb_pixbuf_picture_height(VALUE self);
|
218
|
+
VALUE prb_pixbuf_ofs0(VALUE self);
|
219
|
+
VALUE prb_pixbuf_pix_mask(VALUE self);
|
220
|
+
VALUE prb_pixbuf_border_width(VALUE self);
|
221
|
+
VALUE prb_pixbuf_init(int argc, VALUE *argv, VALUE self);
|
222
|
+
VALUE prb_pixbuf_get_pix(VALUE self, VALUE x, VALUE y);
|
223
|
+
VALUE prb_pixbuf_dup(VALUE self);
|
224
|
+
VALUE prb_pixbuf_scale(int argc, VALUE *argv, VALUE self);
|
225
|
+
VALUE prb_pixbuf_add_border(VALUE self, VALUE rb_b_width);
|
226
|
+
/*
|
227
|
+
VALUE prb_pixbuf_subpixbuf
|
228
|
+
(VALUE self, VALUE r_x, VALUE r_y, VALUE r_width, VALUE r_height);*/
|
229
|
+
VALUE prb_pixbuf_scaled
|
230
|
+
(VALUE self, VALUE r_kx, VALUE r_ky, VALUE r_x, VALUE r_y,VALUE r_width,
|
231
|
+
VALUE r_height, VALUE r_interp);
|
232
|
+
VALUE prb_pixbuf_gdk_scaled
|
233
|
+
(VALUE self, VALUE r_kx, VALUE r_ky, VALUE r_x, VALUE r_y,VALUE r_width,
|
234
|
+
VALUE r_height, VALUE r_interp);
|
235
|
+
|
236
|
+
#endif /* PAV_PIX_H */
|
data/ruby_ext/pav/t.rb
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
#!/usr/bin/ruby
|
2
|
+
|
3
|
+
require 'pav/pav'
|
4
|
+
|
5
|
+
class T
|
6
|
+
def initialize
|
7
|
+
CStrView.new(10, 100, nil)
|
8
|
+
nil
|
9
|
+
end
|
10
|
+
|
11
|
+
def t1
|
12
|
+
ObjectSpace.define_finalizer(CStrView.new(10, 100, nil)) { |oid|
|
13
|
+
puts "Killing #{oid}." }
|
14
|
+
nil
|
15
|
+
end
|
16
|
+
|
17
|
+
def t2
|
18
|
+
ObjectSpace.undefine_finalizer(CStrView.new(10, 100, nil))
|
19
|
+
nil
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
T.new
|
24
|
+
puts "GC'ing (1)..."
|
25
|
+
GC.start
|
26
|
+
|
27
|
+
T.new.t1
|
28
|
+
puts "GC'ing (2)..."
|
29
|
+
GC.start
|
30
|
+
|
31
|
+
T.new.t2
|
32
|
+
puts "GC'ing (3)..."
|
33
|
+
GC.start
|
34
|
+
|
35
|
+
puts "Done."
|
data/ruby_ext/pav/t1.rb
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
#!/usr/bin/ruby
|
2
|
+
|
3
|
+
require 'pav/pav'
|
4
|
+
|
5
|
+
class T
|
6
|
+
def initialize
|
7
|
+
String.cstr_view_new([], 10, 100)
|
8
|
+
nil
|
9
|
+
end
|
10
|
+
|
11
|
+
def t1
|
12
|
+
ObjectSpace.define_finalizer(String.cstr_view_new(nil,10,100)) {
|
13
|
+
|oid| puts "Killing #{oid}." }
|
14
|
+
nil
|
15
|
+
end
|
16
|
+
|
17
|
+
def t2
|
18
|
+
ObjectSpace.undefine_finalizer(String.cstr_view_new(nil,10,100))
|
19
|
+
nil
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
T.new
|
24
|
+
puts "GC'ing (1)..."
|
25
|
+
GC.start
|
26
|
+
|
27
|
+
T.new.t1
|
28
|
+
puts "GC'ing (2)..."
|
29
|
+
GC.start
|
30
|
+
|
31
|
+
T.new.t2
|
32
|
+
puts "GC'ing (3)..."
|
33
|
+
GC.start
|
34
|
+
|
35
|
+
puts "Done."
|
@@ -0,0 +1 @@
|
|
1
|
+
D/pav////
|
@@ -0,0 +1 @@
|
|
1
|
+
extract-curves/ruby_libs
|
data/ruby_libs/CVS/Root
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
:ext:pavpen@rubyforge.org:/var/cvs/extract-curves
|
@@ -0,0 +1,20 @@
|
|
1
|
+
/attr_cache.rb/1.1.1.1/Tue Nov 15 17:32:12 2005//
|
2
|
+
/attr_cache.t1.rb/1.1.1.1/Tue Nov 15 17:32:11 2005//
|
3
|
+
/cache.rb/1.1.1.1/Tue Nov 15 17:32:12 2005//
|
4
|
+
/dbg_log.rb/1.1.1.1/Tue Nov 15 17:32:12 2005//
|
5
|
+
/floatsio.rb/1.1.1.1/Tue Nov 15 17:32:11 2005//
|
6
|
+
/generator_cache.rb/1.1.1.1/Tue Nov 15 17:32:12 2005//
|
7
|
+
/heap.rb/1.1.1.1/Tue Nov 15 17:32:11 2005//
|
8
|
+
/pav_find.rb/1.1.1.1/Tue Nov 15 17:32:11 2005//
|
9
|
+
/pix.rb/1.1.1.1/Tue Nov 15 17:32:12 2005//
|
10
|
+
/rand_accessible.rb/1.1.1.1/Tue Nov 15 17:32:11 2005//
|
11
|
+
/rangeset.rb/1.1.1.1/Tue Nov 15 17:32:12 2005//
|
12
|
+
/search.rb/1.1.1.1/Tue Nov 15 17:32:12 2005//
|
13
|
+
/set.rb/1.1.1.1/Tue Nov 15 17:32:11 2005//
|
14
|
+
/sub_arr.rb/1.1.1.1/Tue Nov 15 17:32:12 2005//
|
15
|
+
/traced_obj.rb/1.1.1.1/Tue Nov 15 17:32:11 2005//
|
16
|
+
D/gtk////
|
17
|
+
D/icons////
|
18
|
+
D/numeric////
|
19
|
+
D/pix////
|
20
|
+
D/string////
|
@@ -0,0 +1 @@
|
|
1
|
+
extract-curves/ruby_libs/pav
|
@@ -0,0 +1 @@
|
|
1
|
+
:ext:pavpen@rubyforge.org:/var/cvs/extract-curves
|
@@ -0,0 +1,211 @@
|
|
1
|
+
require 'pav/dbg_log'
|
2
|
+
|
3
|
+
class Module
|
4
|
+
# Like +once+ from the Ruby Book (Pragmatic Programmer's Guide):
|
5
|
+
def cache_attr!(*ids)
|
6
|
+
res = []
|
7
|
+
for id in ids
|
8
|
+
id_orig = "__ca_#{id.to_i}_o__".to_sym
|
9
|
+
id_val = "@__ca_#{id.to_i}_val__".to_sym
|
10
|
+
self.module_eval <<-"end_eval"
|
11
|
+
#{if self.public_instance_methods.member?(id_orig.id2name)
|
12
|
+
res << id
|
13
|
+
""
|
14
|
+
else
|
15
|
+
"alias_method #{id_orig.inspect}, #{id.inspect}"
|
16
|
+
end}
|
17
|
+
def #{id.id2name}(*args, &block)
|
18
|
+
tc = Thread::critical=(true)
|
19
|
+
def self.#{id.id2name}(*args, &block)
|
20
|
+
#{id_val.id2name}
|
21
|
+
end
|
22
|
+
$PDbgLog.sig_wrapped_call
|
23
|
+
#{id_val.id2name} = #{id_orig.id2name}(*args, &block)
|
24
|
+
$PDbgLog.sig_wrapped_return
|
25
|
+
Thread::critical = tc
|
26
|
+
#{id_val.id2name}
|
27
|
+
end
|
28
|
+
end_eval
|
29
|
+
end
|
30
|
+
res
|
31
|
+
end
|
32
|
+
|
33
|
+
def freeze_cache_attr!(*ids)
|
34
|
+
res = []
|
35
|
+
for id in ids
|
36
|
+
id_orig = "__ca_#{id.to_i}_o__".to_sym
|
37
|
+
id_val = "@__ca_#{id.to_i}_val__".to_sym
|
38
|
+
self.module_eval <<-"end_eval"
|
39
|
+
#{if self.public_instance_methods.member?(id_orig.id2name)
|
40
|
+
res << id
|
41
|
+
""
|
42
|
+
else
|
43
|
+
"alias_method #{id_orig.inspect}, #{id.inspect}"
|
44
|
+
end}
|
45
|
+
def #{id.id2name}(*args, &block)
|
46
|
+
tc = Thread::critical=(true)
|
47
|
+
def self.#{id.id2name}(*args, &block)
|
48
|
+
#{id_val.id2name}
|
49
|
+
end
|
50
|
+
$PDbgLog.sig_wrapped_call
|
51
|
+
#{id_val.id2name} = #{id_orig.id2name}(*args, &block)
|
52
|
+
$PDbgLog.sig_wrapped_return
|
53
|
+
#{id_val.id2name}.freeze
|
54
|
+
Thread::critical = tc
|
55
|
+
#{id_val.id2name}
|
56
|
+
end
|
57
|
+
end_eval
|
58
|
+
end
|
59
|
+
res
|
60
|
+
end
|
61
|
+
|
62
|
+
def uncache_attr!(*ids)
|
63
|
+
res = []
|
64
|
+
for id in ids
|
65
|
+
id_orig = "__ca_#{id.to_i}_o__".to_sym
|
66
|
+
if !self.public_instance_methods.member?(id_orig.id2name)
|
67
|
+
res << id
|
68
|
+
next
|
69
|
+
end
|
70
|
+
self.module_eval <<-"end_eval"
|
71
|
+
alias_method #{id.inspect}, #{id_orig.inspect}
|
72
|
+
remove_method #{id_orig.inspect}
|
73
|
+
end_eval
|
74
|
+
end
|
75
|
+
res
|
76
|
+
end
|
77
|
+
|
78
|
+
def cache_get!(*ids)
|
79
|
+
for id in ids
|
80
|
+
self.module_eval <<-end_eval
|
81
|
+
def #{id.to_s['get_'.length...id.to_s.length]}
|
82
|
+
if (tmp = @cache_#{id.to_s})
|
83
|
+
return tmp
|
84
|
+
end
|
85
|
+
@cache_#{id.to_s} = self.#{id.to_s}
|
86
|
+
end
|
87
|
+
end_eval
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
def cache_get_lm!(*ids)
|
92
|
+
for id in ids
|
93
|
+
self.module_eval <<-end_eval
|
94
|
+
def #{id.to_s['get_'.length...id.to_s.length]}(lm)
|
95
|
+
if (tmp = @cache_#{id.to_s}[lm])
|
96
|
+
return tmp
|
97
|
+
end
|
98
|
+
@cache_#{id.to_s}[lm] = self.#{id.to_s}(lm)
|
99
|
+
end
|
100
|
+
end_eval
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
module AttrCache
|
106
|
+
def uncache_attr!(*ids)
|
107
|
+
res = []
|
108
|
+
for id in ids
|
109
|
+
id_orig = "__ca_#{id.to_i}_o__".to_sym
|
110
|
+
id_val = "@__ca_#{id.to_i}_val__".to_sym
|
111
|
+
if !self.instance_variables.member?(id_val.id2name)
|
112
|
+
res << id
|
113
|
+
next
|
114
|
+
end
|
115
|
+
self.instance_eval <<-"end_eval"
|
116
|
+
class <<self
|
117
|
+
alias_method #{id.inspect}, #{id_orig.inspect}
|
118
|
+
end
|
119
|
+
end_eval
|
120
|
+
remove_instance_variable id_val
|
121
|
+
end
|
122
|
+
res
|
123
|
+
end
|
124
|
+
|
125
|
+
def cache_attr!(*ids)
|
126
|
+
res = []
|
127
|
+
for id in ids
|
128
|
+
id_orig = "__ca_#{id.to_i}_o__".to_sym
|
129
|
+
id_val = "@__ca_#{id.to_i}_val__".to_sym
|
130
|
+
if self.instance_variables.member?(id_val.id2name)
|
131
|
+
res << id
|
132
|
+
next
|
133
|
+
end
|
134
|
+
self.instance_eval <<-"end_eval"
|
135
|
+
class <<self
|
136
|
+
alias_method #{id_orig.inspect}, #{id.inspect}
|
137
|
+
def #{id.id2name}(*args, &block)
|
138
|
+
tc = Thread::critical=(true)
|
139
|
+
def self.#{id.id2name}(*args, &block)
|
140
|
+
#{id_val.id2name}
|
141
|
+
end
|
142
|
+
$PDbgLog.sig_wrapped_call
|
143
|
+
#{id_val.id2name} = #{id_orig.id2name}(*args, &block)
|
144
|
+
$PDbgLog.sig_wrapped_return
|
145
|
+
Thread::critical = tc
|
146
|
+
#{id_val.id2name}
|
147
|
+
end
|
148
|
+
end
|
149
|
+
end_eval
|
150
|
+
end
|
151
|
+
res
|
152
|
+
end
|
153
|
+
|
154
|
+
def freeze_cache_attr!(*ids)
|
155
|
+
res = []
|
156
|
+
for id in ids
|
157
|
+
id_orig = "__ca_#{id.to_i}_o__".to_sym
|
158
|
+
id_val = "@__ca_#{id.to_i}_val__".to_sym
|
159
|
+
if self.instance_variables.member?(id_val.id2name)
|
160
|
+
res << id
|
161
|
+
next
|
162
|
+
end
|
163
|
+
self.instance_eval <<-"end_eval"
|
164
|
+
class <<self
|
165
|
+
alias_method #{id_orig.inspect}, #{id.inspect}
|
166
|
+
def #{id.id2name}(*args, &block)
|
167
|
+
tc = Thread::critical=(true)
|
168
|
+
def self.#{id.id2name}(*args, &block)
|
169
|
+
#{id_val.id2name}
|
170
|
+
end
|
171
|
+
$PDbgLog.sig_wrapped_call
|
172
|
+
#{id_val.id2name} = #{id_orig.id2name}(*args, &block)
|
173
|
+
$PDbgLog.sig_wrapped_return
|
174
|
+
#{id_val.id2name}.freeze
|
175
|
+
Thread::critical = tc
|
176
|
+
#{id_val.id2name}
|
177
|
+
end
|
178
|
+
end
|
179
|
+
end_eval
|
180
|
+
end
|
181
|
+
res
|
182
|
+
end
|
183
|
+
|
184
|
+
def kill_attr_cache!(*ids)
|
185
|
+
res = []
|
186
|
+
for id in ids
|
187
|
+
id_orig = "__ca_#{id.to_i}_o__".to_sym
|
188
|
+
id_val = "@__ca_#{id.to_i}_val__".to_sym
|
189
|
+
if !self.instance_variables.member?(id_val.id2name)
|
190
|
+
res << id
|
191
|
+
next
|
192
|
+
end
|
193
|
+
self.instance_eval <<-"end_eval"
|
194
|
+
class <<self
|
195
|
+
def #{id.id2name}(*args, &block)
|
196
|
+
tc = Thread::critical=(true)
|
197
|
+
def self.#{id.id2name}(*args, &block)
|
198
|
+
#{id_val.id2name}
|
199
|
+
end
|
200
|
+
$PDbgLog.sig_wrapped_call
|
201
|
+
#{id_val.id2name} = #{id_orig.id2name}(*args, &block)
|
202
|
+
$PDbgLog.sig_wrapped_return
|
203
|
+
Thread::critical = tc
|
204
|
+
#{id_val.id2name}
|
205
|
+
end
|
206
|
+
end
|
207
|
+
end_eval
|
208
|
+
end
|
209
|
+
res
|
210
|
+
end
|
211
|
+
end
|