rays 0.3.16 → 0.5.0

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.
Files changed (90) hide show
  1. checksums.yaml +4 -4
  2. data/.doc/ext/rays/bitmap.cpp +29 -9
  3. data/.doc/ext/rays/bounds.cpp +2 -5
  4. data/.doc/ext/rays/camera.cpp +15 -7
  5. data/.doc/ext/rays/color.cpp +2 -4
  6. data/.doc/ext/rays/color_space.cpp +13 -9
  7. data/.doc/ext/rays/font.cpp +117 -22
  8. data/.doc/ext/rays/image.cpp +31 -7
  9. data/.doc/ext/rays/matrix.cpp +2 -5
  10. data/.doc/ext/rays/painter.cpp +13 -5
  11. data/.doc/ext/rays/point.cpp +2 -5
  12. data/.doc/ext/rays/polygon.cpp +15 -7
  13. data/.doc/ext/rays/polyline.cpp +15 -10
  14. data/.doc/ext/rays/rays.cpp +10 -6
  15. data/.doc/ext/rays/shader.cpp +15 -7
  16. data/.github/workflows/release-gem.yml +2 -40
  17. data/.github/workflows/tag.yml +5 -28
  18. data/.github/workflows/test.yml +1 -28
  19. data/ChangeLog.md +31 -0
  20. data/Gemfile.lock +13 -8
  21. data/Rakefile +2 -2
  22. data/VERSION +1 -1
  23. data/ext/rays/bitmap.cpp +29 -9
  24. data/ext/rays/bounds.cpp +2 -5
  25. data/ext/rays/camera.cpp +16 -7
  26. data/ext/rays/color.cpp +2 -4
  27. data/ext/rays/color_space.cpp +13 -9
  28. data/ext/rays/defs.h +3 -3
  29. data/ext/rays/extconf.rb +6 -5
  30. data/ext/rays/font.cpp +121 -22
  31. data/ext/rays/image.cpp +31 -7
  32. data/ext/rays/matrix.cpp +2 -5
  33. data/ext/rays/painter.cpp +14 -5
  34. data/ext/rays/point.cpp +2 -5
  35. data/ext/rays/polygon.cpp +16 -7
  36. data/ext/rays/polyline.cpp +16 -10
  37. data/ext/rays/rays.cpp +10 -6
  38. data/ext/rays/shader.cpp +16 -7
  39. data/include/rays/bitmap.h +3 -1
  40. data/include/rays/color_space.h +6 -2
  41. data/include/rays/defs.h +14 -4
  42. data/include/rays/font.h +46 -4
  43. data/include/rays/image.h +11 -7
  44. data/include/rays/painter.h +3 -1
  45. data/include/rays/ruby/color_space.h +2 -0
  46. data/include/rays/shader.h +3 -0
  47. data/lib/rays/camera.rb +1 -1
  48. data/lib/rays/extension.rb +1 -1
  49. data/lib/rays/font.rb +4 -1
  50. data/lib/rays/image.rb +4 -2
  51. data/lib/rays/painter.rb +5 -5
  52. data/lib/rays/polygon.rb +1 -1
  53. data/lib/rays/polyline.rb +1 -1
  54. data/lib/rays/shader.rb +1 -1
  55. data/rays.gemspec +3 -3
  56. data/src/bitmap.cpp +107 -0
  57. data/src/color.cpp +17 -0
  58. data/src/color_space.cpp +5 -5
  59. data/src/font.cpp +121 -25
  60. data/src/font.h +7 -5
  61. data/src/image.cpp +104 -102
  62. data/src/ios/bitmap.mm +3 -3
  63. data/src/ios/font.mm +79 -26
  64. data/src/opengl/bitmap.cpp +1 -1
  65. data/src/opengl/color_space.cpp +15 -3
  66. data/src/opengl/color_space.h +1 -1
  67. data/src/opengl/painter.cpp +86 -18
  68. data/src/opengl/shader.cpp +15 -13
  69. data/src/opengl/texture.cpp +7 -7
  70. data/src/opengl/win32/opengl.cpp +17 -12
  71. data/src/osx/bitmap.mm +14 -3
  72. data/src/osx/font.mm +79 -26
  73. data/src/painter.cpp +12 -12
  74. data/src/painter.h +5 -1
  75. data/src/polygon.cpp +21 -21
  76. data/src/polyline.cpp +4 -4
  77. data/src/sdl/bitmap.cpp +43 -18
  78. data/src/sdl/font.cpp +56 -50
  79. data/src/texture.h +1 -1
  80. data/src/win32/bitmap.cpp +92 -45
  81. data/src/win32/font.cpp +43 -44
  82. data/src/win32/gdi.cpp +43 -46
  83. data/src/win32/gdi.h +6 -1
  84. data/src/win32/rays.cpp +18 -1
  85. data/test/test_bitmap.rb +28 -10
  86. data/test/test_font.rb +58 -0
  87. data/test/test_image.rb +29 -6
  88. data/test/test_painter.rb +39 -0
  89. metadata +8 -8
  90. data/.github/workflows/utils.rb +0 -127
@@ -2,6 +2,7 @@
2
2
 
3
3
 
4
4
  #include <vector>
5
+ #include "rays/exception.h"
5
6
  #include "rays/ruby/point.h"
6
7
  #include "rays/ruby/bounds.h"
7
8
  #include "rays/ruby/color.h"
@@ -16,7 +17,7 @@ RUCY_DEFINE_VALUE_FROM_TO(RAYS_EXPORT, Rays::Painter)
16
17
 
17
18
  #define THIS to<Rays::Painter*>(self)
18
19
 
19
- #define CHECK RUCY_CHECK_OBJECT(Rays::Painter, self)
20
+ #define CHECK RUCY_CHECK_OBJ(Rays::Painter, self)
20
21
 
21
22
 
22
23
  static
@@ -25,6 +26,12 @@ VALUE alloc(VALUE klass)
25
26
  return new_type<Rays::Painter>(klass);
26
27
  }
27
28
 
29
+ static
30
+ VALUE initialize_copy(VALUE self, VALUE obj)
31
+ {
32
+ Rays::rays_error(__FILE__, __LINE__, "can not duplicate Painter");
33
+ }
34
+
28
35
  static
29
36
  VALUE canvas(VALUE self)
30
37
  {
@@ -155,7 +162,7 @@ VALUE point(VALUE self)
155
162
  std::vector<Rays::Point> points;
156
163
  get_points(&points, argc, argv);
157
164
 
158
- THIS->points(&points[0], points.size());
165
+ THIS->points(points.data(), points.size());
159
166
  return self;
160
167
  }
161
168
 
@@ -167,7 +174,7 @@ VALUE line(VALUE self, VALUE args, VALUE loop)
167
174
  std::vector<Rays::Point> points;
168
175
  get_points(&points, args.size(), args.as_array());
169
176
 
170
- THIS->line(&points[0], points.size(), loop);
177
+ THIS->line(points.data(), points.size(), loop);
171
178
  return self;
172
179
  }
173
180
 
@@ -225,7 +232,7 @@ VALUE curve(VALUE self, VALUE args, VALUE loop)
225
232
  std::vector<Rays::Point> points;
226
233
  get_points(&points, args.size(), args.as_array());
227
234
 
228
- THIS->curve(&points[0], points.size(), loop);
235
+ THIS->curve(points.data(), points.size(), loop);
229
236
  return self;
230
237
  }
231
238
 
@@ -240,7 +247,7 @@ VALUE bezier(VALUE self, VALUE args, VALUE loop)
240
247
  std::vector<Rays::Point> points;
241
248
  get_points(&points, args.size(), args.as_array());
242
249
 
243
- THIS->bezier(&points[0], points.size(), loop);
250
+ THIS->bezier(points.data(), points.size(), loop);
244
251
  return self;
245
252
  }
246
253
 
@@ -793,6 +800,7 @@ Init_rays_painter ()
793
800
 
794
801
  cPainter = rb_define_class_under(mRays, "Painter", rb_cObject);
795
802
  rb_define_alloc_func(cPainter, alloc);
803
+ rb_define_private_method(cPainter, "initialize_copy", RUBY_METHOD_FUNC(initialize_copy), 1);
796
804
 
797
805
  rb_define_method(cPainter, "canvas", RUBY_METHOD_FUNC(canvas), -1);
798
806
  rb_define_method(cPainter, "bounds", RUBY_METHOD_FUNC(bounds), 0);
@@ -1,7 +1,6 @@
1
1
  #include "rays/ruby/point.h"
2
2
 
3
3
 
4
- #include <assert.h>
5
4
  #include "defs.h"
6
5
 
7
6
 
@@ -9,7 +8,7 @@ RUCY_DEFINE_VALUE_OR_ARRAY_FROM_TO(RAYS_EXPORT, Rays::Point)
9
8
 
10
9
  #define THIS to<Rays::Point*>(self)
11
10
 
12
- #define CHECK RUCY_CHECK_OBJ(Rays::Point, self)
11
+ #define CHECK RUCY_CHECK_PTR(Rays::Point, self)
13
12
 
14
13
 
15
14
  static
@@ -282,14 +281,12 @@ namespace Rucy
282
281
  template <> RAYS_EXPORT Rays::Point
283
282
  value_to<Rays::Point> (int argc, const Value* argv, bool convert)
284
283
  {
285
- if (argc == 1 && argv->is_array())
284
+ if (argc == 1 && argv && argv->is_array())
286
285
  {
287
286
  argc = argv->size();
288
287
  argv = argv->as_array();
289
288
  }
290
289
 
291
- assert(argc == 0 || (argc > 0 && argv));
292
-
293
290
  if (convert)
294
291
  {
295
292
  if (argc == 0)
@@ -12,7 +12,7 @@ RUCY_DEFINE_VALUE_OR_ARRAY_FROM_TO(RAYS_EXPORT, Rays::Polygon)
12
12
 
13
13
  #define THIS to<Rays::Polygon*>(self)
14
14
 
15
- #define CHECK RUCY_CHECK_OBJECT(Rays::Polygon, self)
15
+ #define CHECK RUCY_CHECK_OBJ(Rays::Polygon, self)
16
16
 
17
17
 
18
18
  static
@@ -22,7 +22,7 @@ VALUE alloc(VALUE klass)
22
22
  }
23
23
 
24
24
  static
25
- VALUE setup(VALUE self, VALUE args, VALUE loop, VALUE colors, VALUE texcoords)
25
+ VALUE initialize(VALUE self, VALUE args, VALUE loop, VALUE colors, VALUE texcoords)
26
26
  {
27
27
  CHECK;
28
28
 
@@ -37,6 +37,13 @@ VALUE setup(VALUE self, VALUE args, VALUE loop, VALUE colors, VALUE texcoords)
37
37
  }
38
38
  }
39
39
 
40
+ static
41
+ VALUE initialize_copy(VALUE self, VALUE obj)
42
+ {
43
+ CHECK;
44
+ *THIS = to<Rays::Polygon&>(obj);
45
+ }
46
+
40
47
  static
41
48
  VALUE expand(VALUE self)
42
49
  {
@@ -98,7 +105,7 @@ VALUE each(VALUE self)
98
105
 
99
106
  Value ret = Qnil;
100
107
  for (const auto& polyline : *THIS)
101
- ret = rb_yield(value(polyline));
108
+ ret = yield(value(polyline));
102
109
  return ret;
103
110
  }
104
111
 
@@ -149,7 +156,7 @@ VALUE op_add(VALUE self, VALUE obj)
149
156
  });
150
157
  }
151
158
 
152
- return value(Rays::Polygon(&polylines[0], polylines.size()));
159
+ return value(Rays::Polygon(polylines.data(), polylines.size()));
153
160
  }
154
161
 
155
162
  static
@@ -346,7 +353,8 @@ Init_rays_polygon ()
346
353
 
347
354
  cPolygon = rb_define_class_under(mRays, "Polygon", rb_cObject);
348
355
  rb_define_alloc_func(cPolygon, alloc);
349
- rb_define_private_method(cPolygon, "setup", RUBY_METHOD_FUNC(setup), 4);
356
+ cPolygon.define_private_method("initialize!", initialize);
357
+ rb_define_private_method(cPolygon, "initialize_copy", RUBY_METHOD_FUNC(initialize_copy), 1);
350
358
  rb_define_method(cPolygon, "expand", RUBY_METHOD_FUNC(expand), -1);
351
359
  rb_define_method(cPolygon, "bounds", RUBY_METHOD_FUNC(bounds), 0);
352
360
  rb_define_method(cPolygon, "size", RUBY_METHOD_FUNC(size), 0);
@@ -394,14 +402,14 @@ namespace Rucy
394
402
  polylines.reserve(argc);
395
403
  for (int i = 0; i < argc; ++i)
396
404
  polylines.emplace_back(to<Rays::Polyline&>(argv[i]));
397
- return Rays::Polygon(&polylines[0], polylines.size());
405
+ return Rays::Polygon(polylines.data(), polylines.size());
398
406
  }
399
407
  }
400
408
  else if (argv->is_num() || argv->is_array())
401
409
  {
402
410
  std::vector<Rays::Point> points;
403
411
  get_points(&points, argc, argv);
404
- return Rays::Polygon(&points[0], points.size());
412
+ return Rays::Polygon(points.data(), points.size());
405
413
  }
406
414
  }
407
415
 
@@ -1,7 +1,6 @@
1
1
  #include "rays/ruby/polyline.h"
2
2
 
3
3
 
4
- #include <assert.h>
5
4
  #include <vector>
6
5
  #include "rays/ruby/color.h"
7
6
  #include "rays/ruby/point.h"
@@ -14,7 +13,7 @@ RUCY_DEFINE_VALUE_OR_ARRAY_FROM_TO(RAYS_EXPORT, Rays::Polyline)
14
13
 
15
14
  #define THIS to<Rays::Polyline*>(self)
16
15
 
17
- #define CHECK RUCY_CHECK_OBJECT(Rays::Polyline, self)
16
+ #define CHECK RUCY_CHECK_OBJ(Rays::Polyline, self)
18
17
 
19
18
 
20
19
  static
@@ -24,7 +23,7 @@ VALUE alloc(VALUE klass)
24
23
  }
25
24
 
26
25
  static
27
- VALUE setup(VALUE self, VALUE points, VALUE loop, VALUE fill, VALUE colors, VALUE texcoords, VALUE hole)
26
+ VALUE initialize(VALUE self, VALUE points, VALUE loop, VALUE fill, VALUE colors, VALUE texcoords, VALUE hole)
28
27
  {
29
28
  CHECK;
30
29
 
@@ -35,6 +34,13 @@ VALUE setup(VALUE self, VALUE points, VALUE loop, VALUE fill, VALUE colors, VALU
35
34
  hole);
36
35
  }
37
36
 
37
+ static
38
+ VALUE initialize_copy(VALUE self, VALUE obj)
39
+ {
40
+ CHECK;
41
+ *THIS = to<Rays::Polyline&>(obj);
42
+ }
43
+
38
44
  static
39
45
  VALUE expand(VALUE self)
40
46
  {
@@ -138,7 +144,7 @@ VALUE each_point(VALUE self)
138
144
 
139
145
  Value ret = Qnil;
140
146
  for (const auto& point : *THIS)
141
- ret = rb_yield(value(point));
147
+ ret = yield(value(point));
142
148
  return ret;
143
149
  }
144
150
 
@@ -154,7 +160,7 @@ VALUE each_color(VALUE self)
154
160
  {
155
161
  size_t size = THIS->size();
156
162
  for (size_t i = 0; i < size; ++i)
157
- ret = rb_yield(value(colors[i]));
163
+ ret = yield(value(colors[i]));
158
164
  }
159
165
  return ret;
160
166
  }
@@ -171,7 +177,7 @@ VALUE each_texcoord(VALUE self)
171
177
  {
172
178
  size_t size = THIS->size();
173
179
  for (size_t i = 0; i < size; ++i)
174
- ret = rb_yield(value(*(Rays::Point*) &texcoords[i]));
180
+ ret = yield(value(*(Rays::Point*) &texcoords[i]));
175
181
  }
176
182
  return ret;
177
183
  }
@@ -186,7 +192,8 @@ Init_rays_polyline ()
186
192
 
187
193
  cPolyline = rb_define_class_under(mRays, "Polyline", rb_cObject);
188
194
  rb_define_alloc_func(cPolyline, alloc);
189
- rb_define_private_method(cPolyline, "setup", RUBY_METHOD_FUNC(setup), 6);
195
+ cPolyline.define_private_method("initialize!", initialize);
196
+ rb_define_private_method(cPolyline, "initialize_copy", RUBY_METHOD_FUNC(initialize_copy), 1);
190
197
  rb_define_method(cPolyline, "expand", RUBY_METHOD_FUNC(expand), -1);
191
198
  rb_define_method(cPolyline, "bounds", RUBY_METHOD_FUNC(bounds), 0);
192
199
  cPolyline.define_method("loop?", is_loop);
@@ -211,8 +218,6 @@ namespace Rucy
211
218
  template <> RAYS_EXPORT Rays::Polyline
212
219
  value_to<Rays::Polyline> (int argc, const Value* argv, bool convert)
213
220
  {
214
- assert(argc == 0 || (argc > 0 && argv));
215
-
216
221
  if (convert)
217
222
  {
218
223
  if (argc <= 0)
@@ -221,7 +226,7 @@ namespace Rucy
221
226
  {
222
227
  std::vector<Rays::Point> points;
223
228
  get_points(&points, argc, argv);
224
- return Rays::Polyline(&points[0], points.size());
229
+ return Rays::Polyline(points.data(), points.size());
225
230
  }
226
231
  }
227
232
 
@@ -1,7 +1,6 @@
1
1
  #include "rays/ruby/rays.h"
2
2
 
3
3
 
4
- #include <assert.h>
5
4
  #include <vector>
6
5
  #include "defs.h"
7
6
 
@@ -112,7 +111,8 @@ namespace Rucy
112
111
  template <> RAYS_EXPORT Rays::CapType
113
112
  value_to<Rays::CapType> (int argc, const Value* argv, bool convert)
114
113
  {
115
- assert(argc > 0 && argv);
114
+ if (argc <= 0 || !argv)
115
+ argument_error(__FILE__, __LINE__);
116
116
 
117
117
  if (convert)
118
118
  {
@@ -145,7 +145,8 @@ namespace Rucy
145
145
  template <> RAYS_EXPORT Rays::JoinType
146
146
  value_to<Rays::JoinType> (int argc, const Value* argv, bool convert)
147
147
  {
148
- assert(argc > 0 && argv);
148
+ if (argc <= 0 || !argv)
149
+ argument_error(__FILE__, __LINE__);
149
150
 
150
151
  if (convert)
151
152
  {
@@ -178,7 +179,8 @@ namespace Rucy
178
179
  template <> RAYS_EXPORT Rays::BlendMode
179
180
  value_to<Rays::BlendMode> (int argc, const Value* argv, bool convert)
180
181
  {
181
- assert(argc > 0 && argv);
182
+ if (argc <= 0 || !argv)
183
+ argument_error(__FILE__, __LINE__);
182
184
 
183
185
  if (convert)
184
186
  {
@@ -211,7 +213,8 @@ namespace Rucy
211
213
  template <> RAYS_EXPORT Rays::TexCoordMode
212
214
  value_to<Rays::TexCoordMode> (int argc, const Value* argv, bool convert)
213
215
  {
214
- assert(argc > 0 && argv);
216
+ if (argc <= 0 || !argv)
217
+ argument_error(__FILE__, __LINE__);
215
218
 
216
219
  if (convert)
217
220
  {
@@ -244,7 +247,8 @@ namespace Rucy
244
247
  template <> RAYS_EXPORT Rays::TexCoordWrap
245
248
  value_to<Rays::TexCoordWrap> (int argc, const Value* argv, bool convert)
246
249
  {
247
- assert(argc > 0 && argv);
250
+ if (argc <= 0 || !argv)
251
+ argument_error(__FILE__, __LINE__);
248
252
 
249
253
  if (convert)
250
254
  {
@@ -1,7 +1,7 @@
1
1
  #include "rays/ruby/shader.h"
2
2
 
3
3
 
4
- #include <assert.h>
4
+ #include "rays/exception.h"
5
5
  #include "rays/ruby/image.h"
6
6
  #include "defs.h"
7
7
 
@@ -10,7 +10,7 @@ RUCY_DEFINE_VALUE_OR_ARRAY_FROM_TO(RAYS_EXPORT, Rays::Shader)
10
10
 
11
11
  #define THIS to<Rays::Shader*>(self)
12
12
 
13
- #define CHECK RUCY_CHECK_OBJECT(Rays::Shader, self)
13
+ #define CHECK RUCY_CHECK_OBJ(Rays::Shader, self)
14
14
 
15
15
 
16
16
  static
@@ -19,6 +19,12 @@ VALUE alloc(VALUE klass)
19
19
  return new_type<Rays::Shader>(klass);
20
20
  }
21
21
 
22
+ static
23
+ VALUE initialize_copy(VALUE self, VALUE obj)
24
+ {
25
+ Rays::rays_error(__FILE__, __LINE__, "can not duplicate Shader");
26
+ }
27
+
22
28
  static const char*
23
29
  to_name (const Value& names, size_t index)
24
30
  {
@@ -81,11 +87,11 @@ make_env (const Value& names, const Value& ignore_no_uniform_location_error)
81
87
  }
82
88
 
83
89
  static
84
- VALUE setup(VALUE self, VALUE
90
+ VALUE initialize(VALUE self, VALUE
85
91
  fragment_shader_source, VALUE vertex_shader_source, VALUE
86
92
  builtin_variable_names, VALUE ignore_no_uniform_location_error)
87
93
  {
88
- RUCY_CHECK_OBJ(Rays::Shader, self);
94
+ RUCY_CHECK_PTR(Rays::Shader, self);
89
95
 
90
96
  if (fragment_shader_source.is_nil())
91
97
  argument_error(__FILE__, __LINE__);
@@ -180,7 +186,8 @@ Init_rays_shader ()
180
186
 
181
187
  cShader = rb_define_class_under(mRays, "Shader", rb_cObject);
182
188
  rb_define_alloc_func(cShader, alloc);
183
- rb_define_private_method(cShader, "setup", RUBY_METHOD_FUNC(setup), 4);
189
+ cShader.define_private_method("initialize!", initialize);
190
+ rb_define_private_method(cShader, "initialize_copy", RUBY_METHOD_FUNC(initialize_copy), 1);
184
191
  rb_define_private_method(cShader, "set_uniform", RUBY_METHOD_FUNC(set_uniform), -1);
185
192
  rb_define_method(cShader, "vertex_shader_source", RUBY_METHOD_FUNC(get_vertex_shader_source), 0);
186
193
  rb_define_method(cShader, "fragment_shader_source", RUBY_METHOD_FUNC(get_fragment_shader_source), 0);
@@ -194,13 +201,14 @@ namespace Rucy
194
201
  template <> RAYS_EXPORT Rays::Shader
195
202
  value_to<Rays::Shader> (int argc, const Value* argv, bool convert)
196
203
  {
197
- if (argc == 1 && argv->is_array())
204
+ if (argc == 1 && argv && argv->is_array())
198
205
  {
199
206
  argc = argv->size();
200
207
  argv = argv->as_array();
201
208
  }
202
209
 
203
- assert(argc > 0 && argv);
210
+ if (argc <= 0 || !argv)
211
+ argument_error(__FILE__, __LINE__);
204
212
 
205
213
  if (convert)
206
214
  {
@@ -9,43 +9,5 @@ permissions:
9
9
 
10
10
  jobs:
11
11
  release:
12
- runs-on: macos-latest
13
-
14
- steps:
15
- - name: ruby 3.2
16
- uses: ruby/setup-ruby@v1
17
- with:
18
- ruby-version: 3.2
19
-
20
- - name: checkout
21
- uses: actions/checkout@v4
22
-
23
- - name: setup gems
24
- run: bundle install
25
-
26
- - name: setup dependencies
27
- run: "ruby -I.github/workflows -rutils -e 'setup_dependencies'"
28
-
29
- - name: test
30
- run: bundle exec rake packages test
31
-
32
- - name: create gem
33
- id: gem
34
- run: |
35
- bundle exec rake gem
36
- echo path=$(ruby -e 'print Dir.glob("*.gem").first') >> $GITHUB_OUTPUT
37
-
38
- - name: create github release
39
- env:
40
- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41
- run: ruby -I.github/workflows -rutils -e 'release(*ARGV)' ./${{ steps.gem.outputs.path }}
42
-
43
- - name: upload to rubygems
44
- env:
45
- GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_AUTH_TOKEN }}
46
- run: |
47
- mkdir -p $HOME/.gem
48
- touch $HOME/.gem/credentials
49
- chmod 0600 $HOME/.gem/credentials
50
- printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
51
- bundle exec rake upload
12
+ uses: xord/xot/.github/workflows/release-gem.yml@master
13
+ secrets: inherit
@@ -1,35 +1,12 @@
1
1
  name: Tag
2
2
 
3
3
  on:
4
- push:
4
+ workflow_run:
5
+ workflows: [Test]
6
+ types: [completed]
5
7
  branches: [master]
6
8
 
7
9
  jobs:
8
10
  tag:
9
- runs-on: ubuntu-latest
10
-
11
- steps:
12
- - name: ruby 3.2
13
- uses: ruby/setup-ruby@v1
14
- with:
15
- ruby-version: 3.2
16
-
17
- - name: checkout
18
- uses: actions/checkout@v4
19
- with:
20
- fetch-depth: 0
21
- token: ${{ secrets.PAT }}
22
-
23
- - name: setup dependencies
24
- run: "ruby -I.github/workflows -rutils -e 'setup_dependencies only: :xot'"
25
-
26
- - name: setup user name and email
27
- run: |
28
- git config --global user.email "xordog@gmail.com"
29
- git config --global user.name "xord"
30
-
31
- - name: tag versions
32
- run: "ruby -I.github/workflows -rutils -e 'tag_versions'"
33
-
34
- - name: push tags
35
- run: git push origin --tags
11
+ uses: xord/xot/.github/workflows/tag.yml@master
12
+ secrets: inherit
@@ -7,31 +7,4 @@ on:
7
7
 
8
8
  jobs:
9
9
  test:
10
- runs-on: macos-latest
11
-
12
- steps:
13
- - name: ruby 3.2
14
- uses: ruby/setup-ruby@v1
15
- with:
16
- ruby-version: 3.2
17
-
18
- - name: checkout
19
- uses: actions/checkout@v4
20
-
21
- - name: setup gems
22
- run: bundle install
23
-
24
- - name: setup dependencies
25
- run: "ruby -I.github/workflows -rutils -e 'setup_dependencies'"
26
-
27
- - name: packages
28
- run: bundle exec rake verbose packages
29
-
30
- - name: lib
31
- run: bundle exec rake verbose lib
32
-
33
- - name: ext
34
- run: bundle exec rake verbose ext
35
-
36
- - name: test
37
- run: bundle exec rake verbose test
10
+ uses: xord/xot/.github/workflows/test.yml@master
data/ChangeLog.md CHANGED
@@ -1,6 +1,37 @@
1
1
  # rays ChangeLog
2
2
 
3
3
 
4
+ ## [v0.5.0] - 2026-11-04
5
+
6
+ - [BREAKING] Store and blend alpha premultiplied on the GPU, so a fragment shader sees premultiplied samples and must emit premultiplied color
7
+ - [BREAKING] Bitmap#pixels exchanges straight alpha, not premultiplied
8
+ - [BREAKING] Size fonts in pixels on Windows, as on the other platforms
9
+ - [BREAKING] Font#name returns the name asked for, and Font#name(true) the name of the face the platform picked
10
+ - Add weight and italic to Font
11
+ - Add Font#italic? and #smooth?, and Image#smooth?
12
+ - Handle non-ASCII text and file paths on Windows
13
+ - Support High DPI on Windows
14
+ - Draw BGRA bitmaps on every platform
15
+ - Make a paint session that draws nothing cost almost nothing, and stop waiting for the GPU at its end
16
+
17
+ - Fix Font.new with no arguments sharing the default font, so that changing it changed every default font
18
+ - Fix text drawn off its baseline at a pixel density other than 1
19
+ - Fix a crash on the error paths, as loading a GIF from a missing file, on macOS
20
+ - Fix a crash in Font.families when the GC runs
21
+ - Fix an overflow of a font name longer than 31 characters on Windows
22
+ - Fix linking the extension statically on macOS
23
+
24
+
25
+ ## [v0.4.0] - 2026-08-04
26
+
27
+ - [BREAKING] Rename COLORSPACE_UNKNOWN to COLORSPACE_NONE
28
+ - [BREAKING] Default to BGRA color space on Windows
29
+ - Add pixel_density and smooth options to Image.load
30
+ - Support dup on value classes, reject it on stateful ones
31
+
32
+ - Fix crash when an empty array is passed where a Color, Point, Bounds, etc. is expected
33
+
34
+
4
35
  ## [v0.3.16] - 2026-06-23
5
36
 
6
37
  - Update dependencies
data/Gemfile.lock CHANGED
@@ -1,21 +1,26 @@
1
1
  GEM
2
2
  remote: https://rubygems.org/
3
3
  specs:
4
- power_assert (3.0.1)
5
- rake (13.3.1)
6
- test-unit (3.7.7)
4
+ power_assert (3.1.0)
5
+ rake (13.4.2)
6
+ test-unit (3.7.8)
7
7
  power_assert
8
- yard (0.9.39)
8
+ yard (0.9.45)
9
9
 
10
10
  PLATFORMS
11
- arm64-darwin-21
12
- arm64-darwin-23
13
- arm64-darwin-24
11
+ ruby
14
12
 
15
13
  DEPENDENCIES
16
14
  rake
17
15
  test-unit
18
16
  yard
19
17
 
18
+ CHECKSUMS
19
+ bundler (4.0.20) sha256=7978a8ac648767f5e635bc522445b79e80a52b907a39a36c2d8085ed6bc762ae
20
+ power_assert (3.1.0) sha256=fefe98ed5d3140628138f3f9f9194d6ece01f1320e69700d3c928adca7518251
21
+ rake (13.4.2) sha256=cb825b2bd5f1f8e91ca37bddb4b9aaf345551b4731da62949be002fa89283701
22
+ test-unit (3.7.8) sha256=689d1ca53f4d46f678b4e5d68d8e4294f87fc5e8b9238cc4de7c5727e8d65943
23
+ yard (0.9.45) sha256=52e211493f7cb8a3ebf7e104a25a1e73937a3103092545d34cb88fafebb3dc51
24
+
20
25
  BUNDLED WITH
21
- 2.4.19
26
+ 4.0.20
data/Rakefile CHANGED
@@ -37,7 +37,7 @@ use_external_library 'https://github.com/andrewwillmott/splines-lib',
37
37
  commit: '11e7240d57b0d22871aec3308186a5fcf915ba77',
38
38
  excludes: 'Test\.cpp',
39
39
  &proc {
40
- filter_file('Splines.cpp') do |cpp|
40
+ filter_file 'Splines.cpp' do |cpp|
41
41
  <<~EOS + cpp
42
42
  #include <cstdint>
43
43
  EOS
@@ -54,6 +54,6 @@ default_tasks :ext
54
54
  use_bundler
55
55
  build_native_library
56
56
  build_ruby_extension
57
- test_ruby_extension unless github_actions? && win32?
57
+ test_ruby_extension
58
58
  generate_documents
59
59
  build_ruby_gem
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.16
1
+ 0.5.0