@takumi-rs/wasm 0.38.1 → 0.40.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@takumi-rs/wasm",
3
- "version": "0.38.1",
3
+ "version": "0.40.0",
4
4
  "keywords": [
5
5
  "image",
6
6
  "rendering",
@@ -73,7 +73,7 @@ export interface InitOutput {
73
73
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
74
74
  readonly __wbindgen_exn_store: (a: number) => void;
75
75
  readonly __externref_table_alloc: () => number;
76
- readonly __wbindgen_export_4: WebAssembly.Table;
76
+ readonly __wbindgen_externrefs: WebAssembly.Table;
77
77
  readonly __wbindgen_free: (a: number, b: number, c: number) => void;
78
78
  readonly __externref_drop_slice: (a: number, b: number) => void;
79
79
  readonly __wbindgen_start: () => void;
@@ -93,26 +93,6 @@ function getDataViewMemory0() {
93
93
  return cachedDataViewMemory0;
94
94
  }
95
95
 
96
- function addToExternrefTable0(obj) {
97
- const idx = wasm.__externref_table_alloc();
98
- wasm.__wbindgen_export_4.set(idx, obj);
99
- return idx;
100
- }
101
-
102
- function handleError(f, args) {
103
- try {
104
- return f.apply(this, args);
105
- } catch (e) {
106
- const idx = addToExternrefTable0(e);
107
- wasm.__wbindgen_exn_store(idx);
108
- }
109
- }
110
-
111
- function getArrayU8FromWasm0(ptr, len) {
112
- ptr = ptr >>> 0;
113
- return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
114
- }
115
-
116
96
  function isLikeNone(x) {
117
97
  return x === undefined || x === null;
118
98
  }
@@ -182,6 +162,26 @@ function debugString(val) {
182
162
  return className;
183
163
  }
184
164
 
165
+ function addToExternrefTable0(obj) {
166
+ const idx = wasm.__externref_table_alloc();
167
+ wasm.__wbindgen_externrefs.set(idx, obj);
168
+ return idx;
169
+ }
170
+
171
+ function handleError(f, args) {
172
+ try {
173
+ return f.apply(this, args);
174
+ } catch (e) {
175
+ const idx = addToExternrefTable0(e);
176
+ wasm.__wbindgen_exn_store(idx);
177
+ }
178
+ }
179
+
180
+ function getArrayU8FromWasm0(ptr, len) {
181
+ ptr = ptr >>> 0;
182
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
183
+ }
184
+
185
185
  function passArray8ToWasm0(arg, malloc) {
186
186
  const ptr = malloc(arg.length * 1, 1) >>> 0;
187
187
  getUint8ArrayMemory0().set(arg, ptr / 1);
@@ -204,7 +204,7 @@ function getArrayJsValueFromWasm0(ptr, len) {
204
204
  const mem = getDataViewMemory0();
205
205
  const result = [];
206
206
  for (let i = ptr; i < ptr + 4 * len; i += 4) {
207
- result.push(wasm.__wbindgen_export_4.get(mem.getUint32(i, true)));
207
+ result.push(wasm.__wbindgen_externrefs.get(mem.getUint32(i, true)));
208
208
  }
209
209
  wasm.__externref_drop_slice(ptr, len);
210
210
  return result;
@@ -389,11 +389,11 @@ async function __wbg_load(module, imports) {
389
389
  function __wbg_get_imports() {
390
390
  const imports = {};
391
391
  imports.wbg = {};
392
- imports.wbg.__wbg_Error_e17e777aac105295 = function(arg0, arg1) {
392
+ imports.wbg.__wbg_Error_e83987f665cf5504 = function(arg0, arg1) {
393
393
  const ret = Error(getStringFromWasm0(arg0, arg1));
394
394
  return ret;
395
395
  };
396
- imports.wbg.__wbg_Number_998bea33bd87c3e0 = function(arg0) {
396
+ imports.wbg.__wbg_Number_bb48ca12f395cd08 = function(arg0) {
397
397
  const ret = Number(arg0);
398
398
  return ret;
399
399
  };
@@ -404,19 +404,87 @@ function __wbg_get_imports() {
404
404
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
405
405
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
406
406
  };
407
+ imports.wbg.__wbg___wbindgen_bigint_get_as_i64_f3ebc5a755000afd = function(arg0, arg1) {
408
+ const v = arg1;
409
+ const ret = typeof(v) === 'bigint' ? v : undefined;
410
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
411
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
412
+ };
413
+ imports.wbg.__wbg___wbindgen_boolean_get_6d5a1ee65bab5f68 = function(arg0) {
414
+ const v = arg0;
415
+ const ret = typeof(v) === 'boolean' ? v : undefined;
416
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
417
+ };
418
+ imports.wbg.__wbg___wbindgen_debug_string_df47ffb5e35e6763 = function(arg0, arg1) {
419
+ const ret = debugString(arg1);
420
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
421
+ const len1 = WASM_VECTOR_LEN;
422
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
423
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
424
+ };
425
+ imports.wbg.__wbg___wbindgen_in_bb933bd9e1b3bc0f = function(arg0, arg1) {
426
+ const ret = arg0 in arg1;
427
+ return ret;
428
+ };
429
+ imports.wbg.__wbg___wbindgen_is_bigint_cb320707dcd35f0b = function(arg0) {
430
+ const ret = typeof(arg0) === 'bigint';
431
+ return ret;
432
+ };
433
+ imports.wbg.__wbg___wbindgen_is_function_ee8a6c5833c90377 = function(arg0) {
434
+ const ret = typeof(arg0) === 'function';
435
+ return ret;
436
+ };
437
+ imports.wbg.__wbg___wbindgen_is_object_c818261d21f283a4 = function(arg0) {
438
+ const val = arg0;
439
+ const ret = typeof(val) === 'object' && val !== null;
440
+ return ret;
441
+ };
442
+ imports.wbg.__wbg___wbindgen_is_string_fbb76cb2940daafd = function(arg0) {
443
+ const ret = typeof(arg0) === 'string';
444
+ return ret;
445
+ };
446
+ imports.wbg.__wbg___wbindgen_is_undefined_2d472862bd29a478 = function(arg0) {
447
+ const ret = arg0 === undefined;
448
+ return ret;
449
+ };
450
+ imports.wbg.__wbg___wbindgen_jsval_eq_6b13ab83478b1c50 = function(arg0, arg1) {
451
+ const ret = arg0 === arg1;
452
+ return ret;
453
+ };
454
+ imports.wbg.__wbg___wbindgen_jsval_loose_eq_b664b38a2f582147 = function(arg0, arg1) {
455
+ const ret = arg0 == arg1;
456
+ return ret;
457
+ };
458
+ imports.wbg.__wbg___wbindgen_number_get_a20bf9b85341449d = function(arg0, arg1) {
459
+ const obj = arg1;
460
+ const ret = typeof(obj) === 'number' ? obj : undefined;
461
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
462
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
463
+ };
464
+ imports.wbg.__wbg___wbindgen_string_get_e4f06c90489ad01b = function(arg0, arg1) {
465
+ const obj = arg1;
466
+ const ret = typeof(obj) === 'string' ? obj : undefined;
467
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
468
+ var len1 = WASM_VECTOR_LEN;
469
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
470
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
471
+ };
472
+ imports.wbg.__wbg___wbindgen_throw_b855445ff6a94295 = function(arg0, arg1) {
473
+ throw new Error(getStringFromWasm0(arg0, arg1));
474
+ };
407
475
  imports.wbg.__wbg_animationframesource_unwrap = function(arg0) {
408
476
  const ret = AnimationFrameSource.__unwrap(arg0);
409
477
  return ret;
410
478
  };
411
- imports.wbg.__wbg_call_13410aac570ffff7 = function() { return handleError(function (arg0, arg1) {
479
+ imports.wbg.__wbg_call_e762c39fa8ea36bf = function() { return handleError(function (arg0, arg1) {
412
480
  const ret = arg0.call(arg1);
413
481
  return ret;
414
482
  }, arguments) };
415
- imports.wbg.__wbg_done_75ed0ee6dd243d9d = function(arg0) {
483
+ imports.wbg.__wbg_done_2042aa2670fb1db1 = function(arg0) {
416
484
  const ret = arg0.done;
417
485
  return ret;
418
486
  };
419
- imports.wbg.__wbg_entries_2be2f15bd5554996 = function(arg0) {
487
+ imports.wbg.__wbg_entries_e171b586f8f6bdbf = function(arg0) {
420
488
  const ret = Object.entries(arg0);
421
489
  return ret;
422
490
  };
@@ -431,19 +499,19 @@ function __wbg_get_imports() {
431
499
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
432
500
  }
433
501
  };
434
- imports.wbg.__wbg_get_0da715ceaecea5c8 = function(arg0, arg1) {
502
+ imports.wbg.__wbg_get_7bed016f185add81 = function(arg0, arg1) {
435
503
  const ret = arg0[arg1 >>> 0];
436
504
  return ret;
437
505
  };
438
- imports.wbg.__wbg_get_458e874b43b18b25 = function() { return handleError(function (arg0, arg1) {
506
+ imports.wbg.__wbg_get_efcb449f58ec27c2 = function() { return handleError(function (arg0, arg1) {
439
507
  const ret = Reflect.get(arg0, arg1);
440
508
  return ret;
441
509
  }, arguments) };
442
- imports.wbg.__wbg_getwithrefkey_1dc361bd10053bfe = function(arg0, arg1) {
510
+ imports.wbg.__wbg_get_with_ref_key_1dc361bd10053bfe = function(arg0, arg1) {
443
511
  const ret = arg0[arg1];
444
512
  return ret;
445
513
  };
446
- imports.wbg.__wbg_instanceof_ArrayBuffer_67f3012529f6a2dd = function(arg0) {
514
+ imports.wbg.__wbg_instanceof_ArrayBuffer_70beb1189ca63b38 = function(arg0) {
447
515
  let result;
448
516
  try {
449
517
  result = arg0 instanceof ArrayBuffer;
@@ -453,7 +521,7 @@ function __wbg_get_imports() {
453
521
  const ret = result;
454
522
  return ret;
455
523
  };
456
- imports.wbg.__wbg_instanceof_Map_ebb01a5b6b5ffd0b = function(arg0) {
524
+ imports.wbg.__wbg_instanceof_Map_8579b5e2ab5437c7 = function(arg0) {
457
525
  let result;
458
526
  try {
459
527
  result = arg0 instanceof Map;
@@ -463,7 +531,7 @@ function __wbg_get_imports() {
463
531
  const ret = result;
464
532
  return ret;
465
533
  };
466
- imports.wbg.__wbg_instanceof_Uint8Array_9a8378d955933db7 = function(arg0) {
534
+ imports.wbg.__wbg_instanceof_Uint8Array_20c8e73002f7af98 = function(arg0) {
467
535
  let result;
468
536
  try {
469
537
  result = arg0 instanceof Uint8Array;
@@ -473,113 +541,45 @@ function __wbg_get_imports() {
473
541
  const ret = result;
474
542
  return ret;
475
543
  };
476
- imports.wbg.__wbg_isArray_030cce220591fb41 = function(arg0) {
544
+ imports.wbg.__wbg_isArray_96e0af9891d0945d = function(arg0) {
477
545
  const ret = Array.isArray(arg0);
478
546
  return ret;
479
547
  };
480
- imports.wbg.__wbg_isSafeInteger_1c0d1af5542e102a = function(arg0) {
548
+ imports.wbg.__wbg_isSafeInteger_d216eda7911dde36 = function(arg0) {
481
549
  const ret = Number.isSafeInteger(arg0);
482
550
  return ret;
483
551
  };
484
- imports.wbg.__wbg_iterator_f370b34483c71a1c = function() {
552
+ imports.wbg.__wbg_iterator_e5822695327a3c39 = function() {
485
553
  const ret = Symbol.iterator;
486
554
  return ret;
487
555
  };
488
- imports.wbg.__wbg_length_186546c51cd61acd = function(arg0) {
556
+ imports.wbg.__wbg_length_69bca3cb64fc8748 = function(arg0) {
489
557
  const ret = arg0.length;
490
558
  return ret;
491
559
  };
492
- imports.wbg.__wbg_length_6bb7e81f9d7713e4 = function(arg0) {
560
+ imports.wbg.__wbg_length_cdd215e10d9dd507 = function(arg0) {
493
561
  const ret = arg0.length;
494
562
  return ret;
495
563
  };
496
- imports.wbg.__wbg_new_638ebfaedbf32a5e = function(arg0) {
564
+ imports.wbg.__wbg_new_5a79be3ab53b8aa5 = function(arg0) {
497
565
  const ret = new Uint8Array(arg0);
498
566
  return ret;
499
567
  };
500
- imports.wbg.__wbg_next_5b3530e612fde77d = function(arg0) {
501
- const ret = arg0.next;
502
- return ret;
503
- };
504
- imports.wbg.__wbg_next_692e82279131b03c = function() { return handleError(function (arg0) {
568
+ imports.wbg.__wbg_next_020810e0ae8ebcb0 = function() { return handleError(function (arg0) {
505
569
  const ret = arg0.next();
506
570
  return ret;
507
571
  }, arguments) };
508
- imports.wbg.__wbg_prototypesetcall_3d4a26c1ed734349 = function(arg0, arg1, arg2) {
509
- Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
510
- };
511
- imports.wbg.__wbg_value_dd9372230531eade = function(arg0) {
512
- const ret = arg0.value;
513
- return ret;
514
- };
515
- imports.wbg.__wbg_wbindgenbigintgetasi64_ac743ece6ab9bba1 = function(arg0, arg1) {
516
- const v = arg1;
517
- const ret = typeof(v) === 'bigint' ? v : undefined;
518
- getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
519
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
520
- };
521
- imports.wbg.__wbg_wbindgenbooleanget_3fe6f642c7d97746 = function(arg0) {
522
- const v = arg0;
523
- const ret = typeof(v) === 'boolean' ? v : undefined;
524
- return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
525
- };
526
- imports.wbg.__wbg_wbindgendebugstring_99ef257a3ddda34d = function(arg0, arg1) {
527
- const ret = debugString(arg1);
528
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
529
- const len1 = WASM_VECTOR_LEN;
530
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
531
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
532
- };
533
- imports.wbg.__wbg_wbindgenin_d7a1ee10933d2d55 = function(arg0, arg1) {
534
- const ret = arg0 in arg1;
535
- return ret;
536
- };
537
- imports.wbg.__wbg_wbindgenisbigint_ecb90cc08a5a9154 = function(arg0) {
538
- const ret = typeof(arg0) === 'bigint';
539
- return ret;
540
- };
541
- imports.wbg.__wbg_wbindgenisfunction_8cee7dce3725ae74 = function(arg0) {
542
- const ret = typeof(arg0) === 'function';
543
- return ret;
544
- };
545
- imports.wbg.__wbg_wbindgenisobject_307a53c6bd97fbf8 = function(arg0) {
546
- const val = arg0;
547
- const ret = typeof(val) === 'object' && val !== null;
548
- return ret;
549
- };
550
- imports.wbg.__wbg_wbindgenisstring_d4fa939789f003b0 = function(arg0) {
551
- const ret = typeof(arg0) === 'string';
552
- return ret;
553
- };
554
- imports.wbg.__wbg_wbindgenisundefined_c4b71d073b92f3c5 = function(arg0) {
555
- const ret = arg0 === undefined;
572
+ imports.wbg.__wbg_next_2c826fe5dfec6b6a = function(arg0) {
573
+ const ret = arg0.next;
556
574
  return ret;
557
575
  };
558
- imports.wbg.__wbg_wbindgenjsvaleq_e6f2ad59ccae1b58 = function(arg0, arg1) {
559
- const ret = arg0 === arg1;
560
- return ret;
576
+ imports.wbg.__wbg_prototypesetcall_2a6620b6922694b2 = function(arg0, arg1, arg2) {
577
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
561
578
  };
562
- imports.wbg.__wbg_wbindgenjsvallooseeq_9bec8c9be826bed1 = function(arg0, arg1) {
563
- const ret = arg0 == arg1;
579
+ imports.wbg.__wbg_value_692627309814bb8c = function(arg0) {
580
+ const ret = arg0.value;
564
581
  return ret;
565
582
  };
566
- imports.wbg.__wbg_wbindgennumberget_f74b4c7525ac05cb = function(arg0, arg1) {
567
- const obj = arg1;
568
- const ret = typeof(obj) === 'number' ? obj : undefined;
569
- getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
570
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
571
- };
572
- imports.wbg.__wbg_wbindgenstringget_0f16a6ddddef376f = function(arg0, arg1) {
573
- const obj = arg1;
574
- const ret = typeof(obj) === 'string' ? obj : undefined;
575
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
576
- var len1 = WASM_VECTOR_LEN;
577
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
578
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
579
- };
580
- imports.wbg.__wbg_wbindgenthrow_451ec1a8469d7eb6 = function(arg0, arg1) {
581
- throw new Error(getStringFromWasm0(arg0, arg1));
582
- };
583
583
  imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
584
584
  // Cast intrinsic for `Ref(String) -> Externref`.
585
585
  const ret = getStringFromWasm0(arg0, arg1);
@@ -596,7 +596,7 @@ function __wbg_get_imports() {
596
596
  return ret;
597
597
  };
598
598
  imports.wbg.__wbindgen_init_externref_table = function() {
599
- const table = wasm.__wbindgen_export_4;
599
+ const table = wasm.__wbindgen_externrefs;
600
600
  const offset = table.grow(4);
601
601
  table.set(0, undefined);
602
602
  table.set(offset + 0, undefined);
@@ -609,10 +609,6 @@ function __wbg_get_imports() {
609
609
  return imports;
610
610
  }
611
611
 
612
- function __wbg_init_memory(imports, memory) {
613
-
614
- }
615
-
616
612
  function __wbg_finalize_init(instance, module) {
617
613
  wasm = instance.exports;
618
614
  __wbg_init.__wbindgen_wasm_module = module;
@@ -638,8 +634,6 @@ function initSync(module) {
638
634
 
639
635
  const imports = __wbg_get_imports();
640
636
 
641
- __wbg_init_memory(imports);
642
-
643
637
  if (!(module instanceof WebAssembly.Module)) {
644
638
  module = new WebAssembly.Module(module);
645
639
  }
@@ -670,8 +664,6 @@ async function __wbg_init(module_or_path) {
670
664
  module_or_path = fetch(module_or_path);
671
665
  }
672
666
 
673
- __wbg_init_memory(imports);
674
-
675
667
  const { instance, module } = await __wbg_load(await module_or_path, imports);
676
668
 
677
669
  return __wbg_finalize_init(instance, module);
Binary file
@@ -17,7 +17,7 @@ export const __wbindgen_malloc: (a: number, b: number) => number;
17
17
  export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
18
18
  export const __wbindgen_exn_store: (a: number) => void;
19
19
  export const __externref_table_alloc: () => number;
20
- export const __wbindgen_export_4: WebAssembly.Table;
20
+ export const __wbindgen_externrefs: WebAssembly.Table;
21
21
  export const __wbindgen_free: (a: number, b: number, c: number) => void;
22
22
  export const __externref_drop_slice: (a: number, b: number) => void;
23
23
  export const __wbindgen_start: () => void;