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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4232c9c8e77b4d6e9d3a60a283934c268baade87875d0bf7ce2f6ee7f4e53aa8
4
- data.tar.gz: d8931fbc4a860a97425e56f716ac995ff5c51e5b7c2cc4bca160eda184007706
3
+ metadata.gz: d27dc838757afd56a521719cf178e3fc21accf98d1e5041c3afa8df730e998c3
4
+ data.tar.gz: 2745744e4dc2b11d5771c1deb94fa949c7d2d27a5903c2b0acca2887678330f2
5
5
  SHA512:
6
- metadata.gz: 735f49b98489b5a3da4bacb0e501b28410aa67954875185eef2515eaa90112573bee44762bbfd9d1489eaeae06f8543fb02a945d177e901eb5f33c5c90811d35
7
- data.tar.gz: ba69b4be7967c303fb8cf0cee65f804be444e7ce426c3d2ea0e337fd8a86837ac95e6011d847c238f8a6c520a81a924c8783b1476040c311080e6ac4f4b72ba8
6
+ metadata.gz: 400f74e76fd7c1db1edfee49d6a68fb7d721fec8dc8e247bc99bdee65b27688b7c6e96962f8a9c95aaa2a87ed045ab2fd0419478cb1aaf118098bf5fefbf7298
7
+ data.tar.gz: 367ed1df9b709b7c5ac7091ea1d38bbe14da8ab72d2dd049bb1c4a9acf994a45971bcef3b599525f25bdccb420ee032d8036ca58656bbc1401a2becc383a7e7a
@@ -66,6 +66,263 @@ VALUE color_space(VALUE self)
66
66
  return value(THIS->color_space());
67
67
  }
68
68
 
69
+ static inline Value
70
+ to_rgb_value (uint8_t r, uint8_t g, uint8_t b)
71
+ {
72
+ return value(
73
+ ((uint) r) << 16 |
74
+ ((uint) g) << 8 |
75
+ ((uint) b));
76
+ }
77
+
78
+ static inline Value
79
+ to_rgba_value (uint8_t r, uint8_t g, uint8_t b, uint8_t a)
80
+ {
81
+ return value(
82
+ ((uint) a) << 24 |
83
+ ((uint) r) << 16 |
84
+ ((uint) g) << 8 |
85
+ ((uint) b));
86
+ }
87
+
88
+ static void
89
+ get_pixels (auto* pixels, const Rays::Bitmap& bmp)
90
+ {
91
+ int w = bmp.width(), h = bmp.height();
92
+
93
+ const auto& cs = bmp.color_space();
94
+ pixels->clear();
95
+ pixels->reserve(w * h * (cs.is_float() ? cs.Bpp() / cs.Bpc() : 1));
96
+
97
+ switch (cs.type())
98
+ {
99
+ case Rays::GRAY_8:
100
+ case Rays::ALPHA_8:
101
+ for (int y = 0; y < h; ++y)
102
+ {
103
+ const auto* p = bmp.at<uint8_t>(0, y);
104
+ for (int x = 0; x < w; ++x, ++p)
105
+ pixels->push_back(value(*p));
106
+ }
107
+ break;
108
+
109
+ case Rays::GRAY_16:
110
+ case Rays::ALPHA_16:
111
+ for (int y = 0; y < h; ++y)
112
+ {
113
+ const auto* p = bmp.at<uint16_t>(0, y);
114
+ for (int x = 0; x < w; ++x, ++p)
115
+ pixels->push_back(value(*p));
116
+ }
117
+ break;
118
+
119
+ case Rays::GRAY_32:
120
+ case Rays::ALPHA_32:
121
+ for (int y = 0; y < h; ++y)
122
+ {
123
+ const auto* p = bmp.at<uint32_t>(0, y);
124
+ for (int x = 0; x < w; ++x, ++p)
125
+ pixels->push_back(value(*p));
126
+ }
127
+ break;
128
+
129
+ case Rays::GRAY_float:
130
+ case Rays::ALPHA_float:
131
+ for (int y = 0; y < h; ++y)
132
+ {
133
+ const auto* p = bmp.at<float>(0, y);
134
+ for (int x = 0; x < w; ++x, ++p)
135
+ pixels->push_back(value(*p));
136
+ }
137
+ break;
138
+
139
+ case Rays::RGB_888:
140
+ for (int y = 0; y < h; ++y)
141
+ {
142
+ const auto* p = bmp.at<uint8_t>(0, y);
143
+ for (int x = 0; x < w; ++x, p += 3)
144
+ pixels->push_back(to_rgb_value(p[0], p[1], p[2]));
145
+ }
146
+ break;
147
+
148
+ case Rays::RGBA_8888:
149
+ for (int y = 0; y < h; ++y)
150
+ {
151
+ const auto* p = bmp.at<uint8_t>(0, y);
152
+ for (int x = 0; x < w; ++x, p += 4)
153
+ pixels->push_back(to_rgba_value(p[0], p[1], p[2], p[3]));
154
+ }
155
+ break;
156
+
157
+ case Rays::RGBX_8888:
158
+ for (int y = 0; y < h; ++y)
159
+ {
160
+ const auto* p = bmp.at<uint8_t>(0, y);
161
+ for (int x = 0; x < w; ++x, p += 4)
162
+ pixels->push_back(to_rgb_value(p[0], p[1], p[2]));
163
+ }
164
+ break;
165
+
166
+ case Rays::ARGB_8888:
167
+ for (int y = 0; y < h; ++y)
168
+ {
169
+ const auto* p = bmp.at<uint8_t>(0, y);
170
+ for (int x = 0; x < w; ++x, p += 4)
171
+ pixels->push_back(to_rgba_value(p[1], p[2], p[3], p[0]));
172
+ }
173
+ break;
174
+
175
+ case Rays::XRGB_8888:
176
+ for (int y = 0; y < h; ++y)
177
+ {
178
+ const auto* p = bmp.at<uint8_t>(0, y);
179
+ for (int x = 0; x < w; ++x, p += 4)
180
+ pixels->push_back(to_rgb_value(p[1], p[2], p[3]));
181
+ }
182
+ break;
183
+
184
+ case Rays::BGR_888:
185
+ for (int y = 0; y < h; ++y)
186
+ {
187
+ const auto* p = bmp.at<uint8_t>(0, y);
188
+ for (int x = 0; x < w; ++x, p += 3)
189
+ pixels->push_back(to_rgb_value(p[2], p[1], p[0]));
190
+ }
191
+ break;
192
+
193
+ case Rays::BGRA_8888:
194
+ for (int y = 0; y < h; ++y)
195
+ {
196
+ const auto* p = bmp.at<uint8_t>(0, y);
197
+ for (int x = 0; x < w; ++x, p += 4)
198
+ pixels->push_back(to_rgba_value(p[2], p[1], p[0], p[3]));
199
+ }
200
+ break;
201
+
202
+ case Rays::BGRX_8888:
203
+ for (int y = 0; y < h; ++y)
204
+ {
205
+ const auto* p = bmp.at<uint8_t>(0, y);
206
+ for (int x = 0; x < w; ++x, p += 4)
207
+ pixels->push_back(to_rgb_value(p[2], p[1], p[0]));
208
+ }
209
+ break;
210
+
211
+ case Rays::ABGR_8888:
212
+ for (int y = 0; y < h; ++y)
213
+ {
214
+ const auto* p = bmp.at<uint8_t>(0, y);
215
+ for (int x = 0; x < w; ++x, p += 4)
216
+ pixels->push_back(to_rgba_value(p[3], p[2], p[1], p[0]));
217
+ }
218
+ break;
219
+
220
+ case Rays::XBGR_8888:
221
+ for (int y = 0; y < h; ++y)
222
+ {
223
+ const auto* p = bmp.at<uint8_t>(0, y);
224
+ for (int x = 0; x < w; ++x, p += 4)
225
+ pixels->push_back(to_rgb_value(p[3], p[2], p[1]));
226
+ }
227
+ break;
228
+
229
+ case Rays::RGB_float:
230
+ for (int y = 0; y < h; ++y)
231
+ {
232
+ const auto* p = bmp.at<uint8_t>(0, y);
233
+ for (int x = 0; x < w; ++x, p += 3)
234
+ {
235
+ pixels->push_back(value(p[0]));
236
+ pixels->push_back(value(p[1]));
237
+ pixels->push_back(value(p[2]));
238
+ }
239
+ }
240
+ break;
241
+
242
+ case Rays::RGBA_float:
243
+ for (int y = 0; y < h; ++y)
244
+ {
245
+ const auto* p = bmp.at<uint8_t>(0, y);
246
+ for (int x = 0; x < w; ++x, p += 4)
247
+ {
248
+ pixels->push_back(value(p[0]));
249
+ pixels->push_back(value(p[1]));
250
+ pixels->push_back(value(p[2]));
251
+ pixels->push_back(value(p[3]));
252
+ }
253
+ }
254
+ break;
255
+
256
+ case Rays::ARGB_float:
257
+ for (int y = 0; y < h; ++y)
258
+ {
259
+ const auto* p = bmp.at<uint8_t>(0, y);
260
+ for (int x = 0; x < w; ++x, p += 4)
261
+ {
262
+ pixels->push_back(value(p[1]));
263
+ pixels->push_back(value(p[2]));
264
+ pixels->push_back(value(p[3]));
265
+ pixels->push_back(value(p[0]));
266
+ }
267
+ }
268
+ break;
269
+
270
+ case Rays::BGR_float:
271
+ for (int y = 0; y < h; ++y)
272
+ {
273
+ const auto* p = bmp.at<uint8_t>(0, y);
274
+ for (int x = 0; x < w; ++x, p += 3)
275
+ {
276
+ pixels->push_back(value(p[2]));
277
+ pixels->push_back(value(p[1]));
278
+ pixels->push_back(value(p[0]));
279
+ }
280
+ }
281
+ break;
282
+
283
+ case Rays::BGRA_float:
284
+ for (int y = 0; y < h; ++y)
285
+ {
286
+ const auto* p = bmp.at<uint8_t>(0, y);
287
+ for (int x = 0; x < w; ++x, p += 4)
288
+ {
289
+ pixels->push_back(value(p[2]));
290
+ pixels->push_back(value(p[1]));
291
+ pixels->push_back(value(p[0]));
292
+ pixels->push_back(value(p[3]));
293
+ }
294
+ }
295
+ break;
296
+
297
+ case Rays::ABGR_float:
298
+ for (int y = 0; y < h; ++y)
299
+ {
300
+ const auto* p = bmp.at<uint8_t>(0, y);
301
+ for (int x = 0; x < w; ++x, p += 4)
302
+ {
303
+ pixels->push_back(value(p[3]));
304
+ pixels->push_back(value(p[2]));
305
+ pixels->push_back(value(p[1]));
306
+ pixels->push_back(value(p[0]));
307
+ }
308
+ }
309
+ break;
310
+
311
+ default:
312
+ argument_error(__FILE__, __LINE__);
313
+ }
314
+ }
315
+
316
+ static
317
+ VALUE pixels(VALUE self)
318
+ {
319
+ CHECK;
320
+
321
+ std::vector<VALUE> pixels;
322
+ get_pixels(&pixels, *THIS);
323
+ return value(pixels.size(), (const Value*) &pixels[0]);
324
+ }
325
+
69
326
  static
70
327
  VALUE set_at(VALUE self, VALUE x, VALUE y, VALUE color)
71
328
  {
@@ -105,6 +362,7 @@ Init_rays_bitmap ()
105
362
  rb_define_method(cBitmap, "width", RUBY_METHOD_FUNC(width), 0);
106
363
  rb_define_method(cBitmap, "height", RUBY_METHOD_FUNC(height), 0);
107
364
  rb_define_method(cBitmap, "color_space", RUBY_METHOD_FUNC(color_space), 0);
365
+ rb_define_method(cBitmap, "pixels", RUBY_METHOD_FUNC(pixels), 0);
108
366
  cBitmap.define_method("[]=", set_at);
109
367
  cBitmap.define_method("[]", get_at);
110
368
  }
@@ -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
@@ -121,11 +121,29 @@ VALUE clear(VALUE self)
121
121
  }
122
122
 
123
123
  static
124
- VALUE polygon(VALUE self, VALUE poly)
124
+ VALUE polygon(VALUE self)
125
125
  {
126
126
  CHECK;
127
+ check_arg_count(__FILE__, __LINE__, "Painter#polygon", argc, 1, 3, 5);
128
+
129
+ const Rays::Polygon* polygon = to<Rays::Polygon*>(argv[0]);
130
+ if (!polygon)
131
+ argument_error(__FILE__, __LINE__, "%s is not a polygon.", argv[0].inspect().c_str());
132
+
133
+ if (argc == 1)
134
+ THIS->polygon(*polygon);
135
+ else if (argc == 3)
136
+ {
137
+ coord x = to<coord>(argv[1]), y = to<coord>(argv[2]);
138
+ THIS->polygon(*polygon, x, y);
139
+ }
140
+ else if (argc == 5)
141
+ {
142
+ coord x = to<coord>(argv[1]), w = to<coord>(argv[3]);
143
+ coord y = to<coord>(argv[2]), h = to<coord>(argv[4]);
144
+ THIS->polygon(*polygon, x, y, w, h);
145
+ }
127
146
 
128
- THIS->polygon(to<Rays::Polygon&>(poly));
129
147
  return self;
130
148
  }
131
149
 
@@ -365,6 +383,21 @@ VALUE get_stroke_width(VALUE self)
365
383
  return value(THIS->stroke_width());
366
384
  }
367
385
 
386
+ static
387
+ VALUE set_stroke_outset(VALUE self, VALUE outset)
388
+ {
389
+ CHECK;
390
+ THIS->set_stroke_outset(to<float>(outset));
391
+ return self;
392
+ }
393
+
394
+ static
395
+ VALUE get_stroke_outset(VALUE self)
396
+ {
397
+ CHECK;
398
+ return value(THIS->stroke_outset());
399
+ }
400
+
368
401
  static
369
402
  VALUE set_stroke_cap(VALUE self, VALUE cap)
370
403
  {
@@ -624,7 +657,7 @@ Init_rays_painter ()
624
657
  rb_define_private_method(cPainter, "end_paint", RUBY_METHOD_FUNC(end_paint), 0);
625
658
  cPainter.define_method( "painting?", is_painting);
626
659
  rb_define_method(cPainter, "clear", RUBY_METHOD_FUNC(clear), 0);
627
- rb_define_method(cPainter, "polygon", RUBY_METHOD_FUNC(polygon), 1);
660
+ rb_define_method(cPainter, "polygon", RUBY_METHOD_FUNC(polygon), -1);
628
661
  rb_define_private_method(cPainter, "draw_line", RUBY_METHOD_FUNC(line), 2);
629
662
  rb_define_private_method(cPainter, "draw_polyline", RUBY_METHOD_FUNC(polyline), 1);
630
663
  rb_define_private_method(cPainter, "draw_rect", RUBY_METHOD_FUNC(rect), 6);
@@ -645,6 +678,8 @@ Init_rays_painter ()
645
678
  rb_define_method(cPainter, "no_stroke", RUBY_METHOD_FUNC(no_stroke), 0);
646
679
  rb_define_method(cPainter, "stroke_width=", RUBY_METHOD_FUNC(set_stroke_width), 1);
647
680
  rb_define_method(cPainter, "stroke_width", RUBY_METHOD_FUNC(get_stroke_width), 0);
681
+ rb_define_method(cPainter, "stroke_outset=", RUBY_METHOD_FUNC(set_stroke_outset), 1);
682
+ rb_define_method(cPainter, "stroke_outset", RUBY_METHOD_FUNC(get_stroke_outset), 0);
648
683
  rb_define_method(cPainter, "stroke_cap=", RUBY_METHOD_FUNC(set_stroke_cap), 1);
649
684
  rb_define_method(cPainter, "stroke_cap", RUBY_METHOD_FUNC(get_stroke_cap), 0);
650
685
  rb_define_method(cPainter, "stroke_join=", RUBY_METHOD_FUNC(set_stroke_join), 1);
@@ -182,6 +182,31 @@ VALUE op_xor(VALUE self, VALUE obj)
182
182
  return value(*THIS ^ to<Rays::Polygon&>(obj));
183
183
  }
184
184
 
185
+ static
186
+ VALUE create_points(VALUE self, VALUE args)
187
+ {
188
+ std::vector<Rays::Point> points;
189
+ get_line_args(&points, args.size(), args.as_array());
190
+ return value(Rays::Polygon(Rays::DRAW_POINTS, &points[0], points.size()));
191
+ }
192
+
193
+ static
194
+ VALUE create_lines(VALUE self, VALUE args)
195
+ {
196
+ std::vector<Rays::Point> points;
197
+ get_line_args(&points, args.size(), args.as_array());
198
+ return value(Rays::Polygon(Rays::DRAW_LINES, &points[0], points.size()));
199
+ }
200
+
201
+ static
202
+ VALUE create_line_strip(VALUE self, VALUE args, VALUE loop)
203
+ {
204
+ std::vector<Rays::Point> points;
205
+ get_line_args(&points, args.size(), args.as_array());
206
+ return value(
207
+ Rays::Polygon(Rays::DRAW_LINE_STRIP, &points[0], points.size(), loop));
208
+ }
209
+
185
210
  static
186
211
  VALUE create_rect(VALUE self, VALUE
187
212
  args, VALUE round, VALUE lefttop, VALUE righttop, VALUE leftbottom, VALUE rightbottom, VALUE nsegment)
@@ -212,6 +237,50 @@ VALUE create_ellipse(VALUE self, VALUE
212
237
  return value(Rays::create_ellipse(x, y, w, h, hole_size, from, to_, nseg));
213
238
  }
214
239
 
240
+ static
241
+ VALUE create_triangles(VALUE self, VALUE args, VALUE loop)
242
+ {
243
+ std::vector<Rays::Point> points;
244
+ get_line_args(&points, args.size(), args.as_array());
245
+ return value(
246
+ Rays::Polygon(Rays::DRAW_TRIANGLES, &points[0], points.size(), loop));
247
+ }
248
+
249
+ static
250
+ VALUE create_triangle_strip(VALUE self, VALUE args)
251
+ {
252
+ std::vector<Rays::Point> points;
253
+ get_line_args(&points, args.size(), args.as_array());
254
+ return value(
255
+ Rays::Polygon(Rays::DRAW_TRIANGLE_STRIP, &points[0], points.size()));
256
+ }
257
+
258
+ static
259
+ VALUE create_triangle_fan(VALUE self, VALUE args)
260
+ {
261
+ std::vector<Rays::Point> points;
262
+ get_line_args(&points, args.size(), args.as_array());
263
+ return value(
264
+ Rays::Polygon(Rays::DRAW_TRIANGLE_FAN, &points[0], points.size()));
265
+ }
266
+
267
+ static
268
+ VALUE create_quads(VALUE self, VALUE args, VALUE loop)
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_QUADS, &points[0], points.size(), loop));
274
+ }
275
+
276
+ static
277
+ VALUE create_quad_strip(VALUE self, VALUE args)
278
+ {
279
+ std::vector<Rays::Point> points;
280
+ get_line_args(&points, args.size(), args.as_array());
281
+ return value(Rays::Polygon(Rays::DRAW_QUAD_STRIP, &points[0], points.size()));
282
+ }
283
+
215
284
  static
216
285
  VALUE create_curve(VALUE self, VALUE args, VALUE loop)
217
286
  {
@@ -252,10 +321,18 @@ Init_rays_polygon ()
252
321
  cPolygon.define_method("&", op_and);
253
322
  cPolygon.define_method("|", op_or);
254
323
  cPolygon.define_method("^", op_xor);
255
- rb_define_singleton_method(cPolygon, "create_rect", RUBY_METHOD_FUNC(create_rect), 7);
256
- rb_define_singleton_method(cPolygon, "create_ellipse", RUBY_METHOD_FUNC(create_ellipse), 7);
257
- rb_define_singleton_method(cPolygon, "create_curve", RUBY_METHOD_FUNC(create_curve), 2);
258
- rb_define_singleton_method(cPolygon, "create_bezier", RUBY_METHOD_FUNC(create_bezier), 2);
324
+ cPolygon.define_singleton_method("points!", create_points);
325
+ cPolygon.define_singleton_method("lines!", create_lines);
326
+ cPolygon.define_singleton_method("line_strip!", create_line_strip);
327
+ cPolygon.define_singleton_method("rect!", create_rect);
328
+ cPolygon.define_singleton_method("ellipse!", create_ellipse);
329
+ cPolygon.define_singleton_method("triangles!", create_triangles);
330
+ cPolygon.define_singleton_method("triangle_strip!", create_triangle_strip);
331
+ cPolygon.define_singleton_method("triangle_fan!", create_triangle_fan);
332
+ cPolygon.define_singleton_method("quads!", create_quads);
333
+ cPolygon.define_singleton_method("quad_strip!", create_quad_strip);
334
+ cPolygon.define_singleton_method("curve!", create_curve);
335
+ cPolygon.define_singleton_method("bezier!", create_bezier);
259
336
  }
260
337
 
261
338
 
@@ -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({
@@ -70,13 +70,13 @@ Init_rays ()
70
70
  mRays.define_singleton_method("fin!", fin);
71
71
 
72
72
  for (auto it = CAP_TYPES.begin(); it != CAP_TYPES.end(); ++it)
73
- mRays.define_const(it->name, it->type);
73
+ mRays.define_const(it->name, it->value);
74
74
 
75
75
  for (auto it = JOIN_TYPES.begin(); it != JOIN_TYPES.end(); ++it)
76
- mRays.define_const(it->name, it->type);
76
+ mRays.define_const(it->name, it->value);
77
77
 
78
78
  for (auto it = BLEND_MODES.begin(); it != BLEND_MODES.end(); ++it)
79
- mRays.define_const(it->name, it->type);
79
+ mRays.define_const(it->name, it->value);
80
80
  }
81
81
 
82
82
 
@@ -100,7 +100,7 @@ namespace Rucy
100
100
  strcasecmp(str, it->name) == 0 ||
101
101
  strcasecmp(str, it->short_name) == 0)
102
102
  {
103
- return it->type;
103
+ return it->value;
104
104
  }
105
105
  }
106
106
  argument_error(__FILE__, __LINE__, "invalid cap type -- %s", str);
@@ -131,7 +131,7 @@ namespace Rucy
131
131
  strcasecmp(str, it->name) == 0 ||
132
132
  strcasecmp(str, it->short_name) == 0)
133
133
  {
134
- return it->type;
134
+ return it->value;
135
135
  }
136
136
  }
137
137
  argument_error(__FILE__, __LINE__, "invalid join type -- %s", str);
@@ -162,18 +162,18 @@ namespace Rucy
162
162
  strcasecmp(str, it->name) == 0 ||
163
163
  strcasecmp(str, it->short_name) == 0)
164
164
  {
165
- return it->type;
165
+ return it->value;
166
166
  }
167
167
  }
168
168
  argument_error(__FILE__, __LINE__, "invalid blend mode -- %s", str);
169
169
  }
170
170
  }
171
171
 
172
- int type = value_to<int>(*argv, convert);
173
- if (type < 0 || Rays::BLEND_MAX <= type)
174
- argument_error(__FILE__, __LINE__, "invalid blend mode -- %d", type);
172
+ int mode = value_to<int>(*argv, convert);
173
+ if (mode < 0 || Rays::BLEND_MAX <= mode)
174
+ argument_error(__FILE__, __LINE__, "invalid blend mode -- %d", mode);
175
175
 
176
- return (Rays::BlendMode) type;
176
+ return (Rays::BlendMode) mode;
177
177
  }
178
178
 
179
179
 
@@ -4,7 +4,6 @@ on:
4
4
  push:
5
5
  branches: [master]
6
6
  pull_request:
7
- branches: [master]
8
7
 
9
8
  jobs:
10
9
  test:
data/ChangeLog.md CHANGED
@@ -1,6 +1,21 @@
1
1
  # rays ChangeLog
2
2
 
3
3
 
4
+ ## [v0.1.47] - 2023-12-09
5
+
6
+ - Add Polygon's singleton methods: points(), lines(), triangles(), triangle_strip(), triangle_fan(), quads(), quad_strip()
7
+ - Add create_polygon(DrawMode, ...)
8
+ - Add Painter#stroke_outset
9
+ - Add Bitmap#pixels
10
+ - Use earcut.hpp for polygon triangulation and delete poly2tri
11
+ - Painter#polygon() can take x, y, width, and height
12
+ - Polygon#bounds() caches bounds
13
+ - Polygon.line() -> Polygon.line_strip()
14
+ - Rays::Polygon.new() can take DrawMode
15
+ - Matrix(nullptr) avoids initialization
16
+ - Trigger github actions on all pull_request
17
+
18
+
4
19
  ## [v0.1.46] - 2023-11-09
5
20
 
6
21
  - Use Gemfile to install gems for development instead of add_development_dependency in gemspec
data/Rakefile CHANGED
@@ -25,10 +25,10 @@ use_external_library 'https://github.com/skyrpex/clipper',
25
25
  srcdirs: 'cpp',
26
26
  excludes: 'clipper/cpp/cpp_'
27
27
 
28
- use_external_library 'https://github.com/greenm01/poly2tri',
29
- commit: '88de49021b6d9bef6faa1bc94ceb3fbd85c3c204',
30
- incdirs: 'poly2tri',
31
- srcdirs: 'poly2tri'
28
+ use_external_library 'https://github.com/mapbox/earcut.hpp',
29
+ tag: 'v2.2.4',
30
+ incdirs: 'include/mapbox',
31
+ srcdirs: 'NOSRC'
32
32
 
33
33
  use_external_library 'https://github.com/andrewwillmott/splines-lib',
34
34
  commit: '11e7240d57b0d22871aec3308186a5fcf915ba77',
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.46
1
+ 0.1.47