@pixerate/editor 0.270.0 → 0.272.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.
Files changed (77) hide show
  1. package/dist/animation-editor/index.cjs +62 -62
  2. package/dist/animation-editor/index.js +5 -5
  3. package/dist/brushes/index.cjs +69 -66
  4. package/dist/brushes/index.js +6 -3
  5. package/dist/brushes/patch.d.cts +1 -1
  6. package/dist/brushes/patch.d.ts +1 -1
  7. package/dist/brushes/schema.d.cts +1 -0
  8. package/dist/brushes/schema.d.ts +1 -0
  9. package/dist/brushes/types.d.cts +8 -0
  10. package/dist/brushes/types.d.ts +8 -0
  11. package/dist/{brushstrokeRender-WR2N5HHY.cjs → brushstrokeRender-5YBCLFDQ.cjs} +15 -15
  12. package/dist/{brushstrokeRender-A727TTNQ.js → brushstrokeRender-DZGFU3J4.js} +3 -3
  13. package/dist/canvas/index.cjs +15 -15
  14. package/dist/canvas/index.js +2 -2
  15. package/dist/{chunk-THBJHPUL.js → chunk-2F3YDXCN.js} +1 -1
  16. package/dist/{chunk-4CPOKP27.js → chunk-2XDNF73E.js} +1 -1
  17. package/dist/{chunk-3KNQ2W6X.cjs → chunk-3JKCREEU.cjs} +59 -53
  18. package/dist/{chunk-4YSPQGZW.js → chunk-5HP2VSAS.js} +1 -1
  19. package/dist/{chunk-BPJSI4NT.cjs → chunk-7W2EQQBP.cjs} +2 -2
  20. package/dist/{chunk-LETF75CA.js → chunk-CLB2I2FU.js} +1 -1
  21. package/dist/{chunk-BAZMCFVL.js → chunk-DZVRH63Y.js} +1 -1
  22. package/dist/{chunk-PY4GWSE2.cjs → chunk-EBFPMSJO.cjs} +27 -5
  23. package/dist/{chunk-VBRHE4AM.cjs → chunk-FXVCB6YG.cjs} +35 -35
  24. package/dist/{chunk-EU2ZZA6L.cjs → chunk-GHGBIAWQ.cjs} +126 -39
  25. package/dist/{chunk-CBVNCWJM.cjs → chunk-LBDC5434.cjs} +2 -2
  26. package/dist/{chunk-2WOGXEDX.cjs → chunk-M3RZOF3G.cjs} +1 -1
  27. package/dist/{chunk-GSTSZPSR.js → chunk-N3SKPQEH.js} +225 -18
  28. package/dist/{chunk-J5VQYK7T.cjs → chunk-N5IMDAHM.cjs} +251 -44
  29. package/dist/{chunk-ININNHLM.js → chunk-NAHJV3O6.js} +11 -5
  30. package/dist/{chunk-MWUZCEFT.js → chunk-S2XPXA47.js} +1 -1
  31. package/dist/{chunk-56RHCIJV.cjs → chunk-SNAFFCAX.cjs} +296 -203
  32. package/dist/{chunk-EHLOCVWB.js → chunk-T2URHAJX.js} +27 -5
  33. package/dist/{chunk-BENSE3VX.cjs → chunk-TNLKFW7D.cjs} +23 -23
  34. package/dist/{chunk-KZI3YWKW.js → chunk-UXYCY3HP.js} +93 -6
  35. package/dist/{chunk-4NMPUJUK.cjs → chunk-YJANF2BL.cjs} +86 -86
  36. package/dist/{chunk-FUDP5QBB.js → chunk-ZEI7ZEA4.js} +101 -8
  37. package/dist/effects/index.cjs +5 -2
  38. package/dist/effects/index.js +4 -1
  39. package/dist/effects/pool.d.cts +9 -0
  40. package/dist/effects/pool.d.ts +9 -0
  41. package/dist/effects/types.d.cts +2 -0
  42. package/dist/effects/types.d.ts +2 -0
  43. package/dist/image-editor/index.cjs +791 -791
  44. package/dist/image-editor/index.js +6 -6
  45. package/dist/paint/index.cjs +2 -2
  46. package/dist/paint/index.js +1 -1
  47. package/dist/paint/wet/world.d.cts +37 -1
  48. package/dist/paint/wet/world.d.ts +37 -1
  49. package/dist/paint-editor/brush-controls.d.cts +2 -0
  50. package/dist/paint-editor/brush-controls.d.ts +2 -0
  51. package/dist/paint-editor/brush-model.d.cts +14 -1
  52. package/dist/paint-editor/brush-model.d.ts +14 -1
  53. package/dist/paint-editor/controller.d.cts +75 -4
  54. package/dist/paint-editor/controller.d.ts +75 -4
  55. package/dist/paint-editor/effect-paint.d.cts +33 -8
  56. package/dist/paint-editor/effect-paint.d.ts +33 -8
  57. package/dist/paint-editor/effects.d.cts +4 -0
  58. package/dist/paint-editor/effects.d.ts +4 -0
  59. package/dist/paint-editor/index.cjs +814 -483
  60. package/dist/paint-editor/index.js +408 -77
  61. package/dist/paint-editor/stroke.d.cts +13 -5
  62. package/dist/paint-editor/stroke.d.ts +13 -5
  63. package/dist/paint-editor/ui.d.cts +1 -1
  64. package/dist/paint-editor/ui.d.ts +1 -1
  65. package/dist/paint-editor/wet.d.cts +8 -1
  66. package/dist/paint-editor/wet.d.ts +8 -1
  67. package/dist/vector/index.cjs +999 -999
  68. package/dist/vector/index.js +5 -5
  69. package/dist/video-editor/index.cjs +317 -317
  70. package/dist/video-editor/index.js +2 -2
  71. package/package.json +1 -1
  72. package/skills/pixerate-brushes/SKILL.md +1 -0
  73. package/skills/pixerate-paint-editor/SKILL.md +6 -13
  74. package/skills/pixerate-paint-editor/references/brush-facets.md +1 -0
  75. package/skills/pixerate-paint-editor/references/effect-paint.md +28 -6
  76. package/skills/pixerate-paint-editor/references/ghost.md +47 -0
  77. package/skills/pixerate-paint-watercolour/SKILL.md +1 -0
@@ -8,7 +8,7 @@ import {
8
8
  listPresets,
9
9
  normalizeBrushSpec,
10
10
  resolveBrush
11
- } from "./chunk-KZI3YWKW.js";
11
+ } from "./chunk-UXYCY3HP.js";
12
12
  import {
13
13
  editorStampOf,
14
14
  stampCoverage
@@ -61,6 +61,7 @@ import {
61
61
  DEFAULT_FLOW,
62
62
  DEFAULT_WET_PARAMS,
63
63
  FLAT,
64
+ FREE_INTERVAL,
64
65
  PIGMENT_UNIT,
65
66
  WET_TILE,
66
67
  WetMedium,
@@ -73,7 +74,7 @@ import {
73
74
  normalizeTilt,
74
75
  normalizeWetParams,
75
76
  pigmentOf
76
- } from "./chunk-GSTSZPSR.js";
77
+ } from "./chunk-N3SKPQEH.js";
77
78
  import {
78
79
  BrushstrokeCache,
79
80
  brushstrokeDataUrl,
@@ -2601,13 +2602,76 @@ function vectorExtrudeFaces(path, params) {
2601
2602
  // src/paint-editor/effect-paint.ts
2602
2603
  var EFFECT_STRIP_HEIGHT = 256;
2603
2604
  var EFFECT_MAP_REPEATS = ["repeat", "mirror", "clamp"];
2605
+ var MAX_EFFECT_PATH_POINTS = 256;
2606
+ var roundPathCoord = (v2) => Math.round(v2 * 100) / 100;
2607
+ function strokePathPoints(points, maxPoints = MAX_EFFECT_PATH_POINTS) {
2608
+ if (!points.length) return [];
2609
+ const clean2 = [points[0]];
2610
+ for (let i = 1; i < points.length; i++) {
2611
+ const p = points[i];
2612
+ const prev = clean2[clean2.length - 1];
2613
+ if (p.x !== prev.x || p.y !== prev.y) clean2.push(p);
2614
+ }
2615
+ if (clean2.length === 1) {
2616
+ const x = roundPathCoord(clean2[0].x);
2617
+ const y = roundPathCoord(clean2[0].y);
2618
+ return [x, y, x, y];
2619
+ }
2620
+ if (clean2.length <= maxPoints) {
2621
+ const out2 = [];
2622
+ for (const p of clean2) out2.push(roundPathCoord(p.x), roundPathCoord(p.y));
2623
+ return out2;
2624
+ }
2625
+ const lengths = [0];
2626
+ for (let i = 1; i < clean2.length; i++) {
2627
+ lengths.push(lengths[i - 1] + Math.hypot(clean2[i].x - clean2[i - 1].x, clean2[i].y - clean2[i - 1].y));
2628
+ }
2629
+ const total = lengths[lengths.length - 1];
2630
+ if (total <= 0) {
2631
+ const x = roundPathCoord(clean2[0].x);
2632
+ const y = roundPathCoord(clean2[0].y);
2633
+ return [x, y, x, y];
2634
+ }
2635
+ const out = [];
2636
+ let j = 0;
2637
+ for (let k = 0; k < maxPoints; k++) {
2638
+ const at2 = total * k / (maxPoints - 1);
2639
+ while (j < clean2.length - 2 && lengths[j + 1] < at2) j++;
2640
+ const span = lengths[j + 1] - lengths[j] || 1;
2641
+ const f = Math.min(1, Math.max(0, (at2 - lengths[j]) / span));
2642
+ const a = clean2[j];
2643
+ const b = clean2[j + 1];
2644
+ out.push(roundPathCoord(a.x + (b.x - a.x) * f), roundPathCoord(a.y + (b.y - a.y) * f));
2645
+ }
2646
+ return out;
2647
+ }
2648
+ function inferEffectPathControl(values) {
2649
+ if ("path" in values) return "path";
2650
+ for (const [k, v2] of Object.entries(values)) {
2651
+ if (Array.isArray(v2) && v2.length >= 4 && v2.every((n) => typeof n === "number")) return k;
2652
+ }
2653
+ for (const [k, v2] of Object.entries(values)) {
2654
+ if (typeof v2 === "string") return k;
2655
+ }
2656
+ return "path";
2657
+ }
2658
+ function withStrokePath(paint, points, control) {
2659
+ if (paint.map?.by !== "path") return paint;
2660
+ const key = control ?? inferEffectPathControl(paint.values);
2661
+ return {
2662
+ ...paint,
2663
+ values: { ...paint.values, [key]: strokePathPoints(points) }
2664
+ };
2665
+ }
2604
2666
  function effectPaintSize(p, canvas) {
2605
- return p.map ? { width: p.map.length, height: EFFECT_STRIP_HEIGHT } : { width: canvas.width, height: canvas.height };
2667
+ return p.map?.by === "stroke" ? { width: p.map.length, height: EFFECT_STRIP_HEIGHT } : { width: canvas.width, height: canvas.height };
2606
2668
  }
2607
2669
  function readEffectStrokeMap(raw) {
2608
- if (raw === void 0 || raw === null || raw.by === "canvas") return void 0;
2670
+ if (raw === void 0 || raw === null || raw === "canvas" || raw.by === "canvas") return void 0;
2671
+ if (raw === "path") return { by: "path" };
2609
2672
  const r = raw;
2610
- if (r.by !== "stroke") throw new Error(`map.by ${JSON.stringify(r.by)} is not a mapping; use "canvas" (fixed to the canvas) or "stroke" (along each stroke).`);
2673
+ if (r.by === "path") return { by: "path" };
2674
+ if (r.by !== "stroke") throw new Error(`map.by ${JSON.stringify(r.by)} is not a mapping; use "canvas" (fixed to the canvas), "stroke" (along each stroke) or "path" (native path control).`);
2611
2675
  const length2 = r.length === void 0 ? 300 : Number(r.length);
2612
2676
  if (!(Number.isFinite(length2) && length2 >= 16 && length2 <= 4096)) throw new Error(`map.length ${JSON.stringify(r.length)} is out of range; use 16..4096 px of stroke per repeat.`);
2613
2677
  const repeat = r.repeat === void 0 ? "repeat" : r.repeat;
@@ -3666,12 +3730,17 @@ var WetStrokeDriver = class {
3666
3730
  const spacing = Math.max(0.02, brush.tip.spacing);
3667
3731
  const perDab = Math.min(1, spacing * 1.2);
3668
3732
  const thin = wet.thinner;
3733
+ const body = wet.body * (1 - thin);
3669
3734
  this.medium = new WetMedium(init.world, init.laneId, {
3670
3735
  water: STROKE_WATER * Math.min(1, wet.water * (1 + thin)) * perDab,
3671
3736
  mass: STROKE_MASS * wet.pigment * (1 - 0.6 * thin) * perDab,
3672
- body: wet.body * (1 - thin),
3737
+ body,
3673
3738
  light: 0
3674
3739
  });
3740
+ if (wet.tool === "paint" && brush.ghost && wet.pigment > 0) {
3741
+ const one = pigmentOf(init.color, body);
3742
+ init.world.startGhost(init.laneId, [one[0], one[1], one[2], one[3]], brush.ghost.linger, init.speed ?? 120);
3743
+ }
3675
3744
  this.lightBase = wet.tool === "paint" ? STROKE_LIGHT * brush.light.amount * (1 - 0.6 * thin) * perDab : 0;
3676
3745
  const rates = exchangeRates(brush.behavior.pickup, brush.behavior.mix, wet.load, brush.behavior.mixing);
3677
3746
  this.states = copies.map((c, i) => ({
@@ -3800,6 +3869,22 @@ var WetStrokeDriver = class {
3800
3869
  if (!(k > 0)) return;
3801
3870
  switch (wet.tool) {
3802
3871
  case "paint": {
3872
+ if (brush.ghost) {
3873
+ const smear = brush.ghost.smear;
3874
+ if (wet.pigment > 0) {
3875
+ this.medium.options.light = this.medium.options.mass;
3876
+ this.medium.deposit(rect, cov, k, this.init.color, null);
3877
+ } else {
3878
+ this.medium.options.light = 0;
3879
+ world.paint(laneId, rect, cov, this.medium.options.water * k * (wet.water > 0 ? 1 : 0), null);
3880
+ }
3881
+ if (smear > 0) {
3882
+ const rw = Math.max(wet.rewet, 0.6) * smear;
3883
+ if (rw > 0) world.rewet(laneId, rect, cov, rw * k * 0.5, this.init.paperColor, true);
3884
+ if (st.last) world.drag(laneId, rect, tip, d.x - st.last.x, d.y - st.last.y, smear * k);
3885
+ }
3886
+ break;
3887
+ }
3803
3888
  const ex = st.exchange;
3804
3889
  this.medium.options.light = this.lightBase * (brush.light.pressure ? d.pressure : 1);
3805
3890
  let flow = 1;
@@ -4030,7 +4115,7 @@ var PaintWetLayers = class {
4030
4115
  if (!w.hasLane(layerId)) {
4031
4116
  const base = this.host.layerSurface(layerId) ?? new TiledSurface(4, /* @__PURE__ */ new Map(), 0);
4032
4117
  const s = this.settingsOf(layerId, medium);
4033
- w.ensureLane(layerId, { params: s.params, base, light: this.host.layerLight(layerId) });
4118
+ w.ensureLane(layerId, { params: s.params, base, light: this.host.layerLight(layerId), ghost: s.ghost });
4034
4119
  const { width, height } = this.host.canvas();
4035
4120
  if (s.flow.kind !== "none") w.setFlow(layerId, flowField(s.flow, width, height), s.flow.strength);
4036
4121
  }
@@ -4064,6 +4149,7 @@ var PaintWetLayers = class {
4064
4149
  info(layerId) {
4065
4150
  const s = this.settingsOf(layerId);
4066
4151
  const st = this.world?.hasLane(layerId) ? this.world.stats(layerId) : null;
4152
+ const g = this.world?.hasLane(layerId) ? this.world.getGhost(layerId) : s.ghost ?? null;
4067
4153
  return {
4068
4154
  layerId,
4069
4155
  wet: Boolean(st && st.wetCells > 0),
@@ -4071,7 +4157,8 @@ var PaintWetLayers = class {
4071
4157
  wetBounds: st?.wetBounds ?? null,
4072
4158
  activeTiles: st?.activeTiles ?? 0,
4073
4159
  params: { ...s.params },
4074
- flow: { ...s.flow }
4160
+ flow: { ...s.flow },
4161
+ ...g ? { ghost: { remaining: Math.round(g.remaining * FREE_INTERVAL / this.speed * 100) / 100 } } : {}
4075
4162
  };
4076
4163
  }
4077
4164
  backend() {
@@ -4128,6 +4215,8 @@ var PaintWetLayers = class {
4128
4215
  const base = w.getBase(id);
4129
4216
  const light = w.isLit(id) ? w.getLight(id) : null;
4130
4217
  w.removeLane(id);
4218
+ const s = this.settings.get(id);
4219
+ if (s?.ghost) delete s.ghost;
4131
4220
  if (light && this.host.layerLight(id) !== light) this.host.updateLights(/* @__PURE__ */ new Map([[id, light]]));
4132
4221
  this.host.updateSurfaces(/* @__PURE__ */ new Map([[id, base]]), []);
4133
4222
  }
@@ -13066,6 +13155,10 @@ export {
13066
13155
  vectorExtrudeFaces,
13067
13156
  EFFECT_STRIP_HEIGHT,
13068
13157
  EFFECT_MAP_REPEATS,
13158
+ MAX_EFFECT_PATH_POINTS,
13159
+ strokePathPoints,
13160
+ inferEffectPathControl,
13161
+ withStrokePath,
13069
13162
  effectPaintSize,
13070
13163
  readEffectStrokeMap,
13071
13164
  effectPaintKey,
@@ -31,7 +31,7 @@ var _chunkXUDMRMXQcjs = require('../chunk-XUDMRMXQ.cjs');
31
31
  var _chunk557BDWKOcjs = require('../chunk-557BDWKO.cjs');
32
32
 
33
33
 
34
- var _chunkPY4GWSE2cjs = require('../chunk-PY4GWSE2.cjs');
34
+ var _chunkEBFPMSJOcjs = require('../chunk-EBFPMSJO.cjs');
35
35
 
36
36
 
37
37
 
@@ -1289,6 +1289,9 @@ function createFakeEffectProvider(options = {}) {
1289
1289
  height,
1290
1290
  depth,
1291
1291
  async render(request) {
1292
+ return this.renderSync(request);
1293
+ },
1294
+ renderSync(request) {
1292
1295
  if (disposed) throw new (0, _chunkL2JTLW6Bcjs.EffectDisposedError)(id);
1293
1296
  if (!Number.isFinite(request.time) || request.time < 0) {
1294
1297
  throw new (0, _chunkL2JTLW6Bcjs.EffectUnsupportedError)(`time must be a finite number of ms \u2265 0, got ${request.time}.`, id);
@@ -1974,4 +1977,4 @@ function createEffectAuthoringToolProvider(host, options) {
1974
1977
 
1975
1978
 
1976
1979
 
1977
- exports.CAMERA_MOVE_MAX_MS = _chunkL2JTLW6Bcjs.CAMERA_MOVE_MAX_MS; exports.CAMERA_MOVE_ROLES = _chunkL2JTLW6Bcjs.CAMERA_MOVE_ROLES; exports.EFFECT_ACCEPTS = _chunkL2JTLW6Bcjs.EFFECT_ACCEPTS; exports.EFFECT_ERROR_CODES = _chunkL2JTLW6Bcjs.EFFECT_ERROR_CODES; exports.EFFECT_KINDS = _chunkL2JTLW6Bcjs.EFFECT_KINDS; exports.EFFECT_LAYER_ROLES = _chunkL2JTLW6Bcjs.EFFECT_LAYER_ROLES; exports.EFFECT_LAYER_USES = _chunk557BDWKOcjs.EFFECT_LAYER_USES; exports.EFFECT_PATH_FORMAT = _chunkL2JTLW6Bcjs.EFFECT_PATH_FORMAT; exports.EFFECT_SEQUENCE_NAME = _chunk557BDWKOcjs.EFFECT_SEQUENCE_NAME; exports.EFFECT_SUBJECT_KINDS = _chunkL2JTLW6Bcjs.EFFECT_SUBJECT_KINDS; exports.EFFECT_TEMPLATE_SLOT_TYPES = _chunkL2JTLW6Bcjs.EFFECT_TEMPLATE_SLOT_TYPES; exports.EFFECT_TRANSITION_MS = _chunkL2JTLW6Bcjs.EFFECT_TRANSITION_MS; exports.EFFECT_USES = _chunkL2JTLW6Bcjs.EFFECT_USES; exports.EFFECT_USE_LABELS = EFFECT_USE_LABELS; exports.EffectControlError = _chunkL2JTLW6Bcjs.EffectControlError; exports.EffectDisposedError = _chunkL2JTLW6Bcjs.EffectDisposedError; exports.EffectError = _chunkL2JTLW6Bcjs.EffectError; exports.EffectRendererPool = _chunkPY4GWSE2cjs.EffectRendererPool; exports.EffectUnsupportedError = _chunkL2JTLW6Bcjs.EffectUnsupportedError; exports.EffectsSlot = _chunkL2JTLW6Bcjs.EffectsSlot; exports.NoEffectsProviderError = _chunkL2JTLW6Bcjs.NoEffectsProviderError; exports.TIMING_BLENDS = _chunkL2JTLW6Bcjs.TIMING_BLENDS; exports.TIMING_DEFAULT_FPS = _chunkL2JTLW6Bcjs.TIMING_DEFAULT_FPS; exports.TIMING_MAX_FPS = _chunkL2JTLW6Bcjs.TIMING_MAX_FPS; exports.TIMING_MAX_FRAMES = _chunkL2JTLW6Bcjs.TIMING_MAX_FRAMES; exports.UnknownEffectError = _chunkL2JTLW6Bcjs.UnknownEffectError; exports.UnknownTemplateError = _chunkL2JTLW6Bcjs.UnknownTemplateError; exports.applyEffectMask = _chunkL2JTLW6Bcjs.applyEffectMask; exports.blendTimingFrames = _chunkL2JTLW6Bcjs.blendTimingFrames; exports.cameraBoxOfView = _chunkL2JTLW6Bcjs.cameraBoxOfView; exports.cameraMoveField = _chunkL2JTLW6Bcjs.cameraMoveField; exports.cameraMoveIdList = _chunkL2JTLW6Bcjs.cameraMoveIdList; exports.cameraMoveParts = _chunkL2JTLW6Bcjs.cameraMoveParts; exports.cameraMovesFor = _chunkL2JTLW6Bcjs.cameraMovesFor; exports.cameraViewOfBox = _chunkL2JTLW6Bcjs.cameraViewOfBox; exports.checkEffectProvider = checkEffectProvider; exports.checkEffectSequence = _chunk557BDWKOcjs.checkEffectSequence; exports.checkTemplateValues = _chunk557BDWKOcjs.checkTemplateValues; exports.checkTimingFootage = _chunkL2JTLW6Bcjs.checkTimingFootage; exports.checkTimingRequest = _chunkL2JTLW6Bcjs.checkTimingRequest; exports.countEffectTags = _chunkL2JTLW6Bcjs.countEffectTags; exports.createEffectAuthoringSession = _chunkXUDMRMXQcjs.createEffectAuthoringSession; exports.createEffectAuthoringToolProvider = createEffectAuthoringToolProvider; exports.createEffectPixels = _chunkL2JTLW6Bcjs.createEffectPixels; exports.createEffectToolProvider = _chunkL2JTLW6Bcjs.createEffectToolProvider; exports.createFakeEffectProvider = createFakeEffectProvider; exports.effectControlField = effectControlField; exports.effectFieldValue = effectFieldValue; exports.effectFontFamilies = effectFontFamilies; exports.effectLayerInput = _chunk557BDWKOcjs.effectLayerInput; exports.effectLayerOffered = _chunk557BDWKOcjs.effectLayerOffered; exports.effectLayerRole = _chunk557BDWKOcjs.effectLayerRole; exports.effectLayerSpan = _chunk557BDWKOcjs.effectLayerSpan; exports.effectOffered = _chunkL2JTLW6Bcjs.effectOffered; exports.effectParameterFields = effectParameterFields; exports.effectSampleInputs = effectSampleInputs; exports.effectSamplePicture = effectSamplePicture; exports.effectSequenceEffects = _chunk557BDWKOcjs.effectSequenceEffects; exports.effectSequenceSlots = _chunk557BDWKOcjs.effectSequenceSlots; exports.effectSequenceTiming = _chunk557BDWKOcjs.effectSequenceTiming; exports.effectSubjectKind = _chunk557BDWKOcjs.effectSubjectKind; exports.effectSubjectProblem = _chunk557BDWKOcjs.effectSubjectProblem; exports.effectTemplateTools = _chunk557BDWKOcjs.effectTemplateTools; exports.effectValueErrors = _chunkL2JTLW6Bcjs.effectValueErrors; exports.encodeEffectFloat = _chunkL2JTLW6Bcjs.encodeEffectFloat; exports.fillEffectTemplate = _chunk557BDWKOcjs.fillEffectTemplate; exports.groupEffectsByCategory = groupEffectsByCategory; exports.hasEffectTags = _chunkL2JTLW6Bcjs.hasEffectTags; exports.isCameraView = _chunkL2JTLW6Bcjs.isCameraView; exports.isEffectError = _chunkL2JTLW6Bcjs.isEffectError; exports.isEffectFontControl = isEffectFontControl; exports.isEffectPixels = _chunkL2JTLW6Bcjs.isEffectPixels; exports.isSubjectTemplateSlot = _chunk557BDWKOcjs.isSubjectTemplateSlot; exports.layerImageInput = _chunkL2JTLW6Bcjs.layerImageInput; exports.linearToSrgb = _chunkL2JTLW6Bcjs.linearToSrgb; exports.normaliseEffectTag = _chunkL2JTLW6Bcjs.normaliseEffectTag; exports.normaliseTimingSample = _chunkL2JTLW6Bcjs.normaliseTimingSample; exports.pathControlsOf = _chunkL2JTLW6Bcjs.pathControlsOf; exports.renderEffectThumbnail = renderEffectThumbnail; exports.resolveCameraMoveSpec = _chunkL2JTLW6Bcjs.resolveCameraMoveSpec; exports.resolveEffectValues = _chunkL2JTLW6Bcjs.resolveEffectValues; exports.sampleCameraViews = _chunkL2JTLW6Bcjs.sampleCameraViews; exports.sampleEffectCameraMove = _chunkL2JTLW6Bcjs.sampleEffectCameraMove; exports.searchEffectSummaries = _chunkL2JTLW6Bcjs.searchEffectSummaries; exports.searchTemplateSummaries = _chunk557BDWKOcjs.searchTemplateSummaries; exports.srgbToLinear = _chunkL2JTLW6Bcjs.srgbToLinear; exports.templateDefaultValues = _chunk557BDWKOcjs.templateDefaultValues; exports.templateSlotSchema = _chunk557BDWKOcjs.templateSlotSchema; exports.templateSlotSummary = _chunk557BDWKOcjs.templateSlotSummary; exports.templateSlotTakes = _chunk557BDWKOcjs.templateSlotTakes; exports.templateValueProblem = _chunk557BDWKOcjs.templateValueProblem; exports.templateValuesSchema = _chunk557BDWKOcjs.templateValuesSchema; exports.timingSampleProblems = _chunkL2JTLW6Bcjs.timingSampleProblems;
1980
+ exports.CAMERA_MOVE_MAX_MS = _chunkL2JTLW6Bcjs.CAMERA_MOVE_MAX_MS; exports.CAMERA_MOVE_ROLES = _chunkL2JTLW6Bcjs.CAMERA_MOVE_ROLES; exports.EFFECT_ACCEPTS = _chunkL2JTLW6Bcjs.EFFECT_ACCEPTS; exports.EFFECT_ERROR_CODES = _chunkL2JTLW6Bcjs.EFFECT_ERROR_CODES; exports.EFFECT_KINDS = _chunkL2JTLW6Bcjs.EFFECT_KINDS; exports.EFFECT_LAYER_ROLES = _chunkL2JTLW6Bcjs.EFFECT_LAYER_ROLES; exports.EFFECT_LAYER_USES = _chunk557BDWKOcjs.EFFECT_LAYER_USES; exports.EFFECT_PATH_FORMAT = _chunkL2JTLW6Bcjs.EFFECT_PATH_FORMAT; exports.EFFECT_SEQUENCE_NAME = _chunk557BDWKOcjs.EFFECT_SEQUENCE_NAME; exports.EFFECT_SUBJECT_KINDS = _chunkL2JTLW6Bcjs.EFFECT_SUBJECT_KINDS; exports.EFFECT_TEMPLATE_SLOT_TYPES = _chunkL2JTLW6Bcjs.EFFECT_TEMPLATE_SLOT_TYPES; exports.EFFECT_TRANSITION_MS = _chunkL2JTLW6Bcjs.EFFECT_TRANSITION_MS; exports.EFFECT_USES = _chunkL2JTLW6Bcjs.EFFECT_USES; exports.EFFECT_USE_LABELS = EFFECT_USE_LABELS; exports.EffectControlError = _chunkL2JTLW6Bcjs.EffectControlError; exports.EffectDisposedError = _chunkL2JTLW6Bcjs.EffectDisposedError; exports.EffectError = _chunkL2JTLW6Bcjs.EffectError; exports.EffectRendererPool = _chunkEBFPMSJOcjs.EffectRendererPool; exports.EffectUnsupportedError = _chunkL2JTLW6Bcjs.EffectUnsupportedError; exports.EffectsSlot = _chunkL2JTLW6Bcjs.EffectsSlot; exports.NoEffectsProviderError = _chunkL2JTLW6Bcjs.NoEffectsProviderError; exports.TIMING_BLENDS = _chunkL2JTLW6Bcjs.TIMING_BLENDS; exports.TIMING_DEFAULT_FPS = _chunkL2JTLW6Bcjs.TIMING_DEFAULT_FPS; exports.TIMING_MAX_FPS = _chunkL2JTLW6Bcjs.TIMING_MAX_FPS; exports.TIMING_MAX_FRAMES = _chunkL2JTLW6Bcjs.TIMING_MAX_FRAMES; exports.UnknownEffectError = _chunkL2JTLW6Bcjs.UnknownEffectError; exports.UnknownTemplateError = _chunkL2JTLW6Bcjs.UnknownTemplateError; exports.applyEffectMask = _chunkL2JTLW6Bcjs.applyEffectMask; exports.blendTimingFrames = _chunkL2JTLW6Bcjs.blendTimingFrames; exports.cameraBoxOfView = _chunkL2JTLW6Bcjs.cameraBoxOfView; exports.cameraMoveField = _chunkL2JTLW6Bcjs.cameraMoveField; exports.cameraMoveIdList = _chunkL2JTLW6Bcjs.cameraMoveIdList; exports.cameraMoveParts = _chunkL2JTLW6Bcjs.cameraMoveParts; exports.cameraMovesFor = _chunkL2JTLW6Bcjs.cameraMovesFor; exports.cameraViewOfBox = _chunkL2JTLW6Bcjs.cameraViewOfBox; exports.checkEffectProvider = checkEffectProvider; exports.checkEffectSequence = _chunk557BDWKOcjs.checkEffectSequence; exports.checkTemplateValues = _chunk557BDWKOcjs.checkTemplateValues; exports.checkTimingFootage = _chunkL2JTLW6Bcjs.checkTimingFootage; exports.checkTimingRequest = _chunkL2JTLW6Bcjs.checkTimingRequest; exports.countEffectTags = _chunkL2JTLW6Bcjs.countEffectTags; exports.createEffectAuthoringSession = _chunkXUDMRMXQcjs.createEffectAuthoringSession; exports.createEffectAuthoringToolProvider = createEffectAuthoringToolProvider; exports.createEffectPixels = _chunkL2JTLW6Bcjs.createEffectPixels; exports.createEffectToolProvider = _chunkL2JTLW6Bcjs.createEffectToolProvider; exports.createFakeEffectProvider = createFakeEffectProvider; exports.effectControlField = effectControlField; exports.effectFieldValue = effectFieldValue; exports.effectFontFamilies = effectFontFamilies; exports.effectLayerInput = _chunk557BDWKOcjs.effectLayerInput; exports.effectLayerOffered = _chunk557BDWKOcjs.effectLayerOffered; exports.effectLayerRole = _chunk557BDWKOcjs.effectLayerRole; exports.effectLayerSpan = _chunk557BDWKOcjs.effectLayerSpan; exports.effectOffered = _chunkL2JTLW6Bcjs.effectOffered; exports.effectParameterFields = effectParameterFields; exports.effectSampleInputs = effectSampleInputs; exports.effectSamplePicture = effectSamplePicture; exports.effectSequenceEffects = _chunk557BDWKOcjs.effectSequenceEffects; exports.effectSequenceSlots = _chunk557BDWKOcjs.effectSequenceSlots; exports.effectSequenceTiming = _chunk557BDWKOcjs.effectSequenceTiming; exports.effectSubjectKind = _chunk557BDWKOcjs.effectSubjectKind; exports.effectSubjectProblem = _chunk557BDWKOcjs.effectSubjectProblem; exports.effectTemplateTools = _chunk557BDWKOcjs.effectTemplateTools; exports.effectValueErrors = _chunkL2JTLW6Bcjs.effectValueErrors; exports.encodeEffectFloat = _chunkL2JTLW6Bcjs.encodeEffectFloat; exports.fillEffectTemplate = _chunk557BDWKOcjs.fillEffectTemplate; exports.groupEffectsByCategory = groupEffectsByCategory; exports.hasEffectTags = _chunkL2JTLW6Bcjs.hasEffectTags; exports.isCameraView = _chunkL2JTLW6Bcjs.isCameraView; exports.isEffectError = _chunkL2JTLW6Bcjs.isEffectError; exports.isEffectFontControl = isEffectFontControl; exports.isEffectPixels = _chunkL2JTLW6Bcjs.isEffectPixels; exports.isSubjectTemplateSlot = _chunk557BDWKOcjs.isSubjectTemplateSlot; exports.layerImageInput = _chunkL2JTLW6Bcjs.layerImageInput; exports.linearToSrgb = _chunkL2JTLW6Bcjs.linearToSrgb; exports.normaliseEffectTag = _chunkL2JTLW6Bcjs.normaliseEffectTag; exports.normaliseTimingSample = _chunkL2JTLW6Bcjs.normaliseTimingSample; exports.pathControlsOf = _chunkL2JTLW6Bcjs.pathControlsOf; exports.renderEffectThumbnail = renderEffectThumbnail; exports.resolveCameraMoveSpec = _chunkL2JTLW6Bcjs.resolveCameraMoveSpec; exports.resolveEffectValues = _chunkL2JTLW6Bcjs.resolveEffectValues; exports.sampleCameraViews = _chunkL2JTLW6Bcjs.sampleCameraViews; exports.sampleEffectCameraMove = _chunkL2JTLW6Bcjs.sampleEffectCameraMove; exports.searchEffectSummaries = _chunkL2JTLW6Bcjs.searchEffectSummaries; exports.searchTemplateSummaries = _chunk557BDWKOcjs.searchTemplateSummaries; exports.srgbToLinear = _chunkL2JTLW6Bcjs.srgbToLinear; exports.templateDefaultValues = _chunk557BDWKOcjs.templateDefaultValues; exports.templateSlotSchema = _chunk557BDWKOcjs.templateSlotSchema; exports.templateSlotSummary = _chunk557BDWKOcjs.templateSlotSummary; exports.templateSlotTakes = _chunk557BDWKOcjs.templateSlotTakes; exports.templateValueProblem = _chunk557BDWKOcjs.templateValueProblem; exports.templateValuesSchema = _chunk557BDWKOcjs.templateValuesSchema; exports.timingSampleProblems = _chunkL2JTLW6Bcjs.timingSampleProblems;
@@ -31,7 +31,7 @@ import {
31
31
  } from "../chunk-DHQPRKXF.js";
32
32
  import {
33
33
  EffectRendererPool
34
- } from "../chunk-EHLOCVWB.js";
34
+ } from "../chunk-T2URHAJX.js";
35
35
  import {
36
36
  CAMERA_MOVE_MAX_MS,
37
37
  CAMERA_MOVE_ROLES,
@@ -1289,6 +1289,9 @@ function createFakeEffectProvider(options = {}) {
1289
1289
  height,
1290
1290
  depth,
1291
1291
  async render(request) {
1292
+ return this.renderSync(request);
1293
+ },
1294
+ renderSync(request) {
1292
1295
  if (disposed) throw new EffectDisposedError(id);
1293
1296
  if (!Number.isFinite(request.time) || request.time < 0) {
1294
1297
  throw new EffectUnsupportedError(`time must be a finite number of ms \u2265 0, got ${request.time}.`, id);
@@ -17,6 +17,15 @@ export declare class EffectRendererPool {
17
17
  constructor(options?: EffectRendererPoolOptions);
18
18
  /** Live renderers now. */
19
19
  get size(): number;
20
+ /**
21
+ * Renders `request` on the caller's stack when this size's renderer is warm, idle and has
22
+ * `renderSync`; otherwise `null`, and nothing is rendered (an asynchronous provider never pays for it).
23
+ */
24
+ renderSync(provider: EffectProvider, id: string, size: {
25
+ width: number;
26
+ height: number;
27
+ depth?: 8 | 16 | 32;
28
+ }, request: EffectRenderRequest): EffectPixels | null;
20
29
  /** Renders `request` with the provider's renderer for this effect, size and depth (made on first use). */
21
30
  render(provider: EffectProvider, id: string, size: {
22
31
  width: number;
@@ -17,6 +17,15 @@ export declare class EffectRendererPool {
17
17
  constructor(options?: EffectRendererPoolOptions);
18
18
  /** Live renderers now. */
19
19
  get size(): number;
20
+ /**
21
+ * Renders `request` on the caller's stack when this size's renderer is warm, idle and has
22
+ * `renderSync`; otherwise `null`, and nothing is rendered (an asynchronous provider never pays for it).
23
+ */
24
+ renderSync(provider: EffectProvider, id: string, size: {
25
+ width: number;
26
+ height: number;
27
+ depth?: 8 | 16 | 32;
28
+ }, request: EffectRenderRequest): EffectPixels | null;
20
29
  /** Renders `request` with the provider's renderer for this effect, size and depth (made on first use). */
21
30
  render(provider: EffectProvider, id: string, size: {
22
31
  width: number;
@@ -200,6 +200,8 @@ export interface EffectRenderer {
200
200
  readonly height: number;
201
201
  readonly depth: 8 | 16 | 32;
202
202
  render(request: EffectRenderRequest): Promise<EffectPixels>;
203
+ /** Optional: renders on the caller's stack, for renderers that can (a CPU one). Throws what `render` rejects with. */
204
+ renderSync?(request: EffectRenderRequest): EffectPixels;
203
205
  /** Frees GPU or worker resources. Rendering afterwards rejects. */
204
206
  dispose(): void;
205
207
  }
@@ -200,6 +200,8 @@ export interface EffectRenderer {
200
200
  readonly height: number;
201
201
  readonly depth: 8 | 16 | 32;
202
202
  render(request: EffectRenderRequest): Promise<EffectPixels>;
203
+ /** Optional: renders on the caller's stack, for renderers that can (a CPU one). Throws what `render` rejects with. */
204
+ renderSync?(request: EffectRenderRequest): EffectPixels;
203
205
  /** Frees GPU or worker resources. Rendering afterwards rejects. */
204
206
  dispose(): void;
205
207
  }