pixi-effects 0.7.0 → 0.8.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/CHANGELOG.md +14 -0
- package/README.md +7 -6
- package/ai/reference/cheatsheet.md +5 -1
- package/ai/template.html +3 -3
- package/dist/Composition-CM62XJKT.cjs +14 -0
- package/dist/{Composition-3KHQPRBA.cjs.map → Composition-CM62XJKT.cjs.map} +1 -1
- package/dist/Composition-RJDSQYTV.js +5 -0
- package/dist/{Composition-DT657FO5.js.map → Composition-RJDSQYTV.js.map} +1 -1
- package/dist/Controller.cjs +55 -20
- package/dist/Controller.cjs.map +1 -1
- package/dist/Controller.d.cts +31 -2
- package/dist/Controller.d.ts +31 -2
- package/dist/Controller.js +55 -21
- package/dist/Controller.js.map +1 -1
- package/dist/{Movie-BK9daiTt.d.cts → Movie-CQOhUmko.d.cts} +24 -1
- package/dist/{Movie-B0OUKlZI.d.ts → Movie-HF3pSGjQ.d.ts} +24 -1
- package/dist/{chunk-6I55T4OH.cjs → chunk-AGMNSJJH.cjs} +13 -4
- package/dist/chunk-AGMNSJJH.cjs.map +1 -0
- package/dist/{chunk-4O2NYDJG.js → chunk-FNKSXBKB.js} +13 -4
- package/dist/chunk-FNKSXBKB.js.map +1 -0
- package/dist/{chunk-36Z4RIRK.js → chunk-O4AJYUPK.js} +3 -3
- package/dist/{chunk-36Z4RIRK.js.map → chunk-O4AJYUPK.js.map} +1 -1
- package/dist/{chunk-4VSIJLU3.cjs → chunk-PDBDDGG5.cjs} +21 -21
- package/dist/{chunk-4VSIJLU3.cjs.map → chunk-PDBDDGG5.cjs.map} +1 -1
- package/dist/index.cjs +82 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +71 -12
- package/dist/index.js.map +1 -1
- package/dist/three.cjs +5 -5
- package/dist/three.js +1 -1
- package/docs/api.md +51 -0
- package/docs/dsl.md +14 -2
- package/llms-full.txt +70 -3
- package/package.json +1 -1
- package/dist/Composition-3KHQPRBA.cjs +0 -14
- package/dist/Composition-DT657FO5.js +0 -5
- package/dist/chunk-4O2NYDJG.js.map +0 -1
- package/dist/chunk-6I55T4OH.cjs.map +0 -1
|
@@ -182,6 +182,17 @@ interface ProgressEvent {
|
|
|
182
182
|
frame: number;
|
|
183
183
|
totalFrames: number;
|
|
184
184
|
}
|
|
185
|
+
/** `volumechange`: the values after the change. */
|
|
186
|
+
interface VolumeEvent {
|
|
187
|
+
volume: number;
|
|
188
|
+
muted: boolean;
|
|
189
|
+
}
|
|
190
|
+
/** `error`: something failed in `init()`, `render()` or during playback. The call that failed still rejects / warns as before. */
|
|
191
|
+
interface MovieErrorEvent {
|
|
192
|
+
where: 'init' | 'render' | 'playback';
|
|
193
|
+
message: string;
|
|
194
|
+
error: unknown;
|
|
195
|
+
}
|
|
185
196
|
type Listener = (...args: any[]) => void;
|
|
186
197
|
declare class Movie {
|
|
187
198
|
private _events;
|
|
@@ -192,6 +203,8 @@ declare class Movie {
|
|
|
192
203
|
audioSource: AudioBufferSourceNode | null;
|
|
193
204
|
gainNode: GainNode | null;
|
|
194
205
|
private _cancelAudioStart;
|
|
206
|
+
/** > 0 while the movie moves its own playhead (playback, render, snapshot, contactSheet): those are not the seeks `seeking` / `seeked` report. */
|
|
207
|
+
private _quiet;
|
|
195
208
|
private _volume;
|
|
196
209
|
private _muted;
|
|
197
210
|
isPlaying: boolean;
|
|
@@ -211,6 +224,12 @@ declare class Movie {
|
|
|
211
224
|
private _mixStats;
|
|
212
225
|
on(event: 'ready', fn: () => void): this;
|
|
213
226
|
on(event: 'frame', fn: (e: FrameEvent) => void): this;
|
|
227
|
+
/** A jump to another frame (`gotoFrame`, a seek bar) starts / finishes. Not emitted for playback ticks, `render()`, `snapshot()` or `contactSheet()`. */
|
|
228
|
+
on(event: 'seeking' | 'seeked', fn: (e: FrameEvent) => void): this;
|
|
229
|
+
/** Playback ran off the end (after `pause`). Pausing by hand does not emit it. */
|
|
230
|
+
on(event: 'ended', fn: () => void): this;
|
|
231
|
+
on(event: 'volumechange', fn: (e: VolumeEvent) => void): this;
|
|
232
|
+
on(event: 'error', fn: (e: MovieErrorEvent) => void): this;
|
|
214
233
|
on(event: 'progress', fn: (e: ProgressEvent) => void): this;
|
|
215
234
|
on(event: 'play', fn: () => void): this;
|
|
216
235
|
on(event: 'pause', fn: () => void): this;
|
|
@@ -220,6 +239,10 @@ declare class Movie {
|
|
|
220
239
|
private _ensureAudioContext;
|
|
221
240
|
init(options?: MovieOptions): Promise<void>;
|
|
222
241
|
gotoFrame(frame: number, force?: boolean): Promise<void>;
|
|
242
|
+
/** Run `fn` with `seeking` / `seeked` silenced: the movie is moving its own playhead, not answering a seek. */
|
|
243
|
+
private _quietly;
|
|
244
|
+
private _emitError;
|
|
245
|
+
private _goto;
|
|
223
246
|
private _awaitVideoFrames;
|
|
224
247
|
/**
|
|
225
248
|
* A picture of one frame (the canvas only: the player bar is not included). Seeks there first and
|
|
@@ -282,4 +305,4 @@ declare class Movie {
|
|
|
282
305
|
destroy(): Promise<void>;
|
|
283
306
|
}
|
|
284
307
|
|
|
285
|
-
export { type AudioInspectOptions as A, type ContactSheetOptions as C, type FrameEvent as F, type InspectOptions as I, type LayerInfo as L, Movie as M, type ProgressEvent as P, type RenderOptions as R, type SnapshotOptions as S, type TimelineData as T, type AudioReport as a, type AudioSourceReport as b, type InspectReport as c, type
|
|
308
|
+
export { type AudioInspectOptions as A, type ContactSheetOptions as C, type FrameEvent as F, type InspectOptions as I, type LayerInfo as L, Movie as M, type ProgressEvent as P, type RenderOptions as R, type SnapshotOptions as S, type TimelineData as T, type VolumeEvent as V, type AudioReport as a, type AudioSourceReport as b, type InspectReport as c, type MovieErrorEvent as d, type MovieOptions as e, type SoundMeasure as f, type TimelineHtmlOptions as g, type TimelineRow as h, type TimelineSvgOptions as i, type TimelineTransition as j };
|
|
@@ -182,6 +182,17 @@ interface ProgressEvent {
|
|
|
182
182
|
frame: number;
|
|
183
183
|
totalFrames: number;
|
|
184
184
|
}
|
|
185
|
+
/** `volumechange`: the values after the change. */
|
|
186
|
+
interface VolumeEvent {
|
|
187
|
+
volume: number;
|
|
188
|
+
muted: boolean;
|
|
189
|
+
}
|
|
190
|
+
/** `error`: something failed in `init()`, `render()` or during playback. The call that failed still rejects / warns as before. */
|
|
191
|
+
interface MovieErrorEvent {
|
|
192
|
+
where: 'init' | 'render' | 'playback';
|
|
193
|
+
message: string;
|
|
194
|
+
error: unknown;
|
|
195
|
+
}
|
|
185
196
|
type Listener = (...args: any[]) => void;
|
|
186
197
|
declare class Movie {
|
|
187
198
|
private _events;
|
|
@@ -192,6 +203,8 @@ declare class Movie {
|
|
|
192
203
|
audioSource: AudioBufferSourceNode | null;
|
|
193
204
|
gainNode: GainNode | null;
|
|
194
205
|
private _cancelAudioStart;
|
|
206
|
+
/** > 0 while the movie moves its own playhead (playback, render, snapshot, contactSheet): those are not the seeks `seeking` / `seeked` report. */
|
|
207
|
+
private _quiet;
|
|
195
208
|
private _volume;
|
|
196
209
|
private _muted;
|
|
197
210
|
isPlaying: boolean;
|
|
@@ -211,6 +224,12 @@ declare class Movie {
|
|
|
211
224
|
private _mixStats;
|
|
212
225
|
on(event: 'ready', fn: () => void): this;
|
|
213
226
|
on(event: 'frame', fn: (e: FrameEvent) => void): this;
|
|
227
|
+
/** A jump to another frame (`gotoFrame`, a seek bar) starts / finishes. Not emitted for playback ticks, `render()`, `snapshot()` or `contactSheet()`. */
|
|
228
|
+
on(event: 'seeking' | 'seeked', fn: (e: FrameEvent) => void): this;
|
|
229
|
+
/** Playback ran off the end (after `pause`). Pausing by hand does not emit it. */
|
|
230
|
+
on(event: 'ended', fn: () => void): this;
|
|
231
|
+
on(event: 'volumechange', fn: (e: VolumeEvent) => void): this;
|
|
232
|
+
on(event: 'error', fn: (e: MovieErrorEvent) => void): this;
|
|
214
233
|
on(event: 'progress', fn: (e: ProgressEvent) => void): this;
|
|
215
234
|
on(event: 'play', fn: () => void): this;
|
|
216
235
|
on(event: 'pause', fn: () => void): this;
|
|
@@ -220,6 +239,10 @@ declare class Movie {
|
|
|
220
239
|
private _ensureAudioContext;
|
|
221
240
|
init(options?: MovieOptions): Promise<void>;
|
|
222
241
|
gotoFrame(frame: number, force?: boolean): Promise<void>;
|
|
242
|
+
/** Run `fn` with `seeking` / `seeked` silenced: the movie is moving its own playhead, not answering a seek. */
|
|
243
|
+
private _quietly;
|
|
244
|
+
private _emitError;
|
|
245
|
+
private _goto;
|
|
223
246
|
private _awaitVideoFrames;
|
|
224
247
|
/**
|
|
225
248
|
* A picture of one frame (the canvas only: the player bar is not included). Seeks there first and
|
|
@@ -282,4 +305,4 @@ declare class Movie {
|
|
|
282
305
|
destroy(): Promise<void>;
|
|
283
306
|
}
|
|
284
307
|
|
|
285
|
-
export { type AudioInspectOptions as A, type ContactSheetOptions as C, type FrameEvent as F, type InspectOptions as I, type LayerInfo as L, Movie as M, type ProgressEvent as P, type RenderOptions as R, type SnapshotOptions as S, type TimelineData as T, type AudioReport as a, type AudioSourceReport as b, type InspectReport as c, type
|
|
308
|
+
export { type AudioInspectOptions as A, type ContactSheetOptions as C, type FrameEvent as F, type InspectOptions as I, type LayerInfo as L, Movie as M, type ProgressEvent as P, type RenderOptions as R, type SnapshotOptions as S, type TimelineData as T, type VolumeEvent as V, type AudioReport as a, type AudioSourceReport as b, type InspectReport as c, type MovieErrorEvent as d, type MovieOptions as e, type SoundMeasure as f, type TimelineHtmlOptions as g, type TimelineRow as h, type TimelineSvgOptions as i, type TimelineTransition as j };
|
|
@@ -825,6 +825,14 @@ function colorMatrix(params) {
|
|
|
825
825
|
if (Array.isArray(params.matrix)) f.matrix = params.matrix;
|
|
826
826
|
return f;
|
|
827
827
|
}
|
|
828
|
+
var GRADIENT_TYPES = ["linear", "radial", "conic"];
|
|
829
|
+
function colorGradientParams(params) {
|
|
830
|
+
const { gradientType, ...rest } = params;
|
|
831
|
+
if (gradientType === void 0) return rest;
|
|
832
|
+
const i = GRADIENT_TYPES.indexOf(String(gradientType));
|
|
833
|
+
if (i < 0) throw new Error(`pixi-effects: colorGradient gradientType "${gradientType}" is not one of linear, radial or conic`);
|
|
834
|
+
return { ...rest, type: i };
|
|
835
|
+
}
|
|
828
836
|
function createNamedFilter(type, params) {
|
|
829
837
|
if (lower(type) === "colormatrix") return colorMatrix(params);
|
|
830
838
|
const core = Object.entries(CORE).find(([k]) => lower(k) === lower(type));
|
|
@@ -833,7 +841,8 @@ function createNamedFilter(type, params) {
|
|
|
833
841
|
const Ctor = library?.get(lower(type));
|
|
834
842
|
if (!Ctor) throw MISSING(type, library ? "not found in the loaded package" : "not loaded yet");
|
|
835
843
|
const single = SINGLE_VALUE[Object.keys(SINGLE_VALUE).find((k) => lower(k) === lower(type)) ?? ""];
|
|
836
|
-
|
|
844
|
+
if (single) return new Ctor(params[single]);
|
|
845
|
+
return new Ctor(lower(type) === "colorgradient" ? colorGradientParams(params) : params);
|
|
837
846
|
}
|
|
838
847
|
|
|
839
848
|
// src/filters/index.ts
|
|
@@ -2525,7 +2534,7 @@ function numOrZero(v, scope) {
|
|
|
2525
2534
|
var _CompositionSequence = null;
|
|
2526
2535
|
async function getCompositionSequence() {
|
|
2527
2536
|
if (!_CompositionSequence) {
|
|
2528
|
-
_CompositionSequence = (await import('./Composition-
|
|
2537
|
+
_CompositionSequence = (await import('./Composition-CM62XJKT.cjs')).CompositionSequence;
|
|
2529
2538
|
}
|
|
2530
2539
|
return _CompositionSequence;
|
|
2531
2540
|
}
|
|
@@ -2582,5 +2591,5 @@ exports.projectLayer = projectLayer;
|
|
|
2582
2591
|
exports.registerSequenceType = registerSequenceType;
|
|
2583
2592
|
exports.resolveAt = resolveAt;
|
|
2584
2593
|
exports.summarizeWarnings = summarizeWarnings;
|
|
2585
|
-
//# sourceMappingURL=chunk-
|
|
2586
|
-
//# sourceMappingURL=chunk-
|
|
2594
|
+
//# sourceMappingURL=chunk-AGMNSJJH.cjs.map
|
|
2595
|
+
//# sourceMappingURL=chunk-AGMNSJJH.cjs.map
|