rays 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. data/.doc/ext/rays/bitmap.cpp +76 -53
  2. data/.doc/ext/rays/font.cpp +31 -27
  3. data/.doc/ext/rays/image.cpp +44 -37
  4. data/.doc/ext/rays/native.cpp +6 -0
  5. data/.doc/ext/rays/painter.cpp +276 -160
  6. data/.doc/ext/rays/rays.cpp +8 -9
  7. data/.doc/ext/rays/texture.cpp +50 -28
  8. data/.gitignore +14 -0
  9. data/Rakefile +5 -30
  10. data/VERSION +1 -1
  11. data/ext/rays/bitmap.cpp +77 -53
  12. data/ext/rays/bounds.cpp +426 -0
  13. data/ext/rays/color.cpp +199 -0
  14. data/ext/rays/defs.h +1 -18
  15. data/ext/rays/extconf.rb +10 -8
  16. data/ext/rays/font.cpp +31 -27
  17. data/ext/rays/image.cpp +44 -37
  18. data/ext/rays/matrix.cpp +154 -0
  19. data/ext/rays/native.cpp +6 -0
  20. data/ext/rays/painter.cpp +288 -163
  21. data/ext/rays/point.cpp +175 -0
  22. data/ext/rays/rays.cpp +8 -9
  23. data/ext/rays/texture.cpp +52 -28
  24. data/include/rays.h +1 -2
  25. data/include/rays/bitmap.h +5 -3
  26. data/include/rays/bounds.h +94 -0
  27. data/include/rays/color.h +53 -0
  28. data/include/rays/colorspace.h +2 -2
  29. data/include/rays/exception.h +1 -1
  30. data/include/rays/font.h +7 -3
  31. data/include/rays/image.h +6 -2
  32. data/include/rays/matrix.h +63 -0
  33. data/include/rays/opengl.h +1 -1
  34. data/include/rays/painter.h +138 -39
  35. data/include/rays/point.h +39 -0
  36. data/include/rays/ruby.h +3 -0
  37. data/include/rays/ruby/bitmap.h +5 -3
  38. data/include/rays/ruby/bounds.h +41 -0
  39. data/include/rays/ruby/color.h +41 -0
  40. data/include/rays/ruby/font.h +5 -3
  41. data/include/rays/ruby/image.h +5 -3
  42. data/include/rays/ruby/matrix.h +41 -0
  43. data/include/rays/ruby/painter.h +5 -3
  44. data/include/rays/ruby/point.h +41 -0
  45. data/include/rays/ruby/texture.h +5 -3
  46. data/include/rays/texture.h +6 -2
  47. data/lib/rays.rb +3 -0
  48. data/lib/rays/autoinit.rb +1 -1
  49. data/lib/rays/bitmap.rb +15 -1
  50. data/lib/rays/bounds.rb +138 -0
  51. data/lib/rays/color.rb +52 -0
  52. data/lib/rays/ext.rb +4 -0
  53. data/lib/rays/image.rb +1 -1
  54. data/lib/rays/module.rb +9 -2
  55. data/lib/rays/painter.rb +40 -41
  56. data/lib/rays/point.rb +82 -0
  57. data/lib/rays/texture.rb +1 -1
  58. data/rays.gemspec +16 -37
  59. data/src/bounds.cpp +234 -0
  60. data/src/cocoa/bitmap.mm +4 -4
  61. data/src/cocoa/font.mm +35 -30
  62. data/src/cocoa/rays.mm +2 -0
  63. data/src/color.cpp +77 -0
  64. data/src/colorspace.cpp +3 -3
  65. data/src/exception.cpp +3 -18
  66. data/src/image.cpp +9 -2
  67. data/src/matrix.cpp +103 -0
  68. data/src/painter.cpp +475 -224
  69. data/src/point.cpp +52 -0
  70. data/src/texture.cpp +14 -2
  71. data/src/win32/bitmap.cpp +2 -2
  72. data/src/win32/gdi.cpp +22 -13
  73. data/src/win32/gdi.h +7 -7
  74. data/test/helpers.rb +1 -5
  75. data/test/test_bitmap.rb +9 -0
  76. data/test/test_bounds.rb +246 -0
  77. data/test/test_color.rb +88 -0
  78. data/test/test_font.rb +28 -0
  79. data/test/test_image.rb +9 -0
  80. data/test/test_painter.rb +1 -3
  81. data/test/test_point.rb +121 -0
  82. data/test/test_rays.rb +2 -3
  83. data/test/test_texture.rb +1 -3
  84. metadata +146 -75
  85. data/include/rays/helpers.h +0 -37
  86. data/include/rays/transform.h +0 -35
  87. data/src/helpers.cpp +0 -22
  88. data/src/transform.cpp +0 -88
@@ -6,12 +6,13 @@
6
6
  using namespace Rucy;
7
7
 
8
8
 
9
+ static Module mRays;
10
+
11
+
9
12
  namespace Rays
10
13
  {
11
14
 
12
15
 
13
- static Module mRays;
14
-
15
16
  Module
16
17
  rays_module ()
17
18
  {
@@ -26,7 +27,7 @@ static
26
27
  VALUE init(VALUE self)
27
28
  {
28
29
  if (!Rays::init())
29
- error("Rays::init() failed.");
30
+ rays_error("Rays::init() failed.");
30
31
 
31
32
  return self;
32
33
  }
@@ -35,7 +36,7 @@ static
35
36
  VALUE fin(VALUE self)
36
37
  {
37
38
  if (!Rays::fin())
38
- error("Rays::fin() failed.");
39
+ rays_error("Rays::fin() failed.");
39
40
 
40
41
  return self;
41
42
  }
@@ -44,9 +45,7 @@ VALUE fin(VALUE self)
44
45
  void
45
46
  Init_rays ()
46
47
  {
47
- Module m = rb_define_module("Rays");
48
- Rays::mRays = m;
49
-
50
- m.define_singleton_method("init!", init);
51
- m.define_singleton_method("fin!", fin);
48
+ mRays = rb_define_module("Rays");
49
+ mRays.define_singleton_method("init!", init);
50
+ mRays.define_singleton_method("fin!", fin);
52
51
  }
@@ -11,12 +11,13 @@ using namespace Rucy;
11
11
  using Rays::coord;
12
12
 
13
13
 
14
+ static Class cTexture;
15
+
16
+
14
17
  namespace Rays
15
18
  {
16
19
 
17
20
 
18
- static Class cTexture;
19
-
20
21
  Class
21
22
  texture_class ()
22
23
  {
@@ -32,32 +33,39 @@ namespace Rucy
32
33
 
33
34
 
34
35
  Value
35
- value (const Rays::Texture& texture)
36
+ value (const Rays::Texture& obj)
37
+ {
38
+ return new_type(cTexture, new Rays::Texture(obj));
39
+ }
40
+
41
+ Value
42
+ value (const Rays::Texture* obj)
36
43
  {
37
- return new_type<Rays::Texture>(
38
- Rays::texture_class(), new Rays::Texture(texture));
44
+ return obj ? value(*obj) : nil();
39
45
  }
40
46
 
41
47
 
42
48
  }// Rucy
43
49
 
44
50
 
45
- #define this to<Rays::Texture*>(self)
51
+ #define THIS to<Rays::Texture*>(self)
46
52
 
47
- #define CHECK CHECK_OBJECT(self, Rays::Texture, Rays::texture_class())
53
+ #define CHECK RUCY_CHECK_OBJECT(self, Rays::Texture, cTexture)
48
54
 
49
55
 
50
56
  static
51
57
  VALUE alloc(VALUE klass)
52
58
  {
53
- return new_type<Rays::Texture>(klass, new Rays::Texture);
59
+ return new_type<Rays::Texture>(klass);
54
60
  }
55
61
 
56
62
  static
57
63
  VALUE initialize(VALUE self)
58
64
  {
59
- CHECK_OBJ(self, Rays::Texture, Rays::texture_class());
60
- if (argc != 1 && argc != 2) arg_count_error("Texture#initialize", argc, 1, 2);
65
+ RUCY_CHECK_OBJ(self, Rays::Texture, cTexture);
66
+
67
+ if (argc != 1 && argc != 2)
68
+ arg_count_error("Texture#initialize", argc, 1, 2);
61
69
 
62
70
  Rays::Bitmap* bitmap = to<Rays::Bitmap*>(argv[0]);
63
71
  bool alphaonly = (argc == 2) ? to<bool>(argv[1]) : false;
@@ -65,7 +73,7 @@ VALUE initialize(VALUE self)
65
73
  if (!bitmap)
66
74
  argument_error("%s is not a Bitmap object.", argv[0].inspect().c_str());
67
75
 
68
- *this = Rays::Texture(*bitmap, alphaonly);
76
+ *THIS = Rays::Texture(*bitmap, alphaonly);
69
77
  return self;
70
78
  }
71
79
 
@@ -74,7 +82,7 @@ VALUE width(VALUE self)
74
82
  {
75
83
  CHECK;
76
84
 
77
- return value(this->width());
85
+ return value(THIS->width());
78
86
  }
79
87
 
80
88
  static
@@ -82,7 +90,23 @@ VALUE height(VALUE self)
82
90
  {
83
91
  CHECK;
84
92
 
85
- return value(this->height());
93
+ return value(THIS->height());
94
+ }
95
+
96
+ static
97
+ VALUE s(VALUE self, VALUE x)
98
+ {
99
+ CHECK;
100
+
101
+ return value(THIS->s(x.as_f(true)));
102
+ }
103
+
104
+ static
105
+ VALUE t(VALUE self, VALUE y)
106
+ {
107
+ CHECK;
108
+
109
+ return value(THIS->t(y.as_f(true)));
86
110
  }
87
111
 
88
112
  static
@@ -90,7 +114,7 @@ VALUE s_max(VALUE self)
90
114
  {
91
115
  CHECK;
92
116
 
93
- return value(this->s_max());
117
+ return value(THIS->s_max());
94
118
  }
95
119
 
96
120
  static
@@ -98,7 +122,7 @@ VALUE t_max(VALUE self)
98
122
  {
99
123
  CHECK;
100
124
 
101
- return value(this->t_max());
125
+ return value(THIS->t_max());
102
126
  }
103
127
 
104
128
  static
@@ -106,23 +130,21 @@ VALUE bitmap(VALUE self)
106
130
  {
107
131
  CHECK;
108
132
 
109
- return value(this->bitmap());
133
+ return value(THIS->bitmap());
110
134
  }
111
135
 
112
136
 
113
137
  void
114
138
  Init_texture ()
115
139
  {
116
- Module m = rb_define_module("Rays");
117
-
118
- Class c = rb_define_class_under(m, "Texture", rb_cObject);
119
- Rays::cTexture = c;
120
-
121
- rb_define_alloc_func(c, alloc);
122
- rb_define_method(c, "initialize", RUBY_METHOD_FUNC(initialize), -1);
123
- rb_define_method(c, "width", RUBY_METHOD_FUNC(width), 0);
124
- rb_define_method(c, "height", RUBY_METHOD_FUNC(height), 0);
125
- rb_define_method(c, "s_max", RUBY_METHOD_FUNC(s_max), 0);
126
- rb_define_method(c, "t_max", RUBY_METHOD_FUNC(t_max), 0);
127
- rb_define_method(c, "bitmap", RUBY_METHOD_FUNC(bitmap), 0);
140
+ Module mRays = rb_define_module("Rays");
141
+
142
+ cTexture = rb_define_class_under(mRays, "Texture", rb_cObject);
143
+ rb_define_alloc_func(cTexture, alloc);
144
+ rb_define_private_method(cTexture, "initialize", RUBY_METHOD_FUNC(initialize), -1);
145
+ rb_define_method(cTexture, "width", RUBY_METHOD_FUNC(width), 0);
146
+ rb_define_method(cTexture, "height", RUBY_METHOD_FUNC(height), 0);
147
+ rb_define_method(cTexture, "s_max", RUBY_METHOD_FUNC(s_max), 0);
148
+ rb_define_method(cTexture, "t_max", RUBY_METHOD_FUNC(t_max), 0);
149
+ rb_define_method(cTexture, "bitmap", RUBY_METHOD_FUNC(bitmap), 0);
128
150
  }
data/.gitignore ADDED
@@ -0,0 +1,14 @@
1
+ *.o
2
+ *.so
3
+ *.bundle
4
+ *.dll.a
5
+ *.gem
6
+ *.log
7
+ *.rdoc.cpp
8
+ *~
9
+ lib/*.a
10
+ .doc
11
+ .yardoc
12
+ .DS_Store
13
+ Makefile
14
+ depend.mf
data/Rakefile CHANGED
@@ -1,12 +1,8 @@
1
1
  # -*- mode: ruby; coding: utf-8 -*-
2
2
 
3
3
 
4
- %w[. ../xot ../rucy].map {|s| "#{s}/lib"}.each do |path|
5
- $: << File.expand_path(File.join File.dirname(__FILE__), *path.split('/'))
6
- end
7
-
8
- require 'rubygems'
9
- require 'xot/rake/helpers'
4
+ require 'bundler/setup'
5
+ require 'xot/rake'
10
6
  require 'xot/module'
11
7
  require 'rucy/module'
12
8
  require 'rays/module'
@@ -14,35 +10,14 @@ require 'rays/module'
14
10
  include Xot::Rake
15
11
 
16
12
 
17
- MODULE = Rays
18
- INCDIRS = [Rays, Rucy].map {|m| m.include_dirs}.flatten
13
+ MODULE = Rays
14
+ INCDIRS = [Rays, Rucy, Xot].map {|m| m.include_dirs}.flatten
15
+ TESTS_ALONE = ['test/test_rays.rb']
19
16
 
20
17
 
21
18
  task :default => :build
22
19
 
23
20
  task :build => :ext
24
21
 
25
- task :rebuild => [:clean, :build]
26
-
27
- task :lib => 'lib:build'
28
-
29
- task :ext => 'ext:build'
30
-
31
- task :doc => 'ext:doc'
32
-
33
- task :gem => 'gem:build'
34
-
35
- task :install => 'gem:install'
36
-
37
- task :uninstall => 'gem:uninstall'
38
-
39
- task :clean => ['lib:clean', 'ext:clean', 'gem:clean']
40
-
41
- task :test => :ext do
42
- Dir['test/**/test_*.rb'].each do |rb|
43
- sh %( ruby #{rb} )
44
- end
45
- end
46
-
47
22
 
48
23
  [Xot, Rucy, Rays].each {|m| m.load_tasks}
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.3
1
+ 0.1.4
data/ext/rays/bitmap.cpp CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
 
4
4
  #include <rucy.h>
5
+ #include "rays/ruby/font.h"
5
6
  #include "defs.h"
6
7
 
7
8
 
@@ -13,12 +14,13 @@ using Rays::ulong;
13
14
  using Rays::coord;
14
15
 
15
16
 
17
+ static Class cBitmap;
18
+
19
+
16
20
  namespace Rays
17
21
  {
18
22
 
19
23
 
20
- static Class cBitmap;
21
-
22
24
  Class
23
25
  bitmap_class ()
24
26
  {
@@ -34,42 +36,64 @@ namespace Rucy
34
36
 
35
37
 
36
38
  Value
37
- value (const Rays::Bitmap& bitmap)
39
+ value (const Rays::Bitmap& obj)
40
+ {
41
+ return new_type(cBitmap, new Rays::Bitmap(obj));
42
+ }
43
+
44
+ Value
45
+ value (const Rays::Bitmap* obj)
38
46
  {
39
- return new_type<Rays::Bitmap>(
40
- Rays::bitmap_class(), new Rays::Bitmap(bitmap));
47
+ return obj ? value(*obj) : nil();
41
48
  }
42
49
 
43
50
 
44
51
  }// Rucy
45
52
 
46
53
 
47
- #define this to<Rays::Bitmap*>(self)
54
+ #define THIS to<Rays::Bitmap*>(self)
48
55
 
49
- #define CHECK CHECK_OBJECT(self, Rays::Bitmap, Rays::bitmap_class())
56
+ #define CHECK RUCY_CHECK_OBJECT(self, Rays::Bitmap, cBitmap)
50
57
 
51
58
 
52
59
  static
53
60
  RUBY_DEF_ALLOC(alloc, klass)
54
61
  {
55
- return new_type<Rays::Bitmap>(klass, new Rays::Bitmap);
62
+ return new_type<Rays::Bitmap>(klass);
63
+ }
64
+ RUBY_END
65
+
66
+ static
67
+ RUBY_DEF3(setup, width, height, colorspace)
68
+ {
69
+ RUCY_CHECK_OBJ(self, Rays::Bitmap, cBitmap);
70
+ *THIS = Rays::Bitmap(
71
+ to<int>(width), to<int>(height),
72
+ (Rays::ColorSpaceType) to<uint>(colorspace));
73
+ return self;
56
74
  }
57
75
  RUBY_END
58
76
 
59
77
  static
60
- RUBY_DEFN(initialize)
78
+ RUBY_DEFN(draw_string)
61
79
  {
62
- CHECK_OBJ(self, Rays::Bitmap, Rays::bitmap_class());
63
- if (argc != 0 && argc != 2 && argc != 3)
64
- arg_count_error("Bitmap#initialize", argc, 0, 2, 3);
80
+ CHECK;
81
+ if (argc < 1 || 4 < argc)
82
+ arg_count_error("Bitmap#draw_string", argc, 1, 2, 3, 4);
65
83
 
66
- if (argc == 0) return self;
84
+ const char* str = to<const char*>(argv[0]);
85
+ coord x = argc >= 2 ? to<coord>(argv[1]) : 0;
86
+ coord y = argc >= 3 ? to<coord>(argv[2]) : 0;
87
+ const Rays::Font* font = argc >= 4
88
+ ? to<Rays::Font*>(argv[3]) : &Rays::default_font();
67
89
 
68
- int width = to<int>(argv[0]);
69
- int height = to<int>(argv[1]);
70
- uint colorspace = (argc == 3) ? to<uint>(argv[2]) : (uint) Rays::RGBA;
90
+ if (!Rays::draw_string(THIS, str, x, y, *font))
91
+ {
92
+ rays_error(
93
+ "Bitmap#draw_string('%s', %f, %f, %s) failed.",
94
+ str, x, y, font->name().c_str());
95
+ }
71
96
 
72
- *this = Rays::Bitmap(width, height, (Rays::ColorSpaceType) colorspace);
73
97
  return self;
74
98
  }
75
99
  RUBY_END
@@ -79,7 +103,7 @@ RUBY_DEF0(width)
79
103
  {
80
104
  CHECK;
81
105
 
82
- return value(this->width());
106
+ return value(THIS->width());
83
107
  }
84
108
  RUBY_END
85
109
 
@@ -88,7 +112,7 @@ RUBY_DEF0(height)
88
112
  {
89
113
  CHECK;
90
114
 
91
- return value(this->height());
115
+ return value(THIS->height());
92
116
  }
93
117
  RUBY_END
94
118
 
@@ -97,7 +121,7 @@ RUBY_DEF0(color_space)
97
121
  {
98
122
  CHECK;
99
123
 
100
- return value(this->color_space().type());
124
+ return value(THIS->color_space().type());
101
125
  }
102
126
  RUBY_END
103
127
 
@@ -107,14 +131,14 @@ RUBY_DEF2(at, x, y)
107
131
  CHECK;
108
132
 
109
133
  int xx = x.as_i(), yy = y.as_i();
110
- void* pixel = this->at<void*>(xx, yy);
111
- if (!pixel) error("Bitmap#at(%d, %d) failed.", xx, yy);
134
+ void* pixel = THIS->at<void*>(xx, yy);
135
+ if (!pixel) rays_error("Bitmap#at(%d, %d) failed.", xx, yy);
112
136
 
113
- Value array(this->color_space().Bpp() / this->color_space().Bpc(), NULL);
114
- if (this->color_space().is_float())
137
+ Value array(THIS->color_space().Bpp() / THIS->color_space().Bpc(), NULL);
138
+ if (THIS->color_space().is_float())
115
139
  {
116
140
  float* p = (float*) pixel;
117
- switch (this->color_space().type())
141
+ switch (THIS->color_space().type())
118
142
  {
119
143
  case Rays::GRAY_float:
120
144
  array.push(p[0]);
@@ -138,13 +162,13 @@ RUBY_DEF2(at, x, y)
138
162
  array.push(p[3]).push(p[2]).push(p[1]).push(p[0]);
139
163
  break;
140
164
  default:
141
- error("Bitmap#at: unknown color space");
165
+ rays_error("Bitmap#at: unknown color space");
142
166
  }
143
167
  }
144
168
  else
145
169
  {
146
170
  uchar* p = (uchar*) pixel;
147
- switch (this->color_space().type())
171
+ switch (THIS->color_space().type())
148
172
  {
149
173
  case Rays::GRAY_8:
150
174
  array.push(*(uchar*) pixel);
@@ -186,7 +210,7 @@ RUBY_DEF2(at, x, y)
186
210
  array.push(p[3]).push(p[2]).push(p[1]);
187
211
  break;
188
212
  default:
189
- error("Bitmap#at: unknown color space");
213
+ rays_error("Bitmap#at: unknown color space");
190
214
  }
191
215
  }
192
216
 
@@ -200,14 +224,14 @@ RUBY_DEF3(assign_at, x, y, color)
200
224
  CHECK;
201
225
 
202
226
  int xx = x.as_i(), yy = y.as_i();
203
- void* pixel = this->at<void*>(xx, yy);
204
- if (!pixel) error("Bitmap#assign_at(%d, %d) failed.", xx, yy);
227
+ void* pixel = THIS->at<void*>(xx, yy);
228
+ if (!pixel) rays_error("Bitmap#assign_at(%d, %d) failed.", xx, yy);
205
229
 
206
- Value array(this->color_space().Bpp() / this->color_space().Bpc(), NULL);
207
- if (this->color_space().is_float())
230
+ Value array(THIS->color_space().Bpp() / THIS->color_space().Bpc(), NULL);
231
+ if (THIS->color_space().is_float())
208
232
  {
209
233
  float* p = (float*) pixel;
210
- switch (this->color_space().type())
234
+ switch (THIS->color_space().type())
211
235
  {
212
236
  #define C(n) ((float) color[n].as_f())
213
237
  case Rays::GRAY_float:
@@ -233,13 +257,13 @@ RUBY_DEF3(assign_at, x, y, color)
233
257
  break;
234
258
  #undef C
235
259
  default:
236
- error("Bitmap#at: unknown color space");
260
+ rays_error("Bitmap#at: unknown color space");
237
261
  }
238
262
  }
239
263
  else
240
264
  {
241
265
  uchar* p = (uchar*) pixel;
242
- switch (this->color_space().type())
266
+ switch (THIS->color_space().type())
243
267
  {
244
268
  #define C(n) ((uchar) color[n].as_i())
245
269
  case Rays::GRAY_8:
@@ -283,7 +307,7 @@ RUBY_DEF3(assign_at, x, y, color)
283
307
  break;
284
308
  #undef C
285
309
  default:
286
- error("Bitmap#at: unknown color space");
310
+ rays_error("Bitmap#at: unknown color space");
287
311
  }
288
312
  }
289
313
 
@@ -297,7 +321,7 @@ RUBY_DEF1(load, path)
297
321
  {
298
322
  Rays::Bitmap bmp;
299
323
  if (!Rays::load_bitmap(&bmp, path.c_str()))
300
- error("Bitmap.load('%s') failed.", path.c_str());
324
+ rays_error("Bitmap.load('%s') failed.", path.c_str());
301
325
 
302
326
  return value(bmp);
303
327
  }
@@ -307,20 +331,20 @@ RUBY_END
307
331
  void
308
332
  Init_bitmap ()
309
333
  {
310
- Module m = define_module("Rays");
311
-
312
- m.define_const("RGB", Rays::RGB);
313
- m.define_const("RGBA", Rays::RGBA);
314
-
315
- Class c = m.define_class("Bitmap");
316
- Rays::cBitmap = c;
317
-
318
- c.define_alloc_func(alloc);
319
- c.define_method("initialize", initialize);
320
- c.define_method("width", width);
321
- c.define_method("height", height);
322
- c.define_method("color_space", color_space);
323
- c.define_method("[]", at);
324
- c.define_method("[]=", assign_at);
325
- c.define_function("load", load);
334
+ Module mRays = define_module("Rays");
335
+
336
+ mRays.define_const("GRAY", Rays::GRAY);
337
+ mRays.define_const("RGB", Rays::RGB);
338
+ mRays.define_const("RGBA", Rays::RGBA);
339
+
340
+ cBitmap = mRays.define_class("Bitmap");
341
+ cBitmap.define_alloc_func(alloc);
342
+ cBitmap.define_private_method("setup", setup);
343
+ cBitmap.define_method("draw_string", draw_string);
344
+ cBitmap.define_method("width", width);
345
+ cBitmap.define_method("height", height);
346
+ cBitmap.define_method("color_space", color_space);
347
+ cBitmap.define_method("[]", at);
348
+ cBitmap.define_method("[]=", assign_at);
349
+ cBitmap.define_function("load", load);
326
350
  }