-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathBebert.pde
More file actions
73 lines (65 loc) · 1.51 KB
/
Copy pathBebert.pde
File metadata and controls
73 lines (65 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
//A FAIRE:
//1) Portée de effets.
//2) Ergonomie, interface graphique avec Arduino
import processing.video.*;
Capture cam;
PrintWriter periph;
String[] lignes;
//EFFETS **************************
PShader hsb;
float ptdr = 0.5;
float bri = 1;
//ACTIVATION EFFETS
boolean seuil = true;
boolean sh = false;
float[] parametres = new float[2];
//BOUCLES *************************
int boucleCourante;
boolean[] bcl = new boolean[3];
Calque[] boucles = new Calque[3];
int vitesse;
int vit = 1;
//FOND
PImage fond;
void setup() {
fullScreen(P2D); //size(640, 480, P2D);
String[] cameras = Capture.list();
lignes = loadStrings("config.txt");
int config = int(lignes[0]);
periph = createWriter("peripheriques.txt");
for(int i = 0; i < cameras.length; i++){
periph.println(i + " " + cameras[i]);
}
periph.flush();
periph.close();
cam = new Capture(this, cameras[config]);
cam.start();
for (int i = 0; i < boucles.length; i++) {
boucles[i] = new Calque(i);
}
hsb = loadShader("traitement.glsl");
fond = createImage(width, height, ARGB);
background(0);
}
void draw() {
//FOND
resetShader();
image(fond, 0, 0);
//FLUX
hsb.set("brightness", bri);
hsb.set("saturation", parametres[0]);
hsb.set("contrast", parametres[1]);
if (sh) {
shader(hsb);
}
for (int i = 0; i < 3; i++) {
if (bcl[i]) {
/*if (frameCount % boucles[i].idid() == 0) {
boucles[i].capturer();
}*/
boucles[i].jouer();
}
}
image(cam, 0, 0, width, height);
println(frameRate);
}