[ Web Proxy ]
URL:
Viewing: https://raw.githubusercontent.com/processing-js/processing-js/master/processing.min.js [Back]  [Original]

!function e(t,n,r){function i(o,a){if(!n[o]){if(!t[o]){var l="function"==typeof require&&require
if(!a&&l)return l(o,!0)
if(s)return s(o,!0)
var h=new Error("Cannot find module '"+o+"'")
throw h.code="MODULE_NOT_FOUND",h}var u=n[o]={exports:{}}
t[o][0].call(u.exports,function(e){var n=t[o][1][e]
return i(n?n:e)},u,u.exports,e,t,n,r)}return n[o].exports}for(var s="function"==typeof require&&require,o=0;on.BufferMax?n.BufferArray.splice(0,1):n.javaconsole.scrollTop=n.javaconsole.scrollHeight},n.showconsole=function(){n.wrapper.classList.remove("hidden")},n.hideconsole=function(){n.wrapper.classList.add("hidden")},n.closer.onclick=function(){n.hideconsole()},n.hideconsole(),n}},{}],6:[function(e,t,n){t.exports=function(e){function t(){}function n(e,t,n){if(!e.hasOwnProperty(t)||"function"!=typeof e[t])return void(e[t]=n)
var r=e[t]
if("$overloads"in r)return void(r.$defaultOverload=n)
if("$overloads"in n||r.length!==n.length){var i,s
"$overloads"in n?(i=n.$overloads.slice(0),i[r.length]=r,s=n.$defaultOverload):(i=[],i[n.length]=n,i[r.length]=r,s=r)
var o=function(){var e=o.$overloads[arguments.length]||("$methodArgsIndex"in o&&arguments.length>o.$methodArgsIndex?o.$overloads[o.$methodArgsIndex]:null)||o.$defaultOverload
return e.apply(this,arguments)}
o.$overloads=i,"$methodArgsIndex"in n&&(o.$methodArgsIndex=n.$methodArgsIndex),o.$defaultOverload=s,o.name=t,e[t]=o}}function r(e,t){function r(n){s.defineProperty(e,n,{get:function(){return t[n]},set:function(e){t[n]=e},enumerable:!0})}var i=[]
for(var o in t)"function"==typeof t[o]?n(e,o,t[o]):"$"===o.charAt(0)||o in e||i.push(o)
for(;i.length>0;)r(i.shift())
e.$super=t}function i(e){return"string"==typeof e&&["byte","int","char","color","float","long","double"].indexOf(e)!==-1}t.prototype=e.PConstants
var s=new t
return Object.keys(e).forEach(function(t){s[t]=e[t]}),s.defineProperty=function(e,t,n){"defineProperty"in Object?Object.defineProperty(e,t,n):(n.hasOwnProperty("get")&&e.__defineGetter__(t,n.get),n.hasOwnProperty("set")&&e.__defineSetter__(t,n.set))},s.extendClassChain=function(e){for(var t=[e],n=e.$upcast;n;n=n.$upcast)r(n,e),t.push(n),e=n
for(;t.length>0;)t.pop().$self=e},s.extendStaticMembers=function(e,t){r(e,t)},s.extendInterfaceMembers=function(e,t){r(e,t)},s.addMethod=function(e,t,n,r){var i=e[t]
if(i||r){var s=n.length
if("$overloads"in i)i.$overloads[s]=n
else{var o=function(){var e=o.$overloads[arguments.length]||("$methodArgsIndex"in o&&arguments.length>o.$methodArgsIndex?o.$overloads[o.$methodArgsIndex]:null)||o.$defaultOverload
return e.apply(this,arguments)},a=[]
i&&(a[i.length]=i),a[s]=n,o.$overloads=a,o.$defaultOverload=i||n,r&&(o.$methodArgsIndex=s),o.name=t,e[t]=o}}else e[t]=n},s.createJavaArray=function(e,t){var n=null,r=null
if("string"==typeof e&&("boolean"===e?r=!1:i(e)&&(r=0)),"number"==typeof t[0]){var o=0|t[0]
if(t.length2147483647&&(t-=4294967296),t}function $(e){return"number"==typeof e?0!==e:"boolean"==typeof e?e:"string"==typeof e?"true"===e.toLowerCase():e instanceof Char?49===e.code||84===e.code||116===e.code:void 0}function G(e){return"number"==typeof e?e:"boolean"==typeof e?e?1:0:"string"==typeof e?parseFloat(e):e instanceof Char?e.code:void 0}function V(e,t){if("number"==typeof e)return 4294967295&e
if("boolean"==typeof e)return e?1:0
if("string"==typeof e){var n=parseInt(e,t||10)
return 4294967295&n}return e instanceof Char?e.code:void 0}function z(){at&&(ut&&(Ae.fillStyle=xe.color.toString(ht),ut=!1),Ae.fill())}function U(){ct&&(mt&&(Ae.strokeStyle=xe.color.toString(pt),mt=!1),Ae.stroke())}function H(){z(),U(),Ae.closePath()}function X(e,n,r){var i=wr.shift()
i===t&&(i={},i.canvas=h.createElement("canvas"),i.context=i.canvas.getContext("2d")),wr.push(i)
var s=i.canvas,o=i.context,a=n||e.width,l=r||e.height
return s.width=a,s.height=l,e?"data"in e?o.putImageData(e,0,0):(o.clearRect(0,0,a,l),o.drawImage(e,0,0,a,l)):o.clearRect(0,0,a,l),i}function Y(e){return{getLength:function(e){return function(){if(e.isRemote)throw"Image is loaded remotely. Cannot get length."
return e.imageData.data.length?e.imageData.data.length/4:0}}(e),getPixel:function(e){return function(t){var n=4*t,r=e.imageData.data
if(e.isRemote)throw"Image is loaded remotely. Cannot get pixels."
return r[n+3]8,i[r+2]=n&c.BLUE_MASK,i[r+3]=(n&c.ALPHA_MASK)>>>24,e.__isDirty=!0}}(e),toArray:function(e){return function(){var t=[],n=e.imageData.data,r=e.width*e.height
if(e.isRemote)throw"Image is loaded remotely. Cannot get pixels."
for(var i=0,s=0;i>24
e.__isDirty=!0}}(e)}}function j(e,t){var n
if(e>=xe.width||e>>24)+l,255)8)*l,r)&n|o((e&r)-((a&r)>>8)*l,i)&r|o((e&i)-((a&i)*l>>8),0)},lightest:function(e,a){var l=(a&t)>>>24
return s(((e&t)>>>24)+l,255)8)*l)&n|o(e&r,((a&r)>>8)*l)&r|o(e&i,(a&i)*l>>8)},darkest:function(e,o){var a=(o&t)>>>24,l=e&n,h=e&r,u=e&i,c=s(e&n,((o&n)>>8)*a),f=s(e&r,((o&r)>>8)*a),p=s(e&i,(o&i)*a>>8)
return s(((e&t)>>>24)+a,255)8)&n|h+((f-h)*a>>8)&r|u+((p-u)*a>>8)&i},difference:function(s,o){var a=(o&t)>>>24,l=(s&n)>>16,h=(s&r)>>8,u=s&i,c=(o&n)>>16,f=(o&r)>>8,p=o&i,m=l>c?l-c:c-l,g=h>f?h-f:f-h,d=u>p?u-p:p-u
return e(s,a,l,h,u,c,f,p,m,g,d)},exclusion:function(s,o){var a=(o&t)>>>24,l=(s&n)>>16,h=(s&r)>>8,u=s&i,c=(o&n)>>16,f=(o&r)>>8,p=o&i,m=l+c-(l*c>>7),g=h+f-(h*f>>7),d=u+p-(u*p>>7)
return e(s,a,l,h,u,c,f,p,m,g,d)},multiply:function(s,o){var a=(o&t)>>>24,l=(s&n)>>16,h=(s&r)>>8,u=s&i,c=(o&n)>>16,f=(o&r)>>8,p=o&i,m=l*c>>8,g=h*f>>8,d=u*p>>8
return e(s,a,l,h,u,c,f,p,m,g,d)},screen:function(s,o){var a=(o&t)>>>24,l=(s&n)>>16,h=(s&r)>>8,u=s&i,c=(o&n)>>16,f=(o&r)>>8,p=o&i,m=255-((255-l)*(255-c)>>8),g=255-((255-h)*(255-f)>>8),d=255-((255-u)*(255-p)>>8)
return e(s,a,l,h,u,c,f,p,m,g,d)},hard_light:function(s,o){var a=(o&t)>>>24,l=(s&n)>>16,h=(s&r)>>8,u=s&i,c=(o&n)>>16,f=(o&r)>>8,p=o&i,m=c>7:255-((255-l)*(255-c)>>7),g=f>7:255-((255-h)*(255-f)>>7),d=p>7:255-((255-u)*(255-p)>>7)
return e(s,a,l,h,u,c,f,p,m,g,d)},soft_light:function(s,o){var a=(o&t)>>>24,l=(s&n)>>16,h=(s&r)>>8,u=s&i,c=(o&n)>>16,f=(o&r)>>8,p=o&i,m=(l*c>>7)+(l*l>>8)-(l*l*c>>15),g=(h*f>>7)+(h*h>>8)-(h*h*f>>15),d=(u*p>>7)+(u*u>>8)-(u*u*p>>15)
return e(s,a,l,h,u,c,f,p,m,g,d)},overlay:function(s,o){var a=(o&t)>>>24,l=(s&n)>>16,h=(s&r)>>8,u=s&i,c=(o&n)>>16,f=(o&r)>>8,p=o&i,m=l>7:255-((255-l)*(255-c)>>7),g=h>7:255-((255-h)*(255-f)>>7),d=u>7:255-((255-u)*(255-p)>>7)
return e(s,a,l,h,u,c,f,p,m,g,d)},dodge:function(s,o){var a=(o&t)>>>24,l=(s&n)>>16,h=(s&r)>>8,u=s&i,c=(o&n)>>16,f=(o&r)>>8,p=o&i,m=255
255!==c&&(m=(l>8,u=s&i,c=(o&n)>>16,f=(o&r)>>8,p=o&i,m=0
0!==c&&(m=(255-l8)+","+(e&c.BLUE_MASK)+","+((e&c.ALPHA_MASK)>>>24)/255+")"},xe.color.toInt=function(e,t,n,r){return r8,e&c.BLUE_MASK,(e&c.ALPHA_MASK)>>>24]},xe.color.toGLArray=function(e){return[((e&c.RED_MASK)>>>16)/255,((e&c.GREEN_MASK)>>>8)/255,(e&c.BLUE_MASK)/255,((e&c.ALPHA_MASK)>>>24)/255]},xe.color.toRGB=function(e,t,n){e=e>Bt?Bt:e,t=t>$t?$t:t,n=n>Gt?Gt:n,e=e>>16)/255*Bt},xe.green=function(e){return((e&c.GREEN_MASK)>>>8)/255*$t},xe.blue=function(e){return(e&c.BLUE_MASK)/255*Gt},xe.alpha=function(e){return((e&c.ALPHA_MASK)>>>24)/255*kt},xe.lerpColor=function(e,t,n){var r,i,s,o,a,l,h,u,f,p,m,g,d,v,y,x,A,b=xe.color(e),w=xe.color(t)
return Ut===c.HSB?(d=O(b),u=((b&c.ALPHA_MASK)>>>24)/kt,v=O(w),g=((w&c.ALPHA_MASK)>>>24)/kt,x=xe.lerp(d[0],v[0],n),A=xe.lerp(d[1],v[1],n),s=xe.lerp(d[2],v[2],n),y=xe.color.toRGB(x,A,s),o=xe.lerp(u,g,n)*kt+.5|0,o8,h=b&c.BLUE_MASK,u=((b&c.ALPHA_MASK)>>>24)/kt,f=(w&c.RED_MASK)>>>16,p=(w&c.GREEN_MASK)>>>8,m=w&c.BLUE_MASK,g=((w&c.ALPHA_MASK)>>>24)/kt,r=xe.lerp(a,f,n)+.5|0,i=xe.lerp(l,p,n)+.5|0,s=xe.lerp(h,m,n)+.5|0,o=xe.lerp(u,g,n)*kt+.5|0,o>1
var r=n.toDataURL(),i='url("'+r+'") '+e+" "+t+", default"
Tt=de.style.cursor=i}else if(1===arguments.length){var s=arguments[0]
Tt=de.style.cursor=s}else Tt=de.style.cursor=_t},xe.noCursor=function(){Tt=de.style.cursor=c.NOCURSOR},xe.link=function(e,n){n!==t?l.open(e,n):l.location=e},xe.beginDraw=u,xe.endDraw=u,ir.prototype.toImageData=function(e,n,r,i){return e=e!==t?e:0,n=n!==t?n:0,r=r!==t?r:xe.width,i=i!==t?i:xe.height,Ae.getImageData(e,n,r,i)},sr.prototype.toImageData=function(e,n,r,i){e=e!==t?e:0,n=n!==t?n:0,r=r!==t?r:xe.width,i=i!==t?i:xe.height
var s=h.createElement("canvas"),o=s.getContext("2d"),a=o.createImageData(r,i),l=new y(r*i*4)
Ae.readPixels(e,n,r,i,Ae.RGBA,Ae.UNSIGNED_BYTE,l)
for(var u=0,c=l.length,f=a.data;u0)n=t
else if(e instanceof Char)n=16,e|=0
else for(n=32;n>1&&!(e>>>n-1&1);)n--
for(var r="";n>0;)r+=e>>>--n&1?"1":"0"
return r},xe.unbinary=function(e){for(var t=e.length-1,n=1,r=0;t>=0;){var i=e[t--]
if("0"!==i&&"1"!==i)throw"the value passed into unbinary was not an 8 bit binary number"
"1"===i&&(r+=n),n>>8)/255,(l&c.BLUE_MASK)/255]
C("uLights.color.3d."+gn,Re,"uLights"+gn+".color",h),C("uLights.position.3d."+gn,Re,"uLights"+gn+".position",a),M("uLights.type.3d."+gn,Re,"uLights"+gn+".type",1),M("uLightCount3d",Re,"uLightCount",++gn)},ir.prototype.lightFalloff=rr.prototype.a3DOnlyFunction,sr.prototype.lightFalloff=function(e,t,n){Ae.useProgram(Re),C("uFalloff3d",Re,"uFalloff",[e,t,n])},ir.prototype.lightSpecular=rr.prototype.a3DOnlyFunction,sr.prototype.lightSpecular=function(e,t,n){var r=L(e,t,n,0),i=[((r&c.RED_MASK)>>>16)/255,((r&c.GREEN_MASK)>>>8)/255,(r&c.BLUE_MASK)/255]
Ae.useProgram(Re),C("uSpecular3d",Re,"uSpecular",i)},xe.lights=function(){xe.ambientLight(128,128,128),xe.directionalLight(128,128,128,0,0,-1),xe.lightFalloff(1,0,0),xe.lightSpecular(0,0,0)},ir.prototype.pointLight=rr.prototype.a3DOnlyFunction,sr.prototype.pointLight=function(e,t,n,r,i,s){if(gn===c.MAX_LIGHTS)throw"can only create "+c.MAX_LIGHTS+" lights"
var o=new PVector(r,i,s),a=new hr
a.scale(1,-1,1),a.apply(tt.array()),a.mult(o,o)
var l=L(e,t,n,0),h=[((l&c.RED_MASK)>>>16)/255,((l&c.GREEN_MASK)>>>8)/255,(l&c.BLUE_MASK)/255]
Ae.useProgram(Re),C("uLights.color.3d."+gn,Re,"uLights"+gn+".color",h),C("uLights.position.3d."+gn,Re,"uLights"+gn+".position",o.array()),M("uLights.type.3d."+gn,Re,"uLights"+gn+".type",2),M("uLightCount3d",Re,"uLightCount",++gn)},ir.prototype.noLights=rr.prototype.a3DOnlyFunction,sr.prototype.noLights=function(){gn=0,Ae.useProgram(Re),M("uLightCount3d",Re,"uLightCount",gn)},ir.prototype.spotLight=rr.prototype.a3DOnlyFunction,sr.prototype.spotLight=function(e,t,n,r,i,s,o,a,l,h,u){if(gn===c.MAX_LIGHTS)throw"can only create "+c.MAX_LIGHTS+" lights"
Ae.useProgram(Re)
var f=new PVector(r,i,s),p=new hr
p.scale(1,-1,1),p.apply(tt.array()),p.mult(f,f),p=p.array()
var m=[p[0]*o+p[4]*a+p[8]*l,p[1]*o+p[5]*a+p[9]*l,p[2]*o+p[6]*a+p[10]*l],g=L(e,t,n,0),d=[((g&c.RED_MASK)>>>16)/255,((g&c.GREEN_MASK)>>>8)/255,(g&c.BLUE_MASK)/255]
C("uLights.color.3d."+gn,Re,"uLights"+gn+".color",d),C("uLights.position.3d."+gn,Re,"uLights"+gn+".position",f.array()),C("uLights.direction.3d."+gn,Re,"uLights"+gn+".direction",m),C("uLights.concentration.3d."+gn,Re,"uLights"+gn+".concentration",u),C("uLights.angle.3d."+gn,Re,"uLights"+gn+".angle",h),M("uLights.type.3d."+gn,Re,"uLights"+gn+".type",3),M("uLightCount3d",Re,"uLightCount",++gn)},ir.prototype.beginCamera=function(){throw"beginCamera() is not available in 2D mode"},sr.prototype.beginCamera=function(){if(En)throw"You cannot call beginCamera() again before calling endCamera()"
En=!0,tt=et,nt=Je},ir.prototype.endCamera=function(){throw"endCamera() is not available in 2D mode"},sr.prototype.endCamera=function(){if(!En)throw"You cannot call endCamera() before calling beginCamera()"
tt.set(Je),nt.set(et),En=!1},xe.camera=function(e,n,r,i,s,o,a,l,h){e===t&&(Cn=xe.width/2,Mn=xe.height/2,Tn=Mn/Math.tan(Pn/2),e=Cn,n=Mn,r=Tn,i=Cn,s=Mn,o=0,a=0,l=1,h=0)
var u=new PVector(e-i,n-s,r-o),c=new PVector(a,l,h)
u.normalize()
var f=PVector.cross(c,u)
c=PVector.cross(u,f),f.normalize(),c.normalize()
var p=f.x,m=f.y,g=f.z,d=c.x,v=c.y,y=c.z,x=u.x,A=u.y,b=u.z
Je.set(p,m,g,0,d,v,y,0,x,A,b,0,0,0,0,1),Je.translate(-e,-n,-r),et.reset(),et.invApply(p,m,g,0,d,v,y,0,x,A,b,0,0,0,0,1),et.translate(e,n,r),tt.set(Je),nt.set(et)},xe.perspective=function(e,t,n,r){0===arguments.length&&(Mn=de.height/2,Tn=Mn/Math.tan(Pn/2),_n=Tn/10,Rn=10*Tn,Ln=xe.width/xe.height,e=Pn,t=Ln,n=_n,r=Rn)
var i,s,o,a
i=n*Math.tan(e/2),s=-i,o=i*t,a=s*t,xe.frustum(a,o,s,i,n,r)},ir.prototype.frustum=function(){throw"Processing.js: frustum() is not supported in 2D mode"},sr.prototype.frustum=function(e,t,n,r,i,s){Sn=!0,ot=new hr,ot.set(2*i/(t-e),0,(t+e)/(t-e),0,0,2*i/(r-n),(r+n)/(r-n),0,0,0,-(s+i)/(s-i),-(2*s*i)/(s-i),0,0,-1,0)
var o=new hr
o.set(ot),o.transpose(),Ae.useProgram(Le),T("projection2d",Le,"uProjection",!1,o.array()),Ae.useProgram(Re),T("projection3d",Re,"uProjection",!1,o.array()),Ae.useProgram(Ie),T("uProjectionUS",Ie,"uProjection",!1,o.array())},xe.ortho=function(e,t,n,r,i,s){0===arguments.length&&(e=0,t=xe.width,n=0,r=xe.height,i=-10,s=10)
var o=2/(t-e),a=2/(r-n),l=-2/(s-i),h=-(t+e)/(t-e),u=-(r+n)/(r-n),c=-(s+i)/(s-i)
ot=new hr,ot.set(o,0,0,h,0,a,0,u,0,0,l,c,0,0,0,1)
var f=new hr
f.set(ot),f.transpose(),Ae.useProgram(Le),T("projection2d",Le,"uProjection",!1,f.array()),Ae.useProgram(Re),T("projection3d",Re,"uProjection",!1,f.array()),Ae.useProgram(Ie),T("uProjectionUS",Ie,"uProjection",!1,f.array()),Sn=!1},xe.printProjection=function(){ot.print()},xe.printCamera=function(){Je.print()},ir.prototype.box=rr.prototype.a3DOnlyFunction,sr.prototype.box=function(e,t,n){t&&n||(t=n=e)
var r=new hr
r.scale(e,t,n)
var i=new hr
if(i.scale(1,-1,1),i.apply(tt.array()),i.transpose(),at){if(Ae.useProgram(Re),T("model3d",Re,"uModel",!1,r.array()),T("view3d",Re,"uView",!1,i.array()),Ae.enable(Ae.POLYGON_OFFSET_FILL),Ae.polygonOffset(1,1),C("color3d",Re,"uColor",lt),gn>0){var s=new hr
s.set(i)
var o=new hr
o.set(r),s.mult(o)
var a=new hr
a.set(s),a.invert(),a.transpose(),T("uNormalTransform3d",Re,"uNormalTransform",!1,a.array()),_("aNormal3d",Re,"aNormal",3,Oe)}else R("aNormal3d",Re,"aNormal")
_("aVertex3d",Re,"aVertex",3,De),R("aColor3d",Re,"aColor"),R("aTexture3d",Re,"aTexture"),Ae.drawArrays(Ae.TRIANGLES,0,Gn.length/3),Ae.disable(Ae.POLYGON_OFFSET_FILL)}gt>0&&ct&&(Ae.useProgram(Le),T("uModel2d",Le,"uModel",!1,r.array()),T("uView2d",Le,"uView",!1,i.array()),C("uColor2d",Le,"uColor",ft),M("uIsDrawingText2d",Le,"uIsDrawingText",!1),_("vertex2d",Le,"aVertex",3,Ne),R("aTextureCoord2d",Le,"aTextureCoord"),Ae.drawArrays(Ae.LINES,0,Vn.length/3))}
var fr=function(){var e
for(Qe=[],e=0;e

Web Proxy Viewer  |  New URL  |  Original Page