Skip to content

Commit

Permalink
feat: add imageSmoothing property to webcam module (#751)
Browse files Browse the repository at this point in the history
  • Loading branch information
2xAA authored Jul 27, 2022
1 parent bc1469a commit 64f1513
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/application/sample-modules/Webcam.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,21 @@ export default {
default: [0.5, 0.5],
min: 0,
max: 1
},

imageSmoothing: {
type: "bool",
default: true
}
},

draw({ canvas, context, video: { canvas: video }, props }) {
const { position, scale } = props;
const { position, scale, imageSmoothing } = props;
const { width: videoWidth, height: videoHeight } = video;
const { width, height } = canvas;

context.imageSmoothingEnabled = imageSmoothing;

context.drawImage(
video,
width * position[0] - (videoWidth * scale) / 2,
Expand Down

0 comments on commit 64f1513

Please sign in to comment.