rays 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. checksums.yaml +7 -0
  2. data/.doc/ext/rays/bitmap.cpp +70 -233
  3. data/.doc/ext/rays/bounds.cpp +339 -57
  4. data/.doc/ext/rays/color.cpp +58 -48
  5. data/.doc/ext/rays/color_space.cpp +174 -0
  6. data/.doc/ext/rays/font.cpp +31 -53
  7. data/.doc/ext/rays/image.cpp +64 -67
  8. data/.doc/ext/rays/matrix.cpp +22 -50
  9. data/.doc/ext/rays/native.cpp +9 -2
  10. data/.doc/ext/rays/painter.cpp +276 -259
  11. data/.doc/ext/rays/point.cpp +186 -52
  12. data/.doc/ext/rays/rays.cpp +25 -20
  13. data/.doc/ext/rays/shader.cpp +61 -0
  14. data/.doc/ext/rays/texture.cpp +47 -59
  15. data/{README → README.md} +0 -0
  16. data/Rakefile +6 -5
  17. data/VERSION +1 -1
  18. data/ext/rays/bitmap.cpp +88 -248
  19. data/ext/rays/bounds.cpp +437 -141
  20. data/ext/rays/color.cpp +79 -69
  21. data/ext/rays/color_space.cpp +185 -0
  22. data/ext/rays/extconf.rb +14 -63
  23. data/ext/rays/font.cpp +44 -65
  24. data/ext/rays/image.cpp +82 -81
  25. data/ext/rays/matrix.cpp +32 -60
  26. data/ext/rays/native.cpp +9 -2
  27. data/ext/rays/painter.cpp +345 -321
  28. data/ext/rays/point.cpp +212 -69
  29. data/ext/rays/rays.cpp +29 -23
  30. data/ext/rays/shader.cpp +63 -0
  31. data/ext/rays/texture.cpp +64 -74
  32. data/include/rays/bitmap.h +21 -12
  33. data/include/rays/bounds.h +67 -9
  34. data/include/rays/color.h +23 -7
  35. data/include/rays/{colorspace.h → color_space.h} +6 -3
  36. data/include/rays/exception.h +17 -11
  37. data/include/rays/font.h +4 -3
  38. data/include/rays/image.h +11 -6
  39. data/include/rays/matrix.h +15 -12
  40. data/include/rays/opengl.h +54 -1
  41. data/include/rays/painter.h +98 -108
  42. data/include/rays/point.h +45 -5
  43. data/include/rays/rays.h +2 -2
  44. data/include/rays/ruby/bitmap.h +2 -16
  45. data/include/rays/ruby/bounds.h +4 -16
  46. data/include/rays/ruby/color.h +3 -16
  47. data/include/rays/ruby/color_space.h +27 -0
  48. data/include/rays/ruby/font.h +2 -16
  49. data/include/rays/ruby/image.h +2 -16
  50. data/include/rays/ruby/matrix.h +2 -16
  51. data/include/rays/ruby/painter.h +2 -16
  52. data/include/rays/ruby/point.h +3 -16
  53. data/include/rays/ruby/shader.h +27 -0
  54. data/include/rays/ruby/texture.h +2 -16
  55. data/include/rays/ruby.h +1 -0
  56. data/include/rays/shader.h +48 -0
  57. data/include/rays/texture.h +13 -2
  58. data/include/rays.h +2 -1
  59. data/lib/rays/bitmap.rb +20 -11
  60. data/lib/rays/bounds.rb +29 -68
  61. data/lib/rays/color.rb +39 -0
  62. data/lib/rays/color_space.rb +33 -0
  63. data/lib/rays/font.rb +29 -0
  64. data/lib/rays/image.rb +22 -0
  65. data/lib/rays/module.rb +11 -7
  66. data/lib/rays/painter.rb +103 -40
  67. data/lib/rays/point.rb +19 -36
  68. data/lib/rays/shader.rb +13 -0
  69. data/lib/rays/texture.rb +9 -0
  70. data/lib/rays.rb +4 -0
  71. data/rays.gemspec +3 -4
  72. data/src/bounds.cpp +272 -63
  73. data/src/color.cpp +168 -21
  74. data/src/{colorspace.cpp → color_space.cpp} +38 -1
  75. data/src/exception.cpp +24 -15
  76. data/src/frame_buffer.cpp +275 -0
  77. data/src/frame_buffer.h +79 -0
  78. data/src/image.cpp +80 -36
  79. data/src/ios/bitmap.mm +340 -0
  80. data/src/ios/font.mm +206 -0
  81. data/src/{cocoa → ios}/helper.h +2 -2
  82. data/src/{cocoa → ios}/helper.mm +0 -0
  83. data/src/ios/opengl.mm +21 -0
  84. data/src/ios/program.cpp +122 -0
  85. data/src/{cocoa → ios}/rays.mm +8 -7
  86. data/src/matrix.cpp +10 -22
  87. data/src/opengl.cpp +64 -0
  88. data/src/{cocoa → osx}/bitmap.mm +121 -70
  89. data/src/{cocoa → osx}/font.mm +32 -24
  90. data/src/osx/helper.h +26 -0
  91. data/src/osx/helper.mm +25 -0
  92. data/src/osx/opengl.mm +103 -0
  93. data/src/osx/rays.mm +43 -0
  94. data/src/painter.cpp +596 -422
  95. data/src/point.cpp +154 -11
  96. data/src/program.cpp +513 -0
  97. data/src/program.h +73 -0
  98. data/src/render_buffer.cpp +120 -0
  99. data/src/render_buffer.h +47 -0
  100. data/src/shader.cpp +117 -0
  101. data/src/texture.cpp +104 -134
  102. data/test/helper.rb +10 -3
  103. data/test/test_bitmap.rb +18 -0
  104. data/test/test_bounds.rb +81 -35
  105. data/test/test_color.rb +29 -2
  106. data/test/test_image.rb +63 -0
  107. data/test/test_painter.rb +120 -0
  108. data/test/test_point.rb +30 -9
  109. data/test/test_shader.rb +37 -0
  110. data/test/test_texture.rb +18 -0
  111. metadata +75 -58
  112. data/.gitignore +0 -14
  113. data/ChangeLog +0 -8
@@ -6,7 +6,6 @@
6
6
 
7
7
  #include <xot/pimpl.h>
8
8
  #include <rays/defs.h>
9
- #include <rays/texture.h>
10
9
  #include <rays/opengl.h>
11
10
 
12
11
 
@@ -14,46 +13,22 @@ namespace Rays
14
13
  {
15
14
 
16
15
 
17
- enum ShapeType
18
- {
19
-
20
- SHAPE_UNKNOWN = Xot::UNKNOWN,
21
-
22
- POINTS = GL_POINTS,
23
-
24
- LINES = GL_LINES,
25
-
26
- LINE_STRIP = GL_LINE_STRIP,
27
-
28
- LINE_LOOP = GL_LINE_LOOP,
29
-
30
- TRIANGLES = GL_TRIANGLES,
31
-
32
- TRIANGLE_STRIP = GL_TRIANGLE_STRIP,
33
-
34
- TRIANGLE_FAN = GL_TRIANGLE_FAN,
35
-
36
- QUADS = GL_QUADS,
16
+ struct Point;
37
17
 
38
- QUAD_STRIP = GL_QUAD_STRIP,
18
+ struct Bounds;
39
19
 
40
- POLYGON = GL_POLYGON,
20
+ struct Color;
41
21
 
42
- };// ShapeType
43
-
44
-
45
- class Point;
46
-
47
- class Bounds;
48
-
49
- class Color;
50
-
51
- class Matrix;
22
+ struct Matrix;
52
23
 
53
24
  class Font;
54
25
 
55
26
  class Image;
56
27
 
28
+ class Texture;
29
+
30
+ class Shader;
31
+
57
32
 
58
33
  class Painter
59
34
  {
@@ -64,201 +39,216 @@ namespace Rays
64
39
 
65
40
  ~Painter ();
66
41
 
67
- bool canvas (coord x, coord y, coord width, coord height);
42
+ void canvas (coord x, coord y, coord width, coord height);
43
+
44
+ void canvas (coord x, coord y, coord z, coord width, coord height, coord depth);
68
45
 
69
- bool canvas (coord x, coord y, coord z, coord width, coord height, coord depth);
46
+ void canvas (const Bounds& bounds);
70
47
 
71
- bool canvas (const Bounds& bounds);
48
+ void bind (const Texture& texture);
72
49
 
73
- bool begin ();
50
+ void unbind ();
74
51
 
75
- bool end ();
52
+ const Bounds& bounds () const;
76
53
 
77
54
  //
78
55
  // high level drawing methods
79
56
  //
80
- bool line (coord x1, coord y1, coord x2, coord y2);
57
+ void begin ();
58
+
59
+ void end ();
60
+
61
+ void clear ();
81
62
 
82
- bool line (const Point& p1, const Point& p2);
63
+ void line (coord x1, coord y1, coord x2, coord y2);
83
64
 
84
- bool rect (coord x, coord y, coord width, coord height);
65
+ void line (const Point& p1, const Point& p2);
85
66
 
86
- bool rect (const Bounds& bounds);
67
+ void rect (coord x, coord y, coord width, coord height);
87
68
 
88
- bool ellipse (
69
+ void rect (const Bounds& bounds);
70
+
71
+ void ellipse (
89
72
  coord x, coord y, coord width, coord height = 0,
90
73
  coord radius_min = 0, uint nsegment = 0);
91
74
 
92
- bool ellipse (
75
+ void ellipse (
93
76
  const Bounds& bounds,
94
77
  coord radius_min = 0, uint nsegment = 0);
95
78
 
96
- bool ellipse (
79
+ void ellipse (
97
80
  const Point& center, coord radius,
98
81
  coord radius_min = 0, uint nsegment = 0);
99
82
 
100
- bool arc (
83
+ void arc (
101
84
  coord x, coord y, coord width, coord height = 0,
102
85
  float angle_from = 0, float angle_to = 360,
103
86
  coord radius_min = 0, uint nsegment = 0);
104
87
 
105
- bool arc (
88
+ void arc (
106
89
  const Bounds& bounds,
107
90
  float angle_from = 0, float angle_to = 360,
108
91
  coord radius_min = 0, uint nsegment = 0);
109
92
 
110
- bool arc (
93
+ void arc (
111
94
  const Point& center, coord radius,
112
95
  float angle_from = 0, float angle_to = 360,
113
96
  coord radius_min = 0, uint nsegment = 0);
114
97
 
115
- bool image (
98
+ void image (
116
99
  const Image& image, coord x = 0, coord y = 0);
117
100
 
118
- bool image (
101
+ void image (
119
102
  const Image& image, const Point& position);
120
103
 
121
- bool image (
104
+ void image (
122
105
  const Image& image, coord x, coord y, coord width, coord height);
123
106
 
124
- bool image (
107
+ void image (
125
108
  const Image& image, const Bounds& bounds);
126
109
 
127
- bool image (
110
+ void image (
128
111
  const Image& image,
129
112
  coord src_x, coord src_y, coord src_width, coord src_height,
130
113
  coord dest_x, coord dest_y);
131
114
 
132
- bool image (
115
+ void image (
133
116
  const Image& image,
134
117
  const Bounds& src_bounds, const Point& dest_position);
135
118
 
136
- bool image (
119
+ void image (
137
120
  const Image& image,
138
121
  coord src_x, coord src_y, coord src_width, coord src_height,
139
122
  coord dest_x, coord dest_y, coord dest_width, coord dest_height);
140
123
 
141
- bool image (
124
+ void image (
142
125
  const Image& image,
143
126
  const Bounds& src_bounds, const Bounds& dest_bounds);
144
127
 
145
- bool text (
128
+ void text (
146
129
  const char* str, coord x = 0, coord y = 0,
147
130
  const Font* font = NULL);
148
131
 
149
- bool text (
132
+ void text (
150
133
  const char* str, const Point& position,
151
134
  const Font* font = NULL);
152
135
 
153
- bool text (
136
+ void text (
154
137
  const char* str, coord x, coord y, coord width, coord height,
155
138
  const Font* font = NULL);
156
139
 
157
- bool text (
140
+ void text (
158
141
  const char* str, const Bounds& bounds,
159
142
  const Font* font = NULL);
160
143
 
161
- bool clear ();
162
-
163
- bool set_background (float red, float green, float blue, float alpha = 1);
144
+ //
145
+ // attributes
146
+ //
147
+ void set_background (float red, float green, float blue, float alpha = 1, bool clear = true);
164
148
 
165
- bool set_background (const Color& color);
149
+ void set_background (const Color& color, bool clear = true);
166
150
 
167
- bool no_background ();
151
+ void no_background (bool clear = true);
168
152
 
169
153
  const Color& background () const;
170
154
 
171
- bool set_fill (float red, float green, float blue, float alpha = 1);
155
+ void set_fill (float red, float green, float blue, float alpha = 1);
172
156
 
173
- bool set_fill (const Color& color);
157
+ void set_fill (const Color& color);
174
158
 
175
- bool no_fill ();
159
+ void no_fill ();
176
160
 
177
161
  const Color& fill () const;
178
162
 
179
- bool set_stroke (float red, float green, float blue, float alpha = 1);
163
+ void set_stroke (float red, float green, float blue, float alpha = 1);
180
164
 
181
- bool set_stroke (const Color& color);
165
+ void set_stroke (const Color& color);
182
166
 
183
- bool no_stroke ();
167
+ void no_stroke ();
184
168
 
185
169
  const Color& stroke () const;
186
170
 
187
- bool set_clip (coord x, coord y, coord width, coord height);
171
+ void set_clip (coord x, coord y, coord width, coord height);
188
172
 
189
- bool set_clip (const Bounds& bounds);
173
+ void set_clip (const Bounds& bounds);
190
174
 
191
- bool no_clip ();
175
+ void no_clip ();
192
176
 
193
177
  const Bounds& clip () const;
194
178
 
195
- bool set_font (const Font& font);
179
+ void set_font (const char* name, coord size = 0);
180
+
181
+ void set_font (const Font& font);
196
182
 
197
183
  const Font& font () const;
198
184
 
199
- bool push_attrs ();
185
+ void push_attr ();
200
186
 
201
- bool pop_attrs ();
187
+ void pop_attr ();
202
188
 
203
189
  //
204
- // transformation methods
190
+ // shader manipulation methods
205
191
  //
206
- bool translate (coord x, coord y, coord z = 0);
192
+ void attach (const Shader& shader);
207
193
 
208
- bool translate (const Point& value);
194
+ void detach (const Shader& shader);
209
195
 
210
- bool scale (coord x, coord y, coord z = 1);
196
+ void set_uniform (const char* name, int arg1);
211
197
 
212
- bool scale (const Point& value);
198
+ void set_uniform (const char* name, int arg1, int arg2);
213
199
 
214
- bool rotate (float angle, coord x = 0, coord y = 0, coord z = 1);
200
+ void set_uniform (const char* name, int arg1, int arg2, int arg3);
215
201
 
216
- bool rotate (float angle, const Point& center);
202
+ void set_uniform (const char* name, int arg1, int arg2, int arg3, int arg4);
217
203
 
218
- bool set_matrix (float value = 1);
204
+ void set_uniform (const char* name, const int* args, size_t size);
219
205
 
220
- bool set_matrix (
221
- float a1, float a2, float a3, float a4,
222
- float b1, float b2, float b3, float b4,
223
- float c1, float c2, float c3, float c4,
224
- float d1, float d2, float d3, float d4);
206
+ void set_uniform (const char* name, float arg1);
225
207
 
226
- bool set_matrix (const float* elements);
208
+ void set_uniform (const char* name, float arg1, float arg2);
227
209
 
228
- bool set_matrix (const Matrix& matrix);
210
+ void set_uniform (const char* name, float arg1, float arg2, float arg3);
229
211
 
230
- const Matrix& matrix () const;
212
+ void set_uniform (const char* name, float arg1, float arg2, float arg3, float arg4);
213
+
214
+ void set_uniform (const char* name, const float* args, size_t size);
231
215
 
232
- bool push_matrix ();
216
+ void push_shader ();
233
217
 
234
- bool pop_matrix ();
218
+ void pop_shader ();
235
219
 
236
220
  //
237
- // low level drawing methods
221
+ // transformation methods
238
222
  //
239
- bool begin_shape (ShapeType type);
223
+ void translate (coord x, coord y, coord z = 0);
240
224
 
241
- bool end_shape ();
225
+ void translate (const Point& value);
242
226
 
243
- bool set_color (float red, float green, float blue, float alpha = 1);
227
+ void scale (coord x, coord y, coord z = 1);
244
228
 
245
- bool set_color (const Color& color);
229
+ void scale (const Point& value);
246
230
 
247
- bool set_texture (const Texture& tex);
231
+ void rotate (float angle, coord x = 0, coord y = 0, coord z = 1);
248
232
 
249
- bool no_texture ();
233
+ void rotate (float angle, const Point& center);
250
234
 
251
- bool add_vertex (coord x, coord y);
235
+ void set_matrix (float value = 1);
252
236
 
253
- bool add_vertex (coord x, coord y, coord z);
237
+ void set_matrix (
238
+ float a1, float a2, float a3, float a4,
239
+ float b1, float b2, float b3, float b4,
240
+ float c1, float c2, float c3, float c4,
241
+ float d1, float d2, float d3, float d4);
254
242
 
255
- bool add_vertex (const Point& position);
243
+ void set_matrix (const float* elements);
256
244
 
257
- bool add_vertex (coord x, coord y, coord tex_s, coord tex_t);
245
+ void set_matrix (const Matrix& matrix);
246
+
247
+ const Matrix& matrix () const;
258
248
 
259
- bool add_vertex (coord x, coord y, coord z, coord tex_s, coord tex_t);
249
+ void push_matrix ();
260
250
 
261
- bool add_vertex (const Point& position, coord tex_s, coord tex_t);
251
+ void pop_matrix ();
262
252
 
263
253
 
264
254
  operator bool () const;
data/include/rays/point.h CHANGED
@@ -14,7 +14,11 @@ namespace Rays
14
14
  struct Point
15
15
  {
16
16
 
17
- coord x, y, z;
17
+ union
18
+ {
19
+ struct {coord x, y, z;};
20
+ coord array[3];
21
+ };
18
22
 
19
23
  Point (coord value = 0);
20
24
 
@@ -22,13 +26,49 @@ namespace Rays
22
26
 
23
27
  Point dup () const;
24
28
 
25
- Point& set (coord value = 0);
29
+ Point& reset (coord value = 0);
26
30
 
27
- Point& set (coord x, coord y, coord z = 0);
31
+ Point& reset (coord x, coord y, coord z = 0);
28
32
 
29
- coord* array ();
33
+ Point& move_to (coord x, coord y, coord z = 0);
30
34
 
31
- const coord* array () const;
35
+ Point& move_to (const Point& point);
36
+
37
+ Point& move_by (coord x, coord y, coord z = 0);
38
+
39
+ Point& move_by (const Point& point);
40
+
41
+ String inspect () const;
42
+
43
+ coord& operator [] (size_t index);
44
+
45
+ const coord& operator [] (size_t index) const;
46
+
47
+ Point operator - () const;
48
+
49
+ Point& operator += (const Point& rhs);
50
+
51
+ Point& operator -= (const Point& rhs);
52
+
53
+ Point& operator *= (const Point& rhs);
54
+
55
+ Point& operator /= (const Point& rhs);
56
+
57
+ Point& operator /= (coord rhs);
58
+
59
+ friend bool operator == (const Point& lhs, const Point& rhs);
60
+
61
+ friend bool operator != (const Point& lhs, const Point& rhs);
62
+
63
+ friend Point operator + (const Point& lhs, const Point& rhs);
64
+
65
+ friend Point operator - (const Point& lhs, const Point& rhs);
66
+
67
+ friend Point operator * (const Point& lhs, const Point& rhs);
68
+
69
+ friend Point operator / (const Point& lhs, const Point& rhs);
70
+
71
+ friend Point operator / (const Point& lhs, coord rhs);
32
72
 
33
73
  };// Point
34
74
 
data/include/rays/rays.h CHANGED
@@ -8,9 +8,9 @@ namespace Rays
8
8
  {
9
9
 
10
10
 
11
- bool init ();
11
+ void init ();
12
12
 
13
- bool fin ();
13
+ void fin ();
14
14
 
15
15
 
16
16
  }// Rays
@@ -6,6 +6,7 @@
6
6
 
7
7
  #include <rucy/rucy.h>
8
8
  #include <rucy/class.h>
9
+ #include <rucy/extension.h>
9
10
  #include <rays/bitmap.h>
10
11
 
11
12
 
@@ -20,22 +21,7 @@ namespace Rays
20
21
  }// Rays
21
22
 
22
23
 
23
- namespace Rucy
24
- {
25
-
26
-
27
- Value value (const Rays::Bitmap& obj);
28
-
29
- Value value (const Rays::Bitmap* obj);
30
-
31
- template <> inline Rays::Bitmap*
32
- value_to<Rays::Bitmap*> (Value val, bool)
33
- {
34
- return get_type_ptr<Rays::Bitmap>(val, Rays::bitmap_class());
35
- }
36
-
37
-
38
- }// Rucy
24
+ RUCY_DECLARE_VALUE_FROM_TO(Rays::Bitmap)
39
25
 
40
26
 
41
27
  #endif//EOH
@@ -6,7 +6,10 @@
6
6
 
7
7
  #include <rucy/rucy.h>
8
8
  #include <rucy/class.h>
9
+ #include <rucy/extension.h>
10
+ #include <rucy/exception.h>
9
11
  #include <rays/bounds.h>
12
+ #include <rays/ruby/point.h>
10
13
 
11
14
 
12
15
  namespace Rays
@@ -20,22 +23,7 @@ namespace Rays
20
23
  }// Rays
21
24
 
22
25
 
23
- namespace Rucy
24
- {
25
-
26
-
27
- Value value (const Rays::Bounds& obj);
28
-
29
- Value value (const Rays::Bounds* obj);
30
-
31
- template <> inline Rays::Bounds*
32
- value_to<Rays::Bounds*> (Value val, bool)
33
- {
34
- return get_type_ptr<Rays::Bounds>(val, Rays::bounds_class());
35
- }
36
-
37
-
38
- }// Rucy
26
+ RUCY_DECLARE_VALUE_FROM_TO(Rays::Bounds)
39
27
 
40
28
 
41
29
  #endif//EOH
@@ -6,6 +6,8 @@
6
6
 
7
7
  #include <rucy/rucy.h>
8
8
  #include <rucy/class.h>
9
+ #include <rucy/extension.h>
10
+ #include <rucy/exception.h>
9
11
  #include <rays/color.h>
10
12
 
11
13
 
@@ -20,22 +22,7 @@ namespace Rays
20
22
  }// Rays
21
23
 
22
24
 
23
- namespace Rucy
24
- {
25
-
26
-
27
- Value value (const Rays::Color& obj);
28
-
29
- Value value (const Rays::Color* obj);
30
-
31
- template <> inline Rays::Color*
32
- value_to<Rays::Color*> (Value val, bool)
33
- {
34
- return get_type_ptr<Rays::Color>(val, Rays::color_class());
35
- }
36
-
37
-
38
- }// Rucy
25
+ RUCY_DECLARE_VALUE_FROM_TO(Rays::Color)
39
26
 
40
27
 
41
28
  #endif//EOH
@@ -0,0 +1,27 @@
1
+ // -*- c++ -*-
2
+ #pragma once
3
+ #ifndef __RAYS_RUBY_COLOR_SPACE_H__
4
+ #define __RAYS_RUBY_COLOR_SPACE_H__
5
+
6
+
7
+ #include <rucy/rucy.h>
8
+ #include <rucy/class.h>
9
+ #include <rucy/extension.h>
10
+ #include <rays/color_space.h>
11
+
12
+
13
+ namespace Rays
14
+ {
15
+
16
+
17
+ Rucy::Class color_space_class ();
18
+ // class Rays::ColorSpace
19
+
20
+
21
+ }// Rays
22
+
23
+
24
+ RUCY_DECLARE_VALUE_FROM_TO(Rays::ColorSpace)
25
+
26
+
27
+ #endif//EOH
@@ -6,6 +6,7 @@
6
6
 
7
7
  #include <rucy/rucy.h>
8
8
  #include <rucy/class.h>
9
+ #include <rucy/extension.h>
9
10
  #include <rays/font.h>
10
11
 
11
12
 
@@ -20,22 +21,7 @@ namespace Rays
20
21
  }// Rays
21
22
 
22
23
 
23
- namespace Rucy
24
- {
25
-
26
-
27
- Value value (const Rays::Font& obj);
28
-
29
- Value value (const Rays::Font* obj);
30
-
31
- template <> inline Rays::Font*
32
- value_to<Rays::Font*> (Value val, bool)
33
- {
34
- return get_type_ptr<Rays::Font>(val, Rays::font_class());
35
- }
36
-
37
-
38
- }// Rucy
24
+ RUCY_DECLARE_VALUE_FROM_TO(Rays::Font)
39
25
 
40
26
 
41
27
  #endif//EOH
@@ -6,6 +6,7 @@
6
6
 
7
7
  #include <rucy/rucy.h>
8
8
  #include <rucy/class.h>
9
+ #include <rucy/extension.h>
9
10
  #include <rays/image.h>
10
11
 
11
12
 
@@ -20,22 +21,7 @@ namespace Rays
20
21
  }// Rays
21
22
 
22
23
 
23
- namespace Rucy
24
- {
25
-
26
-
27
- Value value (const Rays::Image& obj);
28
-
29
- Value value (const Rays::Image* obj);
30
-
31
- template <> inline Rays::Image*
32
- value_to<Rays::Image*> (Value val, bool)
33
- {
34
- return get_type_ptr<Rays::Image>(val, Rays::image_class());
35
- }
36
-
37
-
38
- }// Rucy
24
+ RUCY_DECLARE_VALUE_FROM_TO(Rays::Image)
39
25
 
40
26
 
41
27
  #endif//EOH
@@ -6,6 +6,7 @@
6
6
 
7
7
  #include <rucy/rucy.h>
8
8
  #include <rucy/class.h>
9
+ #include <rucy/extension.h>
9
10
  #include <rays/matrix.h>
10
11
 
11
12
 
@@ -20,22 +21,7 @@ namespace Rays
20
21
  }// Rays
21
22
 
22
23
 
23
- namespace Rucy
24
- {
25
-
26
-
27
- Value value (const Rays::Matrix& obj);
28
-
29
- Value value (const Rays::Matrix* obj);
30
-
31
- template <> inline Rays::Matrix*
32
- value_to<Rays::Matrix*> (Value val, bool)
33
- {
34
- return get_type_ptr<Rays::Matrix>(val, Rays::matrix_class());
35
- }
36
-
37
-
38
- }// Rucy
24
+ RUCY_DECLARE_VALUE_FROM_TO(Rays::Matrix)
39
25
 
40
26
 
41
27
  #endif//EOH
@@ -6,6 +6,7 @@
6
6
 
7
7
  #include <rucy/rucy.h>
8
8
  #include <rucy/class.h>
9
+ #include <rucy/extension.h>
9
10
  #include <rays/painter.h>
10
11
 
11
12
 
@@ -20,22 +21,7 @@ namespace Rays
20
21
  }// Rays
21
22
 
22
23
 
23
- namespace Rucy
24
- {
25
-
26
-
27
- Value value (const Rays::Painter& obj);
28
-
29
- Value value (const Rays::Painter* obj);
30
-
31
- template <> inline Rays::Painter*
32
- value_to<Rays::Painter*> (Value val, bool)
33
- {
34
- return get_type_ptr<Rays::Painter>(val, Rays::painter_class());
35
- }
36
-
37
-
38
- }// Rucy
24
+ RUCY_DECLARE_VALUE_FROM_TO(Rays::Painter)
39
25
 
40
26
 
41
27
  #endif//EOH