@viritura/score-engine 0.2.1-next.34 → 0.2.1-next.36
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.
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/wasm/viritura_wasm.js +331 -177
- package/dist/wasm/viritura_wasm_bg.wasm +0 -0
- package/package.json +1 -1
|
@@ -39,25 +39,35 @@ export class LayoutEngine {
|
|
|
39
39
|
* @returns {string}
|
|
40
40
|
*/
|
|
41
41
|
apply_patch_and_layout(patch_json, spatium, page_width, page_setup_json, score_index) {
|
|
42
|
-
let
|
|
43
|
-
let
|
|
42
|
+
let deferred7_0;
|
|
43
|
+
let deferred7_1;
|
|
44
44
|
try {
|
|
45
|
-
const
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
45
|
+
const val3 = +spatium;
|
|
46
|
+
const val4 = +page_width;
|
|
47
|
+
const val5 = +(isLikeNone(score_index) ? Number.MAX_SAFE_INTEGER : (score_index) >>> 0);
|
|
48
|
+
let ptr0, len0, ptr1, len1;
|
|
49
|
+
try {
|
|
50
|
+
ptr0 = passStringToWasm0(patch_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
51
|
+
len0 = WASM_VECTOR_LEN;
|
|
52
|
+
ptr1 = isLikeNone(page_setup_json) ? 0 : passStringToWasm0(page_setup_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
53
|
+
len1 = WASM_VECTOR_LEN;
|
|
54
|
+
} catch (e) {
|
|
55
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
56
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
57
|
+
throw e;
|
|
58
|
+
}
|
|
59
|
+
const ret = wasm.layoutengine_apply_patch_and_layout(this.__wbg_ptr, ptr0, len0, val3, val4, ptr1, len1, val5);
|
|
60
|
+
var ptr6 = ret[0];
|
|
61
|
+
var len6 = ret[1];
|
|
52
62
|
if (ret[3]) {
|
|
53
|
-
|
|
63
|
+
ptr6 = 0; len6 = 0;
|
|
54
64
|
throw takeFromExternrefTable0(ret[2]);
|
|
55
65
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
return getStringFromWasm0(
|
|
66
|
+
deferred7_0 = ptr6;
|
|
67
|
+
deferred7_1 = len6;
|
|
68
|
+
return getStringFromWasm0(ptr6, len6);
|
|
59
69
|
} finally {
|
|
60
|
-
wasm.__wbindgen_free(
|
|
70
|
+
wasm.__wbindgen_free(deferred7_0, deferred7_1, 1);
|
|
61
71
|
}
|
|
62
72
|
}
|
|
63
73
|
/**
|
|
@@ -70,11 +80,21 @@ export class LayoutEngine {
|
|
|
70
80
|
* @returns {Float32Array}
|
|
71
81
|
*/
|
|
72
82
|
apply_patch_and_layout_binary(patch_json, spatium, page_width, page_setup_json, score_index) {
|
|
73
|
-
const
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
83
|
+
const val3 = +spatium;
|
|
84
|
+
const val4 = +page_width;
|
|
85
|
+
const val5 = +(isLikeNone(score_index) ? Number.MAX_SAFE_INTEGER : (score_index) >>> 0);
|
|
86
|
+
let ptr0, len0, ptr1, len1;
|
|
87
|
+
try {
|
|
88
|
+
ptr0 = passStringToWasm0(patch_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
89
|
+
len0 = WASM_VECTOR_LEN;
|
|
90
|
+
ptr1 = isLikeNone(page_setup_json) ? 0 : passStringToWasm0(page_setup_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
91
|
+
len1 = WASM_VECTOR_LEN;
|
|
92
|
+
} catch (e) {
|
|
93
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
94
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
95
|
+
throw e;
|
|
96
|
+
}
|
|
97
|
+
const ret = wasm.layoutengine_apply_patch_and_layout_binary(this.__wbg_ptr, ptr0, len0, val3, val4, ptr1, len1, val5);
|
|
78
98
|
if (ret[2]) {
|
|
79
99
|
throw takeFromExternrefTable0(ret[1]);
|
|
80
100
|
}
|
|
@@ -100,11 +120,21 @@ export class LayoutEngine {
|
|
|
100
120
|
* @returns {Float32Array}
|
|
101
121
|
*/
|
|
102
122
|
apply_patch_and_layout_patch_frame_binary(patch_json, spatium, page_width, page_setup_json, score_index) {
|
|
103
|
-
const
|
|
104
|
-
const
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
123
|
+
const val3 = +spatium;
|
|
124
|
+
const val4 = +page_width;
|
|
125
|
+
const val5 = +(isLikeNone(score_index) ? Number.MAX_SAFE_INTEGER : (score_index) >>> 0);
|
|
126
|
+
let ptr0, len0, ptr1, len1;
|
|
127
|
+
try {
|
|
128
|
+
ptr0 = passStringToWasm0(patch_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
129
|
+
len0 = WASM_VECTOR_LEN;
|
|
130
|
+
ptr1 = isLikeNone(page_setup_json) ? 0 : passStringToWasm0(page_setup_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
131
|
+
len1 = WASM_VECTOR_LEN;
|
|
132
|
+
} catch (e) {
|
|
133
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
134
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
135
|
+
throw e;
|
|
136
|
+
}
|
|
137
|
+
const ret = wasm.layoutengine_apply_patch_and_layout_patch_frame_binary(this.__wbg_ptr, ptr0, len0, val3, val4, ptr1, len1, val5);
|
|
108
138
|
if (ret[2]) {
|
|
109
139
|
throw takeFromExternrefTable0(ret[1]);
|
|
110
140
|
}
|
|
@@ -131,25 +161,35 @@ export class LayoutEngine {
|
|
|
131
161
|
* @returns {string}
|
|
132
162
|
*/
|
|
133
163
|
compute_full_score_layout_cached(mnx_json, spatium, page_width, page_setup_json, score_index) {
|
|
134
|
-
let
|
|
135
|
-
let
|
|
164
|
+
let deferred7_0;
|
|
165
|
+
let deferred7_1;
|
|
136
166
|
try {
|
|
137
|
-
const
|
|
138
|
-
const
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
167
|
+
const val3 = +spatium;
|
|
168
|
+
const val4 = +page_width;
|
|
169
|
+
const val5 = +(isLikeNone(score_index) ? Number.MAX_SAFE_INTEGER : (score_index) >>> 0);
|
|
170
|
+
let ptr0, len0, ptr1, len1;
|
|
171
|
+
try {
|
|
172
|
+
ptr0 = passStringToWasm0(mnx_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
173
|
+
len0 = WASM_VECTOR_LEN;
|
|
174
|
+
ptr1 = isLikeNone(page_setup_json) ? 0 : passStringToWasm0(page_setup_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
175
|
+
len1 = WASM_VECTOR_LEN;
|
|
176
|
+
} catch (e) {
|
|
177
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
178
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
179
|
+
throw e;
|
|
180
|
+
}
|
|
181
|
+
const ret = wasm.layoutengine_compute_full_score_layout_cached(this.__wbg_ptr, ptr0, len0, val3, val4, ptr1, len1, val5);
|
|
182
|
+
var ptr6 = ret[0];
|
|
183
|
+
var len6 = ret[1];
|
|
144
184
|
if (ret[3]) {
|
|
145
|
-
|
|
185
|
+
ptr6 = 0; len6 = 0;
|
|
146
186
|
throw takeFromExternrefTable0(ret[2]);
|
|
147
187
|
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
return getStringFromWasm0(
|
|
188
|
+
deferred7_0 = ptr6;
|
|
189
|
+
deferred7_1 = len6;
|
|
190
|
+
return getStringFromWasm0(ptr6, len6);
|
|
151
191
|
} finally {
|
|
152
|
-
wasm.__wbindgen_free(
|
|
192
|
+
wasm.__wbindgen_free(deferred7_0, deferred7_1, 1);
|
|
153
193
|
}
|
|
154
194
|
}
|
|
155
195
|
/**
|
|
@@ -165,11 +205,21 @@ export class LayoutEngine {
|
|
|
165
205
|
* @returns {Float32Array}
|
|
166
206
|
*/
|
|
167
207
|
compute_full_score_layout_cached_binary(mnx_json, spatium, page_width, page_setup_json, score_index) {
|
|
168
|
-
const
|
|
169
|
-
const
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
208
|
+
const val3 = +spatium;
|
|
209
|
+
const val4 = +page_width;
|
|
210
|
+
const val5 = +(isLikeNone(score_index) ? Number.MAX_SAFE_INTEGER : (score_index) >>> 0);
|
|
211
|
+
let ptr0, len0, ptr1, len1;
|
|
212
|
+
try {
|
|
213
|
+
ptr0 = passStringToWasm0(mnx_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
214
|
+
len0 = WASM_VECTOR_LEN;
|
|
215
|
+
ptr1 = isLikeNone(page_setup_json) ? 0 : passStringToWasm0(page_setup_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
216
|
+
len1 = WASM_VECTOR_LEN;
|
|
217
|
+
} catch (e) {
|
|
218
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
219
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
220
|
+
throw e;
|
|
221
|
+
}
|
|
222
|
+
const ret = wasm.layoutengine_compute_full_score_layout_cached_binary(this.__wbg_ptr, ptr0, len0, val3, val4, ptr1, len1, val5);
|
|
173
223
|
if (ret[2]) {
|
|
174
224
|
throw takeFromExternrefTable0(ret[1]);
|
|
175
225
|
}
|
|
@@ -186,25 +236,35 @@ export class LayoutEngine {
|
|
|
186
236
|
* @returns {string}
|
|
187
237
|
*/
|
|
188
238
|
compute_layout_cached(mnx_json, part_index, spatium, page_width, page_setup_json) {
|
|
189
|
-
let
|
|
190
|
-
let
|
|
239
|
+
let deferred7_0;
|
|
240
|
+
let deferred7_1;
|
|
191
241
|
try {
|
|
192
|
-
const
|
|
193
|
-
const
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
242
|
+
const val3 = +part_index;
|
|
243
|
+
const val4 = +spatium;
|
|
244
|
+
const val5 = +page_width;
|
|
245
|
+
let ptr0, len0, ptr1, len1;
|
|
246
|
+
try {
|
|
247
|
+
ptr0 = passStringToWasm0(mnx_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
248
|
+
len0 = WASM_VECTOR_LEN;
|
|
249
|
+
ptr1 = isLikeNone(page_setup_json) ? 0 : passStringToWasm0(page_setup_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
250
|
+
len1 = WASM_VECTOR_LEN;
|
|
251
|
+
} catch (e) {
|
|
252
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
253
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
254
|
+
throw e;
|
|
255
|
+
}
|
|
256
|
+
const ret = wasm.layoutengine_compute_layout_cached(this.__wbg_ptr, ptr0, len0, val3, val4, val5, ptr1, len1);
|
|
257
|
+
var ptr6 = ret[0];
|
|
258
|
+
var len6 = ret[1];
|
|
199
259
|
if (ret[3]) {
|
|
200
|
-
|
|
260
|
+
ptr6 = 0; len6 = 0;
|
|
201
261
|
throw takeFromExternrefTable0(ret[2]);
|
|
202
262
|
}
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
return getStringFromWasm0(
|
|
263
|
+
deferred7_0 = ptr6;
|
|
264
|
+
deferred7_1 = len6;
|
|
265
|
+
return getStringFromWasm0(ptr6, len6);
|
|
206
266
|
} finally {
|
|
207
|
-
wasm.__wbindgen_free(
|
|
267
|
+
wasm.__wbindgen_free(deferred7_0, deferred7_1, 1);
|
|
208
268
|
}
|
|
209
269
|
}
|
|
210
270
|
/**
|
|
@@ -217,25 +277,35 @@ export class LayoutEngine {
|
|
|
217
277
|
* @returns {string}
|
|
218
278
|
*/
|
|
219
279
|
full_layout(mnx_json, spatium, page_width, page_setup_json, score_index) {
|
|
220
|
-
let
|
|
221
|
-
let
|
|
280
|
+
let deferred7_0;
|
|
281
|
+
let deferred7_1;
|
|
222
282
|
try {
|
|
223
|
-
const
|
|
224
|
-
const
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
283
|
+
const val3 = +spatium;
|
|
284
|
+
const val4 = +page_width;
|
|
285
|
+
const val5 = +(isLikeNone(score_index) ? Number.MAX_SAFE_INTEGER : (score_index) >>> 0);
|
|
286
|
+
let ptr0, len0, ptr1, len1;
|
|
287
|
+
try {
|
|
288
|
+
ptr0 = passStringToWasm0(mnx_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
289
|
+
len0 = WASM_VECTOR_LEN;
|
|
290
|
+
ptr1 = isLikeNone(page_setup_json) ? 0 : passStringToWasm0(page_setup_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
291
|
+
len1 = WASM_VECTOR_LEN;
|
|
292
|
+
} catch (e) {
|
|
293
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
294
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
295
|
+
throw e;
|
|
296
|
+
}
|
|
297
|
+
const ret = wasm.layoutengine_full_layout(this.__wbg_ptr, ptr0, len0, val3, val4, ptr1, len1, val5);
|
|
298
|
+
var ptr6 = ret[0];
|
|
299
|
+
var len6 = ret[1];
|
|
230
300
|
if (ret[3]) {
|
|
231
|
-
|
|
301
|
+
ptr6 = 0; len6 = 0;
|
|
232
302
|
throw takeFromExternrefTable0(ret[2]);
|
|
233
303
|
}
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
return getStringFromWasm0(
|
|
304
|
+
deferred7_0 = ptr6;
|
|
305
|
+
deferred7_1 = len6;
|
|
306
|
+
return getStringFromWasm0(ptr6, len6);
|
|
237
307
|
} finally {
|
|
238
|
-
wasm.__wbindgen_free(
|
|
308
|
+
wasm.__wbindgen_free(deferred7_0, deferred7_1, 1);
|
|
239
309
|
}
|
|
240
310
|
}
|
|
241
311
|
/**
|
|
@@ -295,23 +365,26 @@ export class LayoutEngine {
|
|
|
295
365
|
* @returns {string}
|
|
296
366
|
*/
|
|
297
367
|
relayout_retained_score_cached(spatium, page_width, page_setup_json, score_index) {
|
|
298
|
-
let
|
|
299
|
-
let
|
|
368
|
+
let deferred6_0;
|
|
369
|
+
let deferred6_1;
|
|
300
370
|
try {
|
|
371
|
+
const val2 = +spatium;
|
|
372
|
+
const val3 = +page_width;
|
|
373
|
+
const val4 = +(isLikeNone(score_index) ? Number.MAX_SAFE_INTEGER : (score_index) >>> 0);
|
|
301
374
|
var ptr0 = isLikeNone(page_setup_json) ? 0 : passStringToWasm0(page_setup_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
302
375
|
var len0 = WASM_VECTOR_LEN;
|
|
303
|
-
const ret = wasm.layoutengine_relayout_retained_score_cached(this.__wbg_ptr,
|
|
304
|
-
var
|
|
305
|
-
var
|
|
376
|
+
const ret = wasm.layoutengine_relayout_retained_score_cached(this.__wbg_ptr, val2, val3, ptr0, len0, val4);
|
|
377
|
+
var ptr5 = ret[0];
|
|
378
|
+
var len5 = ret[1];
|
|
306
379
|
if (ret[3]) {
|
|
307
|
-
|
|
380
|
+
ptr5 = 0; len5 = 0;
|
|
308
381
|
throw takeFromExternrefTable0(ret[2]);
|
|
309
382
|
}
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
return getStringFromWasm0(
|
|
383
|
+
deferred6_0 = ptr5;
|
|
384
|
+
deferred6_1 = len5;
|
|
385
|
+
return getStringFromWasm0(ptr5, len5);
|
|
313
386
|
} finally {
|
|
314
|
-
wasm.__wbindgen_free(
|
|
387
|
+
wasm.__wbindgen_free(deferred6_0, deferred6_1, 1);
|
|
315
388
|
}
|
|
316
389
|
}
|
|
317
390
|
/**
|
|
@@ -325,9 +398,12 @@ export class LayoutEngine {
|
|
|
325
398
|
* @returns {Float32Array}
|
|
326
399
|
*/
|
|
327
400
|
relayout_retained_score_cached_binary(spatium, page_width, page_setup_json, score_index) {
|
|
401
|
+
const val2 = +spatium;
|
|
402
|
+
const val3 = +page_width;
|
|
403
|
+
const val4 = +(isLikeNone(score_index) ? Number.MAX_SAFE_INTEGER : (score_index) >>> 0);
|
|
328
404
|
var ptr0 = isLikeNone(page_setup_json) ? 0 : passStringToWasm0(page_setup_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
329
405
|
var len0 = WASM_VECTOR_LEN;
|
|
330
|
-
const ret = wasm.layoutengine_relayout_retained_score_cached_binary(this.__wbg_ptr,
|
|
406
|
+
const ret = wasm.layoutengine_relayout_retained_score_cached_binary(this.__wbg_ptr, val2, val3, ptr0, len0, val4);
|
|
331
407
|
if (ret[2]) {
|
|
332
408
|
throw takeFromExternrefTable0(ret[1]);
|
|
333
409
|
}
|
|
@@ -373,25 +449,34 @@ if (Symbol.dispose) LayoutEngine.prototype[Symbol.dispose] = LayoutEngine.protot
|
|
|
373
449
|
* @returns {string}
|
|
374
450
|
*/
|
|
375
451
|
export function compute_full_score_layout(mnx_json, spatium, page_width, page_setup_json) {
|
|
376
|
-
let
|
|
377
|
-
let
|
|
452
|
+
let deferred6_0;
|
|
453
|
+
let deferred6_1;
|
|
378
454
|
try {
|
|
379
|
-
const
|
|
380
|
-
const
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
455
|
+
const val3 = +spatium;
|
|
456
|
+
const val4 = +page_width;
|
|
457
|
+
let ptr0, len0, ptr1, len1;
|
|
458
|
+
try {
|
|
459
|
+
ptr0 = passStringToWasm0(mnx_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
460
|
+
len0 = WASM_VECTOR_LEN;
|
|
461
|
+
ptr1 = isLikeNone(page_setup_json) ? 0 : passStringToWasm0(page_setup_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
462
|
+
len1 = WASM_VECTOR_LEN;
|
|
463
|
+
} catch (e) {
|
|
464
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
465
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
466
|
+
throw e;
|
|
467
|
+
}
|
|
468
|
+
const ret = wasm.compute_full_score_layout(ptr0, len0, val3, val4, ptr1, len1);
|
|
469
|
+
var ptr5 = ret[0];
|
|
470
|
+
var len5 = ret[1];
|
|
386
471
|
if (ret[3]) {
|
|
387
|
-
|
|
472
|
+
ptr5 = 0; len5 = 0;
|
|
388
473
|
throw takeFromExternrefTable0(ret[2]);
|
|
389
474
|
}
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
return getStringFromWasm0(
|
|
475
|
+
deferred6_0 = ptr5;
|
|
476
|
+
deferred6_1 = len5;
|
|
477
|
+
return getStringFromWasm0(ptr5, len5);
|
|
393
478
|
} finally {
|
|
394
|
-
wasm.__wbindgen_free(
|
|
479
|
+
wasm.__wbindgen_free(deferred6_0, deferred6_1, 1);
|
|
395
480
|
}
|
|
396
481
|
}
|
|
397
482
|
|
|
@@ -404,11 +489,20 @@ export function compute_full_score_layout(mnx_json, spatium, page_width, page_se
|
|
|
404
489
|
* @returns {Float32Array}
|
|
405
490
|
*/
|
|
406
491
|
export function compute_full_score_layout_binary(mnx_json, spatium, page_width, page_setup_json) {
|
|
407
|
-
const
|
|
408
|
-
const
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
492
|
+
const val3 = +spatium;
|
|
493
|
+
const val4 = +page_width;
|
|
494
|
+
let ptr0, len0, ptr1, len1;
|
|
495
|
+
try {
|
|
496
|
+
ptr0 = passStringToWasm0(mnx_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
497
|
+
len0 = WASM_VECTOR_LEN;
|
|
498
|
+
ptr1 = isLikeNone(page_setup_json) ? 0 : passStringToWasm0(page_setup_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
499
|
+
len1 = WASM_VECTOR_LEN;
|
|
500
|
+
} catch (e) {
|
|
501
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
502
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
503
|
+
throw e;
|
|
504
|
+
}
|
|
505
|
+
const ret = wasm.compute_full_score_layout_binary(ptr0, len0, val3, val4, ptr1, len1);
|
|
412
506
|
if (ret[2]) {
|
|
413
507
|
throw takeFromExternrefTable0(ret[1]);
|
|
414
508
|
}
|
|
@@ -425,25 +519,35 @@ export function compute_full_score_layout_binary(mnx_json, spatium, page_width,
|
|
|
425
519
|
* @returns {string}
|
|
426
520
|
*/
|
|
427
521
|
export function compute_layout(mnx_json, part_index, spatium, page_width, page_setup_json) {
|
|
428
|
-
let
|
|
429
|
-
let
|
|
522
|
+
let deferred7_0;
|
|
523
|
+
let deferred7_1;
|
|
430
524
|
try {
|
|
431
|
-
const
|
|
432
|
-
const
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
525
|
+
const val3 = +part_index;
|
|
526
|
+
const val4 = +spatium;
|
|
527
|
+
const val5 = +page_width;
|
|
528
|
+
let ptr0, len0, ptr1, len1;
|
|
529
|
+
try {
|
|
530
|
+
ptr0 = passStringToWasm0(mnx_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
531
|
+
len0 = WASM_VECTOR_LEN;
|
|
532
|
+
ptr1 = isLikeNone(page_setup_json) ? 0 : passStringToWasm0(page_setup_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
533
|
+
len1 = WASM_VECTOR_LEN;
|
|
534
|
+
} catch (e) {
|
|
535
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
536
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
537
|
+
throw e;
|
|
538
|
+
}
|
|
539
|
+
const ret = wasm.compute_layout(ptr0, len0, val3, val4, val5, ptr1, len1);
|
|
540
|
+
var ptr6 = ret[0];
|
|
541
|
+
var len6 = ret[1];
|
|
438
542
|
if (ret[3]) {
|
|
439
|
-
|
|
543
|
+
ptr6 = 0; len6 = 0;
|
|
440
544
|
throw takeFromExternrefTable0(ret[2]);
|
|
441
545
|
}
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
return getStringFromWasm0(
|
|
546
|
+
deferred7_0 = ptr6;
|
|
547
|
+
deferred7_1 = len6;
|
|
548
|
+
return getStringFromWasm0(ptr6, len6);
|
|
445
549
|
} finally {
|
|
446
|
-
wasm.__wbindgen_free(
|
|
550
|
+
wasm.__wbindgen_free(deferred7_0, deferred7_1, 1);
|
|
447
551
|
}
|
|
448
552
|
}
|
|
449
553
|
|
|
@@ -457,11 +561,21 @@ export function compute_layout(mnx_json, part_index, spatium, page_width, page_s
|
|
|
457
561
|
* @returns {Float32Array}
|
|
458
562
|
*/
|
|
459
563
|
export function compute_layout_binary(mnx_json, part_index, spatium, page_width, page_setup_json) {
|
|
460
|
-
const
|
|
461
|
-
const
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
564
|
+
const val3 = +part_index;
|
|
565
|
+
const val4 = +spatium;
|
|
566
|
+
const val5 = +page_width;
|
|
567
|
+
let ptr0, len0, ptr1, len1;
|
|
568
|
+
try {
|
|
569
|
+
ptr0 = passStringToWasm0(mnx_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
570
|
+
len0 = WASM_VECTOR_LEN;
|
|
571
|
+
ptr1 = isLikeNone(page_setup_json) ? 0 : passStringToWasm0(page_setup_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
572
|
+
len1 = WASM_VECTOR_LEN;
|
|
573
|
+
} catch (e) {
|
|
574
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
575
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
576
|
+
throw e;
|
|
577
|
+
}
|
|
578
|
+
const ret = wasm.compute_layout_binary(ptr0, len0, val3, val4, val5, ptr1, len1);
|
|
465
579
|
if (ret[2]) {
|
|
466
580
|
throw takeFromExternrefTable0(ret[1]);
|
|
467
581
|
}
|
|
@@ -478,25 +592,35 @@ export function compute_layout_binary(mnx_json, part_index, spatium, page_width,
|
|
|
478
592
|
* @returns {string}
|
|
479
593
|
*/
|
|
480
594
|
export function compute_mnx_score_layout(mnx_json, spatium, page_width, score_index, page_setup_json) {
|
|
481
|
-
let
|
|
482
|
-
let
|
|
595
|
+
let deferred7_0;
|
|
596
|
+
let deferred7_1;
|
|
483
597
|
try {
|
|
484
|
-
const
|
|
485
|
-
const
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
598
|
+
const val3 = +spatium;
|
|
599
|
+
const val4 = +page_width;
|
|
600
|
+
const val5 = +score_index;
|
|
601
|
+
let ptr0, len0, ptr1, len1;
|
|
602
|
+
try {
|
|
603
|
+
ptr0 = passStringToWasm0(mnx_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
604
|
+
len0 = WASM_VECTOR_LEN;
|
|
605
|
+
ptr1 = isLikeNone(page_setup_json) ? 0 : passStringToWasm0(page_setup_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
606
|
+
len1 = WASM_VECTOR_LEN;
|
|
607
|
+
} catch (e) {
|
|
608
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
609
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
610
|
+
throw e;
|
|
611
|
+
}
|
|
612
|
+
const ret = wasm.compute_mnx_score_layout(ptr0, len0, val3, val4, val5, ptr1, len1);
|
|
613
|
+
var ptr6 = ret[0];
|
|
614
|
+
var len6 = ret[1];
|
|
491
615
|
if (ret[3]) {
|
|
492
|
-
|
|
616
|
+
ptr6 = 0; len6 = 0;
|
|
493
617
|
throw takeFromExternrefTable0(ret[2]);
|
|
494
618
|
}
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
return getStringFromWasm0(
|
|
619
|
+
deferred7_0 = ptr6;
|
|
620
|
+
deferred7_1 = len6;
|
|
621
|
+
return getStringFromWasm0(ptr6, len6);
|
|
498
622
|
} finally {
|
|
499
|
-
wasm.__wbindgen_free(
|
|
623
|
+
wasm.__wbindgen_free(deferred7_0, deferred7_1, 1);
|
|
500
624
|
}
|
|
501
625
|
}
|
|
502
626
|
|
|
@@ -510,11 +634,21 @@ export function compute_mnx_score_layout(mnx_json, spatium, page_width, score_in
|
|
|
510
634
|
* @returns {Float32Array}
|
|
511
635
|
*/
|
|
512
636
|
export function compute_mnx_score_layout_binary(mnx_json, spatium, page_width, score_index, page_setup_json) {
|
|
513
|
-
const
|
|
514
|
-
const
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
637
|
+
const val3 = +spatium;
|
|
638
|
+
const val4 = +page_width;
|
|
639
|
+
const val5 = +score_index;
|
|
640
|
+
let ptr0, len0, ptr1, len1;
|
|
641
|
+
try {
|
|
642
|
+
ptr0 = passStringToWasm0(mnx_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
643
|
+
len0 = WASM_VECTOR_LEN;
|
|
644
|
+
ptr1 = isLikeNone(page_setup_json) ? 0 : passStringToWasm0(page_setup_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
645
|
+
len1 = WASM_VECTOR_LEN;
|
|
646
|
+
} catch (e) {
|
|
647
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
648
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
649
|
+
throw e;
|
|
650
|
+
}
|
|
651
|
+
const ret = wasm.compute_mnx_score_layout_binary(ptr0, len0, val3, val4, val5, ptr1, len1);
|
|
518
652
|
if (ret[2]) {
|
|
519
653
|
throw takeFromExternrefTable0(ret[1]);
|
|
520
654
|
}
|
|
@@ -601,8 +735,8 @@ export function engine_version() {
|
|
|
601
735
|
* * `spatium_mm`, `sp_pixels` — coordinate conversion factors.
|
|
602
736
|
* * `page_width_mm`, `page_height_mm` — output page dimensions.
|
|
603
737
|
* @param {string} display_list_json
|
|
604
|
-
* @param {Uint8Array} bravura_data
|
|
605
|
-
* @param {Uint8Array} text_font_data
|
|
738
|
+
* @param {Uint8Array | number[]} bravura_data
|
|
739
|
+
* @param {Uint8Array | number[]} text_font_data
|
|
606
740
|
* @param {number} spatium_mm
|
|
607
741
|
* @param {number} sp_pixels
|
|
608
742
|
* @param {number} page_width_mm
|
|
@@ -610,27 +744,39 @@ export function engine_version() {
|
|
|
610
744
|
* @returns {string}
|
|
611
745
|
*/
|
|
612
746
|
export function export_svg(display_list_json, bravura_data, text_font_data, spatium_mm, sp_pixels, page_width_mm, page_height_mm) {
|
|
613
|
-
let
|
|
614
|
-
let
|
|
747
|
+
let deferred9_0;
|
|
748
|
+
let deferred9_1;
|
|
615
749
|
try {
|
|
616
|
-
const
|
|
617
|
-
const
|
|
618
|
-
const
|
|
619
|
-
const
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
750
|
+
const val4 = +spatium_mm;
|
|
751
|
+
const val5 = +sp_pixels;
|
|
752
|
+
const val6 = +page_width_mm;
|
|
753
|
+
const val7 = +page_height_mm;
|
|
754
|
+
let ptr0, len0, ptr1, len1, ptr2, len2;
|
|
755
|
+
try {
|
|
756
|
+
ptr0 = passStringToWasm0(display_list_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
757
|
+
len0 = WASM_VECTOR_LEN;
|
|
758
|
+
ptr1 = passArray8ToWasm0(bravura_data, wasm.__wbindgen_malloc);
|
|
759
|
+
len1 = WASM_VECTOR_LEN;
|
|
760
|
+
ptr2 = passArray8ToWasm0(text_font_data, wasm.__wbindgen_malloc);
|
|
761
|
+
len2 = WASM_VECTOR_LEN;
|
|
762
|
+
} catch (e) {
|
|
763
|
+
if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 1, 1); }
|
|
764
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
765
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
766
|
+
throw e;
|
|
767
|
+
}
|
|
768
|
+
const ret = wasm.export_svg(ptr0, len0, ptr1, len1, ptr2, len2, val4, val5, val6, val7);
|
|
769
|
+
var ptr8 = ret[0];
|
|
770
|
+
var len8 = ret[1];
|
|
625
771
|
if (ret[3]) {
|
|
626
|
-
|
|
772
|
+
ptr8 = 0; len8 = 0;
|
|
627
773
|
throw takeFromExternrefTable0(ret[2]);
|
|
628
774
|
}
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
return getStringFromWasm0(
|
|
775
|
+
deferred9_0 = ptr8;
|
|
776
|
+
deferred9_1 = len8;
|
|
777
|
+
return getStringFromWasm0(ptr8, len8);
|
|
632
778
|
} finally {
|
|
633
|
-
wasm.__wbindgen_free(
|
|
779
|
+
wasm.__wbindgen_free(deferred9_0, deferred9_1, 1);
|
|
634
780
|
}
|
|
635
781
|
}
|
|
636
782
|
|
|
@@ -691,27 +837,27 @@ export function set_wasm_timing(enabled) {
|
|
|
691
837
|
function __wbg_get_imports() {
|
|
692
838
|
const import0 = {
|
|
693
839
|
__proto__: null,
|
|
694
|
-
|
|
840
|
+
__wbg___wbindgen_throw_4c88d8bf264fd984: function(arg0, arg1) {
|
|
695
841
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
696
842
|
},
|
|
697
|
-
|
|
843
|
+
__wbg_getRandomValues_19b7c67932c07470: function() { return handleError(function (arg0, arg1) {
|
|
698
844
|
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
699
845
|
}, arguments); },
|
|
700
|
-
|
|
846
|
+
__wbg_getRandomValues_5d8c030b527203a6: function() { return handleError(function (arg0, arg1) {
|
|
701
847
|
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
702
848
|
}, arguments); },
|
|
703
|
-
|
|
849
|
+
__wbg_new_from_slice_355c10c5d8f2addb: function(arg0, arg1) {
|
|
704
850
|
const ret = new Float32Array(getArrayF32FromWasm0(arg0, arg1));
|
|
705
851
|
return ret;
|
|
706
852
|
},
|
|
707
|
-
|
|
853
|
+
__wbg_now_463ac581d2fc7ea3: function() {
|
|
708
854
|
const ret = Date.now();
|
|
709
855
|
return ret;
|
|
710
|
-
},
|
|
711
|
-
|
|
856
|
+
},
|
|
857
|
+
__wbg_now_92c09207a20dd1e3: function() { return handleError(function () {
|
|
712
858
|
const ret = Date.now();
|
|
713
859
|
return ret;
|
|
714
|
-
},
|
|
860
|
+
}, arguments); },
|
|
715
861
|
__wbindgen_generic_0000000000000001: function(arg0, arg1) {
|
|
716
862
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
717
863
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
@@ -719,12 +865,11 @@ function __wbg_get_imports() {
|
|
|
719
865
|
},
|
|
720
866
|
__wbindgen_init_externref_table: function() {
|
|
721
867
|
const table = wasm.__wbindgen_externrefs;
|
|
722
|
-
const offset = table.grow(4);
|
|
723
868
|
table.set(0, undefined);
|
|
724
|
-
table.set(
|
|
725
|
-
table.set(
|
|
726
|
-
table.set(
|
|
727
|
-
table.set(
|
|
869
|
+
table.set(1024, undefined);
|
|
870
|
+
table.set(1025, null);
|
|
871
|
+
table.set(1026, true);
|
|
872
|
+
table.set(1027, false);
|
|
728
873
|
},
|
|
729
874
|
};
|
|
730
875
|
return {
|
|
@@ -767,7 +912,8 @@ function getFloat32ArrayMemory0() {
|
|
|
767
912
|
}
|
|
768
913
|
|
|
769
914
|
function getStringFromWasm0(ptr, len) {
|
|
770
|
-
|
|
915
|
+
ptr = ptr >>> 0;
|
|
916
|
+
return decodeText(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
771
917
|
}
|
|
772
918
|
|
|
773
919
|
let cachedUint32ArrayMemory0 = null;
|
|
@@ -849,18 +995,18 @@ function takeFromExternrefTable0(idx) {
|
|
|
849
995
|
return value;
|
|
850
996
|
}
|
|
851
997
|
|
|
852
|
-
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true
|
|
998
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true });
|
|
853
999
|
cachedTextDecoder.decode();
|
|
854
1000
|
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
855
1001
|
let numBytesDecoded = 0;
|
|
856
|
-
function decodeText(
|
|
857
|
-
numBytesDecoded +=
|
|
1002
|
+
function decodeText(bytes) {
|
|
1003
|
+
numBytesDecoded += bytes.length;
|
|
858
1004
|
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
859
|
-
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true
|
|
1005
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true });
|
|
860
1006
|
cachedTextDecoder.decode();
|
|
861
|
-
numBytesDecoded =
|
|
1007
|
+
numBytesDecoded = bytes.length;
|
|
862
1008
|
}
|
|
863
|
-
return cachedTextDecoder.decode(
|
|
1009
|
+
return cachedTextDecoder.decode(bytes);
|
|
864
1010
|
}
|
|
865
1011
|
|
|
866
1012
|
const cachedTextEncoder = new TextEncoder();
|
|
@@ -949,9 +1095,17 @@ function initSync(module) {
|
|
|
949
1095
|
return __wbg_finalize_init(instance, module);
|
|
950
1096
|
}
|
|
951
1097
|
|
|
1098
|
+
let __wbg_init_promise;
|
|
952
1099
|
async function __wbg_init(module_or_path) {
|
|
953
1100
|
if (wasm !== undefined) return wasm;
|
|
1101
|
+
if (__wbg_init_promise === undefined) {
|
|
1102
|
+
__wbg_init_promise = __wbg_init_once(module_or_path);
|
|
1103
|
+
__wbg_init_promise.catch(() => { __wbg_init_promise = undefined; });
|
|
1104
|
+
}
|
|
1105
|
+
return __wbg_init_promise;
|
|
1106
|
+
}
|
|
954
1107
|
|
|
1108
|
+
async function __wbg_init_once(module_or_path) {
|
|
955
1109
|
|
|
956
1110
|
if (module_or_path !== undefined) {
|
|
957
1111
|
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|