@clypra-studio/engine 1.0.4 → 1.0.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/package.json +2 -2
- package/dist/TransitionDefinition-CQoSb4ZB.d.cts +0 -158
- package/dist/TransitionDefinition-CQoSb4ZB.d.ts +0 -158
- package/dist/index-Da47I6aX.d.cts +0 -139
- package/dist/index-Da47I6aX.d.ts +0 -139
- package/dist/index-lNWEWqab.d.cts +0 -633
- package/dist/index-lNWEWqab.d.ts +0 -633
- package/dist/index.d.cts +0 -8884
- package/dist/index.d.ts +0 -8884
- package/dist/textEffects/index.d.cts +0 -1
- package/dist/textEffects/index.d.ts +0 -1
- package/dist/transitions/index.d.cts +0 -219
- package/dist/transitions/index.d.ts +0 -219
- package/dist/v2/backends/index.d.cts +0 -3
- package/dist/v2/backends/index.d.ts +0 -3
- package/dist/v2/contract/index.d.cts +0 -165
- package/dist/v2/contract/index.d.ts +0 -165
- package/dist/videoEffects/index.d.cts +0 -697
- package/dist/videoEffects/index.d.ts +0 -697
|
@@ -1,697 +0,0 @@
|
|
|
1
|
-
import { E as EffectDefinition, e as ParamValues, i as TransitionDefinition, P as PixiEffectDefinition } from '../TransitionDefinition-CQoSb4ZB.cjs';
|
|
2
|
-
export { C as Canvas2DEffectDefinition, a as Canvas2DEngine, b as Canvas2DEngineConstructor, c as ParamSchema, d as ParamType, f as PixiEffectContext, g as PixiEffectSubtype, h as PixiFilterSpec, j as isCanvas2DEffect, k as isCompositeEffect, l as isFilterEffect, m as isMotionEffect, n as isPixiEffect } from '../TransitionDefinition-CQoSb4ZB.cjs';
|
|
3
|
-
import { Application, Sprite, Container, Texture } from 'pixi.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Video Effects Type System
|
|
7
|
-
*
|
|
8
|
-
* Distinguishes between:
|
|
9
|
-
* - Overlay Assets: Actual video files (smoke.mov, fire.mov)
|
|
10
|
-
* - Effect Presets: JSON behavior definitions (shake, blur)
|
|
11
|
-
*
|
|
12
|
-
* NOTE: Transitions have been moved to @clypra/engine/transitions
|
|
13
|
-
*/
|
|
14
|
-
type EffectCategory = "overlay" | "effect" | "filter";
|
|
15
|
-
interface OverlayAsset {
|
|
16
|
-
id: string;
|
|
17
|
-
name: string;
|
|
18
|
-
type: "overlay";
|
|
19
|
-
category: string;
|
|
20
|
-
description: string;
|
|
21
|
-
thumbnail: string;
|
|
22
|
-
url: string;
|
|
23
|
-
duration: number;
|
|
24
|
-
width: number;
|
|
25
|
-
height: number;
|
|
26
|
-
hasAlpha: boolean;
|
|
27
|
-
fileFormat: "mov" | "webm" | "mp4" | "png-sequence";
|
|
28
|
-
fileSize: number;
|
|
29
|
-
tags: string[];
|
|
30
|
-
isPremium?: boolean;
|
|
31
|
-
blendMode?: BlendMode;
|
|
32
|
-
loopable: boolean;
|
|
33
|
-
recommended: {
|
|
34
|
-
opacity?: number;
|
|
35
|
-
blendMode?: BlendMode;
|
|
36
|
-
placement?: "fullscreen" | "overlay";
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
type EffectRenderer$1 = "shake" | "zoom" | "pan" | "rotate" | "dolly" | "blur" | "motion_blur" | "radial_blur" | "zoom_blur" | "motion-blur" | "gaussian-blur" | "kawase-blur" | "zoom-blur" | "radial-blur" | "drop-shadow" | "vhs" | "glitch" | "rgb_split" | "chromatic_aberration" | "film_grain" | "scanlines" | "crt" | "pixelate" | "rgb-split" | "film-grain" | "glitch-band" | "color-gradient" | "color-overlay" | "hsl-adjustment" | "alpha" | "color-matrix" | "color-adjustments" | "neon-glow" | "static-noise" | "old-film" | "displacement" | "outline" | "grayscale" | "dot" | "emboss" | "cross-hatch" | "ascii" | "wave" | "ripple" | "bulge" | "twist" | "fisheye" | "shockwave" | "bulge-pinch" | "reflection" | "flash" | "flicker" | "vignette" | "glow" | "light_leak" | "light_leak_2" | "fire" | "particles" | "dust_particles" | "light-leak" | "lens-flare" | "tilt-shift" | "cinematic-lut" | "speed_ramp" | "freeze_frame" | "echo" | "strobe" | "body-segmentation-glow" | "body_glow" | "body_outline" | "body_particles";
|
|
40
|
-
interface EffectPreset {
|
|
41
|
-
id: string;
|
|
42
|
-
name: string;
|
|
43
|
-
type: "effect" | "video-effect" | "body-effect";
|
|
44
|
-
category: string;
|
|
45
|
-
description: string;
|
|
46
|
-
thumbnail: string;
|
|
47
|
-
renderer: EffectRenderer$1;
|
|
48
|
-
params: EffectParameters;
|
|
49
|
-
tags: string[];
|
|
50
|
-
isPremium?: boolean;
|
|
51
|
-
intensity: {
|
|
52
|
-
min: number;
|
|
53
|
-
max: number;
|
|
54
|
-
default: number;
|
|
55
|
-
step: number;
|
|
56
|
-
};
|
|
57
|
-
requirements?: {
|
|
58
|
-
bodySegmentation?: boolean;
|
|
59
|
-
minConfidence?: number;
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
type BlendMode = "normal" | "multiply" | "screen" | "overlay" | "darken" | "lighten" | "color-dodge" | "color-burn" | "hard-light" | "soft-light" | "difference" | "exclusion" | "add" | "subtract";
|
|
63
|
-
type EasingFunction = "linear" | "ease" | "ease-in" | "ease-out" | "ease-in-out" | "ease-in-quad" | "ease-out-quad" | "ease-in-out-quad" | "ease-in-cubic" | "ease-out-cubic" | "ease-in-out-cubic" | "ease-in-quart" | "ease-out-quart" | "ease-in-out-quart" | "spring" | "bounce";
|
|
64
|
-
interface EffectParameters {
|
|
65
|
-
intensity?: number;
|
|
66
|
-
frequency?: number;
|
|
67
|
-
blurAmount?: number;
|
|
68
|
-
direction?: number;
|
|
69
|
-
glitchIntensity?: number;
|
|
70
|
-
scanlineCount?: number;
|
|
71
|
-
noiseAmount?: number;
|
|
72
|
-
colorOffset?: number;
|
|
73
|
-
splitDistance?: number;
|
|
74
|
-
angle?: number;
|
|
75
|
-
startSpeed?: number;
|
|
76
|
-
endSpeed?: number;
|
|
77
|
-
curve?: EasingFunction;
|
|
78
|
-
scale?: number;
|
|
79
|
-
centerX?: number;
|
|
80
|
-
centerY?: number;
|
|
81
|
-
flashColor?: string;
|
|
82
|
-
flashIntensity?: number;
|
|
83
|
-
grainSize?: number;
|
|
84
|
-
grainIntensity?: number;
|
|
85
|
-
duration?: number;
|
|
86
|
-
size?: number;
|
|
87
|
-
color1?: string;
|
|
88
|
-
color2?: string;
|
|
89
|
-
color3?: string;
|
|
90
|
-
[key: string]: any;
|
|
91
|
-
}
|
|
92
|
-
interface FilterAsset {
|
|
93
|
-
id: string;
|
|
94
|
-
name: string;
|
|
95
|
-
type: "filter";
|
|
96
|
-
category: string;
|
|
97
|
-
description: string;
|
|
98
|
-
thumbnail: string;
|
|
99
|
-
status?: string;
|
|
100
|
-
intensity: {
|
|
101
|
-
min: number;
|
|
102
|
-
max: number;
|
|
103
|
-
default: number;
|
|
104
|
-
step: number;
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
type VideoEffectItem = OverlayAsset | EffectPreset | FilterAsset;
|
|
108
|
-
interface VideoEffectCategory {
|
|
109
|
-
id: string;
|
|
110
|
-
name: string;
|
|
111
|
-
type: EffectCategory;
|
|
112
|
-
description: string;
|
|
113
|
-
thumbnail: string;
|
|
114
|
-
itemCount: number;
|
|
115
|
-
}
|
|
116
|
-
interface VideoEffectManifest {
|
|
117
|
-
categories: VideoEffectCategory[];
|
|
118
|
-
featured: VideoEffectItem[];
|
|
119
|
-
version: string;
|
|
120
|
-
}
|
|
121
|
-
interface AppliedOverlay {
|
|
122
|
-
id: string;
|
|
123
|
-
effectId: string;
|
|
124
|
-
type: "overlay";
|
|
125
|
-
url: string;
|
|
126
|
-
x: number;
|
|
127
|
-
y: number;
|
|
128
|
-
width: number;
|
|
129
|
-
height: number;
|
|
130
|
-
rotation: number;
|
|
131
|
-
opacity: number;
|
|
132
|
-
blendMode: BlendMode;
|
|
133
|
-
startTime: number;
|
|
134
|
-
duration: number;
|
|
135
|
-
loop: boolean;
|
|
136
|
-
}
|
|
137
|
-
interface AppliedEffect {
|
|
138
|
-
id: string;
|
|
139
|
-
effectId: string;
|
|
140
|
-
type: "effect";
|
|
141
|
-
renderer: EffectRenderer$1;
|
|
142
|
-
params: EffectParameters;
|
|
143
|
-
startTime: number;
|
|
144
|
-
duration: number;
|
|
145
|
-
intensity: number;
|
|
146
|
-
keyframes?: Array<{
|
|
147
|
-
time: number;
|
|
148
|
-
intensity: number;
|
|
149
|
-
easing: EasingFunction;
|
|
150
|
-
}>;
|
|
151
|
-
}
|
|
152
|
-
interface VideoEffectState {
|
|
153
|
-
manifest: VideoEffectManifest | null;
|
|
154
|
-
categories: Record<string, VideoEffectItem[]>;
|
|
155
|
-
loading: Record<string, boolean>;
|
|
156
|
-
errors: Record<string, string | null>;
|
|
157
|
-
overlayCache: Map<string, Blob>;
|
|
158
|
-
favorites: Set<string>;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* Effect Renderer
|
|
163
|
-
*
|
|
164
|
-
* Applies behavior-driven effects to canvas contexts.
|
|
165
|
-
* These are NOT video files - they are algorithmic transformations.
|
|
166
|
-
*/
|
|
167
|
-
|
|
168
|
-
declare class EffectRenderer {
|
|
169
|
-
/**
|
|
170
|
-
* Apply an effect to a canvas context
|
|
171
|
-
*
|
|
172
|
-
* @param ctx - Canvas 2D context
|
|
173
|
-
* @param renderer - Effect type
|
|
174
|
-
* @param params - Effect parameters
|
|
175
|
-
* @param intensity - Effect intensity (0-1)
|
|
176
|
-
* @param time - Current time for animated effects
|
|
177
|
-
*/
|
|
178
|
-
static apply(ctx: CanvasRenderingContext2D, renderer: EffectRenderer$1, params: EffectParameters, intensity?: number, time?: number, bodyMask?: ImageData): void;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* @clypra-studio/engine — EffectGraph
|
|
183
|
-
*
|
|
184
|
-
* Directed Acyclic Graph evaluator for effect chains.
|
|
185
|
-
* Uses Kahn's algorithm for topological ordering.
|
|
186
|
-
* Supports both Canvas2D and PixiJS effect nodes transparently.
|
|
187
|
-
*
|
|
188
|
-
* Unchanged public API from v1 — new PixiJS nodes slot in automatically.
|
|
189
|
-
*/
|
|
190
|
-
|
|
191
|
-
interface KeyframePoint {
|
|
192
|
-
time: number;
|
|
193
|
-
value: number | string | number[];
|
|
194
|
-
easing: EasingFunction;
|
|
195
|
-
}
|
|
196
|
-
interface GraphNode {
|
|
197
|
-
id: string;
|
|
198
|
-
effect?: EffectDefinition;
|
|
199
|
-
type?: string;
|
|
200
|
-
params?: Record<string, any>;
|
|
201
|
-
keyframes?: Record<string, KeyframePoint[]>;
|
|
202
|
-
/** IDs of nodes this node depends on (must render before this one) */
|
|
203
|
-
dependencies?: string[];
|
|
204
|
-
}
|
|
205
|
-
interface GraphEdge {
|
|
206
|
-
from: string;
|
|
207
|
-
to: string;
|
|
208
|
-
}
|
|
209
|
-
interface GraphConnection {
|
|
210
|
-
fromNode: string;
|
|
211
|
-
fromOutput: string;
|
|
212
|
-
toNode: string;
|
|
213
|
-
toInput: string;
|
|
214
|
-
}
|
|
215
|
-
interface GraphDefinition {
|
|
216
|
-
schemaVersion: string;
|
|
217
|
-
graphId: string;
|
|
218
|
-
name: string;
|
|
219
|
-
nodes: GraphNode[];
|
|
220
|
-
connections: GraphConnection[];
|
|
221
|
-
}
|
|
222
|
-
declare class EffectGraph {
|
|
223
|
-
schemaVersion?: string;
|
|
224
|
-
graphId?: string;
|
|
225
|
-
name?: string;
|
|
226
|
-
nodes: Map<string, GraphNode>;
|
|
227
|
-
edges: GraphEdge[];
|
|
228
|
-
connections: GraphConnection[];
|
|
229
|
-
constructor(definition?: GraphDefinition);
|
|
230
|
-
addNode(node: GraphNode): this;
|
|
231
|
-
addEdge(from: string, to: string): this;
|
|
232
|
-
removeNode(id: string): this;
|
|
233
|
-
/**
|
|
234
|
-
* Topological sort via Kahn's algorithm.
|
|
235
|
-
* Returns nodes in render order or throws on circular dependency.
|
|
236
|
-
*/
|
|
237
|
-
resolve(): GraphNode[];
|
|
238
|
-
getExecutionOrder(): string[];
|
|
239
|
-
getUpstreamNodes(nodeId: string): string[];
|
|
240
|
-
/**
|
|
241
|
-
* Returns only the PixiJS nodes in resolved order.
|
|
242
|
-
* Used by EffectRenderer to build the PixiJS filter + motion pipeline.
|
|
243
|
-
*/
|
|
244
|
-
resolvePixi(): GraphNode[];
|
|
245
|
-
/**
|
|
246
|
-
* Returns only the Canvas2D nodes in resolved order.
|
|
247
|
-
* Used by EffectRenderer for text effect overlays.
|
|
248
|
-
*/
|
|
249
|
-
resolveCanvas2D(): GraphNode[];
|
|
250
|
-
get size(): number;
|
|
251
|
-
clear(): this;
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
/**
|
|
255
|
-
* Effect Runtime Engine
|
|
256
|
-
*
|
|
257
|
-
* Manages the lifecycle of active effect graphs,
|
|
258
|
-
* interpolates keyframe parameters, and coordinates rendering passes.
|
|
259
|
-
*/
|
|
260
|
-
|
|
261
|
-
declare class EffectEngine {
|
|
262
|
-
private activeGraph;
|
|
263
|
-
private canvasPool;
|
|
264
|
-
constructor();
|
|
265
|
-
/**
|
|
266
|
-
* Set the active effect graph to execute
|
|
267
|
-
*/
|
|
268
|
-
loadGraph(graph: EffectGraph): void;
|
|
269
|
-
/**
|
|
270
|
-
* Clear active graph and associated canvases
|
|
271
|
-
*/
|
|
272
|
-
unloadGraph(): void;
|
|
273
|
-
/**
|
|
274
|
-
* Evaluate node parameters at specific timestamp `t`
|
|
275
|
-
*/
|
|
276
|
-
evaluateParameters(node: GraphNode, time: number): Record<string, any>;
|
|
277
|
-
/**
|
|
278
|
-
* Render the active graph onto a Canvas 2D Context
|
|
279
|
-
*
|
|
280
|
-
* @param ctx Target canvas context
|
|
281
|
-
* @param time Timestamp relative to effect start
|
|
282
|
-
* @param sourceTexture Optional raw image source
|
|
283
|
-
*/
|
|
284
|
-
render(ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, time: number, sourceTexture?: CanvasImageSource): void;
|
|
285
|
-
/**
|
|
286
|
-
* Interpolate values (numbers or colors)
|
|
287
|
-
*/
|
|
288
|
-
private interpolate;
|
|
289
|
-
/**
|
|
290
|
-
* Easing curves mapping
|
|
291
|
-
*/
|
|
292
|
-
private applyEasing;
|
|
293
|
-
/**
|
|
294
|
-
* Acquire Offscreen Canvas context from reuse pool
|
|
295
|
-
*/
|
|
296
|
-
private acquireCanvas;
|
|
297
|
-
private clearPool;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
/**
|
|
301
|
-
* Effects Registry
|
|
302
|
-
* Central registry for all available video effects
|
|
303
|
-
*/
|
|
304
|
-
|
|
305
|
-
/**
|
|
306
|
-
* Effect metadata for UI and documentation
|
|
307
|
-
*/
|
|
308
|
-
interface EffectMetadata {
|
|
309
|
-
id: EffectRenderer$1;
|
|
310
|
-
name: string;
|
|
311
|
-
category: "essentials" | "glitch" | "retro" | "light" | "motion" | "color" | "body" | "cinematic" | "distortion";
|
|
312
|
-
description: string;
|
|
313
|
-
defaultParams: EffectParameters;
|
|
314
|
-
parameterSchema: {
|
|
315
|
-
[key: string]: {
|
|
316
|
-
type: "number" | "string" | "boolean" | "color";
|
|
317
|
-
label: string;
|
|
318
|
-
min?: number;
|
|
319
|
-
max?: number;
|
|
320
|
-
default: any;
|
|
321
|
-
step?: number;
|
|
322
|
-
};
|
|
323
|
-
};
|
|
324
|
-
tags: string[];
|
|
325
|
-
premium?: boolean;
|
|
326
|
-
}
|
|
327
|
-
/**
|
|
328
|
-
* Registry of all available effects with their metadata
|
|
329
|
-
*/
|
|
330
|
-
declare const EFFECTS_REGISTRY: Record<string, EffectMetadata>;
|
|
331
|
-
/**
|
|
332
|
-
* Get effect metadata by ID
|
|
333
|
-
*/
|
|
334
|
-
declare function getEffectMetadata(id: EffectRenderer$1): EffectMetadata | undefined;
|
|
335
|
-
/**
|
|
336
|
-
* Get all effects by category
|
|
337
|
-
*/
|
|
338
|
-
declare function getEffectsByCategory(category: EffectMetadata["category"]): EffectMetadata[];
|
|
339
|
-
/**
|
|
340
|
-
* Get effect renderer function by ID
|
|
341
|
-
*/
|
|
342
|
-
declare function getEffectRenderer(id: EffectRenderer$1): ((ctx: CanvasRenderingContext2D, params: EffectParameters, intensity: number, time: number, bodyMask?: ImageData) => void) | null;
|
|
343
|
-
/**
|
|
344
|
-
* Search effects by name or tag
|
|
345
|
-
*/
|
|
346
|
-
declare function searchEffects(query: string): EffectMetadata[];
|
|
347
|
-
|
|
348
|
-
/**
|
|
349
|
-
* Color Utility Functions
|
|
350
|
-
*/
|
|
351
|
-
/**
|
|
352
|
-
* Convert hex color to rgba string
|
|
353
|
-
*/
|
|
354
|
-
declare function hexToRgba(hex: string, alpha: number): string;
|
|
355
|
-
/**
|
|
356
|
-
* Convert rgba string to individual components
|
|
357
|
-
*/
|
|
358
|
-
declare function rgbaToComponents(rgba: string): {
|
|
359
|
-
r: number;
|
|
360
|
-
g: number;
|
|
361
|
-
b: number;
|
|
362
|
-
a: number;
|
|
363
|
-
};
|
|
364
|
-
/**
|
|
365
|
-
* Blend two colors together
|
|
366
|
-
*/
|
|
367
|
-
declare function blendColors(color1: string, color2: string, ratio: number): string;
|
|
368
|
-
|
|
369
|
-
/**
|
|
370
|
-
* Canvas Utility Functions
|
|
371
|
-
*/
|
|
372
|
-
/**
|
|
373
|
-
* Add noise to canvas
|
|
374
|
-
*/
|
|
375
|
-
declare function addNoise(ctx: CanvasRenderingContext2D, amount: number): void;
|
|
376
|
-
/**
|
|
377
|
-
* Clear canvas with optional color
|
|
378
|
-
*/
|
|
379
|
-
declare function clearCanvas(ctx: CanvasRenderingContext2D, color?: string): void;
|
|
380
|
-
/**
|
|
381
|
-
* Save and restore canvas context for isolated transforms
|
|
382
|
-
*/
|
|
383
|
-
declare function withContext<T>(ctx: CanvasRenderingContext2D, fn: (ctx: CanvasRenderingContext2D) => T): T;
|
|
384
|
-
|
|
385
|
-
/**
|
|
386
|
-
* Video Effects API Integration
|
|
387
|
-
*
|
|
388
|
-
* Provides metadata about effects for the API to consume
|
|
389
|
-
*/
|
|
390
|
-
|
|
391
|
-
/**
|
|
392
|
-
* API-compatible effect definition
|
|
393
|
-
*/
|
|
394
|
-
interface VideoEffectApiDefinition {
|
|
395
|
-
id: string;
|
|
396
|
-
name: string;
|
|
397
|
-
type: "effect" | "video-effect";
|
|
398
|
-
category: "essentials" | "glitch" | "retro" | "light" | "motion" | "color" | "body" | "cinematic" | "distortion";
|
|
399
|
-
description: string;
|
|
400
|
-
thumbnail: string;
|
|
401
|
-
renderer: EffectRenderer$1;
|
|
402
|
-
params: EffectParameters;
|
|
403
|
-
parameterSchema: EffectMetadata["parameterSchema"];
|
|
404
|
-
tags: string[];
|
|
405
|
-
isPremium?: boolean;
|
|
406
|
-
intensity: {
|
|
407
|
-
min: number;
|
|
408
|
-
max: number;
|
|
409
|
-
default: number;
|
|
410
|
-
step: number;
|
|
411
|
-
};
|
|
412
|
-
previewUrl?: string;
|
|
413
|
-
previewDuration?: number;
|
|
414
|
-
thumbnailUrl?: string;
|
|
415
|
-
}
|
|
416
|
-
/**
|
|
417
|
-
* Get effect preview URL
|
|
418
|
-
*/
|
|
419
|
-
declare function getEffectPreviewUrl(effectId: string, category: string): string;
|
|
420
|
-
/**
|
|
421
|
-
* Convert effect metadata to API format with preview URL
|
|
422
|
-
*/
|
|
423
|
-
declare function effectMetadataToApi(metadata: EffectMetadata): VideoEffectApiDefinition;
|
|
424
|
-
/**
|
|
425
|
-
* Get all effects in API format
|
|
426
|
-
*/
|
|
427
|
-
declare function getAllEffectsForApi(): VideoEffectApiDefinition[];
|
|
428
|
-
/**
|
|
429
|
-
* Get effects by category in API format
|
|
430
|
-
*/
|
|
431
|
-
declare function getEffectsByCategoryForApi(category: EffectMetadata["category"]): VideoEffectApiDefinition[];
|
|
432
|
-
/**
|
|
433
|
-
* Search effects in API format
|
|
434
|
-
*/
|
|
435
|
-
declare function searchEffectsForApi(query: string): VideoEffectApiDefinition[];
|
|
436
|
-
/**
|
|
437
|
-
* Get effect by ID in API format
|
|
438
|
-
*/
|
|
439
|
-
declare function getEffectByIdForApi(id: string): VideoEffectApiDefinition | null;
|
|
440
|
-
/**
|
|
441
|
-
* Get effect categories summary
|
|
442
|
-
*/
|
|
443
|
-
declare function getEffectCategoriesSummary(): Array<{
|
|
444
|
-
id: string;
|
|
445
|
-
name: string;
|
|
446
|
-
count: number;
|
|
447
|
-
description: string;
|
|
448
|
-
}>;
|
|
449
|
-
/**
|
|
450
|
-
* Generate manifest for all effects
|
|
451
|
-
*/
|
|
452
|
-
declare function generateEffectsManifest(): {
|
|
453
|
-
version: string;
|
|
454
|
-
totalCount: number;
|
|
455
|
-
categories: Array<{
|
|
456
|
-
id: string;
|
|
457
|
-
name: string;
|
|
458
|
-
count: number;
|
|
459
|
-
description: string;
|
|
460
|
-
}>;
|
|
461
|
-
effects: VideoEffectApiDefinition[];
|
|
462
|
-
};
|
|
463
|
-
|
|
464
|
-
/**
|
|
465
|
-
* @clypra-studio/engine — PixiRenderer
|
|
466
|
-
*
|
|
467
|
-
* Manages a single shared PixiJS Application instance.
|
|
468
|
-
* Handles three effect subtypes:
|
|
469
|
-
* - filter → builds filter chain on videoSprite, updates uniforms per frame
|
|
470
|
-
* - motion → calls mount/unmount lifecycle, hooks into Ticker
|
|
471
|
-
* - composite → does both
|
|
472
|
-
*
|
|
473
|
-
* Used by:
|
|
474
|
-
* - Clypra Studio (VideoEffectWorkspace preview canvas)
|
|
475
|
-
* - Clypra Desktop (rasterizer.ts frame compositor)
|
|
476
|
-
*
|
|
477
|
-
* Both environments receive the same canvas output — PixiJS renders into it,
|
|
478
|
-
* then the Desktop rasterizer reads the pixels for FFmpeg.
|
|
479
|
-
*/
|
|
480
|
-
|
|
481
|
-
declare class PixiRenderer {
|
|
482
|
-
private app;
|
|
483
|
-
private videoSprite;
|
|
484
|
-
private transitionSprite;
|
|
485
|
-
private _activeTransition;
|
|
486
|
-
private fromRenderTexture;
|
|
487
|
-
private toRenderTexture;
|
|
488
|
-
private blitSprite;
|
|
489
|
-
private _transitionFromTex;
|
|
490
|
-
private _transitionToTex;
|
|
491
|
-
private overlayContainer;
|
|
492
|
-
private baseMediaContainer;
|
|
493
|
-
private mounted;
|
|
494
|
-
private initialized;
|
|
495
|
-
private initializing;
|
|
496
|
-
private _activeSource;
|
|
497
|
-
private _fitMode;
|
|
498
|
-
/**
|
|
499
|
-
* Initialize the PixiJS Application.
|
|
500
|
-
* Call once, reuse across effect changes.
|
|
501
|
-
*
|
|
502
|
-
* @param canvas The target HTMLCanvasElement (Studio preview or rasterizer offscreen canvas)
|
|
503
|
-
* @param width Canvas width in pixels
|
|
504
|
-
* @param height Canvas height in pixels
|
|
505
|
-
*/
|
|
506
|
-
init(canvas: HTMLCanvasElement, width: number, height: number): Promise<void>;
|
|
507
|
-
setVideoSource(video: HTMLVideoElement): void;
|
|
508
|
-
setImageSource(image: HTMLImageElement | HTMLCanvasElement): void;
|
|
509
|
-
/**
|
|
510
|
-
* Mount a resolved set of PixiJS graph nodes.
|
|
511
|
-
* Builds filter chains and initialises motion effects.
|
|
512
|
-
* Previously mounted effects NOT in the new list are unmounted.
|
|
513
|
-
*/
|
|
514
|
-
applyNodes(nodes: GraphNode[], globalParams?: Map<string, ParamValues>): void;
|
|
515
|
-
/**
|
|
516
|
-
* Update multiple params on a mounted effect in one pass.
|
|
517
|
-
*/
|
|
518
|
-
updateParams(nodeId: string, params: ParamValues): void;
|
|
519
|
-
/**
|
|
520
|
-
* Force a render pass (required for static image previews after uniform changes).
|
|
521
|
-
*/
|
|
522
|
-
render(): void;
|
|
523
|
-
/**
|
|
524
|
-
* Update a single param on a mounted effect.
|
|
525
|
-
* Triggers uniform refresh and calls onParamChange lifecycle hook.
|
|
526
|
-
*/
|
|
527
|
-
updateParam(nodeId: string, key: string, value: number | string | boolean): void;
|
|
528
|
-
/**
|
|
529
|
-
* Capture the current rendered frame as an ImageData.
|
|
530
|
-
* Used by the Desktop rasterizer to extract pixels for FFmpeg.
|
|
531
|
-
*/
|
|
532
|
-
captureFrame(): ImageData | null;
|
|
533
|
-
/**
|
|
534
|
-
* Resize the renderer (e.g. when project resolution changes).
|
|
535
|
-
*/
|
|
536
|
-
resize(width: number, height: number): void;
|
|
537
|
-
setFitMode(mode: "stretch" | "fit" | "crop"): void;
|
|
538
|
-
resizeSprites(): void;
|
|
539
|
-
private _getElementDimensions;
|
|
540
|
-
private _resizeSprite;
|
|
541
|
-
/**
|
|
542
|
-
* Full teardown — unmounts all effects, destroys the PixiJS Application.
|
|
543
|
-
* Call when the editor session ends or the Studio workspace unmounts.
|
|
544
|
-
*/
|
|
545
|
-
destroy(): void;
|
|
546
|
-
private _unmount;
|
|
547
|
-
private _defaultParams;
|
|
548
|
-
getApp(): Application | null;
|
|
549
|
-
getVideoSprite(): Sprite | null;
|
|
550
|
-
getTransitionSprite(): Sprite | null;
|
|
551
|
-
getBaseMediaContainer(): Container | null;
|
|
552
|
-
getOverlayContainer(): Container | null;
|
|
553
|
-
get isReady(): boolean;
|
|
554
|
-
private _ensureRenderTextures;
|
|
555
|
-
private _blitTransitionFrames;
|
|
556
|
-
mountTransition(definition: TransitionDefinition, fromTexture: Texture, toTexture: Texture, params: ParamValues): void;
|
|
557
|
-
getActiveTransitionId(): string | null;
|
|
558
|
-
updateTransitionProgress(id: string, progress: number, params?: ParamValues): void;
|
|
559
|
-
unmountTransition(): void;
|
|
560
|
-
}
|
|
561
|
-
|
|
562
|
-
/**
|
|
563
|
-
* @clypra-studio/engine — example effects
|
|
564
|
-
*
|
|
565
|
-
* Three fully-worked examples covering every PixiJS subtype.
|
|
566
|
-
* Copy these as templates when authoring new effects.
|
|
567
|
-
*
|
|
568
|
-
* 1. NeonGlowEffect — 'filter' — GPU shader, no ticker needed
|
|
569
|
-
* 2. ParticleBurstEffect — 'motion' — ticker-driven animation, no shader
|
|
570
|
-
* 3. VHSCompositeEffect — 'composite' — shader + animated overlay together
|
|
571
|
-
*/
|
|
572
|
-
|
|
573
|
-
declare const NeonGlowEffect: PixiEffectDefinition;
|
|
574
|
-
declare const ParticleBurstEffect: PixiEffectDefinition;
|
|
575
|
-
declare const VHSCompositeEffect: PixiEffectDefinition;
|
|
576
|
-
|
|
577
|
-
declare const example_NeonGlowEffect: typeof NeonGlowEffect;
|
|
578
|
-
declare const example_ParticleBurstEffect: typeof ParticleBurstEffect;
|
|
579
|
-
declare const example_VHSCompositeEffect: typeof VHSCompositeEffect;
|
|
580
|
-
declare namespace example {
|
|
581
|
-
export { example_NeonGlowEffect as NeonGlowEffect, example_ParticleBurstEffect as ParticleBurstEffect, example_VHSCompositeEffect as VHSCompositeEffect };
|
|
582
|
-
}
|
|
583
|
-
|
|
584
|
-
/**
|
|
585
|
-
* Shake Effect
|
|
586
|
-
*/
|
|
587
|
-
|
|
588
|
-
declare function renderShake(ctx: CanvasRenderingContext2D, params: EffectParameters, intensity: number, time: number): void;
|
|
589
|
-
|
|
590
|
-
/**
|
|
591
|
-
* Zoom Effect
|
|
592
|
-
*/
|
|
593
|
-
|
|
594
|
-
declare function renderZoom(ctx: CanvasRenderingContext2D, params: EffectParameters, intensity: number, time: number): void;
|
|
595
|
-
|
|
596
|
-
/**
|
|
597
|
-
* Pan Effect
|
|
598
|
-
*/
|
|
599
|
-
|
|
600
|
-
declare function renderPan(ctx: CanvasRenderingContext2D, params: EffectParameters, intensity: number, time: number): void;
|
|
601
|
-
|
|
602
|
-
/**
|
|
603
|
-
* Rotate Effect
|
|
604
|
-
*/
|
|
605
|
-
|
|
606
|
-
declare function renderRotate(ctx: CanvasRenderingContext2D, params: EffectParameters, intensity: number, time: number): void;
|
|
607
|
-
|
|
608
|
-
/**
|
|
609
|
-
* Dolly Effect
|
|
610
|
-
* Essentially zoom with slight rotation
|
|
611
|
-
*/
|
|
612
|
-
|
|
613
|
-
declare function renderDolly(ctx: CanvasRenderingContext2D, params: EffectParameters, intensity: number, time: number): void;
|
|
614
|
-
|
|
615
|
-
/**
|
|
616
|
-
* Camera Effects Renderers
|
|
617
|
-
*/
|
|
618
|
-
|
|
619
|
-
declare const index$1_renderDolly: typeof renderDolly;
|
|
620
|
-
declare const index$1_renderPan: typeof renderPan;
|
|
621
|
-
declare const index$1_renderRotate: typeof renderRotate;
|
|
622
|
-
declare const index$1_renderShake: typeof renderShake;
|
|
623
|
-
declare const index$1_renderZoom: typeof renderZoom;
|
|
624
|
-
declare namespace index$1 {
|
|
625
|
-
export { index$1_renderDolly as renderDolly, index$1_renderPan as renderPan, index$1_renderRotate as renderRotate, index$1_renderShake as renderShake, index$1_renderZoom as renderZoom };
|
|
626
|
-
}
|
|
627
|
-
|
|
628
|
-
/**
|
|
629
|
-
* Light Leak Effect
|
|
630
|
-
*/
|
|
631
|
-
|
|
632
|
-
declare function renderLightLeak(ctx: CanvasRenderingContext2D, params: EffectParameters, intensity: number, time: number): void;
|
|
633
|
-
|
|
634
|
-
/**
|
|
635
|
-
* Light Leak 2 Effect
|
|
636
|
-
* Animated red/orange light that moves from bottom-left → bottom-right → top-right
|
|
637
|
-
*/
|
|
638
|
-
|
|
639
|
-
declare function renderLightLeak2(ctx: CanvasRenderingContext2D, params: EffectParameters, intensity: number, time: number): void;
|
|
640
|
-
|
|
641
|
-
/**
|
|
642
|
-
* Flash Effect
|
|
643
|
-
*/
|
|
644
|
-
|
|
645
|
-
declare function renderFlash(ctx: CanvasRenderingContext2D, params: EffectParameters, intensity: number, time: number): void;
|
|
646
|
-
|
|
647
|
-
/**
|
|
648
|
-
* Flicker Effect
|
|
649
|
-
*/
|
|
650
|
-
|
|
651
|
-
declare function renderFlicker(ctx: CanvasRenderingContext2D, params: EffectParameters, intensity: number, time: number): void;
|
|
652
|
-
|
|
653
|
-
/**
|
|
654
|
-
* Vignette Effect
|
|
655
|
-
*/
|
|
656
|
-
|
|
657
|
-
declare function renderVignette(ctx: CanvasRenderingContext2D, params: EffectParameters, intensity: number, time: number): void;
|
|
658
|
-
|
|
659
|
-
/**
|
|
660
|
-
* Glow Effect
|
|
661
|
-
*/
|
|
662
|
-
|
|
663
|
-
declare function renderGlow(ctx: CanvasRenderingContext2D, params: EffectParameters, intensity: number, time: number): void;
|
|
664
|
-
|
|
665
|
-
/**
|
|
666
|
-
* Fire Effect Renderer
|
|
667
|
-
* Creates animated fire effects with particles and heat distortion
|
|
668
|
-
*/
|
|
669
|
-
|
|
670
|
-
declare function renderFire(ctx: CanvasRenderingContext2D, params: EffectParameters, intensity: number, time: number): void;
|
|
671
|
-
|
|
672
|
-
/**
|
|
673
|
-
* Particles Effect Renderer
|
|
674
|
-
* Creates floating particles with various behaviors
|
|
675
|
-
*/
|
|
676
|
-
|
|
677
|
-
declare function renderParticles(ctx: CanvasRenderingContext2D, params: EffectParameters, intensity: number, time: number): void;
|
|
678
|
-
declare function renderDustParticles(ctx: CanvasRenderingContext2D, params: EffectParameters, intensity: number, time: number): void;
|
|
679
|
-
|
|
680
|
-
/**
|
|
681
|
-
* Light Effects Renderers
|
|
682
|
-
*/
|
|
683
|
-
|
|
684
|
-
declare const index_renderDustParticles: typeof renderDustParticles;
|
|
685
|
-
declare const index_renderFire: typeof renderFire;
|
|
686
|
-
declare const index_renderFlash: typeof renderFlash;
|
|
687
|
-
declare const index_renderFlicker: typeof renderFlicker;
|
|
688
|
-
declare const index_renderGlow: typeof renderGlow;
|
|
689
|
-
declare const index_renderLightLeak: typeof renderLightLeak;
|
|
690
|
-
declare const index_renderLightLeak2: typeof renderLightLeak2;
|
|
691
|
-
declare const index_renderParticles: typeof renderParticles;
|
|
692
|
-
declare const index_renderVignette: typeof renderVignette;
|
|
693
|
-
declare namespace index {
|
|
694
|
-
export { index_renderDustParticles as renderDustParticles, index_renderFire as renderFire, index_renderFlash as renderFlash, index_renderFlicker as renderFlicker, index_renderGlow as renderGlow, index_renderLightLeak as renderLightLeak, index_renderLightLeak2 as renderLightLeak2, index_renderParticles as renderParticles, index_renderVignette as renderVignette };
|
|
695
|
-
}
|
|
696
|
-
|
|
697
|
-
export { type AppliedEffect, type AppliedOverlay, type BlendMode, index$1 as CameraEffects, EFFECTS_REGISTRY, type EffectCategory, EffectDefinition, EffectEngine, EffectGraph, type EffectMetadata, type EffectParameters, type EffectPreset, EffectRenderer, type EffectRenderer$1 as EffectRendererType, example as ExamplePixiEffects, type FilterAsset, type GraphDefinition, index as LightEffects, type OverlayAsset, ParamValues, PixiEffectDefinition, PixiRenderer, type VideoEffectApiDefinition, type VideoEffectCategory, type VideoEffectItem, type VideoEffectManifest, type VideoEffectState, addNoise, blendColors, clearCanvas, effectMetadataToApi, generateEffectsManifest, getAllEffectsForApi, getEffectByIdForApi, getEffectCategoriesSummary, getEffectMetadata, getEffectPreviewUrl, getEffectRenderer, getEffectsByCategory, getEffectsByCategoryForApi, hexToRgba, rgbaToComponents, searchEffects, searchEffectsForApi, withContext };
|