blend2d-bindings 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +7 -0
  2. data/ChangeLog +26 -0
  3. data/LICENSE.txt +21 -0
  4. data/README.md +41 -0
  5. data/examples/test.rb +46 -0
  6. data/examples/util/setup_blend2d.rb +46 -0
  7. data/lib/blend2d.rb +95 -0
  8. data/lib/blend2d_api.rb +255 -0
  9. data/lib/blend2d_array.rb +319 -0
  10. data/lib/blend2d_bitarray.rb +275 -0
  11. data/lib/blend2d_bitset.rb +311 -0
  12. data/lib/blend2d_context.rb +1613 -0
  13. data/lib/blend2d_filesystem.rb +211 -0
  14. data/lib/blend2d_font.rb +281 -0
  15. data/lib/blend2d_fontdata.rb +209 -0
  16. data/lib/blend2d_fontdefs.rb +552 -0
  17. data/lib/blend2d_fontface.rb +345 -0
  18. data/lib/blend2d_fontfeaturesettings.rb +210 -0
  19. data/lib/blend2d_fontmanager.rb +187 -0
  20. data/lib/blend2d_fontvariationsettings.rb +210 -0
  21. data/lib/blend2d_format.rb +112 -0
  22. data/lib/blend2d_geometry.rb +424 -0
  23. data/lib/blend2d_glyphbuffer.rb +141 -0
  24. data/lib/blend2d_glyphrun.rb +101 -0
  25. data/lib/blend2d_gradient.rb +429 -0
  26. data/lib/blend2d_image.rb +291 -0
  27. data/lib/blend2d_imagecodec.rb +219 -0
  28. data/lib/blend2d_imagedecoder.rb +168 -0
  29. data/lib/blend2d_imageencoder.rb +159 -0
  30. data/lib/blend2d_matrix.rb +132 -0
  31. data/lib/blend2d_object.rb +326 -0
  32. data/lib/blend2d_path.rb +511 -0
  33. data/lib/blend2d_pattern.rb +202 -0
  34. data/lib/blend2d_pixelconverter.rb +109 -0
  35. data/lib/blend2d_random.rb +77 -0
  36. data/lib/blend2d_rgba.rb +95 -0
  37. data/lib/blend2d_runtime.rb +259 -0
  38. data/lib/blend2d_string.rb +245 -0
  39. data/lib/blend2d_var.rb +294 -0
  40. data/lib/libblend2d.aarch64.so +0 -0
  41. data/lib/libblend2d.arm64.dylib +0 -0
  42. data/lib/libblend2d.dll +0 -0
  43. data/lib/libblend2d.x86_64.dylib +0 -0
  44. data/lib/libblend2d.x86_64.so +0 -0
  45. metadata +99 -0
@@ -0,0 +1,294 @@
1
+ # Ruby-Blend2D : Yet another Blend2D wrapper for Ruby
2
+ #
3
+ # * https://github.com/vaiorabbit/blend2d-bindings
4
+ #
5
+ # [NOTICE] Autogenerated. Do not edit.
6
+
7
+ require 'ffi'
8
+ require_relative 'blend2d_object'
9
+ require_relative 'blend2d_rgba'
10
+
11
+ module Blend2D
12
+ extend FFI::Library
13
+ # Define/Macro
14
+
15
+
16
+ # Enum
17
+
18
+
19
+ # Typedef
20
+
21
+
22
+ # Struct
23
+
24
+ class BLVarCore < FFI::Struct
25
+ layout(
26
+ :_d, BLObjectDetail,
27
+ )
28
+ def _d = self[:_d]
29
+ def _d=(v) self[:_d] = v end
30
+ def initType(type) = blVarInitType(self, type)
31
+ def initNull() = blVarInitNull(self)
32
+ def initBool(value) = blVarInitBool(self, value)
33
+ def initInt32(value) = blVarInitInt32(self, value)
34
+ def initInt64(value) = blVarInitInt64(self, value)
35
+ def initUInt32(value) = blVarInitUInt32(self, value)
36
+ def initUInt64(value) = blVarInitUInt64(self, value)
37
+ def initDouble(value) = blVarInitDouble(self, value)
38
+ def initRgba(rgba) = blVarInitRgba(self, rgba)
39
+ def initRgba32(rgba32) = blVarInitRgba32(self, rgba32)
40
+ def initRgba64(rgba64) = blVarInitRgba64(self, rgba64)
41
+ def initMove(other) = blVarInitMove(self, other)
42
+ def initWeak(other) = blVarInitWeak(self, other)
43
+ def destroy() = blVarDestroy(self)
44
+ def reset() = blVarReset(self)
45
+ def assignNull() = blVarAssignNull(self)
46
+ def assignBool(value) = blVarAssignBool(self, value)
47
+ def assignInt32(value) = blVarAssignInt32(self, value)
48
+ def assignInt64(value) = blVarAssignInt64(self, value)
49
+ def assignUInt32(value) = blVarAssignUInt32(self, value)
50
+ def assignUInt64(value) = blVarAssignUInt64(self, value)
51
+ def assignDouble(value) = blVarAssignDouble(self, value)
52
+ def assignRgba(rgba) = blVarAssignRgba(self, rgba)
53
+ def assignRgba32(rgba32) = blVarAssignRgba32(self, rgba32)
54
+ def assignRgba64(rgba64) = blVarAssignRgba64(self, rgba64)
55
+ def assignMove(other) = blVarAssignMove(self, other)
56
+ def assignWeak(other) = blVarAssignWeak(self, other)
57
+ def getType() = blVarGetType(self)
58
+ def toBool(out) = blVarToBool(self, out)
59
+ def toInt32(out) = blVarToInt32(self, out)
60
+ def toInt64(out) = blVarToInt64(self, out)
61
+ def toUInt32(out) = blVarToUInt32(self, out)
62
+ def toUInt64(out) = blVarToUInt64(self, out)
63
+ def toDouble(out) = blVarToDouble(self, out)
64
+ def toRgba(out) = blVarToRgba(self, out)
65
+ def toRgba32(out) = blVarToRgba32(self, out)
66
+ def toRgba64(out) = blVarToRgba64(self, out)
67
+ def equals(b) = blVarEquals(a, b)
68
+ def equalsNull() = blVarEqualsNull(self)
69
+ def equalsBool(value) = blVarEqualsBool(self, value)
70
+ def equalsInt64(value) = blVarEqualsInt64(self, value)
71
+ def equalsUInt64(value) = blVarEqualsUInt64(self, value)
72
+ def equalsDouble(value) = blVarEqualsDouble(self, value)
73
+ def equalsRgba(rgba) = blVarEqualsRgba(self, rgba)
74
+ def equalsRgba32(rgba32) = blVarEqualsRgba32(self, rgba32)
75
+ def equalsRgba64(rgba64) = blVarEqualsRgba64(self, rgba64)
76
+ def strictEquals(b) = blVarStrictEquals(a, b)
77
+ def self.create_as(__d_)
78
+ instance = BLVarCore.new
79
+ instance[:_d] = __d_
80
+ instance
81
+ end
82
+ end
83
+
84
+
85
+ # Function
86
+
87
+ def self.setup_var_symbols(output_error = false)
88
+ symbols = [
89
+ :blVarInitType,
90
+ :blVarInitNull,
91
+ :blVarInitBool,
92
+ :blVarInitInt32,
93
+ :blVarInitInt64,
94
+ :blVarInitUInt32,
95
+ :blVarInitUInt64,
96
+ :blVarInitDouble,
97
+ :blVarInitRgba,
98
+ :blVarInitRgba32,
99
+ :blVarInitRgba64,
100
+ :blVarInitMove,
101
+ :blVarInitWeak,
102
+ :blVarDestroy,
103
+ :blVarReset,
104
+ :blVarAssignNull,
105
+ :blVarAssignBool,
106
+ :blVarAssignInt32,
107
+ :blVarAssignInt64,
108
+ :blVarAssignUInt32,
109
+ :blVarAssignUInt64,
110
+ :blVarAssignDouble,
111
+ :blVarAssignRgba,
112
+ :blVarAssignRgba32,
113
+ :blVarAssignRgba64,
114
+ :blVarAssignMove,
115
+ :blVarAssignWeak,
116
+ :blVarGetType,
117
+ :blVarToBool,
118
+ :blVarToInt32,
119
+ :blVarToInt64,
120
+ :blVarToUInt32,
121
+ :blVarToUInt64,
122
+ :blVarToDouble,
123
+ :blVarToRgba,
124
+ :blVarToRgba32,
125
+ :blVarToRgba64,
126
+ :blVarEquals,
127
+ :blVarEqualsNull,
128
+ :blVarEqualsBool,
129
+ :blVarEqualsInt64,
130
+ :blVarEqualsUInt64,
131
+ :blVarEqualsDouble,
132
+ :blVarEqualsRgba,
133
+ :blVarEqualsRgba32,
134
+ :blVarEqualsRgba64,
135
+ :blVarStrictEquals,
136
+ ]
137
+ apis = {
138
+ :blVarInitType => :blVarInitType,
139
+ :blVarInitNull => :blVarInitNull,
140
+ :blVarInitBool => :blVarInitBool,
141
+ :blVarInitInt32 => :blVarInitInt32,
142
+ :blVarInitInt64 => :blVarInitInt64,
143
+ :blVarInitUInt32 => :blVarInitUInt32,
144
+ :blVarInitUInt64 => :blVarInitUInt64,
145
+ :blVarInitDouble => :blVarInitDouble,
146
+ :blVarInitRgba => :blVarInitRgba,
147
+ :blVarInitRgba32 => :blVarInitRgba32,
148
+ :blVarInitRgba64 => :blVarInitRgba64,
149
+ :blVarInitMove => :blVarInitMove,
150
+ :blVarInitWeak => :blVarInitWeak,
151
+ :blVarDestroy => :blVarDestroy,
152
+ :blVarReset => :blVarReset,
153
+ :blVarAssignNull => :blVarAssignNull,
154
+ :blVarAssignBool => :blVarAssignBool,
155
+ :blVarAssignInt32 => :blVarAssignInt32,
156
+ :blVarAssignInt64 => :blVarAssignInt64,
157
+ :blVarAssignUInt32 => :blVarAssignUInt32,
158
+ :blVarAssignUInt64 => :blVarAssignUInt64,
159
+ :blVarAssignDouble => :blVarAssignDouble,
160
+ :blVarAssignRgba => :blVarAssignRgba,
161
+ :blVarAssignRgba32 => :blVarAssignRgba32,
162
+ :blVarAssignRgba64 => :blVarAssignRgba64,
163
+ :blVarAssignMove => :blVarAssignMove,
164
+ :blVarAssignWeak => :blVarAssignWeak,
165
+ :blVarGetType => :blVarGetType,
166
+ :blVarToBool => :blVarToBool,
167
+ :blVarToInt32 => :blVarToInt32,
168
+ :blVarToInt64 => :blVarToInt64,
169
+ :blVarToUInt32 => :blVarToUInt32,
170
+ :blVarToUInt64 => :blVarToUInt64,
171
+ :blVarToDouble => :blVarToDouble,
172
+ :blVarToRgba => :blVarToRgba,
173
+ :blVarToRgba32 => :blVarToRgba32,
174
+ :blVarToRgba64 => :blVarToRgba64,
175
+ :blVarEquals => :blVarEquals,
176
+ :blVarEqualsNull => :blVarEqualsNull,
177
+ :blVarEqualsBool => :blVarEqualsBool,
178
+ :blVarEqualsInt64 => :blVarEqualsInt64,
179
+ :blVarEqualsUInt64 => :blVarEqualsUInt64,
180
+ :blVarEqualsDouble => :blVarEqualsDouble,
181
+ :blVarEqualsRgba => :blVarEqualsRgba,
182
+ :blVarEqualsRgba32 => :blVarEqualsRgba32,
183
+ :blVarEqualsRgba64 => :blVarEqualsRgba64,
184
+ :blVarStrictEquals => :blVarStrictEquals,
185
+ }
186
+ args = {
187
+ :blVarInitType => [:pointer, :int],
188
+ :blVarInitNull => [:pointer],
189
+ :blVarInitBool => [:pointer, :bool],
190
+ :blVarInitInt32 => [:pointer, :int],
191
+ :blVarInitInt64 => [:pointer, :long_long],
192
+ :blVarInitUInt32 => [:pointer, :uint],
193
+ :blVarInitUInt64 => [:pointer, :ulong_long],
194
+ :blVarInitDouble => [:pointer, :double],
195
+ :blVarInitRgba => [:pointer, :pointer],
196
+ :blVarInitRgba32 => [:pointer, :uint],
197
+ :blVarInitRgba64 => [:pointer, :ulong_long],
198
+ :blVarInitMove => [:pointer, :pointer],
199
+ :blVarInitWeak => [:pointer, :pointer],
200
+ :blVarDestroy => [:pointer],
201
+ :blVarReset => [:pointer],
202
+ :blVarAssignNull => [:pointer],
203
+ :blVarAssignBool => [:pointer, :bool],
204
+ :blVarAssignInt32 => [:pointer, :int],
205
+ :blVarAssignInt64 => [:pointer, :long_long],
206
+ :blVarAssignUInt32 => [:pointer, :uint],
207
+ :blVarAssignUInt64 => [:pointer, :ulong_long],
208
+ :blVarAssignDouble => [:pointer, :double],
209
+ :blVarAssignRgba => [:pointer, :pointer],
210
+ :blVarAssignRgba32 => [:pointer, :uint],
211
+ :blVarAssignRgba64 => [:pointer, :ulong_long],
212
+ :blVarAssignMove => [:pointer, :pointer],
213
+ :blVarAssignWeak => [:pointer, :pointer],
214
+ :blVarGetType => [:pointer],
215
+ :blVarToBool => [:pointer, :pointer],
216
+ :blVarToInt32 => [:pointer, :pointer],
217
+ :blVarToInt64 => [:pointer, :pointer],
218
+ :blVarToUInt32 => [:pointer, :pointer],
219
+ :blVarToUInt64 => [:pointer, :pointer],
220
+ :blVarToDouble => [:pointer, :pointer],
221
+ :blVarToRgba => [:pointer, :pointer],
222
+ :blVarToRgba32 => [:pointer, :pointer],
223
+ :blVarToRgba64 => [:pointer, :pointer],
224
+ :blVarEquals => [:pointer, :pointer],
225
+ :blVarEqualsNull => [:pointer],
226
+ :blVarEqualsBool => [:pointer, :bool],
227
+ :blVarEqualsInt64 => [:pointer, :long_long],
228
+ :blVarEqualsUInt64 => [:pointer, :ulong_long],
229
+ :blVarEqualsDouble => [:pointer, :double],
230
+ :blVarEqualsRgba => [:pointer, :pointer],
231
+ :blVarEqualsRgba32 => [:pointer, :uint],
232
+ :blVarEqualsRgba64 => [:pointer, :ulong_long],
233
+ :blVarStrictEquals => [:pointer, :pointer],
234
+ }
235
+ retvals = {
236
+ :blVarInitType => :uint,
237
+ :blVarInitNull => :uint,
238
+ :blVarInitBool => :uint,
239
+ :blVarInitInt32 => :uint,
240
+ :blVarInitInt64 => :uint,
241
+ :blVarInitUInt32 => :uint,
242
+ :blVarInitUInt64 => :uint,
243
+ :blVarInitDouble => :uint,
244
+ :blVarInitRgba => :uint,
245
+ :blVarInitRgba32 => :uint,
246
+ :blVarInitRgba64 => :uint,
247
+ :blVarInitMove => :uint,
248
+ :blVarInitWeak => :uint,
249
+ :blVarDestroy => :uint,
250
+ :blVarReset => :uint,
251
+ :blVarAssignNull => :uint,
252
+ :blVarAssignBool => :uint,
253
+ :blVarAssignInt32 => :uint,
254
+ :blVarAssignInt64 => :uint,
255
+ :blVarAssignUInt32 => :uint,
256
+ :blVarAssignUInt64 => :uint,
257
+ :blVarAssignDouble => :uint,
258
+ :blVarAssignRgba => :uint,
259
+ :blVarAssignRgba32 => :uint,
260
+ :blVarAssignRgba64 => :uint,
261
+ :blVarAssignMove => :uint,
262
+ :blVarAssignWeak => :uint,
263
+ :blVarGetType => :int,
264
+ :blVarToBool => :uint,
265
+ :blVarToInt32 => :uint,
266
+ :blVarToInt64 => :uint,
267
+ :blVarToUInt32 => :uint,
268
+ :blVarToUInt64 => :uint,
269
+ :blVarToDouble => :uint,
270
+ :blVarToRgba => :uint,
271
+ :blVarToRgba32 => :uint,
272
+ :blVarToRgba64 => :uint,
273
+ :blVarEquals => :bool,
274
+ :blVarEqualsNull => :bool,
275
+ :blVarEqualsBool => :bool,
276
+ :blVarEqualsInt64 => :bool,
277
+ :blVarEqualsUInt64 => :bool,
278
+ :blVarEqualsDouble => :bool,
279
+ :blVarEqualsRgba => :bool,
280
+ :blVarEqualsRgba32 => :bool,
281
+ :blVarEqualsRgba64 => :bool,
282
+ :blVarStrictEquals => :bool,
283
+ }
284
+ symbols.each do |sym|
285
+ begin
286
+ attach_function apis[sym], sym, args[sym], retvals[sym]
287
+ rescue FFI::NotFoundError => error
288
+ $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
289
+ end
290
+ end
291
+ end
292
+
293
+ end
294
+
Binary file
Binary file
Binary file
Binary file
Binary file
metadata ADDED
@@ -0,0 +1,99 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: blend2d-bindings
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - vaiorabbit
8
+ bindir: bin
9
+ cert_chain: []
10
+ date: 2025-01-01 00:00:00.000000000 Z
11
+ dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: ffi
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - "~>"
17
+ - !ruby/object:Gem::Version
18
+ version: '1.16'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - "~>"
24
+ - !ruby/object:Gem::Version
25
+ version: '1.16'
26
+ description: 'Ruby bindings for Blend2D ( https://github.com/blend2d/blend2d ).
27
+
28
+ '
29
+ email:
30
+ - vaiorabbit@gmail.com
31
+ executables: []
32
+ extensions: []
33
+ extra_rdoc_files: []
34
+ files:
35
+ - ChangeLog
36
+ - LICENSE.txt
37
+ - README.md
38
+ - examples/test.rb
39
+ - examples/util/setup_blend2d.rb
40
+ - lib/blend2d.rb
41
+ - lib/blend2d_api.rb
42
+ - lib/blend2d_array.rb
43
+ - lib/blend2d_bitarray.rb
44
+ - lib/blend2d_bitset.rb
45
+ - lib/blend2d_context.rb
46
+ - lib/blend2d_filesystem.rb
47
+ - lib/blend2d_font.rb
48
+ - lib/blend2d_fontdata.rb
49
+ - lib/blend2d_fontdefs.rb
50
+ - lib/blend2d_fontface.rb
51
+ - lib/blend2d_fontfeaturesettings.rb
52
+ - lib/blend2d_fontmanager.rb
53
+ - lib/blend2d_fontvariationsettings.rb
54
+ - lib/blend2d_format.rb
55
+ - lib/blend2d_geometry.rb
56
+ - lib/blend2d_glyphbuffer.rb
57
+ - lib/blend2d_glyphrun.rb
58
+ - lib/blend2d_gradient.rb
59
+ - lib/blend2d_image.rb
60
+ - lib/blend2d_imagecodec.rb
61
+ - lib/blend2d_imagedecoder.rb
62
+ - lib/blend2d_imageencoder.rb
63
+ - lib/blend2d_matrix.rb
64
+ - lib/blend2d_object.rb
65
+ - lib/blend2d_path.rb
66
+ - lib/blend2d_pattern.rb
67
+ - lib/blend2d_pixelconverter.rb
68
+ - lib/blend2d_random.rb
69
+ - lib/blend2d_rgba.rb
70
+ - lib/blend2d_runtime.rb
71
+ - lib/blend2d_string.rb
72
+ - lib/blend2d_var.rb
73
+ - lib/libblend2d.aarch64.so
74
+ - lib/libblend2d.arm64.dylib
75
+ - lib/libblend2d.dll
76
+ - lib/libblend2d.x86_64.dylib
77
+ - lib/libblend2d.x86_64.so
78
+ homepage: https://github.com/vaiorabbit/blend2d-bindings
79
+ licenses:
80
+ - Zlib
81
+ metadata: {}
82
+ rdoc_options: []
83
+ require_paths:
84
+ - lib
85
+ required_ruby_version: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: 3.0.0
90
+ required_rubygems_version: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ version: '0'
95
+ requirements: []
96
+ rubygems_version: 3.6.2
97
+ specification_version: 4
98
+ summary: Ruby bindings for Blend2d
99
+ test_files: []