pixi-effects 0.47.3 → 0.47.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/README.md +5 -5
- package/ai/chat-template.html +3 -3
- package/dist/Composition-PMWLJQPI.cjs +16 -0
- package/dist/{Composition-IC274CKO.cjs.map → Composition-PMWLJQPI.cjs.map} +1 -1
- package/dist/Composition-ZCRJHBB5.js +7 -0
- package/dist/{Composition-6TXRN65C.js.map → Composition-ZCRJHBB5.js.map} +1 -1
- package/dist/Controller.cjs +3 -3
- package/dist/Controller.d.cts +1 -1
- package/dist/Controller.d.ts +1 -1
- package/dist/Controller.js +1 -1
- package/dist/{Movie-sV8nJr_f.d.ts → Movie--qSYKgAQ.d.ts} +2 -2
- package/dist/{Movie-BqrAWN0g.d.cts → Movie-svZQF-9Z.d.cts} +2 -2
- package/dist/{Spans-3T6ZEEN4.js → Spans-FMAVPATS.js} +7 -7
- package/dist/{Spans-3T6ZEEN4.js.map → Spans-FMAVPATS.js.map} +1 -1
- package/dist/{Spans-M5KMHT6K.cjs → Spans-KTUPDFSR.cjs} +12 -12
- package/dist/{Spans-M5KMHT6K.cjs.map → Spans-KTUPDFSR.cjs.map} +1 -1
- package/dist/{blendModes-S72MBYKY.js → blendModes-535EMYGK.js} +5 -5
- package/dist/{blendModes-S72MBYKY.js.map → blendModes-535EMYGK.js.map} +1 -1
- package/dist/{blendModes-Y56QAMC4.cjs → blendModes-V5XHC7U4.cjs} +6 -6
- package/dist/{blendModes-Y56QAMC4.cjs.map → blendModes-V5XHC7U4.cjs.map} +1 -1
- package/dist/{chunk-VTGJRKW4.cjs → chunk-2AT5WSSV.cjs} +105 -92
- package/dist/chunk-2AT5WSSV.cjs.map +1 -0
- package/dist/{chunk-HGKXEPDJ.js → chunk-4PYVHLIK.js} +31 -9
- package/dist/chunk-4PYVHLIK.js.map +1 -0
- package/dist/{chunk-JVO2W77G.js → chunk-BFRWSV3R.js} +3 -3
- package/dist/{chunk-JVO2W77G.js.map → chunk-BFRWSV3R.js.map} +1 -1
- package/dist/{chunk-TWZNOUM7.cjs → chunk-DOLTCXCL.cjs} +7 -2
- package/dist/chunk-DOLTCXCL.cjs.map +1 -0
- package/dist/{chunk-33OVRSXF.cjs → chunk-ECLBZV4N.cjs} +66 -44
- package/dist/chunk-ECLBZV4N.cjs.map +1 -0
- package/dist/{chunk-PC7DFDCV.js → chunk-JBDBICS2.js} +5 -5
- package/dist/{chunk-PC7DFDCV.js.map → chunk-JBDBICS2.js.map} +1 -1
- package/dist/{chunk-6LA7W362.js → chunk-LHUIEFMH.js} +23 -10
- package/dist/chunk-LHUIEFMH.js.map +1 -0
- package/dist/{chunk-YSTOH5PC.cjs → chunk-NGJXVJB7.cjs} +6 -6
- package/dist/{chunk-YSTOH5PC.cjs.map → chunk-NGJXVJB7.cjs.map} +1 -1
- package/dist/{chunk-GDY56V74.cjs → chunk-OGLRSR6C.cjs} +96 -96
- package/dist/{chunk-GDY56V74.cjs.map → chunk-OGLRSR6C.cjs.map} +1 -1
- package/dist/{chunk-HX73PCVU.js → chunk-UI7CEUTP.js} +6 -6
- package/dist/{chunk-HX73PCVU.js.map → chunk-UI7CEUTP.js.map} +1 -1
- package/dist/{chunk-BXOCEZ4U.js → chunk-WGRWFQOB.js} +7 -2
- package/dist/chunk-WGRWFQOB.js.map +1 -0
- package/dist/{chunk-RU4N3B5B.cjs → chunk-WYR2AU4W.cjs} +7 -7
- package/dist/{chunk-RU4N3B5B.cjs.map → chunk-WYR2AU4W.cjs.map} +1 -1
- package/dist/index.cjs +37 -37
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6 -6
- package/dist/loader.css +1 -1
- package/dist/{music-JKOM5YK6.js → music-P4JRT73P.js} +3 -3
- package/dist/{music-JKOM5YK6.js.map → music-P4JRT73P.js.map} +1 -1
- package/dist/{music-6WFTPVHU.cjs → music-XQEPBIDT.cjs} +7 -7
- package/dist/{music-6WFTPVHU.cjs.map → music-XQEPBIDT.cjs.map} +1 -1
- package/dist/present.cjs +13 -13
- package/dist/present.d.cts +1 -1
- package/dist/present.d.ts +1 -1
- package/dist/present.js +6 -6
- package/dist/{sfx-2O6UQEUP.cjs → sfx-G2XAMD7K.cjs} +8 -8
- package/dist/{sfx-2O6UQEUP.cjs.map → sfx-G2XAMD7K.cjs.map} +1 -1
- package/dist/{sfx-VUKARHDX.js → sfx-Z7OQIKHG.js} +3 -3
- package/dist/{sfx-VUKARHDX.js.map → sfx-Z7OQIKHG.js.map} +1 -1
- package/dist/three.cjs +7 -7
- package/dist/three.js +3 -3
- package/docs/api.md +4 -4
- package/docs/dsl.md +11 -10
- package/llms-full.txt +19 -18
- package/package.json +1 -1
- package/skills/pixi-effects/SKILL.md +1 -1
- package/skills/pixi-effects/reference/cheatsheet.md +2 -2
- package/skills/pixi-effects/reference/pitfalls.md +1 -1
- package/skills/pixi-effects/template.html +6 -6
- package/dist/Composition-6TXRN65C.js +0 -7
- package/dist/Composition-IC274CKO.cjs +0 -16
- package/dist/chunk-33OVRSXF.cjs.map +0 -1
- package/dist/chunk-6LA7W362.js.map +0 -1
- package/dist/chunk-BXOCEZ4U.js.map +0 -1
- package/dist/chunk-HGKXEPDJ.js.map +0 -1
- package/dist/chunk-TWZNOUM7.cjs.map +0 -1
- package/dist/chunk-VTGJRKW4.cjs.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkOGLRSR6C_cjs = require('./chunk-OGLRSR6C.cjs');
|
|
4
|
+
var chunkECLBZV4N_cjs = require('./chunk-ECLBZV4N.cjs');
|
|
5
5
|
var chunkZAHCGFGC_cjs = require('./chunk-ZAHCGFGC.cjs');
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
6
|
+
var chunkWYR2AU4W_cjs = require('./chunk-WYR2AU4W.cjs');
|
|
7
|
+
var chunkNGJXVJB7_cjs = require('./chunk-NGJXVJB7.cjs');
|
|
8
|
+
var chunkDOLTCXCL_cjs = require('./chunk-DOLTCXCL.cjs');
|
|
9
9
|
var pixi_js = require('pixi.js');
|
|
10
10
|
var mediabunny = require('mediabunny');
|
|
11
11
|
|
|
@@ -250,6 +250,19 @@ async function normalizeMix(buffer, target, between) {
|
|
|
250
250
|
gainDb = next;
|
|
251
251
|
}
|
|
252
252
|
}
|
|
253
|
+
if (original && final.integratedLufs !== null && m.integratedLufs !== null) {
|
|
254
|
+
const plainDb = Math.min(target - m.integratedLufs, LOUDNESS_CEILING_DB - m.samplePeakDb);
|
|
255
|
+
if (final.integratedLufs < m.integratedLufs + plainDb - 0.1) {
|
|
256
|
+
const k = 10 ** (plainDb / 20);
|
|
257
|
+
for (let ch = 0; ch < chans.length; ch++) {
|
|
258
|
+
const o = original[ch], d = chans[ch];
|
|
259
|
+
for (let i = 0; i < d.length; i++) d[i] = o[i] * k;
|
|
260
|
+
}
|
|
261
|
+
gainDb = plainDb;
|
|
262
|
+
applied = { reductionDb: 0, at: 0 };
|
|
263
|
+
final = chunkZAHCGFGC_cjs.measureLoudness(chans, sr);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
253
266
|
let trimDb = 0;
|
|
254
267
|
if (final.truePeakDb > LOUDNESS_CEILING_DB) {
|
|
255
268
|
trimDb = final.truePeakDb - LOUDNESS_CEILING_DB + 0.01;
|
|
@@ -460,7 +473,7 @@ var DEFAULTS = { samples: 8, shutter: 0.5 };
|
|
|
460
473
|
function resolveMotionBlur(spec, where) {
|
|
461
474
|
if (spec === void 0 || spec === null || spec === false) return null;
|
|
462
475
|
const o = spec === true ? {} : typeof spec === "number" ? { samples: spec } : spec;
|
|
463
|
-
if (typeof spec === "object")
|
|
476
|
+
if (typeof spec === "object") chunkDOLTCXCL_cjs.warnUnknownOptions(`${where} motionBlur`, o, ["samples", "shutter"]);
|
|
464
477
|
const samples = o.samples ?? DEFAULTS.samples, shutter = o.shutter ?? DEFAULTS.shutter;
|
|
465
478
|
if (!(Number.isInteger(samples) && samples >= 2 && samples <= 64)) throw new Error(`pixi-effects: ${where}: motionBlur samples must be a whole number from 2 to 64, got ${samples}`);
|
|
466
479
|
if (!(Number.isFinite(shutter) && shutter > 0 && shutter <= 1)) throw new Error(`pixi-effects: ${where}: motionBlur shutter must be a fraction of the frame time above 0 and up to 1 (0.5 is a 180\xB0 shutter), got ${shutter}`);
|
|
@@ -665,8 +678,8 @@ async function exportFrames(movie, options = {}) {
|
|
|
665
678
|
const range2 = resolveRange(options.range, { frameRate: movie.frameRate, totalFrames: movie.totalFrames, duration: movie.duration, rows: typeof options.range === "string" ? movie.timelineData().rows : void 0 });
|
|
666
679
|
if (isAudioFormat(fmt)) return exportAudioOnly(movie, options, fmt, range2);
|
|
667
680
|
if (!["mp4", "mov", "webm", "mkv"].includes(fmt)) throw new Error(`pixi-effects: render({ format: "${String(fmt)}" }): use mp4, mov, webm, mkv (a picture) or wav, ogg (only the sound)`);
|
|
668
|
-
|
|
669
|
-
|
|
681
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("movie.render({ video })", options.video, ["codec", "bitrate", "hardware", "keyFrameInterval"]);
|
|
682
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("movie.render({ audio })", options.audio, ["codec", "bitrate"]);
|
|
670
683
|
const videoBitrate = bitrateOf(eff.bitrate ?? "high", mediabunny.QUALITY_HIGH);
|
|
671
684
|
const opts = {
|
|
672
685
|
format: fmt,
|
|
@@ -1198,7 +1211,7 @@ var LumaWipeFilter = class extends pixi_js.Filter {
|
|
|
1198
1211
|
this._resolved = true;
|
|
1199
1212
|
} else if (!this._warned) {
|
|
1200
1213
|
this._warned = true;
|
|
1201
|
-
const guess =
|
|
1214
|
+
const guess = chunkDOLTCXCL_cjs.suggestName(this._mapName, LUMA_MAPS);
|
|
1202
1215
|
console.warn(`pixi-effects: luma transition map "${this._mapName}" is not a built-in map (${LUMA_MAPS.join(", ")}) and no image asset has that name${guess ? `; did you mean "${guess}"?` : ""}; the wipe follows a white map (everything changes at once)`);
|
|
1203
1216
|
}
|
|
1204
1217
|
}
|
|
@@ -1245,8 +1258,8 @@ function expandTransitions(spec) {
|
|
|
1245
1258
|
}
|
|
1246
1259
|
const transitions = out.transitions;
|
|
1247
1260
|
const sequences = out.sequences ?? [];
|
|
1248
|
-
const remap = out.duration !== void 0 ?
|
|
1249
|
-
const parentDuration = remap ?
|
|
1261
|
+
const remap = out.duration !== void 0 ? chunkECLBZV4N_cjs.timeRemapOf(out) : null;
|
|
1262
|
+
const parentDuration = remap ? chunkECLBZV4N_cjs.contentLength(remap, out.duration) : out.duration ?? Infinity;
|
|
1250
1263
|
const compW = out.width;
|
|
1251
1264
|
const compH = out.height;
|
|
1252
1265
|
const threeDByName = new Set(sequences.filter((s) => s.name && s.threeD).map((s) => s.name));
|
|
@@ -1314,16 +1327,16 @@ function expandTransitions(spec) {
|
|
|
1314
1327
|
if (toUses > 1) {
|
|
1315
1328
|
throw new Error(`pixi-effects: ${tag} sequence "${t.to}" is used as \`to\` in more than one transition`);
|
|
1316
1329
|
}
|
|
1317
|
-
const tStart =
|
|
1330
|
+
const tStart = chunkECLBZV4N_cjs.resolveAt(t.at, parentDuration);
|
|
1318
1331
|
const tEnd = tStart + t.duration;
|
|
1319
1332
|
const fromSeq = fromEntry.seq;
|
|
1320
|
-
const fromStart =
|
|
1333
|
+
const fromStart = chunkECLBZV4N_cjs.resolveAt(fromSeq.at, parentDuration);
|
|
1321
1334
|
const fromEnd = fromStart + (fromSeq.duration ?? parentDuration);
|
|
1322
1335
|
if (tStart < fromStart - EPS || tEnd > fromEnd + EPS) {
|
|
1323
1336
|
throw new Error(`pixi-effects: ${tag} window [${tStart}, ${tEnd}] is not covered by \`from\` "${t.from}" (lives [${fromStart}, ${fromEnd}], so it ends at ${fromEnd})`);
|
|
1324
1337
|
}
|
|
1325
1338
|
const toSeq = toEntry.seq;
|
|
1326
|
-
const toStart =
|
|
1339
|
+
const toStart = chunkECLBZV4N_cjs.resolveAt(toSeq.at, parentDuration);
|
|
1327
1340
|
const toEnd = toStart + (toSeq.duration ?? parentDuration);
|
|
1328
1341
|
if (tStart < toStart - EPS || tEnd > toEnd + EPS) {
|
|
1329
1342
|
throw new Error(`pixi-effects: ${tag} window [${tStart}, ${tEnd}] is not covered by \`to\` "${t.to}" (lives [${toStart}, ${toEnd}], so it starts at ${toStart})`);
|
|
@@ -1383,7 +1396,7 @@ function wrapAsFullComposition(seq, compW, compH) {
|
|
|
1383
1396
|
delete inner.at;
|
|
1384
1397
|
delete inner.duration;
|
|
1385
1398
|
const m = inner.mask;
|
|
1386
|
-
const carriesMatte = m !== void 0 &&
|
|
1399
|
+
const carriesMatte = m !== void 0 && chunkOGLRSR6C_cjs.maskSourceOf(m).kind === "refs";
|
|
1387
1400
|
if (carriesMatte) delete inner.mask;
|
|
1388
1401
|
return {
|
|
1389
1402
|
...carriesMatte ? { mask: m } : {},
|
|
@@ -1648,12 +1661,12 @@ function canvasReport(root) {
|
|
|
1648
1661
|
const length = seq.duration ?? 0;
|
|
1649
1662
|
const moments = [0.15, 0.4, 0.65, 0.9].map((f) => Math.round(f * length * 1e3) / 1e3);
|
|
1650
1663
|
const { differs, drawMs, threw } = seq.checkDeterminism(moments);
|
|
1651
|
-
const name =
|
|
1664
|
+
const name = chunkNGJXVJB7_cjs.describeLayer(seq.spec);
|
|
1652
1665
|
const kind = seq.spec.type === "three" ? "three" : "canvas";
|
|
1653
1666
|
const problem = threw.length ? `${name} could not draw at ${threw.map((t) => `${t} s`).join(", ")} (its ${kind === "three" ? "update or render threw" : "draw threw"}, or the layer failed to build): ${kind === "three" ? "the warning above says why" : "it shows a magenta checkerboard there; the warning above says why"}, so the layer cannot be called deterministic` : differs.length ? `${name} does not draw the same picture for the same time (checked at ${differs.map(describeDiff).join(", ")}; drawn in two orders after one draw that was thrown away): ` + (kind === "three" ? "usually its update uses Math.random, Date.now, a clock, or state that builds up from call to call: a mixer advanced with mixer.update(dt) is one (pose a clip with mixer.setTime(t), or threeGltf(url).pose(t)), and so is a value moved by the time since the last call. A skinned model of your own (not loaded by threeGltf) that moves and casts a shadow does it too: three culls a skinned mesh by a bounding sphere that does not follow it, so set mesh.frustumCulled = false. Set every object from t, so playback, a seek and an export agree" : "usually its draw uses Math.random, Date.now or state that outlives the call (a value it keeps from the last call), so playback, a seek and an export would not agree: use info.random() (seeded) and derive everything from t. If it uses none of these, look at the canvases it draws from: make sprites and masks with info.canvas(w, h) (not document.createElement) and draw them into the picture before the strokes that depend on them") : "";
|
|
1654
1667
|
out.push({ name: seq.spec.name ?? name, moments, drawMs, ok: !differs.length && !threw.length, problem, kind });
|
|
1655
1668
|
}
|
|
1656
|
-
if (seq instanceof
|
|
1669
|
+
if (seq instanceof chunkOGLRSR6C_cjs.CompositionSequence) walk3(seq);
|
|
1657
1670
|
};
|
|
1658
1671
|
const walk3 = (comp) => {
|
|
1659
1672
|
for (const { seq } of comp.layers()) {
|
|
@@ -1705,8 +1718,8 @@ function motionOf(keyframes, local, lives, keys = (k) => GEOMETRY.has(k)) {
|
|
|
1705
1718
|
let length = 0;
|
|
1706
1719
|
if (typeof kf.duration === "number") length = kf.duration;
|
|
1707
1720
|
else if (kf.duration === "auto") {
|
|
1708
|
-
const sp =
|
|
1709
|
-
length = sp ? Math.round(
|
|
1721
|
+
const sp = chunkECLBZV4N_cjs.parseSpring(kf.ease);
|
|
1722
|
+
length = sp ? Math.round(chunkECLBZV4N_cjs.springDuration(sp) * 1e3) / 1e3 : 0.5;
|
|
1710
1723
|
}
|
|
1711
1724
|
if (!(length > 0)) continue;
|
|
1712
1725
|
const kat = kf.at ?? 0;
|
|
@@ -1786,7 +1799,7 @@ function inspectScene(root, frame, time, canvas, opts = {}) {
|
|
|
1786
1799
|
if (motion.ever) hasMotion.add(info);
|
|
1787
1800
|
let shown = bounds ? clip(bounds, view) : null;
|
|
1788
1801
|
const maskTarget = seq.maskSequence?.target;
|
|
1789
|
-
const maskSrc =
|
|
1802
|
+
const maskSrc = chunkOGLRSR6C_cjs.maskSourceOf(seq.spec.mask);
|
|
1790
1803
|
if (shown && maskTarget && !(maskSrc.kind === "inline" && maskSrc.invert)) {
|
|
1791
1804
|
const m = maskTarget.getBounds();
|
|
1792
1805
|
shown = clip(shown, { x: m.x, y: m.y, width: m.width, height: m.height });
|
|
@@ -1795,7 +1808,7 @@ function inspectScene(root, frame, time, canvas, opts = {}) {
|
|
|
1795
1808
|
const group = parentScene ?? (name !== void 0 && blending.has(name) ? name : void 0);
|
|
1796
1809
|
if (group) scene.set(info, group);
|
|
1797
1810
|
if (zero || seq.showsNothingYet) scaledToNothing.add(info);
|
|
1798
|
-
if (seq instanceof
|
|
1811
|
+
if (seq instanceof chunkOGLRSR6C_cjs.CompositionSequence) walk3(seq, prefix + label + "/", insideThreeD || threeD, visible, group, motion, zero, parentAlpha * alpha);
|
|
1799
1812
|
});
|
|
1800
1813
|
};
|
|
1801
1814
|
walk3(root, "", false, true);
|
|
@@ -1967,12 +1980,12 @@ function pickScene(root, x, y, opts = {}, deps = {}) {
|
|
|
1967
1980
|
const alive = (threeD ? d.visible : (t?.renderable ?? true) && t?.visible !== false) && carriers.every((c) => c.target?.renderable ?? true);
|
|
1968
1981
|
const visible = parentVisible && alive && alpha > 0;
|
|
1969
1982
|
if (!visible) {
|
|
1970
|
-
if (seq instanceof
|
|
1983
|
+
if (seq instanceof chunkOGLRSR6C_cjs.CompositionSequence && !threeD && parentVisible && alpha > 0 && t?.visible === false && (t?.renderable ?? true) && carriers.every((c) => c.target?.renderable ?? true)) hiddenSources.set(seq, path);
|
|
1971
1984
|
return;
|
|
1972
1985
|
}
|
|
1973
|
-
const isComposition = seq instanceof
|
|
1986
|
+
const isComposition = seq instanceof chunkOGLRSR6C_cjs.CompositionSequence;
|
|
1974
1987
|
if (isComposition && !threeD) {
|
|
1975
|
-
const gm = seq.maskSequence?.target, gs =
|
|
1988
|
+
const gm = seq.maskSequence?.target, gs = chunkOGLRSR6C_cjs.maskSourceOf(seq.spec.mask);
|
|
1976
1989
|
if (gm && gs.kind === "inline" && !gs.invert && !inMask(gm, at)) return;
|
|
1977
1990
|
walk3(seq, path + "/", visible, at, orderBase, via);
|
|
1978
1991
|
return;
|
|
@@ -2028,7 +2041,7 @@ function pickScene(root, x, y, opts = {}, deps = {}) {
|
|
|
2028
2041
|
}
|
|
2029
2042
|
if (!hit) return;
|
|
2030
2043
|
const maskTarget = seq.maskSequence?.target;
|
|
2031
|
-
const maskSrc =
|
|
2044
|
+
const maskSrc = chunkOGLRSR6C_cjs.maskSourceOf(seq.spec.mask);
|
|
2032
2045
|
if (maskTarget && !(maskSrc.kind === "inline" && maskSrc.invert) && !(maskSrc.kind === "inline" ? inMask(maskTarget, point) : inside(maskTarget.getBounds(), point))) return;
|
|
2033
2046
|
found.push({ hit: via ? { ...hit, point: { x, y }, via } : hit, order: orderBase ? [...orderBase, ...orderOf(d)] : orderOf(d) });
|
|
2034
2047
|
});
|
|
@@ -2038,7 +2051,7 @@ function pickScene(root, x, y, opts = {}, deps = {}) {
|
|
|
2038
2051
|
const path = hiddenSources.get(f.source);
|
|
2039
2052
|
if (path === void 0) continue;
|
|
2040
2053
|
const g = f.source.target.toGlobal({ x: f.at.x * f.source.intrinsicWidth, y: f.at.y * f.source.intrinsicHeight });
|
|
2041
|
-
const sm = f.source.maskSequence?.target, ss =
|
|
2054
|
+
const sm = f.source.maskSequence?.target, ss = chunkOGLRSR6C_cjs.maskSourceOf(f.source.spec.mask);
|
|
2042
2055
|
if (sm && ss.kind === "inline" && !ss.invert && !inMask(sm, g)) continue;
|
|
2043
2056
|
walk3(f.source, path + "/", true, g, f.order, f.via);
|
|
2044
2057
|
}
|
|
@@ -2074,7 +2087,7 @@ function walk(root, visit) {
|
|
|
2074
2087
|
visit(seq);
|
|
2075
2088
|
const mask = seq.maskSequence;
|
|
2076
2089
|
if (mask) visit(mask);
|
|
2077
|
-
if (seq instanceof
|
|
2090
|
+
if (seq instanceof chunkOGLRSR6C_cjs.CompositionSequence) walk(seq, visit);
|
|
2078
2091
|
}
|
|
2079
2092
|
}
|
|
2080
2093
|
function reusePoolOf(old) {
|
|
@@ -2175,7 +2188,7 @@ var round = (n) => Math.round(n * 1e6) / 1e6;
|
|
|
2175
2188
|
var family = (name) => name.replace(/\d+/g, "#");
|
|
2176
2189
|
function detailOf(seq) {
|
|
2177
2190
|
const s = seq.spec;
|
|
2178
|
-
const spans =
|
|
2191
|
+
const spans = chunkECLBZV4N_cjs.spansMeta.get(seq.spec)?.preview;
|
|
2179
2192
|
if (spans) return spans.length > 60 ? spans.slice(0, 57) + "\u2026" : spans;
|
|
2180
2193
|
if (typeof s.text === "string") return s.text.length > 60 ? s.text.slice(0, 57) + "\u2026" : s.text;
|
|
2181
2194
|
if (typeof s.asset === "string") return `asset \u201C${s.asset}\u201D`;
|
|
@@ -2191,10 +2204,10 @@ function walk2(comp, parentStart, parentEnd, depth, prefix, rows, transitions, l
|
|
|
2191
2204
|
const start = parentStart + (seq.at ?? 0);
|
|
2192
2205
|
const end = Math.min(parentEnd, seq.duration !== void 0 ? start + seq.duration : parentEnd);
|
|
2193
2206
|
const span = end - start;
|
|
2194
|
-
const keys = (seq.spec.keyframes ?? []).map((kf) => round(start +
|
|
2207
|
+
const keys = (seq.spec.keyframes ?? []).map((kf) => round(start + chunkECLBZV4N_cjs.resolveAt(kf.at, span))).sort((a, b) => a - b).slice(0, MAX_KEYS);
|
|
2195
2208
|
const row = { path: prefix + name, name, type: seq.spec.type, depth, start: round(start), end: round(end), keys, detail: detailOf(seq), ...local ? { local } : {} };
|
|
2196
2209
|
const inner = [];
|
|
2197
|
-
const isComp = seq instanceof
|
|
2210
|
+
const isComp = seq instanceof chunkOGLRSR6C_cjs.CompositionSequence;
|
|
2198
2211
|
if (isComp) {
|
|
2199
2212
|
const label = seq.remapLabel();
|
|
2200
2213
|
walk2(seq, label ? 0 : start, label ? seq.contentSpan : end, depth + 1, prefix + name + "/", inner, transitions, label ? `${name} ${label}` : local);
|
|
@@ -2353,7 +2366,7 @@ function sheetLayout(n, columns, cellW, srcW, srcH, labelH) {
|
|
|
2353
2366
|
}
|
|
2354
2367
|
|
|
2355
2368
|
// src/core/vars.ts
|
|
2356
|
-
var RESERVED_NAMES = ["w", "h", "W", "H", "GW", "GH", "t", "d", "T", "contain", "cover", "value", ...
|
|
2369
|
+
var RESERVED_NAMES = ["w", "h", "W", "H", "GW", "GH", "t", "d", "T", "contain", "cover", "value", ...chunkECLBZV4N_cjs.EXPRESSION_NAMES];
|
|
2357
2370
|
var NAME = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
2358
2371
|
var isPlain = (v) => !!v && typeof v === "object" && (Object.getPrototypeOf(v) === Object.prototype || Object.getPrototypeOf(v) === null);
|
|
2359
2372
|
function normalizeVars(raw, where, warn = (m) => console.warn(m)) {
|
|
@@ -2426,7 +2439,7 @@ function lintVars(spec, vars) {
|
|
|
2426
2439
|
const name = m[1];
|
|
2427
2440
|
if (seen.has(name) || Object.prototype.hasOwnProperty.call(vars, name) || RESERVED_NAMES.includes(name) || declared.length === 0) continue;
|
|
2428
2441
|
seen.add(name);
|
|
2429
|
-
const guess =
|
|
2442
|
+
const guess = chunkDOLTCXCL_cjs.suggestName(name, declared);
|
|
2430
2443
|
out.push(`pixi-effects: vars: {${name}} is not a declared variable${guess ? ` \u2014 did you mean "${guess}"?` : ` (declared: ${declared.join(", ")})`}`);
|
|
2431
2444
|
}
|
|
2432
2445
|
}
|
|
@@ -2529,7 +2542,7 @@ function normalizeStops(raw, duration, frameRate) {
|
|
|
2529
2542
|
console.warn(`pixi-effects: stops[${i}] ${JSON.stringify(r)} is not a time in seconds (or { at, page?, notes?, advance?, pdf? }); ignored`);
|
|
2530
2543
|
return;
|
|
2531
2544
|
}
|
|
2532
|
-
if (typeof r === "object")
|
|
2545
|
+
if (typeof r === "object") chunkDOLTCXCL_cjs.warnUnknownOptions(`stops[${i}]`, r, KEYS);
|
|
2533
2546
|
const at = spec.at < 0 ? duration + spec.at : spec.at;
|
|
2534
2547
|
if (at < -1e-9 || at > duration + 1e-9) {
|
|
2535
2548
|
console.warn(`pixi-effects: stops[${i}] at ${spec.at} s is outside the movie (0 to ${duration} s); ignored`);
|
|
@@ -2872,7 +2885,7 @@ var Movie = class {
|
|
|
2872
2885
|
return this._audioContext;
|
|
2873
2886
|
}
|
|
2874
2887
|
async init(options = {}) {
|
|
2875
|
-
|
|
2888
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("movie.init()", options, ["width", "height", "duration", "frameRate", "background", "canvas", "assets", "composition", "vars", "poster", "motionBlur", "loader", "loop", "loudness"]);
|
|
2876
2889
|
if (options.loudness !== void 0 && options.loudness !== false && !(typeof options.loudness === "number" && Number.isFinite(options.loudness) && options.loudness <= 0 && options.loudness >= -70)) {
|
|
2877
2890
|
throw new Error(`pixi-effects: movie.init({ loudness }) is the loudness of the whole mix in LUFS: a number from -70 to 0 (-16 is usual for web video: loudness: -16), or false for no change; got ${JSON.stringify(options.loudness)}`);
|
|
2878
2891
|
}
|
|
@@ -2897,8 +2910,8 @@ var Movie = class {
|
|
|
2897
2910
|
this.stops = normalizeStops(applyVars(options.composition, this._vars)?.stops, this.duration, this.frameRate);
|
|
2898
2911
|
this._posterFrame = poster.frame;
|
|
2899
2912
|
this.background = options.background ?? "#000000";
|
|
2900
|
-
this.timeline =
|
|
2901
|
-
|
|
2913
|
+
this.timeline = chunkECLBZV4N_cjs.createTimeline({ paused: true, defaults: { ease: "none" } });
|
|
2914
|
+
chunkECLBZV4N_cjs.lengthen(this.timeline, this.duration);
|
|
2902
2915
|
const baseAppOptions = {
|
|
2903
2916
|
width: this.width,
|
|
2904
2917
|
height: this.height,
|
|
@@ -2997,8 +3010,8 @@ var Movie = class {
|
|
|
2997
3010
|
height: sizeWins ? height : spec.height ?? height,
|
|
2998
3011
|
duration: spec.duration ?? this.duration
|
|
2999
3012
|
} : void 0;
|
|
3000
|
-
await
|
|
3001
|
-
if (
|
|
3013
|
+
await chunkECLBZV4N_cjs.ensureFilterLibrary(seededComposition);
|
|
3014
|
+
if (chunkWYR2AU4W_cjs.usesAdvancedBlend(seededComposition)) await chunkWYR2AU4W_cjs.enableAdvancedBlend(this.app.renderer);
|
|
3002
3015
|
const userComposition = seededComposition ? expandTransitions(seededComposition) : void 0;
|
|
3003
3016
|
const rootSeqSpec = {
|
|
3004
3017
|
type: "composition",
|
|
@@ -3008,7 +3021,7 @@ var Movie = class {
|
|
|
3008
3021
|
...userComposition
|
|
3009
3022
|
};
|
|
3010
3023
|
if (userComposition) carryTransitionWindows(userComposition, rootSeqSpec);
|
|
3011
|
-
const sequence = new
|
|
3024
|
+
const sequence = new chunkOGLRSR6C_cjs.CompositionSequence(rootSeqSpec, null, rootShape);
|
|
3012
3025
|
lp?.begin("build", countLayers(rootSeqSpec));
|
|
3013
3026
|
try {
|
|
3014
3027
|
await sequence.build();
|
|
@@ -3076,7 +3089,7 @@ var Movie = class {
|
|
|
3076
3089
|
*/
|
|
3077
3090
|
async rebuild(change = {}, reason = "rebuild") {
|
|
3078
3091
|
this._requireReady("rebuild");
|
|
3079
|
-
|
|
3092
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("movie.rebuild()", change, ["composition", "vars", "width", "height"]);
|
|
3080
3093
|
if (this._rebuildRun) {
|
|
3081
3094
|
if (!this._rebuildNext) {
|
|
3082
3095
|
let resolve, reject;
|
|
@@ -3126,7 +3139,7 @@ var Movie = class {
|
|
|
3126
3139
|
const given = normalizeVars(change.vars, who);
|
|
3127
3140
|
for (const [name, value] of Object.entries(given)) {
|
|
3128
3141
|
if (!this._declared.has(name)) {
|
|
3129
|
-
const guess =
|
|
3142
|
+
const guess = chunkDOLTCXCL_cjs.suggestName(name, [...this._declared]);
|
|
3130
3143
|
console.warn(`pixi-effects: ${who}: "${name}" is not a declared variable${guess ? ` \u2014 did you mean "${guess}"?` : ""} (declared in movie.init({ vars }): ${[...this._declared].join(", ") || "none"}); ignored`);
|
|
3131
3144
|
continue;
|
|
3132
3145
|
}
|
|
@@ -3147,8 +3160,8 @@ var Movie = class {
|
|
|
3147
3160
|
if (!changed) return { reason, ms: 0, audio: "none", frame: this.currentFrame, playing: this.isPlaying, unchanged: true };
|
|
3148
3161
|
sequence = await this._construct(composition, vars, width, height, void 0, this._resized || sizeChanged, reusePoolOf(this._rootSequence));
|
|
3149
3162
|
alive();
|
|
3150
|
-
const timeline =
|
|
3151
|
-
|
|
3163
|
+
const timeline = chunkECLBZV4N_cjs.createTimeline({ paused: true, defaults: { ease: "none" } });
|
|
3164
|
+
chunkECLBZV4N_cjs.lengthen(timeline, this.duration);
|
|
3152
3165
|
sequence.bindTimeline(timeline);
|
|
3153
3166
|
const hadSound = this.audioBuffer !== null;
|
|
3154
3167
|
const audio = await this._mixSound(sequence, this._ensureAudioContext());
|
|
@@ -3298,7 +3311,7 @@ var Movie = class {
|
|
|
3298
3311
|
}
|
|
3299
3312
|
}
|
|
3300
3313
|
async snapshot(frame = this.currentFrame, opts = {}) {
|
|
3301
|
-
|
|
3314
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("movie.snapshot()", opts, ["scale", "type", "quality", "as", "motionBlur"]);
|
|
3302
3315
|
this._requireReady("snapshot");
|
|
3303
3316
|
return this._captureFrame(clampFrame(frame, this.totalFrames), { scale: opts.scale ?? 1, type: opts.type ?? "image/png", quality: opts.quality, as: opts.as ?? "blob", motionBlur: opts.motionBlur });
|
|
3304
3317
|
}
|
|
@@ -3340,7 +3353,7 @@ var Movie = class {
|
|
|
3340
3353
|
* (a seek, a render, a peek), or is another thumbnail's turn. It is the picture `snapshot()` gives at that size (without motion blur).
|
|
3341
3354
|
*/
|
|
3342
3355
|
async thumbnail(frame, opts = {}) {
|
|
3343
|
-
|
|
3356
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("movie.thumbnail()", opts, ["width", "scale"]);
|
|
3344
3357
|
this._requireReady("thumbnail");
|
|
3345
3358
|
if (opts.width !== void 0 && !(opts.width > 0 && opts.width <= this.width * 4)) throw new Error(`pixi-effects: movie.thumbnail(): width must be above 0 and at most ${this.width * 4} px, got ${opts.width}`);
|
|
3346
3359
|
if (opts.scale !== void 0 && !(opts.scale > 0 && opts.scale <= 4)) throw new Error(`pixi-effects: movie.thumbnail(): scale must be above 0 and at most 4, got ${opts.scale}`);
|
|
@@ -3386,7 +3399,7 @@ var Movie = class {
|
|
|
3386
3399
|
return out;
|
|
3387
3400
|
}
|
|
3388
3401
|
async onionSkin(opts = {}) {
|
|
3389
|
-
|
|
3402
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("movie.onionSkin()", opts, ["from", "to", "count", "scale", "as", "motionBlur"]);
|
|
3390
3403
|
this._requireReady("onionSkin");
|
|
3391
3404
|
const from = opts.from ?? 0, to = opts.to ?? this.duration, count = opts.count ?? 8, scale = opts.scale ?? 1;
|
|
3392
3405
|
if (!(Number.isInteger(count) && count >= 1 && count <= 64)) throw new Error(`pixi-effects: movie.onionSkin(): count must be a whole number from 1 to 64, got ${count}`);
|
|
@@ -3417,7 +3430,7 @@ var Movie = class {
|
|
|
3417
3430
|
return encodeCanvas(out, "image/png", opts.as ?? "blob");
|
|
3418
3431
|
}
|
|
3419
3432
|
async contactSheet(opts = {}) {
|
|
3420
|
-
|
|
3433
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("movie.contactSheet()", opts, ["frames", "times", "count", "columns", "cellWidth", "as", "motionBlur"]);
|
|
3421
3434
|
this._requireReady("contactSheet");
|
|
3422
3435
|
const mb = this._blurFor(opts.motionBlur, "movie.contactSheet()");
|
|
3423
3436
|
const blurred = mb ? this._blurCanvas() : null;
|
|
@@ -3463,7 +3476,7 @@ var Movie = class {
|
|
|
3463
3476
|
}
|
|
3464
3477
|
/** Every layer under the canvas point, the one on top first (see `pick`). */
|
|
3465
3478
|
pickAll(x, y, opts = {}) {
|
|
3466
|
-
|
|
3479
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("movie.pick()", opts, ["only", "ignore", "alpha"]);
|
|
3467
3480
|
this._requireReady("pick");
|
|
3468
3481
|
if (!Number.isFinite(x) || !Number.isFinite(y)) throw new Error(`pixi-effects: movie.pick(x, y) needs two numbers (canvas pixels), got ${x}, ${y}. For a pointer event: movie.pick(...movie.canvasPoint(event))`);
|
|
3469
3482
|
const textureOf = textPictureOf;
|
|
@@ -3475,7 +3488,7 @@ var Movie = class {
|
|
|
3475
3488
|
* `{ only, ignore }` as for `pick`; `cursor: true` (or a CSS cursor) shows it while something is hovered. Returns the function that stops it. A page-side tool: an exported video has no pointer.
|
|
3476
3489
|
*/
|
|
3477
3490
|
hover(opts = {}) {
|
|
3478
|
-
|
|
3491
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("movie.hover()", opts, ["onEnter", "onLeave", "cursor", "only", "ignore"]);
|
|
3479
3492
|
this._requireReady("hover");
|
|
3480
3493
|
const canvas = this.app?.canvas;
|
|
3481
3494
|
if (!canvas) throw new Error("pixi-effects: movie.hover needs the movie's canvas");
|
|
@@ -3490,7 +3503,7 @@ var Movie = class {
|
|
|
3490
3503
|
return [(event.clientX - r.left) * this.width / (r.width || this.width), (event.clientY - r.top) * this.height / (r.height || this.height)];
|
|
3491
3504
|
}
|
|
3492
3505
|
async inspect(frame = this.currentFrame, opts = { layers: "visible" }) {
|
|
3493
|
-
|
|
3506
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("movie.inspect()", opts, ["layers"]);
|
|
3494
3507
|
this._requireReady("inspect");
|
|
3495
3508
|
const f = clampFrame(frame, this.totalFrames);
|
|
3496
3509
|
await this.gotoFrame(f, true);
|
|
@@ -3516,12 +3529,12 @@ var Movie = class {
|
|
|
3516
3529
|
}
|
|
3517
3530
|
/** The timeline as one self-contained HTML page (an inline SVG, no scripts): layers as bars on a time axis, ◆ keyframes, transition bands. Open it in a browser. */
|
|
3518
3531
|
timelineChart(opts = {}) {
|
|
3519
|
-
|
|
3532
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("movie.timelineChart()", opts, ["title"]);
|
|
3520
3533
|
return timelineHtml(this.timelineData(), opts);
|
|
3521
3534
|
}
|
|
3522
3535
|
/** Just the chart: one `<svg>` whose geometry is in `data-*` attributes (a viewer puts a playhead on it: `pixi-effects view`). */
|
|
3523
3536
|
timelineSvg(opts = {}) {
|
|
3524
|
-
|
|
3537
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("movie.timelineSvg()", opts, ["chartWidth", "labels"]);
|
|
3525
3538
|
return timelineSvg(this.timelineData(), opts);
|
|
3526
3539
|
}
|
|
3527
3540
|
/**
|
|
@@ -3538,7 +3551,7 @@ var Movie = class {
|
|
|
3538
3551
|
* scene's first and last frame and a frame every 0.25 s), fonts and the sound. See `ReviewReport`. Page warnings are in `window.__logs`. The movie is left as it was.
|
|
3539
3552
|
*/
|
|
3540
3553
|
async review(opts = {}) {
|
|
3541
|
-
|
|
3554
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("movie.review()", opts, ["at", "strict"]);
|
|
3542
3555
|
this._requireReady("review");
|
|
3543
3556
|
const back = this.currentFrame, wasAtPoster = this._atPoster;
|
|
3544
3557
|
try {
|
|
@@ -3558,7 +3571,7 @@ var Movie = class {
|
|
|
3558
3571
|
return inspectFonts(this._rootSequence);
|
|
3559
3572
|
}
|
|
3560
3573
|
inspectAudio(opts = {}) {
|
|
3561
|
-
|
|
3574
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("movie.inspectAudio()", opts, ["window", "scenes"]);
|
|
3562
3575
|
this._requireReady("inspectAudio");
|
|
3563
3576
|
const scenes = opts.scenes ?? namedScenes(this.timelineData().rows);
|
|
3564
3577
|
return chunkZAHCGFGC_cjs.analyzeAudio(this.audioBuffer, this._audioSources, this._mixStats, this.duration, { ...opts, scenes });
|
|
@@ -3854,7 +3867,7 @@ var Movie = class {
|
|
|
3854
3867
|
return this._loop;
|
|
3855
3868
|
}
|
|
3856
3869
|
async render(options) {
|
|
3857
|
-
|
|
3870
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("movie.render()", options, ["format", "video", "audio", "motionBlur", "range", "scale", "draft"]);
|
|
3858
3871
|
try {
|
|
3859
3872
|
return await this._exclusive(() => this._quietly(() => exportFrames(this, options)));
|
|
3860
3873
|
} catch (err) {
|
|
@@ -3923,7 +3936,7 @@ function countLayers(spec) {
|
|
|
3923
3936
|
n += 1 + countLayers(s);
|
|
3924
3937
|
const spans = s.spans;
|
|
3925
3938
|
if (Array.isArray(spans)) n += spans.length;
|
|
3926
|
-
const src =
|
|
3939
|
+
const src = chunkOGLRSR6C_cjs.maskSourceOf(mask);
|
|
3927
3940
|
if (src.kind === "inline") n += 1 + countLayers(src.spec);
|
|
3928
3941
|
}
|
|
3929
3942
|
return n;
|
|
@@ -3936,16 +3949,16 @@ function measureText(text, style = {}) {
|
|
|
3936
3949
|
return { width: m.width, height: m.height, lines: m.lines?.length ?? text.split("\n").length };
|
|
3937
3950
|
}
|
|
3938
3951
|
function splitText(text, style = {}, opts = {}) {
|
|
3939
|
-
|
|
3952
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("splitText()", opts, ["by", "x", "y", "align", "vertical"]);
|
|
3940
3953
|
let by = opts.by ?? "chars";
|
|
3941
3954
|
if (!BY.includes(by)) {
|
|
3942
|
-
const g =
|
|
3955
|
+
const g = chunkDOLTCXCL_cjs.suggestName(String(by), BY);
|
|
3943
3956
|
console.warn(`pixi-effects: splitText(): by "${by}" is not one of ${BY.map((b) => `"${b}"`).join(", ")}${g ? ` \u2014 did you mean "${g}"?` : ""}; using "chars"`);
|
|
3944
3957
|
by = "chars";
|
|
3945
3958
|
}
|
|
3946
3959
|
let align = opts.align ?? "left";
|
|
3947
3960
|
if (!ALIGN.includes(align)) {
|
|
3948
|
-
const g =
|
|
3961
|
+
const g = chunkDOLTCXCL_cjs.suggestName(String(align), ALIGN);
|
|
3949
3962
|
console.warn(`pixi-effects: splitText(): align "${align}" is not one of ${ALIGN.join(", ")}${g ? ` \u2014 did you mean "${g}"?` : ""}; using "left"`);
|
|
3950
3963
|
align = "left";
|
|
3951
3964
|
}
|
|
@@ -4012,14 +4025,14 @@ function splitVertical(text, style, ts, right, top, align, by) {
|
|
|
4012
4025
|
|
|
4013
4026
|
// src/presets/_ease.ts
|
|
4014
4027
|
function parseEase2(name) {
|
|
4015
|
-
|
|
4016
|
-
return
|
|
4028
|
+
chunkECLBZV4N_cjs.checkEase(name, "a preset");
|
|
4029
|
+
return chunkECLBZV4N_cjs.parseEase(name);
|
|
4017
4030
|
}
|
|
4018
4031
|
|
|
4019
4032
|
// src/presets/kenBurns.ts
|
|
4020
4033
|
var KEN_BURNS_KEYS = ["asset", "name", "at", "duration", "fit", "ease", "motion", "origin", "zoom", "direction", "angle", "from", "to"];
|
|
4021
4034
|
function kenBurns(opts) {
|
|
4022
|
-
|
|
4035
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("kenBurns()", opts, KEN_BURNS_KEYS);
|
|
4023
4036
|
const {
|
|
4024
4037
|
asset,
|
|
4025
4038
|
name,
|
|
@@ -4132,7 +4145,7 @@ function clamp(v, lo, hi) {
|
|
|
4132
4145
|
// src/presets/orbit.ts
|
|
4133
4146
|
var ORBIT_KEYS = ["duration", "degrees", "start", "radius", "center", "width", "height", "fov", "ease", "dollyZoom", "at", "name", "stepsPerSecond"];
|
|
4134
4147
|
function orbit(opts) {
|
|
4135
|
-
|
|
4148
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("orbit()", opts, ORBIT_KEYS);
|
|
4136
4149
|
const {
|
|
4137
4150
|
duration,
|
|
4138
4151
|
degrees,
|
|
@@ -4148,17 +4161,17 @@ function orbit(opts) {
|
|
|
4148
4161
|
throw new Error("pixi-effects: orbit() cannot combine `radius` with `dollyZoom` \u2014 the radius follows the animated fov");
|
|
4149
4162
|
}
|
|
4150
4163
|
const [cx, cy] = opts.center ?? [width / 2, height / 2];
|
|
4151
|
-
const fixedR = opts.radius ??
|
|
4164
|
+
const fixedR = opts.radius ?? chunkECLBZV4N_cjs.homeDistance(height, fov ?? chunkECLBZV4N_cjs.DEFAULT_FOV);
|
|
4152
4165
|
const start = opts.start ?? -degrees / 2;
|
|
4153
4166
|
const steps = Math.max(1, Math.round(duration * stepsPerSecond));
|
|
4154
4167
|
const easeFn = parseEase2(ease);
|
|
4155
4168
|
const dollyEase = dolly ? parseEase2(dolly.ease ?? ease) : null;
|
|
4156
4169
|
const pos = (i) => {
|
|
4157
4170
|
const p = i / steps;
|
|
4158
|
-
const a = (start + degrees * easeFn(p)) *
|
|
4171
|
+
const a = (start + degrees * easeFn(p)) * chunkECLBZV4N_cjs.DEG;
|
|
4159
4172
|
if (!dolly) return { x: cx + fixedR * Math.sin(a), z: fixedR * Math.cos(a) };
|
|
4160
4173
|
const f = dolly.from + (dolly.to - dolly.from) * dollyEase(p);
|
|
4161
|
-
const R =
|
|
4174
|
+
const R = chunkECLBZV4N_cjs.homeDistance(height, f);
|
|
4162
4175
|
return { x: cx + R * Math.sin(a), z: R * Math.cos(a), fov: f };
|
|
4163
4176
|
};
|
|
4164
4177
|
const keyframes = [];
|
|
@@ -4190,7 +4203,7 @@ var KEYS2 = ["count", "at", "emit", "life", "area", "angle", "speed", "gravity",
|
|
|
4190
4203
|
var SHAPES = ["circle", "rect", "star"];
|
|
4191
4204
|
var MAX_KEYFRAMES = 3e4;
|
|
4192
4205
|
function particles(opts) {
|
|
4193
|
-
|
|
4206
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("particles()", opts, KEYS2);
|
|
4194
4207
|
const { count, at = 0, emit = 0, gravity = 0, wind = 0, drag = 0, sway, fade, colors = ["#ffffff"], shape = "circle", seed = 0, name = "particle", template, sampleRate = 20 } = opts;
|
|
4195
4208
|
if (!(Number.isInteger(count) && count > 0)) throw new Error(`particles(): count must be a whole number of particles (at least 1), got ${count}`);
|
|
4196
4209
|
const life = range("life", opts.life, 1e-6);
|
|
@@ -4198,7 +4211,7 @@ function particles(opts) {
|
|
|
4198
4211
|
if (!(Number.isFinite(emit) && emit >= 0)) throw new Error(`particles(): emit must be a number of seconds >= 0, got ${emit}`);
|
|
4199
4212
|
if (!(Number.isFinite(sampleRate) && sampleRate > 0)) throw new Error(`particles(): sampleRate must be a positive number (samples per second), got ${sampleRate}`);
|
|
4200
4213
|
if (!SHAPES.includes(shape)) {
|
|
4201
|
-
const g =
|
|
4214
|
+
const g = chunkDOLTCXCL_cjs.suggestName(String(shape), SHAPES);
|
|
4202
4215
|
throw new Error(`particles(): shape "${shape}" is not one of ${SHAPES.map((s) => `"${s}"`).join(", ")}${g ? `; did you mean "${g}"?` : ""}`);
|
|
4203
4216
|
}
|
|
4204
4217
|
const angle = range("angle", opts.angle ?? [0, 360], -Infinity);
|
|
@@ -4213,7 +4226,7 @@ function particles(opts) {
|
|
|
4213
4226
|
const round2 = (v) => Math.round(v * 1e6) / 1e6;
|
|
4214
4227
|
const out = [];
|
|
4215
4228
|
for (let i = 0; i < count; i++) {
|
|
4216
|
-
const r =
|
|
4229
|
+
const r = chunkECLBZV4N_cjs.random(seed * 1000003 + i * 7919 + 17);
|
|
4217
4230
|
const pick = ([a2, b]) => a2 + r() * (b - a2);
|
|
4218
4231
|
const born = at + r() * emit;
|
|
4219
4232
|
const lifetime = pick(life);
|
|
@@ -4226,7 +4239,7 @@ function particles(opts) {
|
|
|
4226
4239
|
const turn = spin ? pick(spin) : 0;
|
|
4227
4240
|
const startAngle = spin ? r() * 360 : 0;
|
|
4228
4241
|
const swayAmp = sway?.amp ?? 0, swayFreq = sway?.freq ?? 1;
|
|
4229
|
-
const n0 = sway ?
|
|
4242
|
+
const n0 = sway ? chunkECLBZV4N_cjs.noise(0, seed * 1000003 + i) : 0;
|
|
4230
4243
|
const at_ = (t) => {
|
|
4231
4244
|
const axis = (p0, v0, acc) => {
|
|
4232
4245
|
if (drag > 0) {
|
|
@@ -4235,7 +4248,7 @@ function particles(opts) {
|
|
|
4235
4248
|
}
|
|
4236
4249
|
return p0 + v0 * t + 0.5 * acc * t * t;
|
|
4237
4250
|
};
|
|
4238
|
-
const sw = sway ? swayAmp * (
|
|
4251
|
+
const sw = sway ? swayAmp * (chunkECLBZV4N_cjs.noise(t * swayFreq, seed * 1000003 + i) - n0) : 0;
|
|
4239
4252
|
return { x: axis(x0, vx, wind) + sw, y: axis(y0, vy, gravity) };
|
|
4240
4253
|
};
|
|
4241
4254
|
const kfs = [];
|
|
@@ -4285,7 +4298,7 @@ function range(name, v, min) {
|
|
|
4285
4298
|
var KEYS3 = ["d", "at", "duration", "ease", "from", "to", "orient", "rotate", "frameRate"];
|
|
4286
4299
|
var MAX_STEPS = 2e3;
|
|
4287
4300
|
function followPath(opts) {
|
|
4288
|
-
|
|
4301
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("followPath()", opts, KEYS3);
|
|
4289
4302
|
const { d, at = 0, duration, ease = "none", from = 0, to = 1, orient = false, rotate = 0, frameRate = 30 } = opts;
|
|
4290
4303
|
if (typeof d !== "string" || d.trim() === "") throw new Error('followPath(): d must be SVG path data, e.g. "M 100 600 C 300 100 900 100 1180 600"');
|
|
4291
4304
|
if (!(Number.isFinite(duration) && duration > 0)) throw new Error(`followPath(): duration must be a positive number of seconds, got ${duration}`);
|
|
@@ -4297,7 +4310,7 @@ function followPath(opts) {
|
|
|
4297
4310
|
if (steps > MAX_STEPS) throw new Error(`followPath(): ${steps} samples is too many (max ${MAX_STEPS}); lower frameRate or duration`);
|
|
4298
4311
|
const segments = [];
|
|
4299
4312
|
let total = 0;
|
|
4300
|
-
for (const line of
|
|
4313
|
+
for (const line of chunkECLBZV4N_cjs.flattenSvgPath(d)) {
|
|
4301
4314
|
const p = line.closed ? [...line.pts, line.pts[0], line.pts[1]] : line.pts;
|
|
4302
4315
|
for (let i = 2; i < p.length; i += 2) {
|
|
4303
4316
|
const len = Math.hypot(p[i] - p[i - 2], p[i + 1] - p[i - 1]);
|
|
@@ -4350,7 +4363,7 @@ function followPath(opts) {
|
|
|
4350
4363
|
// src/core/pathSample.ts
|
|
4351
4364
|
function samplePath(d) {
|
|
4352
4365
|
if (typeof d !== "string" || d.trim() === "") throw new Error('samplePath(): d must be SVG path data, e.g. "M 40 300 C 200 20 400 20 560 300"');
|
|
4353
|
-
const lines =
|
|
4366
|
+
const lines = chunkECLBZV4N_cjs.flattenSvgPath(d);
|
|
4354
4367
|
const segments = [];
|
|
4355
4368
|
let length = 0;
|
|
4356
4369
|
for (const line of lines) {
|
|
@@ -4381,7 +4394,7 @@ function samplePath(d) {
|
|
|
4381
4394
|
return { x: g.x0 + (g.x1 - g.x0) * t, y: g.y0 + (g.y1 - g.y0) * t, angle: Math.atan2(g.y1 - g.y0, g.x1 - g.x0) };
|
|
4382
4395
|
},
|
|
4383
4396
|
trim(start = 0, end = 1) {
|
|
4384
|
-
return
|
|
4397
|
+
return chunkECLBZV4N_cjs.trimPolylines(lines, start, end).map((l) => l.closed ? [...l.pts, l.pts[0], l.pts[1]] : l.pts);
|
|
4385
4398
|
}
|
|
4386
4399
|
};
|
|
4387
4400
|
}
|
|
@@ -4391,7 +4404,7 @@ var KEYS4 = ["points", "at", "duration", "ease", "look", "lookAhead", "smooth",
|
|
|
4391
4404
|
var MAX_STEPS2 = 4e3;
|
|
4392
4405
|
var PER_SPAN = 48;
|
|
4393
4406
|
function cameraPath(opts) {
|
|
4394
|
-
|
|
4407
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("cameraPath()", opts, KEYS4);
|
|
4395
4408
|
const { points, at = 0, duration, ease = "none", look = "ahead", lookAhead = 0.08, smooth = true, from = 0, to = 1, frameRate = 30 } = opts;
|
|
4396
4409
|
if (!Array.isArray(points) || points.length < 2) throw new Error("cameraPath(): points needs at least two points: [[x, y, z], [x, y, z], \u2026]");
|
|
4397
4410
|
points.forEach((p, i) => {
|
|
@@ -4467,7 +4480,7 @@ function stagger(items, spec = {}) {
|
|
|
4467
4480
|
const isCount = typeof items === "number";
|
|
4468
4481
|
const n = isCount ? items : items.length;
|
|
4469
4482
|
if (!Number.isInteger(n) || n < 0) throw new Error(`stagger(): count must be a whole number of items, got ${n}`);
|
|
4470
|
-
|
|
4483
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("stagger()", options, STAGGER_KEYS);
|
|
4471
4484
|
const { each, amount, from = "start", grid, ease = "none", seed = 0 } = options;
|
|
4472
4485
|
if (each !== void 0 && amount !== void 0) throw new Error("stagger(): give `each` (seconds between neighbours) or `amount` (seconds in total), not both");
|
|
4473
4486
|
if (each !== void 0 && !(Number.isFinite(each) && each >= 0)) throw new Error(`stagger(): each must be a number of seconds >= 0, got ${each}`);
|
|
@@ -4492,7 +4505,7 @@ function distances(n, from, grid, seed) {
|
|
|
4492
4505
|
if (n === 0) return [];
|
|
4493
4506
|
if (from === "random") {
|
|
4494
4507
|
const order = Array.from({ length: n }, (_, i) => i);
|
|
4495
|
-
const r =
|
|
4508
|
+
const r = chunkECLBZV4N_cjs.random(seed);
|
|
4496
4509
|
for (let i = n - 1; i > 0; i--) {
|
|
4497
4510
|
const j = Math.floor(r() * (i + 1));
|
|
4498
4511
|
[order[i], order[j]] = [order[j], order[i]];
|
|
@@ -4529,7 +4542,7 @@ function distances(n, from, grid, seed) {
|
|
|
4529
4542
|
var WIGGLE_KEYS = ["at", "duration", "freq", "seed", "ease", "props"];
|
|
4530
4543
|
var MAX_STEPS3 = 2e3;
|
|
4531
4544
|
function wiggle(opts) {
|
|
4532
|
-
|
|
4545
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("wiggle()", opts, WIGGLE_KEYS);
|
|
4533
4546
|
const { at = 0, duration, freq = 3, seed = 0, ease = "sine.inOut", props } = opts;
|
|
4534
4547
|
if (!(Number.isFinite(duration) && duration > 0)) throw new Error(`wiggle(): duration must be a positive number of seconds, got ${duration}`);
|
|
4535
4548
|
if (!(Number.isFinite(freq) && freq > 0)) throw new Error(`wiggle(): freq must be a positive number (steps per second), got ${freq}`);
|
|
@@ -4554,7 +4567,7 @@ function wiggle(opts) {
|
|
|
4554
4567
|
to[n] = p.around;
|
|
4555
4568
|
return;
|
|
4556
4569
|
}
|
|
4557
|
-
const off = (
|
|
4570
|
+
const off = (chunkECLBZV4N_cjs.rand(seed * 7919 + pi * 104729 + s * 31 + 1) * 2 - 1) * p.amp;
|
|
4558
4571
|
to[n] = typeof p.around === "number" ? p.around + off : `(${p.around}) ${off < 0 ? "-" : "+"} ${Math.abs(off)}`;
|
|
4559
4572
|
});
|
|
4560
4573
|
out.push({ at: at + s * stepLen, to, duration: stepLen, ease });
|
|
@@ -4577,7 +4590,7 @@ var PRESETS = {
|
|
|
4577
4590
|
};
|
|
4578
4591
|
var PRESET_NAMES = Object.keys(PRESETS);
|
|
4579
4592
|
function animateText(text, style, options) {
|
|
4580
|
-
|
|
4593
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("animateText()", options, KEYS5);
|
|
4581
4594
|
const { by = "chars", x = 0, y = 0, align = "left", vertical = false, name = "text", at = 0, duration, idle, styleFor } = options;
|
|
4582
4595
|
for (const [n, v] of [["x", x], ["y", y]]) {
|
|
4583
4596
|
if (typeof v !== "number" || !Number.isFinite(v)) {
|
|
@@ -4673,11 +4686,11 @@ function resolveTween(spec, which) {
|
|
|
4673
4686
|
}
|
|
4674
4687
|
if (TIME_KEYS.includes(key)) {
|
|
4675
4688
|
console.warn(`pixi-effects: animateText(): ${which}.${key} ("${key}") is ignored: ${which === "out" ? "an exit starts at out.at (composition seconds); without it it leaves from the END of the layer (at + duration)" : "the entrance starts when the piece starts (the options' `at`, plus the stagger), and the layer lasts `duration`"}`);
|
|
4676
|
-
} else
|
|
4689
|
+
} else chunkDOLTCXCL_cjs.warnUnknownOptions(`animateText() ${which}`, { [key]: 1 }, TWEEN_KEYS);
|
|
4677
4690
|
}
|
|
4678
4691
|
}
|
|
4679
4692
|
if (t.preset !== void 0 && !(t.preset in PRESETS)) {
|
|
4680
|
-
const guess =
|
|
4693
|
+
const guess = chunkDOLTCXCL_cjs.suggestName(String(t.preset), PRESET_NAMES);
|
|
4681
4694
|
throw new Error(`animateText(): ${which} "${t.preset}" is not a preset${guess ? `; did you mean "${guess}"?` : ""} (presets: ${PRESET_NAMES.map((n) => `"${n}"`).join(", ")}; for no ${which === "out" ? "exit: omit `out` or write out: false (the pieces stay until the layer ends)" : "entrance: in: false"})`);
|
|
4682
4695
|
}
|
|
4683
4696
|
const base = t.preset ? PRESETS[t.preset] : void 0;
|
|
@@ -4702,7 +4715,7 @@ var KEYS6 = ["at", "duration", "props", "audioOffset", "loop", "frameRate"];
|
|
|
4702
4715
|
var PROP_KEYS = ["base", "amount", "band", "beats", "decay", "attack", "release", "invert", "curve"];
|
|
4703
4716
|
var MAX_STEPS4 = 4e3;
|
|
4704
4717
|
function react(env, options) {
|
|
4705
|
-
|
|
4718
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("react()", options, KEYS6);
|
|
4706
4719
|
const { at = 0, duration, props, audioOffset = 0, loop = false } = options;
|
|
4707
4720
|
const frameRate = options.frameRate ?? env.frameRate;
|
|
4708
4721
|
if (!(Number.isFinite(duration) && duration > 0)) throw new Error(`react(): duration must be a positive number of seconds, got ${duration}`);
|
|
@@ -4711,7 +4724,7 @@ function react(env, options) {
|
|
|
4711
4724
|
if (names.length === 0) throw new Error("react(): props is empty; name at least one property, e.g. props: { scale: { base: 1, amount: 0.3 } }");
|
|
4712
4725
|
for (const n of names) {
|
|
4713
4726
|
const p = props[n];
|
|
4714
|
-
|
|
4727
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions(`react() props.${n}`, p, PROP_KEYS);
|
|
4715
4728
|
if (!Number.isFinite(p.amount)) throw new Error(`react(): props.${n}.amount must be a number, got ${p.amount}`);
|
|
4716
4729
|
if (!p.beats && p.band !== void 0 && !env.series[p.band]) throw new Error(`react(): props.${n}: band "${p.band}" is not in this envelope (it has: ${Object.keys(env.series).join(", ")})`);
|
|
4717
4730
|
if (p.beats && !(p.decay === void 0 || Number.isFinite(p.decay) && p.decay > 0)) throw new Error(`react(): props.${n}.decay must be a positive number of seconds, got ${p.decay}`);
|
|
@@ -4818,7 +4831,7 @@ function tempo(beats) {
|
|
|
4818
4831
|
return Math.round(60 / median * 10) / 10;
|
|
4819
4832
|
}
|
|
4820
4833
|
function computeEnvelope(audio, options = {}) {
|
|
4821
|
-
|
|
4834
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("audioEnvelope()", options, OPTION_KEYS);
|
|
4822
4835
|
const frameRate = options.frameRate ?? 30;
|
|
4823
4836
|
if (!(Number.isFinite(frameRate) && frameRate > 0)) throw new Error(`pixi-effects: audioEnvelope(): frameRate must be a positive number, got ${frameRate}`);
|
|
4824
4837
|
const bands = options.bands ?? DEFAULT_BANDS;
|
|
@@ -4942,7 +4955,7 @@ async function audioEnvelope(source, options = {}) {
|
|
|
4942
4955
|
|
|
4943
4956
|
// src/audio/musicEnvelope.ts
|
|
4944
4957
|
async function musicEnvelope(music, options = {}) {
|
|
4945
|
-
const { resolveMusic, renderMusic, musicLength, musicBeatTimes, TempoMap } = await import('./music-
|
|
4958
|
+
const { resolveMusic, renderMusic, musicLength, musicBeatTimes, TempoMap } = await import('./music-XQEPBIDT.cjs');
|
|
4946
4959
|
const messages = [];
|
|
4947
4960
|
const m = resolveMusic(music, "musicEnvelope()", (msg) => messages.push(msg));
|
|
4948
4961
|
if (!m) throw new Error(`pixi-effects: musicEnvelope(): ${messages.join(" ") || "the music has nothing to play"}`);
|
|
@@ -4955,7 +4968,7 @@ async function musicEnvelope(music, options = {}) {
|
|
|
4955
4968
|
|
|
4956
4969
|
// src/audio/musicBuffer.ts
|
|
4957
4970
|
async function musicBuffer(music, options = {}) {
|
|
4958
|
-
const { resolveMusic, renderMusic, musicLength } = await import('./music-
|
|
4971
|
+
const { resolveMusic, renderMusic, musicLength } = await import('./music-XQEPBIDT.cjs');
|
|
4959
4972
|
const messages = [];
|
|
4960
4973
|
const m = resolveMusic(music, "musicBuffer()", (msg) => messages.push(msg));
|
|
4961
4974
|
if (!m) throw new Error(`pixi-effects: musicBuffer(): ${messages.join(" ") || "the music has nothing to play"}`);
|
|
@@ -4972,7 +4985,7 @@ async function musicBuffer(music, options = {}) {
|
|
|
4972
4985
|
|
|
4973
4986
|
// src/audio/musicEvents.ts
|
|
4974
4987
|
async function musicEvents(music) {
|
|
4975
|
-
const { resolveMusic } = await import('./music-
|
|
4988
|
+
const { resolveMusic } = await import('./music-XQEPBIDT.cjs');
|
|
4976
4989
|
const { describeEvents } = await import('./events-EE3SM5LM.cjs');
|
|
4977
4990
|
const messages = [];
|
|
4978
4991
|
const m = resolveMusic(music, "musicEvents()", (msg) => messages.push(msg));
|
|
@@ -4983,7 +4996,7 @@ async function musicEvents(music) {
|
|
|
4983
4996
|
|
|
4984
4997
|
// src/transforms/withFade.ts
|
|
4985
4998
|
function withFade(spec, opts) {
|
|
4986
|
-
|
|
4999
|
+
chunkDOLTCXCL_cjs.warnUnknownOptions("withFade()", opts, ["in", "out"]);
|
|
4987
5000
|
if (opts.in != null && opts.in > 0) {
|
|
4988
5001
|
spec.initial = { ...spec.initial ?? {}, alpha: 0 };
|
|
4989
5002
|
const kf = { at: 0, to: { alpha: 1 }, duration: opts.in };
|
|
@@ -5025,5 +5038,5 @@ exports.splitText = splitText;
|
|
|
5025
5038
|
exports.stagger = stagger;
|
|
5026
5039
|
exports.wiggle = wiggle;
|
|
5027
5040
|
exports.withFade = withFade;
|
|
5028
|
-
//# sourceMappingURL=chunk-
|
|
5029
|
-
//# sourceMappingURL=chunk-
|
|
5041
|
+
//# sourceMappingURL=chunk-2AT5WSSV.cjs.map
|
|
5042
|
+
//# sourceMappingURL=chunk-2AT5WSSV.cjs.map
|