@remotion/effects 4.0.469 → 4.0.470

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.
@@ -0,0 +1,28 @@
1
+ export type FisheyeState = {
2
+ gl: WebGL2RenderingContext;
3
+ program: WebGLProgram;
4
+ vao: WebGLVertexArrayObject;
5
+ vbo: WebGLBuffer;
6
+ textureSource: WebGLTexture;
7
+ uniforms: {
8
+ uSource: WebGLUniformLocation | null;
9
+ uCenter: WebGLUniformLocation | null;
10
+ uFieldOfView: WebGLUniformLocation | null;
11
+ uRadius: WebGLUniformLocation | null;
12
+ uZoom: WebGLUniformLocation | null;
13
+ uAspect: WebGLUniformLocation | null;
14
+ };
15
+ };
16
+ export declare const setupFisheye: (target: HTMLCanvasElement) => FisheyeState;
17
+ export declare const cleanupFisheye: (state: FisheyeState) => void;
18
+ export declare const applyFisheye: ({ state, source, width, height, center, fieldOfView, radius, zoom, flipSourceY, }: {
19
+ readonly state: FisheyeState;
20
+ readonly source: CanvasImageSource;
21
+ readonly width: number;
22
+ readonly height: number;
23
+ readonly center: readonly [number, number];
24
+ readonly fieldOfView: number;
25
+ readonly radius: number;
26
+ readonly zoom: number;
27
+ readonly flipSourceY: boolean;
28
+ }) => void;
@@ -0,0 +1,2 @@
1
+ export declare const FISHEYE_VS = "#version 300 es\nlayout(location = 0) in vec2 aPos;\nlayout(location = 1) in vec2 aUv;\nout vec2 vUv;\nvoid main() {\n\tvUv = aUv;\n\tgl_Position = vec4(aPos, 0.0, 1.0);\n}\n";
2
+ export declare const FISHEYE_FS = "#version 300 es\nprecision highp float;\nin vec2 vUv;\nout vec4 fragColor;\n\nuniform sampler2D uSource;\nuniform vec2 uCenter;\nuniform float uFieldOfView;\nuniform float uRadius;\nuniform float uZoom;\nuniform float uAspect;\n\nvoid main() {\n\tvec2 toCenter = vUv - uCenter;\n\tvec2 aspectCorrected = vec2(toCenter.x * uAspect, toCenter.y);\n\n\tfloat dist = length(aspectCorrected);\n\tfloat r = dist / max(uRadius, 0.0001);\n\n\tif (r > 1.0 || uFieldOfView <= 0.0001) {\n\t\tfragColor = vec4(0.0);\n\t\treturn;\n\t}\n\n\tfloat halfFov = uFieldOfView * 0.5;\n\tfloat warped = tan(r * halfFov) / tan(halfFov);\n\n\tfloat scale = (dist > 0.00001) ? (warped * uRadius / dist) : 0.0;\n\tvec2 warpedAspect = aspectCorrected * scale;\n\tvec2 warpedOffset = vec2(warpedAspect.x / uAspect, warpedAspect.y);\n\twarpedOffset /= max(uZoom, 0.0001);\n\n\tvec2 srcUv = uCenter + warpedOffset;\n\n\tif (\n\t\tsrcUv.x < 0.0 ||\n\t\tsrcUv.x > 1.0 ||\n\t\tsrcUv.y < 0.0 ||\n\t\tsrcUv.y > 1.0\n\t) {\n\t\tfragColor = vec4(0.0);\n\t\treturn;\n\t}\n\n\tfragColor = texture(uSource, srcUv);\n}\n";
@@ -0,0 +1,26 @@
1
+ export type FisheyeUvCoordinate = readonly [number, number];
2
+ export type FisheyeParams = {
3
+ /**
4
+ * Lens field of view in radians, from `0` to `Math.PI`.
5
+ * Higher values produce a stronger fisheye distortion.
6
+ * Defaults to `2.5` (approx. 143°).
7
+ */
8
+ readonly fieldOfView?: number;
9
+ /**
10
+ * Center of the lens in UV coordinates. Defaults to `[0.5, 0.5]`.
11
+ */
12
+ readonly center?: FisheyeUvCoordinate;
13
+ /**
14
+ * Radius of the lens area, in normalized half-height units.
15
+ * `1` covers the full vertical area. Defaults to `1`.
16
+ */
17
+ readonly radius?: number;
18
+ /**
19
+ * Post-warp zoom factor. Values above `1` zoom in, below `1` zoom out.
20
+ * Defaults to `1`.
21
+ */
22
+ readonly zoom?: number;
23
+ };
24
+ export declare const fisheye: (params?: (FisheyeParams & {
25
+ readonly disabled?: boolean | undefined;
26
+ }) | undefined) => import("remotion").EffectDescriptor<unknown>;
@@ -0,0 +1 @@
1
+ export { fisheye, type FisheyeParams } from './fisheye/index.js';
@@ -0,0 +1,61 @@
1
+ declare const LINE_DIRECTIONS: readonly ["horizontal", "vertical"];
2
+ export declare const linesSchema: {
3
+ readonly direction: {
4
+ readonly type: "enum";
5
+ readonly variants: {
6
+ readonly horizontal: {};
7
+ readonly vertical: {};
8
+ };
9
+ readonly default: "horizontal";
10
+ readonly description: "Direction";
11
+ };
12
+ readonly thickness: {
13
+ readonly type: "number";
14
+ readonly min: 0.1;
15
+ readonly max: 400;
16
+ readonly step: 0.1;
17
+ readonly default: 40;
18
+ readonly description: "Thickness";
19
+ };
20
+ readonly gap: {
21
+ readonly type: "number";
22
+ readonly min: 0;
23
+ readonly max: 400;
24
+ readonly step: 0.1;
25
+ readonly default: 0;
26
+ readonly description: "Gap";
27
+ };
28
+ readonly angle: {
29
+ readonly type: "number";
30
+ readonly min: -180;
31
+ readonly max: 180;
32
+ readonly step: 1;
33
+ readonly default: 0;
34
+ readonly description: "Angle";
35
+ };
36
+ readonly offset: {
37
+ readonly type: "number";
38
+ readonly step: 0.1;
39
+ readonly default: 0;
40
+ readonly description: "Offset";
41
+ };
42
+ };
43
+ export type LinesDirection = (typeof LINE_DIRECTIONS)[number];
44
+ export type LinesParams = {
45
+ /** Stripe colors, assigned cyclically. Defaults to light blue and transparent. */
46
+ readonly colors?: readonly string[];
47
+ /** Line direction. Defaults to `horizontal`. */
48
+ readonly direction?: LinesDirection;
49
+ /** Thickness of each stripe in pixels. Defaults to `40`. */
50
+ readonly thickness?: number;
51
+ /** Transparent gap in pixels between each stripe. Defaults to `0` (stripes are packed solid). */
52
+ readonly gap?: number;
53
+ /** Rotates the line pattern in degrees. Defaults to `0`. */
54
+ readonly angle?: number;
55
+ /** Offset in pixels. Animate this value to scroll the lines. Defaults to `0`. */
56
+ readonly offset?: number;
57
+ };
58
+ export declare const lines: (params?: (LinesParams & {
59
+ readonly disabled?: boolean | undefined;
60
+ }) | undefined) => import("remotion").EffectDescriptor<unknown>;
61
+ export {};
@@ -0,0 +1,15 @@
1
+ export type ScanlinesParams = {
2
+ /** Strength of the scanline modulation from `0` to `1`. Defaults to `0.15`. */
3
+ readonly amount?: number;
4
+ /** Distance between scanlines in pixels. Defaults to `4`. */
5
+ readonly spacing?: number;
6
+ /** Thickness of each scanline in pixels. Defaults to `1`. */
7
+ readonly thickness?: number;
8
+ /** Vertical offset in pixels. Animate this value to scroll the scanlines. Defaults to `0`. */
9
+ readonly offset?: number;
10
+ /** Multiply the scanline contribution with the input colors before blending. Defaults to `false`. */
11
+ readonly premultiply?: boolean;
12
+ };
13
+ export declare const scanlines: (params?: (ScanlinesParams & {
14
+ readonly disabled?: boolean | undefined;
15
+ }) | undefined) => import("remotion").EffectDescriptor<unknown>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,13 @@
1
+ import { type EffectDefinitionAndStack, type EffectDescriptor } from 'remotion';
2
+ export declare const testImage: ({ blob, testId, threshold, allowedMismatchedPixelRatio, }: {
3
+ blob: Blob;
4
+ testId: string;
5
+ threshold?: number | undefined;
6
+ allowedMismatchedPixelRatio?: number | undefined;
7
+ }) => Promise<void>;
8
+ export declare const descriptorsToMemoizedEffects: (effects: EffectDescriptor<unknown>[]) => EffectDefinitionAndStack<unknown>[];
9
+ export declare const renderEffectChainToBlob: ({ effects, width, height, }: {
10
+ effects: EffectDefinitionAndStack<unknown>[];
11
+ width?: number | undefined;
12
+ height?: number | undefined;
13
+ }) => Promise<Blob>;
@@ -0,0 +1,9 @@
1
+ export type WhiteNoiseParams = {
2
+ /** Blend amount from `0` to `1`. Defaults to `1`. */
3
+ readonly amount?: number;
4
+ /** Seed for the random noise pattern. Defaults to `0`. */
5
+ readonly seed?: number;
6
+ };
7
+ export declare const whiteNoise: (params?: (WhiteNoiseParams & {
8
+ readonly disabled?: boolean | undefined;
9
+ }) | undefined) => import("remotion").EffectDescriptor<unknown>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/effects",
3
- "version": "4.0.469",
3
+ "version": "4.0.470",
4
4
  "description": "Effects that can be applied to Remotion-based canvas components",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -11,6 +11,8 @@
11
11
  "type": "module",
12
12
  "scripts": {
13
13
  "test": "bun test src/test",
14
+ "testvisual": "vitest src/visual-test/effects-visual.test.ts",
15
+ "testeffectsvisual": "vitest src/visual-test/effects-visual.test.ts --browser --run",
14
16
  "formatting": "oxfmt src --check",
15
17
  "format": "oxfmt src",
16
18
  "lint": "eslint src",
@@ -24,7 +26,7 @@
24
26
  "url": "https://github.com/remotion-dev/remotion/issues"
25
27
  },
26
28
  "dependencies": {
27
- "remotion": "4.0.469"
29
+ "remotion": "4.0.470"
28
30
  },
29
31
  "exports": {
30
32
  ".": {
@@ -67,6 +69,16 @@
67
69
  "module": "./dist/esm/duotone.mjs",
68
70
  "import": "./dist/esm/duotone.mjs"
69
71
  },
72
+ "./evolve": {
73
+ "types": "./dist/evolve.d.ts",
74
+ "module": "./dist/esm/evolve.mjs",
75
+ "import": "./dist/esm/evolve.mjs"
76
+ },
77
+ "./fisheye": {
78
+ "types": "./dist/fisheye.d.ts",
79
+ "module": "./dist/esm/fisheye.mjs",
80
+ "import": "./dist/esm/fisheye.mjs"
81
+ },
70
82
  "./glow": {
71
83
  "types": "./dist/glow.d.ts",
72
84
  "module": "./dist/esm/glow.mjs",
@@ -97,6 +109,11 @@
97
109
  "module": "./dist/esm/invert.mjs",
98
110
  "import": "./dist/esm/invert.mjs"
99
111
  },
112
+ "./lines": {
113
+ "types": "./dist/lines.d.ts",
114
+ "module": "./dist/esm/lines.mjs",
115
+ "import": "./dist/esm/lines.mjs"
116
+ },
100
117
  "./dot-grid": {
101
118
  "types": "./dist/dot-grid.d.ts",
102
119
  "module": "./dist/esm/dot-grid.mjs",
@@ -117,6 +134,11 @@
117
134
  "module": "./dist/esm/saturation.mjs",
118
135
  "import": "./dist/esm/saturation.mjs"
119
136
  },
137
+ "./scanlines": {
138
+ "types": "./dist/scanlines.d.ts",
139
+ "module": "./dist/esm/scanlines.mjs",
140
+ "import": "./dist/esm/scanlines.mjs"
141
+ },
120
142
  "./scale": {
121
143
  "types": "./dist/scale.d.ts",
122
144
  "module": "./dist/esm/scale.mjs",
@@ -152,6 +174,11 @@
152
174
  "module": "./dist/esm/wave.mjs",
153
175
  "import": "./dist/esm/wave.mjs"
154
176
  },
177
+ "./white-noise": {
178
+ "types": "./dist/white-noise.d.ts",
179
+ "module": "./dist/esm/white-noise.mjs",
180
+ "import": "./dist/esm/white-noise.mjs"
181
+ },
155
182
  "./package.json": "./package.json"
156
183
  },
157
184
  "typesVersions": {
@@ -177,6 +204,12 @@
177
204
  "duotone": [
178
205
  "dist/duotone.d.ts"
179
206
  ],
207
+ "evolve": [
208
+ "dist/evolve.d.ts"
209
+ ],
210
+ "fisheye": [
211
+ "dist/fisheye.d.ts"
212
+ ],
180
213
  "glow": [
181
214
  "dist/glow.d.ts"
182
215
  ],
@@ -195,6 +228,9 @@
195
228
  "invert": [
196
229
  "dist/invert.d.ts"
197
230
  ],
231
+ "lines": [
232
+ "dist/lines.d.ts"
233
+ ],
198
234
  "dot-grid": [
199
235
  "dist/dot-grid.d.ts"
200
236
  ],
@@ -207,6 +243,9 @@
207
243
  "saturation": [
208
244
  "dist/saturation.d.ts"
209
245
  ],
246
+ "scanlines": [
247
+ "dist/scanlines.d.ts"
248
+ ],
210
249
  "scale": [
211
250
  "dist/scale.d.ts"
212
251
  ],
@@ -227,13 +266,18 @@
227
266
  ],
228
267
  "wave": [
229
268
  "dist/wave.d.ts"
269
+ ],
270
+ "white-noise": [
271
+ "dist/white-noise.d.ts"
230
272
  ]
231
273
  }
232
274
  },
233
275
  "homepage": "https://www.remotion.dev/docs/effects/api",
234
276
  "devDependencies": {
235
- "@remotion/eslint-config-internal": "4.0.469",
277
+ "@remotion/eslint-config-internal": "4.0.470",
278
+ "@vitest/browser-playwright": "4.0.9",
236
279
  "eslint": "9.19.0",
280
+ "vitest": "4.0.9",
237
281
  "@typescript/native-preview": "7.0.0-dev.20260217.1"
238
282
  },
239
283
  "keywords": [