int w; int h; int w2; int h2; int npixels; int npixels2; int bg1=0xDDDDCC; int bg2=0xDDCCCC; color bg_col=color(221,221,204); boolean update; PImage blurImg; float nLevels; float resolution=3; //color[] colors={color(220,220,203),color(100,150,120),color(222,122,172),color(222,33,65),color(145,22,42),color(145,91,80),color(32,96,128),color(204,153,51)}; color[] colors={color(173,226,191),color(246,211,221),color(246,57,103),color(225,38,67),color(55,166,203)}; //{0x915071,0xDEDEDE,0xDE2141,0xDE7AAC,0x91162A}; //DED2CC - 915B50 - 206080 - CC9933 float offset; float noiseVal; Branch mainBranch; float effectBlend=0; int nextTime; boolean inited; boolean inited2; color frame_col=color(222,33,65);// strong red color border_col=color(220,220,203);// weak green Vector blendedRects; int[] leftPrintScreen; PFont tooltipFont; ToolTip toolTip; boolean showPalette; Palette palette; boolean colorChanged; void setup(){ nLevels=0; offset=1; size(600,300,P3D); w=width; h=height; npixels=w*h; npixels2=int(npixels*.5); w2=int(w*.5); h2=int(h*.5); //background(221,204,204); int[] parentPixels=new int[npixels]; for(int y=0; y=w2 && pmouseXnextTime){ effectBlend=mouseX/float(w2); nextTime=millis()+1000; update=true; } } } if(update){ update=false; stroke(border_col); mainBranch.drawMe(); loadPixels(); blurImg.loadPixels(); for(int y=0; y0){ noiseVal+=offset; if(noiseVal>1) noiseVal--; col=colors[floor(noiseVal*colors.length*resolution)%(colors.length)]; pixels[(w*y)+x]=col; }/*else{ pixels[(w*y)+x]= pixels[(w*y)+(w-1-x)]=bgcolor; }*/ } } updatePixels(); int len=blendedRects.size(); if(len>0){ TreeRect tr; stroke(border_col); for(int i=0; i> 16; float g=(c & gshift) >> 8; float b=c & 255; if(g>r){ //from green r+=(100-r)*.1; g+=(150-g)*.1; b+=(120-b)*.1; } else{ //from red r+=(181-r)*.1; g+=(16-g)*.1; b+=(16-b)*.1; } return color(int(r),int(g),int(b)); } float distance(int x1, int y1, int x2, int y2){ return sqrt(sq(x1-x2)+sq(y1-y2)); } // ================================================== // Super Fast Blur v1.1 // by Mario Klingemann // Christian Giordano just removed the blue and red channel // ================================================== void fastblur(PImage img,int radius){ if (radius<1){ return; } int w=img.width; int h=img.height; int wm=w-1; int hm=h-1; int wh=w*h; int div=radius+radius+1; int b[]=new int[wh]; int bsum,x,y,i,p,p1,p2,yp,yi,yw; int vmin[] = new int[max(w,h)]; int vmax[] = new int[max(w,h)]; int[] pix=img.pixels; int dv[]=new int[256*div]; for (i=0;i<256*div;i++){ dv[i]=(i/div); } yw=yi=0; for (y=0;y