p5.js:camera
Video Capture
code:test.js
let capture;
function setup() {
createCanvas(0, 0);
capture = createCapture(VIDEO);
capture.size(640, 480);
//capture.hide();
}
function draw() {
//background(255);
//image(capture, 0, 0, 320, 240);
//filter(INVERT);
}
code:sketch.js
const sketch = p => {
let capture;
p.setup = () => {
p.createCanvas(0,0);
capture = p.createCapture(p.VIDEO);
capture.size(320, 240);
}
p.draw = () => {
}
}
new p5(sketch, L${scrapbox.Page.lines[20].id});
//new p5(sketch, 'editor');
p5-sketch-button.icon
https://img.shields.io/badge/p5.js-camera-ED225D.svg?logo=p5.js&style=for-the-badge