-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathstackie-minmin.js
1 lines (1 loc) · 1.95 KB
/
stackie-minmin.js
1
var Stackie=eval('(X(){X v(b){m=w(b);b=new Float32Array(1<<17);VTc=0;1<<17>c;c+=2){Ta=m()*QPI*2;b[c]=Qsin(a);b[c+1]=Qcos(a)}q=b}X x(b,c){X a(a,c,d){f[c*b+a]=d}Tf=new Float32Array(b*c);this.get=X(a,c){Yf[c*b+a]};this.set=a;this.getImageData=X(a){a=a||n("x");VTe=new ImageData(b,c),d=new Uint32Array(e.data.buffer),g=0;g<d.length;g++)d[g]=a(f[g]);Ye};this.generate=X(f){VTe=0;e<c;e++)VTd=0;d<b;d++)1<<a(d,e,f(d/b,e/c))}}X y(){X b(a){d.push(a)}X c(a,c){YX(){b(c.apply(null,d.splice(-a,a)))}}X a(a){YX(){TcZ;b(a(d.pop(),c))}}X f(a){YX(){b(a(d.pop()))}}X l(a){YX(){b(a)}}X e(a){YX(){b(d[a])}}Td,g={"*":a(X(a,b){Ya*b}),"/":a(X(a,b){Ya/b}),"-":a(X(a,b){Ya-b}),"+":a(X(a,b){Ya+b}),p:a(r),w:c(3,r),W:c(4,r),s:f(Qsin),c:f(Qcos),q:f(Qsqrt),a:a(Qatan2),r:c(0,m),"<":a(Qmin),">":a(Qmax),l:f(Qlog),"^":a(Qpow),P:l(QPI),"~":f(Qabs),"#":f(Qround),"!":f(X(a){Y1-a}),"?":f(X(a){Y0>=a?0:1}),":":X(){TaZ,cZ;b(a);b(c)},";":X(){TaZ,cZ,fZ;b(a);b(c);b(f)},d:X(){TaZ;b(a);b(a)}},h;Vh in z)g[z[h]]=e(z[h]);Vh=0;10>h;h++)g[""+h]=l(h);YX(a,b){d=a;g[b]()}}X t(b){Tc=y();YX(a,f,l){Te=[];e.x=a;e.y=f;e.t=l;Va=0;a<b.length;a++)c(e,b[a]);Ye.pop()}}X p(b){YQfloor(255*(0>b?0:1<b?1:b))}X n(b){b=t(b);VTc=[],a=0;256>a;a++){Tf=p(b(a/256,0)),l=p(b(a/256,.5)),e=p(b(a/256,1));c.push(e<<16|l<<8|f|4278190080)}YX(a){Yc[p(a)]}}X r(b,c,a,f){X l(a,b){a%=b;Y0>a?b-a:a}X e(a,b,c){c=c*c*c*(c*(6*c-15)+10);return(1-c)*a+c*b}X d(d,e){Tg=2*(l(e,f)*a+l(d,a));return(b-d)*q[g]+(c-e)*q[g+1]}a=a||256;f=f||a;Tg=Qfloor(b),h=Qfloor(c),k=b-g,p=c-h,m=g+1,n=h+1;Ye(e(d(g,h),d(m,h),k),e(d(g,n),d(m,n),k),p)}X w(b){Tc=b&u-1,a=173;YX(){a=36969*(a&65535)+(a>>16);c=18E3*(c&65535)+(c>>16);return((a<<16)+c&u-1)/u}}Tk={},m,q,z="tuvxyz";v(42);Tu=1073741824;k.makeField=X(b,c){Ynew x(b,c)};k.program=t;k.makeRandom=w;k.setSeed=v;k.makePaletteMapper=n;k.generate=X(b,c,a){a=a||256;a=new x(a,a);c=n(c||"x");a.generate(t(b));Ya.getImageData(c)};Yk})();'.replace(/X|Y|Z|Q|V|T/g,function(m){return{X:"function",Y:"return ",Z:"=d.pop()",Q:"Math.",V:"for(",T:"var "}[m]}))