-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRenderer.pde
More file actions
33 lines (29 loc) · 751 Bytes
/
Renderer.pde
File metadata and controls
33 lines (29 loc) · 751 Bytes
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
PGraphics buildFrame(float width, float height) {
PGraphics frame = render(s, width, height);
return frame;
}
PGraphics render(Sequence s) {
return render(s, width,height);
}
PGraphics render(Sequence s, float w, float h) {
PGraphics g = createGraphics((int)w,(int)h, P3D);
g.beginDraw();
g.scale(w/width, h/height);
g.stroke(255,255,255,255/3);
g.strokeWeight(3);
s.draw(g);
g.endDraw();
return g;
}
PGraphics backdrop(PGraphics source) {
return backdrop(source, 0);
}
PGraphics backdrop(PGraphics source, int background) {
PGraphics dest = createGraphics(source.width, source.height, P3D);
dest.beginDraw();
dest.background(background);
dest.clear();
dest.image(source, 0, 0);
dest.endDraw();
return dest;
}