texplay 0.4.3 → 0.4.4.pre

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG +225 -222
  3. data/README.markdown +48 -48
  4. data/Rakefile +16 -16
  5. data/examples/common.rb +18 -18
  6. data/examples/example_alpha_blend.rb +29 -29
  7. data/examples/example_bezier.rb +41 -41
  8. data/examples/example_blank.rb +37 -37
  9. data/examples/example_cache.rb +21 -21
  10. data/examples/example_color_control.rb +69 -69
  11. data/examples/example_color_transform.rb +62 -62
  12. data/examples/example_color_transform_circle.rb +34 -34
  13. data/examples/example_darken.rb +24 -24
  14. data/examples/example_dup.rb +73 -73
  15. data/examples/example_each.rb +39 -39
  16. data/examples/example_effect.rb +34 -34
  17. data/examples/example_fill.rb +43 -43
  18. data/examples/example_fill_old.rb +48 -48
  19. data/examples/example_fluent.rb +29 -29
  20. data/examples/example_font.rb +31 -31
  21. data/examples/example_hash_arguments.rb +46 -46
  22. data/examples/example_ippa.rb +23 -23
  23. data/examples/example_light.rb +75 -75
  24. data/examples/example_light_multiply.rb +18 -18
  25. data/examples/example_lsystem.rb +61 -61
  26. data/examples/example_melt.rb +25 -25
  27. data/examples/example_meyet.rb +62 -62
  28. data/examples/example_polyline.rb +42 -42
  29. data/examples/example_scale.rb +27 -27
  30. data/examples/example_select.rb +36 -36
  31. data/examples/example_select2.rb +25 -25
  32. data/examples/example_simple.rb +46 -46
  33. data/examples/example_splice.rb +26 -26
  34. data/examples/example_sync.rb +59 -59
  35. data/examples/example_tiles.rb +41 -41
  36. data/examples/example_trace.rb +22 -22
  37. data/examples/example_transparent.rb +28 -28
  38. data/examples/example_transparent2.rb +24 -24
  39. data/examples/example_transparent3.rb +20 -20
  40. data/examples/example_turtle.rb +39 -39
  41. data/examples/example_weird.rb +22 -22
  42. data/examples/example_window_render_to_image.rb +41 -41
  43. data/examples/example_window_to_blob.rb +35 -35
  44. data/examples/media/maria.png +0 -0
  45. data/examples/media/rose.bmp +0 -0
  46. data/ext/texplay/actions.c +1011 -1006
  47. data/ext/texplay/actions.h +60 -60
  48. data/ext/texplay/bindings.c +1130 -1125
  49. data/ext/texplay/bindings.h +46 -46
  50. data/ext/texplay/cache.c +123 -118
  51. data/ext/texplay/cache.h +24 -24
  52. data/ext/texplay/compat.h +21 -27
  53. data/ext/texplay/extconf.rb +38 -38
  54. data/ext/texplay/graphics_utils.c +1318 -1313
  55. data/ext/texplay/graphics_utils.h +22 -22
  56. data/ext/texplay/texplay.c +206 -201
  57. data/ext/texplay/texplay.h +153 -153
  58. data/ext/texplay/utils.c +896 -891
  59. data/ext/texplay/utils.h +153 -153
  60. data/lib/texplay-contrib.rb +147 -147
  61. data/lib/texplay.rb +347 -347
  62. data/lib/texplay/alone.rb +20 -20
  63. data/lib/texplay/c_function_docs.rb +178 -178
  64. data/lib/texplay/live.rb +84 -84
  65. data/lib/texplay/version.rb +3 -3
  66. data/live/live.rb +85 -85
  67. data/test/image_spec.rb +45 -45
  68. data/test/texplay_spec.rb +144 -144
  69. metadata +42 -52
  70. data/lib/texplay/1.8/texplay.so +0 -0
  71. data/lib/texplay/1.9/texplay.so +0 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7cb3fc2c92e083c9c79c27e0ee5177c96d863234
4
+ data.tar.gz: 6b02709511491a382229b51b35479b55fe20b415
5
+ SHA512:
6
+ metadata.gz: daba54ad58f10260caab17de25188f7e488f0b00d8deff458d85f20e33a19d23c6efadf01c78e8c1bcde2e16bf78f390519979b1c24f090704313bdea8d90006
7
+ data.tar.gz: 6b0465d46937b092bf8ddd3314ea4c5209494b714a1a29f657c6688e7cac922cfe70972a745f2765f839f458c425d5bcda5e7cf00bf9ba716ea6eae05914c678
data/CHANGELOG CHANGED
@@ -1,222 +1,225 @@
1
- *22/2/11 version 0.3.5
2
- * added :source, :dest, :source_with_alpha, :dest_with_alpha options to
3
- :alpha_blend
4
- * added live.rb (repl image editor)
5
- * added alone.rb (run texplay image manip independent from gosu)
6
-
7
- *1/11/10 version 0.3.0
8
- * pushed gems
9
- * tested
10
- *1/10/10
11
- version 0.2.983pre2
12
- * added Window#to_texture(...) seems to be broken! releasing pre2 so
13
- * others can test it :)
14
-
15
- *27/9/10
16
- version 0.2.983pre1
17
- * added Window#to_blob(x,y,width,height), grab a screenshot region
18
-
19
- *24/9/10
20
- version 0.2.982pre1
21
- * added :default drawing mode (equivalent to :mode => nil)
22
- * changed Linux texture size to 512
23
-
24
- 16/8/10
25
- version 0.2.981
26
- * oops, added :caching => false to TexPlay#dup
27
- * oops, put 'self' inside the capture block for TexPlay#clear
28
- * got rid of tolerance member from rgba struct, as tolerance is now stored
29
- separately
30
-
31
-
32
- 16/8/10
33
- version 0.2.980
34
- * added :caching option to TexPlay.set_options, and Gosu::Image.new. For
35
- control over whether images are cached or not. (accepts true and
36
- false values)
37
- * TexPlay.create_image() no longer calls refresh_cache
38
- * added new TexPlay#clear() method, just draws a filled rect over image.
39
-
40
- 14/8/10
41
- version 0.2.975
42
- * fixed :tolerance bug (was in special_cmp_color_with_tolerance, was checking color1.alpha <= tolerance instead of color2.alpha <= tolerance)
43
- * modified TexPlay.create_image() so it only draws a colored, filled rect if a :color parameter is specified
44
-
45
- 14/8/10
46
- version 0.2.970
47
- * fixed :transparent bug (bug was in rb_convert_rb_color_to_rgba(), :transparent was being matched as
48
- not_a_color)
49
- * limited not_a_color() to match just color.red == -1 && color.green == -1, etc rather than color.red < 0
50
- * Now we can use negative values to define other pseudo-colors (in similar vein to :transparent)
51
-
52
- 16/7/10
53
- version 0.2.965
54
- * fixed MAX_TEXTURE_SIZE at 1024 for linux (to avoid segfault)
55
-
56
- 4/7/10
57
- version 0.2.960
58
- * added :transparent pseudo-color
59
- * added :tolerance option (applies to :trace and :source_select etc
60
- family)
61
- * fixed memleak in to_blob
62
-
63
- 10/6/10
64
- version 0.2.950
65
- * fixed bug in apply_drawing_mode, wasn't using blended_pixel as source_pixel
66
- * hex literal colors now accepted, e.g 0xffff0000 (red)
67
-
68
- 9/6/10
69
- version 0.2.940
70
- * hopefully fixed :trace behaviour. Should now return nil for color when
71
- pixel out of bounds.
72
-
73
- 9/6/10
74
- version 0.2.930
75
- * not_a_color now returns true when color channel < 0
76
-
77
- 8/6/10
78
- version 0.2.920
79
- * :trace now supports :color_mode => :gosu
80
-
81
- 7/6/10
82
- version 0.2.910
83
- * 1.8.7 incompatibility fixed
84
-
85
- 7/6/10
86
- version 0.2.900
87
- * added source_select, source_ignore, dest_select, dest_ignore
88
- * :chroma_key now deprecated (by above functionality)
89
- * using Gosu::MAX_TEXTURE_SIZE, hopefully fixes crashes on some linux
90
- distros
91
- * Gosu::Color objects now accepted (and optionally returned by get_pixel)
92
- * Monkey patched Gosu::Image.from_text() for auto-caching
93
- * bitwise drawing modes no longer affect alpha
94
- * rows and columns methods added to Gosu::Image, allowed Gosu::Image to be
95
- reopened by Gosu::Image.new (works with Gosu::Image#to_blob)
96
-
97
-
98
- 23/03/10
99
- version 0.2.800
100
- * added 28 drawing modes (using :mode option)
101
- * added linear interpolation (:lerp)
102
- * added 'trace' option to line for efficient pixel-based collision detection
103
-
104
- 12/03/10
105
- version 0.2.721
106
- * fixed bug in alpha_blend (now blends alpha channels too)
107
-
108
- 6/12/09
109
- version 0.2.710
110
- * fixed bug in line drawing code (wasn't drawing final pixel)
111
- * fixed bug in filled rect code (wasn't drawing final row)
112
- * fixed bug in flood fill (wasn't drawing on first column)
113
- * added glDisable(GL_TEXTURE_2D) calls to cache.c, and removed 'restore previous texture binding' (i doubt there is any previous binding to restore)
114
- * using version.rb to help manage versions
115
-
116
- 23/11/09
117
- * fixed bug in texplay.rb. Replaced TexPlay::TP_MAX_QUAD_SIZE - 2 with
118
- just TexPlay::TP_MAX_QUAD_SIZE (the -2 is now built into the constant)
119
-
120
- 16/10/09
121
- version 0.2.700
122
- * removed memory leak from Gosu::Image#to_blob, now writing directly to RSTRING_PTR
123
-
124
- 12/10/09
125
- version 0.2.666
126
- * added Gosu::Image#to_blob
127
- * to_blob functionality enables Gosu::Images to work with DevIL library
128
-
129
- 6/10/09
130
- version 0.2.5
131
- * fixed quad_draw flicker bug
132
- * added splice_and_scale (to texplay-contrib.rb)
133
- * now using rake-compiler to run build process
134
-
135
- 15/9/09
136
- version 0.2.4
137
- * added lsystem
138
- * made lsystem both 1.9.1 and 1.8.6 compatible
139
-
140
- 11/9/09
141
- version 0.2.3
142
- * added Ruby 1.8.7 compatibility by modifying extconf.rb to define RUBY_19 macro
143
- * and modified compat.h to get rid of feature test (fails on 1.8.7)
144
-
145
- 8/9/09
146
- version 0.2.2
147
- * fixed color_control bug, action_struct->color was being overwritten (now using a temp).
148
- * fixed faulty error msg where max tex size was being displayed as 1024 but is actually 1022
149
- * added :start_angle parameter to ngon action
150
- * fixed example screen height from 769 to 768
151
- * arity of -1 and 0 now supported for color_control procs
152
- * fixed parameter checks for circle and ngon
153
- * updated documentation to reflect changes, and added details on caching
154
-
155
- 2/9/09
156
- version 0.2.1
157
- * releasing a gem for TexPlay
158
- * bumped version number so can add add gosu 0.7.14 dependency to github gem
159
- * hopefully gem works on both github and rubyforge
160
- 31/8/09
161
- version 0.2.0
162
- * added each iterator
163
- * added alternative to proc for :color_control proc (allowing static linear transforms to pixels)
164
- * no longer segfaulting on windows (no idea why not)
165
- * rewrote EmptyImageStub in ruby, using philomory's code. now alot faster.
166
- * implemented 'shadow' in terms of static :color_control pixel transform
167
- * added more example code demonstrating each iterator (example_each.rb) and new color_control behaviour
168
- i.e example_color_transform.rb
169
- * should be relatively stable now!
170
-
171
- 28/8/09
172
- version 0.1.9.1 (still BETA)
173
- * experimental features: Gosu::Image#dup and Gosu::Image#clone
174
- * also TexPlay::create_blank_image(window, width, height)
175
- * I noticed these features SEG FAULT on my setup in windows, so be warned
176
- * This is a BETA release
177
-
178
- 14/8/09
179
- version 0.1.9.0 (BETA)
180
- * major rewrite. TP now supports beziers, polylines, polygons, and more
181
- * also supports alpha_blending (though still tempermental)
182
- * This is a BETA release
183
-
184
- 1/7/09
185
- version 0.1.6.2
186
- * fixed another subtle bug in constrain_local_boundaries(). Function was
187
- unable to deal with drawing actions that were 100% outside the image
188
- boundaries.
189
-
190
- 28/6/09
191
- version 0.1.6
192
- * gen_eval now working as a replacement for instance_eval in the #paint block. Allows for more user-friendly interface.
193
- * #paint can now be called without a block; if invoked this way it executes any commands in the action queue, e.g
194
- @img.circle 20, 20, 40
195
- @img.pixel 30, 30
196
- @img.paint
197
- * above will function as if: @img.paint { circle 20, 20, 40; pixel 30, 30 }
198
- * collected 1.8.6/1.9.1 compatibility into compat.h
199
-
200
- 16/6/09
201
- version 0.1.4.6
202
- * allowed arity of 0 (as well as -1) for ruby 1.9 compatibility
203
-
204
- 13/6/09
205
- version 0.1.4.5
206
- * major bugfix with TexPlay#splice method (segfaut). Also added new color format parameter: color [1, 1, 0, 1] (e.g purple with full alpha).
207
- Also fixed subtle edge-case bug in constrain_local_boundaries().
208
-
209
- 9/6/09
210
- version 0.1.4
211
- * improved error checking. should work better with later gosu releases
212
-
213
- 20/2/09
214
- version 0.1.1
215
- * rerelease of this version fixing the oversized image bug for refresh_cache (i.e images over 500 x 500
216
-
217
- version 0.1.1
218
- * oops, bug in leftshift/rightshift functions, fixed!
219
-
220
- version 0.1.0
221
- * release!
222
-
1
+ *29/6/14 version 0.4.4.pre
2
+ * added support for Ruby 2.1.x
3
+ * pushing test gem
4
+ *22/2/11 version 0.3.5
5
+ * added :source, :dest, :source_with_alpha, :dest_with_alpha options to
6
+ :alpha_blend
7
+ * added live.rb (repl image editor)
8
+ * added alone.rb (run texplay image manip independent from gosu)
9
+
10
+ *1/11/10 version 0.3.0
11
+ * pushed gems
12
+ * tested
13
+ *1/10/10
14
+ version 0.2.983pre2
15
+ * added Window#to_texture(...) seems to be broken! releasing pre2 so
16
+ * others can test it :)
17
+
18
+ *27/9/10
19
+ version 0.2.983pre1
20
+ * added Window#to_blob(x,y,width,height), grab a screenshot region
21
+
22
+ *24/9/10
23
+ version 0.2.982pre1
24
+ * added :default drawing mode (equivalent to :mode => nil)
25
+ * changed Linux texture size to 512
26
+
27
+ 16/8/10
28
+ version 0.2.981
29
+ * oops, added :caching => false to TexPlay#dup
30
+ * oops, put 'self' inside the capture block for TexPlay#clear
31
+ * got rid of tolerance member from rgba struct, as tolerance is now stored
32
+ separately
33
+
34
+
35
+ 16/8/10
36
+ version 0.2.980
37
+ * added :caching option to TexPlay.set_options, and Gosu::Image.new. For
38
+ control over whether images are cached or not. (accepts true and
39
+ false values)
40
+ * TexPlay.create_image() no longer calls refresh_cache
41
+ * added new TexPlay#clear() method, just draws a filled rect over image.
42
+
43
+ 14/8/10
44
+ version 0.2.975
45
+ * fixed :tolerance bug (was in special_cmp_color_with_tolerance, was checking color1.alpha <= tolerance instead of color2.alpha <= tolerance)
46
+ * modified TexPlay.create_image() so it only draws a colored, filled rect if a :color parameter is specified
47
+
48
+ 14/8/10
49
+ version 0.2.970
50
+ * fixed :transparent bug (bug was in rb_convert_rb_color_to_rgba(), :transparent was being matched as
51
+ not_a_color)
52
+ * limited not_a_color() to match just color.red == -1 && color.green == -1, etc rather than color.red < 0
53
+ * Now we can use negative values to define other pseudo-colors (in similar vein to :transparent)
54
+
55
+ 16/7/10
56
+ version 0.2.965
57
+ * fixed MAX_TEXTURE_SIZE at 1024 for linux (to avoid segfault)
58
+
59
+ 4/7/10
60
+ version 0.2.960
61
+ * added :transparent pseudo-color
62
+ * added :tolerance option (applies to :trace and :source_select etc
63
+ family)
64
+ * fixed memleak in to_blob
65
+
66
+ 10/6/10
67
+ version 0.2.950
68
+ * fixed bug in apply_drawing_mode, wasn't using blended_pixel as source_pixel
69
+ * hex literal colors now accepted, e.g 0xffff0000 (red)
70
+
71
+ 9/6/10
72
+ version 0.2.940
73
+ * hopefully fixed :trace behaviour. Should now return nil for color when
74
+ pixel out of bounds.
75
+
76
+ 9/6/10
77
+ version 0.2.930
78
+ * not_a_color now returns true when color channel < 0
79
+
80
+ 8/6/10
81
+ version 0.2.920
82
+ * :trace now supports :color_mode => :gosu
83
+
84
+ 7/6/10
85
+ version 0.2.910
86
+ * 1.8.7 incompatibility fixed
87
+
88
+ 7/6/10
89
+ version 0.2.900
90
+ * added source_select, source_ignore, dest_select, dest_ignore
91
+ * :chroma_key now deprecated (by above functionality)
92
+ * using Gosu::MAX_TEXTURE_SIZE, hopefully fixes crashes on some linux
93
+ distros
94
+ * Gosu::Color objects now accepted (and optionally returned by get_pixel)
95
+ * Monkey patched Gosu::Image.from_text() for auto-caching
96
+ * bitwise drawing modes no longer affect alpha
97
+ * rows and columns methods added to Gosu::Image, allowed Gosu::Image to be
98
+ reopened by Gosu::Image.new (works with Gosu::Image#to_blob)
99
+
100
+
101
+ 23/03/10
102
+ version 0.2.800
103
+ * added 28 drawing modes (using :mode option)
104
+ * added linear interpolation (:lerp)
105
+ * added 'trace' option to line for efficient pixel-based collision detection
106
+
107
+ 12/03/10
108
+ version 0.2.721
109
+ * fixed bug in alpha_blend (now blends alpha channels too)
110
+
111
+ 6/12/09
112
+ version 0.2.710
113
+ * fixed bug in line drawing code (wasn't drawing final pixel)
114
+ * fixed bug in filled rect code (wasn't drawing final row)
115
+ * fixed bug in flood fill (wasn't drawing on first column)
116
+ * added glDisable(GL_TEXTURE_2D) calls to cache.c, and removed 'restore previous texture binding' (i doubt there is any previous binding to restore)
117
+ * using version.rb to help manage versions
118
+
119
+ 23/11/09
120
+ * fixed bug in texplay.rb. Replaced TexPlay::TP_MAX_QUAD_SIZE - 2 with
121
+ just TexPlay::TP_MAX_QUAD_SIZE (the -2 is now built into the constant)
122
+
123
+ 16/10/09
124
+ version 0.2.700
125
+ * removed memory leak from Gosu::Image#to_blob, now writing directly to RSTRING_PTR
126
+
127
+ 12/10/09
128
+ version 0.2.666
129
+ * added Gosu::Image#to_blob
130
+ * to_blob functionality enables Gosu::Images to work with DevIL library
131
+
132
+ 6/10/09
133
+ version 0.2.5
134
+ * fixed quad_draw flicker bug
135
+ * added splice_and_scale (to texplay-contrib.rb)
136
+ * now using rake-compiler to run build process
137
+
138
+ 15/9/09
139
+ version 0.2.4
140
+ * added lsystem
141
+ * made lsystem both 1.9.1 and 1.8.6 compatible
142
+
143
+ 11/9/09
144
+ version 0.2.3
145
+ * added Ruby 1.8.7 compatibility by modifying extconf.rb to define RUBY_19 macro
146
+ * and modified compat.h to get rid of feature test (fails on 1.8.7)
147
+
148
+ 8/9/09
149
+ version 0.2.2
150
+ * fixed color_control bug, action_struct->color was being overwritten (now using a temp).
151
+ * fixed faulty error msg where max tex size was being displayed as 1024 but is actually 1022
152
+ * added :start_angle parameter to ngon action
153
+ * fixed example screen height from 769 to 768
154
+ * arity of -1 and 0 now supported for color_control procs
155
+ * fixed parameter checks for circle and ngon
156
+ * updated documentation to reflect changes, and added details on caching
157
+
158
+ 2/9/09
159
+ version 0.2.1
160
+ * releasing a gem for TexPlay
161
+ * bumped version number so can add add gosu 0.7.14 dependency to github gem
162
+ * hopefully gem works on both github and rubyforge
163
+ 31/8/09
164
+ version 0.2.0
165
+ * added each iterator
166
+ * added alternative to proc for :color_control proc (allowing static linear transforms to pixels)
167
+ * no longer segfaulting on windows (no idea why not)
168
+ * rewrote EmptyImageStub in ruby, using philomory's code. now alot faster.
169
+ * implemented 'shadow' in terms of static :color_control pixel transform
170
+ * added more example code demonstrating each iterator (example_each.rb) and new color_control behaviour
171
+ i.e example_color_transform.rb
172
+ * should be relatively stable now!
173
+
174
+ 28/8/09
175
+ version 0.1.9.1 (still BETA)
176
+ * experimental features: Gosu::Image#dup and Gosu::Image#clone
177
+ * also TexPlay::create_blank_image(window, width, height)
178
+ * I noticed these features SEG FAULT on my setup in windows, so be warned
179
+ * This is a BETA release
180
+
181
+ 14/8/09
182
+ version 0.1.9.0 (BETA)
183
+ * major rewrite. TP now supports beziers, polylines, polygons, and more
184
+ * also supports alpha_blending (though still tempermental)
185
+ * This is a BETA release
186
+
187
+ 1/7/09
188
+ version 0.1.6.2
189
+ * fixed another subtle bug in constrain_local_boundaries(). Function was
190
+ unable to deal with drawing actions that were 100% outside the image
191
+ boundaries.
192
+
193
+ 28/6/09
194
+ version 0.1.6
195
+ * gen_eval now working as a replacement for instance_eval in the #paint block. Allows for more user-friendly interface.
196
+ * #paint can now be called without a block; if invoked this way it executes any commands in the action queue, e.g
197
+ @img.circle 20, 20, 40
198
+ @img.pixel 30, 30
199
+ @img.paint
200
+ * above will function as if: @img.paint { circle 20, 20, 40; pixel 30, 30 }
201
+ * collected 1.8.6/1.9.1 compatibility into compat.h
202
+
203
+ 16/6/09
204
+ version 0.1.4.6
205
+ * allowed arity of 0 (as well as -1) for ruby 1.9 compatibility
206
+
207
+ 13/6/09
208
+ version 0.1.4.5
209
+ * major bugfix with TexPlay#splice method (segfaut). Also added new color format parameter: color [1, 1, 0, 1] (e.g purple with full alpha).
210
+ Also fixed subtle edge-case bug in constrain_local_boundaries().
211
+
212
+ 9/6/09
213
+ version 0.1.4
214
+ * improved error checking. should work better with later gosu releases
215
+
216
+ 20/2/09
217
+ version 0.1.1
218
+ * rerelease of this version fixing the oversized image bug for refresh_cache (i.e images over 500 x 500
219
+
220
+ version 0.1.1
221
+ * oops, bug in leftshift/rightshift functions, fixed!
222
+
223
+ version 0.1.0
224
+ * release!
225
+