rays 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/.doc/ext/rays/bitmap.cpp +76 -53
- data/.doc/ext/rays/font.cpp +31 -27
- data/.doc/ext/rays/image.cpp +44 -37
- data/.doc/ext/rays/native.cpp +6 -0
- data/.doc/ext/rays/painter.cpp +276 -160
- data/.doc/ext/rays/rays.cpp +8 -9
- data/.doc/ext/rays/texture.cpp +50 -28
- data/.gitignore +14 -0
- data/Rakefile +5 -30
- data/VERSION +1 -1
- data/ext/rays/bitmap.cpp +77 -53
- data/ext/rays/bounds.cpp +426 -0
- data/ext/rays/color.cpp +199 -0
- data/ext/rays/defs.h +1 -18
- data/ext/rays/extconf.rb +10 -8
- data/ext/rays/font.cpp +31 -27
- data/ext/rays/image.cpp +44 -37
- data/ext/rays/matrix.cpp +154 -0
- data/ext/rays/native.cpp +6 -0
- data/ext/rays/painter.cpp +288 -163
- data/ext/rays/point.cpp +175 -0
- data/ext/rays/rays.cpp +8 -9
- data/ext/rays/texture.cpp +52 -28
- data/include/rays.h +1 -2
- data/include/rays/bitmap.h +5 -3
- data/include/rays/bounds.h +94 -0
- data/include/rays/color.h +53 -0
- data/include/rays/colorspace.h +2 -2
- data/include/rays/exception.h +1 -1
- data/include/rays/font.h +7 -3
- data/include/rays/image.h +6 -2
- data/include/rays/matrix.h +63 -0
- data/include/rays/opengl.h +1 -1
- data/include/rays/painter.h +138 -39
- data/include/rays/point.h +39 -0
- data/include/rays/ruby.h +3 -0
- data/include/rays/ruby/bitmap.h +5 -3
- data/include/rays/ruby/bounds.h +41 -0
- data/include/rays/ruby/color.h +41 -0
- data/include/rays/ruby/font.h +5 -3
- data/include/rays/ruby/image.h +5 -3
- data/include/rays/ruby/matrix.h +41 -0
- data/include/rays/ruby/painter.h +5 -3
- data/include/rays/ruby/point.h +41 -0
- data/include/rays/ruby/texture.h +5 -3
- data/include/rays/texture.h +6 -2
- data/lib/rays.rb +3 -0
- data/lib/rays/autoinit.rb +1 -1
- data/lib/rays/bitmap.rb +15 -1
- data/lib/rays/bounds.rb +138 -0
- data/lib/rays/color.rb +52 -0
- data/lib/rays/ext.rb +4 -0
- data/lib/rays/image.rb +1 -1
- data/lib/rays/module.rb +9 -2
- data/lib/rays/painter.rb +40 -41
- data/lib/rays/point.rb +82 -0
- data/lib/rays/texture.rb +1 -1
- data/rays.gemspec +16 -37
- data/src/bounds.cpp +234 -0
- data/src/cocoa/bitmap.mm +4 -4
- data/src/cocoa/font.mm +35 -30
- data/src/cocoa/rays.mm +2 -0
- data/src/color.cpp +77 -0
- data/src/colorspace.cpp +3 -3
- data/src/exception.cpp +3 -18
- data/src/image.cpp +9 -2
- data/src/matrix.cpp +103 -0
- data/src/painter.cpp +475 -224
- data/src/point.cpp +52 -0
- data/src/texture.cpp +14 -2
- data/src/win32/bitmap.cpp +2 -2
- data/src/win32/gdi.cpp +22 -13
- data/src/win32/gdi.h +7 -7
- data/test/helpers.rb +1 -5
- data/test/test_bitmap.rb +9 -0
- data/test/test_bounds.rb +246 -0
- data/test/test_color.rb +88 -0
- data/test/test_font.rb +28 -0
- data/test/test_image.rb +9 -0
- data/test/test_painter.rb +1 -3
- data/test/test_point.rb +121 -0
- data/test/test_rays.rb +2 -3
- data/test/test_texture.rb +1 -3
- metadata +146 -75
- data/include/rays/helpers.h +0 -37
- data/include/rays/transform.h +0 -35
- data/src/helpers.cpp +0 -22
- data/src/transform.cpp +0 -88
data/.doc/ext/rays/rays.cpp
CHANGED
@@ -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
|
-
|
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
|
-
|
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
|
-
|
48
|
-
|
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
|
}
|
data/.doc/ext/rays/texture.cpp
CHANGED
@@ -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&
|
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
|
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
|
51
|
+
#define THIS to<Rays::Texture*>(self)
|
46
52
|
|
47
|
-
#define CHECK
|
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
|
59
|
+
return new_type<Rays::Texture>(klass);
|
54
60
|
}
|
55
61
|
|
56
62
|
static
|
57
63
|
VALUE initialize(VALUE self)
|
58
64
|
{
|
59
|
-
|
60
|
-
|
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
|
-
*
|
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(
|
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(
|
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(
|
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(
|
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(
|
133
|
+
return value(THIS->bitmap());
|
110
134
|
}
|
111
135
|
|
112
136
|
|
113
137
|
void
|
114
138
|
Init_texture ()
|
115
139
|
{
|
116
|
-
Module
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
rb_define_method(
|
123
|
-
rb_define_method(
|
124
|
-
rb_define_method(
|
125
|
-
rb_define_method(
|
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
data/Rakefile
CHANGED
@@ -1,12 +1,8 @@
|
|
1
1
|
# -*- mode: ruby; coding: utf-8 -*-
|
2
2
|
|
3
3
|
|
4
|
-
|
5
|
-
|
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
|
18
|
-
INCDIRS
|
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.
|
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&
|
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
|
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
|
54
|
+
#define THIS to<Rays::Bitmap*>(self)
|
48
55
|
|
49
|
-
#define CHECK
|
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
|
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(
|
78
|
+
RUBY_DEFN(draw_string)
|
61
79
|
{
|
62
|
-
|
63
|
-
if (argc
|
64
|
-
arg_count_error("Bitmap#
|
80
|
+
CHECK;
|
81
|
+
if (argc < 1 || 4 < argc)
|
82
|
+
arg_count_error("Bitmap#draw_string", argc, 1, 2, 3, 4);
|
65
83
|
|
66
|
-
|
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
|
-
|
69
|
-
|
70
|
-
|
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(
|
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(
|
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(
|
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 =
|
111
|
-
if (!pixel)
|
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(
|
114
|
-
if (
|
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 (
|
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
|
-
|
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 (
|
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
|
-
|
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 =
|
204
|
-
if (!pixel)
|
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(
|
207
|
-
if (
|
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 (
|
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
|
-
|
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 (
|
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
|
-
|
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
|
-
|
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
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
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
|
}
|