import imageadjuster.*; /** Animation of color adjustments.
*/ BouncyAdjustBox [] boxes; int nboxes = 3; PImage bkgnd; ImageAdjuster adjust; void setup() { size(200,200); bkgnd = loadImage("milan_rubbish.jpg"); adjust = new ImageAdjuster(this); boxes = new BouncyAdjustBox[nboxes]; boxes[0] = new BouncyAdjustBox(0, 0.25f); boxes[1] = new BouncyAdjustBox(1, 1.5f); boxes[2] = new BouncyAdjustBox(2, 0.55f); } void draw() { background(bkgnd); for (int i=0; i width-w)) { x -= dx; dx = -dx; } y += dy; if ((y < 0) || (y > height-h)) { y -= dy; dy = -dy; } switch(operation) { case 0 : adjust.brightness(g, x, y, w, h, amount); break; case 1 : adjust.contrast(g, x, y, w, h, amount); break; case 2 : adjust.gamma(g, x, y, w, h, amount); break; } } }