@sanox/sangine-core 0.2.4 → 0.2.5
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.cjs.js +1 -1
- package/dist/index.es.js +61 -58
- package/dist/wasm/sangine/{sangine.52e59288.js → sangine.77477298.js} +52 -29
- package/dist/wasm/sangine/sangine.d.ts +38 -16
- package/dist/wasm/sangine/{sangine_bg.52e59288.wasm → sangine_bg.77477298.wasm} +0 -0
- package/dist/wasm/sangine/sangine_bg.wasm.d.ts +16 -16
- package/dist/wasm/sbo-decode/{wasm_sbo_decode.95e75786.js → wasm_sbo_decode.fa5ceba1.js} +1 -1
- package/dist/wasm/sbo-decode/wasm_sbo_decode_bg.fa5ceba1.wasm +0 -0
- package/dist/wasm-hashes/sangine.d.ts +1 -1
- package/dist/wasm-hashes/sbo-decode.d.ts +1 -1
- package/dist/worker/decodeWorkerImpl.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/wasm/sbo-decode/wasm_sbo_decode_bg.95e75786.wasm +0 -0
package/dist/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var f=Object.defineProperty;var y=(
|
|
1
|
+
"use strict";var f=Object.defineProperty;var y=(n,e,t)=>e in n?f(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var o=(n,e,t)=>y(n,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g="/static/sangine/wasm",_="77477298";class p{constructor(e,t){o(this,"workers");o(this,"idle");o(this,"queue",[]);this.workers=Array.from({length:t},e),this.idle=[...this.workers]}run(e){return new Promise((t,i)=>{const r=this.idle.pop();r?this.dispatch(r,e,t,i):this.queue.push({request:e,resolve:t,reject:i})})}dispatch(e,t,i,r){const d=s=>{i(s.data),a(),this.release(e)},c=s=>{r(s),a(),this.release(e)},a=()=>{e.removeEventListener("message",d),e.removeEventListener("error",c)};e.addEventListener("message",d,{once:!0}),e.addEventListener("error",c,{once:!0}),e.postMessage(t)}release(e){const t=this.queue.shift();t?this.dispatch(e,t.request,t.resolve,t.reject):this.idle.push(e)}terminate(){for(const e of this.workers)e.terminate()}}class R{constructor(e){o(this,"wasm",null);o(this,"callbackRegistry",{});o(this,"userActionRegistry",{});o(this,"windowCreatedPromiseRegistry",{});o(this,"windowCreatedPromiseResolveRegistry",{});o(this,"_inited",!1);o(this,"decodePool");o(this,"_readyPromise");o(this,"_resolveReady");o(this,"_rejectReady");this.config=e,this._readyPromise=new Promise((t,i)=>{this._resolveReady=t,this._rejectReady=i}),this.config=e}async init(){if(!(typeof window>"u")){if(this._inited)return this._readyPromise;try{const t=await import(new URL(`${g}/sangine/sangine.${_}.js`,window.location.origin).toString());await t.default(),this.wasm=t,this._inited=!0;const i=this.config.numWorkers??(navigator.hardwareConcurrency||2)-1;this.decodePool=new p(()=>this.config.createDecodeWorker(),Math.max(i,1)),this.wasm.register_asset_decoder(this.decodeAsset.bind(this)),this.wasm.register_event_listener(this.handleSangineEvent.bind(this)),this._resolveReady()}catch(e){throw this._rejectReady(e),e}return this._readyPromise}}ready(){return this._readyPromise}get inited(){return this._inited}getWasm(){if(!this.wasm)throw new Error("RendererService not initialized");return this.wasm}handleActionChanged(e,t){this.userActionRegistry[e]=t;for(const i of this.callbackRegistry[e].actionChanged)i(t)}handleMeasurementCreated(e,t){for(const i of this.callbackRegistry[e].measurementCreated)i(t)}handleRouteUpdated(e,t){for(const i of this.callbackRegistry[e].routeUpdated)i(t)}handleSangineEvent(e,t){t==="ready"?this.windowCreatedPromiseResolveRegistry[e]():"actionChanged"in t?this.handleActionChanged(e,t.actionChanged.action):"measurementCreated"in t?this.handleMeasurementCreated(e,t.measurementCreated.measurement):"routeUnderConstructionUpdated"in t&&this.handleRouteUpdated(e,t.routeUnderConstructionUpdated.route)}createWindow(e,t){if(!this.wasm)throw new Error("WASM not initialized");let i;const r=new Promise(c=>{i=c}),d=this.wasm.create_window(e,t);return this.windowCreatedPromiseResolveRegistry[d]=i,this.callbackRegistry[d]={actionChanged:[],routeUpdated:[],measurementCreated:[]},this.userActionRegistry[d]="watching",this.windowCreatedPromiseRegistry[d]=r,d}readUserAction(e){return this.userActionRegistry[e]}windowReady(e){return this.windowCreatedPromiseRegistry[e]}registerCallback(e,t,i){this.callbackRegistry[e][t].push(i)}setWindowAction(e,t){if(!this.wasm)throw new Error("WASM not initialized");this.wasm.set_window_action(e,t)}destroyWindow(e){if(!this.wasm)throw new Error("WASM not initialized");this.wasm.destroy_window(e),delete this.callbackRegistry[e],delete this.userActionRegistry[e]}setRouteHighlight(e,t,i){if(!this.wasm)throw new Error("WASM not initialized");this.wasm.set_route_highlight(e,t,i)}setRouteVisible(e,t,i){if(!this.wasm)throw new Error("WASM not initialized");this.wasm.set_route_visible(e,t,i)}animateToRoute(e,t){if(!this.wasm)throw new Error("WASM not initialized");this.wasm.animate_to_route(e,t)}setSunProperties(e,t,i,r,d,c,a){if(!this.wasm)throw new Error("WASM not initialized");this.wasm.set_sun_properties(e,t,i,r,d,c,a)}setNorthCorrection(e,t){if(!this.wasm)throw new Error("WASM not initialized");this.wasm.set_north_correction(e,t)}setGpuMemoryBudgetMb(e,t){if(!this.wasm)throw new Error("WASM not initialized");this.wasm.set_gpu_memory_budget_mb(e,t)}setRenderQuality(e,t){if(!this.wasm)throw new Error("WASM not initialized");this.wasm.set_render_quality(e,t)}readCameraPos(e){if(!this.wasm)throw new Error("WASM not initialized");return this.wasm.read_camera_pos(e)}animateTo(e,t){if(!this.wasm)throw new Error("WASM not initialized");this.wasm.animate_to(e,t)}setScale(e,t){if(!this.wasm)throw new Error("WASM not initialized");this.wasm.set_window_scale(e,t)}async decodeAsset(e){if(!this.decodePool)throw new Error("Renderer not initialized");return this.decodePool.run(e)}destroy(){var e;(e=this.decodePool)==null||e.terminate()}}const b="fa5ceba1";function A(n,e){let t=!1,i=null,r=null;async function d(c,a){if(r){const s=`https://sangine-asset-cache/${c}`,w=await r.match(s);if(w)return w;const l=await a(),h=await fetch(l);return h.ok&&await r.put(s,h.clone()),h}return fetch(await a())}n.onmessage=async c=>{if(!t){const w=await import(new URL(`${g}/sbo-decode/wasm_sbo_decode.${b}.js`,n.location.origin).href);await w.default(),i=w,t=!0}!r&&typeof caches<"u"&&(r=await caches.open("sangine-assets-v1"));const{data:a}=c;if("texture-file"in a)try{const s=await d(a["texture-file"].pk,()=>e(a));if(!s.ok)throw new Error(`HTTP error! status: ${s.status}`);const w=await s.blob(),l=await createImageBitmap(w),h=new OffscreenCanvas(l.width,l.height),m=h.getContext("2d");if(m===null)throw new Error("Couldnt create canvas");m.drawImage(l,0,0);const u=m.getImageData(0,0,h.width,h.height);n.postMessage({success:!0,width:h.width,height:h.height,data:u.data.buffer},[u.data.buffer])}catch(s){n.postMessage({success:!1,error:s.message})}else if("model-part-mesh"in a){const s=await d(a["model-part-mesh"].pk,()=>e(a));if(!s.ok)throw new Error(`HTTP error! status: ${s.status}`);const w=await s.arrayBuffer(),l=new Uint8Array(w),h=i.decode_sbo(l);n.postMessage({success:!0,data:h.buffer},[h.buffer])}}}exports.RendererService=R;exports.registerDecodeWorker=A;
|
package/dist/index.es.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
var
|
|
2
|
-
var y = (
|
|
3
|
-
var
|
|
4
|
-
const
|
|
1
|
+
var g = Object.defineProperty;
|
|
2
|
+
var y = (n, e, t) => e in n ? g(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
+
var o = (n, e, t) => y(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
const f = "/static/sangine/wasm", _ = "77477298";
|
|
5
5
|
class p {
|
|
6
6
|
constructor(e, t) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
o(this, "workers");
|
|
8
|
+
o(this, "idle");
|
|
9
|
+
o(this, "queue", []);
|
|
10
10
|
this.workers = Array.from({ length: t }, e), this.idle = [...this.workers];
|
|
11
11
|
}
|
|
12
12
|
run(e) {
|
|
13
13
|
return new Promise((t, s) => {
|
|
14
|
-
const
|
|
15
|
-
|
|
14
|
+
const r = this.idle.pop();
|
|
15
|
+
r ? this.dispatch(r, e, t, s) : this.queue.push({ request: e, resolve: t, reject: s });
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
|
-
dispatch(e, t, s,
|
|
19
|
-
const
|
|
20
|
-
s(i.data),
|
|
18
|
+
dispatch(e, t, s, r) {
|
|
19
|
+
const d = (i) => {
|
|
20
|
+
s(i.data), a(), this.release(e);
|
|
21
21
|
}, c = (i) => {
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
e.removeEventListener("message",
|
|
22
|
+
r(i), a(), this.release(e);
|
|
23
|
+
}, a = () => {
|
|
24
|
+
e.removeEventListener("message", d), e.removeEventListener("error", c);
|
|
25
25
|
};
|
|
26
|
-
e.addEventListener("message",
|
|
26
|
+
e.addEventListener("message", d, { once: !0 }), e.addEventListener("error", c, { once: !0 }), e.postMessage(t);
|
|
27
27
|
}
|
|
28
28
|
release(e) {
|
|
29
29
|
const t = this.queue.shift();
|
|
@@ -34,18 +34,18 @@ class p {
|
|
|
34
34
|
e.terminate();
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
class
|
|
37
|
+
class A {
|
|
38
38
|
constructor(e) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
39
|
+
o(this, "wasm", null);
|
|
40
|
+
o(this, "callbackRegistry", {});
|
|
41
|
+
o(this, "userActionRegistry", {});
|
|
42
|
+
o(this, "windowCreatedPromiseRegistry", {});
|
|
43
|
+
o(this, "windowCreatedPromiseResolveRegistry", {});
|
|
44
|
+
o(this, "_inited", !1);
|
|
45
|
+
o(this, "decodePool");
|
|
46
|
+
o(this, "_readyPromise");
|
|
47
|
+
o(this, "_resolveReady");
|
|
48
|
+
o(this, "_rejectReady");
|
|
49
49
|
this.config = e, this._readyPromise = new Promise((t, s) => {
|
|
50
50
|
this._resolveReady = t, this._rejectReady = s;
|
|
51
51
|
}), this.config = e;
|
|
@@ -55,7 +55,7 @@ class b {
|
|
|
55
55
|
if (this._inited) return this._readyPromise;
|
|
56
56
|
try {
|
|
57
57
|
const t = await import(new URL(
|
|
58
|
-
`${
|
|
58
|
+
`${f}/sangine/sangine.${_}.js`,
|
|
59
59
|
window.location.origin
|
|
60
60
|
).toString());
|
|
61
61
|
await t.default(), this.wasm = t, this._inited = !0;
|
|
@@ -100,14 +100,14 @@ class b {
|
|
|
100
100
|
createWindow(e, t) {
|
|
101
101
|
if (!this.wasm) throw new Error("WASM not initialized");
|
|
102
102
|
let s;
|
|
103
|
-
const
|
|
103
|
+
const r = new Promise((c) => {
|
|
104
104
|
s = c;
|
|
105
|
-
}),
|
|
106
|
-
return this.windowCreatedPromiseResolveRegistry[
|
|
105
|
+
}), d = this.wasm.create_window(e, t);
|
|
106
|
+
return this.windowCreatedPromiseResolveRegistry[d] = s, this.callbackRegistry[d] = {
|
|
107
107
|
actionChanged: [],
|
|
108
108
|
routeUpdated: [],
|
|
109
109
|
measurementCreated: []
|
|
110
|
-
}, this.userActionRegistry[
|
|
110
|
+
}, this.userActionRegistry[d] = "watching", this.windowCreatedPromiseRegistry[d] = r, d;
|
|
111
111
|
}
|
|
112
112
|
readUserAction(e) {
|
|
113
113
|
return this.userActionRegistry[e];
|
|
@@ -138,16 +138,16 @@ class b {
|
|
|
138
138
|
if (!this.wasm) throw new Error("WASM not initialized");
|
|
139
139
|
this.wasm.animate_to_route(e, t);
|
|
140
140
|
}
|
|
141
|
-
setSunProperties(e, t, s,
|
|
141
|
+
setSunProperties(e, t, s, r, d, c, a) {
|
|
142
142
|
if (!this.wasm) throw new Error("WASM not initialized");
|
|
143
143
|
this.wasm.set_sun_properties(
|
|
144
144
|
e,
|
|
145
145
|
t,
|
|
146
146
|
s,
|
|
147
|
-
|
|
148
|
-
|
|
147
|
+
r,
|
|
148
|
+
d,
|
|
149
149
|
c,
|
|
150
|
-
|
|
150
|
+
a
|
|
151
151
|
);
|
|
152
152
|
}
|
|
153
153
|
setNorthCorrection(e, t) {
|
|
@@ -183,28 +183,31 @@ class b {
|
|
|
183
183
|
(e = this.decodePool) == null || e.terminate();
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
|
-
const R = "
|
|
187
|
-
function E(
|
|
188
|
-
let t = !1, s = null,
|
|
189
|
-
async function
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
186
|
+
const R = "fa5ceba1";
|
|
187
|
+
function E(n, e) {
|
|
188
|
+
let t = !1, s = null, r = null;
|
|
189
|
+
async function d(c, a) {
|
|
190
|
+
if (r) {
|
|
191
|
+
const i = `https://sangine-asset-cache/${c}`, w = await r.match(i);
|
|
192
|
+
if (w) return w;
|
|
193
|
+
const l = await a(), h = await fetch(l);
|
|
194
|
+
return h.ok && await r.put(i, h.clone()), h;
|
|
195
|
+
}
|
|
196
|
+
return fetch(await a());
|
|
197
|
+
}
|
|
198
|
+
n.onmessage = async (c) => {
|
|
196
199
|
if (!t) {
|
|
197
200
|
const w = await import(new URL(
|
|
198
|
-
`${
|
|
199
|
-
|
|
201
|
+
`${f}/sbo-decode/wasm_sbo_decode.${R}.js`,
|
|
202
|
+
n.location.origin
|
|
200
203
|
).href);
|
|
201
204
|
await w.default(), s = w, t = !0;
|
|
202
205
|
}
|
|
203
|
-
|
|
204
|
-
const { data:
|
|
205
|
-
if ("texture-file" in
|
|
206
|
+
!r && typeof caches < "u" && (r = await caches.open("sangine-assets-v1"));
|
|
207
|
+
const { data: a } = c;
|
|
208
|
+
if ("texture-file" in a)
|
|
206
209
|
try {
|
|
207
|
-
const i = await
|
|
210
|
+
const i = await d(a["texture-file"].pk, () => e(a));
|
|
208
211
|
if (!i.ok)
|
|
209
212
|
throw new Error(`HTTP error! status: ${i.status}`);
|
|
210
213
|
const w = await i.blob(), l = await createImageBitmap(w), h = new OffscreenCanvas(l.width, l.height), m = h.getContext("2d");
|
|
@@ -212,7 +215,7 @@ function E(a, e) {
|
|
|
212
215
|
throw new Error("Couldnt create canvas");
|
|
213
216
|
m.drawImage(l, 0, 0);
|
|
214
217
|
const u = m.getImageData(0, 0, h.width, h.height);
|
|
215
|
-
|
|
218
|
+
n.postMessage(
|
|
216
219
|
{
|
|
217
220
|
success: !0,
|
|
218
221
|
width: h.width,
|
|
@@ -222,14 +225,14 @@ function E(a, e) {
|
|
|
222
225
|
[u.data.buffer]
|
|
223
226
|
);
|
|
224
227
|
} catch (i) {
|
|
225
|
-
|
|
228
|
+
n.postMessage({ success: !1, error: i.message });
|
|
226
229
|
}
|
|
227
|
-
else if ("model-part-mesh" in
|
|
228
|
-
const i = await
|
|
230
|
+
else if ("model-part-mesh" in a) {
|
|
231
|
+
const i = await d(a["model-part-mesh"].pk, () => e(a));
|
|
229
232
|
if (!i.ok)
|
|
230
233
|
throw new Error(`HTTP error! status: ${i.status}`);
|
|
231
234
|
const w = await i.arrayBuffer(), l = new Uint8Array(w), h = s.decode_sbo(l);
|
|
232
|
-
|
|
235
|
+
n.postMessage(
|
|
233
236
|
{
|
|
234
237
|
success: !0,
|
|
235
238
|
data: h.buffer
|
|
@@ -240,6 +243,6 @@ function E(a, e) {
|
|
|
240
243
|
};
|
|
241
244
|
}
|
|
242
245
|
export {
|
|
243
|
-
|
|
246
|
+
A as RendererService,
|
|
244
247
|
E as registerDecodeWorker
|
|
245
248
|
};
|
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
/* @ts-self-types="./sangine.d.ts" */
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Chroma subsampling format
|
|
5
|
+
* @enum {0 | 1 | 2 | 3}
|
|
6
|
+
*/
|
|
7
|
+
export const ChromaSampling = Object.freeze({
|
|
8
|
+
/**
|
|
9
|
+
* Both vertically and horizontally subsampled.
|
|
10
|
+
*/
|
|
11
|
+
Cs420: 0, "0": "Cs420",
|
|
12
|
+
/**
|
|
13
|
+
* Horizontally subsampled.
|
|
14
|
+
*/
|
|
15
|
+
Cs422: 1, "1": "Cs422",
|
|
16
|
+
/**
|
|
17
|
+
* Not subsampled.
|
|
18
|
+
*/
|
|
19
|
+
Cs444: 2, "2": "Cs444",
|
|
20
|
+
/**
|
|
21
|
+
* Monochrome.
|
|
22
|
+
*/
|
|
23
|
+
Cs400: 3, "3": "Cs400",
|
|
24
|
+
});
|
|
25
|
+
|
|
3
26
|
/**
|
|
4
27
|
* @param {number} window_id
|
|
5
28
|
* @param {any} camera_target
|
|
@@ -2595,53 +2618,53 @@ function __wbg_get_imports() {
|
|
|
2595
2618
|
arg0.writeTexture(arg1, arg2, arg3, arg4);
|
|
2596
2619
|
}, arguments); },
|
|
2597
2620
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
2598
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
2599
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
2621
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 3770, function: Function { arguments: [NamedExternref("Array<any>"), NamedExternref("ResizeObserver")], shim_idx: 3776, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2622
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h17333457aae2b090, wasm_bindgen__convert__closures_____invoke__h2a85c969f4c20848);
|
|
2600
2623
|
return ret;
|
|
2601
2624
|
},
|
|
2602
2625
|
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
2603
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
2604
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
2626
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 3770, function: Function { arguments: [NamedExternref("Array<any>")], shim_idx: 3771, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2627
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h17333457aae2b090, wasm_bindgen__convert__closures_____invoke__h091d820f15c8c0c2);
|
|
2605
2628
|
return ret;
|
|
2606
2629
|
},
|
|
2607
2630
|
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
|
2608
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
2609
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
2631
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 3770, function: Function { arguments: [NamedExternref("Event")], shim_idx: 3771, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2632
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h17333457aae2b090, wasm_bindgen__convert__closures_____invoke__h091d820f15c8c0c2);
|
|
2610
2633
|
return ret;
|
|
2611
2634
|
},
|
|
2612
2635
|
__wbindgen_cast_0000000000000004: function(arg0, arg1) {
|
|
2613
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
2614
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
2636
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 3770, function: Function { arguments: [NamedExternref("FocusEvent")], shim_idx: 3771, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2637
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h17333457aae2b090, wasm_bindgen__convert__closures_____invoke__h091d820f15c8c0c2);
|
|
2615
2638
|
return ret;
|
|
2616
2639
|
},
|
|
2617
2640
|
__wbindgen_cast_0000000000000005: function(arg0, arg1) {
|
|
2618
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
2619
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
2641
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 3770, function: Function { arguments: [NamedExternref("KeyboardEvent")], shim_idx: 3771, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2642
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h17333457aae2b090, wasm_bindgen__convert__closures_____invoke__h091d820f15c8c0c2);
|
|
2620
2643
|
return ret;
|
|
2621
2644
|
},
|
|
2622
2645
|
__wbindgen_cast_0000000000000006: function(arg0, arg1) {
|
|
2623
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
2624
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
2646
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 3770, function: Function { arguments: [NamedExternref("PageTransitionEvent")], shim_idx: 3771, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2647
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h17333457aae2b090, wasm_bindgen__convert__closures_____invoke__h091d820f15c8c0c2);
|
|
2625
2648
|
return ret;
|
|
2626
2649
|
},
|
|
2627
2650
|
__wbindgen_cast_0000000000000007: function(arg0, arg1) {
|
|
2628
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
2629
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
2651
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 3770, function: Function { arguments: [NamedExternref("PointerEvent")], shim_idx: 3771, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2652
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h17333457aae2b090, wasm_bindgen__convert__closures_____invoke__h091d820f15c8c0c2);
|
|
2630
2653
|
return ret;
|
|
2631
2654
|
},
|
|
2632
2655
|
__wbindgen_cast_0000000000000008: function(arg0, arg1) {
|
|
2633
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
2634
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
2656
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 3770, function: Function { arguments: [NamedExternref("WheelEvent")], shim_idx: 3771, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2657
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h17333457aae2b090, wasm_bindgen__convert__closures_____invoke__h091d820f15c8c0c2);
|
|
2635
2658
|
return ret;
|
|
2636
2659
|
},
|
|
2637
2660
|
__wbindgen_cast_0000000000000009: function(arg0, arg1) {
|
|
2638
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
2639
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
2661
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 3770, function: Function { arguments: [], shim_idx: 3774, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2662
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h17333457aae2b090, wasm_bindgen__convert__closures_____invoke__he5f4030ca973712a);
|
|
2640
2663
|
return ret;
|
|
2641
2664
|
},
|
|
2642
2665
|
__wbindgen_cast_000000000000000a: function(arg0, arg1) {
|
|
2643
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
2644
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
2666
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 3827, function: Function { arguments: [Externref], shim_idx: 3828, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2667
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__hf05ec8f078dda008, wasm_bindgen__convert__closures_____invoke__h07eaa4ea93496cfb);
|
|
2645
2668
|
return ret;
|
|
2646
2669
|
},
|
|
2647
2670
|
__wbindgen_cast_000000000000000b: function(arg0) {
|
|
@@ -2705,20 +2728,20 @@ function __wbg_get_imports() {
|
|
|
2705
2728
|
};
|
|
2706
2729
|
}
|
|
2707
2730
|
|
|
2708
|
-
function
|
|
2709
|
-
wasm.
|
|
2731
|
+
function wasm_bindgen__convert__closures_____invoke__he5f4030ca973712a(arg0, arg1) {
|
|
2732
|
+
wasm.wasm_bindgen__convert__closures_____invoke__he5f4030ca973712a(arg0, arg1);
|
|
2710
2733
|
}
|
|
2711
2734
|
|
|
2712
|
-
function
|
|
2713
|
-
wasm.
|
|
2735
|
+
function wasm_bindgen__convert__closures_____invoke__h091d820f15c8c0c2(arg0, arg1, arg2) {
|
|
2736
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h091d820f15c8c0c2(arg0, arg1, arg2);
|
|
2714
2737
|
}
|
|
2715
2738
|
|
|
2716
|
-
function
|
|
2717
|
-
wasm.
|
|
2739
|
+
function wasm_bindgen__convert__closures_____invoke__h07eaa4ea93496cfb(arg0, arg1, arg2) {
|
|
2740
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h07eaa4ea93496cfb(arg0, arg1, arg2);
|
|
2718
2741
|
}
|
|
2719
2742
|
|
|
2720
|
-
function
|
|
2721
|
-
wasm.
|
|
2743
|
+
function wasm_bindgen__convert__closures_____invoke__h2a85c969f4c20848(arg0, arg1, arg2, arg3) {
|
|
2744
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h2a85c969f4c20848(arg0, arg1, arg2, arg3);
|
|
2722
2745
|
}
|
|
2723
2746
|
|
|
2724
2747
|
|
|
@@ -3178,7 +3201,7 @@ async function __wbg_init(module_or_path) {
|
|
|
3178
3201
|
}
|
|
3179
3202
|
|
|
3180
3203
|
if (module_or_path === undefined) {
|
|
3181
|
-
module_or_path = new URL('sangine_bg.
|
|
3204
|
+
module_or_path = new URL('sangine_bg.77477298.wasm', import.meta.url);
|
|
3182
3205
|
}
|
|
3183
3206
|
const imports = __wbg_get_imports();
|
|
3184
3207
|
|
|
@@ -1,6 +1,28 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Chroma subsampling format
|
|
6
|
+
*/
|
|
7
|
+
export enum ChromaSampling {
|
|
8
|
+
/**
|
|
9
|
+
* Both vertically and horizontally subsampled.
|
|
10
|
+
*/
|
|
11
|
+
Cs420 = 0,
|
|
12
|
+
/**
|
|
13
|
+
* Horizontally subsampled.
|
|
14
|
+
*/
|
|
15
|
+
Cs422 = 1,
|
|
16
|
+
/**
|
|
17
|
+
* Not subsampled.
|
|
18
|
+
*/
|
|
19
|
+
Cs444 = 2,
|
|
20
|
+
/**
|
|
21
|
+
* Monochrome.
|
|
22
|
+
*/
|
|
23
|
+
Cs400 = 3,
|
|
24
|
+
}
|
|
25
|
+
|
|
4
26
|
export function animate_to(window_id: number, camera_target: any): void;
|
|
5
27
|
|
|
6
28
|
export function animate_to_route(window_id: number, route_id: string): void;
|
|
@@ -40,28 +62,28 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
|
|
40
62
|
|
|
41
63
|
export interface InitOutput {
|
|
42
64
|
readonly memory: WebAssembly.Memory;
|
|
43
|
-
readonly animate_to: (a: number, b: any) => [number, number];
|
|
44
|
-
readonly animate_to_route: (a: number, b: number, c: number) => [number, number];
|
|
45
|
-
readonly create_window: (a: number, b: number, c: any) => number;
|
|
46
|
-
readonly destroy_window: (a: number) => [number, number];
|
|
47
|
-
readonly read_camera_pos: (a: number) => [number, number, number];
|
|
48
|
-
readonly register_asset_decoder: (a: any) => void;
|
|
49
65
|
readonly register_event_listener: (a: any) => void;
|
|
66
|
+
readonly register_asset_decoder: (a: any) => void;
|
|
67
|
+
readonly set_render_quality: (a: number, b: any) => [number, number];
|
|
50
68
|
readonly set_gpu_memory_budget_mb: (a: number, b: number) => [number, number];
|
|
51
69
|
readonly set_north_correction: (a: number, b: number) => [number, number];
|
|
52
|
-
readonly set_render_quality: (a: number, b: any) => [number, number];
|
|
53
|
-
readonly set_route_highlight: (a: number, b: number, c: number, d: number) => [number, number];
|
|
54
|
-
readonly set_route_visible: (a: number, b: number, c: number, d: number) => [number, number];
|
|
55
70
|
readonly set_sun_properties: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number];
|
|
56
|
-
readonly set_window_action: (a: number, b: any) => [number, number];
|
|
57
71
|
readonly set_window_scale: (a: number, b: number) => [number, number];
|
|
72
|
+
readonly read_camera_pos: (a: number) => [number, number, number];
|
|
73
|
+
readonly animate_to: (a: number, b: any) => [number, number];
|
|
74
|
+
readonly animate_to_route: (a: number, b: number, c: number) => [number, number];
|
|
75
|
+
readonly set_route_visible: (a: number, b: number, c: number, d: number) => [number, number];
|
|
76
|
+
readonly set_route_highlight: (a: number, b: number, c: number, d: number) => [number, number];
|
|
77
|
+
readonly destroy_window: (a: number) => [number, number];
|
|
78
|
+
readonly set_window_action: (a: number, b: any) => [number, number];
|
|
79
|
+
readonly create_window: (a: number, b: number, c: any) => number;
|
|
58
80
|
readonly run: () => void;
|
|
59
|
-
readonly
|
|
60
|
-
readonly
|
|
61
|
-
readonly
|
|
62
|
-
readonly
|
|
63
|
-
readonly
|
|
64
|
-
readonly
|
|
81
|
+
readonly wasm_bindgen__closure__destroy__h17333457aae2b090: (a: number, b: number) => void;
|
|
82
|
+
readonly wasm_bindgen__closure__destroy__hf05ec8f078dda008: (a: number, b: number) => void;
|
|
83
|
+
readonly wasm_bindgen__convert__closures_____invoke__h2a85c969f4c20848: (a: number, b: number, c: any, d: any) => void;
|
|
84
|
+
readonly wasm_bindgen__convert__closures_____invoke__h091d820f15c8c0c2: (a: number, b: number, c: any) => void;
|
|
85
|
+
readonly wasm_bindgen__convert__closures_____invoke__h07eaa4ea93496cfb: (a: number, b: number, c: any) => void;
|
|
86
|
+
readonly wasm_bindgen__convert__closures_____invoke__he5f4030ca973712a: (a: number, b: number) => void;
|
|
65
87
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
66
88
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
67
89
|
readonly __externref_table_alloc: () => number;
|
|
Binary file
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
-
export const animate_to: (a: number, b: any) => [number, number];
|
|
5
|
-
export const animate_to_route: (a: number, b: number, c: number) => [number, number];
|
|
6
|
-
export const create_window: (a: number, b: number, c: any) => number;
|
|
7
|
-
export const destroy_window: (a: number) => [number, number];
|
|
8
|
-
export const read_camera_pos: (a: number) => [number, number, number];
|
|
9
|
-
export const register_asset_decoder: (a: any) => void;
|
|
10
4
|
export const register_event_listener: (a: any) => void;
|
|
5
|
+
export const register_asset_decoder: (a: any) => void;
|
|
6
|
+
export const set_render_quality: (a: number, b: any) => [number, number];
|
|
11
7
|
export const set_gpu_memory_budget_mb: (a: number, b: number) => [number, number];
|
|
12
8
|
export const set_north_correction: (a: number, b: number) => [number, number];
|
|
13
|
-
export const set_render_quality: (a: number, b: any) => [number, number];
|
|
14
|
-
export const set_route_highlight: (a: number, b: number, c: number, d: number) => [number, number];
|
|
15
|
-
export const set_route_visible: (a: number, b: number, c: number, d: number) => [number, number];
|
|
16
9
|
export const set_sun_properties: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number];
|
|
17
|
-
export const set_window_action: (a: number, b: any) => [number, number];
|
|
18
10
|
export const set_window_scale: (a: number, b: number) => [number, number];
|
|
11
|
+
export const read_camera_pos: (a: number) => [number, number, number];
|
|
12
|
+
export const animate_to: (a: number, b: any) => [number, number];
|
|
13
|
+
export const animate_to_route: (a: number, b: number, c: number) => [number, number];
|
|
14
|
+
export const set_route_visible: (a: number, b: number, c: number, d: number) => [number, number];
|
|
15
|
+
export const set_route_highlight: (a: number, b: number, c: number, d: number) => [number, number];
|
|
16
|
+
export const destroy_window: (a: number) => [number, number];
|
|
17
|
+
export const set_window_action: (a: number, b: any) => [number, number];
|
|
18
|
+
export const create_window: (a: number, b: number, c: any) => number;
|
|
19
19
|
export const run: () => void;
|
|
20
|
-
export const
|
|
21
|
-
export const
|
|
22
|
-
export const
|
|
23
|
-
export const
|
|
24
|
-
export const
|
|
25
|
-
export const
|
|
20
|
+
export const wasm_bindgen__closure__destroy__h17333457aae2b090: (a: number, b: number) => void;
|
|
21
|
+
export const wasm_bindgen__closure__destroy__hf05ec8f078dda008: (a: number, b: number) => void;
|
|
22
|
+
export const wasm_bindgen__convert__closures_____invoke__h2a85c969f4c20848: (a: number, b: number, c: any, d: any) => void;
|
|
23
|
+
export const wasm_bindgen__convert__closures_____invoke__h091d820f15c8c0c2: (a: number, b: number, c: any) => void;
|
|
24
|
+
export const wasm_bindgen__convert__closures_____invoke__h07eaa4ea93496cfb: (a: number, b: number, c: any) => void;
|
|
25
|
+
export const wasm_bindgen__convert__closures_____invoke__he5f4030ca973712a: (a: number, b: number) => void;
|
|
26
26
|
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
27
27
|
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
28
28
|
export const __externref_table_alloc: () => number;
|
|
@@ -169,7 +169,7 @@ async function __wbg_init(module_or_path) {
|
|
|
169
169
|
}
|
|
170
170
|
|
|
171
171
|
if (module_or_path === undefined) {
|
|
172
|
-
module_or_path = new URL('wasm_sbo_decode_bg.
|
|
172
|
+
module_or_path = new URL('wasm_sbo_decode_bg.fa5ceba1.wasm', import.meta.url);
|
|
173
173
|
}
|
|
174
174
|
const imports = __wbg_get_imports();
|
|
175
175
|
|
|
Binary file
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const SANGINE_HASH = "
|
|
1
|
+
export declare const SANGINE_HASH = "77477298";
|
|
2
2
|
//# sourceMappingURL=sangine.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const SBO_DECODE_HASH = "
|
|
1
|
+
export declare const SBO_DECODE_HASH = "fa5ceba1";
|
|
2
2
|
//# sourceMappingURL=sbo-decode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decodeWorkerImpl.d.ts","sourceRoot":"","sources":["../../src/worker/decodeWorkerImpl.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,UAAU,CAAA;AAK1C,KAAK,WAAW,GAAG,CAAC,IAAI,EAAE,UAAU,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;AAExD,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,0BAA0B,EAAE,WAAW,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"decodeWorkerImpl.d.ts","sourceRoot":"","sources":["../../src/worker/decodeWorkerImpl.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,UAAU,CAAA;AAK1C,KAAK,WAAW,GAAG,CAAC,IAAI,EAAE,UAAU,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;AAExD,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,0BAA0B,EAAE,WAAW,EAAE,WAAW,QA8F9F"}
|
package/package.json
CHANGED
|
Binary file
|