- loadPixels()
- updatePixels()
- pixels[]
- PImage
- loadImage()
- can be local or remote
- image()
- tint()
- opacity, etc.
- Video
- Capture class
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
import processing.video.*; Capture video; void setup() { size(320,240); video = new Capture(this,width,height); video.start(); // you might not see this in older examples } void draw() { // Capture and display the video if (video.available()) { video.read(); } image(video,0,0); } |
- Movie class
-
123456789101112131415161718import processing.video.*;Movie myMovie;void setup() {size(200, 200);myMovie = new Movie(this, "myGreat.mov");myMovie.loop();}void draw() {tint(255, 20);image(myMovie, mouseX, mouseY);}// Called every time a new frame is available to readvoid movieEvent(Movie m) {m.read();}
12345678int r = red(video.pixels[55]); //unpacks the red component of the 55th pixelint g = green(video.pixels[55]); //unpacks the green component of the 55th pixelint b = blue(video.pixels[55]); //unpacks the blue component of the 55th pixelint b = brightness (video.pixels[55]); //unpacks the brightness of the 55th pixelint h = hue(video.pixels[55]); //unpacks the hue of the 55th pixelint s = saturation(video.pixels[55]); //unpacks the saturation of the 55th pixelvideo.pixels[55] = color(255,0,255); //pack a color with a lot of red and a lot of blue into the 55th pixel