@remotion/motion-blur 3.3.76 → 3.3.77
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 +3 -3
- package/dist/CameraMotionBlur.d.ts +0 -11
- package/dist/CameraMotionBlur.js +0 -41
- package/dist/MotionBlur.d.ts +0 -9
- package/dist/MotionBlur.js +0 -17
- package/dist/Trail.d.ts +0 -12
- package/dist/Trail.js +0 -39
- package/dist/index.d.ts +0 -3
- package/dist/index.js +0 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/motion-blur",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.77",
|
|
4
4
|
"description": "Motion blur effect for Remotion",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"types": "dist/cjs/index.d.ts",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"url": "https://github.com/remotion-dev/remotion/issues"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"remotion": "3.3.
|
|
19
|
+
"remotion": "3.3.77"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
22
|
"react": ">=16.8.0",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"prettier-plugin-organize-imports": "^2.3.4",
|
|
41
41
|
"react": "18.0.0",
|
|
42
42
|
"react-dom": "18.0.0",
|
|
43
|
-
"remotion": "3.3.
|
|
43
|
+
"remotion": "3.3.77",
|
|
44
44
|
"rollup": "^2.70.1",
|
|
45
45
|
"typescript": "^4.7.0"
|
|
46
46
|
},
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export declare type CameraMotionBlurProps = {
|
|
3
|
-
children: React.ReactNode;
|
|
4
|
-
shutterAngle?: number;
|
|
5
|
-
samples?: number;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* @description Produces natural looking motion blur similar to what would be produced by a film camera.
|
|
9
|
-
* @see [Documentation](https://www.remotion.dev/docs/motion-blur/camera-motion-blur)
|
|
10
|
-
*/
|
|
11
|
-
export declare const CameraMotionBlur: React.FC<CameraMotionBlurProps>;
|
package/dist/CameraMotionBlur.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CameraMotionBlur = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const remotion_1 = require("remotion");
|
|
6
|
-
/**
|
|
7
|
-
* @description Produces natural looking motion blur similar to what would be produced by a film camera.
|
|
8
|
-
* @see [Documentation](https://www.remotion.dev/docs/motion-blur/camera-motion-blur)
|
|
9
|
-
*/
|
|
10
|
-
const CameraMotionBlur = ({ children, shutterAngle = 180, samples = 10, }) => {
|
|
11
|
-
const currentFrame = (0, remotion_1.useCurrentFrame)();
|
|
12
|
-
if (typeof samples !== 'number' ||
|
|
13
|
-
Number.isNaN(samples) ||
|
|
14
|
-
!Number.isFinite(samples)) {
|
|
15
|
-
throw new TypeError(`"samples" must be a number, but got ${JSON.stringify(samples)}`);
|
|
16
|
-
}
|
|
17
|
-
if (samples % 1 !== 0) {
|
|
18
|
-
throw new TypeError(`"samples" must be an integer, but got ${JSON.stringify(samples)}`);
|
|
19
|
-
}
|
|
20
|
-
if (samples < 0) {
|
|
21
|
-
throw new TypeError(`"samples" must be non-negative, but got ${JSON.stringify(samples)}`);
|
|
22
|
-
}
|
|
23
|
-
if (typeof shutterAngle !== 'number' ||
|
|
24
|
-
Number.isNaN(shutterAngle) ||
|
|
25
|
-
!Number.isFinite(shutterAngle)) {
|
|
26
|
-
throw new TypeError(`"shutterAngle" must be a number, but got ${JSON.stringify(shutterAngle)}`);
|
|
27
|
-
}
|
|
28
|
-
if (shutterAngle < 0 || shutterAngle > 360) {
|
|
29
|
-
throw new TypeError(`"shutterAngle" must be between 0 and 360, but got ${JSON.stringify(shutterAngle)}`);
|
|
30
|
-
}
|
|
31
|
-
const shutterFraction = shutterAngle / 360;
|
|
32
|
-
return ((0, jsx_runtime_1.jsx)(remotion_1.AbsoluteFill, { style: { isolation: 'isolate' }, children: new Array(samples).fill(true).map((_, i) => {
|
|
33
|
-
const sample = i + 1;
|
|
34
|
-
const sampleFrameOffset = shutterFraction * (sample / samples);
|
|
35
|
-
return ((0, jsx_runtime_1.jsx)(remotion_1.AbsoluteFill, { style: {
|
|
36
|
-
mixBlendMode: 'plus-lighter',
|
|
37
|
-
filter: `opacity(${1 / samples})`,
|
|
38
|
-
}, children: (0, jsx_runtime_1.jsx)(remotion_1.Freeze, { frame: currentFrame - sampleFrameOffset, children: children }) }, `frame-${i.toString()}`));
|
|
39
|
-
}) }));
|
|
40
|
-
};
|
|
41
|
-
exports.CameraMotionBlur = CameraMotionBlur;
|
package/dist/MotionBlur.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { TrailProps } from './Trail';
|
|
3
|
-
export declare type MotionBlurProps = Omit<TrailProps, 'trailOpacity'> & {
|
|
4
|
-
blurOpacity: number;
|
|
5
|
-
};
|
|
6
|
-
/**
|
|
7
|
-
* @deprecated The component has been renamed "Trail" instead: https://remotion.dev/docs/motion-blur/trail
|
|
8
|
-
*/
|
|
9
|
-
export declare const MotionBlur: React.FC<MotionBlurProps>;
|
package/dist/MotionBlur.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MotionBlur = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const Trail_1 = require("./Trail");
|
|
6
|
-
/**
|
|
7
|
-
* @deprecated The component has been renamed "Trail" instead: https://remotion.dev/docs/motion-blur/trail
|
|
8
|
-
*/
|
|
9
|
-
const MotionBlur = ({ blurOpacity, ...rest }) => {
|
|
10
|
-
if (typeof blurOpacity !== 'number' ||
|
|
11
|
-
Number.isNaN(blurOpacity) ||
|
|
12
|
-
!Number.isFinite(blurOpacity)) {
|
|
13
|
-
throw new TypeError(`"blurOpacity" must be a number, but got ${JSON.stringify(blurOpacity)}`);
|
|
14
|
-
}
|
|
15
|
-
return (0, jsx_runtime_1.jsx)(Trail_1.Trail, { ...rest, trailOpacity: blurOpacity });
|
|
16
|
-
};
|
|
17
|
-
exports.MotionBlur = MotionBlur;
|
package/dist/Trail.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export declare type TrailProps = {
|
|
3
|
-
children: React.ReactNode;
|
|
4
|
-
layers: number;
|
|
5
|
-
lagInFrames: number;
|
|
6
|
-
trailOpacity: number;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* @description The <Trail> component duplicates it's children and adds a time offset to each layer in order to create a trail effect.
|
|
10
|
-
* @see [Documentation](https://www.remotion.dev/docs/motion-blur/trail)
|
|
11
|
-
*/
|
|
12
|
-
export declare const Trail: React.FC<TrailProps>;
|
package/dist/Trail.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Trail = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const remotion_1 = require("remotion");
|
|
6
|
-
/**
|
|
7
|
-
* @description The <Trail> component duplicates it's children and adds a time offset to each layer in order to create a trail effect.
|
|
8
|
-
* @see [Documentation](https://www.remotion.dev/docs/motion-blur/trail)
|
|
9
|
-
*/
|
|
10
|
-
const Trail = ({ children, layers, lagInFrames, trailOpacity, }) => {
|
|
11
|
-
const frame = (0, remotion_1.useCurrentFrame)();
|
|
12
|
-
if (typeof layers !== 'number' ||
|
|
13
|
-
Number.isNaN(layers) ||
|
|
14
|
-
!Number.isFinite(layers)) {
|
|
15
|
-
throw new TypeError(`"layers" must be a number, but got ${JSON.stringify(layers)}`);
|
|
16
|
-
}
|
|
17
|
-
if (layers % 1 !== 0) {
|
|
18
|
-
throw new TypeError(`"layers" must be an integer, but got ${JSON.stringify(layers)}`);
|
|
19
|
-
}
|
|
20
|
-
if (layers < 0) {
|
|
21
|
-
throw new TypeError(`"layers" must be non-negative, but got ${JSON.stringify(layers)}`);
|
|
22
|
-
}
|
|
23
|
-
if (typeof trailOpacity !== 'number' ||
|
|
24
|
-
Number.isNaN(trailOpacity) ||
|
|
25
|
-
!Number.isFinite(trailOpacity)) {
|
|
26
|
-
throw new TypeError(`"trailOpacity" must be a number, but got ${JSON.stringify(trailOpacity)}`);
|
|
27
|
-
}
|
|
28
|
-
if (typeof lagInFrames !== 'number' ||
|
|
29
|
-
Number.isNaN(lagInFrames) ||
|
|
30
|
-
!Number.isFinite(lagInFrames)) {
|
|
31
|
-
throw new TypeError(`"lagInFrames" must be a number, but got ${JSON.stringify(lagInFrames)}`);
|
|
32
|
-
}
|
|
33
|
-
return ((0, jsx_runtime_1.jsxs)(remotion_1.AbsoluteFill, { children: [new Array(layers).fill(true).map((_, i) => {
|
|
34
|
-
return ((0, jsx_runtime_1.jsx)(remotion_1.AbsoluteFill, { style: {
|
|
35
|
-
opacity: trailOpacity - ((layers - i) / layers) * trailOpacity,
|
|
36
|
-
}, children: (0, jsx_runtime_1.jsx)(remotion_1.Freeze, { frame: frame - lagInFrames * (layers - i), children: children }) }, `frame-${i.toString()}`));
|
|
37
|
-
}), children] }));
|
|
38
|
-
};
|
|
39
|
-
exports.Trail = Trail;
|
package/dist/index.d.ts
DELETED
package/dist/index.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Trail = exports.MotionBlur = exports.CameraMotionBlur = void 0;
|
|
4
|
-
var CameraMotionBlur_1 = require("./CameraMotionBlur");
|
|
5
|
-
Object.defineProperty(exports, "CameraMotionBlur", { enumerable: true, get: function () { return CameraMotionBlur_1.CameraMotionBlur; } });
|
|
6
|
-
var MotionBlur_1 = require("./MotionBlur");
|
|
7
|
-
Object.defineProperty(exports, "MotionBlur", { enumerable: true, get: function () { return MotionBlur_1.MotionBlur; } });
|
|
8
|
-
var Trail_1 = require("./Trail");
|
|
9
|
-
Object.defineProperty(exports, "Trail", { enumerable: true, get: function () { return Trail_1.Trail; } });
|