@sealpixel/wasm 1.0.0-rc.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/README.md +14 -0
- package/dist/generated/sealpixel_core.d.ts +133 -0
- package/dist/generated/sealpixel_core.d.ts.map +1 -0
- package/dist/generated/sealpixel_core.js +609 -0
- package/dist/generated/sealpixel_core.js.map +1 -0
- package/dist/generated/sealpixel_core_bg.wasm +0 -0
- package/dist/generated/sealpixel_core_bg.wasm.d.ts +28 -0
- package/dist/index.browser.d.ts +8 -0
- package/dist/index.browser.d.ts.map +1 -0
- package/dist/index.browser.js +19 -0
- package/dist/index.browser.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/index.node.d.ts +8 -0
- package/dist/index.node.d.ts.map +1 -0
- package/dist/index.node.js +37 -0
- package/dist/index.node.js.map +1 -0
- package/dist/types.d.ts +57 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/wrap.d.ts +10 -0
- package/dist/wrap.d.ts.map +1 -0
- package/dist/wrap.js +51 -0
- package/dist/wrap.js.map +1 -0
- package/package.json +42 -0
package/README.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# @sealpixel/wasm
|
|
2
|
+
|
|
3
|
+
The Sealpixel rendering core compiled to WebAssembly, plus a loader for each runtime. This package contains no logic of its own. Use `@sealpixel/core` for the editor API.
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
import { loadSealpixelWasm } from '@sealpixel/wasm';
|
|
7
|
+
|
|
8
|
+
const wasm = await loadSealpixelWasm();
|
|
9
|
+
const decoded = wasm.decode(pngBytes);
|
|
10
|
+
const rendered = wasm.renderRgba(decoded, planJson);
|
|
11
|
+
const png = wasm.encode(rendered, '{"format":"png"}');
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
The `exports` map selects `index.browser.js` for browsers and workers and `index.node.js` for Node, Deno and Bun. Both return the same `SealpixelWasm` surface backed by the same binary.
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Decoded RGBA8 image. `take_data` moves the pixel buffer out to JS exactly once.
|
|
6
|
+
*/
|
|
7
|
+
export class DecodedImage {
|
|
8
|
+
private constructor();
|
|
9
|
+
free(): void;
|
|
10
|
+
[Symbol.dispose](): void;
|
|
11
|
+
/**
|
|
12
|
+
* Returns the RGBA8 buffer and releases it from WASM memory.
|
|
13
|
+
*/
|
|
14
|
+
takeData(): Uint8Array;
|
|
15
|
+
readonly height: number;
|
|
16
|
+
readonly mimeType: string;
|
|
17
|
+
readonly width: number;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Runs a `RenderPlan` (JSON) on an RGBA8 buffer and returns the result.
|
|
22
|
+
*/
|
|
23
|
+
export class RenderedImage {
|
|
24
|
+
private constructor();
|
|
25
|
+
free(): void;
|
|
26
|
+
[Symbol.dispose](): void;
|
|
27
|
+
takeData(): Uint8Array;
|
|
28
|
+
readonly height: number;
|
|
29
|
+
readonly width: number;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function assetClear(): void;
|
|
33
|
+
|
|
34
|
+
export function assetHas(id: string): boolean;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Stores a binary asset (font, sticker image) under `id` for later renders.
|
|
38
|
+
* The caller verifies the hash before handing bytes over.
|
|
39
|
+
*/
|
|
40
|
+
export function assetPut(id: string, bytes: Uint8Array): void;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Decodes PNG (and, in later milestones, JPEG and WebP) into RGBA8.
|
|
44
|
+
*/
|
|
45
|
+
export function decode(bytes: Uint8Array): DecodedImage;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Encodes RGBA8 with the options JSON (`{"format":"png"}`).
|
|
49
|
+
*/
|
|
50
|
+
export function encode(width: number, height: number, data: Uint8Array, options_json: string): Uint8Array;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Installs a panic hook that forwards Rust panics to `console.error`.
|
|
54
|
+
* No-op unless the crate is built with the `debug` feature.
|
|
55
|
+
*/
|
|
56
|
+
export function init_debug(): void;
|
|
57
|
+
|
|
58
|
+
export function renderRgba(width: number, height: number, data: Uint8Array, plan_json: string): RenderedImage;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Deterministic proxy: downscales so the longer side is at most `max_side`.
|
|
62
|
+
* Returns the input unchanged (copied) when it is already small enough.
|
|
63
|
+
*/
|
|
64
|
+
export function resizeProxy(width: number, height: number, data: Uint8Array, max_side: number): RenderedImage;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Resolves stage geometry for `plan_json` on a buffer of `width` x `height`
|
|
68
|
+
* and returns it as JSON. The UI uses this instead of doing any geometry math.
|
|
69
|
+
*/
|
|
70
|
+
export function resolveGeometry(plan_json: string, width: number, height: number): string;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* SHA-256 of `bytes` as lowercase hex.
|
|
74
|
+
*/
|
|
75
|
+
export function sha256_hex(bytes: Uint8Array): string;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Semantic version of the core crate compiled into this binary.
|
|
79
|
+
*/
|
|
80
|
+
export function version(): string;
|
|
81
|
+
|
|
82
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
83
|
+
|
|
84
|
+
export interface InitOutput {
|
|
85
|
+
readonly memory: WebAssembly.Memory;
|
|
86
|
+
readonly __wbg_decodedimage_free: (a: number, b: number) => void;
|
|
87
|
+
readonly __wbg_renderedimage_free: (a: number, b: number) => void;
|
|
88
|
+
readonly assetClear: () => void;
|
|
89
|
+
readonly assetHas: (a: number, b: number) => number;
|
|
90
|
+
readonly assetPut: (a: number, b: number, c: number, d: number) => void;
|
|
91
|
+
readonly decode: (a: number, b: number, c: number) => void;
|
|
92
|
+
readonly decodedimage_height: (a: number) => number;
|
|
93
|
+
readonly decodedimage_mimeType: (a: number, b: number) => void;
|
|
94
|
+
readonly decodedimage_takeData: (a: number, b: number) => void;
|
|
95
|
+
readonly decodedimage_width: (a: number) => number;
|
|
96
|
+
readonly encode: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
97
|
+
readonly init_debug: () => void;
|
|
98
|
+
readonly renderRgba: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
99
|
+
readonly renderedimage_height: (a: number) => number;
|
|
100
|
+
readonly renderedimage_takeData: (a: number, b: number) => void;
|
|
101
|
+
readonly renderedimage_width: (a: number) => number;
|
|
102
|
+
readonly resizeProxy: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
103
|
+
readonly resolveGeometry: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
104
|
+
readonly sha256_hex: (a: number, b: number, c: number) => void;
|
|
105
|
+
readonly version: (a: number) => void;
|
|
106
|
+
readonly __wbindgen_export: (a: number) => void;
|
|
107
|
+
readonly __wbindgen_export2: (a: number, b: number) => number;
|
|
108
|
+
readonly __wbindgen_export3: (a: number, b: number, c: number, d: number) => number;
|
|
109
|
+
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
110
|
+
readonly __wbindgen_export4: (a: number, b: number, c: number) => void;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
117
|
+
* a precompiled `WebAssembly.Module`.
|
|
118
|
+
*
|
|
119
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
120
|
+
*
|
|
121
|
+
* @returns {InitOutput}
|
|
122
|
+
*/
|
|
123
|
+
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
127
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
128
|
+
*
|
|
129
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
130
|
+
*
|
|
131
|
+
* @returns {Promise<InitOutput>}
|
|
132
|
+
*/
|
|
133
|
+
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sealpixel_core.d.ts","sourceRoot":"","sources":["../../src/generated/sealpixel_core.js"],"names":[],"mappings":"AA0IA,mCAEC;AAED;;;GAGG;AACH,6BAHW,MAAM,GACJ,OAAO,CAOnB;AAED;;;;;GAKG;AACH,6BAHW,MAAM,SACN,UAAU,QAQpB;AAED;;;;GAIG;AACH,8BAHW,UAAU,GACR,YAAY,CAkBxB;AAED;;;;;;;GAOG;AACH,8BANW,MAAM,UACN,MAAM,QACN,UAAU,gBACV,MAAM,GACJ,UAAU,CAuBtB;AAED;;;GAGG;AACH,mCAEC;AAED;;;;;;GAMG;AACH,kCANW,MAAM,UACN,MAAM,QACN,UAAU,aACV,MAAM,GACJ,aAAa,CAoBzB;AAED;;;;;;;;GAQG;AACH,mCANW,MAAM,UACN,MAAM,QACN,UAAU,YACV,MAAM,GACJ,aAAa,CAkBzB;AAED;;;;;;;GAOG;AACH,2CALW,MAAM,SACN,MAAM,UACN,MAAM,GACJ,MAAM,CA2BlB;AAED;;;;GAIG;AACH,kCAHW,UAAU,GACR,MAAM,CAmBlB;AAED;;;GAGG;AACH,2BAFa,MAAM,CAiBlB;AAvWD;;GAEG;AACH;IACI,6BAKC;IACD,yCAKC;IAHG,8BAAkB;IAItB,aAGC;IACD;;OAEG;IACH,cAFa,MAAM,CAKlB;IACD;;OAEG;IACH,gBAFa,MAAM,CAiBlB;IACD;;;OAGG;IACH,YAFa,UAAU,CAmBtB;IACD;;OAEG;IACH,aAFa,MAAM,CAKlB;CACJ;AAGD;;GAEG;AACH;IACI,6BAKC;IACD,yCAKC;IAHG,8BAAkB;IAItB,aAGC;IACD;;OAEG;IACH,cAFa,MAAM,CAKlB;IACD;;OAEG;IACH,YAFa,UAAU,CAmBtB;IACD;;OAEG;IACH,aAFa,MAAM,CAKlB;CACJ;AAqcD,2CAkBC;AAED,+DAwBC"}
|
|
@@ -0,0 +1,609 @@
|
|
|
1
|
+
/* @ts-self-types="./sealpixel_core.d.ts" */
|
|
2
|
+
/**
|
|
3
|
+
* Decoded RGBA8 image. `take_data` moves the pixel buffer out to JS exactly once.
|
|
4
|
+
*/
|
|
5
|
+
export class DecodedImage {
|
|
6
|
+
static __wrap(ptr) {
|
|
7
|
+
const obj = Object.create(DecodedImage.prototype);
|
|
8
|
+
obj.__wbg_ptr = ptr;
|
|
9
|
+
DecodedImageFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
10
|
+
return obj;
|
|
11
|
+
}
|
|
12
|
+
__destroy_into_raw() {
|
|
13
|
+
const ptr = this.__wbg_ptr;
|
|
14
|
+
this.__wbg_ptr = 0;
|
|
15
|
+
DecodedImageFinalization.unregister(this);
|
|
16
|
+
return ptr;
|
|
17
|
+
}
|
|
18
|
+
free() {
|
|
19
|
+
const ptr = this.__destroy_into_raw();
|
|
20
|
+
wasm.__wbg_decodedimage_free(ptr, 0);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* @returns {number}
|
|
24
|
+
*/
|
|
25
|
+
get height() {
|
|
26
|
+
const ret = wasm.decodedimage_height(this.__wbg_ptr);
|
|
27
|
+
return ret >>> 0;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* @returns {string}
|
|
31
|
+
*/
|
|
32
|
+
get mimeType() {
|
|
33
|
+
let deferred1_0;
|
|
34
|
+
let deferred1_1;
|
|
35
|
+
try {
|
|
36
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
37
|
+
wasm.decodedimage_mimeType(retptr, this.__wbg_ptr);
|
|
38
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
39
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
40
|
+
deferred1_0 = r0;
|
|
41
|
+
deferred1_1 = r1;
|
|
42
|
+
return getStringFromWasm0(r0, r1);
|
|
43
|
+
}
|
|
44
|
+
finally {
|
|
45
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
46
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Returns the RGBA8 buffer and releases it from WASM memory.
|
|
51
|
+
* @returns {Uint8Array}
|
|
52
|
+
*/
|
|
53
|
+
takeData() {
|
|
54
|
+
try {
|
|
55
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
56
|
+
wasm.decodedimage_takeData(retptr, this.__wbg_ptr);
|
|
57
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
58
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
59
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
60
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
61
|
+
if (r3) {
|
|
62
|
+
throw takeObject(r2);
|
|
63
|
+
}
|
|
64
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
65
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
66
|
+
return v1;
|
|
67
|
+
}
|
|
68
|
+
finally {
|
|
69
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* @returns {number}
|
|
74
|
+
*/
|
|
75
|
+
get width() {
|
|
76
|
+
const ret = wasm.decodedimage_width(this.__wbg_ptr);
|
|
77
|
+
return ret >>> 0;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
if (Symbol.dispose)
|
|
81
|
+
DecodedImage.prototype[Symbol.dispose] = DecodedImage.prototype.free;
|
|
82
|
+
/**
|
|
83
|
+
* Runs a `RenderPlan` (JSON) on an RGBA8 buffer and returns the result.
|
|
84
|
+
*/
|
|
85
|
+
export class RenderedImage {
|
|
86
|
+
static __wrap(ptr) {
|
|
87
|
+
const obj = Object.create(RenderedImage.prototype);
|
|
88
|
+
obj.__wbg_ptr = ptr;
|
|
89
|
+
RenderedImageFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
90
|
+
return obj;
|
|
91
|
+
}
|
|
92
|
+
__destroy_into_raw() {
|
|
93
|
+
const ptr = this.__wbg_ptr;
|
|
94
|
+
this.__wbg_ptr = 0;
|
|
95
|
+
RenderedImageFinalization.unregister(this);
|
|
96
|
+
return ptr;
|
|
97
|
+
}
|
|
98
|
+
free() {
|
|
99
|
+
const ptr = this.__destroy_into_raw();
|
|
100
|
+
wasm.__wbg_renderedimage_free(ptr, 0);
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* @returns {number}
|
|
104
|
+
*/
|
|
105
|
+
get height() {
|
|
106
|
+
const ret = wasm.renderedimage_height(this.__wbg_ptr);
|
|
107
|
+
return ret >>> 0;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* @returns {Uint8Array}
|
|
111
|
+
*/
|
|
112
|
+
takeData() {
|
|
113
|
+
try {
|
|
114
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
115
|
+
wasm.renderedimage_takeData(retptr, this.__wbg_ptr);
|
|
116
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
117
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
118
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
119
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
120
|
+
if (r3) {
|
|
121
|
+
throw takeObject(r2);
|
|
122
|
+
}
|
|
123
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
124
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
125
|
+
return v1;
|
|
126
|
+
}
|
|
127
|
+
finally {
|
|
128
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* @returns {number}
|
|
133
|
+
*/
|
|
134
|
+
get width() {
|
|
135
|
+
const ret = wasm.renderedimage_width(this.__wbg_ptr);
|
|
136
|
+
return ret >>> 0;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
if (Symbol.dispose)
|
|
140
|
+
RenderedImage.prototype[Symbol.dispose] = RenderedImage.prototype.free;
|
|
141
|
+
export function assetClear() {
|
|
142
|
+
wasm.assetClear();
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* @param {string} id
|
|
146
|
+
* @returns {boolean}
|
|
147
|
+
*/
|
|
148
|
+
export function assetHas(id) {
|
|
149
|
+
const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export2, wasm.__wbindgen_export3);
|
|
150
|
+
const len0 = WASM_VECTOR_LEN;
|
|
151
|
+
const ret = wasm.assetHas(ptr0, len0);
|
|
152
|
+
return ret !== 0;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Stores a binary asset (font, sticker image) under `id` for later renders.
|
|
156
|
+
* The caller verifies the hash before handing bytes over.
|
|
157
|
+
* @param {string} id
|
|
158
|
+
* @param {Uint8Array} bytes
|
|
159
|
+
*/
|
|
160
|
+
export function assetPut(id, bytes) {
|
|
161
|
+
const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export2, wasm.__wbindgen_export3);
|
|
162
|
+
const len0 = WASM_VECTOR_LEN;
|
|
163
|
+
const ptr1 = passArray8ToWasm0(bytes, wasm.__wbindgen_export2);
|
|
164
|
+
const len1 = WASM_VECTOR_LEN;
|
|
165
|
+
wasm.assetPut(ptr0, len0, ptr1, len1);
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Decodes PNG (and, in later milestones, JPEG and WebP) into RGBA8.
|
|
169
|
+
* @param {Uint8Array} bytes
|
|
170
|
+
* @returns {DecodedImage}
|
|
171
|
+
*/
|
|
172
|
+
export function decode(bytes) {
|
|
173
|
+
try {
|
|
174
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
175
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export2);
|
|
176
|
+
const len0 = WASM_VECTOR_LEN;
|
|
177
|
+
wasm.decode(retptr, ptr0, len0);
|
|
178
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
179
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
180
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
181
|
+
if (r2) {
|
|
182
|
+
throw takeObject(r1);
|
|
183
|
+
}
|
|
184
|
+
return DecodedImage.__wrap(r0);
|
|
185
|
+
}
|
|
186
|
+
finally {
|
|
187
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Encodes RGBA8 with the options JSON (`{"format":"png"}`).
|
|
192
|
+
* @param {number} width
|
|
193
|
+
* @param {number} height
|
|
194
|
+
* @param {Uint8Array} data
|
|
195
|
+
* @param {string} options_json
|
|
196
|
+
* @returns {Uint8Array}
|
|
197
|
+
*/
|
|
198
|
+
export function encode(width, height, data, options_json) {
|
|
199
|
+
try {
|
|
200
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
201
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_export2);
|
|
202
|
+
const len0 = WASM_VECTOR_LEN;
|
|
203
|
+
const ptr1 = passStringToWasm0(options_json, wasm.__wbindgen_export2, wasm.__wbindgen_export3);
|
|
204
|
+
const len1 = WASM_VECTOR_LEN;
|
|
205
|
+
wasm.encode(retptr, width, height, ptr0, len0, ptr1, len1);
|
|
206
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
207
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
208
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
209
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
210
|
+
if (r3) {
|
|
211
|
+
throw takeObject(r2);
|
|
212
|
+
}
|
|
213
|
+
var v3 = getArrayU8FromWasm0(r0, r1).slice();
|
|
214
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
215
|
+
return v3;
|
|
216
|
+
}
|
|
217
|
+
finally {
|
|
218
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Installs a panic hook that forwards Rust panics to `console.error`.
|
|
223
|
+
* No-op unless the crate is built with the `debug` feature.
|
|
224
|
+
*/
|
|
225
|
+
export function init_debug() {
|
|
226
|
+
wasm.init_debug();
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* @param {number} width
|
|
230
|
+
* @param {number} height
|
|
231
|
+
* @param {Uint8Array} data
|
|
232
|
+
* @param {string} plan_json
|
|
233
|
+
* @returns {RenderedImage}
|
|
234
|
+
*/
|
|
235
|
+
export function renderRgba(width, height, data, plan_json) {
|
|
236
|
+
try {
|
|
237
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
238
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_export2);
|
|
239
|
+
const len0 = WASM_VECTOR_LEN;
|
|
240
|
+
const ptr1 = passStringToWasm0(plan_json, wasm.__wbindgen_export2, wasm.__wbindgen_export3);
|
|
241
|
+
const len1 = WASM_VECTOR_LEN;
|
|
242
|
+
wasm.renderRgba(retptr, width, height, ptr0, len0, ptr1, len1);
|
|
243
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
244
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
245
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
246
|
+
if (r2) {
|
|
247
|
+
throw takeObject(r1);
|
|
248
|
+
}
|
|
249
|
+
return RenderedImage.__wrap(r0);
|
|
250
|
+
}
|
|
251
|
+
finally {
|
|
252
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Deterministic proxy: downscales so the longer side is at most `max_side`.
|
|
257
|
+
* Returns the input unchanged (copied) when it is already small enough.
|
|
258
|
+
* @param {number} width
|
|
259
|
+
* @param {number} height
|
|
260
|
+
* @param {Uint8Array} data
|
|
261
|
+
* @param {number} max_side
|
|
262
|
+
* @returns {RenderedImage}
|
|
263
|
+
*/
|
|
264
|
+
export function resizeProxy(width, height, data, max_side) {
|
|
265
|
+
try {
|
|
266
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
267
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_export2);
|
|
268
|
+
const len0 = WASM_VECTOR_LEN;
|
|
269
|
+
wasm.resizeProxy(retptr, width, height, ptr0, len0, max_side);
|
|
270
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
271
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
272
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
273
|
+
if (r2) {
|
|
274
|
+
throw takeObject(r1);
|
|
275
|
+
}
|
|
276
|
+
return RenderedImage.__wrap(r0);
|
|
277
|
+
}
|
|
278
|
+
finally {
|
|
279
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Resolves stage geometry for `plan_json` on a buffer of `width` x `height`
|
|
284
|
+
* and returns it as JSON. The UI uses this instead of doing any geometry math.
|
|
285
|
+
* @param {string} plan_json
|
|
286
|
+
* @param {number} width
|
|
287
|
+
* @param {number} height
|
|
288
|
+
* @returns {string}
|
|
289
|
+
*/
|
|
290
|
+
export function resolveGeometry(plan_json, width, height) {
|
|
291
|
+
let deferred3_0;
|
|
292
|
+
let deferred3_1;
|
|
293
|
+
try {
|
|
294
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
295
|
+
const ptr0 = passStringToWasm0(plan_json, wasm.__wbindgen_export2, wasm.__wbindgen_export3);
|
|
296
|
+
const len0 = WASM_VECTOR_LEN;
|
|
297
|
+
wasm.resolveGeometry(retptr, ptr0, len0, width, height);
|
|
298
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
299
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
300
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
301
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
302
|
+
var ptr2 = r0;
|
|
303
|
+
var len2 = r1;
|
|
304
|
+
if (r3) {
|
|
305
|
+
ptr2 = 0;
|
|
306
|
+
len2 = 0;
|
|
307
|
+
throw takeObject(r2);
|
|
308
|
+
}
|
|
309
|
+
deferred3_0 = ptr2;
|
|
310
|
+
deferred3_1 = len2;
|
|
311
|
+
return getStringFromWasm0(ptr2, len2);
|
|
312
|
+
}
|
|
313
|
+
finally {
|
|
314
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
315
|
+
wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* SHA-256 of `bytes` as lowercase hex.
|
|
320
|
+
* @param {Uint8Array} bytes
|
|
321
|
+
* @returns {string}
|
|
322
|
+
*/
|
|
323
|
+
export function sha256_hex(bytes) {
|
|
324
|
+
let deferred2_0;
|
|
325
|
+
let deferred2_1;
|
|
326
|
+
try {
|
|
327
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
328
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export2);
|
|
329
|
+
const len0 = WASM_VECTOR_LEN;
|
|
330
|
+
wasm.sha256_hex(retptr, ptr0, len0);
|
|
331
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
332
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
333
|
+
deferred2_0 = r0;
|
|
334
|
+
deferred2_1 = r1;
|
|
335
|
+
return getStringFromWasm0(r0, r1);
|
|
336
|
+
}
|
|
337
|
+
finally {
|
|
338
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
339
|
+
wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Semantic version of the core crate compiled into this binary.
|
|
344
|
+
* @returns {string}
|
|
345
|
+
*/
|
|
346
|
+
export function version() {
|
|
347
|
+
let deferred1_0;
|
|
348
|
+
let deferred1_1;
|
|
349
|
+
try {
|
|
350
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
351
|
+
wasm.version(retptr);
|
|
352
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
353
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
354
|
+
deferred1_0 = r0;
|
|
355
|
+
deferred1_1 = r1;
|
|
356
|
+
return getStringFromWasm0(r0, r1);
|
|
357
|
+
}
|
|
358
|
+
finally {
|
|
359
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
360
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
function __wbg_get_imports() {
|
|
364
|
+
const import0 = {
|
|
365
|
+
__proto__: null,
|
|
366
|
+
__wbg___wbindgen_throw_5d9e815e6fdf150f: function (arg0, arg1) {
|
|
367
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
368
|
+
},
|
|
369
|
+
__wbg_new_a32a1ab6c6655abe: function (arg0, arg1) {
|
|
370
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
371
|
+
return addHeapObject(ret);
|
|
372
|
+
},
|
|
373
|
+
__wbg_new_bebc3f4757acf305: function () {
|
|
374
|
+
const ret = new Object();
|
|
375
|
+
return addHeapObject(ret);
|
|
376
|
+
},
|
|
377
|
+
__wbg_set_a377297433dfea63: function () {
|
|
378
|
+
return handleError(function (arg0, arg1, arg2) {
|
|
379
|
+
const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
|
|
380
|
+
return ret;
|
|
381
|
+
}, arguments);
|
|
382
|
+
},
|
|
383
|
+
__wbg_set_name_6e2a5da46a9ae1e7: function (arg0, arg1, arg2) {
|
|
384
|
+
getObject(arg0).name = getStringFromWasm0(arg1, arg2);
|
|
385
|
+
},
|
|
386
|
+
__wbindgen_generic_0000000000000001: function (arg0, arg1) {
|
|
387
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
388
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
389
|
+
return addHeapObject(ret);
|
|
390
|
+
},
|
|
391
|
+
__wbindgen_object_drop_ref: function (arg0) {
|
|
392
|
+
takeObject(arg0);
|
|
393
|
+
},
|
|
394
|
+
};
|
|
395
|
+
return {
|
|
396
|
+
__proto__: null,
|
|
397
|
+
"./sealpixel_core_bg.js": import0,
|
|
398
|
+
};
|
|
399
|
+
}
|
|
400
|
+
const DecodedImageFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
401
|
+
? { register: () => { }, unregister: () => { } }
|
|
402
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_decodedimage_free(ptr, 1));
|
|
403
|
+
const RenderedImageFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
404
|
+
? { register: () => { }, unregister: () => { } }
|
|
405
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_renderedimage_free(ptr, 1));
|
|
406
|
+
function addHeapObject(obj) {
|
|
407
|
+
if (heap_next === heap.length)
|
|
408
|
+
heap.push(heap.length + 1);
|
|
409
|
+
const idx = heap_next;
|
|
410
|
+
heap_next = heap[idx];
|
|
411
|
+
heap[idx] = obj;
|
|
412
|
+
return idx;
|
|
413
|
+
}
|
|
414
|
+
function dropObject(idx) {
|
|
415
|
+
if (idx < 1028)
|
|
416
|
+
return;
|
|
417
|
+
heap[idx] = heap_next;
|
|
418
|
+
heap_next = idx;
|
|
419
|
+
}
|
|
420
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
421
|
+
ptr = ptr >>> 0;
|
|
422
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
423
|
+
}
|
|
424
|
+
let cachedDataViewMemory0 = null;
|
|
425
|
+
function getDataViewMemory0() {
|
|
426
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
427
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
428
|
+
}
|
|
429
|
+
return cachedDataViewMemory0;
|
|
430
|
+
}
|
|
431
|
+
function getStringFromWasm0(ptr, len) {
|
|
432
|
+
return decodeText(ptr >>> 0, len);
|
|
433
|
+
}
|
|
434
|
+
let cachedUint8ArrayMemory0 = null;
|
|
435
|
+
function getUint8ArrayMemory0() {
|
|
436
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
437
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
438
|
+
}
|
|
439
|
+
return cachedUint8ArrayMemory0;
|
|
440
|
+
}
|
|
441
|
+
function getObject(idx) { return heap[idx]; }
|
|
442
|
+
function handleError(f, args) {
|
|
443
|
+
try {
|
|
444
|
+
return f.apply(this, args);
|
|
445
|
+
}
|
|
446
|
+
catch (e) {
|
|
447
|
+
wasm.__wbindgen_export(addHeapObject(e));
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
let heap = new Array(1024).fill(undefined);
|
|
451
|
+
heap.push(undefined, null, true, false);
|
|
452
|
+
let heap_next = heap.length;
|
|
453
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
454
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
455
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
456
|
+
WASM_VECTOR_LEN = arg.length;
|
|
457
|
+
return ptr;
|
|
458
|
+
}
|
|
459
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
460
|
+
if (realloc === undefined) {
|
|
461
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
462
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
463
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
464
|
+
WASM_VECTOR_LEN = buf.length;
|
|
465
|
+
return ptr;
|
|
466
|
+
}
|
|
467
|
+
let len = arg.length;
|
|
468
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
469
|
+
const mem = getUint8ArrayMemory0();
|
|
470
|
+
let offset = 0;
|
|
471
|
+
for (; offset < len; offset++) {
|
|
472
|
+
const code = arg.charCodeAt(offset);
|
|
473
|
+
if (code > 0x7F)
|
|
474
|
+
break;
|
|
475
|
+
mem[ptr + offset] = code;
|
|
476
|
+
}
|
|
477
|
+
if (offset !== len) {
|
|
478
|
+
if (offset !== 0) {
|
|
479
|
+
arg = arg.slice(offset);
|
|
480
|
+
}
|
|
481
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
482
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
483
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
484
|
+
offset += ret.written;
|
|
485
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
486
|
+
}
|
|
487
|
+
WASM_VECTOR_LEN = offset;
|
|
488
|
+
return ptr;
|
|
489
|
+
}
|
|
490
|
+
function takeObject(idx) {
|
|
491
|
+
const ret = getObject(idx);
|
|
492
|
+
dropObject(idx);
|
|
493
|
+
return ret;
|
|
494
|
+
}
|
|
495
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
496
|
+
cachedTextDecoder.decode();
|
|
497
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
498
|
+
let numBytesDecoded = 0;
|
|
499
|
+
function decodeText(ptr, len) {
|
|
500
|
+
numBytesDecoded += len;
|
|
501
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
502
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
503
|
+
cachedTextDecoder.decode();
|
|
504
|
+
numBytesDecoded = len;
|
|
505
|
+
}
|
|
506
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
507
|
+
}
|
|
508
|
+
const cachedTextEncoder = new TextEncoder();
|
|
509
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
510
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
511
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
512
|
+
view.set(buf);
|
|
513
|
+
return {
|
|
514
|
+
read: arg.length,
|
|
515
|
+
written: buf.length
|
|
516
|
+
};
|
|
517
|
+
};
|
|
518
|
+
}
|
|
519
|
+
let WASM_VECTOR_LEN = 0;
|
|
520
|
+
let wasmModule, wasmInstance, wasm;
|
|
521
|
+
function __wbg_finalize_init(instance, module) {
|
|
522
|
+
wasmInstance = instance;
|
|
523
|
+
wasm = instance.exports;
|
|
524
|
+
wasmModule = module;
|
|
525
|
+
cachedDataViewMemory0 = null;
|
|
526
|
+
cachedUint8ArrayMemory0 = null;
|
|
527
|
+
return wasm;
|
|
528
|
+
}
|
|
529
|
+
async function __wbg_load(module, imports) {
|
|
530
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
531
|
+
if (!module.ok) {
|
|
532
|
+
throw new Error(`failed to fetch Wasm: ${module.status} ${module.statusText} fetching '${module.url}'`);
|
|
533
|
+
}
|
|
534
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
535
|
+
try {
|
|
536
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
537
|
+
}
|
|
538
|
+
catch (e) {
|
|
539
|
+
const validResponse = expectedResponseType(module.type);
|
|
540
|
+
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
541
|
+
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
542
|
+
}
|
|
543
|
+
else {
|
|
544
|
+
throw e;
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
const bytes = await module.arrayBuffer();
|
|
549
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
550
|
+
}
|
|
551
|
+
else {
|
|
552
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
553
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
554
|
+
return { instance, module };
|
|
555
|
+
}
|
|
556
|
+
else {
|
|
557
|
+
return instance;
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
function expectedResponseType(type) {
|
|
561
|
+
switch (type) {
|
|
562
|
+
case 'basic':
|
|
563
|
+
case 'cors':
|
|
564
|
+
case 'default': return true;
|
|
565
|
+
}
|
|
566
|
+
return false;
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
function initSync(module) {
|
|
570
|
+
if (wasm !== undefined)
|
|
571
|
+
return wasm;
|
|
572
|
+
if (module !== undefined) {
|
|
573
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
574
|
+
({ module } = module);
|
|
575
|
+
}
|
|
576
|
+
else {
|
|
577
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead');
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
const imports = __wbg_get_imports();
|
|
581
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
582
|
+
module = new WebAssembly.Module(module);
|
|
583
|
+
}
|
|
584
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
585
|
+
return __wbg_finalize_init(instance, module);
|
|
586
|
+
}
|
|
587
|
+
async function __wbg_init(module_or_path) {
|
|
588
|
+
if (wasm !== undefined)
|
|
589
|
+
return wasm;
|
|
590
|
+
if (module_or_path !== undefined) {
|
|
591
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
592
|
+
({ module_or_path } = module_or_path);
|
|
593
|
+
}
|
|
594
|
+
else {
|
|
595
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead');
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
if (module_or_path === undefined) {
|
|
599
|
+
module_or_path = new URL('sealpixel_core_bg.wasm', import.meta.url);
|
|
600
|
+
}
|
|
601
|
+
const imports = __wbg_get_imports();
|
|
602
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
603
|
+
module_or_path = fetch(module_or_path);
|
|
604
|
+
}
|
|
605
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
606
|
+
return __wbg_finalize_init(instance, module);
|
|
607
|
+
}
|
|
608
|
+
export { initSync, __wbg_init as default };
|
|
609
|
+
//# sourceMappingURL=sealpixel_core.js.map
|
|
@@ -0,0 +1 @@
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,CAAC,EAAC,cAAc,EAAC,GAAG,cAAc,CAAC,CAAA;QACvC,CAAC;aAAM,CAAC;YACJ,OAAO,CAAC,IAAI,CAAC,2FAA2F,CAAC,CAAA;QAC7G,CAAC;IACL,CAAC;IAED,IAAI,cAAc,KAAK,SAAS,EAAE,CAAC;QAC/B,cAAc,GAAG,IAAI,GAAG,CAAC,wBAAwB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACxE,CAAC;IACD,MAAM,OAAO,GAAG,iBAAiB,EAAE,CAAC;IAEpC,IAAI,OAAO,cAAc,KAAK,QAAQ,IAAI,CAAC,OAAO,OAAO,KAAK,UAAU,IAAI,cAAc,YAAY,OAAO,CAAC,IAAI,CAAC,OAAO,GAAG,KAAK,UAAU,IAAI,cAAc,YAAY,GAAG,CAAC,EAAE,CAAC;QAC7K,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC,CAAC;IAC3C,CAAC;IAED,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,UAAU,CAAC,MAAM,cAAc,EAAE,OAAO,CAAC,CAAC;IAE7E,OAAO,mBAAmB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;AACjD,CAAC;AAED,OAAO,EAAE,QAAQ,EAAE,UAAU,IAAI,OAAO,EAAE,CAAC"}
|
|
Binary file
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
export const memory: WebAssembly.Memory;
|
|
4
|
+
export const __wbg_decodedimage_free: (a: number, b: number) => void;
|
|
5
|
+
export const __wbg_renderedimage_free: (a: number, b: number) => void;
|
|
6
|
+
export const assetClear: () => void;
|
|
7
|
+
export const assetHas: (a: number, b: number) => number;
|
|
8
|
+
export const assetPut: (a: number, b: number, c: number, d: number) => void;
|
|
9
|
+
export const decode: (a: number, b: number, c: number) => void;
|
|
10
|
+
export const decodedimage_height: (a: number) => number;
|
|
11
|
+
export const decodedimage_mimeType: (a: number, b: number) => void;
|
|
12
|
+
export const decodedimage_takeData: (a: number, b: number) => void;
|
|
13
|
+
export const decodedimage_width: (a: number) => number;
|
|
14
|
+
export const encode: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
15
|
+
export const init_debug: () => void;
|
|
16
|
+
export const renderRgba: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
17
|
+
export const renderedimage_height: (a: number) => number;
|
|
18
|
+
export const renderedimage_takeData: (a: number, b: number) => void;
|
|
19
|
+
export const renderedimage_width: (a: number) => number;
|
|
20
|
+
export const resizeProxy: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
21
|
+
export const resolveGeometry: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
22
|
+
export const sha256_hex: (a: number, b: number, c: number) => void;
|
|
23
|
+
export const version: (a: number) => void;
|
|
24
|
+
export const __wbindgen_export: (a: number) => void;
|
|
25
|
+
export const __wbindgen_export2: (a: number, b: number) => number;
|
|
26
|
+
export const __wbindgen_export3: (a: number, b: number, c: number, d: number) => number;
|
|
27
|
+
export const __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
28
|
+
export const __wbindgen_export4: (a: number, b: number, c: number) => void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { LoadOptions, SealpixelWasm } from './types.js';
|
|
2
|
+
export type * from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Loads the Sealpixel core in browsers and workers. Bundlers resolve the
|
|
5
|
+
* `new URL(..., import.meta.url)` reference and emit the binary as an asset.
|
|
6
|
+
*/
|
|
7
|
+
export declare function loadSealpixelWasm(options?: LoadOptions): Promise<SealpixelWasm>;
|
|
8
|
+
//# sourceMappingURL=index.browser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.browser.d.ts","sourceRoot":"","sources":["../src/index.browser.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAG7D,mBAAmB,YAAY,CAAC;AAShC;;;GAGG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,GAAE,WAAgB,GAAG,OAAO,CAAC,aAAa,CAAC,CAIzF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as glue from './generated/sealpixel_core.js';
|
|
2
|
+
import { once, wrap } from './wrap.js';
|
|
3
|
+
const defaultLoad = once(async () => {
|
|
4
|
+
await glue.default({
|
|
5
|
+
module_or_path: new URL('./generated/sealpixel_core_bg.wasm', import.meta.url),
|
|
6
|
+
});
|
|
7
|
+
return wrap(glue);
|
|
8
|
+
});
|
|
9
|
+
/**
|
|
10
|
+
* Loads the Sealpixel core in browsers and workers. Bundlers resolve the
|
|
11
|
+
* `new URL(..., import.meta.url)` reference and emit the binary as an asset.
|
|
12
|
+
*/
|
|
13
|
+
export async function loadSealpixelWasm(options = {}) {
|
|
14
|
+
if (options.module === undefined)
|
|
15
|
+
return defaultLoad();
|
|
16
|
+
await glue.default({ module_or_path: options.module });
|
|
17
|
+
return wrap(glue);
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=index.browser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.browser.js","sourceRoot":"","sources":["../src/index.browser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,+BAA+B,CAAC;AAEtD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAIvC,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,IAAI,EAAE;IAClC,MAAM,IAAI,CAAC,OAAO,CAAC;QACjB,cAAc,EAAE,IAAI,GAAG,CAAC,oCAAoC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;KAC/E,CAAC,CAAC;IACH,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,UAAuB,EAAE;IAC/D,IAAI,OAAO,CAAC,MAAM,KAAK,SAAS;QAAE,OAAO,WAAW,EAAE,CAAC;IACvD,MAAM,IAAI,CAAC,OAAO,CAAC,EAAE,cAAc,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACvD,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC;AACpB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type entry point. Runtime entry points are `index.browser.ts` and
|
|
3
|
+
* `index.node.ts`, selected through the `exports` conditions in package.json.
|
|
4
|
+
*/
|
|
5
|
+
export type * from './types.js';
|
|
6
|
+
export declare function loadSealpixelWasm(options?: import('./types.js').LoadOptions): Promise<import('./types.js').SealpixelWasm>;
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,mBAAmB,YAAY,CAAC;AAChC,MAAM,CAAC,OAAO,UAAU,iBAAiB,CACvC,OAAO,CAAC,EAAE,OAAO,YAAY,EAAE,WAAW,GACzC,OAAO,CAAC,OAAO,YAAY,EAAE,aAAa,CAAC,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { LoadOptions, SealpixelWasm } from './types.js';
|
|
2
|
+
export type * from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Loads the Sealpixel core on Node, Deno and Bun by reading the binary from disk.
|
|
5
|
+
* Works with esbuild bundling when `.wasm` files are copied as assets.
|
|
6
|
+
*/
|
|
7
|
+
export declare function loadSealpixelWasm(options?: LoadOptions): Promise<SealpixelWasm>;
|
|
8
|
+
//# sourceMappingURL=index.node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.node.d.ts","sourceRoot":"","sources":["../src/index.node.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAG7D,mBAAmB,YAAY,CAAC;AAuBhC;;;GAGG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,GAAE,WAAgB,GAAG,OAAO,CAAC,aAAa,CAAC,CAMzF"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { readFile } from 'node:fs/promises';
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
3
|
+
import * as glue from './generated/sealpixel_core.js';
|
|
4
|
+
import { once, wrap } from './wrap.js';
|
|
5
|
+
const defaultLoad = once(async () => {
|
|
6
|
+
await glue.default({ module_or_path: await readBinary() });
|
|
7
|
+
return wrap(glue);
|
|
8
|
+
});
|
|
9
|
+
/**
|
|
10
|
+
* The binary sits next to the glue in the published package. Bundlers that
|
|
11
|
+
* inline this module move `import.meta.url`, so fall back to resolving the
|
|
12
|
+
* package export `@sealpixel/wasm/sealpixel_core_bg.wasm` from node_modules.
|
|
13
|
+
*/
|
|
14
|
+
async function readBinary() {
|
|
15
|
+
const local = new URL('./generated/sealpixel_core_bg.wasm', import.meta.url);
|
|
16
|
+
try {
|
|
17
|
+
return await readFile(fileURLToPath(local));
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
if (error.code !== 'ENOENT')
|
|
21
|
+
throw error;
|
|
22
|
+
const resolved = import.meta.resolve('@sealpixel/wasm/sealpixel_core_bg.wasm');
|
|
23
|
+
return readFile(fileURLToPath(resolved));
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Loads the Sealpixel core on Node, Deno and Bun by reading the binary from disk.
|
|
28
|
+
* Works with esbuild bundling when `.wasm` files are copied as assets.
|
|
29
|
+
*/
|
|
30
|
+
export async function loadSealpixelWasm(options = {}) {
|
|
31
|
+
if (options.module === undefined)
|
|
32
|
+
return defaultLoad();
|
|
33
|
+
const source = typeof options.module === 'string' ? await readFile(options.module) : options.module;
|
|
34
|
+
await glue.default({ module_or_path: source });
|
|
35
|
+
return wrap(glue);
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=index.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.node.js","sourceRoot":"","sources":["../src/index.node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,IAAI,MAAM,+BAA+B,CAAC;AAEtD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAIvC,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,IAAI,EAAE;IAClC,MAAM,IAAI,CAAC,OAAO,CAAC,EAAE,cAAc,EAAE,MAAM,UAAU,EAAE,EAAE,CAAC,CAAC;IAC3D,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC;AAEH;;;;GAIG;AACH,KAAK,UAAU,UAAU;IACvB,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,oCAAoC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC7E,IAAI,CAAC;QACH,OAAO,MAAM,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;IAC9C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAK,KAA2B,CAAC,IAAI,KAAK,QAAQ;YAAE,MAAM,KAAK,CAAC;QAChE,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,wCAAwC,CAAC,CAAC;QAC/E,OAAO,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC3C,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,UAAuB,EAAE;IAC/D,IAAI,OAAO,CAAC,MAAM,KAAK,SAAS;QAAE,OAAO,WAAW,EAAE,CAAC;IACvD,MAAM,MAAM,GACV,OAAO,OAAO,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;IACvF,MAAM,IAAI,CAAC,OAAO,CAAC,EAAE,cAAc,EAAE,MAAM,EAAE,CAAC,CAAC;IAC/C,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC;AACpB,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RGBA8 pixel buffer, straight alpha, row-major, no padding.
|
|
3
|
+
* `data.length === width * height * 4`.
|
|
4
|
+
*/
|
|
5
|
+
export interface RgbaBuffer {
|
|
6
|
+
readonly width: number;
|
|
7
|
+
readonly height: number;
|
|
8
|
+
readonly data: Uint8Array;
|
|
9
|
+
}
|
|
10
|
+
/** Result of decoding a container into pixels. */
|
|
11
|
+
export interface DecodedImage extends RgbaBuffer {
|
|
12
|
+
/** Container the bytes came from, e.g. `image/png`. */
|
|
13
|
+
readonly mimeType: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Typed surface over the WASM exports. Every call copies its input into WASM
|
|
17
|
+
* memory and copies the result out, so callers never hold views into the
|
|
18
|
+
* WASM heap.
|
|
19
|
+
*/
|
|
20
|
+
export interface SealpixelWasm {
|
|
21
|
+
/** Version of the Rust core compiled into this binary. */
|
|
22
|
+
version(): string;
|
|
23
|
+
/** SHA-256 of `bytes`, lowercase hex. */
|
|
24
|
+
sha256Hex(bytes: Uint8Array): string;
|
|
25
|
+
/** Decodes PNG (and, in later milestones, JPEG and WebP). */
|
|
26
|
+
decode(bytes: Uint8Array): DecodedImage;
|
|
27
|
+
/** Encodes pixels using `OutputOptions` JSON, e.g. `{"format":"png"}`. */
|
|
28
|
+
encode(image: RgbaBuffer, optionsJson: string): Uint8Array;
|
|
29
|
+
/** Executes a `RenderPlan` JSON on the pixels. */
|
|
30
|
+
renderRgba(image: RgbaBuffer, planJson: string): RgbaBuffer;
|
|
31
|
+
/** Stage geometry (JSON) for a plan executed on a buffer of the given size. */
|
|
32
|
+
resolveGeometry(planJson: string, width: number, height: number): string;
|
|
33
|
+
/** Deterministic downscale so the longer side is at most `maxSide`. Never upscales. */
|
|
34
|
+
resizeProxy(image: RgbaBuffer, maxSide: number): RgbaBuffer;
|
|
35
|
+
/** Stores a font or image for kernels that reference it by id. Verify the hash first. */
|
|
36
|
+
assetPut(id: string, bytes: Uint8Array): void;
|
|
37
|
+
assetHas(id: string): boolean;
|
|
38
|
+
assetClear(): void;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Error thrown by every `SealpixelWasm` method. `name` is the stable code from
|
|
42
|
+
* the Rust core (`INVALID_PLAN`, `DECODE_FAILED`, ...), `message` the detail.
|
|
43
|
+
*/
|
|
44
|
+
export interface SealpixelWasmError extends Error {
|
|
45
|
+
readonly name: SealpixelErrorCode | string;
|
|
46
|
+
}
|
|
47
|
+
export type SealpixelErrorCode = 'DECODE_FAILED' | 'ENCODE_FAILED' | 'UNSUPPORTED_FORMAT' | 'INVALID_PLAN' | 'TOO_LARGE' | 'BUFFER_MISMATCH' | 'MISSING_ASSET' | 'ALREADY_TAKEN';
|
|
48
|
+
/** Input accepted by the loaders when the caller supplies the binary itself. */
|
|
49
|
+
export type WasmSource = WebAssembly.Module | BufferSource | URL | Response | string;
|
|
50
|
+
export interface LoadOptions {
|
|
51
|
+
/**
|
|
52
|
+
* Pre-fetched binary, compiled module, URL or path. When omitted, the
|
|
53
|
+
* runtime-specific loader locates `sealpixel_core_bg.wasm` next to the glue.
|
|
54
|
+
*/
|
|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AC;IAC9B,UAAU,IAAI,IAAI,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAmB,SAAQ,KAAK;IAC/C,QAAQ,CAAC,IAAI,EAAE,kBAAkB,GAAG,MAAM,CAAC;CAC5C;AAED,MAAM,MAAM,kBAAkB,GAC1B,eAAe,GACf,eAAe,GACf,oBAAoB,GACpB,cAAc,GACd,WAAW,GACX,iBAAiB,GACjB,eAAe,GACf,eAAe,CAAC;AAEpB,gFAAgF;AAChF,MAAM,MAAM,UAAU,GAAG,WAAW,CAAC,MAAM,GAAG,YAAY,GAAG,GAAG,GAAG,QAAQ,GAAG,MAAM,CAAC;AAErF,MAAM,WAAW,WAAW;IAC1B;;;OAGG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
package/dist/wrap.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type * as Glue from './generated/sealpixel_core.js';
|
|
2
|
+
import type { SealpixelWasm } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Wraps the raw wasm-bindgen exports into the typed `SealpixelWasm` surface.
|
|
5
|
+
* The glue module must already be initialised.
|
|
6
|
+
*/
|
|
7
|
+
export declare function wrap(glue: typeof Glue): SealpixelWasm;
|
|
8
|
+
/** Memoises one initialisation per process so repeated loads are free. */
|
|
9
|
+
export declare function once<T>(load: () => Promise<T>): () => Promise<T>;
|
|
10
|
+
//# sourceMappingURL=wrap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wrap.d.ts","sourceRoot":"","sources":["../src/wrap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,IAAI,MAAM,+BAA+B,CAAC;AAC3D,OAAO,KAAK,EAA4B,aAAa,EAAE,MAAM,YAAY,CAAC;AAE1E;;;GAGG;AACH,wBAAgB,IAAI,CAAC,IAAI,EAAE,OAAO,IAAI,GAAG,aAAa,CA2BrD;AAUD,0EAA0E;AAC1E,wBAAgB,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,MAAM,OAAO,CAAC,CAAC,CAAC,CAShE"}
|
package/dist/wrap.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wraps the raw wasm-bindgen exports into the typed `SealpixelWasm` surface.
|
|
3
|
+
* The glue module must already be initialised.
|
|
4
|
+
*/
|
|
5
|
+
export function wrap(glue) {
|
|
6
|
+
return {
|
|
7
|
+
version: () => glue.version(),
|
|
8
|
+
sha256Hex: (bytes) => glue.sha256_hex(bytes),
|
|
9
|
+
decode: (bytes) => {
|
|
10
|
+
const decoded = glue.decode(bytes);
|
|
11
|
+
try {
|
|
12
|
+
return {
|
|
13
|
+
width: decoded.width,
|
|
14
|
+
height: decoded.height,
|
|
15
|
+
mimeType: decoded.mimeType,
|
|
16
|
+
data: decoded.takeData(),
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
finally {
|
|
20
|
+
decoded.free();
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
encode: (image, optionsJson) => glue.encode(image.width, image.height, image.data, optionsJson),
|
|
24
|
+
renderRgba: (image, planJson) => takeRendered(glue.renderRgba(image.width, image.height, image.data, planJson)),
|
|
25
|
+
resolveGeometry: (planJson, width, height) => glue.resolveGeometry(planJson, width, height),
|
|
26
|
+
resizeProxy: (image, maxSide) => takeRendered(glue.resizeProxy(image.width, image.height, image.data, maxSide)),
|
|
27
|
+
assetPut: (id, bytes) => glue.assetPut(id, bytes),
|
|
28
|
+
assetHas: (id) => glue.assetHas(id),
|
|
29
|
+
assetClear: () => glue.assetClear(),
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function takeRendered(rendered) {
|
|
33
|
+
try {
|
|
34
|
+
return { width: rendered.width, height: rendered.height, data: rendered.takeData() };
|
|
35
|
+
}
|
|
36
|
+
finally {
|
|
37
|
+
rendered.free();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/** Memoises one initialisation per process so repeated loads are free. */
|
|
41
|
+
export function once(load) {
|
|
42
|
+
let pending;
|
|
43
|
+
return () => {
|
|
44
|
+
pending ??= load().catch((error) => {
|
|
45
|
+
pending = undefined;
|
|
46
|
+
throw error;
|
|
47
|
+
});
|
|
48
|
+
return pending;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=wrap.js.map
|
package/dist/wrap.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wrap.js","sourceRoot":"","sources":["../src/wrap.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,MAAM,UAAU,IAAI,CAAC,IAAiB;IACpC,OAAO;QACL,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE;QAC7B,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC;QAC5C,MAAM,EAAE,CAAC,KAAK,EAAgB,EAAE;YAC9B,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACnC,IAAI,CAAC;gBACH,OAAO;oBACL,KAAK,EAAE,OAAO,CAAC,KAAK;oBACpB,MAAM,EAAE,OAAO,CAAC,MAAM;oBACtB,QAAQ,EAAE,OAAO,CAAC,QAAQ;oBAC1B,IAAI,EAAE,OAAO,CAAC,QAAQ,EAAE;iBACzB,CAAC;YACJ,CAAC;oBAAS,CAAC;gBACT,OAAO,CAAC,IAAI,EAAE,CAAC;YACjB,CAAC;QACH,CAAC;QACD,MAAM,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE,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AAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;YACjC,OAAO,GAAG,SAAS,CAAC;YACpB,MAAM,KAAK,CAAC;QACd,CAAC,CAAC,CAAC;QACH,OAAO,OAAO,CAAC;IACjB,CAAC,CAAC;AACJ,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sealpixel/wasm",
|
|
3
|
+
"version": "1.0.0-rc.0",
|
|
4
|
+
"description": "The Sealpixel core compiled to WebAssembly, with loaders for browsers, Node, Deno and Bun. No logic lives here.",
|
|
5
|
+
"license": "BUSL-1.1",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/9feet/sealpixel.git",
|
|
9
|
+
"directory": "packages/wasm"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://docs.sealpixel.dev",
|
|
12
|
+
"bugs": "https://github.com/9feet/sealpixel/issues",
|
|
13
|
+
"type": "module",
|
|
14
|
+
"sideEffects": false,
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"README.md"
|
|
18
|
+
],
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"browser": "./dist/index.browser.js",
|
|
23
|
+
"workerd": "./dist/index.browser.js",
|
|
24
|
+
"deno": "./dist/index.node.js",
|
|
25
|
+
"bun": "./dist/index.node.js",
|
|
26
|
+
"node": "./dist/index.node.js",
|
|
27
|
+
"default": "./dist/index.browser.js"
|
|
28
|
+
},
|
|
29
|
+
"./sealpixel_core_bg.wasm": "./dist/generated/sealpixel_core_bg.wasm",
|
|
30
|
+
"./package.json": "./package.json"
|
|
31
|
+
},
|
|
32
|
+
"scripts": {
|
|
33
|
+
"build": "bash ../../scripts/build-wasm.sh && node build.mjs",
|
|
34
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
35
|
+
"test": "node --test test/*.node.test.mjs && deno test --no-check --allow-read --quiet test/*.deno.test.ts && bun test test/*.bun.test.ts"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@sealpixel/config": "workspace:*",
|
|
39
|
+
"@types/node": "^24.0.0",
|
|
40
|
+
"typescript": "^5.9.0"
|
|
41
|
+
}
|
|
42
|
+
}
|