/*----------------------------------------\ | ____ _ | | / __/ | |_ _ _ _ _ _ ___ | | [__[ | / | [ | [ | | \ | \ | / | | /___/ |__[ |__[|_[_| |__\ |__\|_| | | | | T E X T U R I Z E R | | | \----------------------------------------*/ SkanaarGUI gui; TextureFilter root; TextureFilter selectedFilter; TextureFilter connectionSelectedFilter; int connectionSelectedSource = 0; Vector filters; int texWidth, texHeight, guiWidth, rootX, rootY; boolean refresh = true; boolean savingImage = false; ImgBuffer imgBuffer; int detail = 0; PFont font; final int LINEAR = 0, EXPONENTIAL = 1; //-------------------------------------------- void setup(){ size(800,500); frameRate(30); texWidth = 500; texHeight = height; guiWidth = width-texWidth; rootX = guiWidth/2; rootY = 200; smooth(); font = loadFont("silkscreen.vlw"); textFont(font); filters = new Vector(); gui = new SkanaarGUI(); gui.setDesign(font); String[] distorts= new String[]{"coords","warp","rotate","translate","scale","displace","swirl","bulge"}; String[] filters = new String[]{"crease","monochrom","hue","invert","newsprint","colorprint","overlay","mix","add","multiply","tint","threshold"}; String[] sources = new String[]{"color","grid","julia","noise","gradient x","gradient y"}; distorts = sort(distorts); filters = sort(filters); sources = sort(sources); for(int i=0; i=0 ; i-- ) if( getFilter(i).deleteMe ) filters.remove(i); // make nodes moveable by mouse dragging if( selectedFilter!=null && selectedFilter!=root) if( mousePressed ) selectedFilter.setIconPos(mouseX,mouseY); // nodes in trees order themselves nicely and every node repel each other for(int i=0 ; i= '1' && key<='9') for(int i=0 ; i