Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import processing.video.*;
- int videoScale = 10;
- int cols , rows;
- Capture video;
- void setup(){
- size(640,480);
- cols = width / videoScale;
- rows = height / videoScale;
- video = new Capture ( this , cols ,rows);
- video.start();
- }
- void captureEvent(Capture video) {
- video.read();
- }
- void draw(){
- background(0);
- video.loadPixels();
- for (int i = 0; i < cols ; i++){
- for (int j = 0 ; j < rows; j++) {
- int x = i*videoScale;
- int y = j*videoScale;
- color c = video.pixels[i + j*video.width];
- fill(c);
- stroke(0);
- rect(x , y,videoScale , videoScale);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement