Calibrate works?
This commit is contained in:
parent
26e34f7671
commit
cc711c6343
1104 changed files with 636510 additions and 75 deletions
51
lib/video/examples/Movie/Pixelate/Pixelate.pde
Normal file
51
lib/video/examples/Movie/Pixelate/Pixelate.pde
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
/**
|
||||
* Pixelate
|
||||
* by Hernando Barragan.
|
||||
*
|
||||
* Load a QuickTime file and display the video signal
|
||||
* using rectangles as pixels by reading the values stored
|
||||
* in the current video frame pixels array.
|
||||
*/
|
||||
|
||||
import processing.video.*;
|
||||
|
||||
int numPixelsWide, numPixelsHigh;
|
||||
int blockSize = 10;
|
||||
Movie mov;
|
||||
color movColors[];
|
||||
|
||||
void setup() {
|
||||
size(640, 360);
|
||||
noStroke();
|
||||
mov = new Movie(this, "transit.mov");
|
||||
mov.loop();
|
||||
numPixelsWide = width / blockSize;
|
||||
numPixelsHigh = height / blockSize;
|
||||
println(numPixelsWide);
|
||||
movColors = new color[numPixelsWide * numPixelsHigh];
|
||||
}
|
||||
|
||||
// Display values from movie
|
||||
void draw() {
|
||||
if (mov.available() == true) {
|
||||
mov.read();
|
||||
mov.loadPixels();
|
||||
int count = 0;
|
||||
for (int j = 0; j < numPixelsHigh; j++) {
|
||||
for (int i = 0; i < numPixelsWide; i++) {
|
||||
movColors[count] = mov.get(i*blockSize, j*blockSize);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
background(255);
|
||||
for (int j = 0; j < numPixelsHigh; j++) {
|
||||
for (int i = 0; i < numPixelsWide; i++) {
|
||||
fill(movColors[j*numPixelsWide + i]);
|
||||
rect(i*blockSize, j*blockSize, blockSize, blockSize);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
BIN
lib/video/examples/Movie/Pixelate/data/transit.mov
Normal file
BIN
lib/video/examples/Movie/Pixelate/data/transit.mov
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue