rays 0.1.46 → 0.1.47

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.
data/ext/rays/bitmap.cpp CHANGED
@@ -72,6 +72,264 @@ RUCY_DEF0(color_space)
72
72
  }
73
73
  RUCY_END
74
74
 
75
+ static inline Value
76
+ to_rgb_value (uint8_t r, uint8_t g, uint8_t b)
77
+ {
78
+ return value(
79
+ ((uint) r) << 16 |
80
+ ((uint) g) << 8 |
81
+ ((uint) b));
82
+ }
83
+
84
+ static inline Value
85
+ to_rgba_value (uint8_t r, uint8_t g, uint8_t b, uint8_t a)
86
+ {
87
+ return value(
88
+ ((uint) a) << 24 |
89
+ ((uint) r) << 16 |
90
+ ((uint) g) << 8 |
91
+ ((uint) b));
92
+ }
93
+
94
+ static void
95
+ get_pixels (auto* pixels, const Rays::Bitmap& bmp)
96
+ {
97
+ int w = bmp.width(), h = bmp.height();
98
+
99
+ const auto& cs = bmp.color_space();
100
+ pixels->clear();
101
+ pixels->reserve(w * h * (cs.is_float() ? cs.Bpp() / cs.Bpc() : 1));
102
+
103
+ switch (cs.type())
104
+ {
105
+ case Rays::GRAY_8:
106
+ case Rays::ALPHA_8:
107
+ for (int y = 0; y < h; ++y)
108
+ {
109
+ const auto* p = bmp.at<uint8_t>(0, y);
110
+ for (int x = 0; x < w; ++x, ++p)
111
+ pixels->push_back(value(*p));
112
+ }
113
+ break;
114
+
115
+ case Rays::GRAY_16:
116
+ case Rays::ALPHA_16:
117
+ for (int y = 0; y < h; ++y)
118
+ {
119
+ const auto* p = bmp.at<uint16_t>(0, y);
120
+ for (int x = 0; x < w; ++x, ++p)
121
+ pixels->push_back(value(*p));
122
+ }
123
+ break;
124
+
125
+ case Rays::GRAY_32:
126
+ case Rays::ALPHA_32:
127
+ for (int y = 0; y < h; ++y)
128
+ {
129
+ const auto* p = bmp.at<uint32_t>(0, y);
130
+ for (int x = 0; x < w; ++x, ++p)
131
+ pixels->push_back(value(*p));
132
+ }
133
+ break;
134
+
135
+ case Rays::GRAY_float:
136
+ case Rays::ALPHA_float:
137
+ for (int y = 0; y < h; ++y)
138
+ {
139
+ const auto* p = bmp.at<float>(0, y);
140
+ for (int x = 0; x < w; ++x, ++p)
141
+ pixels->push_back(value(*p));
142
+ }
143
+ break;
144
+
145
+ case Rays::RGB_888:
146
+ for (int y = 0; y < h; ++y)
147
+ {
148
+ const auto* p = bmp.at<uint8_t>(0, y);
149
+ for (int x = 0; x < w; ++x, p += 3)
150
+ pixels->push_back(to_rgb_value(p[0], p[1], p[2]));
151
+ }
152
+ break;
153
+
154
+ case Rays::RGBA_8888:
155
+ for (int y = 0; y < h; ++y)
156
+ {
157
+ const auto* p = bmp.at<uint8_t>(0, y);
158
+ for (int x = 0; x < w; ++x, p += 4)
159
+ pixels->push_back(to_rgba_value(p[0], p[1], p[2], p[3]));
160
+ }
161
+ break;
162
+
163
+ case Rays::RGBX_8888:
164
+ for (int y = 0; y < h; ++y)
165
+ {
166
+ const auto* p = bmp.at<uint8_t>(0, y);
167
+ for (int x = 0; x < w; ++x, p += 4)
168
+ pixels->push_back(to_rgb_value(p[0], p[1], p[2]));
169
+ }
170
+ break;
171
+
172
+ case Rays::ARGB_8888:
173
+ for (int y = 0; y < h; ++y)
174
+ {
175
+ const auto* p = bmp.at<uint8_t>(0, y);
176
+ for (int x = 0; x < w; ++x, p += 4)
177
+ pixels->push_back(to_rgba_value(p[1], p[2], p[3], p[0]));
178
+ }
179
+ break;
180
+
181
+ case Rays::XRGB_8888:
182
+ for (int y = 0; y < h; ++y)
183
+ {
184
+ const auto* p = bmp.at<uint8_t>(0, y);
185
+ for (int x = 0; x < w; ++x, p += 4)
186
+ pixels->push_back(to_rgb_value(p[1], p[2], p[3]));
187
+ }
188
+ break;
189
+
190
+ case Rays::BGR_888:
191
+ for (int y = 0; y < h; ++y)
192
+ {
193
+ const auto* p = bmp.at<uint8_t>(0, y);
194
+ for (int x = 0; x < w; ++x, p += 3)
195
+ pixels->push_back(to_rgb_value(p[2], p[1], p[0]));
196
+ }
197
+ break;
198
+
199
+ case Rays::BGRA_8888:
200
+ for (int y = 0; y < h; ++y)
201
+ {
202
+ const auto* p = bmp.at<uint8_t>(0, y);
203
+ for (int x = 0; x < w; ++x, p += 4)
204
+ pixels->push_back(to_rgba_value(p[2], p[1], p[0], p[3]));
205
+ }
206
+ break;
207
+
208
+ case Rays::BGRX_8888:
209
+ for (int y = 0; y < h; ++y)
210
+ {
211
+ const auto* p = bmp.at<uint8_t>(0, y);
212
+ for (int x = 0; x < w; ++x, p += 4)
213
+ pixels->push_back(to_rgb_value(p[2], p[1], p[0]));
214
+ }
215
+ break;
216
+
217
+ case Rays::ABGR_8888:
218
+ for (int y = 0; y < h; ++y)
219
+ {
220
+ const auto* p = bmp.at<uint8_t>(0, y);
221
+ for (int x = 0; x < w; ++x, p += 4)
222
+ pixels->push_back(to_rgba_value(p[3], p[2], p[1], p[0]));
223
+ }
224
+ break;
225
+
226
+ case Rays::XBGR_8888:
227
+ for (int y = 0; y < h; ++y)
228
+ {
229
+ const auto* p = bmp.at<uint8_t>(0, y);
230
+ for (int x = 0; x < w; ++x, p += 4)
231
+ pixels->push_back(to_rgb_value(p[3], p[2], p[1]));
232
+ }
233
+ break;
234
+
235
+ case Rays::RGB_float:
236
+ for (int y = 0; y < h; ++y)
237
+ {
238
+ const auto* p = bmp.at<uint8_t>(0, y);
239
+ for (int x = 0; x < w; ++x, p += 3)
240
+ {
241
+ pixels->push_back(value(p[0]));
242
+ pixels->push_back(value(p[1]));
243
+ pixels->push_back(value(p[2]));
244
+ }
245
+ }
246
+ break;
247
+
248
+ case Rays::RGBA_float:
249
+ for (int y = 0; y < h; ++y)
250
+ {
251
+ const auto* p = bmp.at<uint8_t>(0, y);
252
+ for (int x = 0; x < w; ++x, p += 4)
253
+ {
254
+ pixels->push_back(value(p[0]));
255
+ pixels->push_back(value(p[1]));
256
+ pixels->push_back(value(p[2]));
257
+ pixels->push_back(value(p[3]));
258
+ }
259
+ }
260
+ break;
261
+
262
+ case Rays::ARGB_float:
263
+ for (int y = 0; y < h; ++y)
264
+ {
265
+ const auto* p = bmp.at<uint8_t>(0, y);
266
+ for (int x = 0; x < w; ++x, p += 4)
267
+ {
268
+ pixels->push_back(value(p[1]));
269
+ pixels->push_back(value(p[2]));
270
+ pixels->push_back(value(p[3]));
271
+ pixels->push_back(value(p[0]));
272
+ }
273
+ }
274
+ break;
275
+
276
+ case Rays::BGR_float:
277
+ for (int y = 0; y < h; ++y)
278
+ {
279
+ const auto* p = bmp.at<uint8_t>(0, y);
280
+ for (int x = 0; x < w; ++x, p += 3)
281
+ {
282
+ pixels->push_back(value(p[2]));
283
+ pixels->push_back(value(p[1]));
284
+ pixels->push_back(value(p[0]));
285
+ }
286
+ }
287
+ break;
288
+
289
+ case Rays::BGRA_float:
290
+ for (int y = 0; y < h; ++y)
291
+ {
292
+ const auto* p = bmp.at<uint8_t>(0, y);
293
+ for (int x = 0; x < w; ++x, p += 4)
294
+ {
295
+ pixels->push_back(value(p[2]));
296
+ pixels->push_back(value(p[1]));
297
+ pixels->push_back(value(p[0]));
298
+ pixels->push_back(value(p[3]));
299
+ }
300
+ }
301
+ break;
302
+
303
+ case Rays::ABGR_float:
304
+ for (int y = 0; y < h; ++y)
305
+ {
306
+ const auto* p = bmp.at<uint8_t>(0, y);
307
+ for (int x = 0; x < w; ++x, p += 4)
308
+ {
309
+ pixels->push_back(value(p[3]));
310
+ pixels->push_back(value(p[2]));
311
+ pixels->push_back(value(p[1]));
312
+ pixels->push_back(value(p[0]));
313
+ }
314
+ }
315
+ break;
316
+
317
+ default:
318
+ argument_error(__FILE__, __LINE__);
319
+ }
320
+ }
321
+
322
+ static
323
+ RUCY_DEF0(pixels)
324
+ {
325
+ CHECK;
326
+
327
+ std::vector<VALUE> pixels;
328
+ get_pixels(&pixels, *THIS);
329
+ return value(pixels.size(), (const Value*) &pixels[0]);
330
+ }
331
+ RUCY_END
332
+
75
333
  static
76
334
  RUCY_DEF3(set_at, x, y, color)
77
335
  {
@@ -113,6 +371,7 @@ Init_rays_bitmap ()
113
371
  cBitmap.define_method("width", width);
114
372
  cBitmap.define_method("height", height);
115
373
  cBitmap.define_method("color_space", color_space);
374
+ cBitmap.define_method("pixels", pixels);
116
375
  cBitmap.define_method("[]=", set_at);
117
376
  cBitmap.define_method("[]", get_at);
118
377
  }
data/ext/rays/defs.cpp CHANGED
@@ -24,9 +24,9 @@ get_line_args (std::vector<Rays::Point>* points, int argc, const Value* argv)
24
24
  points->reserve(argc / 2);
25
25
  for (int i = 0; i < argc; i += 2)
26
26
  {
27
- coord x = to<coord>(argv[i + 0]);
28
- coord y = to<coord>(argv[i + 1]);
29
- points->emplace_back(Rays::Point(x, y));
27
+ points->emplace_back(
28
+ to<coord>(argv[i + 0]),
29
+ to<coord>(argv[i + 1]));
30
30
  }
31
31
  }
32
32
  else
data/ext/rays/painter.cpp CHANGED
@@ -129,11 +129,29 @@ RUCY_DEF0(clear)
129
129
  RUCY_END
130
130
 
131
131
  static
132
- RUCY_DEF1(polygon, poly)
132
+ RUCY_DEFN(polygon)
133
133
  {
134
134
  CHECK;
135
+ check_arg_count(__FILE__, __LINE__, "Painter#polygon", argc, 1, 3, 5);
136
+
137
+ const Rays::Polygon* polygon = to<Rays::Polygon*>(argv[0]);
138
+ if (!polygon)
139
+ argument_error(__FILE__, __LINE__, "%s is not a polygon.", argv[0].inspect().c_str());
140
+
141
+ if (argc == 1)
142
+ THIS->polygon(*polygon);
143
+ else if (argc == 3)
144
+ {
145
+ coord x = to<coord>(argv[1]), y = to<coord>(argv[2]);
146
+ THIS->polygon(*polygon, x, y);
147
+ }
148
+ else if (argc == 5)
149
+ {
150
+ coord x = to<coord>(argv[1]), w = to<coord>(argv[3]);
151
+ coord y = to<coord>(argv[2]), h = to<coord>(argv[4]);
152
+ THIS->polygon(*polygon, x, y, w, h);
153
+ }
135
154
 
136
- THIS->polygon(to<Rays::Polygon&>(poly));
137
155
  return self;
138
156
  }
139
157
  RUCY_END
@@ -393,6 +411,23 @@ RUCY_DEF0(get_stroke_width)
393
411
  }
394
412
  RUCY_END
395
413
 
414
+ static
415
+ RUCY_DEF1(set_stroke_outset, outset)
416
+ {
417
+ CHECK;
418
+ THIS->set_stroke_outset(to<float>(outset));
419
+ return self;
420
+ }
421
+ RUCY_END
422
+
423
+ static
424
+ RUCY_DEF0(get_stroke_outset)
425
+ {
426
+ CHECK;
427
+ return value(THIS->stroke_outset());
428
+ }
429
+ RUCY_END
430
+
396
431
  static
397
432
  RUCY_DEF1(set_stroke_cap, cap)
398
433
  {
@@ -698,12 +733,14 @@ Init_rays_painter ()
698
733
  cPainter.define_method( "stroke=", set_stroke);
699
734
  cPainter.define_method( "stroke", get_stroke);
700
735
  cPainter.define_method("no_stroke", no_stroke);
701
- cPainter.define_method( "stroke_width=", set_stroke_width);
702
- cPainter.define_method( "stroke_width", get_stroke_width);
703
- cPainter.define_method( "stroke_cap=", set_stroke_cap);
704
- cPainter.define_method( "stroke_cap", get_stroke_cap);
705
- cPainter.define_method( "stroke_join=", set_stroke_join);
706
- cPainter.define_method( "stroke_join", get_stroke_join);
736
+ cPainter.define_method( "stroke_width=", set_stroke_width);
737
+ cPainter.define_method( "stroke_width", get_stroke_width);
738
+ cPainter.define_method( "stroke_outset=", set_stroke_outset);
739
+ cPainter.define_method( "stroke_outset", get_stroke_outset);
740
+ cPainter.define_method( "stroke_cap=", set_stroke_cap);
741
+ cPainter.define_method( "stroke_cap", get_stroke_cap);
742
+ cPainter.define_method( "stroke_join=", set_stroke_join);
743
+ cPainter.define_method( "stroke_join", get_stroke_join);
707
744
  cPainter.define_method("miter_limit=", set_miter_limit);
708
745
  cPainter.define_method("miter_limit", get_miter_limit);
709
746
  cPainter.define_method("nsegment=", set_nsegment);
data/ext/rays/polygon.cpp CHANGED
@@ -194,6 +194,34 @@ RUCY_DEF1(op_xor, obj)
194
194
  }
195
195
  RUCY_END
196
196
 
197
+ static
198
+ RUCY_DEF1(create_points, args)
199
+ {
200
+ std::vector<Rays::Point> points;
201
+ get_line_args(&points, args.size(), args.as_array());
202
+ return value(Rays::Polygon(Rays::DRAW_POINTS, &points[0], points.size()));
203
+ }
204
+ RUCY_END
205
+
206
+ static
207
+ RUCY_DEF1(create_lines, args)
208
+ {
209
+ std::vector<Rays::Point> points;
210
+ get_line_args(&points, args.size(), args.as_array());
211
+ return value(Rays::Polygon(Rays::DRAW_LINES, &points[0], points.size()));
212
+ }
213
+ RUCY_END
214
+
215
+ static
216
+ RUCY_DEF2(create_line_strip, args, loop)
217
+ {
218
+ std::vector<Rays::Point> points;
219
+ get_line_args(&points, args.size(), args.as_array());
220
+ return value(
221
+ Rays::Polygon(Rays::DRAW_LINE_STRIP, &points[0], points.size(), loop));
222
+ }
223
+ RUCY_END
224
+
197
225
  static
198
226
  RUCY_DEF7(create_rect,
199
227
  args, round, lefttop, righttop, leftbottom, rightbottom, nsegment)
@@ -226,6 +254,55 @@ RUCY_DEF7(create_ellipse,
226
254
  }
227
255
  RUCY_END
228
256
 
257
+ static
258
+ RUCY_DEF2(create_triangles, args, loop)
259
+ {
260
+ std::vector<Rays::Point> points;
261
+ get_line_args(&points, args.size(), args.as_array());
262
+ return value(
263
+ Rays::Polygon(Rays::DRAW_TRIANGLES, &points[0], points.size(), loop));
264
+ }
265
+ RUCY_END
266
+
267
+ static
268
+ RUCY_DEF1(create_triangle_strip, args)
269
+ {
270
+ std::vector<Rays::Point> points;
271
+ get_line_args(&points, args.size(), args.as_array());
272
+ return value(
273
+ Rays::Polygon(Rays::DRAW_TRIANGLE_STRIP, &points[0], points.size()));
274
+ }
275
+ RUCY_END
276
+
277
+ static
278
+ RUCY_DEF1(create_triangle_fan, args)
279
+ {
280
+ std::vector<Rays::Point> points;
281
+ get_line_args(&points, args.size(), args.as_array());
282
+ return value(
283
+ Rays::Polygon(Rays::DRAW_TRIANGLE_FAN, &points[0], points.size()));
284
+ }
285
+ RUCY_END
286
+
287
+ static
288
+ RUCY_DEF2(create_quads, args, loop)
289
+ {
290
+ std::vector<Rays::Point> points;
291
+ get_line_args(&points, args.size(), args.as_array());
292
+ return value(
293
+ Rays::Polygon(Rays::DRAW_QUADS, &points[0], points.size(), loop));
294
+ }
295
+ RUCY_END
296
+
297
+ static
298
+ RUCY_DEF1(create_quad_strip, args)
299
+ {
300
+ std::vector<Rays::Point> points;
301
+ get_line_args(&points, args.size(), args.as_array());
302
+ return value(Rays::Polygon(Rays::DRAW_QUAD_STRIP, &points[0], points.size()));
303
+ }
304
+ RUCY_END
305
+
229
306
  static
230
307
  RUCY_DEF2(create_curve, args, loop)
231
308
  {
@@ -268,10 +345,18 @@ Init_rays_polygon ()
268
345
  cPolygon.define_method("&", op_and);
269
346
  cPolygon.define_method("|", op_or);
270
347
  cPolygon.define_method("^", op_xor);
271
- cPolygon.define_singleton_method("create_rect", create_rect);
272
- cPolygon.define_singleton_method("create_ellipse", create_ellipse);
273
- cPolygon.define_singleton_method("create_curve", create_curve);
274
- cPolygon.define_singleton_method("create_bezier", create_bezier);
348
+ cPolygon.define_singleton_method("points!", create_points);
349
+ cPolygon.define_singleton_method("lines!", create_lines);
350
+ cPolygon.define_singleton_method("line_strip!", create_line_strip);
351
+ cPolygon.define_singleton_method("rect!", create_rect);
352
+ cPolygon.define_singleton_method("ellipse!", create_ellipse);
353
+ cPolygon.define_singleton_method("triangles!", create_triangles);
354
+ cPolygon.define_singleton_method("triangle_strip!", create_triangle_strip);
355
+ cPolygon.define_singleton_method("triangle_fan!", create_triangle_fan);
356
+ cPolygon.define_singleton_method("quads!", create_quads);
357
+ cPolygon.define_singleton_method("quad_strip!", create_quad_strip);
358
+ cPolygon.define_singleton_method("curve!", create_curve);
359
+ cPolygon.define_singleton_method("bezier!", create_bezier);
275
360
  }
276
361
 
277
362
 
data/ext/rays/rays.cpp CHANGED
@@ -16,7 +16,7 @@ struct EnumType
16
16
  {
17
17
  const char* name;
18
18
  const char* short_name;
19
- T type;
19
+ T value;
20
20
  };
21
21
 
22
22
  static std::vector<EnumType<Rays::CapType>> CAP_TYPES({
@@ -72,13 +72,13 @@ Init_rays ()
72
72
  mRays.define_singleton_method("fin!", fin);
73
73
 
74
74
  for (auto it = CAP_TYPES.begin(); it != CAP_TYPES.end(); ++it)
75
- mRays.define_const(it->name, it->type);
75
+ mRays.define_const(it->name, it->value);
76
76
 
77
77
  for (auto it = JOIN_TYPES.begin(); it != JOIN_TYPES.end(); ++it)
78
- mRays.define_const(it->name, it->type);
78
+ mRays.define_const(it->name, it->value);
79
79
 
80
80
  for (auto it = BLEND_MODES.begin(); it != BLEND_MODES.end(); ++it)
81
- mRays.define_const(it->name, it->type);
81
+ mRays.define_const(it->name, it->value);
82
82
  }
83
83
 
84
84
 
@@ -102,7 +102,7 @@ namespace Rucy
102
102
  strcasecmp(str, it->name) == 0 ||
103
103
  strcasecmp(str, it->short_name) == 0)
104
104
  {
105
- return it->type;
105
+ return it->value;
106
106
  }
107
107
  }
108
108
  argument_error(__FILE__, __LINE__, "invalid cap type -- %s", str);
@@ -133,7 +133,7 @@ namespace Rucy
133
133
  strcasecmp(str, it->name) == 0 ||
134
134
  strcasecmp(str, it->short_name) == 0)
135
135
  {
136
- return it->type;
136
+ return it->value;
137
137
  }
138
138
  }
139
139
  argument_error(__FILE__, __LINE__, "invalid join type -- %s", str);
@@ -164,18 +164,18 @@ namespace Rucy
164
164
  strcasecmp(str, it->name) == 0 ||
165
165
  strcasecmp(str, it->short_name) == 0)
166
166
  {
167
- return it->type;
167
+ return it->value;
168
168
  }
169
169
  }
170
170
  argument_error(__FILE__, __LINE__, "invalid blend mode -- %s", str);
171
171
  }
172
172
  }
173
173
 
174
- int type = value_to<int>(*argv, convert);
175
- if (type < 0 || Rays::BLEND_MAX <= type)
176
- argument_error(__FILE__, __LINE__, "invalid blend mode -- %d", type);
174
+ int mode = value_to<int>(*argv, convert);
175
+ if (mode < 0 || Rays::BLEND_MAX <= mode)
176
+ argument_error(__FILE__, __LINE__, "invalid blend mode -- %d", mode);
177
177
 
178
- return (Rays::BlendMode) type;
178
+ return (Rays::BlendMode) mode;
179
179
  }
180
180
 
181
181
 
data/include/rays/defs.h CHANGED
@@ -23,6 +23,32 @@ namespace Rays
23
23
  typedef float coord;
24
24
 
25
25
 
26
+ enum DrawMode
27
+ {
28
+
29
+ DRAW_POINTS = 0,
30
+
31
+ DRAW_LINES,
32
+
33
+ DRAW_LINE_STRIP,
34
+
35
+ DRAW_TRIANGLES,
36
+
37
+ DRAW_TRIANGLE_STRIP,
38
+
39
+ DRAW_TRIANGLE_FAN,
40
+
41
+ DRAW_QUADS,
42
+
43
+ DRAW_QUAD_STRIP,
44
+
45
+ DRAW_POLYGON,
46
+
47
+ DRAW_MAX,
48
+
49
+ };// DrawMode
50
+
51
+
26
52
  enum CapType
27
53
  {
28
54
 
@@ -43,6 +43,8 @@ namespace Rays
43
43
 
44
44
  Matrix (const coord* elements, size_t size);
45
45
 
46
+ Matrix (void* null);
47
+
46
48
  This dup () const;
47
49
 
48
50
  This& reset (coord value = 1);
@@ -65,7 +65,17 @@ namespace Rays
65
65
 
66
66
  void clear ();
67
67
 
68
- void polygon (const Polygon& polygon);
68
+ void polygon (
69
+ const Polygon& polygon, coord x = 0, coord y = 0);
70
+
71
+ void polygon (
72
+ const Polygon& polygon, const Point& position);
73
+
74
+ void polygon (
75
+ const Polygon& polygon, coord x, coord y, coord width, coord height);
76
+
77
+ void polygon (
78
+ const Polygon& polygon, const Bounds& bounds);
69
79
 
70
80
  void line (coord x1, coord y1, coord x2, coord y2);
71
81
 
@@ -205,6 +215,10 @@ namespace Rays
205
215
 
206
216
  coord stroke_width () const;
207
217
 
218
+ void set_stroke_outset (float outset);
219
+
220
+ float stroke_outset () const;
221
+
208
222
  void set_stroke_cap (CapType cap);
209
223
 
210
224
  CapType stroke_cap () const;
@@ -54,7 +54,12 @@ namespace Rays
54
54
 
55
55
  Polygon ();
56
56
 
57
- Polygon (const Point* points, size_t size, bool loop = true);
57
+ Polygon (
58
+ const Point* points, size_t size, bool loop = true);
59
+
60
+ Polygon (
61
+ DrawMode mode,
62
+ const Point* points, size_t size, bool loop = true);
58
63
 
59
64
  Polygon (const Polyline& polyline);
60
65
 
@@ -31,6 +31,8 @@ namespace Rays
31
31
 
32
32
  Polyline (const Point* points, size_t size, bool loop = false);
33
33
 
34
+ Polyline (const Point* points, size_t size, bool loop, bool fill);
35
+
34
36
  ~Polyline ();
35
37
 
36
38
  bool expand (
@@ -44,6 +46,8 @@ namespace Rays
44
46
 
45
47
  bool loop () const;
46
48
 
49
+ bool fill () const;
50
+
47
51
  size_t size () const;
48
52
 
49
53
  bool empty () const;
data/lib/rays/painter.rb CHANGED
@@ -119,7 +119,7 @@ module Rays
119
119
  }
120
120
 
121
121
  universal_accessor :background, :fill, :stroke, :color,
122
- :stroke_width, :stroke_cap, :stroke_join, :miter_limit,
122
+ :stroke_width, :stroke_outset, :stroke_cap, :stroke_join, :miter_limit,
123
123
  :nsegment, :blend_mode, :shader, :clip, :font
124
124
 
125
125
  private