@clypra-studio/engine 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{TransitionDefinition-CC6oSTYB.d.cts → TransitionDefinition-CQoSb4ZB.d.cts} +9 -9
- package/dist/{TransitionDefinition-CC6oSTYB.d.ts → TransitionDefinition-CQoSb4ZB.d.ts} +9 -9
- package/dist/{chunk-LGW5SSLZ.js → chunk-2VGI6ZB7.js} +2 -7
- package/dist/chunk-2VGI6ZB7.js.map +1 -0
- package/dist/{chunk-AUMNXFYQ.js → chunk-4PKBLJ34.js} +1 -1
- package/dist/chunk-4PKBLJ34.js.map +1 -0
- package/dist/{chunk-4Y7ZSGHJ.js → chunk-FIJBB3MH.js} +1 -1
- package/dist/chunk-FIJBB3MH.js.map +1 -0
- package/dist/{index-BP1N8Yg7.d.cts → index-Da47I6aX.d.cts} +3 -3
- package/dist/{index-BP1N8Yg7.d.ts → index-Da47I6aX.d.ts} +3 -3
- package/dist/index.cjs +28 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -13
- package/dist/index.d.ts +13 -13
- package/dist/index.js +69 -45
- package/dist/index.js.map +1 -1
- package/dist/transitions/index.cjs.map +1 -1
- package/dist/transitions/index.d.cts +5 -5
- package/dist/transitions/index.d.ts +5 -5
- package/dist/transitions/index.js +1 -1
- package/dist/v2/backends/index.cjs.map +1 -1
- package/dist/v2/backends/index.d.cts +1 -1
- package/dist/v2/backends/index.d.ts +1 -1
- package/dist/v2/backends/index.js +1 -1
- package/dist/v2/contract/index.d.cts +12 -12
- package/dist/v2/contract/index.d.ts +12 -12
- package/dist/videoEffects/index.cjs +1 -6
- package/dist/videoEffects/index.cjs.map +1 -1
- package/dist/videoEffects/index.d.cts +5 -6
- package/dist/videoEffects/index.d.ts +5 -6
- package/dist/videoEffects/index.js +1 -1
- package/package.json +12 -12
- package/LICENSE +0 -9
- package/dist/chunk-4Y7ZSGHJ.js.map +0 -1
- package/dist/chunk-AUMNXFYQ.js.map +0 -1
- package/dist/chunk-LGW5SSLZ.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Filter, Application, Container, Ticker, Texture } from 'pixi.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* @clypra/engine — EffectDefinition
|
|
4
|
+
* @clypra-studio/engine — EffectDefinition
|
|
5
5
|
*
|
|
6
6
|
* Unified type system for all Clypra video effects.
|
|
7
7
|
* Supports two rendering backends:
|
|
@@ -12,7 +12,7 @@ import { Filter, Application, Container, Ticker, Texture } from 'pixi.js';
|
|
|
12
12
|
* The Studio and Desktop Editor import from this single package — same code, same output.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
type ParamType =
|
|
15
|
+
type ParamType = "range" | "color" | "toggle" | "select" | "text";
|
|
16
16
|
interface ParamSchema {
|
|
17
17
|
key: string;
|
|
18
18
|
label: string;
|
|
@@ -24,7 +24,7 @@ interface ParamSchema {
|
|
|
24
24
|
options?: string[];
|
|
25
25
|
}
|
|
26
26
|
type ParamValues = Record<string, number | string | boolean>;
|
|
27
|
-
type EffectCategory =
|
|
27
|
+
type EffectCategory = "light" | "glitch" | "cinematic" | "neon" | "retro" | "motion" | "color" | "blur" | "distortion" | "particle" | "custom";
|
|
28
28
|
interface Canvas2DEngine {
|
|
29
29
|
/** Advance internal animation state by N steps */
|
|
30
30
|
advanceSteps(steps: number): void;
|
|
@@ -33,7 +33,7 @@ interface Canvas2DEngine {
|
|
|
33
33
|
}
|
|
34
34
|
type Canvas2DEngineConstructor = new (config: ParamValues) => Canvas2DEngine;
|
|
35
35
|
interface Canvas2DEffectDefinition {
|
|
36
|
-
backend:
|
|
36
|
+
backend: "canvas2d";
|
|
37
37
|
id: string;
|
|
38
38
|
name: string;
|
|
39
39
|
category: EffectCategory;
|
|
@@ -56,7 +56,7 @@ interface Canvas2DEffectDefinition {
|
|
|
56
56
|
*
|
|
57
57
|
* 'composite' — combines filter + motion in one effect (e.g. neon glow + particle burst).
|
|
58
58
|
*/
|
|
59
|
-
type PixiEffectSubtype =
|
|
59
|
+
type PixiEffectSubtype = "filter" | "motion" | "composite";
|
|
60
60
|
/** Context passed to every PixiJS effect lifecycle method */
|
|
61
61
|
interface PixiEffectContext {
|
|
62
62
|
/** The PixiJS Application instance (shared, do not destroy) */
|
|
@@ -87,7 +87,7 @@ interface PixiFilterSpec {
|
|
|
87
87
|
updateUniforms?: (filter: Filter | Filter[], params: ParamValues, elapsed: number) => void;
|
|
88
88
|
}
|
|
89
89
|
interface PixiEffectDefinition {
|
|
90
|
-
backend:
|
|
90
|
+
backend: "pixi";
|
|
91
91
|
subtype: PixiEffectSubtype;
|
|
92
92
|
id: string;
|
|
93
93
|
name: string;
|
|
@@ -116,13 +116,13 @@ type EffectDefinition = Canvas2DEffectDefinition | PixiEffectDefinition;
|
|
|
116
116
|
declare function isCanvas2DEffect(e: EffectDefinition): e is Canvas2DEffectDefinition;
|
|
117
117
|
declare function isPixiEffect(e: EffectDefinition): e is PixiEffectDefinition;
|
|
118
118
|
declare function isFilterEffect(e: EffectDefinition): e is PixiEffectDefinition & {
|
|
119
|
-
subtype:
|
|
119
|
+
subtype: "filter";
|
|
120
120
|
};
|
|
121
121
|
declare function isMotionEffect(e: EffectDefinition): e is PixiEffectDefinition & {
|
|
122
|
-
subtype:
|
|
122
|
+
subtype: "motion";
|
|
123
123
|
};
|
|
124
124
|
declare function isCompositeEffect(e: EffectDefinition): e is PixiEffectDefinition & {
|
|
125
|
-
subtype:
|
|
125
|
+
subtype: "composite";
|
|
126
126
|
};
|
|
127
127
|
|
|
128
128
|
type GPUEffectTransitionCategory = 'geometric' | 'optical-distortion' | 'temporal' | 'particle-dissolve' | 'light-based' | 'depth-based' | 'physics-simulated';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Filter, Application, Container, Ticker, Texture } from 'pixi.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* @clypra/engine — EffectDefinition
|
|
4
|
+
* @clypra-studio/engine — EffectDefinition
|
|
5
5
|
*
|
|
6
6
|
* Unified type system for all Clypra video effects.
|
|
7
7
|
* Supports two rendering backends:
|
|
@@ -12,7 +12,7 @@ import { Filter, Application, Container, Ticker, Texture } from 'pixi.js';
|
|
|
12
12
|
* The Studio and Desktop Editor import from this single package — same code, same output.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
type ParamType =
|
|
15
|
+
type ParamType = "range" | "color" | "toggle" | "select" | "text";
|
|
16
16
|
interface ParamSchema {
|
|
17
17
|
key: string;
|
|
18
18
|
label: string;
|
|
@@ -24,7 +24,7 @@ interface ParamSchema {
|
|
|
24
24
|
options?: string[];
|
|
25
25
|
}
|
|
26
26
|
type ParamValues = Record<string, number | string | boolean>;
|
|
27
|
-
type EffectCategory =
|
|
27
|
+
type EffectCategory = "light" | "glitch" | "cinematic" | "neon" | "retro" | "motion" | "color" | "blur" | "distortion" | "particle" | "custom";
|
|
28
28
|
interface Canvas2DEngine {
|
|
29
29
|
/** Advance internal animation state by N steps */
|
|
30
30
|
advanceSteps(steps: number): void;
|
|
@@ -33,7 +33,7 @@ interface Canvas2DEngine {
|
|
|
33
33
|
}
|
|
34
34
|
type Canvas2DEngineConstructor = new (config: ParamValues) => Canvas2DEngine;
|
|
35
35
|
interface Canvas2DEffectDefinition {
|
|
36
|
-
backend:
|
|
36
|
+
backend: "canvas2d";
|
|
37
37
|
id: string;
|
|
38
38
|
name: string;
|
|
39
39
|
category: EffectCategory;
|
|
@@ -56,7 +56,7 @@ interface Canvas2DEffectDefinition {
|
|
|
56
56
|
*
|
|
57
57
|
* 'composite' — combines filter + motion in one effect (e.g. neon glow + particle burst).
|
|
58
58
|
*/
|
|
59
|
-
type PixiEffectSubtype =
|
|
59
|
+
type PixiEffectSubtype = "filter" | "motion" | "composite";
|
|
60
60
|
/** Context passed to every PixiJS effect lifecycle method */
|
|
61
61
|
interface PixiEffectContext {
|
|
62
62
|
/** The PixiJS Application instance (shared, do not destroy) */
|
|
@@ -87,7 +87,7 @@ interface PixiFilterSpec {
|
|
|
87
87
|
updateUniforms?: (filter: Filter | Filter[], params: ParamValues, elapsed: number) => void;
|
|
88
88
|
}
|
|
89
89
|
interface PixiEffectDefinition {
|
|
90
|
-
backend:
|
|
90
|
+
backend: "pixi";
|
|
91
91
|
subtype: PixiEffectSubtype;
|
|
92
92
|
id: string;
|
|
93
93
|
name: string;
|
|
@@ -116,13 +116,13 @@ type EffectDefinition = Canvas2DEffectDefinition | PixiEffectDefinition;
|
|
|
116
116
|
declare function isCanvas2DEffect(e: EffectDefinition): e is Canvas2DEffectDefinition;
|
|
117
117
|
declare function isPixiEffect(e: EffectDefinition): e is PixiEffectDefinition;
|
|
118
118
|
declare function isFilterEffect(e: EffectDefinition): e is PixiEffectDefinition & {
|
|
119
|
-
subtype:
|
|
119
|
+
subtype: "filter";
|
|
120
120
|
};
|
|
121
121
|
declare function isMotionEffect(e: EffectDefinition): e is PixiEffectDefinition & {
|
|
122
|
-
subtype:
|
|
122
|
+
subtype: "motion";
|
|
123
123
|
};
|
|
124
124
|
declare function isCompositeEffect(e: EffectDefinition): e is PixiEffectDefinition & {
|
|
125
|
-
subtype:
|
|
125
|
+
subtype: "composite";
|
|
126
126
|
};
|
|
127
127
|
|
|
128
128
|
type GPUEffectTransitionCategory = 'geometric' | 'optical-distortion' | 'temporal' | 'particle-dissolve' | 'light-based' | 'depth-based' | 'physics-simulated';
|
|
@@ -2465,10 +2465,7 @@ var PixiRenderer = class {
|
|
|
2465
2465
|
const scale = fitMode === "fit" ? Math.min(scaleX, scaleY) : Math.max(scaleX, scaleY);
|
|
2466
2466
|
sprite.width = texWidth * scale;
|
|
2467
2467
|
sprite.height = texHeight * scale;
|
|
2468
|
-
sprite.position.set(
|
|
2469
|
-
(canvasWidth - sprite.width) / 2,
|
|
2470
|
-
(canvasHeight - sprite.height) / 2
|
|
2471
|
-
);
|
|
2468
|
+
sprite.position.set((canvasWidth - sprite.width) / 2, (canvasHeight - sprite.height) / 2);
|
|
2472
2469
|
}
|
|
2473
2470
|
}
|
|
2474
2471
|
/**
|
|
@@ -2793,7 +2790,6 @@ var ParticleBurstEffect = {
|
|
|
2793
2790
|
{ key: "fade", label: "Fade out", type: "toggle", value: true }
|
|
2794
2791
|
],
|
|
2795
2792
|
mount(ctx) {
|
|
2796
|
-
;
|
|
2797
2793
|
ctx._particleContainer = new Container2();
|
|
2798
2794
|
ctx.container.addChild(ctx._particleContainer);
|
|
2799
2795
|
const particles = [];
|
|
@@ -2950,7 +2946,6 @@ var VHSCompositeEffect = {
|
|
|
2950
2946
|
draw();
|
|
2951
2947
|
ctx.container.addChild(band);
|
|
2952
2948
|
ctx._tickerFn = (ticker) => {
|
|
2953
|
-
;
|
|
2954
2949
|
ctx._bandY += ctx.params.bandSpeed * ticker.deltaTime;
|
|
2955
2950
|
if (ctx._bandY > ctx.height + 20) ctx._bandY = -20;
|
|
2956
2951
|
draw();
|
|
@@ -3054,4 +3049,4 @@ export {
|
|
|
3054
3049
|
example_exports,
|
|
3055
3050
|
camera_exports
|
|
3056
3051
|
};
|
|
3057
|
-
//# sourceMappingURL=chunk-
|
|
3052
|
+
//# sourceMappingURL=chunk-2VGI6ZB7.js.map
|