@remotion/effects 4.0.460 → 4.0.461
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/esm/index.mjs +25 -5
- package/package.json +3 -3
package/dist/esm/index.mjs
CHANGED
|
@@ -185,6 +185,7 @@ var blurHorizontalDef = defineEffect({
|
|
|
185
185
|
type: "remotion/blur-horizontal",
|
|
186
186
|
label: "Blur (horizontal)",
|
|
187
187
|
backend: "webgl2",
|
|
188
|
+
calculateKey: (params) => String(params.radius),
|
|
188
189
|
setup: (target) => setupBlur(target, BLUR_FS_HORIZONTAL),
|
|
189
190
|
apply: ({ source, width, height, params, state }) => {
|
|
190
191
|
applyBlur(state, source, width, height, params.radius);
|
|
@@ -201,6 +202,7 @@ var blurVerticalDef = defineEffect2({
|
|
|
201
202
|
type: "remotion/blur-vertical",
|
|
202
203
|
label: "Blur (vertical)",
|
|
203
204
|
backend: "webgl2",
|
|
205
|
+
calculateKey: (params) => String(params.radius),
|
|
204
206
|
setup: (target) => setupBlur(target, BLUR_FS_VERTICAL),
|
|
205
207
|
apply: ({ source, width, height, params, state }) => {
|
|
206
208
|
applyBlur(state, source, width, height, params.radius);
|
|
@@ -400,6 +402,10 @@ var halftoneDef = defineEffect3({
|
|
|
400
402
|
type: "remotion/halftone",
|
|
401
403
|
label: "Halftone",
|
|
402
404
|
backend: "webgl2",
|
|
405
|
+
calculateKey: (params) => {
|
|
406
|
+
const r = resolve(params);
|
|
407
|
+
return `halftone-${r.shape}-${r.dotSize}-${r.dotSpacing}-${r.rotation}-${r.offsetX}-${r.offsetY}-${r.sampling}-${r.color}-${r.shadeOutside ? 1 : 0}`;
|
|
408
|
+
},
|
|
403
409
|
setup: (target) => {
|
|
404
410
|
const gl = target.getContext("webgl2", {
|
|
405
411
|
premultipliedAlpha: true,
|
|
@@ -541,34 +547,44 @@ var halftone = (params = {}) => createDescriptor3(halftoneDef, params);
|
|
|
541
547
|
// src/tint.ts
|
|
542
548
|
import { Internals as Internals4 } from "remotion";
|
|
543
549
|
var { createDescriptor: createDescriptor4, defineEffect: defineEffect4 } = Internals4;
|
|
550
|
+
var DEFAULT_AMOUNT = 0.5;
|
|
544
551
|
var tintSchema = {
|
|
545
552
|
amount: {
|
|
546
553
|
type: "number",
|
|
547
554
|
min: 0,
|
|
548
555
|
max: 1,
|
|
549
556
|
step: 0.01,
|
|
550
|
-
default:
|
|
557
|
+
default: DEFAULT_AMOUNT,
|
|
551
558
|
description: "Amount"
|
|
552
559
|
}
|
|
553
560
|
};
|
|
561
|
+
var resolve2 = (p) => ({
|
|
562
|
+
color: p.color,
|
|
563
|
+
amount: p.amount ?? DEFAULT_AMOUNT
|
|
564
|
+
});
|
|
554
565
|
var tintDef = defineEffect4({
|
|
555
566
|
type: "remotion/tint",
|
|
556
567
|
label: "Tint",
|
|
557
568
|
backend: "2d",
|
|
569
|
+
calculateKey: (params) => {
|
|
570
|
+
const r = resolve2(params);
|
|
571
|
+
return `tint-${r.color}-${r.amount}`;
|
|
572
|
+
},
|
|
558
573
|
setup: () => null,
|
|
559
574
|
apply: ({ source, target, width, height, params }) => {
|
|
560
575
|
const ctx = target.getContext("2d");
|
|
561
576
|
if (!ctx) {
|
|
562
577
|
throw new Error("Failed to acquire 2D context for tint effect. The canvas may have been assigned a different context type.");
|
|
563
578
|
}
|
|
564
|
-
const
|
|
579
|
+
const r = resolve2(params);
|
|
580
|
+
const amount = Math.max(0, Math.min(1, r.amount));
|
|
565
581
|
ctx.clearRect(0, 0, width, height);
|
|
566
582
|
ctx.globalAlpha = 1;
|
|
567
583
|
ctx.globalCompositeOperation = "source-over";
|
|
568
584
|
ctx.drawImage(source, 0, 0, width, height);
|
|
569
585
|
ctx.globalAlpha = amount;
|
|
570
586
|
ctx.globalCompositeOperation = "source-atop";
|
|
571
|
-
ctx.fillStyle =
|
|
587
|
+
ctx.fillStyle = r.color;
|
|
572
588
|
ctx.fillRect(0, 0, width, height);
|
|
573
589
|
ctx.globalAlpha = 1;
|
|
574
590
|
ctx.globalCompositeOperation = "source-over";
|
|
@@ -582,7 +598,7 @@ var tint = (params) => createDescriptor4(tintDef, params);
|
|
|
582
598
|
// src/wave.ts
|
|
583
599
|
import { Internals as Internals5 } from "remotion";
|
|
584
600
|
var { createDescriptor: createDescriptor5, defineEffect: defineEffect5 } = Internals5;
|
|
585
|
-
var
|
|
601
|
+
var resolve3 = (p) => ({
|
|
586
602
|
amplitude: p.amplitude ?? 60,
|
|
587
603
|
wavelength: p.wavelength ?? 240,
|
|
588
604
|
speed: p.speed ?? 1 / 6,
|
|
@@ -593,13 +609,17 @@ var waveDef = defineEffect5({
|
|
|
593
609
|
type: "remotion/wave",
|
|
594
610
|
label: "Wave",
|
|
595
611
|
backend: "2d",
|
|
612
|
+
calculateKey: (params) => {
|
|
613
|
+
const r = resolve3(params);
|
|
614
|
+
return `wave-${r.amplitude}-${r.wavelength}-${r.speed}-${r.sliceWidth}-${r.background}`;
|
|
615
|
+
},
|
|
596
616
|
setup: () => null,
|
|
597
617
|
apply: ({ source, target, frame, width, height, params }) => {
|
|
598
618
|
const ctx = target.getContext("2d");
|
|
599
619
|
if (!ctx) {
|
|
600
620
|
throw new Error("Failed to acquire 2D context for wave effect. The canvas may have been assigned a different context type.");
|
|
601
621
|
}
|
|
602
|
-
const r =
|
|
622
|
+
const r = resolve3(params);
|
|
603
623
|
ctx.clearRect(0, 0, width, height);
|
|
604
624
|
if (r.background !== "transparent") {
|
|
605
625
|
ctx.fillStyle = r.background;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/effects",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.461",
|
|
4
4
|
"description": "Experimental presets for Remotion canvas effect hooks",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"url": "https://github.com/remotion-dev/remotion/issues"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"remotion": "4.0.
|
|
27
|
+
"remotion": "4.0.461"
|
|
28
28
|
},
|
|
29
29
|
"exports": {
|
|
30
30
|
".": {
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"./package.json": "./package.json"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
38
|
+
"@remotion/eslint-config-internal": "4.0.461",
|
|
39
39
|
"eslint": "9.19.0",
|
|
40
40
|
"@typescript/native-preview": "7.0.0-dev.20260217.1"
|
|
41
41
|
},
|