28 lines
806 KiB
JavaScript
28 lines
806 KiB
JavaScript
|
var SpeRuntime=function(e,t){"use strict";class r extends t.Raycaster{setFromCamera(e,t){"OrthographicCamera"===t.cameraType?(this.ray.origin.set(e.x,e.y,-1).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):"PerspectiveCamera"===t.cameraType?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):console.error("Raycaster: Unsupported camera type.")}createRaycastLineHelper(){const e=new t.LineBasicMaterial({color:16711680,linewidth:10}),r=new t.Vector3(this.ray.origin.x,this.ray.origin.y,this.ray.origin.z),i=new t.Vector3(this.ray.direction.x,this.ray.direction.y,this.ray.direction.z),n=(new t.Vector3).lerpVectors(r,i,.5);i.multiplyScalar(0);const s=new t.BufferGeometry;return s.setAttribute("position",new t.BufferAttribute([r.x,r.y,r.z,n.x,n.y,n.z,i.x,i.y,i.z],3)),new t.Line(s,e)}}function i(e,t,r){r.x=e.x*t.x,r.y=e.y,r.z=e.x*t.y}function n(e){return new t.Vector2(e.y,-e.x)}class s extends t.BufferGeometry{constructor(e,r,s,o,a,l,c,h,u,d,p,f,m=!1){super(),this.type="RoundedCylinderBufferGeometry",e=void 0!==e?e:1,r=void 0!==r?r:1,s=s||1,o=Math.floor(o)||8,a=Math.floor(a)||1,l=void 0!==l&&l,c=void 0!==c?c:0,h=void 0!==h?h:2*Math.PI,l&&(u=0,d=0);const g=[],v=[],y=[],A=[];let w=0;const x=s/2,b=new t.Vector3,S=new t.Vector3;m&&0==e&&(e=u),m&&0==r&&(r=d);const E=new t.Vector2(e,x),C=new t.Vector2(r,-x);let T=null,O=null,D=null,M=null,_=E.clone().sub(C),N=0,L=0,B=0;f>0&&(N=Math.min(e,r)*(1-f),L=e-N,B=r-N);const I=E.clone();I.x-=N;const P=Math.PI-_.angle(),R=_.angle(),F=Math.tan(R/2),U=Math.tan(P/2),z=F+U,k=f?z:U,G=f?z:F;if(u=Math.min(u,(e-L)/k,_.length()/z),d=Math.min(d,(r-B)/G,_.length()/z),u>0){const e=u/F;T=E.clone().sub(new t.Vector2(e,u)),f&&(D=T.clone(),D.x-=N-z*u),E.sub(_.clone().setLength(e))}if(d>0){const e=d/U;O=C.clone().sub(new t.Vector2(e,-d)),C.add(_.clone().setLength(e)),f&&(M=O.clone(),M.x-=N-z*d,I.sub(_.clone().setLength(e)))}_=E.clone().sub(C);const j=_.length()<.5,V=[];for(let p=0;p<=o;p++){const m=[],g=p/o,x=g*h+c,E=new t.Vector2(Math.sin(x),Math.cos(x));M&&O?(H(m,g,E,P,d,M,-1,!0),H(m,g,E,R,d,O,-1,!1)):O?(J(m,E,O.x,0,-1),H(m,g,E,R,d,O,-1,!1)):l||J(m,E,r,B,-1);if(i(n(_).normalize(),E,b),!j)for(let e=0;e<=a;e++){const t=e/a;i(_.clone().multiplyScalar(t).add(C),E,S),v.push(S.x,S.y,S.z),y.push(b.x,b.y,b.z),A.push(g,.5+S.y/s),m.push(w++)}if(D&&T?(H(m,g,E,P,u,T,1,!1),H(m,g,E,R,u,D,1,!0)):T?(H(m,g,E,P,u,T,1,!1),J(m,E,T.x,0,1)):l||J(m,E,e,L,1),f&&!j){i(n(_).multiplyScalar(-1).normalize(),E,b);for(let e=0;e<=a;e++){const t=e/a;i(_.clone().multiplyScalar(-t).add(I),E,S),v.push(S.x,S.y,S.z),y.push(b.x,b.y,b.z),A.push(g,.5+S.y/s),m.push(w++)}}f&&!l&&m.push(m[0]),V.push(m)}for(let e=0;e<V.length-1;e++)for(let t=0;t<V[0].length-1;t++){if(l&&f&&t==a)continue;const r=V[e][t],i=V[e+1][t],n=V[e+1][t+1],s=V[e][t+1],o=v[3*n+0],c=v[3*n+2];g.push(r,i,s),0==o&&0==c||g.push(i,n,s)}function H(e,r,n,o,a,l,c,h){for(let u=0;u<p+1;u++){const d=u/p;let f=c<0?d:1-d;h&&(f-=1),f*=o;const m=new t.Vector2(Math.sin(f),Math.cos(f)*c);i(m.clone().multiplyScalar(a).add(l),n,S),v.push(S.x,S.y,S.z),i(m,n,b),y.push(b.x,b.y,b.z),A.push(r,.5+S.y/s),e.push(w++)}}function J(e,r,n,s,o){const a=new t.Vector3,l=new t.Vector2,c=[n,s];o<0&&c.reverse();for(const t of c)l.set(t,x*o),i(l,r,a),v.push(a.x,a.y,a.z),y.push(0,o,0),A.push(.5,.5),e.push(w++)}function Q(n,s,o){const a=new t.Vector2(Math.sin(o),Math.cos(o)),l=new t.Vector2(-Math.cos(o),Math.sin(o)),c=new t.Vector3,h=n<0?(e,t,r)=>g.push(e,t,r):(e,t,r)=>g.push(e,r,t);i(new t.Vector2((e+r+L+B)/4,0),a,c),v.push(c.x,c.y,c.z),y.push(l.x,0,l.y),A.push(.5,.5);const u=w++;for(const e of s){const t=v.slice(3*e,3*e+3);v.push(...t),y.push(l.x,0,l.y);const r=A.slice(2*e,2*e+2);A.push(...r),w++}for(let e=u+1;e<w-1;e++)h(u,e,e+1);h(u,w-1,u+1)}h<2*Math.PI&&(Q(-1,V[0],c),Q(1,V[V.length-1],c+h)),this.setIndex(g),this.setAttribute("position",new t.Float32BufferAttribute(v,3)),this.setAttribute("normal",new t.Float32BufferAttribute(y,3)),this.setAttribute("uv",new t.Float32BufferAttrib
|
||
|
/*! *****************************************************************************
|
||
|
Copyright (c) Microsoft Corporation.
|
||
|
|
||
|
Permission to use, copy, modify, and/or distribute this software for any
|
||
|
purpose with or without fee is hereby granted.
|
||
|
|
||
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||
|
PERFORMANCE OF THIS SOFTWARE.
|
||
|
***************************************************************************** */function er(e,t,r,i){return new(r||(r=Promise))((function(n,s){function o(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}l((i=i.apply(e,t||[])).next())}))}class tr{constructor(e){e=null!=e?e:{},this.name=e.name,this.type=e.type,this.node=e.node,this.size=e.size,this.needsUpdate=e.needsUpdate}get value(){return this.node.value}set value(e){this.node.value=e}}class rr extends pt{constructor(e=0,r,i,n){super("v4"),this.nodeType="Vector4",this.value=e instanceof t.Vector4?e:new t.Vector4(e,r,i,n)}generateReadonly(e,t,r,i,n,s){return e.format("vec4("+this.value.x+", "+this.value.y+", "+this.value.z+", "+this.value.w+")",i,t)}copy(e){return super.copy(e),this.value.copy(e.value),this}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.x=this.value.x,t.y=this.value.y,t.z=this.value.z,t.w=this.value.w,!0===this.getReadonly()&&(t.readonly=!0)),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.x&&(this.value.x=e.x),e.y&&(this.value.y=e.y),e.z&&(this.value.z=e.z),e.w&&(this.value.w=e.w),void 0!==e.readonly&&(this.readonly=e.readonly),this}}ft.addShortcuts(rr.prototype,"value",["x","y","z","w"]);const ir=new RegExp("^structs*([a-z_0-9]+)s*{s*((.|\n)*?)}","gim"),nr=new RegExp("s*(w*?)s*(w*?)(=|;)","gim");class sr extends dt{constructor(e=""){super(),this.inputs=[],this.src="",this.nodeType="Struct",this.parse(e)}getType(e){return e.getTypeByFormat(this.name)}getInputByName(e){let t=this.inputs.length;for(;t--;)if(this.inputs[t].name===e)return this.inputs[t]}generate(e,t,r,i,n){return"source"===t?this.src+";":e.format("( "+this.src+" )",this.getType(e),t)}parse(e=""){this.src=e,this.inputs=[];const t=ir.exec(e);if(t){const e=t[2];let r;for(;r=nr.exec(e);)this.inputs.push({type:r[1],name:r[2]});this.name=t[1]}else this.name="";this.type=this.name}toJSON(e){let t=this.getJSONNode(e);return t||(t=this.createJSONNode(e),t.src=this.src),t.nodeType=this.nodeType,t}fromJSON(e,t){return super.fromJSON(e,t),e.src&&(this.src=e.src,this.parse(this.src)),this}}class or extends dt{constructor(e,t){super(),this.inputs=[],this.nodeType="FunctionCall",this.value=e,this.inputs=null!=t?t:[]}getFunction(){return this.value}getType(e){return this.value.getType(e)}generate(e,t,r,i,n){i=this.getType(e);const s=this.value;let o=s.build(e,t)+"( ";const a=[];if(s.inputs){for(let t=0;t<s.inputs.length;t++){const r=s.inputs[t],i=this.inputs[t]||this.inputs[r.name];a.push(i.build(e,e.getTypeByFormat(r.type)))}o+=a.join(", ")+" )"}return e.format(o,i,t)}copy(e){return super.copy(e),this.value.copy(e.value),this.inputs=e.inputs.map((e=>e.clone())),this}toJSON(e){var t;let r=this.getJSONNode(e);if(!r){const i=this.value;if(r=this.createJSONNode(e),r.value=this.value.toJSON(e).uuid,null===(t=i.inputs)||void 0===t?void 0:t.length){r.inputs={};for(let t=0;t<i.inputs.length;t++){const n=i.inputs[t],s=this.inputs[t];r.inputs[n.name]=s.toJSON(e).uuid}}}return r}}var ar;!function(e){e.RAD="radians",e.DEG="degrees",e.EXP="exp",e.EXP2="exp2",e.LOG="log",e.LOG2="log2",e.SQRT="sqrt",e.INV_SQRT="inversesqrt",e.FLOOR="floor",e.CEIL="ceil",e.NORMALIZE="normalize",e.FRACT="fract",e.SATURATE="saturate",e.SIN="sin",e.COS="cos",e.TAN="tan",e.ASIN="asin",e.ACOS="acos",e.ARCTAN="atan",e.ABS="abs",e.SIGN="sign",e.LENGTH="length",e.NEGATE="negate",e.INVERT="invert",e.MIN="min",e.MAX="max",e.MOD="mod",e.STEP="step",e.REFLECT="reflect",e.DISTANCE="distance",e.DOT="dot",e.CROSS="cross",e.POW="pow",e.MIX="mix",e.CLAMP="clamp",e.REFRACT="refract",e.SMOOTHSTEP="smoothstep",e.FACEFORWARD="faceforward"}(ar||(ar={}));class lr extends dt{constructor(e=new ut,t=lr.ABS,r,i){super(),this.nodeType="Math",this.a=e,"string"!=typeof t?this.b=t:i=t,"string"!=typeof r?this.c=r:i=r,this.method=i,this.hashProperties=["method"]}getNumInputs(e){switch(this.method){case lr.MIX:case lr.CLAMP:case lr.REFRACT:case lr.SMOOTHSTEP:case lr.FACEFORWARD:ret
|
||
|
/**
|
||
|
* postprocessing v6.22.3 build Sat Jul 31 2021
|
||
|
* https://github.com/vanruesc/postprocessing
|
||
|
* Copyright 2021 Raoul van Rüschen
|
||
|
* @license Zlib
|
||
|
*/var As=0,ws=1,xs="varying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}",bs=class extends t.ShaderMaterial{constructor(e=!1,r=!1){super({type:"BokehMaterial",defines:{PASS:e?"2":"1"},uniforms:{kernel64:new t.Uniform(null),kernel16:new t.Uniform(null),inputBuffer:new t.Uniform(null),cocBuffer:new t.Uniform(null),texelSize:new t.Uniform(new t.Vector2),scale:new t.Uniform(1)},fragmentShader:"#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;\n#else\nuniform lowp sampler2D inputBuffer;\n#endif\nuniform lowp sampler2D cocBuffer;uniform vec2 texelSize;uniform float scale;\n#if PASS == 1\nuniform vec4 kernel64[32];\n#else\nuniform vec4 kernel16[8];\n#endif\nvarying vec2 vUv;void main(){\n#ifdef FOREGROUND\nvec2 CoCNearFar=texture2D(cocBuffer,vUv).rg;float CoC=CoCNearFar.r*scale;\n#else\nfloat CoC=texture2D(cocBuffer,vUv).g*scale;\n#endif\nif(CoC==0.0){gl_FragColor=texture2D(inputBuffer,vUv);}else{\n#ifdef FOREGROUND\nvec2 step=texelSize*max(CoC,CoCNearFar.g*scale);\n#else\nvec2 step=texelSize*CoC;\n#endif\n#if PASS == 1\nvec4 acc=vec4(0.0);for(int i=0;i<32;++i){vec4 kernel=kernel64[i];vec2 uv=step*kernel.xy+vUv;acc+=texture2D(inputBuffer,uv);uv=step*kernel.zw+vUv;acc+=texture2D(inputBuffer,uv);}gl_FragColor=acc/64.0;\n#else\nvec4 maxValue=texture2D(inputBuffer,vUv);for(int i=0;i<8;++i){vec4 kernel=kernel16[i];vec2 uv=step*kernel.xy+vUv;maxValue=max(texture2D(inputBuffer,uv),maxValue);uv=step*kernel.zw+vUv;maxValue=max(texture2D(inputBuffer,uv),maxValue);}gl_FragColor=maxValue;\n#endif\n}}",vertexShader:xs,blending:t.NoBlending,depthWrite:!1,depthTest:!1}),this.toneMapped=!1,r&&(this.defines.FOREGROUND="1"),this.generateKernel()}generateKernel(){const e=new Float32Array(128),r=new Float32Array(32);let i=0,n=0;for(let t=0;t<80;++t){const s=2.39996323*t,o=Math.sqrt(t)/Math.sqrt(80),a=o*Math.cos(s),l=o*Math.sin(s);t%5==0?(r[n++]=a,r[n++]=l):(e[i++]=a,e[i++]=l)}const s=[],o=[];for(let r=0;r<128;)s.push(new t.Vector4(e[r++],e[r++],e[r++],e[r++]));for(let e=0;e<32;)o.push(new t.Vector4(r[e++],r[e++],r[e++],r[e++]));this.uniforms.kernel64.value=s,this.uniforms.kernel16.value=o}setTexelSize(e,t){this.uniforms.texelSize.value.set(e,t)}},Ss=class extends t.ShaderMaterial{constructor(e){super({type:"CircleOfConfusionMaterial",defines:{DEPTH_PACKING:"0"},uniforms:{depthBuffer:new t.Uniform(null),focusDistance:new t.Uniform(0),focalLength:new t.Uniform(0),cameraNear:new t.Uniform(.3),cameraFar:new t.Uniform(1e3)},fragmentShader:"#include <common>\n#include <packing>\n#ifdef GL_FRAGMENT_PRECISION_HIGH\nuniform highp sampler2D depthBuffer;\n#else\nuniform mediump sampler2D depthBuffer;\n#endif\nuniform float focusDistance;uniform float focalLength;uniform float cameraNear;uniform float cameraFar;varying vec2 vUv;float readDepth(const in vec2 uv){\n#if DEPTH_PACKING == 3201\nreturn unpackRGBAToDepth(texture2D(depthBuffer,uv));\n#else\nreturn texture2D(depthBuffer,uv).r;\n#endif\n}void main(){float depth=readDepth(vUv);\n#ifdef PERSPECTIVE_CAMERA\nfloat viewZ=perspectiveDepthToViewZ(depth,cameraNear,cameraFar);float linearDepth=viewZToOrthographicDepth(viewZ,cameraNear,cameraFar);\n#else\nfloat linearDepth=depth;\n#endif\nfloat signedDistance=linearDepth-focusDistance;float magnitude=smoothstep(0.0,focalLength,abs(signedDistance));gl_FragColor.rg=vec2(step(signedDistance,0.0)*magnitude,step(0.0,signedDistance)*magnitude);}",vertexShader:xs,blending:t.NoBlending,depthWrite:!1,depthTest:!1}),this.toneMapped=!1,this.adoptCameraSettings(e)}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(e){this.defines.DEPTH_PACKING=e.toFixed(0),this.needsUpdate=!0}adoptCameraSettings(e=null){null!==e&&(this.uniforms.cameraNear.value=e.near,this.uniforms.cameraFar.value=e.far,e instanceof t.PerspectiveCamera?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}},Es=class extends t.ShaderMaterial{constructor(e=new t.Vector2){super({type:"ConvolutionMaterial",uniforms:{inputBuffer:new t.Uniform(null),texelSize:new t.Uniform(new
|
||
|
/*!
|
||
|
|
||
|
pica
|
||
|
https://github.com/nodeca/pica
|
||
|
|
||
|
*/var Xo;!function(e){var t={exports:{}};e(t,t.exports)}((function(e,t){e.exports=function(){function e(t,r,i){function n(o,a){if(!r[o]){if(!t[o]){if(!a&&Wo)return Wo(o);if(s)return s(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var c=r[o]={exports:{}};t[o][0].call(c.exports,(function(e){return n(t[o][1][e]||e)}),c,c.exports,e,t,r,i)}return r[o].exports}for(var s=Wo,o=0;o<i.length;o++)n(i[o]);return n}return e}()({1:[function(e,t,r){var i=e("inherits"),n=e("multimath"),s=e("./mm_unsharp_mask"),o=e("./mm_resize");function a(e){var t=e||[],r={js:t.indexOf("js")>=0,wasm:t.indexOf("wasm")>=0};n.call(this,r),this.features={js:r.js,wasm:r.wasm&&this.has_wasm()},this.use(s),this.use(o)}i(a,n),a.prototype.resizeAndUnsharp=function(e,t){var r=this.resize(e,t);return e.unsharpAmount&&this.unsharp_mask(r,e.toWidth,e.toHeight,e.unsharpAmount,e.unsharpRadius,e.unsharpThreshold),r},t.exports=a},{"./mm_resize":4,"./mm_unsharp_mask":9,inherits:19,multimath:20}],2:[function(e,t,r){function i(e){return e<0?0:e>255?255:e}function n(e,t,r,n,s,o){var a,l,c,h,u,d,p,f,m,g,v,y=0,A=0;for(m=0;m<n;m++){for(u=0,g=0;g<s;g++){for(d=o[u++],p=o[u++],f=y+4*d|0,a=l=c=h=0;p>0;p--)h=h+(v=o[u++])*e[f+3]|0,c=c+v*e[f+2]|0,l=l+v*e[f+1]|0,a=a+v*e[f]|0,f=f+4|0;t[A+3]=i(h+8192>>14),t[A+2]=i(c+8192>>14),t[A+1]=i(l+8192>>14),t[A]=i(a+8192>>14),A=A+4*n|0}A=4*(m+1)|0,y=(m+1)*r*4|0}}function s(e,t,r,n,s,o){var a,l,c,h,u,d,p,f,m,g,v,y=0,A=0;for(m=0;m<n;m++){for(u=0,g=0;g<s;g++){for(d=o[u++],p=o[u++],f=y+4*d|0,a=l=c=h=0;p>0;p--)h=h+(v=o[u++])*e[f+3]|0,c=c+v*e[f+2]|0,l=l+v*e[f+1]|0,a=a+v*e[f]|0,f=f+4|0;t[A+3]=i(h+8192>>14),t[A+2]=i(c+8192>>14),t[A+1]=i(l+8192>>14),t[A]=i(a+8192>>14),A=A+4*n|0}A=4*(m+1)|0,y=(m+1)*r*4|0}}t.exports={convolveHorizontally:n,convolveVertically:s}},{}],3:[function(e,t,r){t.exports="AGFzbQEAAAAADAZkeWxpbmsAAAAAAAEXA2AAAGAGf39/f39/AGAHf39/f39/fwACDwEDZW52Bm1lbW9yeQIAAAMEAwABAgYGAX8AQQALB1cFEV9fd2FzbV9jYWxsX2N0b3JzAAAIY29udm9sdmUAAQpjb252b2x2ZUhWAAIMX19kc29faGFuZGxlAwAYX193YXNtX2FwcGx5X2RhdGFfcmVsb2NzAAAK7AMDAwABC8YDAQ9/AkAgA0UNACAERQ0AA0AgDCENQQAhE0EAIQcDQCAHQQJqIQYCfyAHQQF0IAVqIgcuAQIiFEUEQEGAwAAhCEGAwAAhCUGAwAAhCkGAwAAhCyAGDAELIBIgBy4BAGohCEEAIQsgFCEHQQAhDiAGIQlBACEPQQAhEANAIAUgCUEBdGouAQAiESAAIAhBAnRqKAIAIgpBGHZsIBBqIRAgCkH/AXEgEWwgC2ohCyAKQRB2Qf8BcSARbCAPaiEPIApBCHZB/wFxIBFsIA5qIQ4gCEEBaiEIIAlBAWohCSAHQQFrIgcNAAsgC0GAQGshCCAOQYBAayEJIA9BgEBrIQogEEGAQGshCyAGIBRqCyEHIAEgDUECdGogCUEOdSIGQf8BIAZB/wFIGyIGQQAgBkEAShtBCHRBgP4DcSAKQQ51IgZB/wEgBkH/AUgbIgZBACAGQQBKG0EQdEGAgPwHcSALQQ51IgZB/wEgBkH/AUgbIgZBACAGQQBKG0EYdHJyIAhBDnUiBkH/ASAGQf8BSBsiBkEAIAZBAEobcjYCACADIA1qIQ0gE0EBaiITIARHDQALIAxBAWoiDCACbCESIAMgDEcNAAsLCx4AQQAgAiADIAQgBSAAEAEgAkEAIAQgBSAGIAEQAQs="},{}],4:[function(e,t,r){t.exports={name:"resize",fn:e("./resize"),wasm_fn:e("./resize_wasm"),wasm_src:e("./convolve_wasm_base64")}},{"./convolve_wasm_base64":3,"./resize":5,"./resize_wasm":8}],5:[function(e,t,r){var i=e("./resize_filter_gen"),n=e("./convolve").convolveHorizontally,s=e("./convolve").convolveVertically;function o(e,t,r){for(var i=3,n=t*r*4|0;i<n;)e[i]=255,i=i+4|0}t.exports=function(e){var t=e.src,r=e.width,a=e.height,l=e.toWidth,c=e.toHeight,h=e.scaleX||e.toWidth/e.width,u=e.scaleY||e.toHeight/e.height,d=e.offsetX||0,p=e.offsetY||0,f=e.dest||new Uint8Array(l*c*4),m=void 0===e.quality?3:e.quality,g=e.alpha||!1,v=i(m,r,l,h,d),y=i(m,a,c,u,p),A=new Uint8Array(l*a*4);return n(t,A,r,a,l,v),s(A,f,a,l,c,y),g||o(f,l,c),f}},{"./convolve":2,"./resize_filter_gen":6}],6:[function(e,t,r){var i=e("./resize_filter_info"),n=14;function s(e){return Math.round(e*((1<<n)-1))}t.exports=function(e,t,r,n,o){var a,l,c,h,u,d,p,f,m,g,v,y,A,w,x,b,S,E=i[e].filter,C=1/n,T=Math.min(1,n),O=i[e].win/T,D=Math.floor(2*(O+1)),M=new Int16Array((D+2)*r),_=0,N=!M.subarray||!M.set;for(a=0;a<r;a++){for(l=(a+.5)*C+o,c=Math.max(0,Math.floor(l-O)),u=(h=Math.min(t-1,Math.ceil(l+O)))-c+1,d=new Float32Array(u),p=new Int16Array(u),f=0,m=c,g=0;m<=h;m++,g++)f+=v=E((m+.5-l)*T),d[g]=v;for(y=0,g=0;g<d.length;g++)y+=A=d[g]/f,p[g]=s(A);for(p[r>>1]+=s(1-y),w=0;w<p.length&&0===p[w];)w++;if(w<p
|