@pixerate/editor 0.116.0 → 0.117.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/dist/{chunk-ZYZGEILO.cjs → chunk-2J3LS7JZ.cjs} +203 -203
- package/dist/{chunk-ZYZGEILO.cjs.map → chunk-2J3LS7JZ.cjs.map} +1 -1
- package/dist/{chunk-TFOPHZ3U.cjs → chunk-7ISPWEJA.cjs} +302 -5
- package/dist/chunk-7ISPWEJA.cjs.map +1 -0
- package/dist/{chunk-2UT4GXYA.cjs → chunk-BYAWOAST.cjs} +109 -41
- package/dist/chunk-BYAWOAST.cjs.map +1 -0
- package/dist/{chunk-PAOWHJ5O.cjs → chunk-EBSYZRSW.cjs} +217 -400
- package/dist/chunk-EBSYZRSW.cjs.map +1 -0
- package/dist/{chunk-XK5LZKBD.js → chunk-HKDTM6VC.js} +298 -1
- package/dist/chunk-HKDTM6VC.js.map +1 -0
- package/dist/{chunk-D53VQGEJ.js → chunk-IVSNUXW7.js} +79 -2
- package/dist/chunk-IVSNUXW7.js.map +1 -0
- package/dist/{chunk-ARQ7PQ6Q.js → chunk-JHXMNOMF.js} +71 -3
- package/dist/chunk-JHXMNOMF.js.map +1 -0
- package/dist/{chunk-HOCPSFGA.cjs → chunk-L2T6EJ5S.cjs} +154 -77
- package/dist/chunk-L2T6EJ5S.cjs.map +1 -0
- package/dist/{chunk-SEBYNBHW.js → chunk-R2JE6SA7.js} +9 -9
- package/dist/{chunk-D53KSJUV.js → chunk-VD2UDVF7.js} +100 -283
- package/dist/chunk-VD2UDVF7.js.map +1 -0
- package/dist/{export-BXxSGBCq.d.cts → export-DMOuzgZZ.d.cts} +8 -3
- package/dist/{export-Dm44YUvS.d.ts → export-Dul1SbPv.d.ts} +8 -3
- package/dist/{flow-COCB42TP.d.cts → flow-4-OC-UkQ.d.cts} +22 -1
- package/dist/{flow-BMtHAmg4.d.ts → flow-Cb7lkPm8.d.ts} +22 -1
- package/dist/image-editor/index.cjs +1112 -1024
- package/dist/image-editor/index.cjs.map +1 -1
- package/dist/image-editor/index.d.cts +6 -6
- package/dist/image-editor/index.d.ts +6 -6
- package/dist/image-editor/index.js +124 -36
- package/dist/image-editor/index.js.map +1 -1
- package/dist/paint/index.cjs +8 -4
- package/dist/paint/index.cjs.map +1 -1
- package/dist/paint/index.d.cts +2 -2
- package/dist/paint/index.d.ts +2 -2
- package/dist/paint/index.js +7 -3
- package/dist/paint-editor/index.cjs +242 -242
- package/dist/paint-editor/index.d.cts +4 -4
- package/dist/paint-editor/index.d.ts +4 -4
- package/dist/paint-editor/index.js +4 -4
- package/dist/raster/index.cjs +6 -4
- package/dist/raster/index.cjs.map +1 -1
- package/dist/raster/index.d.cts +2 -2
- package/dist/raster/index.d.ts +2 -2
- package/dist/raster/index.js +27 -25
- package/dist/{render-CrmHOgpo.d.ts → render-B05K68_h.d.ts} +9 -1
- package/dist/{render-B1K_OoLy.d.cts → render-DnAbIKcs.d.cts} +9 -1
- package/dist/vector/index.cjs +11272 -10183
- package/dist/vector/index.cjs.map +1 -1
- package/dist/vector/index.d.cts +135 -1
- package/dist/vector/index.d.ts +135 -1
- package/dist/vector/index.js +11179 -10090
- package/dist/vector/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-2UT4GXYA.cjs.map +0 -1
- package/dist/chunk-ARQ7PQ6Q.js.map +0 -1
- package/dist/chunk-D53KSJUV.js.map +0 -1
- package/dist/chunk-D53VQGEJ.js.map +0 -1
- package/dist/chunk-HOCPSFGA.cjs.map +0 -1
- package/dist/chunk-PAOWHJ5O.cjs.map +0 -1
- package/dist/chunk-TFOPHZ3U.cjs.map +0 -1
- package/dist/chunk-XK5LZKBD.js.map +0 -1
- /package/dist/{chunk-SEBYNBHW.js.map → chunk-R2JE6SA7.js.map} +0 -0
|
@@ -26,251 +26,15 @@ var _chunkEJVDBITDcjs = require('./chunk-EJVDBITD.cjs');
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
29
|
-
var _chunkTFOPHZ3Ucjs = require('./chunk-TFOPHZ3U.cjs');
|
|
30
29
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
if (!(v > 0)) return 0;
|
|
40
|
-
return v <= 31308e-7 ? v * 12.92 : 1.055 * Math.pow(v, 1 / 2.4) - 0.055;
|
|
41
|
-
}
|
|
42
|
-
var LIN8 = null;
|
|
43
|
-
var LIN16 = null;
|
|
44
|
-
function lin8() {
|
|
45
|
-
if (!LIN8) {
|
|
46
|
-
LIN8 = new Float32Array(256);
|
|
47
|
-
for (let i = 0; i < 256; i++) LIN8[i] = srgbDecode(i / 255);
|
|
48
|
-
}
|
|
49
|
-
return LIN8;
|
|
50
|
-
}
|
|
51
|
-
function lin16() {
|
|
52
|
-
if (!LIN16) {
|
|
53
|
-
LIN16 = new Float32Array(65536);
|
|
54
|
-
for (let i = 0; i < 65536; i++) LIN16[i] = srgbDecode(i / 65535);
|
|
55
|
-
}
|
|
56
|
-
return LIN16;
|
|
57
|
-
}
|
|
58
|
-
function encode16(v) {
|
|
59
|
-
if (!(v > 0)) return 0;
|
|
60
|
-
if (v >= 1) return 65535;
|
|
61
|
-
return Math.round(srgbEncode(v) * 65535);
|
|
62
|
-
}
|
|
63
|
-
var ENC8 = null;
|
|
64
|
-
function encode8(v) {
|
|
65
|
-
if (!(v > 0)) return 0;
|
|
66
|
-
if (v >= 1) return 255;
|
|
67
|
-
if (!ENC8) {
|
|
68
|
-
ENC8 = new Uint8Array(65536);
|
|
69
|
-
for (let i = 0; i < 65536; i++) ENC8[i] = Math.round(srgbEncode(i / 65535) * 255);
|
|
70
|
-
}
|
|
71
|
-
return ENC8[Math.round(v * 65535)];
|
|
72
|
-
}
|
|
73
|
-
function to16From8(data, out = new Uint16Array(data.length)) {
|
|
74
|
-
for (let i = 0; i < data.length; i++) out[i] = data[i] * 257;
|
|
75
|
-
return out;
|
|
76
|
-
}
|
|
77
|
-
function to32From8(data, channels, out = new Float32Array(data.length)) {
|
|
78
|
-
if (channels === 1) {
|
|
79
|
-
for (let i = 0; i < data.length; i++) out[i] = data[i] / 255;
|
|
80
|
-
return out;
|
|
81
|
-
}
|
|
82
|
-
const t = lin8();
|
|
83
|
-
for (let i = 0; i < data.length; i += 4) {
|
|
84
|
-
out[i] = t[data[i]];
|
|
85
|
-
out[i + 1] = t[data[i + 1]];
|
|
86
|
-
out[i + 2] = t[data[i + 2]];
|
|
87
|
-
out[i + 3] = data[i + 3] / 255;
|
|
88
|
-
}
|
|
89
|
-
return out;
|
|
90
|
-
}
|
|
91
|
-
function to32From16(data, channels, out = new Float32Array(data.length)) {
|
|
92
|
-
if (channels === 1) {
|
|
93
|
-
for (let i = 0; i < data.length; i++) out[i] = data[i] / 65535;
|
|
94
|
-
return out;
|
|
95
|
-
}
|
|
96
|
-
const t = lin16();
|
|
97
|
-
for (let i = 0; i < data.length; i += 4) {
|
|
98
|
-
out[i] = t[data[i]];
|
|
99
|
-
out[i + 1] = t[data[i + 1]];
|
|
100
|
-
out[i + 2] = t[data[i + 2]];
|
|
101
|
-
out[i + 3] = data[i + 3] / 65535;
|
|
102
|
-
}
|
|
103
|
-
return out;
|
|
104
|
-
}
|
|
105
|
-
function to16From32(data, channels, out = new Uint16Array(data.length)) {
|
|
106
|
-
const unit = (v) => v > 0 ? v < 1 ? Math.round(v * 65535) : 65535 : 0;
|
|
107
|
-
if (channels === 1) {
|
|
108
|
-
for (let i = 0; i < data.length; i++) out[i] = unit(data[i]);
|
|
109
|
-
return out;
|
|
110
|
-
}
|
|
111
|
-
for (let i = 0; i < data.length; i += 4) {
|
|
112
|
-
out[i] = encode16(data[i]);
|
|
113
|
-
out[i + 1] = encode16(data[i + 1]);
|
|
114
|
-
out[i + 2] = encode16(data[i + 2]);
|
|
115
|
-
out[i + 3] = unit(data[i + 3]);
|
|
116
|
-
}
|
|
117
|
-
return out;
|
|
118
|
-
}
|
|
119
|
-
function to8From16(data, out = new Uint8ClampedArray(data.length)) {
|
|
120
|
-
for (let i = 0; i < data.length; i++) out[i] = Math.round(data[i] / 257);
|
|
121
|
-
return out;
|
|
122
|
-
}
|
|
123
|
-
function to8From32(data, channels, out = new Uint8ClampedArray(data.length)) {
|
|
124
|
-
if (channels === 1) {
|
|
125
|
-
for (let i = 0; i < data.length; i++) out[i] = Math.round(data[i] * 255);
|
|
126
|
-
return out;
|
|
127
|
-
}
|
|
128
|
-
for (let i = 0; i < data.length; i += 4) {
|
|
129
|
-
out[i] = encode8(data[i]);
|
|
130
|
-
out[i + 1] = encode8(data[i + 1]);
|
|
131
|
-
out[i + 2] = encode8(data[i + 2]);
|
|
132
|
-
out[i + 3] = Math.round(Math.min(1, Math.max(0, data[i + 3])) * 255);
|
|
133
|
-
}
|
|
134
|
-
return out;
|
|
135
|
-
}
|
|
136
|
-
function proxyOf(deep, channels, out) {
|
|
137
|
-
return deep instanceof Uint16Array ? to8From16(deep, out) : to8From32(deep, channels, out);
|
|
138
|
-
}
|
|
139
|
-
var depthOf = (deep) => deep instanceof Uint16Array ? 16 : 32;
|
|
140
|
-
function deepTile(deep, channels, defaultValue = 0) {
|
|
141
|
-
const data = proxyOf(deep, channels);
|
|
142
|
-
if (deep instanceof Uint16Array) {
|
|
143
|
-
let exact = true;
|
|
144
|
-
for (let i = 0; i < deep.length; i++) {
|
|
145
|
-
if (deep[i] % 257 !== 0) {
|
|
146
|
-
exact = false;
|
|
147
|
-
break;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
if (exact) return _chunkTFOPHZ3Ucjs.finishTile.call(void 0, data, channels, defaultValue);
|
|
151
|
-
} else if (channels === 4 && defaultValue === 0) {
|
|
152
|
-
let empty = true;
|
|
153
|
-
for (let i = 3; i < deep.length; i += 4) {
|
|
154
|
-
if (deep[i] !== 0) {
|
|
155
|
-
empty = false;
|
|
156
|
-
break;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
if (empty) return null;
|
|
160
|
-
}
|
|
161
|
-
return { data, uniform: null, deep };
|
|
162
|
-
}
|
|
163
|
-
function tileSamples16(tile, channels, defaultValue = 0) {
|
|
164
|
-
const deep = _optionalChain([tile, 'optionalAccess', _2 => _2.deep]);
|
|
165
|
-
if (deep instanceof Uint16Array) return deep;
|
|
166
|
-
if (deep instanceof Float32Array) return to16From32(deep, channels);
|
|
167
|
-
if (tile) return to16From8(tile.data);
|
|
168
|
-
return new Uint16Array(TILE_PIXELS * channels).fill(defaultValue * 257);
|
|
169
|
-
}
|
|
170
|
-
function tileSamples32(tile, channels, defaultValue = 0) {
|
|
171
|
-
const deep = _optionalChain([tile, 'optionalAccess', _3 => _3.deep]);
|
|
172
|
-
if (deep instanceof Float32Array) return deep;
|
|
173
|
-
if (deep instanceof Uint16Array) return to32From16(deep, channels);
|
|
174
|
-
if (tile) return to32From8(tile.data, channels);
|
|
175
|
-
const out = new Float32Array(TILE_PIXELS * channels);
|
|
176
|
-
if (defaultValue) {
|
|
177
|
-
if (channels === 1) out.fill(defaultValue / 255);
|
|
178
|
-
else to32From8(new Uint8ClampedArray(TILE_PIXELS * 4).fill(defaultValue), 4, out);
|
|
179
|
-
}
|
|
180
|
-
return out;
|
|
181
|
-
}
|
|
182
|
-
function tileSamples(tile, channels, depth, defaultValue = 0) {
|
|
183
|
-
return depth === 16 ? tileSamples16(tile, channels, defaultValue) : tileSamples32(tile, channels, defaultValue);
|
|
184
|
-
}
|
|
185
|
-
function surfaceDepth(surface) {
|
|
186
|
-
let d = 8;
|
|
187
|
-
for (const t of surface.tiles.values()) {
|
|
188
|
-
if (t.deep instanceof Float32Array) return 32;
|
|
189
|
-
if (t.deep) d = 16;
|
|
190
|
-
}
|
|
191
|
-
return d;
|
|
192
|
-
}
|
|
193
|
-
function readDeepRegion(surface, rect, depth) {
|
|
194
|
-
const ch = surface.channels;
|
|
195
|
-
const w = rect.width;
|
|
196
|
-
const h = rect.height;
|
|
197
|
-
const out = depth === 16 ? new Uint16Array(w * h * ch) : new Float32Array(w * h * ch);
|
|
198
|
-
const fill2 = tileSamples(void 0, ch, depth, surface.defaultValue);
|
|
199
|
-
if (surface.defaultValue) for (let i = 0; i < out.length; i += ch) for (let c = 0; c < ch; c++) out[i + c] = fill2[c];
|
|
200
|
-
for (const { tx, ty } of _chunkTFOPHZ3Ucjs.tilesInRect.call(void 0, rect)) {
|
|
201
|
-
const tile = surface.tiles.get(_chunkTFOPHZ3Ucjs.tileKey.call(void 0, tx, ty));
|
|
202
|
-
if (!tile) continue;
|
|
203
|
-
const src = tileSamples(tile, ch, depth, surface.defaultValue);
|
|
204
|
-
const ox = tx * _chunkTFOPHZ3Ucjs.TILE;
|
|
205
|
-
const oy = ty * _chunkTFOPHZ3Ucjs.TILE;
|
|
206
|
-
const x0 = Math.max(rect.x, ox);
|
|
207
|
-
const y0 = Math.max(rect.y, oy);
|
|
208
|
-
const x1 = Math.min(rect.x + w, ox + _chunkTFOPHZ3Ucjs.TILE);
|
|
209
|
-
const y1 = Math.min(rect.y + h, oy + _chunkTFOPHZ3Ucjs.TILE);
|
|
210
|
-
const span = (x1 - x0) * ch;
|
|
211
|
-
for (let yy = y0; yy < y1; yy++) {
|
|
212
|
-
const s = ((yy - oy) * _chunkTFOPHZ3Ucjs.TILE + (x0 - ox)) * ch;
|
|
213
|
-
const d = ((yy - rect.y) * w + (x0 - rect.x)) * ch;
|
|
214
|
-
out.set(src.subarray(s, s + span), d);
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
return out;
|
|
218
|
-
}
|
|
219
|
-
function writeDeepRegion(surface, rect, samples) {
|
|
220
|
-
const ch = surface.channels;
|
|
221
|
-
const w = rect.width;
|
|
222
|
-
const h = rect.height;
|
|
223
|
-
if (w <= 0 || h <= 0) return surface;
|
|
224
|
-
if (samples.length < w * h * ch) throw new Error(`writeDeepRegion: expected ${w * h * ch} samples, got ${samples.length}`);
|
|
225
|
-
const depth = depthOf(samples);
|
|
226
|
-
const tiles = new Map(surface.tiles);
|
|
227
|
-
for (const { tx, ty } of _chunkTFOPHZ3Ucjs.tilesInRect.call(void 0, rect)) {
|
|
228
|
-
const key = _chunkTFOPHZ3Ucjs.tileKey.call(void 0, tx, ty);
|
|
229
|
-
const ox = tx * _chunkTFOPHZ3Ucjs.TILE;
|
|
230
|
-
const oy = ty * _chunkTFOPHZ3Ucjs.TILE;
|
|
231
|
-
const x0 = Math.max(rect.x, ox);
|
|
232
|
-
const y0 = Math.max(rect.y, oy);
|
|
233
|
-
const x1 = Math.min(rect.x + w, ox + _chunkTFOPHZ3Ucjs.TILE);
|
|
234
|
-
const y1 = Math.min(rect.y + h, oy + _chunkTFOPHZ3Ucjs.TILE);
|
|
235
|
-
const full = x0 === ox && y0 === oy && x1 === ox + _chunkTFOPHZ3Ucjs.TILE && y1 === oy + _chunkTFOPHZ3Ucjs.TILE;
|
|
236
|
-
const base = full ? null : tileSamples(surface.tiles.get(key), ch, depth, surface.defaultValue);
|
|
237
|
-
const t = base ? base.slice() : depth === 16 ? new Uint16Array(TILE_PIXELS * ch) : new Float32Array(TILE_PIXELS * ch);
|
|
238
|
-
const span = (x1 - x0) * ch;
|
|
239
|
-
for (let yy = y0; yy < y1; yy++) {
|
|
240
|
-
const s = ((yy - rect.y) * w + (x0 - rect.x)) * ch;
|
|
241
|
-
const d = ((yy - oy) * _chunkTFOPHZ3Ucjs.TILE + (x0 - ox)) * ch;
|
|
242
|
-
t.set(samples.subarray(s, s + span), d);
|
|
243
|
-
}
|
|
244
|
-
const tile = deepTile(t, ch, surface.defaultValue);
|
|
245
|
-
if (tile) tiles.set(key, tile);
|
|
246
|
-
else tiles.delete(key);
|
|
247
|
-
}
|
|
248
|
-
return new (0, _chunkTFOPHZ3Ucjs.TiledSurface)(ch, tiles, surface.defaultValue);
|
|
249
|
-
}
|
|
250
|
-
function surfaceFromDeepPixels(pixels, channels = 4, x = 0, y = 0, defaultValue = 0) {
|
|
251
|
-
return writeDeepRegion(_chunkTFOPHZ3Ucjs.emptySurface.call(void 0, channels, defaultValue), { x, y, width: pixels.width, height: pixels.height }, pixels.data);
|
|
252
|
-
}
|
|
253
|
-
function convertSurfaceDepth(surface, depth) {
|
|
254
|
-
let changed = false;
|
|
255
|
-
const tiles = new Map(surface.tiles);
|
|
256
|
-
const ch = surface.channels;
|
|
257
|
-
for (const [key, tile] of surface.tiles) {
|
|
258
|
-
const deep = tile.deep;
|
|
259
|
-
if (!deep || depthOf(deep) === depth) continue;
|
|
260
|
-
changed = true;
|
|
261
|
-
let next;
|
|
262
|
-
if (depth === 8) next = _chunkTFOPHZ3Ucjs.finishTile.call(void 0, tile.data, ch, surface.defaultValue);
|
|
263
|
-
else next = deepTile(depth === 16 ? to16From32(deep, ch) : to32From16(deep, ch), ch, surface.defaultValue);
|
|
264
|
-
if (next) tiles.set(key, next);
|
|
265
|
-
else tiles.delete(key);
|
|
266
|
-
}
|
|
267
|
-
return changed ? new (0, _chunkTFOPHZ3Ucjs.TiledSurface)(ch, tiles, surface.defaultValue) : surface;
|
|
268
|
-
}
|
|
269
|
-
function deepBytes(surface) {
|
|
270
|
-
let n = 0;
|
|
271
|
-
for (const t of surface.tiles.values()) if (t.deep) n += t.deep.byteLength;
|
|
272
|
-
return n;
|
|
273
|
-
}
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
var _chunk7ISPWEJAcjs = require('./chunk-7ISPWEJA.cjs');
|
|
274
38
|
|
|
275
39
|
// src/raster/effects/model.ts
|
|
276
40
|
var DEFAULT_GLOBAL_LIGHT = { angle: 120, altitude: 30 };
|
|
@@ -459,7 +223,7 @@ function oneOf(r, key, path, values) {
|
|
|
459
223
|
if (typeof r[key] !== "string" || !values.includes(r[key])) fail(`${path}.${key}`, `must be one of ${values.join(", ")}.`);
|
|
460
224
|
}
|
|
461
225
|
function blend(r, key, path) {
|
|
462
|
-
if (!
|
|
226
|
+
if (!_chunk7ISPWEJAcjs.isBlendMode.call(void 0, r[key])) fail(`${path}.${key}`, `must be a blend mode such as normal, multiply or screen (got ${JSON.stringify(r[key])}).`);
|
|
463
227
|
if (r[key] === "pigment") fail(`${path}.${key}`, "pigment is a layer blend mode only; effects cannot use it.");
|
|
464
228
|
}
|
|
465
229
|
function contour(v, path) {
|
|
@@ -725,10 +489,10 @@ var DeepCompositor = class {
|
|
|
725
489
|
}
|
|
726
490
|
// --- Steps (as RasterCompositor.buildSteps) ------------------------------------
|
|
727
491
|
isPixel(l) {
|
|
728
|
-
return l.type === "pixel" || (_nullishCoalesce(_optionalChain([this, 'access',
|
|
492
|
+
return l.type === "pixel" || (_nullishCoalesce(_optionalChain([this, 'access', _2 => _2.profile, 'access', _3 => _3.isPixelLike, 'optionalCall', _4 => _4(l)]), () => ( false)));
|
|
729
493
|
}
|
|
730
494
|
isFilter(l) {
|
|
731
|
-
return _nullishCoalesce(_optionalChain([this, 'access',
|
|
495
|
+
return _nullishCoalesce(_optionalChain([this, 'access', _5 => _5.profile, 'access', _6 => _6.isFilterLayer, 'optionalCall', _7 => _7(l)]), () => ( false));
|
|
732
496
|
}
|
|
733
497
|
buildSteps(layers) {
|
|
734
498
|
const steps = [];
|
|
@@ -833,24 +597,24 @@ var DeepCompositor = class {
|
|
|
833
597
|
}
|
|
834
598
|
if (!visible.length) return;
|
|
835
599
|
if (this.deep.applyFilterRunDeep) {
|
|
836
|
-
if (this.linear) mapColour(acc, srgbEncode);
|
|
600
|
+
if (this.linear) mapColour(acc, _chunk7ISPWEJAcjs.srgbEncode);
|
|
837
601
|
this.deep.applyFilterRunDeep(visible, acc, r, masks, this.sources);
|
|
838
|
-
if (this.linear) mapColour(acc, srgbDecode);
|
|
602
|
+
if (this.linear) mapColour(acc, _chunk7ISPWEJAcjs.srgbDecode);
|
|
839
603
|
return;
|
|
840
604
|
}
|
|
841
605
|
const bytes = this.to8(acc);
|
|
842
|
-
_optionalChain([this, 'access',
|
|
606
|
+
_optionalChain([this, 'access', _8 => _8.profile, 'access', _9 => _9.applyFilterRun, 'optionalCall', _10 => _10(visible, bytes, r, masks, this.sources)]);
|
|
843
607
|
acc.set(this.from8(bytes));
|
|
844
608
|
}
|
|
845
609
|
// --- Layer content ---------------------------------------------------------------
|
|
846
610
|
/** Layers drawn by the 8-bit compositor alone (effects, pixel filters, content the editor draws). */
|
|
847
611
|
renderedAlone(layer) {
|
|
848
612
|
if (hasActiveEffects(layer.effects) && !this.isFilter(layer)) return true;
|
|
849
|
-
if (this.isPixel(layer)) return Boolean(_optionalChain([this, 'access',
|
|
613
|
+
if (this.isPixel(layer)) return Boolean(_optionalChain([this, 'access', _11 => _11.profile, 'access', _12 => _12.pixelFilters, 'optionalCall', _13 => _13(layer)]));
|
|
850
614
|
return !isGroup(layer);
|
|
851
615
|
}
|
|
852
616
|
blendOf(layer) {
|
|
853
|
-
return _nullishCoalesce(_optionalChain([this, 'access',
|
|
617
|
+
return _nullishCoalesce(_optionalChain([this, 'access', _14 => _14.profile, 'access', _15 => _15.contentBlend, 'optionalCall', _16 => _16(layer)]), () => ( layer.blend));
|
|
854
618
|
}
|
|
855
619
|
/** A layer's float RGBA over `r` (straight alpha, working space), or `null` when it has none there. */
|
|
856
620
|
content(layer, r) {
|
|
@@ -861,9 +625,9 @@ var DeepCompositor = class {
|
|
|
861
625
|
}
|
|
862
626
|
const surface = this.sources.surfaceOf ? this.sources.surfaceOf(layer) : layer.surface;
|
|
863
627
|
if (!surface) return null;
|
|
864
|
-
const ox = _nullishCoalesce(_optionalChain([layer, 'access',
|
|
865
|
-
const oy = _nullishCoalesce(_optionalChain([layer, 'access',
|
|
866
|
-
const samples = readDeepRegion(surface, { x: r.x - ox, y: r.y - oy, width: r.width, height: r.height }, this.depth);
|
|
628
|
+
const ox = _nullishCoalesce(_optionalChain([layer, 'access', _17 => _17.offset, 'optionalAccess', _18 => _18.x]), () => ( 0));
|
|
629
|
+
const oy = _nullishCoalesce(_optionalChain([layer, 'access', _19 => _19.offset, 'optionalAccess', _20 => _20.y]), () => ( 0));
|
|
630
|
+
const samples = _chunk7ISPWEJAcjs.readDeepRegion.call(void 0, surface, { x: r.x - ox, y: r.y - oy, width: r.width, height: r.height }, this.depth);
|
|
867
631
|
if (samples instanceof Float32Array) return samples;
|
|
868
632
|
const out = new Float32Array(samples.length);
|
|
869
633
|
for (let i = 0; i < samples.length; i++) out[i] = samples[i] / 65535;
|
|
@@ -871,7 +635,7 @@ var DeepCompositor = class {
|
|
|
871
635
|
}
|
|
872
636
|
/** 8-bit RGBA to the working space. */
|
|
873
637
|
from8(bytes) {
|
|
874
|
-
if (this.linear) return to32From8(bytes, 4);
|
|
638
|
+
if (this.linear) return _chunk7ISPWEJAcjs.to32From8.call(void 0, bytes, 4);
|
|
875
639
|
const out = new Float32Array(bytes.length);
|
|
876
640
|
for (let i = 0; i < bytes.length; i++) out[i] = bytes[i] / 255;
|
|
877
641
|
return out;
|
|
@@ -880,7 +644,7 @@ var DeepCompositor = class {
|
|
|
880
644
|
to8(acc) {
|
|
881
645
|
const out = new Uint8ClampedArray(acc.length);
|
|
882
646
|
for (let i = 0; i < acc.length; i += 4) {
|
|
883
|
-
for (let c = 0; c < 3; c++) out[i + c] = Math.round((this.linear ? srgbEncode(acc[i + c]) : acc[i + c]) * 255);
|
|
647
|
+
for (let c = 0; c < 3; c++) out[i + c] = Math.round((this.linear ? _chunk7ISPWEJAcjs.srgbEncode.call(void 0, acc[i + c]) : acc[i + c]) * 255);
|
|
884
648
|
out[i + 3] = Math.round(acc[i + 3] * 255);
|
|
885
649
|
}
|
|
886
650
|
return out;
|
|
@@ -918,13 +682,13 @@ var DeepCompositor = class {
|
|
|
918
682
|
cs[c] = src[i + c];
|
|
919
683
|
}
|
|
920
684
|
if (pigment) {
|
|
921
|
-
if (this.linear) for (let c = 0; c < 3; c++) cb[c] = srgbEncode(cb[c]), cs[c] = srgbEncode(cs[c]);
|
|
922
|
-
|
|
923
|
-
for (let c = 0; c < 3; c++) dst[i + c] = this.linear ? srgbDecode(mix[c]) : mix[c];
|
|
685
|
+
if (this.linear) for (let c = 0; c < 3; c++) cb[c] = _chunk7ISPWEJAcjs.srgbEncode.call(void 0, cb[c]), cs[c] = _chunk7ISPWEJAcjs.srgbEncode.call(void 0, cs[c]);
|
|
686
|
+
_chunk7ISPWEJAcjs.mixPigmentRgb.call(void 0, cb, cs, as / ao, mix);
|
|
687
|
+
for (let c = 0; c < 3; c++) dst[i + c] = this.linear ? _chunk7ISPWEJAcjs.srgbDecode.call(void 0, mix[c]) : mix[c];
|
|
924
688
|
dst[i + 3] = ao;
|
|
925
689
|
continue;
|
|
926
690
|
}
|
|
927
|
-
const m = normal ? cs :
|
|
691
|
+
const m = normal ? cs : _chunk7ISPWEJAcjs.blendRgb.call(void 0, mode, cb, cs);
|
|
928
692
|
const wb = (1 - as) * ab;
|
|
929
693
|
const ws = (1 - ab) * as;
|
|
930
694
|
const wm = as * ab;
|
|
@@ -1126,7 +890,7 @@ function insertLayer(layers, layer, parentId, index) {
|
|
|
1126
890
|
});
|
|
1127
891
|
}
|
|
1128
892
|
function isLayerLocked(layer, what) {
|
|
1129
|
-
return Boolean(_optionalChain([layer, 'access',
|
|
893
|
+
return Boolean(_optionalChain([layer, 'access', _21 => _21.locks, 'optionalAccess', _22 => _22.all]) || _optionalChain([layer, 'access', _23 => _23.locks, 'optionalAccess', _24 => _24[what]]));
|
|
1130
894
|
}
|
|
1131
895
|
|
|
1132
896
|
// src/raster/effects/patterns.ts
|
|
@@ -2087,7 +1851,7 @@ function compositeAt(dst, i, mode, separable, sr, sg, sb, sa) {
|
|
|
2087
1851
|
rgbScratchS[0] = sr;
|
|
2088
1852
|
rgbScratchS[1] = sg;
|
|
2089
1853
|
rgbScratchS[2] = sb;
|
|
2090
|
-
|
|
1854
|
+
_chunk7ISPWEJAcjs.mixPigmentRgb.call(void 0, rgbScratchB, rgbScratchS, sa / ao, rgbScratchM);
|
|
2091
1855
|
dst[i] = rgbScratchM[0];
|
|
2092
1856
|
dst[i + 1] = rgbScratchM[1];
|
|
2093
1857
|
dst[i + 2] = rgbScratchM[2];
|
|
@@ -2102,9 +1866,9 @@ function compositeAt(dst, i, mode, separable, sr, sg, sb, sa) {
|
|
|
2102
1866
|
m1 = sg;
|
|
2103
1867
|
m2 = sb;
|
|
2104
1868
|
} else if (separable) {
|
|
2105
|
-
m0 =
|
|
2106
|
-
m1 =
|
|
2107
|
-
m2 =
|
|
1869
|
+
m0 = _chunk7ISPWEJAcjs.blendChannel.call(void 0, mode, b0, sr);
|
|
1870
|
+
m1 = _chunk7ISPWEJAcjs.blendChannel.call(void 0, mode, b1, sg);
|
|
1871
|
+
m2 = _chunk7ISPWEJAcjs.blendChannel.call(void 0, mode, b2, sb);
|
|
2108
1872
|
} else {
|
|
2109
1873
|
rgbScratchB[0] = b0;
|
|
2110
1874
|
rgbScratchB[1] = b1;
|
|
@@ -2112,7 +1876,7 @@ function compositeAt(dst, i, mode, separable, sr, sg, sb, sa) {
|
|
|
2112
1876
|
rgbScratchS[0] = sr;
|
|
2113
1877
|
rgbScratchS[1] = sg;
|
|
2114
1878
|
rgbScratchS[2] = sb;
|
|
2115
|
-
const m =
|
|
1879
|
+
const m = _chunk7ISPWEJAcjs.blendRgb.call(void 0, mode, rgbScratchB, rgbScratchS);
|
|
2116
1880
|
m0 = m[0];
|
|
2117
1881
|
m1 = m[1];
|
|
2118
1882
|
m2 = m[2];
|
|
@@ -2126,7 +1890,7 @@ function compositeAt(dst, i, mode, separable, sr, sg, sb, sa) {
|
|
|
2126
1890
|
dst[i + 3] = ao;
|
|
2127
1891
|
}
|
|
2128
1892
|
function paint(dst, m, color2, mode, opacity) {
|
|
2129
|
-
const sep = mode !== "normal" &&
|
|
1893
|
+
const sep = mode !== "normal" && _chunk7ISPWEJAcjs.isSeparableBlendMode.call(void 0, mode);
|
|
2130
1894
|
const c = [0, 0, 0, 1];
|
|
2131
1895
|
const n = m.length;
|
|
2132
1896
|
for (let i = 0; i < n; i++) {
|
|
@@ -2415,7 +2179,7 @@ function compositeLayerEffects(input) {
|
|
|
2415
2179
|
}
|
|
2416
2180
|
const premerge = !normalLike;
|
|
2417
2181
|
if (premerge) {
|
|
2418
|
-
const sep2 =
|
|
2182
|
+
const sep2 = _chunk7ISPWEJAcjs.isSeparableBlendMode.call(void 0, input.blend);
|
|
2419
2183
|
for (let i = 0; i < n; i++) {
|
|
2420
2184
|
const p = i * 4;
|
|
2421
2185
|
const sr = lay[p];
|
|
@@ -2535,7 +2299,7 @@ function compositeLayerEffects(input) {
|
|
|
2535
2299
|
paintColor(work, fx(i, 1), e.shadowColor, e.shadowBlend, e.shadowOpacity);
|
|
2536
2300
|
}
|
|
2537
2301
|
const mode = premerge ? "normal" : input.blend;
|
|
2538
|
-
const sep =
|
|
2302
|
+
const sep = _chunk7ISPWEJAcjs.isSeparableBlendMode.call(void 0, mode);
|
|
2539
2303
|
for (let i = 0; i < n; i++) {
|
|
2540
2304
|
const p = i * 4;
|
|
2541
2305
|
if (lay[p + 3] > 0) compositeAt(work, p, mode, sep, lay[p], lay[p + 1], lay[p + 2], lay[p + 3]);
|
|
@@ -2580,8 +2344,8 @@ function renderLayerEffects(effects, layer, backdrop, canvas, ctx) {
|
|
|
2580
2344
|
}
|
|
2581
2345
|
|
|
2582
2346
|
// src/raster/compositor.ts
|
|
2583
|
-
var
|
|
2584
|
-
var TILE_BYTES =
|
|
2347
|
+
var TILE_PIXELS = _chunk7ISPWEJAcjs.TILE * _chunk7ISPWEJAcjs.TILE;
|
|
2348
|
+
var TILE_BYTES = TILE_PIXELS * 4;
|
|
2585
2349
|
function sameSig(a, b) {
|
|
2586
2350
|
if (!a || a.key !== b.key || a.refs.length !== b.refs.length) return false;
|
|
2587
2351
|
for (let i = 0; i < a.refs.length; i++) if (a.refs[i] !== b.refs[i]) return false;
|
|
@@ -2592,13 +2356,13 @@ function dirtyInTile(rects, tx, ty) {
|
|
|
2592
2356
|
let y0 = Infinity;
|
|
2593
2357
|
let x1 = -Infinity;
|
|
2594
2358
|
let y1 = -Infinity;
|
|
2595
|
-
const ox = tx *
|
|
2596
|
-
const oy = ty *
|
|
2359
|
+
const ox = tx * _chunk7ISPWEJAcjs.TILE;
|
|
2360
|
+
const oy = ty * _chunk7ISPWEJAcjs.TILE;
|
|
2597
2361
|
for (const r of rects) {
|
|
2598
2362
|
const a = Math.max(ox, Math.floor(r.x));
|
|
2599
2363
|
const b = Math.max(oy, Math.floor(r.y));
|
|
2600
|
-
const c = Math.min(ox +
|
|
2601
|
-
const d = Math.min(oy +
|
|
2364
|
+
const c = Math.min(ox + _chunk7ISPWEJAcjs.TILE, Math.ceil(r.x + r.width));
|
|
2365
|
+
const d = Math.min(oy + _chunk7ISPWEJAcjs.TILE, Math.ceil(r.y + r.height));
|
|
2602
2366
|
if (c <= a || d <= b) continue;
|
|
2603
2367
|
x0 = Math.min(x0, a);
|
|
2604
2368
|
y0 = Math.min(y0, b);
|
|
@@ -2611,7 +2375,7 @@ function blendTile(dst, src, mode, alpha, coverage) {
|
|
|
2611
2375
|
if (!(alpha > 0)) return;
|
|
2612
2376
|
const normal = mode === "normal";
|
|
2613
2377
|
const pigment = mode === "pigment";
|
|
2614
|
-
const lut = !normal &&
|
|
2378
|
+
const lut = !normal && _chunk7ISPWEJAcjs.isSeparableBlendMode.call(void 0, mode) ? separableLut(mode) : null;
|
|
2615
2379
|
const cb = [0, 0, 0];
|
|
2616
2380
|
const cs = [0, 0, 0];
|
|
2617
2381
|
const n = dst.length;
|
|
@@ -2638,7 +2402,7 @@ function blendTile(dst, src, mode, alpha, coverage) {
|
|
|
2638
2402
|
const d1 = dst[i + 1];
|
|
2639
2403
|
const d2 = dst[i + 2];
|
|
2640
2404
|
if (pigment) {
|
|
2641
|
-
|
|
2405
|
+
_chunk7ISPWEJAcjs.mixPigment8.call(void 0, d0, d1, d2, src[i], src[i + 1], src[i + 2], as / ao, cb);
|
|
2642
2406
|
dst[i] = Math.round(cb[0] * 255);
|
|
2643
2407
|
dst[i + 1] = Math.round(cb[1] * 255);
|
|
2644
2408
|
dst[i + 2] = Math.round(cb[2] * 255);
|
|
@@ -2669,7 +2433,7 @@ function blendTile(dst, src, mode, alpha, coverage) {
|
|
|
2669
2433
|
cs[0] = s0;
|
|
2670
2434
|
cs[1] = s1;
|
|
2671
2435
|
cs[2] = s2;
|
|
2672
|
-
const m =
|
|
2436
|
+
const m = _chunk7ISPWEJAcjs.blendRgb.call(void 0, mode, cb, cs);
|
|
2673
2437
|
m0 = m[0];
|
|
2674
2438
|
m1 = m[1];
|
|
2675
2439
|
m2 = m[2];
|
|
@@ -2688,7 +2452,7 @@ function separableLut(mode) {
|
|
|
2688
2452
|
let lut = separableLuts.get(mode);
|
|
2689
2453
|
if (!lut) {
|
|
2690
2454
|
lut = new Float64Array(65536);
|
|
2691
|
-
for (let b = 0; b < 256; b++) for (let c = 0; c < 256; c++) lut[b << 8 | c] =
|
|
2455
|
+
for (let b = 0; b < 256; b++) for (let c = 0; c < 256; c++) lut[b << 8 | c] = _chunk7ISPWEJAcjs.blendChannel.call(void 0, mode, b / 255, c / 255);
|
|
2692
2456
|
separableLuts.set(mode, lut);
|
|
2693
2457
|
}
|
|
2694
2458
|
return lut;
|
|
@@ -2762,15 +2526,15 @@ var RasterCompositor = (_class = class {
|
|
|
2762
2526
|
composite(layers, rect, sources, options = {}) {
|
|
2763
2527
|
const out = new Uint8ClampedArray(Math.max(0, rect.width * rect.height * 4));
|
|
2764
2528
|
this.compositeTiles(layers, rect, sources, (tx, ty, data) => {
|
|
2765
|
-
const ox = tx *
|
|
2766
|
-
const oy = ty *
|
|
2529
|
+
const ox = tx * _chunk7ISPWEJAcjs.TILE;
|
|
2530
|
+
const oy = ty * _chunk7ISPWEJAcjs.TILE;
|
|
2767
2531
|
const x0 = Math.max(rect.x, ox);
|
|
2768
2532
|
const y0 = Math.max(rect.y, oy);
|
|
2769
|
-
const x1 = Math.min(rect.x + rect.width, ox +
|
|
2770
|
-
const y1 = Math.min(rect.y + rect.height, oy +
|
|
2533
|
+
const x1 = Math.min(rect.x + rect.width, ox + _chunk7ISPWEJAcjs.TILE);
|
|
2534
|
+
const y1 = Math.min(rect.y + rect.height, oy + _chunk7ISPWEJAcjs.TILE);
|
|
2771
2535
|
const span = (x1 - x0) * 4;
|
|
2772
2536
|
for (let y = y0; y < y1; y++) {
|
|
2773
|
-
const s = ((y - oy) *
|
|
2537
|
+
const s = ((y - oy) * _chunk7ISPWEJAcjs.TILE + (x0 - ox)) * 4;
|
|
2774
2538
|
out.set(data.subarray(s, s + span), ((y - rect.y) * rect.width + (x0 - rect.x)) * 4);
|
|
2775
2539
|
}
|
|
2776
2540
|
}, options);
|
|
@@ -2791,9 +2555,9 @@ var RasterCompositor = (_class = class {
|
|
|
2791
2555
|
this.callStats = stats;
|
|
2792
2556
|
const grow = options.dirty ? this.effectsReach(layers) : 0;
|
|
2793
2557
|
const dirty = grow > 0 ? options.dirty.map((d) => inflateRect(d, grow)) : options.dirty;
|
|
2794
|
-
for (const { tx, ty } of
|
|
2558
|
+
for (const { tx, ty } of _chunk7ISPWEJAcjs.tilesInRect.call(void 0, rect)) {
|
|
2795
2559
|
stats.tiles++;
|
|
2796
|
-
const before = _optionalChain([this, 'access',
|
|
2560
|
+
const before = _optionalChain([this, 'access', _25 => _25.tiles, 'access', _26 => _26.get, 'call', _27 => _27(_chunk7ISPWEJAcjs.tileKey.call(void 0, tx, ty)), 'optionalAccess', _28 => _28.result]);
|
|
2797
2561
|
const data = this.compositeTile(layers, steps, tx, ty, stats, dirty ? dirtyInTile(dirty, tx, ty) : null);
|
|
2798
2562
|
onTile(tx, ty, data, data !== before);
|
|
2799
2563
|
}
|
|
@@ -2824,10 +2588,10 @@ var RasterCompositor = (_class = class {
|
|
|
2824
2588
|
// --- Steps -------------------------------------------------------------------
|
|
2825
2589
|
/** Pixel layers, and the layer kinds the profile composites like them. */
|
|
2826
2590
|
isPixel(l) {
|
|
2827
|
-
return l.type === "pixel" || (_nullishCoalesce(_optionalChain([this, 'access',
|
|
2591
|
+
return l.type === "pixel" || (_nullishCoalesce(_optionalChain([this, 'access', _29 => _29.profile, 'access', _30 => _30.isPixelLike, 'optionalCall', _31 => _31(l)]), () => ( false)));
|
|
2828
2592
|
}
|
|
2829
2593
|
isFilter(l) {
|
|
2830
|
-
return _nullishCoalesce(_optionalChain([this, 'access',
|
|
2594
|
+
return _nullishCoalesce(_optionalChain([this, 'access', _32 => _32.profile, 'access', _33 => _33.isFilterLayer, 'optionalCall', _34 => _34(l)]), () => ( false));
|
|
2831
2595
|
}
|
|
2832
2596
|
/**
|
|
2833
2597
|
* Groups a layer list into compositing steps: clipped layers join the nearest unclipped
|
|
@@ -2866,16 +2630,16 @@ var RasterCompositor = (_class = class {
|
|
|
2866
2630
|
if (key !== void 0) return key;
|
|
2867
2631
|
const mask = layer.mask ? [layer.mask.enabled !== false, _nullishCoalesce(layer.mask.density, () => ( 1)), _nullishCoalesce(layer.mask.feather, () => ( 0)), layer.mask.defaultValue, _nullishCoalesce(layer.mask.source, () => ( null))] : null;
|
|
2868
2632
|
const base = [layer.type, layer.id, layer.visible, layer.opacity, layer.blend, Boolean(layer.clipped), mask];
|
|
2869
|
-
if (this.isPixel(layer)) base.push(_nullishCoalesce(_optionalChain([layer, 'access',
|
|
2633
|
+
if (this.isPixel(layer)) base.push(_nullishCoalesce(_optionalChain([layer, 'access', _35 => _35.offset, 'optionalAccess', _36 => _36.x]), () => ( 0)), _nullishCoalesce(_optionalChain([layer, 'access', _37 => _37.offset, 'optionalAccess', _38 => _38.y]), () => ( 0)), _nullishCoalesce(layer.fillOpacity, () => ( 1)));
|
|
2870
2634
|
if (this.hasEffects(layer)) base.push(effectsFingerprint(layer.effects));
|
|
2871
|
-
const extra = _optionalChain([this, 'access',
|
|
2635
|
+
const extra = _optionalChain([this, 'access', _39 => _39.profile, 'access', _40 => _40.layerKey, 'optionalCall', _41 => _41(layer)]);
|
|
2872
2636
|
if (extra !== void 0) base.push(extra);
|
|
2873
2637
|
key = JSON.stringify(base);
|
|
2874
2638
|
this.propsKeyCache.set(layer, key);
|
|
2875
2639
|
return key;
|
|
2876
2640
|
}
|
|
2877
2641
|
compositeTile(root, steps, tx, ty, stats, dirty = null) {
|
|
2878
|
-
const key =
|
|
2642
|
+
const key = _chunk7ISPWEJAcjs.tileKey.call(void 0, tx, ty);
|
|
2879
2643
|
const entry = this.tiles.get(key);
|
|
2880
2644
|
const sigs = steps.map((s) => this.stepSig(s, tx, ty));
|
|
2881
2645
|
let first = 0;
|
|
@@ -2898,20 +2662,20 @@ var RasterCompositor = (_class = class {
|
|
|
2898
2662
|
}
|
|
2899
2663
|
}
|
|
2900
2664
|
}
|
|
2901
|
-
const tileRect = { x: tx *
|
|
2665
|
+
const tileRect = { x: tx * _chunk7ISPWEJAcjs.TILE, y: ty * _chunk7ISPWEJAcjs.TILE, width: _chunk7ISPWEJAcjs.TILE, height: _chunk7ISPWEJAcjs.TILE };
|
|
2902
2666
|
const hint = this.hint;
|
|
2903
2667
|
const checkpoints = /* @__PURE__ */ new Map();
|
|
2904
2668
|
if (entry) {
|
|
2905
2669
|
for (const [index, cp] of entry.checkpoints) if (index <= start) checkpoints.set(index, cp);
|
|
2906
2670
|
}
|
|
2907
2671
|
let result;
|
|
2908
|
-
if (entry && dirty && (dirty.width <
|
|
2672
|
+
if (entry && dirty && (dirty.width < _chunk7ISPWEJAcjs.TILE || dirty.height < _chunk7ISPWEJAcjs.TILE)) {
|
|
2909
2673
|
const r = dirty;
|
|
2910
2674
|
const sub = (data) => {
|
|
2911
2675
|
const out = new Uint8ClampedArray(r.width * r.height * 4);
|
|
2912
2676
|
if (!data) return out;
|
|
2913
2677
|
for (let y = 0; y < r.height; y++) {
|
|
2914
|
-
const s = ((r.y - tileRect.y + y) *
|
|
2678
|
+
const s = ((r.y - tileRect.y + y) * _chunk7ISPWEJAcjs.TILE + (r.x - tileRect.x)) * 4;
|
|
2915
2679
|
out.set(data.subarray(s, s + r.width * 4), y * r.width * 4);
|
|
2916
2680
|
}
|
|
2917
2681
|
return out;
|
|
@@ -2924,7 +2688,7 @@ var RasterCompositor = (_class = class {
|
|
|
2924
2688
|
}
|
|
2925
2689
|
result = new Uint8ClampedArray(entry.result);
|
|
2926
2690
|
for (let y = 0; y < r.height; y++) {
|
|
2927
|
-
result.set(acc.subarray(y * r.width * 4, (y + 1) * r.width * 4), ((r.y - tileRect.y + y) *
|
|
2691
|
+
result.set(acc.subarray(y * r.width * 4, (y + 1) * r.width * 4), ((r.y - tileRect.y + y) * _chunk7ISPWEJAcjs.TILE + (r.x - tileRect.x)) * 4);
|
|
2928
2692
|
}
|
|
2929
2693
|
} else {
|
|
2930
2694
|
const acc = base ? new Uint8ClampedArray(base.data) : new Uint8ClampedArray(TILE_BYTES);
|
|
@@ -3033,9 +2797,9 @@ var RasterCompositor = (_class = class {
|
|
|
3033
2797
|
if (!this.isPixel(layer)) return { key, refs: this.maskRefs(layer, tx, ty, 0, 0) };
|
|
3034
2798
|
const { surface, dx, dy } = this.layerPixels(layer);
|
|
3035
2799
|
const refs = [surface.defaultValue];
|
|
3036
|
-
const r = { x: tx *
|
|
3037
|
-
for (const t of
|
|
3038
|
-
refs.push(...this.maskRefs(layer, tx, ty, _nullishCoalesce(_optionalChain([layer, 'access',
|
|
2800
|
+
const r = { x: tx * _chunk7ISPWEJAcjs.TILE - dx, y: ty * _chunk7ISPWEJAcjs.TILE - dy, width: _chunk7ISPWEJAcjs.TILE, height: _chunk7ISPWEJAcjs.TILE };
|
|
2801
|
+
for (const t of _chunk7ISPWEJAcjs.tilesInRect.call(void 0, r)) refs.push(_nullishCoalesce(surface.getTile(t.tx, t.ty), () => ( null)));
|
|
2802
|
+
refs.push(...this.maskRefs(layer, tx, ty, _nullishCoalesce(_optionalChain([layer, 'access', _42 => _42.offset, 'optionalAccess', _43 => _43.x]), () => ( 0)), _nullishCoalesce(_optionalChain([layer, 'access', _44 => _44.offset, 'optionalAccess', _45 => _45.y]), () => ( 0))));
|
|
3039
2803
|
return { key, refs };
|
|
3040
2804
|
}
|
|
3041
2805
|
// --- Layer effects ------------------------------------------------------------
|
|
@@ -3065,7 +2829,7 @@ var RasterCompositor = (_class = class {
|
|
|
3065
2829
|
this.fxContext = {
|
|
3066
2830
|
light: _nullishCoalesce(sources.globalLight, () => ( DEFAULT_GLOBAL_LIGHT)),
|
|
3067
2831
|
pattern: (id) => {
|
|
3068
|
-
const p = _nullishCoalesce(_optionalChain([sources, 'access',
|
|
2832
|
+
const p = _nullishCoalesce(_optionalChain([sources, 'access', _46 => _46.pattern, 'optionalCall', _47 => _47(id)]), () => ( builtinPattern(id)));
|
|
3069
2833
|
if (!p || !(p.width > 0 && p.height > 0) || p.data.length < p.width * p.height * 4) return null;
|
|
3070
2834
|
let t = tiles.get(p);
|
|
3071
2835
|
if (!t) {
|
|
@@ -3096,8 +2860,8 @@ var RasterCompositor = (_class = class {
|
|
|
3096
2860
|
const sigs = /* @__PURE__ */ new Map();
|
|
3097
2861
|
if (region.width <= 0 || region.height <= 0) return sigs;
|
|
3098
2862
|
const steps = isGroup2(layer) ? this.buildSteps(_nullishCoalesce(layer.children, () => ( []))) : null;
|
|
3099
|
-
for (const t of
|
|
3100
|
-
sigs.set(
|
|
2863
|
+
for (const t of _chunk7ISPWEJAcjs.tilesInRect.call(void 0, region)) {
|
|
2864
|
+
sigs.set(_chunk7ISPWEJAcjs.tileKey.call(void 0, t.tx, t.ty), steps ? this.plainGroupSig(layer, steps, t.tx, t.ty) : this.plainContentSig(layer, t.tx, t.ty));
|
|
3101
2865
|
}
|
|
3102
2866
|
return sigs;
|
|
3103
2867
|
}
|
|
@@ -3121,7 +2885,7 @@ var RasterCompositor = (_class = class {
|
|
|
3121
2885
|
const region = this.effectRegion(layer);
|
|
3122
2886
|
const m = effectsMargin(layer.effects);
|
|
3123
2887
|
if (effectsAreLocal(activeEffectItems(layer.effects))) {
|
|
3124
|
-
return { key, refs: this.shapeRefs(layer, intersectRect({ x: tx *
|
|
2888
|
+
return { key, refs: this.shapeRefs(layer, intersectRect({ x: tx * _chunk7ISPWEJAcjs.TILE - m, y: ty * _chunk7ISPWEJAcjs.TILE - m, width: _chunk7ISPWEJAcjs.TILE + 2 * m, height: _chunk7ISPWEJAcjs.TILE + 2 * m }, region)) };
|
|
3125
2889
|
}
|
|
3126
2890
|
return { key, refs: [`${region.x},${region.y},${region.width},${region.height}`, ...this.shapeRefs(layer, region)] };
|
|
3127
2891
|
}
|
|
@@ -3170,11 +2934,11 @@ var RasterCompositor = (_class = class {
|
|
|
3170
2934
|
*/
|
|
3171
2935
|
shapeChanges(layer, prev, tiles, region) {
|
|
3172
2936
|
const out = [];
|
|
3173
|
-
for (const { tx, ty } of
|
|
3174
|
-
const sig = tiles.get(
|
|
3175
|
-
const old = prev.tiles.get(
|
|
2937
|
+
for (const { tx, ty } of _chunk7ISPWEJAcjs.tilesInRect.call(void 0, region)) {
|
|
2938
|
+
const sig = tiles.get(_chunk7ISPWEJAcjs.tileKey.call(void 0, tx, ty));
|
|
2939
|
+
const old = prev.tiles.get(_chunk7ISPWEJAcjs.tileKey.call(void 0, tx, ty));
|
|
3176
2940
|
if (old ? sameSig(old, sig) : sig.refs.every((r2) => r2 === null || r2 === 0)) continue;
|
|
3177
|
-
const r = intersectRect({ x: tx *
|
|
2941
|
+
const r = intersectRect({ x: tx * _chunk7ISPWEJAcjs.TILE, y: ty * _chunk7ISPWEJAcjs.TILE, width: _chunk7ISPWEJAcjs.TILE, height: _chunk7ISPWEJAcjs.TILE }, region);
|
|
3178
2942
|
if (r.width > 0 && r.height > 0) out.push(r);
|
|
3179
2943
|
}
|
|
3180
2944
|
const dirty = this.callDirty;
|
|
@@ -3193,7 +2957,7 @@ var RasterCompositor = (_class = class {
|
|
|
3193
2957
|
* without filters or a feathered or parametric mask (those spread a change beyond it).
|
|
3194
2958
|
*/
|
|
3195
2959
|
dirtyCoversShape(layer) {
|
|
3196
|
-
if (!this.isPixel(layer) || _optionalChain([this, 'access',
|
|
2960
|
+
if (!this.isPixel(layer) || _optionalChain([this, 'access', _48 => _48.profile, 'access', _49 => _49.pixelFilters, 'optionalCall', _50 => _50(layer)])) return false;
|
|
3197
2961
|
const mask = layer.mask;
|
|
3198
2962
|
return !mask || mask.enabled === false || !mask.source && !((_nullishCoalesce(mask.feather, () => ( 0))) > 0);
|
|
3199
2963
|
}
|
|
@@ -3269,7 +3033,7 @@ var RasterCompositor = (_class = class {
|
|
|
3269
3033
|
if (!mask || mask.enabled === false) return [];
|
|
3270
3034
|
if (mask.source || (_nullishCoalesce(mask.feather, () => ( 0))) > 0) return [this.planeFor(mask, ox, oy)];
|
|
3271
3035
|
const refs = [];
|
|
3272
|
-
for (const t of
|
|
3036
|
+
for (const t of _chunk7ISPWEJAcjs.tilesInRect.call(void 0, { x: tx * _chunk7ISPWEJAcjs.TILE - ox, y: ty * _chunk7ISPWEJAcjs.TILE - oy, width: _chunk7ISPWEJAcjs.TILE, height: _chunk7ISPWEJAcjs.TILE })) {
|
|
3273
3037
|
refs.push(_nullishCoalesce(mask.surface.getTile(t.tx, t.ty), () => ( null)));
|
|
3274
3038
|
}
|
|
3275
3039
|
return refs;
|
|
@@ -3281,10 +3045,10 @@ var RasterCompositor = (_class = class {
|
|
|
3281
3045
|
*/
|
|
3282
3046
|
layerPixels(layer) {
|
|
3283
3047
|
const raw = this.sources.surfaceOf ? this.sources.surfaceOf(layer) : layer.surface;
|
|
3284
|
-
const ox = _nullishCoalesce(_optionalChain([layer, 'access',
|
|
3285
|
-
const oy = _nullishCoalesce(_optionalChain([layer, 'access',
|
|
3286
|
-
const filters = _nullishCoalesce(_optionalChain([this, 'access',
|
|
3287
|
-
if (!_optionalChain([filters, 'optionalAccess',
|
|
3048
|
+
const ox = _nullishCoalesce(_optionalChain([layer, 'access', _51 => _51.offset, 'optionalAccess', _52 => _52.x]), () => ( 0));
|
|
3049
|
+
const oy = _nullishCoalesce(_optionalChain([layer, 'access', _53 => _53.offset, 'optionalAccess', _54 => _54.y]), () => ( 0));
|
|
3050
|
+
const filters = _nullishCoalesce(_optionalChain([this, 'access', _55 => _55.profile, 'access', _56 => _56.pixelFilters, 'optionalCall', _57 => _57(layer)]), () => ( null));
|
|
3051
|
+
if (!_optionalChain([filters, 'optionalAccess', _58 => _58.spatial])) return { surface: raw, dx: ox, dy: oy, perPixel: filters };
|
|
3288
3052
|
const fkey = `${ox},${oy}:${filters.key}`;
|
|
3289
3053
|
let byKey = this.filteredCache.get(raw);
|
|
3290
3054
|
if (!byKey) {
|
|
@@ -3301,25 +3065,25 @@ var RasterCompositor = (_class = class {
|
|
|
3301
3065
|
}
|
|
3302
3066
|
/** RGBA of a content layer over `r` (document space, inside one tile), or `null` when it has nothing there. */
|
|
3303
3067
|
contentTile(layer, r) {
|
|
3304
|
-
if (!this.isPixel(layer)) return _nullishCoalesce(_optionalChain([this, 'access',
|
|
3068
|
+
if (!this.isPixel(layer)) return _nullishCoalesce(_optionalChain([this, 'access', _59 => _59.profile, 'access', _60 => _60.contentTile, 'optionalCall', _61 => _61(layer, r, this.sources)]), () => ( null));
|
|
3305
3069
|
const { surface, dx, dy, perPixel } = this.layerPixels(layer);
|
|
3306
3070
|
const src = { x: r.x - dx, y: r.y - dy, width: r.width, height: r.height };
|
|
3307
|
-
const covered =
|
|
3071
|
+
const covered = _chunk7ISPWEJAcjs.tilesInRect.call(void 0, src).map((t) => surface.getTile(t.tx, t.ty));
|
|
3308
3072
|
if (surface.defaultValue === 0 && covered.every((t) => !t)) return null;
|
|
3309
|
-
const aligned = r.width ===
|
|
3073
|
+
const aligned = r.width === _chunk7ISPWEJAcjs.TILE && r.height === _chunk7ISPWEJAcjs.TILE && src.x % _chunk7ISPWEJAcjs.TILE === 0 && src.y % _chunk7ISPWEJAcjs.TILE === 0;
|
|
3310
3074
|
if (!perPixel) {
|
|
3311
3075
|
if (aligned && covered[0]) return covered[0].data;
|
|
3312
|
-
return
|
|
3076
|
+
return _chunk7ISPWEJAcjs.readRegion.call(void 0, surface, src);
|
|
3313
3077
|
}
|
|
3314
3078
|
const fkey = `${dx},${dy}:${perPixel.key}`;
|
|
3315
3079
|
const anchor = _nullishCoalesce(covered.find(Boolean), () => ( surface));
|
|
3316
3080
|
let byKey = this.contentCache.get(anchor);
|
|
3317
3081
|
const refsKey = `${r.x},${r.y}:${fkey}`;
|
|
3318
3082
|
if (aligned) {
|
|
3319
|
-
const hit = _optionalChain([byKey, 'optionalAccess',
|
|
3083
|
+
const hit = _optionalChain([byKey, 'optionalAccess', _62 => _62.get, 'call', _63 => _63(refsKey)]);
|
|
3320
3084
|
if (hit) return hit;
|
|
3321
3085
|
}
|
|
3322
|
-
const data =
|
|
3086
|
+
const data = _chunk7ISPWEJAcjs.readRegion.call(void 0, surface, src);
|
|
3323
3087
|
perPixel.apply(data, r.width, r.height);
|
|
3324
3088
|
if (aligned) {
|
|
3325
3089
|
if (!byKey) {
|
|
@@ -3354,11 +3118,11 @@ var RasterCompositor = (_class = class {
|
|
|
3354
3118
|
const H = this.sources.height;
|
|
3355
3119
|
let v = new Float32Array(W * H);
|
|
3356
3120
|
if (mask.source) {
|
|
3357
|
-
const generated = _nullishCoalesce(_optionalChain([this, 'access',
|
|
3121
|
+
const generated = _nullishCoalesce(_optionalChain([this, 'access', _64 => _64.profile, 'access', _65 => _65.maskSourcePlane, 'optionalCall', _66 => _66(mask.source, W, H, this.sources)]), () => ( null));
|
|
3358
3122
|
if (!generated || generated.length !== W * H) v.fill(1);
|
|
3359
3123
|
else v.set(generated);
|
|
3360
3124
|
} else {
|
|
3361
|
-
const bytes =
|
|
3125
|
+
const bytes = _chunk7ISPWEJAcjs.readRegion.call(void 0, mask.surface, { x: -ox, y: -oy, width: W, height: H });
|
|
3362
3126
|
for (let i = 0; i < v.length; i++) v[i] = bytes[i] / 255;
|
|
3363
3127
|
}
|
|
3364
3128
|
const feather = _nullishCoalesce(mask.feather, () => ( 0));
|
|
@@ -3373,8 +3137,8 @@ var RasterCompositor = (_class = class {
|
|
|
3373
3137
|
maskTile(layer, r) {
|
|
3374
3138
|
const mask = layer.mask;
|
|
3375
3139
|
if (!mask || mask.enabled === false) return null;
|
|
3376
|
-
const ox = this.isPixel(layer) ? _nullishCoalesce(_optionalChain([layer, 'access',
|
|
3377
|
-
const oy = this.isPixel(layer) ? _nullishCoalesce(_optionalChain([layer, 'access',
|
|
3140
|
+
const ox = this.isPixel(layer) ? _nullishCoalesce(_optionalChain([layer, 'access', _67 => _67.offset, 'optionalAccess', _68 => _68.x]), () => ( 0)) : 0;
|
|
3141
|
+
const oy = this.isPixel(layer) ? _nullishCoalesce(_optionalChain([layer, 'access', _69 => _69.offset, 'optionalAccess', _70 => _70.y]), () => ( 0)) : 0;
|
|
3378
3142
|
const n = r.width * r.height;
|
|
3379
3143
|
const out = new Float32Array(n);
|
|
3380
3144
|
const density = _nullishCoalesce(mask.density, () => ( 1));
|
|
@@ -3394,7 +3158,7 @@ var RasterCompositor = (_class = class {
|
|
|
3394
3158
|
for (let x = x0; x < x1; x++) out[d + x] = plane.data[s + x];
|
|
3395
3159
|
}
|
|
3396
3160
|
} else {
|
|
3397
|
-
const bytes =
|
|
3161
|
+
const bytes = _chunk7ISPWEJAcjs.readRegion.call(void 0, mask.surface, { x: r.x - ox, y: r.y - oy, width: r.width, height: r.height });
|
|
3398
3162
|
let all = true;
|
|
3399
3163
|
for (let i = 0; i < n; i++) {
|
|
3400
3164
|
out[i] = bytes[i] / 255;
|
|
@@ -3448,7 +3212,7 @@ var RasterCompositor = (_class = class {
|
|
|
3448
3212
|
return empty;
|
|
3449
3213
|
}
|
|
3450
3214
|
contentBlend(layer) {
|
|
3451
|
-
return _nullishCoalesce(_optionalChain([this, 'access',
|
|
3215
|
+
return _nullishCoalesce(_optionalChain([this, 'access', _71 => _71.profile, 'access', _72 => _72.contentBlend, 'optionalCall', _73 => _73(layer)]), () => ( layer.blend));
|
|
3452
3216
|
}
|
|
3453
3217
|
blendOnto(acc, src, empty, mode, alpha, coverage) {
|
|
3454
3218
|
if (!(alpha > 0)) return empty;
|
|
@@ -3502,14 +3266,14 @@ var RasterCompositor = (_class = class {
|
|
|
3502
3266
|
}
|
|
3503
3267
|
visible.push(node);
|
|
3504
3268
|
}
|
|
3505
|
-
if (visible.length) _optionalChain([this, 'access',
|
|
3269
|
+
if (visible.length) _optionalChain([this, 'access', _74 => _74.profile, 'access', _75 => _75.applyFilterRun, 'optionalCall', _76 => _76(visible, acc, r, masks, this.sources)]);
|
|
3506
3270
|
}
|
|
3507
3271
|
}, _class);
|
|
3508
3272
|
function filterOverCanvas(surface, ox, oy, filters, width, height) {
|
|
3509
|
-
if (width <= 0 || height <= 0) return
|
|
3510
|
-
const data =
|
|
3273
|
+
if (width <= 0 || height <= 0) return _chunk7ISPWEJAcjs.emptySurface.call(void 0, 4);
|
|
3274
|
+
const data = _chunk7ISPWEJAcjs.readRegion.call(void 0, surface, { x: -ox, y: -oy, width, height });
|
|
3511
3275
|
filters.apply(data, width, height);
|
|
3512
|
-
return
|
|
3276
|
+
return _chunk7ISPWEJAcjs.surfaceFromPixels.call(void 0, { width, height, data }, 4, 0, 0);
|
|
3513
3277
|
}
|
|
3514
3278
|
function copyRect(data, r, a) {
|
|
3515
3279
|
const out = new Uint8ClampedArray(a.width * a.height * 4);
|
|
@@ -3598,16 +3362,16 @@ function intersect(a, b) {
|
|
|
3598
3362
|
return x1 > x && y1 > y ? { x, y, width: x1 - x, height: y1 - y } : null;
|
|
3599
3363
|
}
|
|
3600
3364
|
function hasTilesIn(src, r) {
|
|
3601
|
-
for (const { tx, ty } of
|
|
3365
|
+
for (const { tx, ty } of _chunk7ISPWEJAcjs.tilesInRect.call(void 0, r)) if (src.getTile(tx, ty)) return true;
|
|
3602
3366
|
return false;
|
|
3603
3367
|
}
|
|
3604
|
-
function readWindow(src, srcRect, rect) {
|
|
3368
|
+
function readWindow(src, srcRect, rect, depth = null) {
|
|
3605
3369
|
const n = src.channels === 4 ? 4 : 2;
|
|
3606
3370
|
const data = new Float32Array(rect.width * rect.height * n);
|
|
3607
3371
|
const win = { x: rect.x, y: rect.y, w: rect.width, h: rect.height, n, data };
|
|
3608
3372
|
const r = intersect(rect, srcRect);
|
|
3609
3373
|
if (!r) return win;
|
|
3610
|
-
const px =
|
|
3374
|
+
const px = depth ? readScaled(src, r, depth) : _chunk7ISPWEJAcjs.readRegion.call(void 0, src, r);
|
|
3611
3375
|
for (let y = 0; y < r.height; y++) {
|
|
3612
3376
|
let s = y * r.width * src.channels;
|
|
3613
3377
|
let d = ((r.y - rect.y + y) * rect.width + (r.x - rect.x)) * n;
|
|
@@ -3741,7 +3505,44 @@ function store(out, o, acc, ch, def) {
|
|
|
3741
3505
|
out[o] = acc[0] + def * (1 - inside);
|
|
3742
3506
|
return true;
|
|
3743
3507
|
}
|
|
3744
|
-
function
|
|
3508
|
+
function resampleDepth(src, step) {
|
|
3509
|
+
if (src.channels !== 4 || src.defaultValue !== 0 || step !== 1) return null;
|
|
3510
|
+
const d = _chunk7ISPWEJAcjs.surfaceDepth.call(void 0, src);
|
|
3511
|
+
return d === 8 ? null : d;
|
|
3512
|
+
}
|
|
3513
|
+
function readScaled(src, rect, depth) {
|
|
3514
|
+
const d = _chunk7ISPWEJAcjs.readDeepRegion.call(void 0, src, rect, depth);
|
|
3515
|
+
const out = new Float32Array(d.length);
|
|
3516
|
+
const k = depth === 16 ? 1 / 257 : 255;
|
|
3517
|
+
for (let i = 0; i < d.length; i++) out[i] = d[i] * k;
|
|
3518
|
+
return out;
|
|
3519
|
+
}
|
|
3520
|
+
function fromScaled(v, depth) {
|
|
3521
|
+
if (depth === 16) {
|
|
3522
|
+
const out2 = new Uint16Array(v.length);
|
|
3523
|
+
for (let i = 0; i < v.length; i++) {
|
|
3524
|
+
const x = Math.round(v[i] * 257);
|
|
3525
|
+
out2[i] = x <= 0 ? 0 : x >= 65535 ? 65535 : x;
|
|
3526
|
+
}
|
|
3527
|
+
return out2;
|
|
3528
|
+
}
|
|
3529
|
+
const out = new Float32Array(v.length);
|
|
3530
|
+
for (let i = 0; i < v.length; i++) {
|
|
3531
|
+
const x = v[i] / 255;
|
|
3532
|
+
out[i] = (i & 3) === 3 ? x <= 0 ? 0 : x >= 1 ? 1 : x : x;
|
|
3533
|
+
}
|
|
3534
|
+
return out;
|
|
3535
|
+
}
|
|
3536
|
+
function storeScaled(out, o, acc) {
|
|
3537
|
+
const al = acc[3] > 1 ? 1 : acc[3];
|
|
3538
|
+
if (!(al > 1e-6)) return false;
|
|
3539
|
+
out[o] = acc[0] / al;
|
|
3540
|
+
out[o + 1] = acc[1] / al;
|
|
3541
|
+
out[o + 2] = acc[2] / al;
|
|
3542
|
+
out[o + 3] = al * 255;
|
|
3543
|
+
return true;
|
|
3544
|
+
}
|
|
3545
|
+
function boxReduce(src, srcRect, kx, ky, depth = null) {
|
|
3745
3546
|
const ch = src.channels;
|
|
3746
3547
|
const rx0 = Math.floor(srcRect.x / kx);
|
|
3747
3548
|
const ry0 = Math.floor(srcRect.y / ky);
|
|
@@ -3749,14 +3550,14 @@ function boxReduce(src, srcRect, kx, ky) {
|
|
|
3749
3550
|
const ry1 = Math.ceil((srcRect.y + srcRect.height) / ky);
|
|
3750
3551
|
const rw = rx1 - rx0;
|
|
3751
3552
|
const rect = { x: rx0, y: ry0, width: rw, height: ry1 - ry0 };
|
|
3752
|
-
let out =
|
|
3753
|
-
const rowsPer = Math.max(1, Math.floor(
|
|
3553
|
+
let out = _chunk7ISPWEJAcjs.emptySurface.call(void 0, ch, src.defaultValue);
|
|
3554
|
+
const rowsPer = Math.max(1, Math.floor(_chunk7ISPWEJAcjs.TILE / ky));
|
|
3754
3555
|
const area = kx * ky;
|
|
3755
3556
|
for (let ry = ry0; ry < ry1; ry += rowsPer) {
|
|
3756
3557
|
const rows = Math.min(rowsPer, ry1 - ry);
|
|
3757
3558
|
const strip = { x: rx0 * kx, y: ry * ky, width: rw * kx, height: rows * ky };
|
|
3758
|
-
const px =
|
|
3759
|
-
const red = new Uint8ClampedArray(rw * rows * ch);
|
|
3559
|
+
const px = depth ? readScaled(src, strip, depth) : _chunk7ISPWEJAcjs.readRegion.call(void 0, src, strip);
|
|
3560
|
+
const red = depth ? new Float32Array(rw * rows * ch) : new Uint8ClampedArray(rw * rows * ch);
|
|
3760
3561
|
for (let j = 0; j < rows; j++) {
|
|
3761
3562
|
for (let i = 0; i < rw; i++) {
|
|
3762
3563
|
if (ch === 4) {
|
|
@@ -3791,13 +3592,14 @@ function boxReduce(src, srcRect, kx, ky) {
|
|
|
3791
3592
|
}
|
|
3792
3593
|
}
|
|
3793
3594
|
}
|
|
3794
|
-
|
|
3595
|
+
const region = { x: rx0, y: ry, width: rw, height: rows };
|
|
3596
|
+
out = depth ? _chunk7ISPWEJAcjs.writeDeepRegion.call(void 0, out, region, fromScaled(red, depth)) : _chunk7ISPWEJAcjs.writeRegion.call(void 0, out, region, red);
|
|
3795
3597
|
}
|
|
3796
3598
|
return { surface: out, rect };
|
|
3797
3599
|
}
|
|
3798
3600
|
function reduceSurface(src, factor) {
|
|
3799
3601
|
const k = Math.max(1, Math.floor(factor));
|
|
3800
|
-
const b =
|
|
3602
|
+
const b = _chunk7ISPWEJAcjs.contentBounds.call(void 0, src);
|
|
3801
3603
|
if (k === 1 || !b) return src;
|
|
3802
3604
|
return boxReduce(src, b, k, k).surface;
|
|
3803
3605
|
}
|
|
@@ -3825,7 +3627,7 @@ function checkBudget(dst, what = "result") {
|
|
|
3825
3627
|
}
|
|
3826
3628
|
}
|
|
3827
3629
|
function assemble(src, tiles) {
|
|
3828
|
-
return new (0,
|
|
3630
|
+
return new (0, _chunk7ISPWEJAcjs.TiledSurface)(src.channels, tiles, src.defaultValue);
|
|
3829
3631
|
}
|
|
3830
3632
|
function transformedBounds(source, h) {
|
|
3831
3633
|
if (!(source.width > 0 && source.height > 0) || !_chunkEJVDBITDcjs.invertHomography.call(void 0, h)) return null;
|
|
@@ -3837,16 +3639,23 @@ function transformSurface(src, h, options = {}) {
|
|
|
3837
3639
|
const interp = _nullishCoalesce(options.interpolation, () => ( "bicubic"));
|
|
3838
3640
|
const ch = src.channels;
|
|
3839
3641
|
const def = src.defaultValue;
|
|
3840
|
-
const empty =
|
|
3642
|
+
const empty = _chunk7ISPWEJAcjs.emptySurface.call(void 0, ch, def);
|
|
3841
3643
|
const given = options.source;
|
|
3842
3644
|
const step = normalizeStep(options.step);
|
|
3645
|
+
const depth = resampleDepth(src, step);
|
|
3843
3646
|
if (_chunkEJVDBITDcjs.isIdentityHomography.call(void 0, h, 1e-12) && !given && !options.clip) return src;
|
|
3844
3647
|
const dx = h[2] / h[8];
|
|
3845
3648
|
const dy = h[5] / h[8];
|
|
3846
3649
|
if (!given && !options.clip && _chunkEJVDBITDcjs.isIdentityHomography.call(void 0, [h[0], h[1], 0, h[3], h[4], 0, h[6], h[7], h[8]], 1e-12) && Math.abs(dx - Math.round(dx)) < 1e-9 && Math.abs(dy - Math.round(dy)) < 1e-9) {
|
|
3847
|
-
|
|
3650
|
+
const mx = Math.round(dx);
|
|
3651
|
+
const my = Math.round(dy);
|
|
3652
|
+
const b = src.bounds;
|
|
3653
|
+
if (depth && b && (mx % _chunk7ISPWEJAcjs.TILE !== 0 || my % _chunk7ISPWEJAcjs.TILE !== 0)) {
|
|
3654
|
+
return _chunk7ISPWEJAcjs.writeDeepRegion.call(void 0, _chunk7ISPWEJAcjs.emptySurface.call(void 0, ch, def), { ...b, x: b.x + mx, y: b.y + my }, _chunk7ISPWEJAcjs.readDeepRegion.call(void 0, src, b, depth));
|
|
3655
|
+
}
|
|
3656
|
+
return _chunk7ISPWEJAcjs.translateSurface.call(void 0, src, mx, my);
|
|
3848
3657
|
}
|
|
3849
|
-
let srcRect = given ? intersect(given, given) :
|
|
3658
|
+
let srcRect = given ? intersect(given, given) : _chunk7ISPWEJAcjs.contentBounds.call(void 0, src);
|
|
3850
3659
|
if (!srcRect) return empty;
|
|
3851
3660
|
let H = h;
|
|
3852
3661
|
let S = src;
|
|
@@ -3858,7 +3667,7 @@ function transformSurface(src, h, options = {}) {
|
|
|
3858
3667
|
const kx = reduction(su);
|
|
3859
3668
|
const ky = reduction(sv);
|
|
3860
3669
|
if (kx > 1 || ky > 1) {
|
|
3861
|
-
const red = boxReduce(src, srcRect, kx, ky);
|
|
3670
|
+
const red = boxReduce(src, srcRect, kx, ky, depth);
|
|
3862
3671
|
S = red.surface;
|
|
3863
3672
|
srcRect = red.rect;
|
|
3864
3673
|
H = _chunkEJVDBITDcjs.multiplyHomographies.call(void 0, [kx, 0, 0, 0, ky, 0, 0, 0, 1], H);
|
|
@@ -3896,8 +3705,8 @@ function transformSurface(src, h, options = {}) {
|
|
|
3896
3705
|
const sy0 = sr.y;
|
|
3897
3706
|
const sx1 = sr.x + sr.width - 1;
|
|
3898
3707
|
const sy1 = sr.y + sr.height - 1;
|
|
3899
|
-
for (const { tx, ty } of
|
|
3900
|
-
const t = intersect({ x: tx *
|
|
3708
|
+
for (const { tx, ty } of _chunk7ISPWEJAcjs.tilesInRect.call(void 0, dst)) {
|
|
3709
|
+
const t = intersect({ x: tx * _chunk7ISPWEJAcjs.TILE, y: ty * _chunk7ISPWEJAcjs.TILE, width: _chunk7ISPWEJAcjs.TILE, height: _chunk7ISPWEJAcjs.TILE }, dst);
|
|
3901
3710
|
if (!t) continue;
|
|
3902
3711
|
const tc = [
|
|
3903
3712
|
{ x: t.x, y: t.y },
|
|
@@ -3942,12 +3751,13 @@ function transformSurface(src, h, options = {}) {
|
|
|
3942
3751
|
if (!foot) continue;
|
|
3943
3752
|
const readable = intersect(foot, sr);
|
|
3944
3753
|
if (!readable || !hasTilesIn(S, readable)) continue;
|
|
3945
|
-
const win = readWindow(S, sr, foot);
|
|
3946
|
-
const out = new Uint8ClampedArray(
|
|
3754
|
+
const win = readWindow(S, sr, foot, depth);
|
|
3755
|
+
const out = new Uint8ClampedArray(_chunk7ISPWEJAcjs.TILE * _chunk7ISPWEJAcjs.TILE * ch);
|
|
3947
3756
|
if (def) out.fill(def);
|
|
3757
|
+
const deepOut = depth ? new Float32Array(_chunk7ISPWEJAcjs.TILE * _chunk7ISPWEJAcjs.TILE * 4) : null;
|
|
3948
3758
|
let any = false;
|
|
3949
|
-
const ox = tx *
|
|
3950
|
-
const oy = ty *
|
|
3759
|
+
const ox = tx * _chunk7ISPWEJAcjs.TILE;
|
|
3760
|
+
const oy = ty * _chunk7ISPWEJAcjs.TILE;
|
|
3951
3761
|
let su = widen(su0);
|
|
3952
3762
|
let sv = widen(sv0);
|
|
3953
3763
|
const ystart = t.y - ((t.y - oy) % step + step) % step;
|
|
@@ -3973,6 +3783,10 @@ function transformSurface(src, h, options = {}) {
|
|
|
3973
3783
|
sv = widen(s[1]);
|
|
3974
3784
|
}
|
|
3975
3785
|
sample(win, interp, u, v, su, sv, acc);
|
|
3786
|
+
if (deepOut) {
|
|
3787
|
+
if (storeScaled(deepOut, ((y - oy) * _chunk7ISPWEJAcjs.TILE + (x - ox)) * 4, acc)) any = true;
|
|
3788
|
+
continue;
|
|
3789
|
+
}
|
|
3976
3790
|
if (!store(scratch, 0, acc, ch, def)) continue;
|
|
3977
3791
|
rowSet[bi] = 1;
|
|
3978
3792
|
rowVals[bi] = ch === 4 ? scratchWord[0] : scratch[0];
|
|
@@ -3983,7 +3797,7 @@ function transformSurface(src, h, options = {}) {
|
|
|
3983
3797
|
const y0 = Math.max(y, t.y);
|
|
3984
3798
|
const y1 = Math.min(y + step, t.y + t.height);
|
|
3985
3799
|
for (let yy = y0; yy < y1; yy++) {
|
|
3986
|
-
const row = (yy - oy) *
|
|
3800
|
+
const row = (yy - oy) * _chunk7ISPWEJAcjs.TILE - ox;
|
|
3987
3801
|
for (let bi = 0, x = xstart; bi < blocks; bi++, x += step) {
|
|
3988
3802
|
if (!rowSet[bi]) continue;
|
|
3989
3803
|
const x0 = Math.max(x, t.x);
|
|
@@ -3995,8 +3809,8 @@ function transformSurface(src, h, options = {}) {
|
|
|
3995
3809
|
}
|
|
3996
3810
|
}
|
|
3997
3811
|
if (!any) continue;
|
|
3998
|
-
const tile =
|
|
3999
|
-
if (tile) tiles.set(
|
|
3812
|
+
const tile = deepOut ? _chunk7ISPWEJAcjs.deepTile.call(void 0, fromScaled(deepOut, depth), 4, def) : _chunk7ISPWEJAcjs.finishTile.call(void 0, out, ch, def);
|
|
3813
|
+
if (tile) tiles.set(_chunk7ISPWEJAcjs.tileKey.call(void 0, tx, ty), tile);
|
|
4000
3814
|
}
|
|
4001
3815
|
return assemble(src, tiles);
|
|
4002
3816
|
}
|
|
@@ -4007,10 +3821,11 @@ function warpSurface(src, f, options = {}) {
|
|
|
4007
3821
|
const interp = _nullishCoalesce(options.interpolation, () => ( "bicubic"));
|
|
4008
3822
|
const ch = src.channels;
|
|
4009
3823
|
const def = src.defaultValue;
|
|
4010
|
-
const empty =
|
|
4011
|
-
const sr = options.source ? intersect(options.source, options.source) :
|
|
3824
|
+
const empty = _chunk7ISPWEJAcjs.emptySurface.call(void 0, ch, def);
|
|
3825
|
+
const sr = options.source ? intersect(options.source, options.source) : _chunk7ISPWEJAcjs.contentBounds.call(void 0, src);
|
|
4012
3826
|
if (!sr) return empty;
|
|
4013
3827
|
const step = normalizeStep(options.step);
|
|
3828
|
+
const depth = resampleDepth(src, step);
|
|
4014
3829
|
const nx = Math.min(MAX_CELLS, Math.max(1, Math.ceil(sr.width / CELL)));
|
|
4015
3830
|
const ny = Math.min(MAX_CELLS, Math.max(1, Math.ceil(sr.height / CELL)));
|
|
4016
3831
|
const w1 = nx + 1;
|
|
@@ -4059,10 +3874,10 @@ function warpSurface(src, f, options = {}) {
|
|
|
4059
3874
|
tris[t++] = a + w1;
|
|
4060
3875
|
}
|
|
4061
3876
|
}
|
|
4062
|
-
const tx0 = Math.floor(dst.x /
|
|
4063
|
-
const ty0 = Math.floor(dst.y /
|
|
4064
|
-
const cols = Math.floor((dst.x + dst.width - 1) /
|
|
4065
|
-
const rows = Math.floor((dst.y + dst.height - 1) /
|
|
3877
|
+
const tx0 = Math.floor(dst.x / _chunk7ISPWEJAcjs.TILE);
|
|
3878
|
+
const ty0 = Math.floor(dst.y / _chunk7ISPWEJAcjs.TILE);
|
|
3879
|
+
const cols = Math.floor((dst.x + dst.width - 1) / _chunk7ISPWEJAcjs.TILE) - tx0 + 1;
|
|
3880
|
+
const rows = Math.floor((dst.y + dst.height - 1) / _chunk7ISPWEJAcjs.TILE) - ty0 + 1;
|
|
4066
3881
|
const bins = Array.from({ length: cols * rows }, () => []);
|
|
4067
3882
|
for (let k = 0; k < triCount; k++) {
|
|
4068
3883
|
const a = tris[3 * k];
|
|
@@ -4072,10 +3887,10 @@ function warpSurface(src, f, options = {}) {
|
|
|
4072
3887
|
const tminy = Math.floor(Math.min(dvy[a], dvy[b], dvy[c]));
|
|
4073
3888
|
const tmaxx = Math.ceil(Math.max(dvx[a], dvx[b], dvx[c]));
|
|
4074
3889
|
const tmaxy = Math.ceil(Math.max(dvy[a], dvy[b], dvy[c]));
|
|
4075
|
-
const cx0 = Math.max(0, Math.floor(Math.max(tminx, dst.x) /
|
|
4076
|
-
const cy0 = Math.max(0, Math.floor(Math.max(tminy, dst.y) /
|
|
4077
|
-
const cx1 = Math.min(cols - 1, Math.floor(Math.min(tmaxx, dst.x + dst.width - 1) /
|
|
4078
|
-
const cy1 = Math.min(rows - 1, Math.floor(Math.min(tmaxy, dst.y + dst.height - 1) /
|
|
3890
|
+
const cx0 = Math.max(0, Math.floor(Math.max(tminx, dst.x) / _chunk7ISPWEJAcjs.TILE) - tx0);
|
|
3891
|
+
const cy0 = Math.max(0, Math.floor(Math.max(tminy, dst.y) / _chunk7ISPWEJAcjs.TILE) - ty0);
|
|
3892
|
+
const cx1 = Math.min(cols - 1, Math.floor(Math.min(tmaxx, dst.x + dst.width - 1) / _chunk7ISPWEJAcjs.TILE) - tx0);
|
|
3893
|
+
const cy1 = Math.min(rows - 1, Math.floor(Math.min(tmaxy, dst.y + dst.height - 1) / _chunk7ISPWEJAcjs.TILE) - ty0);
|
|
4079
3894
|
for (let cy = cy0; cy <= cy1; cy++) for (let cx = cx0; cx <= cx1; cx++) bins[cy * cols + cx].push(k);
|
|
4080
3895
|
}
|
|
4081
3896
|
const tiles = /* @__PURE__ */ new Map();
|
|
@@ -4089,7 +3904,7 @@ function warpSurface(src, f, options = {}) {
|
|
|
4089
3904
|
if (!list.length) continue;
|
|
4090
3905
|
const ttx = tx0 + cx;
|
|
4091
3906
|
const tty = ty0 + cy;
|
|
4092
|
-
const t = intersect({ x: ttx *
|
|
3907
|
+
const t = intersect({ x: ttx * _chunk7ISPWEJAcjs.TILE, y: tty * _chunk7ISPWEJAcjs.TILE, width: _chunk7ISPWEJAcjs.TILE, height: _chunk7ISPWEJAcjs.TILE }, dst);
|
|
4093
3908
|
if (!t) continue;
|
|
4094
3909
|
const tw = t.width;
|
|
4095
3910
|
const th = t.height;
|
|
@@ -4178,12 +3993,13 @@ function warpSurface(src, f, options = {}) {
|
|
|
4178
3993
|
if (fx0 > fx1) continue;
|
|
4179
3994
|
const foot = intersect({ x: Math.floor(fx0) - 3, y: Math.floor(fy0) - 3, width: Math.ceil(fx1) - Math.floor(fx0) + 6, height: Math.ceil(fy1) - Math.floor(fy0) + 6 }, sr);
|
|
4180
3995
|
if (!foot || !hasTilesIn(src, foot)) continue;
|
|
4181
|
-
const win = readWindow(src, sr, foot);
|
|
4182
|
-
const out = new Uint8ClampedArray(
|
|
3996
|
+
const win = readWindow(src, sr, foot, depth);
|
|
3997
|
+
const out = new Uint8ClampedArray(_chunk7ISPWEJAcjs.TILE * _chunk7ISPWEJAcjs.TILE * ch);
|
|
4183
3998
|
if (def) out.fill(def);
|
|
3999
|
+
const deepOut = depth ? new Float32Array(_chunk7ISPWEJAcjs.TILE * _chunk7ISPWEJAcjs.TILE * 4) : null;
|
|
4184
4000
|
let any = false;
|
|
4185
|
-
const ox = ttx *
|
|
4186
|
-
const oy = tty *
|
|
4001
|
+
const ox = ttx * _chunk7ISPWEJAcjs.TILE;
|
|
4002
|
+
const oy = tty * _chunk7ISPWEJAcjs.TILE;
|
|
4187
4003
|
const pointAt = (o, into) => {
|
|
4188
4004
|
const li = owner[o];
|
|
4189
4005
|
const cnx = ssx[li];
|
|
@@ -4214,7 +4030,8 @@ function warpSurface(src, f, options = {}) {
|
|
|
4214
4030
|
pointAt(o, acc);
|
|
4215
4031
|
const x = t.x + o % tw;
|
|
4216
4032
|
const y = t.y + Math.floor(o / tw);
|
|
4217
|
-
|
|
4033
|
+
const o4 = ((y - oy) * _chunk7ISPWEJAcjs.TILE + (x - ox)) * ch;
|
|
4034
|
+
if (deepOut ? storeScaled(deepOut, o4, acc) : store(out, o4, acc, ch, def)) any = true;
|
|
4218
4035
|
}
|
|
4219
4036
|
} else {
|
|
4220
4037
|
for (let by = 0; by < th; by += step) {
|
|
@@ -4222,19 +4039,19 @@ function warpSurface(src, f, options = {}) {
|
|
|
4222
4039
|
const o = by * tw + bx;
|
|
4223
4040
|
if (Number.isNaN(us[o])) continue;
|
|
4224
4041
|
pointAt(o, acc);
|
|
4225
|
-
const first = ((t.y + by - oy) *
|
|
4042
|
+
const first = ((t.y + by - oy) * _chunk7ISPWEJAcjs.TILE + (t.x + bx - ox)) * ch;
|
|
4226
4043
|
if (!store(out, first, acc, ch, def)) continue;
|
|
4227
4044
|
any = true;
|
|
4228
4045
|
for (let yy = by; yy < Math.min(th, by + step); yy++) {
|
|
4229
|
-
const row = ((t.y + yy - oy) *
|
|
4046
|
+
const row = ((t.y + yy - oy) * _chunk7ISPWEJAcjs.TILE + (t.x - ox)) * ch;
|
|
4230
4047
|
for (let xx = bx; xx < Math.min(tw, bx + step); xx++) for (let c = 0; c < ch; c++) out[row + xx * ch + c] = out[first + c];
|
|
4231
4048
|
}
|
|
4232
4049
|
}
|
|
4233
4050
|
}
|
|
4234
4051
|
}
|
|
4235
4052
|
if (!any) continue;
|
|
4236
|
-
const tile =
|
|
4237
|
-
if (tile) tiles.set(
|
|
4053
|
+
const tile = deepOut ? _chunk7ISPWEJAcjs.deepTile.call(void 0, fromScaled(deepOut, depth), 4, def) : _chunk7ISPWEJAcjs.finishTile.call(void 0, out, ch, def);
|
|
4054
|
+
if (tile) tiles.set(_chunk7ISPWEJAcjs.tileKey.call(void 0, ttx, tty), tile);
|
|
4238
4055
|
}
|
|
4239
4056
|
}
|
|
4240
4057
|
return assemble(src, tiles);
|
|
@@ -4244,13 +4061,35 @@ function compositeSurfaceOver(base, top) {
|
|
|
4244
4061
|
if (!top.tiles.size) return base;
|
|
4245
4062
|
const ch = base.channels;
|
|
4246
4063
|
const tiles = new Map(base.tiles);
|
|
4064
|
+
const bd = ch === 4 && base.defaultValue === 0 ? Math.max(_chunk7ISPWEJAcjs.surfaceDepth.call(void 0, base), _chunk7ISPWEJAcjs.surfaceDepth.call(void 0, top)) : 8;
|
|
4065
|
+
const depth = bd === 8 ? null : bd;
|
|
4247
4066
|
for (const [key, t] of top.tiles) {
|
|
4248
4067
|
const under = base.tiles.get(key);
|
|
4249
4068
|
if (!under && ch === 4) {
|
|
4250
4069
|
tiles.set(key, t);
|
|
4251
4070
|
continue;
|
|
4252
4071
|
}
|
|
4253
|
-
|
|
4072
|
+
if (depth) {
|
|
4073
|
+
const k = depth === 16 ? 65535 : 1;
|
|
4074
|
+
const d2 = _chunk7ISPWEJAcjs.tileSamples.call(void 0, under, 4, depth, 0).slice();
|
|
4075
|
+
const sd = _chunk7ISPWEJAcjs.tileSamples.call(void 0, t, 4, depth, 0);
|
|
4076
|
+
for (let i = 0; i < d2.length; i += 4) {
|
|
4077
|
+
const ta = Math.min(1, sd[i + 3] / k);
|
|
4078
|
+
if (ta <= 0) continue;
|
|
4079
|
+
const da = d2[i + 3] / k;
|
|
4080
|
+
const oa = ta + da * (1 - ta);
|
|
4081
|
+
for (let c = 0; c < 3; c++) {
|
|
4082
|
+
const v = (sd[i + c] * ta + d2[i + c] * da * (1 - ta)) / oa;
|
|
4083
|
+
d2[i + c] = depth === 16 ? Math.round(v) : v;
|
|
4084
|
+
}
|
|
4085
|
+
d2[i + 3] = depth === 16 ? Math.round(oa * k) : oa;
|
|
4086
|
+
}
|
|
4087
|
+
const tile2 = _chunk7ISPWEJAcjs.deepTile.call(void 0, d2, 4, 0);
|
|
4088
|
+
if (tile2) tiles.set(key, tile2);
|
|
4089
|
+
else tiles.delete(key);
|
|
4090
|
+
continue;
|
|
4091
|
+
}
|
|
4092
|
+
const d = new Uint8ClampedArray(_chunk7ISPWEJAcjs.TILE * _chunk7ISPWEJAcjs.TILE * ch);
|
|
4254
4093
|
if (under) d.set(under.data);
|
|
4255
4094
|
else if (base.defaultValue) d.fill(base.defaultValue);
|
|
4256
4095
|
const s = t.data;
|
|
@@ -4276,11 +4115,11 @@ function compositeSurfaceOver(base, top) {
|
|
|
4276
4115
|
if (ta > 0) d[p] = s[i] * ta + d[p] * (1 - ta);
|
|
4277
4116
|
}
|
|
4278
4117
|
}
|
|
4279
|
-
const tile =
|
|
4118
|
+
const tile = _chunk7ISPWEJAcjs.finishTile.call(void 0, d, ch, base.defaultValue);
|
|
4280
4119
|
if (tile) tiles.set(key, tile);
|
|
4281
4120
|
else tiles.delete(key);
|
|
4282
4121
|
}
|
|
4283
|
-
return new (0,
|
|
4122
|
+
return new (0, _chunk7ISPWEJAcjs.TiledSurface)(ch, tiles, base.defaultValue);
|
|
4284
4123
|
}
|
|
4285
4124
|
|
|
4286
4125
|
|
|
@@ -4346,27 +4185,5 @@ function compositeSurfaceOver(base, top) {
|
|
|
4346
4185
|
|
|
4347
4186
|
|
|
4348
4187
|
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
|
|
4362
|
-
|
|
4363
|
-
|
|
4364
|
-
|
|
4365
|
-
|
|
4366
|
-
|
|
4367
|
-
|
|
4368
|
-
|
|
4369
|
-
|
|
4370
|
-
|
|
4371
|
-
exports.BIT_DEPTHS = BIT_DEPTHS; exports.isBitDepth = isBitDepth; exports.srgbDecode = srgbDecode; exports.srgbEncode = srgbEncode; exports.to16From8 = to16From8; exports.to32From8 = to32From8; exports.to32From16 = to32From16; exports.to16From32 = to16From32; exports.to8From16 = to8From16; exports.to8From32 = to8From32; exports.proxyOf = proxyOf; exports.depthOf = depthOf; exports.deepTile = deepTile; exports.tileSamples16 = tileSamples16; exports.tileSamples32 = tileSamples32; exports.tileSamples = tileSamples; exports.surfaceDepth = surfaceDepth; exports.readDeepRegion = readDeepRegion; exports.writeDeepRegion = writeDeepRegion; exports.surfaceFromDeepPixels = surfaceFromDeepPixels; exports.convertSurfaceDepth = convertSurfaceDepth; exports.deepBytes = deepBytes; exports.DEFAULT_GLOBAL_LIGHT = DEFAULT_GLOBAL_LIGHT; exports.LAYER_EFFECT_KINDS = LAYER_EFFECT_KINDS; exports.layerEffectLabel = layerEffectLabel; exports.isLayerEffectKind = isLayerEffectKind; exports.defaultEffectGradient = defaultEffectGradient; exports.newEffectId = newEffectId; exports.defaultLayerEffect = defaultLayerEffect; exports.hasActiveEffects = hasActiveEffects; exports.MAX_EFFECT_REACH = MAX_EFFECT_REACH; exports.effectReach = effectReach; exports.effectsMargin = effectsMargin; exports.effectsScale = effectsScale; exports.scaleLayerEffect = scaleLayerEffect; exports.parseEffectColor = parseEffectColor; exports.effectColorHex = effectColorHex; exports.LayerEffectError = LayerEffectError; exports.validateEffectGradient = validateEffectGradient; exports.layerEffectFields = layerEffectFields; exports.validateLayerEffect = validateLayerEffect; exports.mergeLayerEffect = mergeLayerEffect; exports.validateLayerEffects = validateLayerEffects; exports.normalizeLayerEffects = normalizeLayerEffects; exports.effectsFingerprint = effectsFingerprint; exports.DeepCompositor = DeepCompositor; exports.workingToSamples = workingToSamples; exports.DIRECT_GAUSSIAN_MAX_SIGMA = DIRECT_GAUSSIAN_MAX_SIGMA; exports.gaussianBlur = gaussianBlur; exports.flattenLayers = flattenLayers; exports.findLayer = findLayer; exports.mapLayer = mapLayer; exports.insertLayer = insertLayer; exports.isLayerLocked = isLayerLocked; exports.PatternTile = PatternTile; exports.PatternPlacement = PatternPlacement; exports.builtinPatternIds = builtinPatternIds; exports.builtinPattern = builtinPattern; exports.hashNoise = hashNoise; exports.CURVE_LUT_SIZE = CURVE_LUT_SIZE; exports.curveLut = curveLut; exports.STROKE_CHAMFER_MAX = STROKE_CHAMFER_MAX; exports.contourLut = contourLut; exports.activeEffectItems = activeEffectItems; exports.effectsAreLocal = effectsAreLocal; exports.buildEffectMaps = buildEffectMaps; exports.patchEffectMaps = patchEffectMaps; exports.gradientT = gradientT; exports.effectFillColors = effectFillColors; exports.compositeLayerEffects = compositeLayerEffects; exports.renderLayerEffects = renderLayerEffects; exports.blendTile = blendTile; exports.RasterCompositor = RasterCompositor; exports.changedTiles = changedTiles; exports.INTERPOLATIONS = INTERPOLATIONS; exports.isInterpolation = isInterpolation; exports.MAX_TRANSFORM_PIXELS = MAX_TRANSFORM_PIXELS; exports.TransformTooLargeError = TransformTooLargeError; exports.keysWeight = keysWeight; exports.reduceSurface = reduceSurface; exports.transformedBounds = transformedBounds; exports.transformSurface = transformSurface; exports.warpSurface = warpSurface; exports.compositeSurfaceOver = compositeSurfaceOver;
|
|
4372
|
-
//# sourceMappingURL=chunk-PAOWHJ5O.cjs.map
|
|
4188
|
+
exports.DEFAULT_GLOBAL_LIGHT = DEFAULT_GLOBAL_LIGHT; exports.LAYER_EFFECT_KINDS = LAYER_EFFECT_KINDS; exports.layerEffectLabel = layerEffectLabel; exports.isLayerEffectKind = isLayerEffectKind; exports.defaultEffectGradient = defaultEffectGradient; exports.newEffectId = newEffectId; exports.defaultLayerEffect = defaultLayerEffect; exports.hasActiveEffects = hasActiveEffects; exports.MAX_EFFECT_REACH = MAX_EFFECT_REACH; exports.effectReach = effectReach; exports.effectsMargin = effectsMargin; exports.effectsScale = effectsScale; exports.scaleLayerEffect = scaleLayerEffect; exports.parseEffectColor = parseEffectColor; exports.effectColorHex = effectColorHex; exports.LayerEffectError = LayerEffectError; exports.validateEffectGradient = validateEffectGradient; exports.layerEffectFields = layerEffectFields; exports.validateLayerEffect = validateLayerEffect; exports.mergeLayerEffect = mergeLayerEffect; exports.validateLayerEffects = validateLayerEffects; exports.normalizeLayerEffects = normalizeLayerEffects; exports.effectsFingerprint = effectsFingerprint; exports.DeepCompositor = DeepCompositor; exports.workingToSamples = workingToSamples; exports.DIRECT_GAUSSIAN_MAX_SIGMA = DIRECT_GAUSSIAN_MAX_SIGMA; exports.gaussianBlur = gaussianBlur; exports.flattenLayers = flattenLayers; exports.findLayer = findLayer; exports.mapLayer = mapLayer; exports.insertLayer = insertLayer; exports.isLayerLocked = isLayerLocked; exports.PatternTile = PatternTile; exports.PatternPlacement = PatternPlacement; exports.builtinPatternIds = builtinPatternIds; exports.builtinPattern = builtinPattern; exports.hashNoise = hashNoise; exports.CURVE_LUT_SIZE = CURVE_LUT_SIZE; exports.curveLut = curveLut; exports.STROKE_CHAMFER_MAX = STROKE_CHAMFER_MAX; exports.contourLut = contourLut; exports.activeEffectItems = activeEffectItems; exports.effectsAreLocal = effectsAreLocal; exports.buildEffectMaps = buildEffectMaps; exports.patchEffectMaps = patchEffectMaps; exports.gradientT = gradientT; exports.effectFillColors = effectFillColors; exports.compositeLayerEffects = compositeLayerEffects; exports.renderLayerEffects = renderLayerEffects; exports.blendTile = blendTile; exports.RasterCompositor = RasterCompositor; exports.changedTiles = changedTiles; exports.INTERPOLATIONS = INTERPOLATIONS; exports.isInterpolation = isInterpolation; exports.MAX_TRANSFORM_PIXELS = MAX_TRANSFORM_PIXELS; exports.TransformTooLargeError = TransformTooLargeError; exports.keysWeight = keysWeight; exports.reduceSurface = reduceSurface; exports.transformedBounds = transformedBounds; exports.transformSurface = transformSurface; exports.warpSurface = warpSurface; exports.compositeSurfaceOver = compositeSurfaceOver;
|
|
4189
|
+
//# sourceMappingURL=chunk-EBSYZRSW.cjs.map
|