texplay 0.2.1-x86-mswin32-60

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. data/CHANGELOG +68 -0
  2. data/README +21 -0
  3. data/README1st +9 -0
  4. data/Rakefile +85 -0
  5. data/examples/basic.rb +48 -0
  6. data/examples/basic2.rb +37 -0
  7. data/examples/benchmark.rb +299 -0
  8. data/examples/common.rb +8 -0
  9. data/examples/example_alpha_blend.rb +31 -0
  10. data/examples/example_bezier.rb +51 -0
  11. data/examples/example_color_control.rb +68 -0
  12. data/examples/example_color_transform.rb +29 -0
  13. data/examples/example_dup.rb +52 -0
  14. data/examples/example_each.rb +42 -0
  15. data/examples/example_effect.rb +35 -0
  16. data/examples/example_fill.rb +49 -0
  17. data/examples/example_fill_old.rb +49 -0
  18. data/examples/example_fluent.rb +31 -0
  19. data/examples/example_gen_eval.rb +34 -0
  20. data/examples/example_hash_arguments.rb +47 -0
  21. data/examples/example_melt.rb +27 -0
  22. data/examples/example_polyline.rb +43 -0
  23. data/examples/example_simple.rb +35 -0
  24. data/examples/example_sync.rb +60 -0
  25. data/examples/example_turtle.rb +40 -0
  26. data/examples/media/empty2.png +0 -0
  27. data/examples/media/gosu.png +0 -0
  28. data/examples/media/maria.png +0 -0
  29. data/examples/media/rose.bmp +0 -0
  30. data/examples/media/sand1.png +0 -0
  31. data/examples/media/sunset.png +0 -0
  32. data/examples/media/texplay.png +0 -0
  33. data/examples/specs.rb +240 -0
  34. data/examples/test.rb +70 -0
  35. data/examples/test2.rb +72 -0
  36. data/lib/ctexplay.18.so +0 -0
  37. data/lib/ctexplay.19.so +0 -0
  38. data/lib/texplay-contrib.rb +77 -0
  39. data/lib/texplay.rb +134 -0
  40. data/src/Makefile +181 -0
  41. data/src/TAGS +286 -0
  42. data/src/actions.c +1306 -0
  43. data/src/actions.h +52 -0
  44. data/src/actions.obj +0 -0
  45. data/src/bindings.c +1081 -0
  46. data/src/bindings.h +45 -0
  47. data/src/bindings.obj +0 -0
  48. data/src/cache.c +132 -0
  49. data/src/cache.h +24 -0
  50. data/src/cache.obj +0 -0
  51. data/src/compat.h +23 -0
  52. data/src/ctexplay-i386-mswin32.def +2 -0
  53. data/src/ctexplay-i386-mswin32.exp +0 -0
  54. data/src/ctexplay-i386-mswin32.lib +0 -0
  55. data/src/ctexplay-i386-mswin32.pdb +0 -0
  56. data/src/ctexplay.so +0 -0
  57. data/src/extconf.rb +18 -0
  58. data/src/gen_eval.c +209 -0
  59. data/src/gen_eval.h +20 -0
  60. data/src/gen_eval.obj +0 -0
  61. data/src/mkmf.log +18 -0
  62. data/src/object2module.c +171 -0
  63. data/src/object2module.h +11 -0
  64. data/src/object2module.obj +0 -0
  65. data/src/texplay.c +136 -0
  66. data/src/texplay.h +107 -0
  67. data/src/texplay.obj +0 -0
  68. data/src/utils.c +959 -0
  69. data/src/utils.h +143 -0
  70. data/src/utils.obj +0 -0
  71. data/src/vc60.pdb +0 -0
  72. metadata +132 -0
data/src/utils.h ADDED
@@ -0,0 +1,143 @@
1
+ #ifndef GUARD_UTILS_H
2
+ #define GUARD_UTILS_H
3
+
4
+
5
+ /* for use with get_image_local, and set_image_local */
6
+ #define DRAW_OFFSET 0
7
+ #define LAZY_BOUNDS 1
8
+ #define IMAGE_COLOR 2
9
+ #define USER_DEFAULTS 3
10
+
11
+
12
+ /* color and pixel related functions */
13
+ rgba find_color_from_string(char * try_color);
14
+ bool cmp_color(rgba color1, rgba color2);
15
+ void color_copy(float * source, float * dest);
16
+ rgba get_pixel_color(texture_info * tex, int x, int y) ;
17
+ float* get_pixel_data(texture_info * tex, int x, int y);
18
+ void set_pixel_color(rgba * pixel_color, texture_info * tex, int x, int y);
19
+ void zero_color(float * tex);
20
+ bool not_a_color(rgba color1);
21
+ bool is_a_color(rgba color1);
22
+ VALUE convert_rgba_to_rb_color(rgba * pix);
23
+ rgba convert_rb_color_to_rgba(VALUE cval);
24
+
25
+ VALUE save_rgba_to_image_local_color(VALUE image, rgba color);
26
+ rgba convert_image_local_color_to_rgba(VALUE image);
27
+
28
+
29
+ /* string/symbol related functions */
30
+ char* lowercase(char*);
31
+ char* sym2string(VALUE);
32
+ VALUE string2sym(char*);
33
+
34
+ /* is it a hash? */
35
+ bool is_a_hash(VALUE try_hash);
36
+
37
+ /* is an array? */
38
+ bool is_an_array(VALUE try_array);
39
+
40
+ /* is a num? */
41
+ bool is_a_num(VALUE try_num);
42
+
43
+ /* helpful C wrapper for rb_hash_aref */
44
+ VALUE get_from_hash(VALUE hash, char * sym);
45
+
46
+ /* a wrapper for rb_hash_aset */
47
+ VALUE set_hash_value(VALUE hash, char * sym, VALUE val);
48
+
49
+ /* a wrapper for rb_hash_delete */
50
+ VALUE delete_from_hash(VALUE hash, char * sym);
51
+
52
+ /* does the hash key 'sym' map to value 'val'? */
53
+ bool hash_value_is(VALUE hash, char * sym, VALUE val);
54
+
55
+ /* determine whether (1) hash is a T_HASH (2) the sym exists in the hash */
56
+ bool has_optional_hash_arg(VALUE hash, char * sym);
57
+
58
+
59
+ /* helpful C wrapper for rb_array_store */
60
+ VALUE set_array_value(VALUE array, int index, VALUE val);
61
+
62
+ /* helpful C wrapper for rb_array_entry */
63
+ VALUE get_from_array(VALUE array, int index);
64
+
65
+ /* set the lazy_bounds ivar for an image */
66
+ VALUE set_ivar_array(VALUE obj, char * ivar, int argc, ...);
67
+
68
+ /* initialize lazy_bounds */
69
+ void init_lazy_bounds(VALUE image);
70
+
71
+ /* initialize the image_local var array */
72
+ VALUE init_image_local(VALUE image);
73
+
74
+ /* return an image local variable */
75
+ VALUE get_image_local(VALUE image, int name);
76
+
77
+ /* set an image local variable */
78
+ void set_image_local(VALUE image, int name, VALUE val);
79
+
80
+ /* error checking functions */
81
+ void check_mask(VALUE mask);
82
+
83
+ void check_image(VALUE image);
84
+
85
+ /* is try_image a Gosu::Image ? */
86
+ bool is_gosu_image(VALUE try_image);
87
+
88
+ /* create a blank gosu image of width and height */
89
+ VALUE create_image(VALUE window, int width, int height);
90
+
91
+ /* make boundaries sane */
92
+ void constrain_boundaries(int * x0, int * y0, int * x1, int * y1, int width, int height);
93
+
94
+ /* line clipping */
95
+ void cohen_sutherland_clip (int * x0, int * y0,int * x1, int * y1, int xmin, int ymin,
96
+ int xmax, int ymax);
97
+
98
+ /* check if point is bound by rect and inner thickness */
99
+ bool bound_by_rect_and_inner(int x, int y, int x0, int y0, int x1, int y1, int inner);
100
+
101
+ /* check if point is bound by rect */
102
+ bool bound_by_rect(int x, int y, int x0, int y0, int x1, int y1);
103
+
104
+ /* calculate the array offset for a given pixel */
105
+ int calc_pixel_offset(texture_info * tex, int x, int y);
106
+
107
+ /* calculate the array offset for a given pixel in an action context */
108
+ int calc_pixel_offset_for_action(action_struct * cur, texture_info * tex, int x, int y);
109
+
110
+ /* return a pointer to a new texture */
111
+ float* allocate_texture(int width, int height);
112
+
113
+ /* other function prototypes, get info for a texture */
114
+ void get_texture_info(VALUE image, texture_info * tex);
115
+
116
+ /* ensure gl_tex_info returns non nil */
117
+ VALUE check_for_texture_info(VALUE image);
118
+
119
+ /* responsible for syncing a subimage to gl */
120
+ void sync_to_gl(int tex_name, int x_offset, int y_offset, int width, int height, void * sub);
121
+
122
+ /* create a subtexture and sync to gl */
123
+ void create_subtexture_and_sync_to_gl(image_bounds * img_bounds, texture_info * tex);
124
+
125
+ float * get_image_chunk(texture_info * tex, int xmin, int ymin, int xmax, int ymax);
126
+
127
+ rgba get_pixel_color_from_chunk(float * chunk, int width, int height, int x, int y);
128
+
129
+ /* from Texture.cpp in Gosu Graphics folder */
130
+ unsigned max_quad_size(void);
131
+
132
+ /* point utils */
133
+ bool is_a_point(VALUE try_point);
134
+ VALUE point_x(VALUE point);
135
+ VALUE point_y(VALUE point);
136
+
137
+ /* mathematical utils, used by bezier curves */
138
+ double power(float base, int exp);
139
+ unsigned fact(int n);
140
+ unsigned comb(int n, int k);
141
+ double bernstein(int n, int k, float u);
142
+
143
+ #endif
data/src/utils.obj ADDED
Binary file
data/src/vc60.pdb ADDED
Binary file
metadata ADDED
@@ -0,0 +1,132 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: texplay
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.1
5
+ platform: x86-mswin32-60
6
+ authors:
7
+ - John Mair (banisterfiend)
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-09-02 00:00:00 +12:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: gosu
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 0.7.14
24
+ version:
25
+ description: TexPlay is a light-weight image manipulation framework for Ruby and Gosu
26
+ email: jrmair@gmail.com
27
+ executables: []
28
+
29
+ extensions: []
30
+
31
+ extra_rdoc_files: []
32
+
33
+ files:
34
+ - Rakefile
35
+ - README
36
+ - CHANGELOG
37
+ - README1st
38
+ - lib/texplay.rb
39
+ - lib/texplay-contrib.rb
40
+ - src/actions.c
41
+ - src/actions.h
42
+ - src/actions.obj
43
+ - src/bindings.c
44
+ - src/bindings.h
45
+ - src/bindings.obj
46
+ - src/cache.c
47
+ - src/cache.h
48
+ - src/cache.obj
49
+ - src/compat.h
50
+ - src/ctexplay-i386-mswin32.def
51
+ - src/ctexplay-i386-mswin32.exp
52
+ - src/ctexplay-i386-mswin32.lib
53
+ - src/ctexplay-i386-mswin32.pdb
54
+ - src/ctexplay.so
55
+ - src/extconf.rb
56
+ - src/gen_eval.c
57
+ - src/gen_eval.h
58
+ - src/gen_eval.obj
59
+ - src/Makefile
60
+ - src/mkmf.log
61
+ - src/object2module.c
62
+ - src/object2module.h
63
+ - src/object2module.obj
64
+ - src/TAGS
65
+ - src/texplay.c
66
+ - src/texplay.h
67
+ - src/texplay.obj
68
+ - src/utils.c
69
+ - src/utils.h
70
+ - src/utils.obj
71
+ - src/vc60.pdb
72
+ - examples/basic.rb
73
+ - examples/basic2.rb
74
+ - examples/benchmark.rb
75
+ - examples/common.rb
76
+ - examples/example_alpha_blend.rb
77
+ - examples/example_bezier.rb
78
+ - examples/example_color_control.rb
79
+ - examples/example_color_transform.rb
80
+ - examples/example_dup.rb
81
+ - examples/example_each.rb
82
+ - examples/example_effect.rb
83
+ - examples/example_fill.rb
84
+ - examples/example_fill_old.rb
85
+ - examples/example_fluent.rb
86
+ - examples/example_gen_eval.rb
87
+ - examples/example_hash_arguments.rb
88
+ - examples/example_melt.rb
89
+ - examples/example_polyline.rb
90
+ - examples/example_simple.rb
91
+ - examples/example_sync.rb
92
+ - examples/example_turtle.rb
93
+ - examples/specs.rb
94
+ - examples/test.rb
95
+ - examples/test2.rb
96
+ - examples/media/empty2.png
97
+ - examples/media/gosu.png
98
+ - examples/media/maria.png
99
+ - examples/media/rose.bmp
100
+ - examples/media/sand1.png
101
+ - examples/media/sunset.png
102
+ - examples/media/texplay.png
103
+ - lib/ctexplay.18.so
104
+ - lib/ctexplay.19.so
105
+ has_rdoc: false
106
+ homepage: http://banisterfiend.wordpress.com/2008/08/23/texplay-an-image-manipulation-tool-for-ruby-and-gosu/
107
+ post_install_message:
108
+ rdoc_options: []
109
+
110
+ require_paths:
111
+ - lib
112
+ required_ruby_version: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - ">="
115
+ - !ruby/object:Gem::Version
116
+ version: "0"
117
+ version:
118
+ required_rubygems_version: !ruby/object:Gem::Requirement
119
+ requirements:
120
+ - - ">="
121
+ - !ruby/object:Gem::Version
122
+ version: "0"
123
+ version:
124
+ requirements: []
125
+
126
+ rubyforge_project:
127
+ rubygems_version: 1.3.1
128
+ signing_key:
129
+ specification_version: 2
130
+ summary: TexPlay is a light-weight image manipulation framework for Ruby and Gosu
131
+ test_files: []
132
+