@remotion/motion-blur 4.0.545 → 4.0.546

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.
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { type InteractiveBaseProps, type InteractivePremountProps } from 'remotion';
3
- export type HtmlInCanvasMotionBlurProps = InteractiveBaseProps & InteractivePremountProps & {
2
+ import { type InteractiveBaseProps, type InteractivePremountProps, type InteractiveTransformProps } from 'remotion';
3
+ export type HtmlInCanvasMotionBlurProps = InteractiveBaseProps & InteractivePremountProps & InteractiveTransformProps & {
4
4
  readonly children: React.ReactNode;
5
5
  readonly width: number;
6
6
  readonly height: number;
@@ -8,6 +8,7 @@ const motion_blur_compositor_1 = require("./motion-blur-compositor");
8
8
  const motion_blur_context_1 = require("./motion-blur-context");
9
9
  const htmlInCanvasMotionBlurSchema = {
10
10
  ...remotion_1.Interactive.baseSchema,
11
+ ...remotion_1.Interactive.transformSchema,
11
12
  shutterAngle: {
12
13
  type: 'number',
13
14
  min: 0,
@@ -60,7 +61,7 @@ const MotionBlurSample = ({ children, width, height, index, count, shutterInFram
60
61
  pointerEvents: isRepresentativeSample ? 'auto' : 'none',
61
62
  }, children: (0, jsx_runtime_1.jsx)(remotion_1.Freeze, { frame: sampleFrame, active: !isRepresentativeSample, children: (0, jsx_runtime_1.jsx)(motion_blur_context_1.MotionBlurSampleProvider, { sampleIndex: index, registry: registry, children: children }) }) }));
62
63
  };
63
- const HtmlInCanvasMotionBlurInner = ({ children, width, height, shutterAngle = 180, samples = 8, disabled = false, disabledInPreview = false, from, durationInFrames, trimBefore, playbackRate, loop, freeze, hidden, name, premountFor, postmountFor, showInTimeline, styleWhilePremounted, styleWhilePostmounted, controls, }) => {
64
+ const HtmlInCanvasMotionBlurInner = ({ children, width, height, shutterAngle = 180, samples = 8, disabled = false, disabledInPreview = false, from, durationInFrames, trimBefore, playbackRate, loop, freeze, hidden, name, premountFor, postmountFor, showInTimeline, style, styleWhilePremounted, styleWhilePostmounted, controls, }) => {
64
65
  const { durationInFrames: compositionDurationInFrames } = (0, remotion_1.useVideoConfig)();
65
66
  const { isRendering } = (0, remotion_1.useRemotionEnvironment)();
66
67
  const videoEnabled = remotion_1.Internals.useVideoEnabled();
@@ -154,8 +155,7 @@ const HtmlInCanvasMotionBlurInner = ({ children, width, height, shutterAngle = 1
154
155
  };
155
156
  }
156
157
  const { compositor } = compositorRef.current;
157
- // Canvas2D quantizes globalAlpha to eight bits, including float16 targets.
158
- const sampleWeight = Math.round(255 / actualSamples) / 255;
158
+ const sampleWeight = 1 / actualSamples;
159
159
  for (const [index, sampleElement] of captureElements.slice(1).entries()) {
160
160
  const image = layoutCanvas.captureElementImage(sampleElement);
161
161
  try {
@@ -179,7 +179,7 @@ const HtmlInCanvasMotionBlurInner = ({ children, width, height, shutterAngle = 1
179
179
  });
180
180
  // The root wrapper holds the first sample. The rest must be canvas children.
181
181
  // Reuse HtmlInCanvas's Sequence for the motion blur controls.
182
- return ((0, jsx_runtime_1.jsx)(remotion_1.HtmlInCanvas, { width: width, height: height, from: from, durationInFrames: durationInFrames, trimBefore: trimBefore, playbackRate: playbackRate, loop: loop, freeze: freeze, hidden: hidden, name: name !== null && name !== void 0 ? name : '<HtmlInCanvasMotionBlur>', premountFor: premountFor, postmountFor: postmountFor, showInTimeline: showInTimeline, styleWhilePremounted: styleWhilePremounted, styleWhilePostmounted: styleWhilePostmounted, controls, onPaint: onPaint, onInit: onInit, _remotionInternalCanvasSiblings: sampleElements.slice(1), _remotionInternalFallbackLabel: "Motion blur is not visible", children: passThrough ? children : sampleElements[0] }));
182
+ return ((0, jsx_runtime_1.jsx)(remotion_1.HtmlInCanvas, { width: width, height: height, from: from, durationInFrames: durationInFrames, trimBefore: trimBefore, playbackRate: playbackRate, loop: loop, freeze: freeze, hidden: hidden, name: name !== null && name !== void 0 ? name : '<HtmlInCanvasMotionBlur>', premountFor: premountFor, postmountFor: postmountFor, showInTimeline: showInTimeline, style: style, styleWhilePremounted: styleWhilePremounted, styleWhilePostmounted: styleWhilePostmounted, controls, onPaint: onPaint, onInit: onInit, _remotionInternalCanvasSiblings: sampleElements.slice(1), _remotionInternalFallbackLabel: "Motion blur is not visible", children: passThrough ? children : sampleElements[0] }));
183
183
  };
184
184
  /**
185
185
  * Experimental motion blur that averages separately captured HTML-in-canvas
@@ -494,6 +494,7 @@ import {
494
494
  import { jsx as jsx3 } from "react/jsx-runtime";
495
495
  var htmlInCanvasMotionBlurSchema = {
496
496
  ...Interactive.baseSchema,
497
+ ...Interactive.transformSchema,
497
498
  shutterAngle: {
498
499
  type: "number",
499
500
  min: 0,
@@ -582,6 +583,7 @@ var HtmlInCanvasMotionBlurInner = ({
582
583
  premountFor,
583
584
  postmountFor,
584
585
  showInTimeline,
586
+ style,
585
587
  styleWhilePremounted,
586
588
  styleWhilePostmounted,
587
589
  controls
@@ -662,7 +664,7 @@ var HtmlInCanvasMotionBlurInner = ({
662
664
  };
663
665
  }
664
666
  const { compositor } = compositorRef.current;
665
- const sampleWeight = Math.round(255 / actualSamples) / 255;
667
+ const sampleWeight = 1 / actualSamples;
666
668
  for (const [index, sampleElement] of captureElements.slice(1).entries()) {
667
669
  const image = layoutCanvas.captureElementImage(sampleElement);
668
670
  try {
@@ -706,6 +708,7 @@ var HtmlInCanvasMotionBlurInner = ({
706
708
  premountFor,
707
709
  postmountFor,
708
710
  showInTimeline,
711
+ style,
709
712
  styleWhilePremounted,
710
713
  styleWhilePostmounted,
711
714
  ...{ controls },
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "url": "https://github.com/remotion-dev/remotion/tree/main/packages/motion-blur"
4
4
  },
5
5
  "name": "@remotion/motion-blur",
6
- "version": "4.0.545",
6
+ "version": "4.0.546",
7
7
  "description": "Motion blur effect for Remotion",
8
8
  "main": "dist/cjs/index.js",
9
9
  "types": "dist/cjs/index.d.ts",
@@ -21,7 +21,7 @@
21
21
  "url": "https://github.com/remotion-dev/remotion/issues"
22
22
  },
23
23
  "dependencies": {
24
- "remotion": "4.0.545"
24
+ "remotion": "4.0.546"
25
25
  },
26
26
  "peerDependencies": {
27
27
  "react": ">=16.8.0",
@@ -40,8 +40,8 @@
40
40
  "@webgpu/types": "0.1.74",
41
41
  "react": "19.3.1",
42
42
  "react-dom": "19.3.1",
43
- "remotion": "4.0.545",
44
- "@remotion/eslint-config-internal": "4.0.545",
43
+ "remotion": "4.0.546",
44
+ "@remotion/eslint-config-internal": "4.0.546",
45
45
  "eslint": "9.19.0",
46
46
  "typescript": "7.1.0-beta"
47
47
  },