/**
CompositorDemo
Dave Bollinger, Dec 2006
http://www.davebollinger.com
for Processing 0123 Beta
Instructions:
Click to display next compositing mode
Press 'a' to toggle alpha channel in overlay image
Purpose:
To help further the development of blend() and
such routines in Processing and/or help standardize
some of the naming of various compositing operations.
Version 0.01 alpha
*/
PImage bkgnd; // the background image "layer 0"
PImage ovlayO; // the overlay image, opaque alpha channel
PImage ovlayA; // the overlay image again, modified to use this...
PImage alffa; // ...image as its alpha channel
PImage dest; // and an image to use for output of the compositing
PFont font; // um, this is one of those font thingies :D
int mode = COMP_MODE_NORMAL;
boolean useAlphaChannel = false;
void setup() {
size(900,120); // avoiding the strong tempation to cheat and use P3D's lovely pixels array
loadPixels(); // ..cuz we'll be bashing them around like crazy
bkgnd = loadImage("bkgnd.jpg");
ovlayO = loadImage("ovlay.jpg");
ovlayA = loadImage("ovlay.jpg");
alffa = loadImage("alffa.jpg");
for (int i=0; i COMP_MODE_LAST)
mode = 0;
redraw();
}