@swf2es/native 0.0.0-stage → 0.1.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/LICENSE +202 -0
- package/LICENSE.third-party +313 -0
- package/README.md +489 -2
- package/dist/atf/binary.d.ts +2 -0
- package/dist/atf/binary.d.ts.map +1 -0
- package/dist/atf/binary.js +4 -0
- package/dist/atf/binary.js.map +1 -0
- package/dist/atf/index.d.ts +27 -0
- package/dist/atf/index.d.ts.map +1 -0
- package/dist/atf/index.js +158 -0
- package/dist/atf/index.js.map +1 -0
- package/dist/atf/jxr.d.ts +22 -0
- package/dist/atf/jxr.d.ts.map +1 -0
- package/dist/atf/jxr.js +60 -0
- package/dist/atf/jxr.js.map +1 -0
- package/dist/atf/parse.d.ts +65 -0
- package/dist/atf/parse.d.ts.map +1 -0
- package/dist/atf/parse.js +204 -0
- package/dist/atf/parse.js.map +1 -0
- package/dist/audio/binary.d.ts +2 -0
- package/dist/audio/binary.d.ts.map +1 -0
- package/dist/audio/binary.js +4 -0
- package/dist/audio/binary.js.map +1 -0
- package/dist/audio/index.d.ts +21 -0
- package/dist/audio/index.d.ts.map +1 -0
- package/dist/audio/index.js +73 -0
- package/dist/audio/index.js.map +1 -0
- package/dist/base64.d.ts +3 -0
- package/dist/base64.d.ts.map +1 -0
- package/dist/base64.js +10 -0
- package/dist/base64.js.map +1 -0
- package/dist/compress/binary.d.ts +2 -0
- package/dist/compress/binary.d.ts.map +1 -0
- package/dist/compress/binary.js +4 -0
- package/dist/compress/binary.js.map +1 -0
- package/dist/compress/index.d.ts +59 -0
- package/dist/compress/index.d.ts.map +1 -0
- package/dist/compress/index.js +146 -0
- package/dist/compress/index.js.map +1 -0
- package/dist/instance.d.ts +25 -0
- package/dist/instance.d.ts.map +1 -0
- package/dist/instance.js +50 -0
- package/dist/instance.js.map +1 -0
- package/dist/mp3/binary.d.ts +2 -0
- package/dist/mp3/binary.d.ts.map +1 -0
- package/dist/mp3/binary.js +4 -0
- package/dist/mp3/binary.js.map +1 -0
- package/dist/mp3/index.d.ts +20 -0
- package/dist/mp3/index.d.ts.map +1 -0
- package/dist/mp3/index.js +49 -0
- package/dist/mp3/index.js.map +1 -0
- package/dist/render/binary.d.ts +2 -0
- package/dist/render/binary.d.ts.map +1 -0
- package/dist/render/binary.js +4 -0
- package/dist/render/binary.js.map +1 -0
- package/dist/render/bitmap-kernel.d.ts +118 -0
- package/dist/render/bitmap-kernel.d.ts.map +1 -0
- package/dist/render/bitmap-kernel.js +592 -0
- package/dist/render/bitmap-kernel.js.map +1 -0
- package/dist/render/draw-kernel.d.ts +79 -0
- package/dist/render/draw-kernel.d.ts.map +1 -0
- package/dist/render/draw-kernel.js +205 -0
- package/dist/render/draw-kernel.js.map +1 -0
- package/dist/render/dxt-encoder.d.ts +19 -0
- package/dist/render/dxt-encoder.d.ts.map +1 -0
- package/dist/render/dxt-encoder.js +95 -0
- package/dist/render/dxt-encoder.js.map +1 -0
- package/dist/render/index.d.ts +6 -0
- package/dist/render/index.d.ts.map +1 -0
- package/dist/render/index.js +11 -0
- package/dist/render/index.js.map +1 -0
- package/dist/render/lines.d.ts +55 -0
- package/dist/render/lines.d.ts.map +1 -0
- package/dist/render/lines.js +123 -0
- package/dist/render/lines.js.map +1 -0
- package/dist/render/module.d.ts +11 -0
- package/dist/render/module.d.ts.map +1 -0
- package/dist/render/module.js +27 -0
- package/dist/render/module.js.map +1 -0
- package/dist/render/pixel-ops.d.ts +77 -0
- package/dist/render/pixel-ops.d.ts.map +1 -0
- package/dist/render/pixel-ops.js +236 -0
- package/dist/render/pixel-ops.js.map +1 -0
- package/dist/render/tessellator.d.ts +90 -0
- package/dist/render/tessellator.d.ts.map +1 -0
- package/dist/render/tessellator.js +251 -0
- package/dist/render/tessellator.js.map +1 -0
- package/package.json +53 -3
- package/src/atf/index.ts +212 -0
- package/src/atf/jxr.ts +83 -0
- package/src/atf/parse.ts +263 -0
- package/src/audio/index.ts +93 -0
- package/src/base64.ts +10 -0
- package/src/compress/index.ts +225 -0
- package/src/instance.ts +53 -0
- package/src/mp3/index.ts +71 -0
- package/src/render/bitmap-kernel.ts +856 -0
- package/src/render/draw-kernel.ts +268 -0
- package/src/render/dxt-encoder.ts +121 -0
- package/src/render/index.ts +37 -0
- package/src/render/lines.ts +161 -0
- package/src/render/module.ts +30 -0
- package/src/render/pixel-ops.ts +356 -0
- package/src/render/tessellator.ts +367 -0
- package/src/webassembly.d.ts +22 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The render module (root.zig), compiled once and shared: the bitmap
|
|
3
|
+
* kernels, DXT encoder, tessellator and lines each make an instance of their
|
|
4
|
+
* own, so that each has its memory and lifecycle apart. It needs wasm
|
|
5
|
+
* SIMD throughout; this throws where the host refuses to compile it, as
|
|
6
|
+
* without SIMD or Wasm or under a CSP without 'wasm-unsafe-eval'.
|
|
7
|
+
*/
|
|
8
|
+
export declare function renderModule(): WebAssembly.Module;
|
|
9
|
+
/** An instance of the module, its memory its own. */
|
|
10
|
+
export declare function renderInstance(failure: () => never): Record<string, unknown>;
|
|
11
|
+
//# sourceMappingURL=module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../src/render/module.ts"],"names":[],"mappings":"AAKA;;;;;;GAMG;AACH,wBAAgB,YAAY,IAAI,WAAW,CAAC,MAAM,CAGjD;AAWD,qDAAqD;AACrD,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAE5E"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { decodeBase64 } from "../base64.js";
|
|
2
|
+
import { binary } from "./binary.js";
|
|
3
|
+
let module = null;
|
|
4
|
+
/**
|
|
5
|
+
* The render module (root.zig), compiled once and shared: the bitmap
|
|
6
|
+
* kernels, DXT encoder, tessellator and lines each make an instance of their
|
|
7
|
+
* own, so that each has its memory and lifecycle apart. It needs wasm
|
|
8
|
+
* SIMD throughout; this throws where the host refuses to compile it, as
|
|
9
|
+
* without SIMD or Wasm or under a CSP without 'wasm-unsafe-eval'.
|
|
10
|
+
*/
|
|
11
|
+
export function renderModule() {
|
|
12
|
+
module ??= new WebAssembly.Module(decodeBase64(binary));
|
|
13
|
+
return module;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* What an instance imports: libtess2's longjmp, which `failure` must
|
|
17
|
+
* throw from, and the host's own sine and cosine, which the lines take so
|
|
18
|
+
* that theirs are the player's JS's to the last bit.
|
|
19
|
+
*/
|
|
20
|
+
function renderImports(failure) {
|
|
21
|
+
return { env: { failure, sine: Math.sin, cosine: Math.cos } };
|
|
22
|
+
}
|
|
23
|
+
/** An instance of the module, its memory its own. */
|
|
24
|
+
export function renderInstance(failure) {
|
|
25
|
+
return new WebAssembly.Instance(renderModule(), renderImports(failure)).exports;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../src/render/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,IAAI,MAAM,GAA8B,IAAI,CAAC;AAE7C;;;;;;GAMG;AACH,MAAM,UAAU,YAAY;IAC1B,MAAM,KAAK,IAAI,WAAW,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC;IACxD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;GAIG;AACH,SAAS,aAAa,CAAC,OAAoB;IACzC,OAAO,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;AAChE,CAAC;AAED,qDAAqD;AACrD,MAAM,UAAU,cAAc,CAAC,OAAoB;IACjD,OAAO,IAAI,WAAW,CAAC,QAAQ,CAAC,YAAY,EAAE,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;AAClF,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/** What pixels.zig's wrapper (bitmap.zig) exports for these. */
|
|
2
|
+
export interface PixelExports {
|
|
3
|
+
memory: WebAssembly.Memory;
|
|
4
|
+
resetArena(bytes: number): number;
|
|
5
|
+
channelPixels(params: number): number;
|
|
6
|
+
mergePixels(params: number): number;
|
|
7
|
+
palettePixels(params: number): number;
|
|
8
|
+
matrixPixels(params: number): number;
|
|
9
|
+
transformPixels(params: number): number;
|
|
10
|
+
noisePixels(params: number): number;
|
|
11
|
+
perlinPixels(params: number): number;
|
|
12
|
+
}
|
|
13
|
+
/** A rect of a store's pixels. */
|
|
14
|
+
export interface PixelRegion {
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
width: number;
|
|
18
|
+
height: number;
|
|
19
|
+
}
|
|
20
|
+
/** How far a call got: the next band to do, and noise's generator. */
|
|
21
|
+
export interface Progress {
|
|
22
|
+
row: number;
|
|
23
|
+
state: number;
|
|
24
|
+
}
|
|
25
|
+
/** Which copy, and what it writes into the params after pixels.zig's Rows. */
|
|
26
|
+
export type CopyOp = {
|
|
27
|
+
op: "channel";
|
|
28
|
+
from: number;
|
|
29
|
+
to: number;
|
|
30
|
+
} | {
|
|
31
|
+
op: "merge";
|
|
32
|
+
muls: readonly [number, number, number, number];
|
|
33
|
+
} | {
|
|
34
|
+
op: "palette";
|
|
35
|
+
tables: readonly [Uint32Array, Uint32Array, Uint32Array, Uint32Array];
|
|
36
|
+
} | {
|
|
37
|
+
op: "matrix";
|
|
38
|
+
matrix: readonly number[];
|
|
39
|
+
near: PixelRegion | null;
|
|
40
|
+
empty: number;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* `region` of `into` (`intoWidth` wide) made by the copy `op` of the rows of
|
|
44
|
+
* `from` (`fromWidth` wide) starting at (sx, sy), band by band; false where
|
|
45
|
+
* the module refused a band.
|
|
46
|
+
*/
|
|
47
|
+
export declare function copyRows(wasm: PixelExports, into: Uint32Array, intoWidth: number, from: Uint32Array, fromWidth: number, region: PixelRegion, sx: number, sy: number, transparent: boolean, op: CopyOp, progress: Progress): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* colorTransform over `region` of `pixels` (`width` wide), in place, band by
|
|
50
|
+
* band: each channel's multiplier in 256ths and offset, red, green, blue,
|
|
51
|
+
* alpha; false where the module refused a band.
|
|
52
|
+
*/
|
|
53
|
+
export declare function transformRows(wasm: PixelExports, pixels: Uint32Array, width: number, region: PixelRegion, muls: readonly number[], adds: readonly number[], progress: Progress): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* noise over every pixel, `count` a band: Park-Miller's generator from
|
|
56
|
+
* `progress.state`, which it moves on; false where the module refused a band.
|
|
57
|
+
*/
|
|
58
|
+
export declare function noiseRows(wasm: PixelExports, pixels: Uint32Array, lo: number, span: number, channels: number, gray: boolean, transparent: boolean, progress: Progress): boolean;
|
|
59
|
+
/** perlinNoise's set-up, as turbulence.ts makes it of the seed and the call's arguments. */
|
|
60
|
+
export interface PerlinSetup {
|
|
61
|
+
lattice: Int32Array;
|
|
62
|
+
/** Four channels' gradients, x and y interleaved, one after another. */
|
|
63
|
+
gradients: Float64Array;
|
|
64
|
+
offsets: readonly (readonly [number, number])[];
|
|
65
|
+
fx: number;
|
|
66
|
+
fy: number;
|
|
67
|
+
stitch: boolean;
|
|
68
|
+
stitchWidth: number;
|
|
69
|
+
stitchHeight: number;
|
|
70
|
+
fractal: boolean;
|
|
71
|
+
channels: number;
|
|
72
|
+
gray: boolean;
|
|
73
|
+
transparent: boolean;
|
|
74
|
+
}
|
|
75
|
+
/** perlinNoise over every pixel of a `width`-wide store, band by band; false where the module refused one. */
|
|
76
|
+
export declare function perlinRows(wasm: PixelExports, pixels: Uint32Array, width: number, setup: PerlinSetup, progress: Progress): boolean;
|
|
77
|
+
//# sourceMappingURL=pixel-ops.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pixel-ops.d.ts","sourceRoot":"","sources":["../../src/render/pixel-ops.ts"],"names":[],"mappings":"AAUA,gEAAgE;AAChE,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC;IAC3B,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IAClC,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACtC,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACpC,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACtC,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACrC,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACxC,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACpC,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;CACtC;AASD,kCAAkC;AAClC,MAAM,WAAW,WAAW;IAC1B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,sEAAsE;AACtE,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf;AAED,8EAA8E;AAC9E,MAAM,MAAM,MAAM,GACd;IAAE,EAAE,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAC3C;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE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,CAAC;IACxB,OAAO,EAAE,SAAS,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC;IAChD,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,OAAO,CAAC;IACd,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,8GAA8G;AAC9G,wBAAgB,UAAU,CACxB,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,QAAQ,GACjB,OAAO,CA4CT"}
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
// BitmapData's pixel operations in the render module (pixels.zig), over a
|
|
2
|
+
// store's pixels a band of rows at a time, so that the scratch stays near
|
|
3
|
+
// BAND_BYTES whatever the bitmap's size. Each band is copied in, worked on
|
|
4
|
+
// and copied back before the next, which reads what the bands before it
|
|
5
|
+
// wrote, as the one loop over the rows did: where the source is the
|
|
6
|
+
// destination and a band's rows of the two overlap, they are copied in as
|
|
7
|
+
// one block, so that a pixel reads what the pixels before it wrote.
|
|
8
|
+
// A band that traps is copied back never, and `Progress` lets the call made
|
|
9
|
+
// again in a new instance (BitmapKernel) take up at that band.
|
|
10
|
+
/** The rows of a band's work: about this much of the pixels it copies in. */
|
|
11
|
+
const BAND_BYTES = 1 << 20;
|
|
12
|
+
/** The params' room at the input's start, before tables and blocks. */
|
|
13
|
+
const HEAD = 256;
|
|
14
|
+
/** paletteMap's four tables of 256 entries, after the params. */
|
|
15
|
+
const TABLES = 4096;
|
|
16
|
+
/**
|
|
17
|
+
* `region` of `into` (`intoWidth` wide) made by the copy `op` of the rows of
|
|
18
|
+
* `from` (`fromWidth` wide) starting at (sx, sy), band by band; false where
|
|
19
|
+
* the module refused a band.
|
|
20
|
+
*/
|
|
21
|
+
export function copyRows(wasm, into, intoWidth, from, fromWidth, region, sx, sy, transparent, op, progress) {
|
|
22
|
+
const { x: dx, y: dy, width: w, height: h } = region;
|
|
23
|
+
const same = into === from;
|
|
24
|
+
// A band's blocks: where the source is the destination, both in one block as wide as their union.
|
|
25
|
+
const wide = same ? w + Math.abs(sx - dx) : w;
|
|
26
|
+
const band = Math.max(1, Math.floor(BAND_BYTES / (wide * 8)));
|
|
27
|
+
for (; progress.row < h; progress.row += band) {
|
|
28
|
+
const r0 = progress.row;
|
|
29
|
+
const rows = Math.min(band, h - r0);
|
|
30
|
+
const dy0 = dy + r0;
|
|
31
|
+
const sy0 = sy + r0;
|
|
32
|
+
const joined = same && dy0 < sy0 + rows && sy0 < dy0 + rows;
|
|
33
|
+
const ux = joined ? Math.min(dx, sx) : 0;
|
|
34
|
+
const uy = joined ? Math.min(dy0, sy0) : 0;
|
|
35
|
+
const uw = joined ? Math.max(dx, sx) + w - ux : w;
|
|
36
|
+
const uh = joined ? Math.max(dy0, sy0) + rows - uy : rows;
|
|
37
|
+
const blocks = joined ? uw * uh : 2 * rows * w;
|
|
38
|
+
const at = wasm.resetArena(HEAD + TABLES + blocks * 4);
|
|
39
|
+
if (!at) {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
const memory = new Uint32Array(wasm.memory.buffer);
|
|
43
|
+
const base = (at + HEAD + TABLES) >> 2;
|
|
44
|
+
let dst;
|
|
45
|
+
let src;
|
|
46
|
+
let stride;
|
|
47
|
+
if (joined) {
|
|
48
|
+
for (let row = 0; row < uh; row++) {
|
|
49
|
+
const start = (uy + row) * intoWidth + ux;
|
|
50
|
+
memory.set(into.subarray(start, start + uw), base + row * uw);
|
|
51
|
+
}
|
|
52
|
+
dst = base + (dy0 - uy) * uw + (dx - ux);
|
|
53
|
+
src = base + (sy0 - uy) * uw + (sx - ux);
|
|
54
|
+
stride = uw;
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
dst = base;
|
|
58
|
+
src = base + rows * w;
|
|
59
|
+
stride = w;
|
|
60
|
+
// paletteMap's and a colour matrix's pixels are the source's alone: the destination's are not read.
|
|
61
|
+
const reads = op.op === "channel" || op.op === "merge";
|
|
62
|
+
for (let row = 0; row < rows; row++) {
|
|
63
|
+
if (reads) {
|
|
64
|
+
const to = (dy0 + row) * intoWidth + dx;
|
|
65
|
+
memory.set(into.subarray(to, to + w), dst + row * w);
|
|
66
|
+
}
|
|
67
|
+
const fromAt = (sy0 + row) * fromWidth + sx;
|
|
68
|
+
memory.set(from.subarray(fromAt, fromAt + w), src + row * w);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
const params = new DataView(wasm.memory.buffer, at, HEAD);
|
|
72
|
+
const words = [w, rows, dst * 4, stride, src * 4, stride, Number(transparent), 0];
|
|
73
|
+
for (let k = 0; k < 8; k++) {
|
|
74
|
+
params.setUint32(k * 4, words[k], true);
|
|
75
|
+
}
|
|
76
|
+
let ok = 0;
|
|
77
|
+
switch (op.op) {
|
|
78
|
+
case "channel":
|
|
79
|
+
params.setInt32(32, op.from, true);
|
|
80
|
+
params.setUint32(36, op.to, true);
|
|
81
|
+
ok = wasm.channelPixels(at);
|
|
82
|
+
break;
|
|
83
|
+
case "merge":
|
|
84
|
+
for (let k = 0; k < 4; k++) {
|
|
85
|
+
params.setUint32(32 + k * 4, op.muls[k] >>> 0, true);
|
|
86
|
+
}
|
|
87
|
+
ok = wasm.mergePixels(at);
|
|
88
|
+
break;
|
|
89
|
+
case "palette": {
|
|
90
|
+
params.setUint32(32, at + HEAD, true);
|
|
91
|
+
params.setUint32(36, 0, true);
|
|
92
|
+
const tables = new Uint32Array(wasm.memory.buffer, at + HEAD, 1024);
|
|
93
|
+
for (let k = 0; k < 4; k++) {
|
|
94
|
+
tables.set(op.tables[k], k * 256);
|
|
95
|
+
}
|
|
96
|
+
ok = wasm.palettePixels(at);
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
case "matrix": {
|
|
100
|
+
const near = op.near;
|
|
101
|
+
params.setInt32(32, sx, true);
|
|
102
|
+
params.setInt32(36, sy0, true);
|
|
103
|
+
params.setInt32(40, near?.x ?? 0, true);
|
|
104
|
+
params.setInt32(44, near?.y ?? 0, true);
|
|
105
|
+
params.setUint32(48, near?.width ?? 0, true);
|
|
106
|
+
params.setUint32(52, near?.height ?? 0, true);
|
|
107
|
+
params.setUint32(56, op.empty >>> 0, true);
|
|
108
|
+
params.setUint32(60, 0, true);
|
|
109
|
+
for (let k = 0; k < 20; k++) {
|
|
110
|
+
params.setFloat64(64 + k * 8, op.matrix[k], true);
|
|
111
|
+
}
|
|
112
|
+
ok = wasm.matrixPixels(at);
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
if (!ok) {
|
|
117
|
+
return false;
|
|
118
|
+
}
|
|
119
|
+
// Read again: the call may have grown the memory.
|
|
120
|
+
const out = new Uint32Array(wasm.memory.buffer);
|
|
121
|
+
for (let row = 0; row < rows; row++) {
|
|
122
|
+
const to = (dy0 + row) * intoWidth + dx;
|
|
123
|
+
into.set(out.subarray(dst + row * stride, dst + row * stride + w), to);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return true;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* colorTransform over `region` of `pixels` (`width` wide), in place, band by
|
|
130
|
+
* band: each channel's multiplier in 256ths and offset, red, green, blue,
|
|
131
|
+
* alpha; false where the module refused a band.
|
|
132
|
+
*/
|
|
133
|
+
export function transformRows(wasm, pixels, width, region, muls, adds, progress) {
|
|
134
|
+
const { x, y, width: w, height: h } = region;
|
|
135
|
+
const band = Math.max(1, Math.floor(BAND_BYTES / (w * 4)));
|
|
136
|
+
for (; progress.row < h; progress.row += band) {
|
|
137
|
+
const rows = Math.min(band, h - progress.row);
|
|
138
|
+
const at = wasm.resetArena(HEAD + rows * w * 4);
|
|
139
|
+
if (!at) {
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
142
|
+
const block = (at + HEAD) >> 2;
|
|
143
|
+
const memory = new Uint32Array(wasm.memory.buffer);
|
|
144
|
+
for (let row = 0; row < rows; row++) {
|
|
145
|
+
const from = (y + progress.row + row) * width + x;
|
|
146
|
+
memory.set(pixels.subarray(from, from + w), block + row * w);
|
|
147
|
+
}
|
|
148
|
+
const params = new DataView(wasm.memory.buffer, at, HEAD);
|
|
149
|
+
const words = [w, rows, block * 4, w];
|
|
150
|
+
for (let k = 0; k < words.length; k++) {
|
|
151
|
+
params.setUint32(k * 4, words[k], true);
|
|
152
|
+
}
|
|
153
|
+
for (let k = 0; k < 4; k++) {
|
|
154
|
+
params.setFloat64(16 + k * 8, muls[k], true);
|
|
155
|
+
params.setFloat64(48 + k * 8, adds[k], true);
|
|
156
|
+
}
|
|
157
|
+
if (!wasm.transformPixels(at)) {
|
|
158
|
+
return false;
|
|
159
|
+
}
|
|
160
|
+
const out = new Uint32Array(wasm.memory.buffer);
|
|
161
|
+
for (let row = 0; row < rows; row++) {
|
|
162
|
+
const to = (y + progress.row + row) * width + x;
|
|
163
|
+
pixels.set(out.subarray(block + row * w, block + (row + 1) * w), to);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
return true;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* noise over every pixel, `count` a band: Park-Miller's generator from
|
|
170
|
+
* `progress.state`, which it moves on; false where the module refused a band.
|
|
171
|
+
*/
|
|
172
|
+
export function noiseRows(wasm, pixels, lo, span, channels, gray, transparent, progress) {
|
|
173
|
+
const band = BAND_BYTES >> 2;
|
|
174
|
+
for (; progress.row < pixels.length; progress.row += band) {
|
|
175
|
+
const count = Math.min(band, pixels.length - progress.row);
|
|
176
|
+
const at = wasm.resetArena(HEAD + count * 4);
|
|
177
|
+
if (!at) {
|
|
178
|
+
return false;
|
|
179
|
+
}
|
|
180
|
+
const params = new DataView(wasm.memory.buffer, at, HEAD);
|
|
181
|
+
const words = [count, at + HEAD, progress.state, lo, span, channels, Number(gray)];
|
|
182
|
+
words.push(Number(transparent));
|
|
183
|
+
for (let k = 0; k < words.length; k++) {
|
|
184
|
+
params.setUint32(k * 4, words[k] >>> 0, true);
|
|
185
|
+
}
|
|
186
|
+
const state = wasm.noisePixels(at);
|
|
187
|
+
if (!state) {
|
|
188
|
+
return false;
|
|
189
|
+
}
|
|
190
|
+
pixels.set(new Uint32Array(wasm.memory.buffer, at + HEAD, count), progress.row);
|
|
191
|
+
progress.state = state;
|
|
192
|
+
}
|
|
193
|
+
return true;
|
|
194
|
+
}
|
|
195
|
+
/** perlinNoise over every pixel of a `width`-wide store, band by band; false where the module refused one. */
|
|
196
|
+
export function perlinRows(wasm, pixels, width, setup, progress) {
|
|
197
|
+
const height = pixels.length / width;
|
|
198
|
+
const octaves = setup.offsets.length;
|
|
199
|
+
const band = Math.max(1, Math.floor(BAND_BYTES / (width * 4)));
|
|
200
|
+
// The tables once, and a band's block, which each band uses again.
|
|
201
|
+
const at = wasm.resetArena(HEAD + 2056 + 8 + 32896 + octaves * 16 + band * width * 4);
|
|
202
|
+
if (!at) {
|
|
203
|
+
return false;
|
|
204
|
+
}
|
|
205
|
+
const lattice = at + HEAD;
|
|
206
|
+
const gradients = lattice + 2056 + 8 - ((lattice + 2056) & 7);
|
|
207
|
+
const offsets = gradients + 32896;
|
|
208
|
+
const block = offsets + octaves * 16;
|
|
209
|
+
new Int32Array(wasm.memory.buffer, lattice, 514).set(setup.lattice);
|
|
210
|
+
new Float64Array(wasm.memory.buffer, gradients, 4112).set(setup.gradients);
|
|
211
|
+
const list = new Float64Array(wasm.memory.buffer, offsets, octaves * 2);
|
|
212
|
+
for (let k = 0; k < octaves; k++) {
|
|
213
|
+
list[k * 2] = setup.offsets[k][0];
|
|
214
|
+
list[k * 2 + 1] = setup.offsets[k][1];
|
|
215
|
+
}
|
|
216
|
+
for (; progress.row < height; progress.row += band) {
|
|
217
|
+
const rows = Math.min(band, height - progress.row);
|
|
218
|
+
const params = new DataView(wasm.memory.buffer, at, HEAD);
|
|
219
|
+
const words = [width, rows, progress.row, block, lattice, gradients, offsets, octaves];
|
|
220
|
+
words.push(setup.channels, Number(setup.gray), Number(setup.fractal), Number(setup.stitch));
|
|
221
|
+
words.push(Number(setup.transparent), 0);
|
|
222
|
+
for (let k = 0; k < words.length; k++) {
|
|
223
|
+
params.setUint32(k * 4, words[k] >>> 0, true);
|
|
224
|
+
}
|
|
225
|
+
params.setFloat64(56, setup.fx, true);
|
|
226
|
+
params.setFloat64(64, setup.fy, true);
|
|
227
|
+
params.setFloat64(72, setup.stitchWidth, true);
|
|
228
|
+
params.setFloat64(80, setup.stitchHeight, true);
|
|
229
|
+
if (!wasm.perlinPixels(at)) {
|
|
230
|
+
return false;
|
|
231
|
+
}
|
|
232
|
+
pixels.set(new Uint32Array(wasm.memory.buffer, block, rows * width), progress.row * width);
|
|
233
|
+
}
|
|
234
|
+
return true;
|
|
235
|
+
}
|
|
236
|
+
//# sourceMappingURL=pixel-ops.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pixel-ops.js","sourceRoot":"","sources":["../../src/render/pixel-ops.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,0EAA0E;AAC1E,2EAA2E;AAC3E,wEAAwE;AACxE,oEAAoE;AACpE,0EAA0E;AAC1E,oEAAoE;AACpE,4EAA4E;AAC5E,+DAA+D;AAe/D,6EAA6E;AAC7E,MAAM,UAAU,GAAG,CAAC,IAAI,EAAE,CAAC;AAC3B,uEAAuE;AACvE,MAAM,IAAI,GAAG,GAAG,CAAC;AACjB,iEAAiE;AACjE,MAAM,MAAM,GAAG,IAAI,CAAC;AA4BpB;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CACtB,IAAkB,EAClB,IAAiB,EACjB,SAAiB,EACjB,IAAiB,EACjB,SAAiB,EACjB,MAAmB,EACnB,EAAU,EACV,EAAU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CAAC,EAAE,EAAE,CAAC;YACtC,MAAM,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,CAAC;QAChD,CAAC;QAED,MAAM,CAAC,UAAU,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;QACtC,MAAM,CAAC,UAAU,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;QACtC,MAAM,CAAC,UAAU,CAAC,EAAE,EAAE,KAAK,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;QAC/C,MAAM,CAAC,UAAU,CAAC,EAAE,EAAE,KAAK,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;QAChD,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC,EAAE,CAAC;YAC3B,OAAO,KAAK,CAAC;QACf,CAAC;QAED,MAAM,CAAC,GAAG,CAAC,IAAI,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,GAAG,KAAK,CAAC,EAAE,QAAQ,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC;IAC7F,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { LineBuilder } from "./lines.js";
|
|
2
|
+
/** Buffers are owned by the caller; subsequent calls and disposal cannot change them. */
|
|
3
|
+
export interface FillGeometry {
|
|
4
|
+
vertices: Float64Array;
|
|
5
|
+
indices: Uint16Array | Uint32Array;
|
|
6
|
+
/**
|
|
7
|
+
* The vertex the indices count from: a layer's fills share its indices,
|
|
8
|
+
* each counted from the layer's first vertex (Tessellator.tessellate.layer).
|
|
9
|
+
*/
|
|
10
|
+
indexOffset?: number;
|
|
11
|
+
}
|
|
12
|
+
/** A fill tessellated alone, and with the rest of its layer. */
|
|
13
|
+
export interface FillTessellate {
|
|
14
|
+
(contours: readonly (readonly number[])[], nonZero: boolean): FillGeometry | null;
|
|
15
|
+
/**
|
|
16
|
+
* Every fill of a layer in one native call, its contours as path
|
|
17
|
+
* commands (PATH_MOVE, PATH_LINE, PATH_CURVE, PATH_CUBIC) that the module
|
|
18
|
+
* flattens itself: each fill's geometry, or null for one it refused, all
|
|
19
|
+
* fills' positions and indices in one buffer each. Its output needs no checking: the module has checked
|
|
20
|
+
* every coordinate finite and every index in range.
|
|
21
|
+
*/
|
|
22
|
+
layer(fills: readonly (readonly (readonly number[])[])[], nonZero: readonly boolean[]): (FillGeometry | null)[] | null;
|
|
23
|
+
/** A layer's lines in one call, their outlines filled by the same libtess2 (LineBuilder). */
|
|
24
|
+
lines: LineBuilder;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The commands of a contour layer() takes, each followed by its
|
|
28
|
+
* coordinates: MOVE x y and LINE x y; CURVE cx cy x y, a quadratic from
|
|
29
|
+
* the pen; CUBIC c1x c1y c2x c2y x y. The pen starts each contour at 0, 0.
|
|
30
|
+
* Curves are flattened to within 0.02 of the curve, in at most 256 chords;
|
|
31
|
+
* repeated points are dropped, and contours of fewer than three points left out.
|
|
32
|
+
*/
|
|
33
|
+
export declare const PATH_MOVE = 1;
|
|
34
|
+
export declare const PATH_LINE = 2;
|
|
35
|
+
export declare const PATH_CURVE = 3;
|
|
36
|
+
export declare const PATH_CUBIC = 4;
|
|
37
|
+
export interface TessellatorOptions {
|
|
38
|
+
/** Maximum arena address, including the C stack; at most 128 MiB. */
|
|
39
|
+
memoryLimit?: number;
|
|
40
|
+
/** Drop instances larger than this after each call. Defaults to 8 MiB. */
|
|
41
|
+
retainMemory?: number;
|
|
42
|
+
/**
|
|
43
|
+
* Fill by the module's bands alone (bands.zig), as it does after libtess2
|
|
44
|
+
* has trapped, never by libtess2, the lines' outlines too: for tests of
|
|
45
|
+
* the bands.
|
|
46
|
+
*/
|
|
47
|
+
bands?: boolean;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Synchronous double-precision tessellator. It compiles the render module
|
|
51
|
+
* as it is made, and throws where the host refuses it. A fill it refuses
|
|
52
|
+
* (not finite, malformed, too large, or out of memory) is null.
|
|
53
|
+
*/
|
|
54
|
+
export declare class Tessellator {
|
|
55
|
+
private instance;
|
|
56
|
+
private readonly limit;
|
|
57
|
+
private readonly keep;
|
|
58
|
+
private readonly bands;
|
|
59
|
+
private readonly lines;
|
|
60
|
+
constructor(options?: TessellatorOptions);
|
|
61
|
+
/**
|
|
62
|
+
* Current retained Wasm capacity, the line builder's included. Arena reset
|
|
63
|
+
* alone does not shrink this memory.
|
|
64
|
+
*/
|
|
65
|
+
get capacity(): number;
|
|
66
|
+
dispose(): void;
|
|
67
|
+
/** The instance, made on first use, its arena reset; filling by the bands alone where `bands`. */
|
|
68
|
+
private arena;
|
|
69
|
+
/** A call that threw: a trapped instance is never used again. */
|
|
70
|
+
private failed;
|
|
71
|
+
/** An instance grown past what is kept, let go. */
|
|
72
|
+
private trim;
|
|
73
|
+
/** One fill. The module checks the coordinates; only the arrays' lengths are looked at here. */
|
|
74
|
+
private readonly fill;
|
|
75
|
+
/** One fill, by the bands alone where `bands`; again so in a new instance where libtess2 trapped. */
|
|
76
|
+
private fillBy;
|
|
77
|
+
/** Each fill flattened and tessellated, as `fill` would make its polygons, in one call and one copy out. */
|
|
78
|
+
private readonly layer;
|
|
79
|
+
/** The layer, by the bands alone where `bands`; again so in a new instance where libtess2 trapped. */
|
|
80
|
+
private layerBy;
|
|
81
|
+
/** One fill's commands as a layer of its own, in a fresh arena. */
|
|
82
|
+
private alone;
|
|
83
|
+
/**
|
|
84
|
+
* Use as RenderView's fillTessellator. A fill alone takes its contours
|
|
85
|
+
* flattened already; a layer takes them as path commands; and a layer's
|
|
86
|
+
* lines take the layer as the player packs it (`lines`).
|
|
87
|
+
*/
|
|
88
|
+
readonly tessellate: FillTessellate;
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=tessellator.d.ts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