Learning about using the PGraphics to crate and edit images and graphics before drawing them. Or, in this case, in order to be sent out via Syphon. Syphon is essentially an invisible video cable between different apps on Mac OSX. Spout is the Windows version.
Everything was working great until I started trying to use filter() within the PGrahics canvas.
The peculiar thing is that the filters used, INVERT & BLUR, do show in the Processing window but not in the Syphon output.
Is there any reason for this and/or a fix?
Should the filters be applied in a different way to ensure they are included in the Syphon output?
See attached screenshot and code below.
Find the library and the “Simple Client” app on the GitHub here.
import codeanticode.syphon.*;
PGraphics canvas;
SyphonServer server;
void setup() {
size(400,400, P3D);
canvas = createGraphics(400, 400, P3D);
frameRate(30);
// Create syhpon server to send frames out.
server = new SyphonServer(this, "Processing Syphon");
}
void draw() {
canvas.beginDraw();
canvas.background(127);
canvas.lights();
canvas.translate(width/2, height/2);
canvas.rotateX(frameCount * 0.01);
canvas.rotateY(frameCount * 0.01);
canvas.box(150);
canvas.filter(INVERT);
canvas.filter(BLUR, 3);
canvas.endDraw();
image(canvas, 0, 0);
server.sendImage(canvas);
}