// convenience function - should be called within loadPixels/updatePixels void pset(int x, int y, color c) { x = constrain(x,0,width-1); // make sure we not out of bounds y = constrain(y,0,height-1); pixels[x+width*y] = c; } color pget(int x, int y) { x = constrain(x,0,width-1); y = constrain(y,0,height-1); return pixels[x+width*y]; } void pset(PImage i, int x, int y, color c) { x = constrain(x,0,i.width-1); y = constrain(y,0,i.height-1); i.pixels[x+i.width*y] = c; } color pget(PImage i, int x, int y) { x = constrain(x,0,i.width-1); y = constrain(y,0,i.height-1); return i.pixels[x+i.width*y]; } void draw() { loadPixels(); for (int y=0; y