diff --git a/demo/README.md b/demo/README.md new file mode 100644 index 000000000..1768a9ced --- /dev/null +++ b/demo/README.md @@ -0,0 +1,4 @@ +The goal of this empty directory is to maintain backward-compatibility with old URLs. For example: + +* `pixijs.io/filters/demo` => `pixijs.io/filters/examples` +* `filters.pixijs.download/main/demo/index.html` => `filters.pixijs.download/main/examples/index.html` \ No newline at end of file diff --git a/demo/index.html b/demo/index.html new file mode 100644 index 000000000..3999053aa --- /dev/null +++ b/demo/index.html @@ -0,0 +1,13 @@ + + + + + PixiJS Filters - Redirecting... + + + + + + \ No newline at end of file diff --git a/dist/pixi-filters.js b/dist/pixi-filters.js new file mode 100644 index 000000000..32a3fa237 --- /dev/null +++ b/dist/pixi-filters.js @@ -0,0 +1,4290 @@ +/*! + * pixi-filters - v6.0.0 + * Compiled Thu, 07 Mar 2024 01:51:58 UTC + * + * pixi-filters is licensed under the MIT License. + * http://www.opensource.org/licenses/mit-license + * + * Copyright 2024, undefined, All Rights Reserved + */this.PIXI=this.PIXI||{},this.PIXI.filters=function(s,i){"use strict";var c=`in vec2 aPosition; +out vec2 vTextureCoord; + +uniform vec4 uInputSize; +uniform vec4 uOutputFrame; +uniform vec4 uOutputTexture; + +vec4 filterVertexPosition( void ) +{ + vec2 position = aPosition * uOutputFrame.zw + uOutputFrame.xy; + + position.x = position.x * (2.0 / uOutputTexture.x) - 1.0; + position.y = position.y * (2.0*uOutputTexture.z / uOutputTexture.y) - uOutputTexture.z; + + return vec4(position, 0.0, 1.0); +} + +vec2 filterTextureCoord( void ) +{ + return aPosition * (uOutputFrame.zw * uInputSize.zw); +} + +void main(void) +{ + gl_Position = filterVertexPosition(); + vTextureCoord = filterTextureCoord(); +} +`,m=`struct GlobalFilterUniforms { + uInputSize:vec4, + uInputPixel:vec4, + uInputClamp:vec4, + uOutputFrame:vec4, + uGlobalFrame:vec4, + uOutputTexture:vec4, +}; + +@group(0) @binding(0) var gfu: GlobalFilterUniforms; + +struct VSOutput { + @builtin(position) position: vec4, + @location(0) uv : vec2 + }; + +fn filterVertexPosition(aPosition:vec2) -> vec4 +{ + var position = aPosition * gfu.uOutputFrame.zw + gfu.uOutputFrame.xy; + + position.x = position.x * (2.0 / gfu.uOutputTexture.x) - 1.0; + position.y = position.y * (2.0*gfu.uOutputTexture.z / gfu.uOutputTexture.y) - gfu.uOutputTexture.z; + + return vec4(position, 0.0, 1.0); +} + +fn filterTextureCoord( aPosition:vec2 ) -> vec2 +{ + return aPosition * (gfu.uOutputFrame.zw * gfu.uInputSize.zw); +} + +fn globalTextureCoord( aPosition:vec2 ) -> vec2 +{ + return (aPosition.xy / gfu.uGlobalFrame.zw) + (gfu.uGlobalFrame.xy / gfu.uGlobalFrame.zw); +} + +fn getSize() -> vec2 +{ + return gfu.uGlobalFrame.zw; +} + +@vertex +fn mainVertex( + @location(0) aPosition : vec2, +) -> VSOutput { + return VSOutput( + filterVertexPosition(aPosition), + filterTextureCoord(aPosition) + ); +}`,wt=`in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform float uGamma; +uniform float uContrast; +uniform float uSaturation; +uniform float uBrightness; +uniform vec4 uColor; + +void main() +{ + vec4 c = texture(uTexture, vTextureCoord); + + if (c.a > 0.0) { + c.rgb /= c.a; + + vec3 rgb = pow(c.rgb, vec3(1. / uGamma)); + rgb = mix(vec3(.5), mix(vec3(dot(vec3(.2125, .7154, .0721), rgb)), rgb, uSaturation), uContrast); + rgb.r *= uColor.r; + rgb.g *= uColor.g; + rgb.b *= uColor.b; + c.rgb = rgb * uBrightness; + + c.rgb *= c.a; + } + + finalColor = c * uColor.a; +} +`,At=`struct AdjustmentUniforms { + uGamma: f32, + uContrast: f32, + uSaturation: f32, + uBrightness: f32, + uColor: vec4, +}; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var adjustmentUniforms : AdjustmentUniforms; + +@fragment +fn mainFragment( + @location(0) uv: vec2, + @builtin(position) position: vec4 +) -> @location(0) vec4 { + var sample = textureSample(uTexture, uSampler, uv); + let color = adjustmentUniforms.uColor; + + if (sample.a > 0.0) + { + sample = vec4(sample.rgb / sample.a, sample.a); + var rgb: vec3 = pow(sample.rgb, vec3(1. / adjustmentUniforms.uGamma)); + rgb = mix(vec3(.5), mix(vec3(dot(vec3(.2125, .7154, .0721), rgb)), rgb, adjustmentUniforms.uSaturation), adjustmentUniforms.uContrast); + rgb.r *= color.r; + rgb.g *= color.g; + rgb.b *= color.b; + sample = vec4(rgb.rgb * adjustmentUniforms.uBrightness, sample.a); + sample = vec4(sample.rgb * sample.a, sample.a); + } + + return sample * color.a; +}`,It=Object.defineProperty,Ve=Object.getOwnPropertySymbols,Ut=Object.prototype.hasOwnProperty,_t=Object.prototype.propertyIsEnumerable,j=(r,e,n)=>e in r?It(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,Xe=(r,e)=>{for(var n in e||(e={}))Ut.call(e,n)&&j(r,n,e[n]);if(Ve)for(var n of Ve(e))_t.call(e,n)&&j(r,n,e[n]);return r},Ye=(r,e,n)=>(j(r,typeof e!="symbol"?e+"":e,n),n);const Ke=class Qr extends i.Filter{constructor(e){e=Xe(Xe({},Qr.DEFAULT_OPTIONS),e);const n=i.GpuProgram.from({vertex:{source:m,entryPoint:"mainVertex"},fragment:{source:At,entryPoint:"mainFragment"}}),t=i.GlProgram.from({vertex:c,fragment:wt,name:"adjustment-filter"});super({gpuProgram:n,glProgram:t,resources:{adjustmentUniforms:{uGamma:{value:e.gamma,type:"f32"},uContrast:{value:e.contrast,type:"f32"},uSaturation:{value:e.saturation,type:"f32"},uBrightness:{value:e.brightness,type:"f32"},uColor:{value:[e.red,e.green,e.blue,e.alpha],type:"vec4"}}}}),Ye(this,"uniforms"),this.uniforms=this.resources.adjustmentUniforms.uniforms}get gamma(){return this.uniforms.uGamma}set gamma(e){this.uniforms.uGamma=e}get contrast(){return this.uniforms.uContrast}set contrast(e){this.uniforms.uContrast=e}get saturation(){return this.uniforms.uSaturation}set saturation(e){this.uniforms.uSaturation=e}get brightness(){return this.uniforms.uBrightness}set brightness(e){this.uniforms.uBrightness=e}get red(){return this.uniforms.uColor[0]}set red(e){this.uniforms.uColor[0]=e}get green(){return this.uniforms.uColor[1]}set green(e){this.uniforms.uColor[1]=e}get blue(){return this.uniforms.uColor[2]}set blue(e){this.uniforms.uColor[2]=e}get alpha(){return this.uniforms.uColor[3]}set alpha(e){this.uniforms.uColor[3]=e}};Ye(Ke,"DEFAULT_OPTIONS",{gamma:1,contrast:1,saturation:1,brightness:1,red:1,green:1,blue:1,alpha:1});let Rt=Ke;var Dt=` +in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform vec2 uOffset; + +void main(void) +{ + vec4 color = vec4(0.0); + + // Sample top left pixel + color += texture(uTexture, vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y + uOffset.y)); + + // Sample top right pixel + color += texture(uTexture, vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y + uOffset.y)); + + // Sample bottom right pixel + color += texture(uTexture, vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y - uOffset.y)); + + // Sample bottom left pixel + color += texture(uTexture, vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y - uOffset.y)); + + // Average + color *= 0.25; + + finalColor = color; +}`,$t=`struct KawaseBlurUniforms { + uOffset:vec2, +}; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var kawaseBlurUniforms : KawaseBlurUniforms; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 +) -> @location(0) vec4 { + let uOffset = kawaseBlurUniforms.uOffset; + var color: vec4 = vec4(0.0); + + // Sample top left pixel + color += textureSample(uTexture, uSampler, vec2(uv.x - uOffset.x, uv.y + uOffset.y)); + // Sample top right pixel + color += textureSample(uTexture, uSampler, vec2(uv.x + uOffset.x, uv.y + uOffset.y)); + // Sample bottom right pixel + color += textureSample(uTexture, uSampler, vec2(uv.x + uOffset.x, uv.y - uOffset.y)); + // Sample bottom left pixel + color += textureSample(uTexture, uSampler, vec2(uv.x - uOffset.x, uv.y - uOffset.y)); + // Average + color *= 0.25; + + return color; +}`,Gt=` +precision highp float; +in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform vec2 uOffset; + +uniform vec4 uInputClamp; + +void main(void) +{ + vec4 color = vec4(0.0); + + // Sample top left pixel + color += texture(uTexture, clamp(vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y + uOffset.y), uInputClamp.xy, uInputClamp.zw)); + + // Sample top right pixel + color += texture(uTexture, clamp(vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y + uOffset.y), uInputClamp.xy, uInputClamp.zw)); + + // Sample bottom right pixel + color += texture(uTexture, clamp(vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y - uOffset.y), uInputClamp.xy, uInputClamp.zw)); + + // Sample bottom left pixel + color += texture(uTexture, clamp(vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y - uOffset.y), uInputClamp.xy, uInputClamp.zw)); + + // Average + color *= 0.25; + + finalColor = color; +} +`,Mt=`struct KawaseBlurUniforms { + uOffset:vec2, +}; + +struct GlobalFilterUniforms { + uInputSize:vec4, + uInputPixel:vec4, + uInputClamp:vec4, + uOutputFrame:vec4, + uGlobalFrame:vec4, + uOutputTexture:vec4, +}; + +@group(0) @binding(0) var gfu: GlobalFilterUniforms; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var kawaseBlurUniforms : KawaseBlurUniforms; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 +) -> @location(0) vec4 { + let uOffset = kawaseBlurUniforms.uOffset; + var color: vec4 = vec4(0.0); + + // Sample top left pixel + color += textureSample(uTexture, uSampler, clamp(vec2(uv.x - uOffset.x, uv.y + uOffset.y), gfu.uInputClamp.xy, gfu.uInputClamp.zw)); + // Sample top right pixel + color += textureSample(uTexture, uSampler, clamp(vec2(uv.x + uOffset.x, uv.y + uOffset.y), gfu.uInputClamp.xy, gfu.uInputClamp.zw)); + // Sample bottom right pixel + color += textureSample(uTexture, uSampler, clamp(vec2(uv.x + uOffset.x, uv.y - uOffset.y), gfu.uInputClamp.xy, gfu.uInputClamp.zw)); + // Sample bottom left pixel + color += textureSample(uTexture, uSampler, clamp(vec2(uv.x - uOffset.x, uv.y - uOffset.y), gfu.uInputClamp.xy, gfu.uInputClamp.zw)); + // Average + color *= 0.25; + + return color; +}`,Et=Object.defineProperty,We=Object.getOwnPropertySymbols,Lt=Object.prototype.hasOwnProperty,kt=Object.prototype.propertyIsEnumerable,H=(r,e,n)=>e in r?Et(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,qe=(r,e)=>{for(var n in e||(e={}))Lt.call(e,n)&&H(r,n,e[n]);if(We)for(var n of We(e))kt.call(e,n)&&H(r,n,e[n]);return r},T=(r,e,n)=>(H(r,typeof e!="symbol"?e+"":e,n),n);const je=class Jr extends i.Filter{constructor(...e){var n,t,o;let u=(n=e[0])!=null?n:{};(typeof u=="number"||Array.isArray(u))&&(i.deprecation("6.0.0","KawaseBlurFilter constructor params are now options object. See params: { strength, quality, clamp, pixelSize }"),u={strength:u},e[1]!==void 0&&(u.quality=e[1]),e[2]!==void 0&&(u.clamp=e[2])),u=qe(qe({},Jr.DEFAULT_OPTIONS),u);const l=i.GpuProgram.from({vertex:{source:m,entryPoint:"mainVertex"},fragment:{source:u!=null&&u.clamp?Mt:$t,entryPoint:"mainFragment"}}),a=i.GlProgram.from({vertex:c,fragment:u!=null&&u.clamp?Gt:Dt,name:"kawase-blur-filter"});super({gpuProgram:l,glProgram:a,resources:{kawaseBlurUniforms:{uOffset:{value:new Float32Array(2),type:"vec2"}}}}),T(this,"uniforms"),T(this,"_pixelSize",{x:0,y:0}),T(this,"_clamp"),T(this,"_kernels",[]),T(this,"_blur"),T(this,"_quality"),this.uniforms=this.resources.kawaseBlurUniforms.uniforms,this.pixelSize=(t=u.pixelSize)!=null?t:{x:1,y:1},Array.isArray(u.strength)?this.kernels=u.strength:typeof u.strength=="number"&&(this._blur=u.strength,this.quality=(o=u.quality)!=null?o:3),this._clamp=!!u.clamp}apply(e,n,t,o){const u=this.pixelSizeX/n.source.width,l=this.pixelSizeY/n.source.height;let a;if(this._quality===1||this._blur===0)a=this._kernels[0]+.5,this.uniforms.uOffset[0]=a*u,this.uniforms.uOffset[1]=a*l,e.applyFilter(this,n,t,o);else{const p=i.TexturePool.getSameSizeTexture(n);let v=n,h=p,R;const D=this._quality-1;for(let $=0;$0?(this._kernels=e,this._quality=e.length,this._blur=Math.max(...e)):(this._kernels=[0],this._quality=1)}get pixelSize(){return this._pixelSize}set pixelSize(e){if(typeof e=="number"){this.pixelSizeX=this.pixelSizeY=e;return}if(Array.isArray(e)){this.pixelSizeX=e[0],this.pixelSizeY=e[1];return}this._pixelSize=e}get pixelSizeX(){return this.pixelSize.x}set pixelSizeX(e){this.pixelSize.x=e}get pixelSizeY(){return this.pixelSize.y}set pixelSizeY(e){this.pixelSize.y=e}get clamp(){return this._clamp}_updatePadding(){this.padding=Math.ceil(this._kernels.reduce((e,n)=>e+n+.5,0))}_generateKernels(){const e=this._blur,n=this._quality,t=[e];if(e>0){let o=e;const u=e/n;for(let l=1;l; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var advancedBloomUniforms : AdvancedBloomUniforms; +@group(1) @binding(1) var uMapTexture: texture_2d; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 +) -> @location(0) vec4 { + var color = textureSample(uTexture, uSampler, uv); + color = vec4(color.rgb * advancedBloomUniforms.uBrightness, color.a); + + var bloomColor = vec4(textureSample(uMapTexture, uSampler, uv).rgb, 0.0); + bloomColor = vec4(bloomColor.rgb * advancedBloomUniforms.uBloomScale, bloomColor.a); + + return color + bloomColor; +} +`,Vt=` +in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform float uThreshold; + +void main() { + vec4 color = texture(uTexture, vTextureCoord); + + // A simple & fast algorithm for getting brightness. + // It's inaccuracy , but good enought for this feature. + float _max = max(max(color.r, color.g), color.b); + float _min = min(min(color.r, color.g), color.b); + float brightness = (_max + _min) * 0.5; + + if(brightness > uThreshold) { + finalColor = color; + } else { + finalColor = vec4(0.0, 0.0, 0.0, 0.0); + } +} +`,Xt=`struct ExtractBrightnessUniforms { + uThreshold: f32, +}; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var extractBrightnessUniforms : ExtractBrightnessUniforms; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 +) -> @location(0) vec4 { + let color: vec4 = textureSample(uTexture, uSampler, uv); + + // A simple & fast algorithm for getting brightness. + // It's inaccurate, but good enough for this feature. + let max: f32 = max(max(color.r, color.g), color.b); + let min: f32 = min(min(color.r, color.g), color.b); + let brightness: f32 = (max + min) * 0.5; + + return select(vec4(0.), color, brightness > extractBrightnessUniforms.uThreshold); +} +`,Yt=Object.defineProperty,He=Object.getOwnPropertySymbols,Kt=Object.prototype.hasOwnProperty,Wt=Object.prototype.propertyIsEnumerable,Q=(r,e,n)=>e in r?Yt(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,Ze=(r,e)=>{for(var n in e||(e={}))Kt.call(e,n)&&Q(r,n,e[n]);if(He)for(var n of He(e))Wt.call(e,n)&&Q(r,n,e[n]);return r},Qe=(r,e,n)=>(Q(r,typeof e!="symbol"?e+"":e,n),n);const Je=class et extends i.Filter{constructor(e){e=Ze(Ze({},et.DEFAULT_OPTIONS),e);const n=i.GpuProgram.from({vertex:{source:m,entryPoint:"mainVertex"},fragment:{source:Xt,entryPoint:"mainFragment"}}),t=i.GlProgram.from({vertex:c,fragment:Vt,name:"extract-brightness-filter"});super({gpuProgram:n,glProgram:t,resources:{extractBrightnessUniforms:{uThreshold:{value:e.threshold,type:"f32"}}}}),Qe(this,"uniforms"),this.uniforms=this.resources.extractBrightnessUniforms.uniforms}get threshold(){return this.uniforms.uThreshold}set threshold(e){this.uniforms.uThreshold=e}};Qe(Je,"DEFAULT_OPTIONS",{threshold:.5});let qt=Je;var jt=Object.defineProperty,en=Object.getOwnPropertySymbols,Ht=Object.prototype.hasOwnProperty,Zt=Object.prototype.propertyIsEnumerable,J=(r,e,n)=>e in r?jt(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,nn=(r,e)=>{for(var n in e||(e={}))Ht.call(e,n)&&J(r,n,e[n]);if(en)for(var n of en(e))Zt.call(e,n)&&J(r,n,e[n]);return r},w=(r,e,n)=>(J(r,typeof e!="symbol"?e+"":e,n),n);const rn=class nt extends i.Filter{constructor(e){var n;e=nn(nn({},nt.DEFAULT_OPTIONS),e);const t=i.GpuProgram.from({vertex:{source:m,entryPoint:"mainVertex"},fragment:{source:Nt,entryPoint:"mainFragment"}}),o=i.GlProgram.from({vertex:c,fragment:Bt,name:"advanced-bloom-filter"});super({gpuProgram:t,glProgram:o,resources:{advancedBloomUniforms:{uBloomScale:{value:e.bloomScale,type:"f32"},uBrightness:{value:e.brightness,type:"f32"}},uMapTexture:i.Texture.WHITE}}),w(this,"uniforms"),w(this,"bloomScale",1),w(this,"brightness",1),w(this,"_extractFilter"),w(this,"_blurFilter"),this.uniforms=this.resources.advancedBloomUniforms.uniforms,this._extractFilter=new qt({threshold:e.threshold}),this._blurFilter=new Z({strength:(n=e.kernels)!=null?n:e.blur,quality:e.kernels?void 0:e.quality}),Object.assign(this,e)}apply(e,n,t,o){const u=i.TexturePool.getSameSizeTexture(n);this._extractFilter.apply(e,n,u,!0);const l=i.TexturePool.getSameSizeTexture(n);this._blurFilter.apply(e,u,l,!0),this.uniforms.uBloomScale=this.bloomScale,this.uniforms.uBrightness=this.brightness,this.resources.uMapTexture=l.source,e.applyFilter(this,n,t,o),i.TexturePool.returnTexture(l),i.TexturePool.returnTexture(u)}get threshold(){return this._extractFilter.threshold}set threshold(e){this._extractFilter.threshold=e}get kernels(){return this._blurFilter.kernels}set kernels(e){this._blurFilter.kernels=e}get blur(){return this._blurFilter.strength}set blur(e){this._blurFilter.strength=e}get quality(){return this._blurFilter.quality}set quality(e){this._blurFilter.quality=e}get pixelSize(){return this._blurFilter.pixelSize}set pixelSize(e){typeof e=="number"&&(e={x:e,y:e}),Array.isArray(e)&&(e={x:e[0],y:e[1]}),this._blurFilter.pixelSize=e}get pixelSizeX(){return this._blurFilter.pixelSizeX}set pixelSizeX(e){this._blurFilter.pixelSizeX=e}get pixelSizeY(){return this._blurFilter.pixelSizeY}set pixelSizeY(e){this._blurFilter.pixelSizeY=e}};w(rn,"DEFAULT_OPTIONS",{threshold:.5,bloomScale:1,brightness:1,blur:8,quality:4,pixelSize:{x:1,y:1}});let Qt=rn;var Jt=`precision highp float; +in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform float uSize; +uniform vec3 uColor; +uniform float uReplaceColor; + +uniform vec4 uInputSize; + +vec2 mapCoord( vec2 coord ) +{ + coord *= uInputSize.xy; + coord += uInputSize.zw; + + return coord; +} + +vec2 unmapCoord( vec2 coord ) +{ + coord -= uInputSize.zw; + coord /= uInputSize.xy; + + return coord; +} + +vec2 pixelate(vec2 coord, vec2 size) +{ + return floor(coord / size) * size; +} + +vec2 getMod(vec2 coord, vec2 size) +{ + return mod(coord, size) / size; +} + +float character(float n, vec2 p) +{ + p = floor(p*vec2(4.0, 4.0) + 2.5); + + if (clamp(p.x, 0.0, 4.0) == p.x) + { + if (clamp(p.y, 0.0, 4.0) == p.y) + { + if (int(mod(n/exp2(p.x + 5.0*p.y), 2.0)) == 1) return 1.0; + } + } + return 0.0; +} + +void main() +{ + vec2 coord = mapCoord(vTextureCoord); + + // get the grid position + vec2 pixCoord = pixelate(coord, vec2(uSize)); + pixCoord = unmapCoord(pixCoord); + + // sample the color at grid position + vec4 color = texture(uTexture, pixCoord); + + // brightness of the color as it's perceived by the human eye + float gray = 0.3 * color.r + 0.59 * color.g + 0.11 * color.b; + + // determine the character to use + float n = 65536.0; // . + if (gray > 0.2) n = 65600.0; // : + if (gray > 0.3) n = 332772.0; // * + if (gray > 0.4) n = 15255086.0; // o + if (gray > 0.5) n = 23385164.0; // & + if (gray > 0.6) n = 15252014.0; // 8 + if (gray > 0.7) n = 13199452.0; // @ + if (gray > 0.8) n = 11512810.0; // # + + // get the mod.. + vec2 modd = getMod(coord, vec2(uSize)); + + finalColor = (uReplaceColor > 0.5 ? vec4(uColor, 1.) : color) * character( n, vec2(-1.0) + modd * 2.0); +} +`,eo=`struct AsciiUniforms { + uSize: f32, + uColor: vec3, + uReplaceColor: f32, +}; + +struct GlobalFilterUniforms { + uInputSize:vec4, + uInputPixel:vec4, + uInputClamp:vec4, + uOutputFrame:vec4, + uGlobalFrame:vec4, + uOutputTexture:vec4, +}; + +@group(0) @binding(0) var gfu: GlobalFilterUniforms; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var asciiUniforms : AsciiUniforms; + +@fragment +fn mainFragment( + @location(0) uv: vec2, + @builtin(position) position: vec4 +) -> @location(0) vec4 { + let pixelSize: f32 = asciiUniforms.uSize; + let coord: vec2 = mapCoord(uv); + + // get the rounded color.. + var pixCoord: vec2 = pixelate(coord, vec2(pixelSize)); + pixCoord = unmapCoord(pixCoord); + + var color = textureSample(uTexture, uSampler, pixCoord); + + // determine the character to use + let gray: f32 = 0.3 * color.r + 0.59 * color.g + 0.11 * color.b; + + var n: f32 = 65536.0; // . + if (gray > 0.2) { + n = 65600.0; // : + } + if (gray > 0.3) { + n = 332772.0; // * + } + if (gray > 0.4) { + n = 15255086.0; // o + } + if (gray > 0.5) { + n = 23385164.0; // & + } + if (gray > 0.6) { + n = 15252014.0; // 8 + } + if (gray > 0.7) { + n = 13199452.0; // @ + } + if (gray > 0.8) { + n = 11512810.0; // # + } + + // get the mod.. + let modd: vec2 = getMod(coord, vec2(pixelSize)); + return select(color, vec4(asciiUniforms.uColor, 1.), asciiUniforms.uReplaceColor > 0.5) * character(n, vec2(-1.0) + modd * 2.0); +} + +fn pixelate(coord: vec2, size: vec2) -> vec2 +{ + return floor( coord / size ) * size; +} + +fn getMod(coord: vec2, size: vec2) -> vec2 +{ + return moduloVec2( coord , size) / size; +} + +fn character(n: f32, p: vec2) -> f32 +{ + var q: vec2 = floor(p*vec2(4.0, 4.0) + 2.5); + + if (clamp(q.x, 0.0, 4.0) == q.x) + { + if (clamp(q.y, 0.0, 4.0) == q.y) + { + if (i32(modulo(n/exp2(q.x + 5.0*q.y), 2.0)) == 1) + { + return 1.0; + } + } + } + + return 0.0; +} + +fn modulo(x: f32, y: f32) -> f32 +{ + return x - y * floor(x/y); +} + +fn moduloVec2(x: vec2, y: vec2) -> vec2 +{ + return x - y * floor(x/y); +} + +fn mapCoord(coord: vec2 ) -> vec2 +{ + var mappedCoord: vec2 = coord; + mappedCoord *= gfu.uInputSize.xy; + mappedCoord += gfu.uOutputFrame.xy; + return mappedCoord; +} + +fn unmapCoord(coord: vec2 ) -> vec2 +{ + var mappedCoord: vec2 = coord; + mappedCoord -= gfu.uOutputFrame.xy; + mappedCoord /= gfu.uInputSize.xy; + return mappedCoord; +}`,no=Object.defineProperty,tn=Object.getOwnPropertySymbols,ro=Object.prototype.hasOwnProperty,to=Object.prototype.propertyIsEnumerable,ee=(r,e,n)=>e in r?no(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,on=(r,e)=>{for(var n in e||(e={}))ro.call(e,n)&&ee(r,n,e[n]);if(tn)for(var n of tn(e))to.call(e,n)&&ee(r,n,e[n]);return r},ne=(r,e,n)=>(ee(r,typeof e!="symbol"?e+"":e,n),n);const un=class rt extends i.Filter{constructor(...e){var n,t;let o=(n=e[0])!=null?n:{};typeof o=="number"&&(i.deprecation("6.0.0","AsciiFilter constructor params are now options object. See params: { size, color, replaceColor }"),o={size:o});const u=(o==null?void 0:o.color)&&o.replaceColor!==!1;o=on(on({},rt.DEFAULT_OPTIONS),o);const l=i.GpuProgram.from({vertex:{source:m,entryPoint:"mainVertex"},fragment:{source:eo,entryPoint:"mainFragment"}}),a=i.GlProgram.from({vertex:c,fragment:Jt,name:"ascii-filter"});super({gpuProgram:l,glProgram:a,resources:{asciiUniforms:{uSize:{value:o.size,type:"f32"},uColor:{value:new Float32Array(3),type:"vec3"},uReplaceColor:{value:Number(u),type:"f32"}}}}),ne(this,"uniforms"),ne(this,"_color"),this.uniforms=this.resources.asciiUniforms.uniforms,this._color=new i.Color,this.color=(t=o.color)!=null?t:16777215}get size(){return this.uniforms.uSize}set size(e){this.uniforms.uSize=e}get color(){return this._color.value}set color(e){this._color.setValue(e);const[n,t,o]=this._color.toArray();this.uniforms.uColor[0]=n,this.uniforms.uColor[1]=t,this.uniforms.uColor[2]=o}get replaceColor(){return this.uniforms.uReplaceColor>.5}set replaceColor(e){this.uniforms.uReplaceColor=e?1:0}};ne(un,"DEFAULT_OPTIONS",{size:8,color:16777215,replaceColor:!1});let oo=un;var io=`precision highp float; +in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform sampler2D uBackground; + +void main(void){ + vec4 front = texture(uTexture, vTextureCoord); + vec4 back = texture(uBackground, vTextureCoord); + + if (front.a == 0.0) { + discard; + } + + vec3 color = mix(back.rgb, front.rgb / front.a, front.a); + + finalColor = vec4(color, 1.0); +}`,uo=`@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var uBackground: texture_2d; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 +) -> @location(0) vec4 { + var front: vec4 = textureSample(uTexture, uSampler, uv); + var back: vec4 = textureSample(uBackground, uSampler, uv); + + if (front.a == 0.0) { + discard; + } + + var color: vec3 = mix(back.rgb, front.rgb / front.a, front.a); + + return vec4(color, 1.0); +}`,lo=Object.defineProperty,ao=(r,e,n)=>e in r?lo(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,so=(r,e,n)=>(ao(r,typeof e!="symbol"?e+"":e,n),n);class fo extends i.BlurFilter{constructor(e){super(e),so(this,"_blendPass"),this.blendRequired=!0,this.padding=0,this._blendPass=new i.Filter({gpuProgram:i.GpuProgram.from({vertex:{source:m,entryPoint:"mainVertex"},fragment:{source:uo,entryPoint:"mainFragment"}}),glProgram:i.GlProgram.from({vertex:c,fragment:io,name:"drop-shadow-filter"}),resources:{uBackground:i.Texture.EMPTY}})}apply(e,n,t,o){const u=e._activeFilterData.backTexture,l=i.TexturePool.getSameSizeTexture(n);super.apply(e,u,l,!0),this._blendPass.resources.uBackground=l.source,this._blendPass.apply(e,n,t,o),i.TexturePool.returnTexture(l)}updatePadding(){this.padding=0}}var co=`precision highp float; +in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform vec2 uTransform; +uniform vec3 uLightColor; +uniform float uLightAlpha; +uniform vec3 uShadowColor; +uniform float uShadowAlpha; + +uniform vec4 uInputSize; + +void main(void) { + vec2 transform = vec2(1.0 / uInputSize) * vec2(uTransform.x, uTransform.y); + vec4 color = texture(uTexture, vTextureCoord); + float light = texture(uTexture, vTextureCoord - transform).a; + float shadow = texture(uTexture, vTextureCoord + transform).a; + + color.rgb = mix(color.rgb, uLightColor, clamp((color.a - light) * uLightAlpha, 0.0, 1.0)); + color.rgb = mix(color.rgb, uShadowColor, clamp((color.a - shadow) * uShadowAlpha, 0.0, 1.0)); + finalColor = vec4(color.rgb * color.a, color.a); +} +`,mo=`struct BevelUniforms { + uLightColor: vec3, + uLightAlpha: f32, + uShadowColor: vec3, + uShadowAlpha: f32, + uTransform: vec2, +}; + +struct GlobalFilterUniforms { + uInputSize:vec4, + uInputPixel:vec4, + uInputClamp:vec4, + uOutputFrame:vec4, + uGlobalFrame:vec4, + uOutputTexture:vec4, +}; + +@group(0) @binding(0) var gfu: GlobalFilterUniforms; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var bevelUniforms : BevelUniforms; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 +) -> @location(0) vec4 { + let transform = vec2(1.0 / gfu.uInputSize.xy) * vec2(bevelUniforms.uTransform.x, bevelUniforms.uTransform.y); + var color: vec4 = textureSample(uTexture, uSampler, uv); + let lightSample: f32 = textureSample(uTexture, uSampler, uv - transform).a; + let shadowSample: f32 = textureSample(uTexture, uSampler, uv + transform).a; + + let light = vec4(bevelUniforms.uLightColor, bevelUniforms.uLightAlpha); + let shadow = vec4(bevelUniforms.uShadowColor, bevelUniforms.uShadowAlpha); + + color = vec4(mix(color.rgb, light.rgb, clamp((color.a - lightSample) * light.a, 0.0, 1.0)), color.a); + color = vec4(mix(color.rgb, shadow.rgb, clamp((color.a - shadowSample) * shadow.a, 0.0, 1.0)), color.a); + + return vec4(color.rgb * color.a, color.a); +}`,po=Object.defineProperty,ln=Object.getOwnPropertySymbols,vo=Object.prototype.hasOwnProperty,go=Object.prototype.propertyIsEnumerable,re=(r,e,n)=>e in r?po(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,an=(r,e)=>{for(var n in e||(e={}))vo.call(e,n)&&re(r,n,e[n]);if(ln)for(var n of ln(e))go.call(e,n)&&re(r,n,e[n]);return r},A=(r,e,n)=>(re(r,typeof e!="symbol"?e+"":e,n),n);const sn=class tt extends i.Filter{constructor(e){var n,t,o;e=an(an({},tt.DEFAULT_OPTIONS),e);const u=((n=e.rotation)!=null?n:45)*i.DEG_TO_RAD,l=i.GpuProgram.from({vertex:{source:m,entryPoint:"mainVertex"},fragment:{source:mo,entryPoint:"mainFragment"}}),a=i.GlProgram.from({vertex:c,fragment:co,name:"bevel-filter"});super({gpuProgram:l,glProgram:a,resources:{bevelUniforms:{uLightColor:{value:new Float32Array(3),type:"vec3"},uLightAlpha:{value:e.lightAlpha,type:"f32"},uShadowColor:{value:new Float32Array(3),type:"vec3"},uShadowAlpha:{value:e.shadowAlpha,type:"f32"},uTransform:{value:new Float32Array(2),type:"vec2"}}},padding:1}),A(this,"uniforms"),A(this,"_thickness"),A(this,"_rotation"),A(this,"_lightColor"),A(this,"_shadowColor"),this.uniforms=this.resources.bevelUniforms.uniforms,this._lightColor=new i.Color,this._shadowColor=new i.Color,this.lightColor=(t=e.lightColor)!=null?t:16777215,this.shadowColor=(o=e.shadowColor)!=null?o:0,Object.assign(this,e,{rotation:u})}get rotation(){return this._rotation/i.DEG_TO_RAD}set rotation(e){this._rotation=e*i.DEG_TO_RAD,this._updateTransform()}get thickness(){return this._thickness}set thickness(e){this._thickness=e,this._updateTransform()}get lightColor(){return this._lightColor.value}set lightColor(e){this._lightColor.setValue(e);const[n,t,o]=this._lightColor.toArray();this.uniforms.uLightColor[0]=n,this.uniforms.uLightColor[1]=t,this.uniforms.uLightColor[2]=o}get lightAlpha(){return this.uniforms.uLightAlpha}set lightAlpha(e){this.uniforms.uLightAlpha=e}get shadowColor(){return this._shadowColor.value}set shadowColor(e){this._shadowColor.setValue(e);const[n,t,o]=this._shadowColor.toArray();this.uniforms.uShadowColor[0]=n,this.uniforms.uShadowColor[1]=t,this.uniforms.uShadowColor[2]=o}get shadowAlpha(){return this.uniforms.uShadowAlpha}set shadowAlpha(e){this.uniforms.uShadowAlpha=e}_updateTransform(){this.uniforms.uTransform[0]=this.thickness*Math.cos(this._rotation),this.uniforms.uTransform[1]=this.thickness*Math.sin(this._rotation)}};A(sn,"DEFAULT_OPTIONS",{rotation:45,thickness:2,lightColor:16777215,lightAlpha:.7,shadowColor:0,shadowAlpha:.7});let ho=sn;var xo=Object.defineProperty,yo=Object.defineProperties,So=Object.getOwnPropertyDescriptors,fn=Object.getOwnPropertySymbols,bo=Object.prototype.hasOwnProperty,Co=Object.prototype.propertyIsEnumerable,te=(r,e,n)=>e in r?xo(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,G=(r,e)=>{for(var n in e||(e={}))bo.call(e,n)&&te(r,n,e[n]);if(fn)for(var n of fn(e))Co.call(e,n)&&te(r,n,e[n]);return r},cn=(r,e)=>yo(r,So(e)),M=(r,e,n)=>(te(r,typeof e!="symbol"?e+"":e,n),n);const mn=class ot extends i.AlphaFilter{constructor(...e){var n;let t=(n=e[0])!=null?n:{};if(typeof t=="number"||Array.isArray(t)||"x"in t&&"y"in t){i.deprecation("6.0.0","BloomFilter constructor params are now options object. See params: { strength, quality, resolution, kernelSize }");let o=t;Array.isArray(o)&&(o={x:o[0],y:o[1]}),t={strength:o},e[1]!==void 0&&(t.quality=e[1]),e[2]!==void 0&&(t.resolution=e[2]),e[3]!==void 0&&(t.kernelSize=e[3])}t=G(G({},ot.DEFAULT_OPTIONS),t),super(),M(this,"_blurXFilter"),M(this,"_blurYFilter"),M(this,"_strength"),this._strength={x:2,y:2},t.strength&&(typeof t.strength=="number"?(this._strength.x=t.strength,this._strength.y=t.strength):(this._strength.x=t.strength.x,this._strength.y=t.strength.y)),this._blurXFilter=new i.BlurFilterPass(cn(G({},t),{horizontal:!0,strength:this.strengthX})),this._blurYFilter=new i.BlurFilterPass(cn(G({},t),{horizontal:!1,strength:this.strengthY})),this._blurYFilter.blendMode="screen",Object.assign(this,t)}apply(e,n,t,o){const u=i.TexturePool.getSameSizeTexture(n);e.applyFilter(this,n,t,o),this._blurXFilter.apply(e,n,u,!0),this._blurYFilter.apply(e,u,t,!1),i.TexturePool.returnTexture(u)}get strength(){return this._strength}set strength(e){this._strength=typeof e=="number"?{x:e,y:e}:e,this._updateStrength()}get strengthX(){return this.strength.x}set strengthX(e){this.strength.x=e,this._updateStrength()}get strengthY(){return this.strength.y}set strengthY(e){this.strength.y=e,this._updateStrength()}_updateStrength(){this._blurXFilter.blur=this.strengthX,this._blurYFilter.blur=this.strengthY}get blur(){return i.deprecation("6.0.0","BloomFilter.blur is deprecated, please use BloomFilter.strength instead"),this.strengthX}set blur(e){i.deprecation("6.0.0","BloomFilter.blur is deprecated, please use BloomFilter.strength instead"),this.strength=e}get blurX(){return i.deprecation("6.0.0","BloomFilter.blurX is deprecated, please use BloomFilter.strengthX instead"),this.strengthX}set blurX(e){i.deprecation("6.0.0","BloomFilter.blurX is deprecated, please use BloomFilter.strengthX instead"),this.strengthX=e}get blurY(){return i.deprecation("6.0.0","BloomFilter.blurY is deprecated, please use BloomFilter.strengthY instead"),this.strengthY}set blurY(e){i.deprecation("6.0.0","BloomFilter.blurY is deprecated, please use BloomFilter.strengthY instead"),this.strengthY=e}};M(mn,"DEFAULT_OPTIONS",{strength:{x:2,y:2},quality:4,resolution:1,kernelSize:5});let To=mn;var Po=`precision highp float; +in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform vec2 uDimensions; +uniform vec2 uCenter; +uniform float uRadius; +uniform float uStrength; + +uniform vec4 uInputSize; +uniform vec4 uInputClamp; + +void main() +{ + vec2 coord = vTextureCoord * uInputSize.xy; + coord -= uCenter * uDimensions.xy; + float distance = length(coord); + + if (distance < uRadius) { + float percent = distance / uRadius; + if (uStrength > 0.0) { + coord *= mix(1.0, smoothstep(0.0, uRadius / distance, percent), uStrength * 0.75); + } else { + coord *= mix(1.0, pow(percent, 1.0 + uStrength * 0.75) * uRadius / distance, 1.0 - percent); + } + } + + coord += uCenter * uDimensions.xy; + coord /= uInputSize.xy; + vec2 clampedCoord = clamp(coord, uInputClamp.xy, uInputClamp.zw); + vec4 color = texture(uTexture, clampedCoord); + + if (coord != clampedCoord) { + color *= max(0.0, 1.0 - length(coord - clampedCoord)); + } + + finalColor = color; +} +`,Oo=`struct BulgePinchUniforms { + uDimensions: vec2, + uCenter: vec2, + uRadius: f32, + uStrength: f32, +}; + +struct GlobalFilterUniforms { + uInputSize:vec4, + uInputPixel:vec4, + uInputClamp:vec4, + uOutputFrame:vec4, + uGlobalFrame:vec4, + uOutputTexture:vec4, +}; + +@group(0) @binding(0) var gfu: GlobalFilterUniforms; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var bulgePinchUniforms : BulgePinchUniforms; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 +) -> @location(0) vec4 { + let dimensions: vec2 = bulgePinchUniforms.uDimensions; + let center: vec2 = bulgePinchUniforms.uCenter; + let radius: f32 = bulgePinchUniforms.uRadius; + let strength: f32 = bulgePinchUniforms.uStrength; + var coord: vec2 = (uv * gfu.uInputSize.xy) - center * dimensions.xy; + + let distance: f32 = length(coord); + + if (distance < radius) { + let percent: f32 = distance / radius; + if (strength > 0.0) { + coord *= mix(1.0, smoothstep(0.0, radius / distance, percent), strength * 0.75); + } else { + coord *= mix(1.0, pow(percent, 1.0 + strength * 0.75) * radius / distance, 1.0 - percent); + } + } + coord += (center * dimensions.xy); + coord /= gfu.uInputSize.xy; + + let clampedCoord: vec2 = clamp(coord, gfu.uInputClamp.xy, gfu.uInputClamp.zw); + var color: vec4 = textureSample(uTexture, uSampler, clampedCoord); + if (coord.x != clampedCoord.x && coord.y != clampedCoord.y) { + color *= max(0.0, 1.0 - length(coord - clampedCoord)); + } + + return color; +} + +fn compareVec2(x: vec2, y: vec2) -> bool +{ + if (x.x == y.x && x.y == y.y) + { + return true; + } + + return false; +}`,zo=Object.defineProperty,pn=Object.getOwnPropertySymbols,Fo=Object.prototype.hasOwnProperty,wo=Object.prototype.propertyIsEnumerable,oe=(r,e,n)=>e in r?zo(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,vn=(r,e)=>{for(var n in e||(e={}))Fo.call(e,n)&&oe(r,n,e[n]);if(pn)for(var n of pn(e))wo.call(e,n)&&oe(r,n,e[n]);return r},gn=(r,e,n)=>(oe(r,typeof e!="symbol"?e+"":e,n),n);const dn=class it extends i.Filter{constructor(e){e=vn(vn({},it.DEFAULT_OPTIONS),e);const n=i.GpuProgram.from({vertex:{source:m,entryPoint:"mainVertex"},fragment:{source:Oo,entryPoint:"mainFragment"}}),t=i.GlProgram.from({vertex:c,fragment:Po,name:"bulge-pinch-filter"});super({gpuProgram:n,glProgram:t,resources:{bulgePinchUniforms:{uDimensions:{value:[0,0],type:"vec2"},uCenter:{value:e.center,type:"vec2"},uRadius:{value:e.radius,type:"f32"},uStrength:{value:e.strength,type:"f32"}}}}),gn(this,"uniforms"),this.uniforms=this.resources.bulgePinchUniforms.uniforms,Object.assign(this,e)}apply(e,n,t,o){this.uniforms.uDimensions[0]=n.frame.width,this.uniforms.uDimensions[1]=n.frame.height,e.applyFilter(this,n,t,o)}get center(){return this.uniforms.uCenter}set center(e){typeof e=="number"&&(e={x:e,y:e}),Array.isArray(e)&&(e={x:e[0],y:e[1]}),this.uniforms.uCenter=e}get centerX(){return this.uniforms.uCenter.x}set centerX(e){this.uniforms.uCenter.x=e}get centerY(){return this.uniforms.uCenter.y}set centerY(e){this.uniforms.uCenter.y=e}get radius(){return this.uniforms.uRadius}set radius(e){this.uniforms.uRadius=e}get strength(){return this.uniforms.uStrength}set strength(e){this.uniforms.uStrength=e}};gn(dn,"DEFAULT_OPTIONS",{center:{x:.5,y:.5},radius:100,strength:1});let Ao=dn;var Io=`precision highp float; +in vec2 vTextureCoord; +in vec2 vFilterCoord; +out vec4 finalColor; + +const int TYPE_LINEAR = 0; +const int TYPE_RADIAL = 1; +const int TYPE_CONIC = 2; +const int MAX_STOPS = 32; + +uniform sampler2D uTexture; +uniform vec4 uOptions; +uniform vec2 uCounts; +uniform vec3 uColors[MAX_STOPS]; +uniform vec4 uStops[MAX_STOPS]; + +const float PI = 3.1415926538; +const float PI_2 = PI*2.; + +struct ColorStop { + float offset; + vec3 color; + float alpha; +}; + +mat2 rotate2d(float angle){ + return mat2(cos(angle), -sin(angle), + sin(angle), cos(angle)); +} + +float projectLinearPosition(vec2 pos, float angle){ + vec2 center = vec2(0.5); + vec2 result = pos - center; + result = rotate2d(angle) * result; + result = result + center; + return clamp(result.x, 0., 1.); +} + +float projectRadialPosition(vec2 pos) { + float r = distance(pos, vec2(0.5)); + return clamp(2.*r, 0., 1.); +} + +float projectAnglePosition(vec2 pos, float angle) { + vec2 center = pos - vec2(0.5); + float polarAngle=atan(-center.y, center.x); + return mod(polarAngle + angle, PI_2) / PI_2; +} + +float projectPosition(vec2 pos, int type, float angle) { + if (type == TYPE_LINEAR) { + return projectLinearPosition(pos, angle); + } else if (type == TYPE_RADIAL) { + return projectRadialPosition(pos); + } else if (type == TYPE_CONIC) { + return projectAnglePosition(pos, angle); + } + + return pos.y; +} + +void main(void) { + int uType = int(uOptions[0]); + float uAngle = uOptions[1]; + float uAlpha = uOptions[2]; + float uReplace = uOptions[3]; + + int uNumStops = int(uCounts[0]); + float uMaxColors = uCounts[1]; + + // current/original color + vec4 currentColor = texture(uTexture, vTextureCoord); + + // skip calculations if gradient alpha is 0 + if (0.0 == uAlpha) { + finalColor = currentColor; + return; + } + + // project position + float y = projectPosition(vFilterCoord, int(uType), radians(uAngle)); + + // check gradient bounds + float offsetMin = uStops[0][0]; + float offsetMax = 0.0; + + int numStops = int(uNumStops); + + for (int i = 0; i < MAX_STOPS; i++) { + if (i == numStops-1){ // last index + offsetMax = uStops[i][0]; + } + } + + if (y < offsetMin || y > offsetMax) { + finalColor = currentColor; + return; + } + + // limit colors + if (uMaxColors > 0.) { + float stepSize = 1./uMaxColors; + float stepNumber = float(floor(y/stepSize)); + y = stepSize * (stepNumber + 0.5);// offset by 0.5 to use color from middle of segment + } + + // find color stops + ColorStop from; + ColorStop to; + + for (int i = 0; i < MAX_STOPS; i++) { + if (y >= uStops[i][0]) { + from = ColorStop(uStops[i][0], uColors[i], uStops[i][1]); + to = ColorStop(uStops[i+1][0], uColors[i+1], uStops[i+1][1]); + } + + if (i == numStops-1){ // last index + break; + } + } + + // mix colors from stops + vec4 colorFrom = vec4(from.color * from.alpha, from.alpha); + vec4 colorTo = vec4(to.color * to.alpha, to.alpha); + + float segmentHeight = to.offset - from.offset; + float relativePos = y - from.offset;// position from 0 to [segmentHeight] + float relativePercent = relativePos / segmentHeight;// position in percent between [from.offset] and [to.offset]. + + float gradientAlpha = uAlpha * currentColor.a; + vec4 gradientColor = mix(colorFrom, colorTo, relativePercent) * gradientAlpha; + + if (uReplace < 0.5) { + // mix resulting color with current color + finalColor = gradientColor + currentColor*(1.-gradientColor.a); + } else { + // replace with gradient color + finalColor = gradientColor; + } +} +`,Uo=`in vec2 aPosition; +out vec2 vTextureCoord; +out vec2 vFilterCoord; + +uniform vec4 uInputSize; +uniform vec4 uOutputFrame; +uniform vec4 uOutputTexture; + +vec4 filterVertexPosition( void ) +{ + vec2 position = aPosition * uOutputFrame.zw + uOutputFrame.xy; + + position.x = position.x * (2.0 / uOutputTexture.x) - 1.0; + position.y = position.y * (2.0*uOutputTexture.z / uOutputTexture.y) - uOutputTexture.z; + + return vec4(position, 0.0, 1.0); +} + +vec2 filterTextureCoord( void ) +{ + return aPosition * (uOutputFrame.zw * uInputSize.zw); +} + +void main(void) +{ + gl_Position = filterVertexPosition(); + vTextureCoord = filterTextureCoord(); + vFilterCoord = vTextureCoord * uInputSize.xy / uOutputFrame.zw; +} +`,hn=`struct BaseUniforms { + uOptions: vec4, + uCounts: vec2, +}; + +struct StopsUniforms { + uColors: array, MAX_STOPS>, + uStops: array, MAX_STOPS>, +}; + +struct GlobalFilterUniforms { + uInputSize:vec4, + uInputPixel:vec4, + uInputClamp:vec4, + uOutputFrame:vec4, + uGlobalFrame:vec4, + uOutputTexture:vec4, +}; + +@group(0) @binding(0) var gfu: GlobalFilterUniforms; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var baseUniforms : BaseUniforms; +@group(1) @binding(1) var stopsUniforms : StopsUniforms; + +struct VSOutput { + @builtin(position) position: vec4, + @location(0) uv : vec2, + @location(1) coord : vec2 +}; + +fn filterVertexPosition(aPosition:vec2) -> vec4 +{ + var position = aPosition * gfu.uOutputFrame.zw + gfu.uOutputFrame.xy; + + position.x = position.x * (2.0 / gfu.uOutputTexture.x) - 1.0; + position.y = position.y * (2.0*gfu.uOutputTexture.z / gfu.uOutputTexture.y) - gfu.uOutputTexture.z; + + return vec4(position, 0.0, 1.0); +} + +fn filterTextureCoord( aPosition:vec2 ) -> vec2 +{ + return aPosition * (gfu.uOutputFrame.zw * gfu.uInputSize.zw); +} + +fn filterCoord( vTextureCoord:vec2 ) -> vec2 +{ + return vTextureCoord * gfu.uInputSize.xy / gfu.uOutputFrame.zw; +} + +fn globalTextureCoord( aPosition:vec2 ) -> vec2 +{ + return (aPosition.xy / gfu.uGlobalFrame.zw) + (gfu.uGlobalFrame.xy / gfu.uGlobalFrame.zw); +} + +fn getSize() -> vec2 +{ + return gfu.uGlobalFrame.zw; +} + +@vertex +fn mainVertex( + @location(0) aPosition : vec2, +) -> VSOutput { + let vTextureCoord: vec2 = filterTextureCoord(aPosition); + return VSOutput( + filterVertexPosition(aPosition), + vTextureCoord, + filterCoord(vTextureCoord), + ); +} + +struct ColorStop { + offset: f32, + color: vec3, + alpha: f32, +}; + +fn rotate2d(angle: f32) -> mat2x2{ + return mat2x2(cos(angle), -sin(angle), + sin(angle), cos(angle)); +} + +fn projectLinearPosition(pos: vec2, angle: f32) -> f32 { + var center: vec2 = vec2(0.5); + var result: vec2 = pos - center; + result = rotate2d(angle) * result; + result = result + center; + return clamp(result.x, 0.0, 1.0); +} + +fn projectRadialPosition(pos: vec2) -> f32 { + var r: f32 = distance(pos, vec2(0.5)); + return clamp(2.0 * r, 0.0, 1.0); +} + +fn projectAnglePosition(pos: vec2, angle: f32) -> f32 { + var center: vec2 = pos - vec2(0.5, 0.5); + var polarAngle: f32 = atan2(-center.y, center.x); + return ((polarAngle + angle) % PI_2) / PI_2; +} + +fn projectPosition(pos: vec2, gradientType: i32, angle: f32) -> f32 { + if (gradientType == TYPE_LINEAR) { + return projectLinearPosition(pos, angle); + } else if (gradientType == TYPE_RADIAL) { + return projectRadialPosition(pos); + } else if (gradientType == TYPE_CONIC) { + return projectAnglePosition(pos, angle); + } + + return pos.y; +} + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2, + @location(1) coord : vec2 +) -> @location(0) vec4 { + let uType: i32 = i32(baseUniforms.uOptions[0]); + let uAngle: f32 = baseUniforms.uOptions[1]; + let uAlpha: f32 = baseUniforms.uOptions[2]; + let uReplace: f32 = baseUniforms.uOptions[3]; + + let uNumStops: i32 = i32(baseUniforms.uCounts[0]); + let uMaxColors: f32 = baseUniforms.uCounts[1]; + + // current/original color + var currentColor: vec4 = textureSample(uTexture, uSampler, uv); + + // skip calculations if gradient alpha is 0 + if (uAlpha == 0.0) { return currentColor; } + + // project position + var y: f32 = projectPosition(coord, uType, radians(uAngle)); + + // check gradient bounds + var offsetMin: f32 = stopsUniforms.uStops[0][0]; + var offsetMax: f32 = 0.0; + + let numStops: i32 = uNumStops; + + for (var i: i32 = 0; i < MAX_STOPS; i = i + 1) { + if (i == numStops - 1) { // last index + offsetMax = stopsUniforms.uStops[i][0]; + } + } + + if (y < offsetMin || y > offsetMax) { return currentColor; } + + // limit colors + if (uMaxColors > 0.0) { + var stepSize: f32 = 1.0 / uMaxColors; + var stepNumber: f32 = floor(y / stepSize); + y = stepSize * (stepNumber + 0.5); // offset by 0.5 to use color from middle of segment + } + + // find color stops + var stopFrom: ColorStop; + var stopTo: ColorStop; + + for (var i: i32 = 0; i < MAX_STOPS; i = i + 1) { + if (y >= stopsUniforms.uStops[i][0]) { + stopFrom = ColorStop(stopsUniforms.uStops[i][0], stopsUniforms.uColors[i], stopsUniforms.uStops[i][1]); + stopTo = ColorStop(stopsUniforms.uStops[i + 1][0], stopsUniforms.uColors[i + 1], stopsUniforms.uStops[i + 1][1]); + } + + if (i == numStops - 1) { // last index + break; + } + } + + // mix colors from stops + var colorFrom: vec4 = vec4(stopFrom.color * stopFrom.alpha, stopFrom.alpha); + var colorTo: vec4 = vec4(stopTo.color * stopTo.alpha, stopTo.alpha); + + var segmentHeight: f32 = stopTo.offset - stopFrom.offset; + var relativePos: f32 = y - stopFrom.offset; // position from 0 to [segmentHeight] + var relativePercent: f32 = relativePos / segmentHeight; // position in percent between [from.offset] and [to.offset]. + + var gradientAlpha: f32 = uAlpha * currentColor.a; + var gradientColor: vec4 = mix(colorFrom, colorTo, relativePercent) * gradientAlpha; + + if (uReplace < 0.5) { + // mix resulting color with current color + return gradientColor + currentColor * (1.0 - gradientColor.a); + } else { + // replace with gradient color + return gradientColor; + } +} + +const PI: f32 = 3.14159265358979323846264; +const PI_2: f32 = PI * 2.0; + +const TYPE_LINEAR: i32 = 0; +const TYPE_RADIAL: i32 = 1; +const TYPE_CONIC: i32 = 2; +const MAX_STOPS: i32 = 32;`,Ql=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Jl(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function ea(r){return r&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function na(r){return r&&Object.prototype.hasOwnProperty.call(r,"default")&&Object.keys(r).length===1?r.default:r}function ra(r){if(r.__esModule)return r;var e=r.default;if(typeof e=="function"){var n=function t(){if(this instanceof t){var o=[null];o.push.apply(o,arguments);var u=Function.bind.apply(e,o);return new u}return e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(r).forEach(function(t){var o=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(n,t,o.get?o:{enumerable:!0,get:function(){return r[t]}})}),n}var xn={},P=P||{};P.stringify=function(){var r={"visit_linear-gradient":function(e){return r.visit_gradient(e)},"visit_repeating-linear-gradient":function(e){return r.visit_gradient(e)},"visit_radial-gradient":function(e){return r.visit_gradient(e)},"visit_repeating-radial-gradient":function(e){return r.visit_gradient(e)},visit_gradient:function(e){var n=r.visit(e.orientation);return n&&(n+=", "),e.type+"("+n+r.visit(e.colorStops)+")"},visit_shape:function(e){var n=e.value,t=r.visit(e.at),o=r.visit(e.style);return o&&(n+=" "+o),t&&(n+=" at "+t),n},"visit_default-radial":function(e){var n="",t=r.visit(e.at);return t&&(n+=t),n},"visit_extent-keyword":function(e){var n=e.value,t=r.visit(e.at);return t&&(n+=" at "+t),n},"visit_position-keyword":function(e){return e.value},visit_position:function(e){return r.visit(e.value.x)+" "+r.visit(e.value.y)},"visit_%":function(e){return e.value+"%"},visit_em:function(e){return e.value+"em"},visit_px:function(e){return e.value+"px"},visit_literal:function(e){return r.visit_color(e.value,e)},visit_hex:function(e){return r.visit_color("#"+e.value,e)},visit_rgb:function(e){return r.visit_color("rgb("+e.value.join(", ")+")",e)},visit_rgba:function(e){return r.visit_color("rgba("+e.value.join(", ")+")",e)},visit_color:function(e,n){var t=e,o=r.visit(n.length);return o&&(t+=" "+o),t},visit_angular:function(e){return e.value+"deg"},visit_directional:function(e){return"to "+e.value},visit_array:function(e){var n="",t=e.length;return e.forEach(function(o,u){n+=r.visit(o),u0&&n("Invalid input not EOF"),f}function o(){return K(u)}function u(){return l("linear-gradient",r.linearGradient,p)||l("repeating-linear-gradient",r.repeatingLinearGradient,p)||l("radial-gradient",r.radialGradient,R)||l("repeating-radial-gradient",r.repeatingRadialGradient,R)}function l(f,g,d){return a(g,function(C){var Zr=d();return Zr&&(b(r.comma)||n("Missing comma before color stops")),{type:f,orientation:Zr,colorStops:K(Yl)}})}function a(f,g){var d=b(f);if(d){b(r.startCall)||n("Missing (");var C=g(d);return b(r.endCall)||n("Missing )"),C}}function p(){return v()||h()}function v(){return x("directional",r.sideOrCorner,1)}function h(){return x("angular",r.angleValue,1)}function R(){var f,g=D(),d;return g&&(f=[],f.push(g),d=e,b(r.comma)&&(g=D(),g?f.push(g):e=d)),f}function D(){var f=$()||Vl();if(f)f.at=Kr();else{var g=Ne();if(g){f=g;var d=Kr();d&&(f.at=d)}else{var C=Wr();C&&(f={type:"default-radial",at:C})}}return f}function $(){var f=x("shape",/^(circle)/i,0);return f&&(f.style=jr()||Ne()),f}function Vl(){var f=x("shape",/^(ellipse)/i,0);return f&&(f.style=W()||Ne()),f}function Ne(){return x("extent-keyword",r.extentKeywords,1)}function Kr(){if(x("position",/^at/,0)){var f=Wr();return f||n("Missing positioning value"),f}}function Wr(){var f=Xl();if(f.x||f.y)return{type:"position",value:f}}function Xl(){return{x:W(),y:W()}}function K(f){var g=f(),d=[];if(g)for(d.push(g);b(r.comma);)g=f(),g?d.push(g):n("One extra comma");return d}function Yl(){var f=Kl();return f||n("Expected color definition"),f.length=W(),f}function Kl(){return ql()||Hl()||jl()||Wl()}function Wl(){return x("literal",r.literalColor,0)}function ql(){return x("hex",r.hexColor,1)}function jl(){return a(r.rgbColor,function(){return{type:"rgb",value:K(qr)}})}function Hl(){return a(r.rgbaColor,function(){return{type:"rgba",value:K(qr)}})}function qr(){return b(r.number)[1]}function W(){return x("%",r.percentageValue,1)||Zl()||jr()}function Zl(){return x("position-keyword",r.positionKeywords,1)}function jr(){return x("px",r.pixelValue,1)||x("em",r.emValue,1)}function x(f,g,d){var C=b(g);if(C)return{type:f,value:C[d]}}function b(f){var g,d;return d=/^[\n\r\t\s]+/.exec(e),d&&Hr(d[0].length),g=f.exec(e),g&&Hr(g[0].length),g}function Hr(f){e=e.substr(f)}return function(f){return e=f.toString(),t()}}();var _o=xn.parse=P.parse,ta=xn.stringify=P.stringify;function yn(r){const e=_o(zn(r));if(e.length===0)throw new Error("Invalid CSS gradient.");if(e.length!==1)throw new Error("Unsupported CSS gradient (multiple gradients is not supported).");const n=e[0],t=Sn(n.type),o=bn(n.colorStops),u=Pn(n.orientation);return{type:t,stops:o,angle:u}}function Sn(r){const e={"linear-gradient":0,"radial-gradient":1};if(!(r in e))throw new Error(`Unsupported gradient type "${r}"`);return e[r]}function bn(r){const e=Tn(r),n=[],t=new i.Color;for(let o=0;o{for(let u=o;u6?parseFloat(r.toString().substring(0,6)):r}function Pn(r){if(typeof r=="undefined")return 0;if("type"in r&&"value"in r)switch(r.type){case"angular":return parseFloat(r.value);case"directional":return On(r.value)}return 0}function On(r){const e={left:270,top:0,bottom:180,right:90,"left top":315,"top left":315,"left bottom":225,"bottom left":225,"right top":45,"top right":45,"right bottom":135,"bottom right":135};if(!(r in e))throw new Error(`Unsupported directional value "${r}"`);return e[r]}function zn(r){let e=r.replace(/\s{2,}/gu," ");return e=e.replace(/;/g,""),e=e.replace(/ ,/g,","),e=e.replace(/\( /g,"("),e=e.replace(/ \)/g,")"),e.trim()}var Do=Object.defineProperty,$o=Object.defineProperties,Go=Object.getOwnPropertyDescriptors,Fn=Object.getOwnPropertySymbols,Mo=Object.prototype.hasOwnProperty,Eo=Object.prototype.propertyIsEnumerable,ie=(r,e,n)=>e in r?Do(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,ue=(r,e)=>{for(var n in e||(e={}))Mo.call(e,n)&&ie(r,n,e[n]);if(Fn)for(var n of Fn(e))Eo.call(e,n)&&ie(r,n,e[n]);return r},Lo=(r,e)=>$o(r,Go(e)),O=(r,e,n)=>(ie(r,typeof e!="symbol"?e+"":e,n),n);const le=90;function ko(r){return[...r].sort((e,n)=>e.offset-n.offset)}const I=class q extends i.Filter{constructor(e){var n,t,o;if(e&&"css"in e?e=Lo(ue({},yn(e.css||"")),{alpha:(n=e.alpha)!=null?n:q.defaults.alpha,maxColors:(t=e.maxColors)!=null?t:q.defaults.maxColors}):e=ue(ue({},q.defaults),e),!e.stops||e.stops.length<2)throw new Error("ColorGradientFilter requires at least 2 color stops.");const u=i.GpuProgram.from({vertex:{source:hn,entryPoint:"mainVertex"},fragment:{source:hn,entryPoint:"mainFragment"}}),l=i.GlProgram.from({vertex:Uo,fragment:Io,name:"color-gradient-filter"}),a=32;super({gpuProgram:u,glProgram:l,resources:{baseUniforms:{uOptions:{value:[e.type,(o=e.angle)!=null?o:le,e.alpha,e.replace?1:0],type:"vec4"},uCounts:{value:[e.stops.length,e.maxColors],type:"vec2"}},stopsUniforms:{uColors:{value:new Float32Array(a*3),type:"vec3",size:a},uStops:{value:new Float32Array(a*4),type:"vec4",size:a}}}}),O(this,"baseUniforms"),O(this,"stopsUniforms"),O(this,"_stops",[]),this.baseUniforms=this.resources.baseUniforms.uniforms,this.stopsUniforms=this.resources.stopsUniforms.uniforms,Object.assign(this,e)}get stops(){return this._stops}set stops(e){const n=ko(e),t=new i.Color;let o,u,l;for(let a=0;a.5}set replace(e){this.baseUniforms.uOptions[3]=e?1:0}};O(I,"LINEAR",0),O(I,"RADIAL",1),O(I,"CONIC",2),O(I,"defaults",{type:I.LINEAR,stops:[{offset:0,color:16711680,alpha:1},{offset:1,color:255,alpha:1}],alpha:1,angle:90,maxColors:0,replace:!1});let Bo=I;var No=`in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform sampler2D uMapTexture; +uniform float uMix; +uniform float uSize; +uniform float uSliceSize; +uniform float uSlicePixelSize; +uniform float uSliceInnerSize; + +void main() { + vec4 color = texture(uTexture, vTextureCoord.xy); + vec4 adjusted; + + if (color.a > 0.0) { + color.rgb /= color.a; + float innerWidth = uSize - 1.0; + float zSlice0 = min(floor(color.b * innerWidth), innerWidth); + float zSlice1 = min(zSlice0 + 1.0, innerWidth); + float xOffset = uSlicePixelSize * 0.5 + color.r * uSliceInnerSize; + float s0 = xOffset + (zSlice0 * uSliceSize); + float s1 = xOffset + (zSlice1 * uSliceSize); + float yOffset = uSliceSize * 0.5 + color.g * (1.0 - uSliceSize); + vec4 slice0Color = texture(uMapTexture, vec2(s0,yOffset)); + vec4 slice1Color = texture(uMapTexture, vec2(s1,yOffset)); + float zOffset = fract(color.b * innerWidth); + adjusted = mix(slice0Color, slice1Color, zOffset); + + color.rgb *= color.a; + } + + finalColor = vec4(mix(color, adjusted, uMix).rgb, color.a); + +}`,Vo=`struct ColorMapUniforms { + uMix: f32, + uSize: f32, + uSliceSize: f32, + uSlicePixelSize: f32, + uSliceInnerSize: f32, +}; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var colorMapUniforms : ColorMapUniforms; +@group(1) @binding(1) var uMapTexture: texture_2d; +@group(1) @binding(2) var uMapSampler: sampler; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 +) -> @location(0) vec4 { + var color:vec4 = textureSample(uTexture, uSampler, uv); + + var adjusted: vec4; + + var altColor: vec4 = vec4(color.rgb / color.a, color.a); + let innerWidth: f32 = colorMapUniforms.uSize - 1.0; + let zSlice0: f32 = min(floor(color.b * innerWidth), innerWidth); + let zSlice1: f32 = min(zSlice0 + 1.0, innerWidth); + let xOffset: f32 = colorMapUniforms.uSlicePixelSize * 0.5 + color.r * colorMapUniforms.uSliceInnerSize; + let s0: f32 = xOffset + (zSlice0 * colorMapUniforms.uSliceSize); + let s1: f32 = xOffset + (zSlice1 * colorMapUniforms.uSliceSize); + let yOffset: f32 = colorMapUniforms.uSliceSize * 0.5 + color.g * (1.0 - colorMapUniforms.uSliceSize); + let slice0Color: vec4 = textureSample(uMapTexture, uMapSampler, vec2(s0,yOffset)); + let slice1Color: vec4 = textureSample(uMapTexture, uMapSampler, vec2(s1,yOffset)); + let zOffset: f32 = fract(color.b * innerWidth); + adjusted = mix(slice0Color, slice1Color, zOffset); + altColor = vec4(color.rgb * color.a, color.a); + + let realColor: vec4 = select(color, altColor, color.a > 0.0); + + return vec4(mix(realColor, adjusted, colorMapUniforms.uMix).rgb, realColor.a); +}`,Xo=Object.defineProperty,wn=Object.getOwnPropertySymbols,Yo=Object.prototype.hasOwnProperty,Ko=Object.prototype.propertyIsEnumerable,ae=(r,e,n)=>e in r?Xo(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,An=(r,e)=>{for(var n in e||(e={}))Yo.call(e,n)&&ae(r,n,e[n]);if(wn)for(var n of wn(e))Ko.call(e,n)&&ae(r,n,e[n]);return r},S=(r,e,n)=>(ae(r,typeof e!="symbol"?e+"":e,n),n);const In=class ut extends i.Filter{constructor(...e){var n;let t=(n=e[0])!=null?n:{};if((t instanceof i.Texture||t instanceof i.TextureSource)&&(i.deprecation("6.0.0","ColorMapFilter constructor params are now options object. See params: { colorMap, nearest, mix }"),t={colorMap:t},e[1]!==void 0&&(t.nearest=e[1]),e[2]!==void 0&&(t.mix=e[2])),t=An(An({},ut.DEFAULT_OPTIONS),t),!t.colorMap)throw Error("No color map texture source was provided to ColorMapFilter");const o=i.GpuProgram.from({vertex:{source:m,entryPoint:"mainVertex"},fragment:{source:Vo,entryPoint:"mainFragment"}}),u=i.GlProgram.from({vertex:c,fragment:No,name:"color-map-filter"});super({gpuProgram:o,glProgram:u,resources:{colorMapUniforms:{uMix:{value:t.mix,type:"f32"},uSize:{value:0,type:"f32"},uSliceSize:{value:0,type:"f32"},uSlicePixelSize:{value:0,type:"f32"},uSliceInnerSize:{value:0,type:"f32"}},uMapTexture:t.colorMap.source,uMapSampler:t.colorMap.source.style}}),S(this,"uniforms"),S(this,"_size",0),S(this,"_sliceSize",0),S(this,"_slicePixelSize",0),S(this,"_sliceInnerSize",0),S(this,"_nearest",!1),S(this,"_scaleMode","linear"),S(this,"_colorMap"),this.uniforms=this.resources.colorMapUniforms.uniforms,Object.assign(this,t)}get mix(){return this.uniforms.uMix}set mix(e){this.uniforms.uMix=e}get colorSize(){return this._size}get colorMap(){return this._colorMap}set colorMap(e){if(!e||e===this.colorMap)return;const n=e instanceof i.Texture?e.source:e;n.style.scaleMode=this._scaleMode,n.autoGenerateMipmaps=!1,this._size=n.height,this._sliceSize=1/this._size,this._slicePixelSize=this._sliceSize/this._size,this._sliceInnerSize=this._slicePixelSize*(this._size-1),this.uniforms.uSize=this._size,this.uniforms.uSliceSize=this._sliceSize,this.uniforms.uSlicePixelSize=this._slicePixelSize,this.uniforms.uSliceInnerSize=this._sliceInnerSize,this.resources.uMapTexture=n,this._colorMap=e}get nearest(){return this._nearest}set nearest(e){this._nearest=e,this._scaleMode=e?"nearest":"linear";const n=this._colorMap;n&&n.source&&(n.source.scaleMode=this._scaleMode,n.source.autoGenerateMipmaps=!1,n.source.style.update(),n.source.update())}updateColorMap(){const e=this._colorMap;e!=null&&e.source&&(e.source.update(),this.colorMap=e)}destroy(){var e;(e=this._colorMap)==null||e.destroy(),super.destroy()}};S(In,"DEFAULT_OPTIONS",{colorMap:i.Texture.WHITE,nearest:!1,mix:1});let Wo=In;var qo=`in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform vec3 uColor; +uniform float uAlpha; + +void main(void) { + vec4 c = texture(uTexture, vTextureCoord); + finalColor = vec4(mix(c.rgb, uColor.rgb, c.a * uAlpha), c.a); +} +`,jo=`struct ColorOverlayUniforms { + uColor: vec3, + uAlpha: f32, +}; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var colorOverlayUniforms : ColorOverlayUniforms; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 +) -> @location(0) vec4 { + let c = textureSample(uTexture, uSampler, uv); + return vec4(mix(c.rgb, colorOverlayUniforms.uColor.rgb, c.a * colorOverlayUniforms.uAlpha), c.a); +} +`,Ho=Object.defineProperty,Un=Object.getOwnPropertySymbols,Zo=Object.prototype.hasOwnProperty,Qo=Object.prototype.propertyIsEnumerable,se=(r,e,n)=>e in r?Ho(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,_n=(r,e)=>{for(var n in e||(e={}))Zo.call(e,n)&&se(r,n,e[n]);if(Un)for(var n of Un(e))Qo.call(e,n)&&se(r,n,e[n]);return r},fe=(r,e,n)=>(se(r,typeof e!="symbol"?e+"":e,n),n);const Rn=class lt extends i.Filter{constructor(...e){var n,t;let o=(n=e[0])!=null?n:{};(typeof o=="number"||Array.isArray(o)||o instanceof Float32Array)&&(i.deprecation("6.0.0","ColorOverlayFilter constructor params are now options object. See params: { color, alpha }"),o={color:o},e[1]!==void 0&&(o.alpha=e[1])),o=_n(_n({},lt.DEFAULT_OPTIONS),o);const u=i.GpuProgram.from({vertex:{source:m,entryPoint:"mainVertex"},fragment:{source:jo,entryPoint:"mainFragment"}}),l=i.GlProgram.from({vertex:c,fragment:qo,name:"color-overlay-filter"});super({gpuProgram:u,glProgram:l,resources:{colorOverlayUniforms:{uColor:{value:new Float32Array(3),type:"vec3"},uAlpha:{value:o.alpha,type:"f32"}}}}),fe(this,"uniforms"),fe(this,"_color"),this.uniforms=this.resources.colorOverlayUniforms.uniforms,this._color=new i.Color,this.color=(t=o.color)!=null?t:0}get color(){return this._color.value}set color(e){this._color.setValue(e);const[n,t,o]=this._color.toArray();this.uniforms.uColor[0]=n,this.uniforms.uColor[1]=t,this.uniforms.uColor[2]=o}get alpha(){return this.uniforms.uAlpha}set alpha(e){this.uniforms.uAlpha=e}};fe(Rn,"DEFAULT_OPTIONS",{color:0,alpha:1});let Jo=Rn;var ei=`in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform vec3 uOriginalColor; +uniform vec3 uTargetColor; +uniform float uTolerance; + +void main(void) { + vec4 c = texture(uTexture, vTextureCoord); + vec3 colorDiff = uOriginalColor - (c.rgb / max(c.a, 0.0000000001)); + float colorDistance = length(colorDiff); + float doReplace = step(colorDistance, uTolerance); + finalColor = vec4(mix(c.rgb, (uTargetColor + colorDiff) * c.a, doReplace), c.a); +} +`,ni=`struct ColorReplaceUniforms { + uOriginalColor: vec3, + uTargetColor: vec3, + uTolerance: f32, +}; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var colorReplaceUniforms : ColorReplaceUniforms; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 +) -> @location(0) vec4 { + let sample: vec4 = textureSample(uTexture, uSampler, uv); + + let colorDiff: vec3 = colorReplaceUniforms.uOriginalColor - (sample.rgb / max(sample.a, 0.0000000001)); + let colorDistance: f32 = length(colorDiff); + let doReplace: f32 = step(colorDistance, colorReplaceUniforms.uTolerance); + + return vec4(mix(sample.rgb, (colorReplaceUniforms.uTargetColor + colorDiff) * sample.a, doReplace), sample.a); +}`,ri=Object.defineProperty,Dn=Object.getOwnPropertySymbols,ti=Object.prototype.hasOwnProperty,oi=Object.prototype.propertyIsEnumerable,ce=(r,e,n)=>e in r?ri(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,$n=(r,e)=>{for(var n in e||(e={}))ti.call(e,n)&&ce(r,n,e[n]);if(Dn)for(var n of Dn(e))oi.call(e,n)&&ce(r,n,e[n]);return r},E=(r,e,n)=>(ce(r,typeof e!="symbol"?e+"":e,n),n);const Gn=class at extends i.Filter{constructor(...e){var n,t,o;let u=(n=e[0])!=null?n:{};(typeof u=="number"||Array.isArray(u)||u instanceof Float32Array)&&(i.deprecation("6.0.0","ColorReplaceFilter constructor params are now options object. See params: { originalColor, targetColor, tolerance }"),u={originalColor:u},e[1]!==void 0&&(u.targetColor=e[1]),e[2]!==void 0&&(u.tolerance=e[2])),u=$n($n({},at.DEFAULT_OPTIONS),u);const l=i.GpuProgram.from({vertex:{source:m,entryPoint:"mainVertex"},fragment:{source:ni,entryPoint:"mainFragment"}}),a=i.GlProgram.from({vertex:c,fragment:ei,name:"color-replace-filter"});super({gpuProgram:l,glProgram:a,resources:{colorReplaceUniforms:{uOriginalColor:{value:new Float32Array(3),type:"vec3"},uTargetColor:{value:new Float32Array(3),type:"vec3"},uTolerance:{value:u.tolerance,type:"f32"}}}}),E(this,"uniforms"),E(this,"_originalColor"),E(this,"_targetColor"),this.uniforms=this.resources.colorReplaceUniforms.uniforms,this._originalColor=new i.Color,this._targetColor=new i.Color,this.originalColor=(t=u.originalColor)!=null?t:16711680,this.targetColor=(o=u.targetColor)!=null?o:0,Object.assign(this,u)}get originalColor(){return this._originalColor.value}set originalColor(e){this._originalColor.setValue(e);const[n,t,o]=this._originalColor.toArray();this.uniforms.uOriginalColor[0]=n,this.uniforms.uOriginalColor[1]=t,this.uniforms.uOriginalColor[2]=o}get targetColor(){return this._targetColor.value}set targetColor(e){this._targetColor.setValue(e);const[n,t,o]=this._targetColor.toArray();this.uniforms.uTargetColor[0]=n,this.uniforms.uTargetColor[1]=t,this.uniforms.uTargetColor[2]=o}get tolerance(){return this.uniforms.uTolerance}set tolerance(e){this.uniforms.uTolerance=e}set newColor(e){i.deprecation("6.0.0","ColorReplaceFilter.newColor is deprecated, please use ColorReplaceFilter.targetColor instead"),this.targetColor=e}get newColor(){return i.deprecation("6.0.0","ColorReplaceFilter.newColor is deprecated, please use ColorReplaceFilter.targetColor instead"),this.targetColor}set epsilon(e){i.deprecation("6.0.0","ColorReplaceFilter.epsilon is deprecated, please use ColorReplaceFilter.tolerance instead"),this.tolerance=e}get epsilon(){return i.deprecation("6.0.0","ColorReplaceFilter.epsilon is deprecated, please use ColorReplaceFilter.tolerance instead"),this.tolerance}};E(Gn,"DEFAULT_OPTIONS",{originalColor:16711680,targetColor:0,tolerance:.4});let ii=Gn;var ui=`in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform vec2 uTexelSize; +uniform mat3 uMatrix; + +void main(void) +{ + vec4 c11 = texture(uTexture, vTextureCoord - uTexelSize); // top left + vec4 c12 = texture(uTexture, vec2(vTextureCoord.x, vTextureCoord.y - uTexelSize.y)); // top center + vec4 c13 = texture(uTexture, vec2(vTextureCoord.x + uTexelSize.x, vTextureCoord.y - uTexelSize.y)); // top right + + vec4 c21 = texture(uTexture, vec2(vTextureCoord.x - uTexelSize.x, vTextureCoord.y)); // mid left + vec4 c22 = texture(uTexture, vTextureCoord); // mid center + vec4 c23 = texture(uTexture, vec2(vTextureCoord.x + uTexelSize.x, vTextureCoord.y)); // mid right + + vec4 c31 = texture(uTexture, vec2(vTextureCoord.x - uTexelSize.x, vTextureCoord.y + uTexelSize.y)); // bottom left + vec4 c32 = texture(uTexture, vec2(vTextureCoord.x, vTextureCoord.y + uTexelSize.y)); // bottom center + vec4 c33 = texture(uTexture, vTextureCoord + uTexelSize); // bottom right + + finalColor = + c11 * uMatrix[0][0] + c12 * uMatrix[0][1] + c13 * uMatrix[0][2] + + c21 * uMatrix[1][0] + c22 * uMatrix[1][1] + c23 * uMatrix[1][2] + + c31 * uMatrix[2][0] + c32 * uMatrix[2][1] + c33 * uMatrix[2][2]; + + finalColor.a = c22.a; +}`,li=`struct ConvolutionUniforms { + uMatrix: mat3x3, + uTexelSize: vec2, +}; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var convolutionUniforms : ConvolutionUniforms; + +@fragment +fn mainFragment( + @location(0) uv: vec2, + @builtin(position) position: vec4 +) -> @location(0) vec4 { + let texelSize = convolutionUniforms.uTexelSize; + let matrix = convolutionUniforms.uMatrix; + + let c11: vec4 = textureSample(uTexture, uSampler, uv - texelSize); // top left + let c12: vec4 = textureSample(uTexture, uSampler, vec2(uv.x, uv.y - texelSize.y)); // top center + let c13: vec4 = textureSample(uTexture, uSampler, vec2(uv.x + texelSize.x, uv.y - texelSize.y)); // top right + + let c21: vec4 = textureSample(uTexture, uSampler, vec2(uv.x - texelSize.x, uv.y)); // mid left + let c22: vec4 = textureSample(uTexture, uSampler, uv); // mid center + let c23: vec4 = textureSample(uTexture, uSampler, vec2(uv.x + texelSize.x, uv.y)); // mid right + + let c31: vec4 = textureSample(uTexture, uSampler, vec2(uv.x - texelSize.x, uv.y + texelSize.y)); // bottom left + let c32: vec4 = textureSample(uTexture, uSampler, vec2(uv.x, uv.y + texelSize.y)); // bottom center + let c33: vec4 = textureSample(uTexture, uSampler, uv + texelSize); // bottom right + + var finalColor: vec4 = vec4( + c11 * matrix[0][0] + c12 * matrix[0][1] + c13 * matrix[0][2] + + c21 * matrix[1][0] + c22 * matrix[1][1] + c23 * matrix[1][2] + + c31 * matrix[2][0] + c32 * matrix[2][1] + c33 * matrix[2][2] + ); + + finalColor.a = c22.a; + + return finalColor; +}`,ai=Object.defineProperty,Mn=Object.getOwnPropertySymbols,si=Object.prototype.hasOwnProperty,fi=Object.prototype.propertyIsEnumerable,me=(r,e,n)=>e in r?ai(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,En=(r,e)=>{for(var n in e||(e={}))si.call(e,n)&&me(r,n,e[n]);if(Mn)for(var n of Mn(e))fi.call(e,n)&&me(r,n,e[n]);return r},Ln=(r,e,n)=>(me(r,typeof e!="symbol"?e+"":e,n),n);const kn=class st extends i.Filter{constructor(...e){var n,t,o;let u=(n=e[0])!=null?n:{};Array.isArray(u)&&(i.deprecation("6.0.0","ConvolutionFilter constructor params are now options object. See params: { matrix, width, height }"),u={matrix:u},e[1]!==void 0&&(u.width=e[1]),e[2]!==void 0&&(u.height=e[2])),u=En(En({},st.DEFAULT_OPTIONS),u);const l=(t=u.width)!=null?t:200,a=(o=u.height)!=null?o:200,p=i.GpuProgram.from({vertex:{source:m,entryPoint:"mainVertex"},fragment:{source:li,entryPoint:"mainFragment"}}),v=i.GlProgram.from({vertex:c,fragment:ui,name:"convolution-filter"});super({gpuProgram:p,glProgram:v,resources:{convolutionUniforms:{uMatrix:{value:u.matrix,type:"mat3x3"},uTexelSize:{value:{x:1/l,y:1/a},type:"vec2"}}}}),Ln(this,"uniforms"),this.uniforms=this.resources.convolutionUniforms.uniforms,this.width=l,this.height=a}get matrix(){return this.uniforms.uMatrix}set matrix(e){e.forEach((n,t)=>{this.uniforms.uMatrix[t]=n})}get width(){return 1/this.uniforms.uTexelSize.x}set width(e){this.uniforms.uTexelSize.x=1/e}get height(){return 1/this.uniforms.uTexelSize.y}set height(e){this.uniforms.uTexelSize.y=1/e}};Ln(kn,"DEFAULT_OPTIONS",{matrix:new Float32Array(9),width:200,height:200});let ci=kn;var mi=`in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; + +void main(void) +{ + float lum = length(texture(uTexture, vTextureCoord.xy).rgb); + + finalColor = vec4(1.0, 1.0, 1.0, 1.0); + + if (lum < 1.00) + { + if (mod(gl_FragCoord.x + gl_FragCoord.y, 10.0) == 0.0) + { + finalColor = vec4(0.0, 0.0, 0.0, 1.0); + } + } + + if (lum < 0.75) + { + if (mod(gl_FragCoord.x - gl_FragCoord.y, 10.0) == 0.0) + { + finalColor = vec4(0.0, 0.0, 0.0, 1.0); + } + } + + if (lum < 0.50) + { + if (mod(gl_FragCoord.x + gl_FragCoord.y - 5.0, 10.0) == 0.0) + { + finalColor = vec4(0.0, 0.0, 0.0, 1.0); + } + } + + if (lum < 0.3) + { + if (mod(gl_FragCoord.x - gl_FragCoord.y - 5.0, 10.0) == 0.0) + { + finalColor = vec4(0.0, 0.0, 0.0, 1.0); + } + } +} +`,pi=`@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; + +@fragment +fn mainFragment( + @location(0) uv: vec2, + @builtin(position) position: vec4 +) -> @location(0) vec4 { + let lum: f32 = length(textureSample(uTexture, uSampler, uv).rgb); + + if (lum < 1.00) + { + if (modulo(position.x + position.y, 10.0) == 0.0) + { + return vec4(0.0, 0.0, 0.0, 1.0); + } + } + + if (lum < 0.75) + { + if (modulo(position.x - position.y, 10.0) == 0.0) + { + return vec4(0.0, 0.0, 0.0, 1.0); + } + } + + if (lum < 0.50) + { + if (modulo(position.x + position.y - 5.0, 10.0) == 0.0) + { + return vec4(0.0, 0.0, 0.0, 1.0); + } + } + + if (lum < 0.3) + { + if (modulo(position.x - position.y - 5.0, 10.0) == 0.0) + { + return vec4(0.0, 0.0, 0.0, 1.0); + } + } + + return vec4(1.0); +} + +fn modulo(x: f32, y: f32) -> f32 +{ + return x - y * floor(x/y); +}`;class vi extends i.Filter{constructor(){const e=i.GpuProgram.from({vertex:{source:m,entryPoint:"mainVertex"},fragment:{source:pi,entryPoint:"mainFragment"}}),n=i.GlProgram.from({vertex:c,fragment:mi,name:"cross-hatch-filter"});super({gpuProgram:e,glProgram:n,resources:{}})}}var gi=`precision highp float; +in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform vec4 uLine; +uniform vec2 uNoise; +uniform vec3 uVignette; +uniform float uSeed; +uniform float uTime; +uniform vec2 uDimensions; + +uniform vec4 uInputSize; + +const float SQRT_2 = 1.414213; + +float rand(vec2 co) { + return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453); +} + +float vignette(vec3 co, vec2 coord) +{ + float outter = SQRT_2 - uVignette[0] * SQRT_2; + vec2 dir = vec2(0.5) - coord; + dir.y *= uDimensions.y / uDimensions.x; + float darker = clamp((outter - length(dir) * SQRT_2) / ( 0.00001 + uVignette[2] * SQRT_2), 0.0, 1.0); + return darker + (1.0 - darker) * (1.0 - uVignette[1]); +} + +float noise(vec2 coord) +{ + vec2 pixelCoord = coord * uInputSize.xy; + pixelCoord.x = floor(pixelCoord.x / uNoise[1]); + pixelCoord.y = floor(pixelCoord.y / uNoise[1]); + return (rand(pixelCoord * uNoise[1] * uSeed) - 0.5) * uNoise[0]; +} + +vec3 interlaceLines(vec3 co, vec2 coord) +{ + vec3 color = co; + + float curvature = uLine[0]; + float lineWidth = uLine[1]; + float lineContrast = uLine[2]; + float verticalLine = uLine[3]; + + vec2 dir = vec2(coord * uInputSize.xy / uDimensions - 0.5); + + float _c = curvature > 0. ? curvature : 1.; + float k = curvature > 0. ? (length(dir * dir) * 0.25 * _c * _c + 0.935 * _c) : 1.; + vec2 uv = dir * k; + float v = verticalLine > 0.5 ? uv.x * uDimensions.x : uv.y * uDimensions.y; + v *= min(1.0, 2.0 / lineWidth ) / _c; + float j = 1. + cos(v * 1.2 - uTime) * 0.5 * lineContrast; + color *= j; + + float segment = verticalLine > 0.5 ? mod((dir.x + .5) * uDimensions.x, 4.) : mod((dir.y + .5) * uDimensions.y, 4.); + color *= 0.99 + ceil(segment) * 0.015; + + return color; +} + +void main(void) +{ + finalColor = texture(uTexture, vTextureCoord); + vec2 coord = vTextureCoord * uInputSize.xy / uDimensions; + + if (uNoise[0] > 0.0 && uNoise[1] > 0.0) + { + float n = noise(vTextureCoord); + finalColor += vec4(n, n, n, finalColor.a); + } + + if (uVignette[0] > 0.) + { + float v = vignette(finalColor.rgb, coord); + finalColor *= vec4(v, v, v, finalColor.a); + } + + if (uLine[1] > 0.0) + { + finalColor = vec4(interlaceLines(finalColor.rgb, vTextureCoord), finalColor.a); + } +} +`,di=`struct CRTUniforms { + uLine: vec4, + uNoise: vec2, + uVignette: vec3, + uSeed: f32, + uTime: f32, + uDimensions: vec2, +}; + +struct GlobalFilterUniforms { + uInputSize:vec4, + uInputPixel:vec4, + uInputClamp:vec4, + uOutputFrame:vec4, + uGlobalFrame:vec4, + uOutputTexture:vec4, +}; + +@group(0) @binding(0) var gfu: GlobalFilterUniforms; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var crtUniforms : CRTUniforms; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 +) -> @location(0) vec4 { + + var color: vec4 = textureSample(uTexture, uSampler, uv); + let coord: vec2 = uv * gfu.uInputSize.xy / crtUniforms.uDimensions; + + let uNoise = crtUniforms.uNoise; + + if (uNoise[0] > 0.0 && uNoise[1] > 0.0) + { + color += vec4(vec3(noise(uv)), color.a); + } + + if (crtUniforms.uVignette[0] > 0.) + { + color *= vec4(vec3(vignette(color.rgb, coord)), color.a); + } + + if (crtUniforms.uLine[1] > 0.0) + { + color = vec4(vec3(interlaceLines(color.rgb, uv)), color.a); + } + + return color; +} + +const SQRT_2: f32 = 1.414213; + +fn modulo(x: f32, y: f32) -> f32 +{ + return x - y * floor(x/y); +} + +fn rand(co: vec2) -> f32 +{ + return fract(sin(dot(co, vec2(12.9898, 78.233))) * 43758.5453); +} + +fn vignette(co: vec3, coord: vec2) -> f32 +{ + let uVignette = crtUniforms.uVignette; + let uDimensions = crtUniforms.uDimensions; + + let outter: f32 = SQRT_2 - uVignette[0] * SQRT_2; + var dir: vec2 = vec2(0.5) - coord; + dir.y *= uDimensions.y / uDimensions.x; + let darker: f32 = clamp((outter - length(dir) * SQRT_2) / ( 0.00001 + uVignette[2] * SQRT_2), 0.0, 1.0); + return darker + (1.0 - darker) * (1.0 - uVignette[1]); +} + +fn noise(coord: vec2) -> f32 +{ + let uNoise = crtUniforms.uNoise; + let uSeed = crtUniforms.uSeed; + + var pixelCoord: vec2 = coord * gfu.uInputSize.xy; + pixelCoord.x = floor(pixelCoord.x / uNoise[1]); + pixelCoord.y = floor(pixelCoord.y / uNoise[1]); + return (rand(pixelCoord * uNoise[1] * uSeed) - 0.5) * uNoise[0]; +} + +fn interlaceLines(co: vec3, coord: vec2) -> vec3 +{ + var color = co; + + let uDimensions = crtUniforms.uDimensions; + + let curvature: f32 = crtUniforms.uLine[0]; + let lineWidth: f32 = crtUniforms.uLine[1]; + let lineContrast: f32 = crtUniforms.uLine[2]; + let verticalLine: f32 = crtUniforms.uLine[3]; + + let dir: vec2 = vec2(coord * gfu.uInputSize.xy / uDimensions - 0.5); + + let _c: f32 = select(1., curvature, curvature > 0.); + let k: f32 = select(1., (length(dir * dir) * 0.25 * _c * _c + 0.935 * _c), curvature > 0.); + let uv: vec2 = dir * k; + let v: f32 = select(uv.y * uDimensions.y, uv.x * uDimensions.x, verticalLine > 0.5) * min(1.0, 2.0 / lineWidth ) / _c; + let j: f32 = 1. + cos(v * 1.2 - crtUniforms.uTime) * 0.5 * lineContrast; + color *= j; + + let segment: f32 = select(modulo((dir.y + .5) * uDimensions.y, 4.), modulo((dir.x + .5) * uDimensions.x, 4.), verticalLine > 0.5); + color *= 0.99 + ceil(segment) * 0.015; + + return color; +}`,hi=Object.defineProperty,Bn=Object.getOwnPropertySymbols,xi=Object.prototype.hasOwnProperty,yi=Object.prototype.propertyIsEnumerable,pe=(r,e,n)=>e in r?hi(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,Nn=(r,e)=>{for(var n in e||(e={}))xi.call(e,n)&&pe(r,n,e[n]);if(Bn)for(var n of Bn(e))yi.call(e,n)&&pe(r,n,e[n]);return r},L=(r,e,n)=>(pe(r,typeof e!="symbol"?e+"":e,n),n);const Vn=class ft extends i.Filter{constructor(e){e=Nn(Nn({},ft.DEFAULT_OPTIONS),e);const n=i.GpuProgram.from({vertex:{source:m,entryPoint:"mainVertex"},fragment:{source:di,entryPoint:"mainFragment"}}),t=i.GlProgram.from({vertex:c,fragment:gi,name:"crt-filter"});super({gpuProgram:n,glProgram:t,resources:{crtUniforms:{uLine:{value:new Float32Array(4),type:"vec4"},uNoise:{value:new Float32Array(2),type:"vec2"},uVignette:{value:new Float32Array(3),type:"vec3"},uSeed:{value:e.seed,type:"f32"},uTime:{value:e.time,type:"f32"},uDimensions:{value:new Float32Array(2),type:"vec2"}}}}),L(this,"uniforms"),L(this,"seed"),L(this,"time"),this.uniforms=this.resources.crtUniforms.uniforms,Object.assign(this,e)}apply(e,n,t,o){this.uniforms.uDimensions[0]=n.frame.width,this.uniforms.uDimensions[1]=n.frame.height,this.uniforms.uSeed=this.seed,this.uniforms.uTime=this.time,e.applyFilter(this,n,t,o)}get curvature(){return this.uniforms.uLine[0]}set curvature(e){this.uniforms.uLine[0]=e}get lineWidth(){return this.uniforms.uLine[1]}set lineWidth(e){this.uniforms.uLine[1]=e}get lineContrast(){return this.uniforms.uLine[2]}set lineContrast(e){this.uniforms.uLine[2]=e}get verticalLine(){return this.uniforms.uLine[3]>.5}set verticalLine(e){this.uniforms.uLine[3]=e?1:0}get noise(){return this.uniforms.uNoise[0]}set noise(e){this.uniforms.uNoise[0]=e}get noiseSize(){return this.uniforms.uNoise[1]}set noiseSize(e){this.uniforms.uNoise[1]=e}get vignetting(){return this.uniforms.uVignette[0]}set vignetting(e){this.uniforms.uVignette[0]=e}get vignettingAlpha(){return this.uniforms.uVignette[1]}set vignettingAlpha(e){this.uniforms.uVignette[1]=e}get vignettingBlur(){return this.uniforms.uVignette[2]}set vignettingBlur(e){this.uniforms.uVignette[2]=e}};L(Vn,"DEFAULT_OPTIONS",{curvature:1,lineWidth:1,lineContrast:.25,verticalLine:!1,noise:0,noiseSize:1,vignetting:.3,vignettingAlpha:1,vignettingBlur:.3,time:0,seed:0});let Si=Vn;var bi=`precision highp float; +in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform float uAngle; +uniform float uScale; +uniform bool uGrayScale; + +uniform vec4 uInputSize; + +float pattern() +{ + float s = sin(uAngle), c = cos(uAngle); + vec2 tex = vTextureCoord * uInputSize.xy; + vec2 point = vec2( + c * tex.x - s * tex.y, + s * tex.x + c * tex.y + ) * uScale; + return (sin(point.x) * sin(point.y)) * 4.0; + } + + void main() + { + vec4 color = texture(uTexture, vTextureCoord); + vec3 colorRGB = vec3(color); + + if (uGrayScale) + { + colorRGB = vec3(color.r + color.g + color.b) / 3.0; + } + + finalColor = vec4(colorRGB * 10.0 - 5.0 + pattern(), color.a); +} +`,Ci=`struct DotUniforms { + uScale:f32, + uAngle:f32, + uGrayScale:f32, +}; + +struct GlobalFilterUniforms { + uInputSize:vec4, + uInputPixel:vec4, + uInputClamp:vec4, + uOutputFrame:vec4, + uGlobalFrame:vec4, + uOutputTexture:vec4, +}; + +@group(0) @binding(0) var gfu: GlobalFilterUniforms; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var dotUniforms : DotUniforms; + +@fragment +fn mainFragment( + @location(0) uv: vec2, + @builtin(position) position: vec4 +) -> @location(0) vec4 { + let color: vec4 = textureSample(uTexture, uSampler, uv); + let gray: vec3 = vec3(dot(color.rgb, vec3(0.299, 0.587, 0.114))); + // dotUniforms.uGrayScale == 1 doesn't ever pass so it is converted to a float and compared to 0.5 instead + let finalColor: vec3 = select(color.rgb, gray, f32(dotUniforms.uGrayScale) >= 0.5); + + return vec4(finalColor * 10.0 - 5.0 + pattern(uv), color.a); +} + +fn pattern(uv: vec2) -> f32 +{ + let s: f32 = sin(dotUniforms.uAngle); + let c: f32 = cos(dotUniforms.uAngle); + + let tex: vec2 = uv * gfu.uInputSize.xy; + + let p: vec2 = vec2( + c * tex.x - s * tex.y, + s * tex.x + c * tex.y + ) * dotUniforms.uScale; + + return (sin(p.x) * sin(p.y)) * 4.0; +}`,Ti=Object.defineProperty,Xn=Object.getOwnPropertySymbols,Pi=Object.prototype.hasOwnProperty,Oi=Object.prototype.propertyIsEnumerable,ve=(r,e,n)=>e in r?Ti(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,Yn=(r,e)=>{for(var n in e||(e={}))Pi.call(e,n)&&ve(r,n,e[n]);if(Xn)for(var n of Xn(e))Oi.call(e,n)&&ve(r,n,e[n]);return r},zi=(r,e,n)=>(ve(r,typeof e!="symbol"?e+"":e,n),n);const Kn=class ct extends i.Filter{constructor(...e){var n;let t=(n=e[0])!=null?n:{};typeof t=="number"&&(i.deprecation("6.0.0","DotFilter constructor params are now options object. See params: { scale, angle, grayscale }"),t={scale:t},e[1]!==void 0&&(t.angle=e[1]),e[2]!==void 0&&(t.grayscale=e[2])),t=Yn(Yn({},ct.DEFAULT_OPTIONS),t);const o={uScale:{value:t.scale,type:"f32"},uAngle:{value:t.angle,type:"f32"},uGrayScale:{value:t.grayscale?1:0,type:"f32"}},u=i.GpuProgram.from({vertex:{source:m,entryPoint:"mainVertex"},fragment:{source:Ci,entryPoint:"mainFragment"}}),l=i.GlProgram.from({vertex:c,fragment:bi,name:"dot-filter"});super({gpuProgram:u,glProgram:l,resources:{dotUniforms:o}})}get scale(){return this.resources.dotUniforms.uniforms.uScale}set scale(e){this.resources.dotUniforms.uniforms.uScale=e}get angle(){return this.resources.dotUniforms.uniforms.uAngle}set angle(e){this.resources.dotUniforms.uniforms.uAngle=e}get grayscale(){return this.resources.dotUniforms.uniforms.uGrayScale===1}set grayscale(e){this.resources.dotUniforms.uniforms.uGrayScale=e?1:0}};zi(Kn,"DEFAULT_OPTIONS",{scale:1,angle:5,grayscale:!0});let Fi=Kn;var wi=`precision highp float; +in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform float uAlpha; +uniform vec3 uColor; +uniform vec2 uOffset; + +uniform vec4 uInputSize; + +void main(void){ + vec4 sample = texture(uTexture, vTextureCoord - uOffset * uInputSize.zw); + + // Premultiply alpha + sample.rgb = uColor.rgb * sample.a; + + // alpha user alpha + sample *= uAlpha; + + finalColor = sample; +}`,Ai=`struct DropShadowUniforms { + uAlpha: f32, + uColor: vec3, + uOffset: vec2, +}; + +struct GlobalFilterUniforms { + uInputSize:vec4, + uInputPixel:vec4, + uInputClamp:vec4, + uOutputFrame:vec4, + uGlobalFrame:vec4, + uOutputTexture:vec4, +}; + +@group(0) @binding(0) var gfu: GlobalFilterUniforms; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var dropShadowUniforms : DropShadowUniforms; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 +) -> @location(0) vec4 { + var color: vec4 = textureSample(uTexture, uSampler, uv - dropShadowUniforms.uOffset * gfu.uInputSize.zw); + + // Premultiply alpha + color = vec4(vec3(dropShadowUniforms.uColor.rgb * color.a), color.a); + // alpha user alpha + color *= dropShadowUniforms.uAlpha; + + return color; +}`,Ii=Object.defineProperty,Wn=Object.getOwnPropertySymbols,Ui=Object.prototype.hasOwnProperty,_i=Object.prototype.propertyIsEnumerable,ge=(r,e,n)=>e in r?Ii(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,qn=(r,e)=>{for(var n in e||(e={}))Ui.call(e,n)&&ge(r,n,e[n]);if(Wn)for(var n of Wn(e))_i.call(e,n)&&ge(r,n,e[n]);return r},U=(r,e,n)=>(ge(r,typeof e!="symbol"?e+"":e,n),n);const jn=class mt extends i.Filter{constructor(e){var n,t;e=qn(qn({},mt.DEFAULT_OPTIONS),e);const o=i.GpuProgram.from({vertex:{source:m,entryPoint:"mainVertex"},fragment:{source:Ai,entryPoint:"mainFragment"}}),u=i.GlProgram.from({vertex:c,fragment:wi,name:"drop-shadow-filter"});super({gpuProgram:o,glProgram:u,resources:{dropShadowUniforms:{uAlpha:{value:e.alpha,type:"f32"},uColor:{value:new Float32Array(3),type:"vec3"},uOffset:{value:e.offset,type:"vec2"}}},resolution:e.resolution}),U(this,"uniforms"),U(this,"shadowOnly",!1),U(this,"_color"),U(this,"_blurFilter"),U(this,"_basePass"),this.uniforms=this.resources.dropShadowUniforms.uniforms,this._color=new i.Color,this.color=(n=e.color)!=null?n:0,this._blurFilter=new Z({strength:(t=e.kernels)!=null?t:e.blur,quality:e.kernels?void 0:e.quality}),this._basePass=new i.Filter({gpuProgram:i.GpuProgram.from({vertex:{source:m,entryPoint:"mainVertex"},fragment:{source:` + @group(0) @binding(1) var uTexture: texture_2d; + @group(0) @binding(2) var uSampler: sampler; + @fragment + fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 + ) -> @location(0) vec4 { + return textureSample(uTexture, uSampler, uv); + } + `,entryPoint:"mainFragment"}}),glProgram:i.GlProgram.from({vertex:c,fragment:` + in vec2 vTextureCoord; + out vec4 finalColor; + uniform sampler2D uTexture; + + void main(void){ + finalColor = texture(uTexture, vTextureCoord); + } + `,name:"drop-shadow-filter"}),resources:{}}),Object.assign(this,e)}apply(e,n,t,o){const u=i.TexturePool.getSameSizeTexture(n);e.applyFilter(this,n,u,!0),this._blurFilter.apply(e,u,t,o),this.shadowOnly||e.applyFilter(this._basePass,n,t,!1),i.TexturePool.returnTexture(u)}get offset(){return this.uniforms.uOffset}set offset(e){this.uniforms.uOffset=e,this._updatePadding()}get offsetX(){return this.offset.x}set offsetX(e){this.offset.x=e,this._updatePadding()}get offsetY(){return this.offset.y}set offsetY(e){this.offset.y=e,this._updatePadding()}get color(){return this._color.value}set color(e){this._color.setValue(e);const[n,t,o]=this._color.toArray();this.uniforms.uColor[0]=n,this.uniforms.uColor[1]=t,this.uniforms.uColor[2]=o}get alpha(){return this.uniforms.uAlpha}set alpha(e){this.uniforms.uAlpha=e}get blur(){return this._blurFilter.strength}set blur(e){this._blurFilter.strength=e,this._updatePadding()}get quality(){return this._blurFilter.quality}set quality(e){this._blurFilter.quality=e,this._updatePadding()}get kernels(){return this._blurFilter.kernels}set kernels(e){this._blurFilter.kernels=e}get pixelSize(){return this._blurFilter.pixelSize}set pixelSize(e){typeof e=="number"&&(e={x:e,y:e}),Array.isArray(e)&&(e={x:e[0],y:e[1]}),this._blurFilter.pixelSize=e}get pixelSizeX(){return this._blurFilter.pixelSizeX}set pixelSizeX(e){this._blurFilter.pixelSizeX=e}get pixelSizeY(){return this._blurFilter.pixelSizeY}set pixelSizeY(e){this._blurFilter.pixelSizeY=e}_updatePadding(){const e=Math.max(Math.abs(this.offsetX),Math.abs(this.offsetY));this.padding=e+this.blur*2+this.quality*4}};U(jn,"DEFAULT_OPTIONS",{offset:{x:4,y:4},color:0,alpha:.5,shadowOnly:!1,kernels:void 0,blur:2,quality:3,pixelSize:{x:1,y:1},resolution:1});let Ri=jn;var Di=`precision highp float; +in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform float uStrength; + +uniform vec4 uInputSize; + +void main(void) +{ + vec2 onePixel = vec2(1.0 / uInputSize); + + vec4 color; + + color.rgb = vec3(0.5); + + color -= texture(uTexture, vTextureCoord - onePixel) * uStrength; + color += texture(uTexture, vTextureCoord + onePixel) * uStrength; + + color.rgb = vec3((color.r + color.g + color.b) / 3.0); + + float alpha = texture(uTexture, vTextureCoord).a; + + finalColor = vec4(color.rgb * alpha, alpha); +} +`,$i=`struct EmbossUniforms { + uStrength:f32, +}; + +struct GlobalFilterUniforms { + uInputSize:vec4, + uInputPixel:vec4, + uInputClamp:vec4, + uOutputFrame:vec4, + uGlobalFrame:vec4, + uOutputTexture:vec4, +}; + +@group(0) @binding(0) var gfu: GlobalFilterUniforms; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var embossUniforms : EmbossUniforms; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 +) -> @location(0) vec4 { + let onePixel: vec2 = vec2(1.0 / gfu.uInputSize.xy); + var color: vec3 = vec3(0.5); + + color -= (textureSample(uTexture, uSampler, uv - onePixel) * embossUniforms.uStrength).rgb; + color += (textureSample(uTexture, uSampler, uv + onePixel) * embossUniforms.uStrength).rgb; + + color = vec3((color.r + color.g + color.b) / 3.0); + + let blendColor: vec4 = textureSample(uTexture, uSampler, uv); + + return vec4(color.rgb * blendColor.a, blendColor.a); +}`,Gi=Object.defineProperty,Mi=(r,e,n)=>e in r?Gi(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,Ei=(r,e,n)=>(Mi(r,typeof e!="symbol"?e+"":e,n),n);class Li extends i.Filter{constructor(e=5){const n=i.GpuProgram.from({vertex:{source:m,entryPoint:"mainVertex"},fragment:{source:$i,entryPoint:"mainFragment"}}),t=i.GlProgram.from({vertex:c,fragment:Di,name:"emboss-filter"});super({gpuProgram:n,glProgram:t,resources:{embossUniforms:{uStrength:{value:e,type:"f32"}}}}),Ei(this,"uniforms"),this.uniforms=this.resources.embossUniforms.uniforms}get strength(){return this.uniforms.uStrength}set strength(e){this.uniforms.uStrength=e}}var ki=`precision highp float; +in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform sampler2D uDisplacementMap; +uniform float uSeed; +uniform vec2 uDimensions; +uniform float uAspect; +uniform float uFillMode; +uniform float uOffset; +uniform float uDirection; +uniform vec2 uRed; +uniform vec2 uGreen; +uniform vec2 uBlue; + +uniform vec4 uInputSize; +uniform vec4 uInputClamp; + +const int TRANSPARENT = 0; +const int ORIGINAL = 1; +const int LOOP = 2; +const int CLAMP = 3; +const int MIRROR = 4; + +void main(void) +{ + vec2 coord = (vTextureCoord * uInputSize.xy) / uDimensions; + + if (coord.x > 1.0 || coord.y > 1.0) { + return; + } + + float sinDir = sin(uDirection); + float cosDir = cos(uDirection); + + float cx = coord.x - 0.5; + float cy = (coord.y - 0.5) * uAspect; + float ny = (-sinDir * cx + cosDir * cy) / uAspect + 0.5; + + // displacementMap: repeat + // ny = ny > 1.0 ? ny - 1.0 : (ny < 0.0 ? 1.0 + ny : ny); + + // displacementMap: mirror + ny = ny > 1.0 ? 2.0 - ny : (ny < 0.0 ? -ny : ny); + + vec4 dc = texture(uDisplacementMap, vec2(0.5, ny)); + + float displacement = (dc.r - dc.g) * (uOffset / uInputSize.x); + + coord = vTextureCoord + vec2(cosDir * displacement, sinDir * displacement * uAspect); + + int fillMode = int(uFillMode); + + if (fillMode == CLAMP) { + coord = clamp(coord, uInputClamp.xy, uInputClamp.zw); + } else { + if( coord.x > uInputClamp.z ) { + if (fillMode == TRANSPARENT) { + discard; + } else if (fillMode == LOOP) { + coord.x -= uInputClamp.z; + } else if (fillMode == MIRROR) { + coord.x = uInputClamp.z * 2.0 - coord.x; + } + } else if( coord.x < uInputClamp.x ) { + if (fillMode == TRANSPARENT) { + discard; + } else if (fillMode == LOOP) { + coord.x += uInputClamp.z; + } else if (fillMode == MIRROR) { + coord.x *= -uInputClamp.z; + } + } + + if( coord.y > uInputClamp.w ) { + if (fillMode == TRANSPARENT) { + discard; + } else if (fillMode == LOOP) { + coord.y -= uInputClamp.w; + } else if (fillMode == MIRROR) { + coord.y = uInputClamp.w * 2.0 - coord.y; + } + } else if( coord.y < uInputClamp.y ) { + if (fillMode == TRANSPARENT) { + discard; + } else if (fillMode == LOOP) { + coord.y += uInputClamp.w; + } else if (fillMode == MIRROR) { + coord.y *= -uInputClamp.w; + } + } + } + + finalColor.r = texture(uTexture, coord + uRed * (1.0 - uSeed * 0.4) / uInputSize.xy).r; + finalColor.g = texture(uTexture, coord + uGreen * (1.0 - uSeed * 0.3) / uInputSize.xy).g; + finalColor.b = texture(uTexture, coord + uBlue * (1.0 - uSeed * 0.2) / uInputSize.xy).b; + finalColor.a = texture(uTexture, coord).a; +} +`,Bi=`struct GlitchUniforms { + uSeed: f32, + uDimensions: vec2, + uAspect: f32, + uFillMode: f32, + uOffset: f32, + uDirection: f32, + uRed: vec2, + uGreen: vec2, + uBlue: vec2, +}; + +struct GlobalFilterUniforms { + uInputSize:vec4, + uInputPixel:vec4, + uInputClamp:vec4, + uOutputFrame:vec4, + uGlobalFrame:vec4, + uOutputTexture:vec4, +}; + +@group(0) @binding(0) var gfu: GlobalFilterUniforms; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var glitchUniforms : GlitchUniforms; +@group(1) @binding(1) var uDisplacementMap: texture_2d; +@group(1) @binding(2) var uDisplacementSampler: sampler; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 +) -> @location(0) vec4 { + let uSeed: f32 = glitchUniforms.uSeed; + let uDimensions: vec2 = glitchUniforms.uDimensions; + let uAspect: f32 = glitchUniforms.uAspect; + let uOffset: f32 = glitchUniforms.uOffset; + let uDirection: f32 = glitchUniforms.uDirection; + let uRed: vec2 = glitchUniforms.uRed; + let uGreen: vec2 = glitchUniforms.uGreen; + let uBlue: vec2 = glitchUniforms.uBlue; + + let uInputSize: vec4 = gfu.uInputSize; + let uInputClamp: vec4 = gfu.uInputClamp; + + var discarded: bool = false; + var coord: vec2 = (uv * uInputSize.xy) / uDimensions; + + if (coord.x > 1.0 || coord.y > 1.0) { + discarded = true; + } + + let sinDir: f32 = sin(uDirection); + let cosDir: f32 = cos(uDirection); + + let cx: f32 = coord.x - 0.5; + let cy: f32 = (coord.y - 0.5) * uAspect; + var ny: f32 = (-sinDir * cx + cosDir * cy) / uAspect + 0.5; + + ny = select(select(ny, -ny, ny < 0.0), 2.0 - ny, ny > 1.0); + + let dc: vec4 = textureSample(uDisplacementMap, uDisplacementSampler, vec2(0.5, ny)); + + let displacement: f32 = (dc.r - dc.g) * (uOffset / uInputSize.x); + + coord = uv + vec2(cosDir * displacement, sinDir * displacement * uAspect); + + let fillMode: i32 = i32(glitchUniforms.uFillMode); + + if (fillMode == CLAMP) { + coord = clamp(coord, uInputClamp.xy, uInputClamp.zw); + } else { + if (coord.x > uInputClamp.z) { + if (fillMode == TRANSPARENT) { + discarded = true; + } else if (fillMode == LOOP) { + coord.x = coord.x - uInputClamp.z; + } else if (fillMode == MIRROR) { + coord.x = uInputClamp.z * 2.0 - coord.x; + } + } else if (coord.x < uInputClamp.x) { + if (fillMode == TRANSPARENT) { + discarded = true; + } else if (fillMode == LOOP) { + coord.x = coord.x + uInputClamp.z; + } else if (fillMode == MIRROR) { + coord.x = coord.x * -uInputClamp.z; + } + } + + if (coord.y > uInputClamp.w) { + if (fillMode == TRANSPARENT) { + discarded = true; + } else if (fillMode == LOOP) { + coord.y = coord.y - uInputClamp.w; + } else if (fillMode == MIRROR) { + coord.y = uInputClamp.w * 2.0 - coord.y; + } + } else if (coord.y < uInputClamp.y) { + if (fillMode == TRANSPARENT) { + discarded = true; + } else if (fillMode == LOOP) { + coord.y = coord.y + uInputClamp.w; + } else if (fillMode == MIRROR) { + coord.y = coord.y * -uInputClamp.w; + } + } + } + + let seedR: f32 = 1.0 - uSeed * 0.4; + let seedG: f32 = 1.0 - uSeed * 0.3; + let seedB: f32 = 1.0 - uSeed * 0.2; + + let offsetR: vec2 = vec2(uRed.x * seedR / uInputSize.x, uRed.y * seedR / uInputSize.y); + let offsetG: vec2 = vec2(uGreen.x * seedG / uInputSize.x, uGreen.y * seedG / uInputSize.y); + let offsetB: vec2 = vec2(uBlue.x * seedB / uInputSize.x, uBlue.y * seedB / uInputSize.y); + + let r = textureSample(uTexture, uSampler, coord + offsetR).r; + let g = textureSample(uTexture, uSampler, coord + offsetG).g; + let b = textureSample(uTexture, uSampler, coord + offsetB).b; + let a = textureSample(uTexture, uSampler, coord).a; + + return select(vec4(r, g, b, a), vec4(0.0,0.0,0.0,0.0), discarded); +} + +const TRANSPARENT: i32 = 0; +const ORIGINAL: i32 = 1; +const LOOP: i32 = 2; +const CLAMP: i32 = 3; +const MIRROR: i32 = 4;`,Ni=Object.defineProperty,Hn=Object.getOwnPropertySymbols,Vi=Object.prototype.hasOwnProperty,Xi=Object.prototype.propertyIsEnumerable,de=(r,e,n)=>e in r?Ni(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,Zn=(r,e)=>{for(var n in e||(e={}))Vi.call(e,n)&&de(r,n,e[n]);if(Hn)for(var n of Hn(e))Xi.call(e,n)&&de(r,n,e[n]);return r},y=(r,e,n)=>(de(r,typeof e!="symbol"?e+"":e,n),n),Yi=(r=>(r[r.TRANSPARENT=0]="TRANSPARENT",r[r.ORIGINAL=1]="ORIGINAL",r[r.LOOP=2]="LOOP",r[r.CLAMP=3]="CLAMP",r[r.MIRROR=4]="MIRROR",r))(Yi||{});const Qn=class pt extends i.Filter{constructor(e){var n,t,o,u,l;e=Zn(Zn({},pt.defaults),e);const a=i.GpuProgram.from({vertex:{source:m,entryPoint:"mainVertex"},fragment:{source:Bi,entryPoint:"mainFragment"}}),p=i.GlProgram.from({vertex:c,fragment:ki,name:"glitch-filter"}),v=document.createElement("canvas");v.width=4,v.height=(n=e.sampleSize)!=null?n:512;const h=new i.Texture({source:new i.ImageSource({resource:v})});super({gpuProgram:a,glProgram:p,resources:{glitchUniforms:{uSeed:{value:(t=e==null?void 0:e.seed)!=null?t:0,type:"f32"},uDimensions:{value:new Float32Array(2),type:"vec2"},uAspect:{value:1,type:"f32"},uFillMode:{value:(o=e==null?void 0:e.fillMode)!=null?o:0,type:"f32"},uOffset:{value:(u=e==null?void 0:e.offset)!=null?u:100,type:"f32"},uDirection:{value:(l=e==null?void 0:e.direction)!=null?l:0,type:"f32"},uRed:{value:e.red,type:"vec2"},uGreen:{value:e.green,type:"vec2"},uBlue:{value:e.blue,type:"vec2"}},uDisplacementMap:h.source,uDisplacementSampler:h.source.style}}),y(this,"uniforms"),y(this,"average",!1),y(this,"minSize",8),y(this,"sampleSize",512),y(this,"_canvas"),y(this,"texture"),y(this,"_slices",0),y(this,"_sizes",new Float32Array(1)),y(this,"_offsets",new Float32Array(1)),this.uniforms=this.resources.glitchUniforms.uniforms,this._canvas=v,this.texture=h,Object.assign(this,e)}apply(e,n,t,o){const{width:u,height:l}=n.frame;this.uniforms.uDimensions[0]=u,this.uniforms.uDimensions[1]=l,this.uniforms.uAspect=l/u,e.applyFilter(this,n,t,o)}_randomizeSizes(){const e=this._sizes,n=this._slices-1,t=this.sampleSize,o=Math.min(this.minSize/t,.9/this._slices);if(this.average){const u=this._slices;let l=1;for(let a=0;a0;t--){const o=Math.random()*t>>0,u=e[t];e[t]=e[o],e[o]=u}}_randomizeOffsets(){for(let e=0;e0?o:0,v=o<0?-o:0;t.fillStyle=`rgba(${p}, ${v}, 0, 1)`,t.fillRect(0,u>>0,e,a+1>>0),u+=a}n.source.update()}set sizes(e){const n=Math.min(this._slices,e.length);for(let t=0;t .5; + float innerStrength = uStrength[0]; + float outerStrength = uStrength[1]; + + float alphaRatio = totalAlpha / MAX_TOTAL_ALPHA; + float innerGlowAlpha = (1. - alphaRatio) * innerStrength * curColor.a * uAlpha; + float innerGlowStrength = min(1., innerGlowAlpha); + + vec4 innerColor = mix(curColor, glowColor, innerGlowStrength); + float outerGlowAlpha = alphaRatio * outerStrength * (1. - curColor.a) * uAlpha; + float outerGlowStrength = min(1. - innerColor.a, outerGlowAlpha); + vec4 outerGlowColor = outerGlowStrength * glowColor.rgba; + + if (knockout) { + float resultAlpha = outerGlowAlpha + innerGlowAlpha; + finalColor = vec4(glowColor.rgb * resultAlpha, resultAlpha); + } + else { + finalColor = innerColor + outerGlowColor; + } +} +`,qi=`struct GlowUniforms { + uDistance: f32, + uStrength: vec2, + uColor: vec3, + uAlpha: f32, + uQuality: f32, + uKnockout: f32, +}; + +struct GlobalFilterUniforms { + uInputSize:vec4, + uInputPixel:vec4, + uInputClamp:vec4, + uOutputFrame:vec4, + uGlobalFrame:vec4, + uOutputTexture:vec4, +}; + +@group(0) @binding(0) var gfu: GlobalFilterUniforms; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var glowUniforms : GlowUniforms; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 +) -> @location(0) vec4 { + let quality = glowUniforms.uQuality; + let distance = glowUniforms.uDistance; + + let dist: f32 = glowUniforms.uDistance; + let angleStepSize: f32 = min(1. / quality / distance, PI * 2.0); + let angleStepNum: f32 = ceil(PI * 2.0 / angleStepSize); + + let px: vec2 = vec2(1.0 / gfu.uInputSize.xy); + + var totalAlpha: f32 = 0.0; + + var direction: vec2; + var displaced: vec2; + var curColor: vec4; + + for (var angle = 0.0; angle < PI * 2.0; angle += angleStepSize) { + direction = vec2(cos(angle), sin(angle)) * px; + for (var curDistance = 0.0; curDistance < dist; curDistance+=1) { + displaced = vec2(clamp(uv + direction * (curDistance + 1.0), gfu.uInputClamp.xy, gfu.uInputClamp.zw)); + curColor = textureSample(uTexture, uSampler, displaced); + totalAlpha += (dist - curDistance) * curColor.a; + } + } + + curColor = textureSample(uTexture, uSampler, uv); + + let glowColorRGB = glowUniforms.uColor; + let glowAlpha = glowUniforms.uAlpha; + let glowColor = vec4(glowColorRGB, glowAlpha); + let knockout: bool = glowUniforms.uKnockout > 0.5; + let innerStrength = glowUniforms.uStrength[0]; + let outerStrength = glowUniforms.uStrength[1]; + + let alphaRatio: f32 = (totalAlpha / (angleStepNum * dist * (dist + 1.0) / 2.0)); + let innerGlowAlpha: f32 = (1.0 - alphaRatio) * innerStrength * curColor.a * glowAlpha; + let innerGlowStrength: f32 = min(1.0, innerGlowAlpha); + + let innerColor: vec4 = mix(curColor, glowColor, innerGlowStrength); + let outerGlowAlpha: f32 = alphaRatio * outerStrength * (1. - curColor.a) * glowAlpha; + let outerGlowStrength: f32 = min(1.0 - innerColor.a, outerGlowAlpha); + let outerGlowColor: vec4 = outerGlowStrength * glowColor.rgba; + + if (knockout) { + let resultAlpha: f32 = outerGlowAlpha + innerGlowAlpha; + return vec4(glowColor.rgb * resultAlpha, resultAlpha); + } + else { + return innerColor + outerGlowColor; + } +} + +const PI: f32 = 3.14159265358979323846264;`,ji=Object.defineProperty,Jn=Object.getOwnPropertySymbols,Hi=Object.prototype.hasOwnProperty,Zi=Object.prototype.propertyIsEnumerable,he=(r,e,n)=>e in r?ji(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,er=(r,e)=>{for(var n in e||(e={}))Hi.call(e,n)&&he(r,n,e[n]);if(Jn)for(var n of Jn(e))Zi.call(e,n)&&he(r,n,e[n]);return r},xe=(r,e,n)=>(he(r,typeof e!="symbol"?e+"":e,n),n);const nr=class vt extends i.Filter{constructor(e){var n,t,o,u;e=er(er({},vt.DEFAULT_OPTIONS),e);const l=(n=e.distance)!=null?n:10,a=(t=e.quality)!=null?t:.1,p=i.GpuProgram.from({vertex:{source:m,entryPoint:"mainVertex"},fragment:{source:qi,entryPoint:"mainFragment"}}),v=i.GlProgram.from({vertex:c,fragment:Wi.replace(/__ANGLE_STEP_SIZE__/gi,`${(1/a/l).toFixed(7)}`).replace(/__DIST__/gi,`${l.toFixed(0)}.0`),name:"glow-filter"});super({gpuProgram:p,glProgram:v,resources:{glowUniforms:{uDistance:{value:l,type:"f32"},uStrength:{value:[e.innerStrength,e.outerStrength],type:"vec2"},uColor:{value:new Float32Array(3),type:"vec3"},uAlpha:{value:e.alpha,type:"f32"},uQuality:{value:a,type:"f32"},uKnockout:{value:(o=e==null?void 0:e.knockout)!=null&&o?1:0,type:"f32"}}},padding:l}),xe(this,"uniforms"),xe(this,"_color"),this.uniforms=this.resources.glowUniforms.uniforms,this._color=new i.Color,this.color=(u=e.color)!=null?u:16777215}get distance(){return this.uniforms.uDistance}set distance(e){this.uniforms.uDistance=this.padding=e}get innerStrength(){return this.uniforms.uStrength[0]}set innerStrength(e){this.uniforms.uStrength[0]=e}get outerStrength(){return this.uniforms.uStrength[1]}set outerStrength(e){this.uniforms.uStrength[1]=e}get color(){return this._color.value}set color(e){this._color.setValue(e);const[n,t,o]=this._color.toArray();this.uniforms.uColor[0]=n,this.uniforms.uColor[1]=t,this.uniforms.uColor[2]=o}get alpha(){return this.uniforms.uAlpha}set alpha(e){this.uniforms.uAlpha=e}get quality(){return this.uniforms.uQuality}set quality(e){this.uniforms.uQuality=e}get knockout(){return this.uniforms.uKnockout===1}set knockout(e){this.uniforms.uKnockout=e?1:0}};xe(nr,"DEFAULT_OPTIONS",{distance:10,outerStrength:4,innerStrength:0,color:16777215,alpha:1,quality:.1,knockout:!1});let Qi=nr;var Ji=`precision highp float; +in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform vec2 uDimensions; +uniform float uParallel; +uniform vec2 uLight; +uniform float uAspect; +uniform float uTime; +uniform vec3 uRay; + +uniform vec4 uInputSize; + +\${PERLIN} + +void main(void) { + vec2 uDimensions = uDimensions; + bool uParallel = uParallel > 0.5; + vec2 uLight = uLight; + float uAspect = uAspect; + + vec2 coord = vTextureCoord * uInputSize.xy / uDimensions; + + float d; + + if (uParallel) { + float _cos = uLight.x; + float _sin = uLight.y; + d = (_cos * coord.x) + (_sin * coord.y * uAspect); + } else { + float dx = coord.x - uLight.x / uDimensions.x; + float dy = (coord.y - uLight.y / uDimensions.y) * uAspect; + float dis = sqrt(dx * dx + dy * dy) + 0.00001; + d = dy / dis; + } + + float uTime = uTime; + vec3 uRay = uRay; + + float gain = uRay[0]; + float lacunarity = uRay[1]; + float alpha = uRay[2]; + + vec3 dir = vec3(d, d, 0.0); + float noise = turb(dir + vec3(uTime, 0.0, 62.1 + uTime) * 0.05, vec3(480.0, 320.0, 480.0), lacunarity, gain); + noise = mix(noise, 0.0, 0.3); + //fade vertically. + vec4 mist = vec4(vec3(noise), 1.0) * (1.0 - coord.y); + mist.a = 1.0; + // apply user alpha + mist *= alpha; + + finalColor = texture(uTexture, vTextureCoord) + mist; +} +`,eu=`struct GodrayUniforms { + uLight: vec2, + uParallel: f32, + uAspect: f32, + uTime: f32, + uRay: vec3, + uDimensions: vec2, +}; + +struct GlobalFilterUniforms { + uInputSize:vec4, + uInputPixel:vec4, + uInputClamp:vec4, + uOutputFrame:vec4, + uGlobalFrame:vec4, + uOutputTexture:vec4, +}; + +@group(0) @binding(0) var gfu: GlobalFilterUniforms; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var godrayUniforms : GodrayUniforms; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 +) -> @location(0) vec4 { + let uDimensions: vec2 = godrayUniforms.uDimensions; + let uParallel: bool = godrayUniforms.uParallel > 0.5; + let uLight: vec2 = godrayUniforms.uLight; + let uAspect: f32 = godrayUniforms.uAspect; + + let coord: vec2 = uv * gfu.uInputSize.xy / uDimensions; + + var d: f32; + + if (uParallel) { + let _cos: f32 = uLight.x; + let _sin: f32 = uLight.y; + d = (_cos * coord.x) + (_sin * coord.y * uAspect); + } else { + let dx: f32 = coord.x - uLight.x / uDimensions.x; + let dy: f32 = (coord.y - uLight.y / uDimensions.y) * uAspect; + let dis: f32 = sqrt(dx * dx + dy * dy) + 0.00001; + d = dy / dis; + } + + let uTime: f32 = godrayUniforms.uTime; + let uRay: vec3 = godrayUniforms.uRay; + + let gain = uRay[0]; + let lacunarity = uRay[1]; + let alpha = uRay[2]; + + let dir: vec3 = vec3(d, d, 0.0); + var noise: f32 = turb(dir + vec3(uTime, 0.0, 62.1 + uTime) * 0.05, vec3(480.0, 320.0, 480.0), lacunarity, gain); + noise = mix(noise, 0.0, 0.3); + //fade vertically. + var mist: vec4 = vec4(vec3(noise), 1.0) * (1.0 - coord.y); + mist.a = 1.0; + // apply user alpha + mist *= alpha; + return textureSample(uTexture, uSampler, uv) + mist; +} + +\${PERLIN}`,nu=`vec3 mod289(vec3 x) +{ + return x - floor(x * (1.0 / 289.0)) * 289.0; +} +vec4 mod289(vec4 x) +{ + return x - floor(x * (1.0 / 289.0)) * 289.0; +} +vec4 permute(vec4 x) +{ + return mod289(((x * 34.0) + 1.0) * x); +} +vec4 taylorInvSqrt(vec4 r) +{ + return 1.79284291400159 - 0.85373472095314 * r; +} +vec3 fade(vec3 t) +{ + return t * t * t * (t * (t * 6.0 - 15.0) + 10.0); +} +// Classic Perlin noise, periodic variant +float pnoise(vec3 P, vec3 rep) +{ + vec3 Pi0 = mod(floor(P), rep); // Integer part, modulo period + vec3 Pi1 = mod(Pi0 + vec3(1.0), rep); // Integer part + 1, mod period + Pi0 = mod289(Pi0); + Pi1 = mod289(Pi1); + vec3 Pf0 = fract(P); // Fractional part for interpolation + vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0 + vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x); + vec4 iy = vec4(Pi0.yy, Pi1.yy); + vec4 iz0 = Pi0.zzzz; + vec4 iz1 = Pi1.zzzz; + vec4 ixy = permute(permute(ix) + iy); + vec4 ixy0 = permute(ixy + iz0); + vec4 ixy1 = permute(ixy + iz1); + vec4 gx0 = ixy0 * (1.0 / 7.0); + vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5; + gx0 = fract(gx0); + vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0); + vec4 sz0 = step(gz0, vec4(0.0)); + gx0 -= sz0 * (step(0.0, gx0) - 0.5); + gy0 -= sz0 * (step(0.0, gy0) - 0.5); + vec4 gx1 = ixy1 * (1.0 / 7.0); + vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5; + gx1 = fract(gx1); + vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1); + vec4 sz1 = step(gz1, vec4(0.0)); + gx1 -= sz1 * (step(0.0, gx1) - 0.5); + gy1 -= sz1 * (step(0.0, gy1) - 0.5); + vec3 g000 = vec3(gx0.x, gy0.x, gz0.x); + vec3 g100 = vec3(gx0.y, gy0.y, gz0.y); + vec3 g010 = vec3(gx0.z, gy0.z, gz0.z); + vec3 g110 = vec3(gx0.w, gy0.w, gz0.w); + vec3 g001 = vec3(gx1.x, gy1.x, gz1.x); + vec3 g101 = vec3(gx1.y, gy1.y, gz1.y); + vec3 g011 = vec3(gx1.z, gy1.z, gz1.z); + vec3 g111 = vec3(gx1.w, gy1.w, gz1.w); + vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110))); + g000 *= norm0.x; + g010 *= norm0.y; + g100 *= norm0.z; + g110 *= norm0.w; + vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111))); + g001 *= norm1.x; + g011 *= norm1.y; + g101 *= norm1.z; + g111 *= norm1.w; + float n000 = dot(g000, Pf0); + float n100 = dot(g100, vec3(Pf1.x, Pf0.yz)); + float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z)); + float n110 = dot(g110, vec3(Pf1.xy, Pf0.z)); + float n001 = dot(g001, vec3(Pf0.xy, Pf1.z)); + float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z)); + float n011 = dot(g011, vec3(Pf0.x, Pf1.yz)); + float n111 = dot(g111, Pf1); + vec3 fade_xyz = fade(Pf0); + vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z); + vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y); + float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x); + return 2.2 * n_xyz; +} +float turb(vec3 P, vec3 rep, float lacunarity, float gain) +{ + float sum = 0.0; + float sc = 1.0; + float totalgain = 1.0; + for (float i = 0.0; i < 6.0; i++) + { + sum += totalgain * pnoise(P * sc, rep); + sc *= lacunarity; + totalgain *= gain; + } + return abs(sum); +} +`,ru=`// Taken from https://gist.github.com/munrocket/236ed5ba7e409b8bdf1ff6eca5dcdc39 + +fn moduloVec3(x: vec3, y: vec3) -> vec3 +{ + return x - y * floor(x/y); +} +fn mod289Vec3(x: vec3) -> vec3 +{ + return x - floor(x * (1.0 / 289.0)) * 289.0; +} +fn mod289Vec4(x: vec4) -> vec4 +{ + return x - floor(x * (1.0 / 289.0)) * 289.0; +} +fn permute4(x: vec4) -> vec4 +{ + return mod289Vec4(((x * 34.0) + 1.0) * x); +} +fn taylorInvSqrt(r: vec4) -> vec4 +{ + return 1.79284291400159 - 0.85373472095314 * r; +} +fn fade3(t: vec3) -> vec3 +{ + return t * t * t * (t * (t * 6.0 - 15.0) + 10.0); +} +fn fade2(t: vec2) -> vec2 { return t * t * t * (t * (t * 6. - 15.) + 10.); } + +fn perlinNoise2(P: vec2) -> f32 { + var Pi: vec4 = floor(P.xyxy) + vec4(0., 0., 1., 1.); + let Pf = fract(P.xyxy) - vec4(0., 0., 1., 1.); + Pi = Pi % vec4(289.); // To avoid truncation effects in permutation + let ix = Pi.xzxz; + let iy = Pi.yyww; + let fx = Pf.xzxz; + let fy = Pf.yyww; + let i = permute4(permute4(ix) + iy); + var gx: vec4 = 2. * fract(i * 0.0243902439) - 1.; // 1/41 = 0.024... + let gy = abs(gx) - 0.5; + let tx = floor(gx + 0.5); + gx = gx - tx; + var g00: vec2 = vec2(gx.x, gy.x); + var g10: vec2 = vec2(gx.y, gy.y); + var g01: vec2 = vec2(gx.z, gy.z); + var g11: vec2 = vec2(gx.w, gy.w); + let norm = 1.79284291400159 - 0.85373472095314 * + vec4(dot(g00, g00), dot(g01, g01), dot(g10, g10), dot(g11, g11)); + g00 = g00 * norm.x; + g01 = g01 * norm.y; + g10 = g10 * norm.z; + g11 = g11 * norm.w; + let n00 = dot(g00, vec2(fx.x, fy.x)); + let n10 = dot(g10, vec2(fx.y, fy.y)); + let n01 = dot(g01, vec2(fx.z, fy.z)); + let n11 = dot(g11, vec2(fx.w, fy.w)); + let fade_xy = fade2(Pf.xy); + let n_x = mix(vec2(n00, n01), vec2(n10, n11), vec2(fade_xy.x)); + let n_xy = mix(n_x.x, n_x.y, fade_xy.y); + return 2.3 * n_xy; +} + +// Classic Perlin noise, periodic variant +fn perlinNoise3(P: vec3, rep: vec3) -> f32 +{ + var Pi0: vec3 = moduloVec3(floor(P), rep); // Integer part, modulo period + var Pi1: vec3 = moduloVec3(Pi0 + vec3(1.0), rep); // Integer part + 1, mod period + Pi0 = mod289Vec3(Pi0); + Pi1 = mod289Vec3(Pi1); + let Pf0: vec3 = fract(P); // Fractional part for interpolation + let Pf1: vec3 = Pf0 - vec3(1.0); // Fractional part - 1.0 + let ix: vec4 = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x); + let iy: vec4 = vec4(Pi0.yy, Pi1.yy); + let iz0: vec4 = Pi0.zzzz; + let iz1: vec4 = Pi1.zzzz; + let ixy: vec4 = permute4(permute4(ix) + iy); + let ixy0: vec4 = permute4(ixy + iz0); + let ixy1: vec4 = permute4(ixy + iz1); + var gx0: vec4 = ixy0 * (1.0 / 7.0); + var gy0: vec4 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5; + gx0 = fract(gx0); + let gz0: vec4 = vec4(0.5) - abs(gx0) - abs(gy0); + let sz0: vec4 = step(gz0, vec4(0.0)); + gx0 -= sz0 * (step(vec4(0.0), gx0) - 0.5); + gy0 -= sz0 * (step(vec4(0.0), gy0) - 0.5); + var gx1: vec4 = ixy1 * (1.0 / 7.0); + var gy1: vec4 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5; + gx1 = fract(gx1); + let gz1: vec4 = vec4(0.5) - abs(gx1) - abs(gy1); + let sz1: vec4 = step(gz1, vec4(0.0)); + gx1 -= sz1 * (step(vec4(0.0), gx1) - 0.5); + gy1 -= sz1 * (step(vec4(0.0), gy1) - 0.5); + var g000: vec3 = vec3(gx0.x, gy0.x, gz0.x); + var g100: vec3 = vec3(gx0.y, gy0.y, gz0.y); + var g010: vec3 = vec3(gx0.z, gy0.z, gz0.z); + var g110: vec3 = vec3(gx0.w, gy0.w, gz0.w); + var g001: vec3 = vec3(gx1.x, gy1.x, gz1.x); + var g101: vec3 = vec3(gx1.y, gy1.y, gz1.y); + var g011: vec3 = vec3(gx1.z, gy1.z, gz1.z); + var g111: vec3 = vec3(gx1.w, gy1.w, gz1.w); + let norm0: vec4 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110))); + g000 *= norm0.x; + g010 *= norm0.y; + g100 *= norm0.z; + g110 *= norm0.w; + let norm1: vec4 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111))); + g001 *= norm1.x; + g011 *= norm1.y; + g101 *= norm1.z; + g111 *= norm1.w; + let n000: f32 = dot(g000, Pf0); + let n100: f32 = dot(g100, vec3(Pf1.x, Pf0.yz)); + let n010: f32 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z)); + let n110: f32 = dot(g110, vec3(Pf1.xy, Pf0.z)); + let n001: f32 = dot(g001, vec3(Pf0.xy, Pf1.z)); + let n101: f32 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z)); + let n011: f32 = dot(g011, vec3(Pf0.x, Pf1.yz)); + let n111: f32 = dot(g111, Pf1); + let fade_xyz: vec3 = fade3(Pf0); + let n_z: vec4 = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z); + let n_yz: vec2 = mix(n_z.xy, n_z.zw, fade_xyz.y); + let n_xyz: f32 = mix(n_yz.x, n_yz.y, fade_xyz.x); + return 2.2 * n_xyz; +} +fn turb(P: vec3, rep: vec3, lacunarity: f32, gain: f32) -> f32 +{ + var sum: f32 = 0.0; + var sc: f32 = 1.0; + var totalgain: f32 = 1.0; + for (var i = 0.0; i < 6.0; i += 1) + { + sum += totalgain * perlinNoise3(P * sc, rep); + sc *= lacunarity; + totalgain *= gain; + } + return abs(sum); +}`,tu=Object.defineProperty,rr=Object.getOwnPropertySymbols,ou=Object.prototype.hasOwnProperty,iu=Object.prototype.propertyIsEnumerable,ye=(r,e,n)=>e in r?tu(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,tr=(r,e)=>{for(var n in e||(e={}))ou.call(e,n)&&ye(r,n,e[n]);if(rr)for(var n of rr(e))iu.call(e,n)&&ye(r,n,e[n]);return r},_=(r,e,n)=>(ye(r,typeof e!="symbol"?e+"":e,n),n);const or=class gt extends i.Filter{constructor(e){e=tr(tr({},gt.DEFAULT_OPTIONS),e);const n=i.GpuProgram.from({vertex:{source:m,entryPoint:"mainVertex"},fragment:{source:eu.replace("${PERLIN}",ru),entryPoint:"mainFragment"}}),t=i.GlProgram.from({vertex:c,fragment:Ji.replace("${PERLIN}",nu),name:"god-ray-filter"});super({gpuProgram:n,glProgram:t,resources:{godrayUniforms:{uLight:{value:new Float32Array(2),type:"vec2"},uParallel:{value:0,type:"f32"},uAspect:{value:0,type:"f32"},uTime:{value:e.time,type:"f32"},uRay:{value:new Float32Array(3),type:"vec3"},uDimensions:{value:new Float32Array(2),type:"vec2"}}}}),_(this,"uniforms"),_(this,"time",0),_(this,"_angleLight",[0,0]),_(this,"_angle",0),_(this,"_center"),this.uniforms=this.resources.godrayUniforms.uniforms,Object.assign(this,e)}apply(e,n,t,o){const u=n.frame.width,l=n.frame.height;this.uniforms.uLight[0]=this.parallel?this._angleLight[0]:this._center.x,this.uniforms.uLight[1]=this.parallel?this._angleLight[1]:this._center.y,this.uniforms.uDimensions[0]=u,this.uniforms.uDimensions[1]=l,this.uniforms.uAspect=l/u,this.uniforms.uTime=this.time,e.applyFilter(this,n,t,o)}get angle(){return this._angle}set angle(e){this._angle=e;const n=e*i.DEG_TO_RAD;this._angleLight[0]=Math.cos(n),this._angleLight[1]=Math.sin(n)}get parallel(){return this.uniforms.uParallel>.5}set parallel(e){this.uniforms.uParallel=e?1:0}get center(){return this._center}set center(e){Array.isArray(e)&&(e={x:e[0],y:e[1]}),this._center=e}get centerX(){return this.center.x}set centerX(e){this.center.x=e}get centerY(){return this.center.y}set centerY(e){this.center.y=e}get gain(){return this.uniforms.uRay[0]}set gain(e){this.uniforms.uRay[0]=e}get lacunarity(){return this.uniforms.uRay[1]}set lacunarity(e){this.uniforms.uRay[1]=e}get alpha(){return this.uniforms.uRay[2]}set alpha(e){this.uniforms.uRay[2]=e}};_(or,"DEFAULT_OPTIONS",{angle:30,gain:.5,lacunarity:2.5,parallel:!0,time:0,center:{x:0,y:0},alpha:1});let uu=or;var lu=`in vec2 vTextureCoord; + +out vec4 finalColor; + +uniform sampler2D uTexture; + +// https://en.wikipedia.org/wiki/Luma_(video) +const vec3 weight = vec3(0.299, 0.587, 0.114); + +void main() +{ + vec4 c = texture(uTexture, vTextureCoord); + finalColor = vec4( + vec3(c.r * weight.r + c.g * weight.g + c.b * weight.b), + c.a + ); +} +`,au=`@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; + +@fragment +fn mainFragment( + @location(0) uv: vec2, + @builtin(position) position: vec4 +) -> @location(0) vec4 { + let color: vec4 = textureSample(uTexture, uSampler, uv); + + let g: f32 = dot(color.rgb, vec3(0.299, 0.587, 0.114)); + return vec4(vec3(g), 1.); +}`;class su extends i.Filter{constructor(){const e=i.GpuProgram.from({vertex:{source:m,entryPoint:"mainVertex"},fragment:{source:au,entryPoint:"mainFragment"}}),n=i.GlProgram.from({vertex:c,fragment:lu,name:"grayscale-filter"});super({gpuProgram:e,glProgram:n,resources:{}})}}var fu=`in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform vec3 uHsl; +uniform float uAlpha; +uniform float uColorize; + +// https://en.wikipedia.org/wiki/Luma_(video) +const vec3 weight = vec3(0.299, 0.587, 0.114); + +float getWeightedAverage(vec3 rgb) { + return rgb.r * weight.r + rgb.g * weight.g + rgb.b * weight.b; +} + +// https://gist.github.com/mairod/a75e7b44f68110e1576d77419d608786?permalink_comment_id=3195243#gistcomment-3195243 +const vec3 k = vec3(0.57735, 0.57735, 0.57735); + +vec3 hueShift(vec3 color, float angle) { + float cosAngle = cos(angle); + return vec3( + color * cosAngle + + cross(k, color) * sin(angle) + + k * dot(k, color) * (1.0 - cosAngle) + ); +} + +void main() +{ + vec4 color = texture(uTexture, vTextureCoord); + vec3 resultRGB = color.rgb; + + float hue = uHsl[0]; + float saturation = uHsl[1]; + float lightness = uHsl[2]; + + // colorize + if (uColorize > 0.5) { + resultRGB = vec3(getWeightedAverage(resultRGB), 0., 0.); + } + + // hue + resultRGB = hueShift(resultRGB, hue); + + // saturation + // https://github.com/evanw/glfx.js/blob/master/src/filters/adjust/huesaturation.js + float average = (resultRGB.r + resultRGB.g + resultRGB.b) / 3.0; + + if (saturation > 0.) { + resultRGB += (average - resultRGB) * (1. - 1. / (1.001 - saturation)); + } else { + resultRGB -= (average - resultRGB) * saturation; + } + + // lightness + resultRGB = mix(resultRGB, vec3(ceil(lightness)) * color.a, abs(lightness)); + + // alpha + finalColor = mix(color, vec4(resultRGB, color.a), uAlpha); +} +`,cu=`struct HslUniforms { + uHsl:vec3, + uColorize:f32, + uAlpha:f32, +}; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var hslUniforms : HslUniforms; + +@fragment +fn mainFragment( + @location(0) uv: vec2, + @builtin(position) position: vec4 +) -> @location(0) vec4 { + let color: vec4 = textureSample(uTexture, uSampler, uv); + var resultRGB: vec3 = color.rgb; + + let hue: f32 = hslUniforms.uHsl[0]; + let saturation: f32 = hslUniforms.uHsl[1]; + let lightness: f32 = hslUniforms.uHsl[2]; + + // colorize + if (hslUniforms.uColorize > 0.5) { + resultRGB = vec3(dot(color.rgb, vec3(0.299, 0.587, 0.114)), 0., 0.); + } + + // hue + resultRGB = hueShift(resultRGB, hue); + + // saturation + // https://github.com/evanw/glfx.js/blob/master/src/filters/adjust/huesaturation.js + let average: f32 = (resultRGB.r + resultRGB.g + resultRGB.b) / 3.0; + + if (saturation > 0.) { + resultRGB += (average - resultRGB) * (1. - 1. / (1.001 - saturation)); + } else { + resultRGB -= (average - resultRGB) * saturation; + } + + // lightness + resultRGB = mix(resultRGB, vec3(ceil(lightness)) * color.a, abs(lightness)); + + // alpha + return mix(color, vec4(resultRGB, color.a), hslUniforms.uAlpha); +} + +// https://gist.github.com/mairod/a75e7b44f68110e1576d77419d608786?permalink_comment_id=3195243#gistcomment-3195243 +const k: vec3 = vec3(0.57735, 0.57735, 0.57735); + +fn hueShift(color: vec3, angle: f32) -> vec3 +{ + let cosAngle: f32 = cos(angle); + return vec3( + color * cosAngle + + cross(k, color) * sin(angle) + + k * dot(k, color) * (1.0 - cosAngle) + ); +}`,mu=Object.defineProperty,ir=Object.getOwnPropertySymbols,pu=Object.prototype.hasOwnProperty,vu=Object.prototype.propertyIsEnumerable,Se=(r,e,n)=>e in r?mu(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,ur=(r,e)=>{for(var n in e||(e={}))pu.call(e,n)&&Se(r,n,e[n]);if(ir)for(var n of ir(e))vu.call(e,n)&&Se(r,n,e[n]);return r},be=(r,e,n)=>(Se(r,typeof e!="symbol"?e+"":e,n),n);const lr=class dt extends i.Filter{constructor(e){e=ur(ur({},dt.DEFAULT_OPTIONS),e);const n=i.GpuProgram.from({vertex:{source:m,entryPoint:"mainVertex"},fragment:{source:cu,entryPoint:"mainFragment"}}),t=i.GlProgram.from({vertex:c,fragment:fu,name:"hsl-adjustment-filter"});super({gpuProgram:n,glProgram:t,resources:{hslUniforms:{uHsl:{value:new Float32Array(3),type:"vec3"},uColorize:{value:e.colorize?1:0,type:"f32"},uAlpha:{value:e.alpha,type:"f32"}}}}),be(this,"uniforms"),be(this,"_hue"),this.uniforms=this.resources.hslUniforms.uniforms,this.hue=e.hue}get hue(){return this._hue}set hue(e){this._hue=e,this.resources.hslUniforms.uniforms.uHsl[0]=e*(Math.PI/180)}get saturation(){return this.resources.hslUniforms.uniforms.uHsl[1]}set saturation(e){this.resources.hslUniforms.uniforms.uHsl[1]=e}get lightness(){return this.resources.hslUniforms.uniforms.uHsl[2]}set lightness(e){this.resources.hslUniforms.uniforms.uHsl[2]=e}get colorize(){return this.resources.hslUniforms.uniforms.uColorize===1}set colorize(e){this.resources.hslUniforms.uniforms.uColorize=e?1:0}get alpha(){return this.resources.hslUniforms.uniforms.uAlpha}set alpha(e){this.resources.hslUniforms.uniforms.uAlpha=e}};be(lr,"DEFAULT_OPTIONS",{hue:0,saturation:0,lightness:0,colorize:!1,alpha:1});let gu=lr;var du=`precision highp float; +in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform vec2 uVelocity; +uniform int uKernelSize; +uniform float uOffset; + +uniform vec4 uInputSize; + +const int MAX_KERNEL_SIZE = 2048; + +// Notice: +// the perfect way: +// int kernelSize = min(uKernelSize, MAX_KERNELSIZE); +// BUT in real use-case , uKernelSize < MAX_KERNELSIZE almost always. +// So use uKernelSize directly. + +void main(void) +{ + vec4 color = texture(uTexture, vTextureCoord); + + if (uKernelSize == 0) + { + finalColor = color; + return; + } + + vec2 velocity = uVelocity / uInputSize.xy; + float offset = -uOffset / length(uVelocity) - 0.5; + int k = uKernelSize - 1; + + for(int i = 0; i < MAX_KERNEL_SIZE - 1; i++) { + if (i == k) { + break; + } + vec2 bias = velocity * (float(i) / float(k) + offset); + color += texture(uTexture, vTextureCoord + bias); + } + finalColor = color / float(uKernelSize); +} +`,hu=`struct MotionBlurUniforms { + uVelocity: vec2, + uKernelSize: f32, + uOffset: f32, +}; + +struct GlobalFilterUniforms { + uInputSize:vec4, + uInputPixel:vec4, + uInputClamp:vec4, + uOutputFrame:vec4, + uGlobalFrame:vec4, + uOutputTexture:vec4, +}; + +@group(0) @binding(0) var gfu: GlobalFilterUniforms; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var motionBlurUniforms : MotionBlurUniforms; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 +) -> @location(0) vec4 { + let uVelocity = motionBlurUniforms.uVelocity; + let uKernelSize = motionBlurUniforms.uKernelSize; + let uOffset = motionBlurUniforms.uOffset; + + let velocity: vec2 = uVelocity / gfu.uInputSize.xy; + let offset: f32 = -uOffset / length(uVelocity) - 0.5; + let k: i32 = i32(min(uKernelSize - 1, MAX_KERNEL_SIZE - 1)); + + var color: vec4 = textureSample(uTexture, uSampler, uv); + + for(var i: i32 = 0; i < k; i += 1) { + let bias: vec2 = velocity * (f32(i) / f32(k) + offset); + color += textureSample(uTexture, uSampler, uv + bias); + } + + return select(color / f32(uKernelSize), textureSample(uTexture, uSampler, uv), uKernelSize == 0); +} + +const MAX_KERNEL_SIZE: f32 = 2048;`,xu=Object.defineProperty,ar=Object.getOwnPropertySymbols,yu=Object.prototype.hasOwnProperty,Su=Object.prototype.propertyIsEnumerable,Ce=(r,e,n)=>e in r?xu(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,sr=(r,e)=>{for(var n in e||(e={}))yu.call(e,n)&&Ce(r,n,e[n]);if(ar)for(var n of ar(e))Su.call(e,n)&&Ce(r,n,e[n]);return r},Te=(r,e,n)=>(Ce(r,typeof e!="symbol"?e+"":e,n),n);const fr=class ht extends i.Filter{constructor(...e){var n,t;let o=(n=e[0])!=null?n:{};if(Array.isArray(o)||"x"in o&&"y"in o||o instanceof i.ObservablePoint){i.deprecation("6.0.0","MotionBlurFilter constructor params are now options object. See params: { velocity, kernelSize, offset }");const a="x"in o?o.x:o[0],p="y"in o?o.y:o[1];o={velocity:{x:a,y:p}},e[1]!==void 0&&(o.kernelSize=e[1]),e[2]!==void 0&&(o.offset=e[2])}o=sr(sr({},ht.DEFAULT_OPTIONS),o);const u=i.GpuProgram.from({vertex:{source:m,entryPoint:"mainVertex"},fragment:{source:hu,entryPoint:"mainFragment"}}),l=i.GlProgram.from({vertex:c,fragment:du,name:"motion-blur-filter"});super({gpuProgram:u,glProgram:l,resources:{motionBlurUniforms:{uVelocity:{value:o.velocity,type:"vec2"},uKernelSize:{value:Math.trunc((t=o.kernelSize)!=null?t:5),type:"f32"},uOffset:{value:o.offset,type:"f32"}}}}),Te(this,"uniforms"),Te(this,"_kernelSize"),this.uniforms=this.resources.motionBlurUniforms.uniforms,Object.assign(this,o)}get velocity(){return this.uniforms.uVelocity}set velocity(e){Array.isArray(e)&&(e={x:e[0],y:e[1]}),this.uniforms.uVelocity=e,this._updateDirty()}get velocityX(){return this.velocity.x}set velocityX(e){this.velocity.x=e,this._updateDirty()}get velocityY(){return this.velocity.y}set velocityY(e){this.velocity.y=e,this._updateDirty()}get kernelSize(){return this._kernelSize}set kernelSize(e){this._kernelSize=e,this._updateDirty()}get offset(){return this.uniforms.uOffset}set offset(e){this.uniforms.uOffset=e}_updateDirty(){this.padding=(Math.max(Math.abs(this.velocityX),Math.abs(this.velocityY))>>0)+1,this.uniforms.uKernelSize=this.velocityX!==0||this.velocityY!==0?this._kernelSize:0}};Te(fr,"DEFAULT_OPTIONS",{velocity:{x:0,y:0},kernelSize:5,offset:0});let bu=fr;var Cu=`in vec2 vTextureCoord; +out vec4 finalColor; + +const int MAX_COLORS = \${MAX_COLORS}; + +uniform sampler2D uTexture; +uniform vec3 uOriginalColors[MAX_COLORS]; +uniform vec3 uTargetColors[MAX_COLORS]; +uniform float uTolerance; + +void main(void) +{ + finalColor = texture(uTexture, vTextureCoord); + + float alpha = finalColor.a; + if (alpha < 0.0001) + { + return; + } + + vec3 color = finalColor.rgb / alpha; + + for(int i = 0; i < MAX_COLORS; i++) + { + vec3 origColor = uOriginalColors[i]; + if (origColor.r < 0.0) + { + break; + } + vec3 colorDiff = origColor - color; + if (length(colorDiff) < uTolerance) + { + vec3 targetColor = uTargetColors[i]; + finalColor = vec4((targetColor + colorDiff) * alpha, alpha); + return; + } + } +} +`,Tu=`struct MultiColorReplaceUniforms { + uOriginalColors: array, MAX_COLORS>, + uTargetColors: array, MAX_COLORS>, + uTolerance:f32, +}; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var multiColorReplaceUniforms : MultiColorReplaceUniforms; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 +) -> @location(0) vec4 { + let uOriginalColors = multiColorReplaceUniforms.uOriginalColors; + let uTargetColors = multiColorReplaceUniforms.uTargetColors; + let uTolerance = multiColorReplaceUniforms.uTolerance; + + var color: vec4 = textureSample(uTexture, uSampler, uv); + + let alpha: f32 = color.a; + + if (alpha > 0.0001) + { + var modColor: vec3 = vec3(color.rgb) / alpha; + + for(var i: i32 = 0; i < MAX_COLORS; i += 1) + { + let origColor: vec3 = uOriginalColors[i]; + if (origColor.r < 0.0) + { + break; + } + let colorDiff: vec3 = origColor - modColor; + + if (length(colorDiff) < uTolerance) + { + let targetColor: vec3 = uTargetColors[i]; + color = vec4((targetColor + colorDiff) * alpha, alpha); + return color; + } + } + } + + return color; +} + +const MAX_COLORS: i32 = \${MAX_COLORS};`,Pu=Object.defineProperty,cr=Object.getOwnPropertySymbols,Ou=Object.prototype.hasOwnProperty,zu=Object.prototype.propertyIsEnumerable,Pe=(r,e,n)=>e in r?Pu(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,mr=(r,e)=>{for(var n in e||(e={}))Ou.call(e,n)&&Pe(r,n,e[n]);if(cr)for(var n of cr(e))zu.call(e,n)&&Pe(r,n,e[n]);return r},k=(r,e,n)=>(Pe(r,typeof e!="symbol"?e+"":e,n),n);const pr=class xt extends i.Filter{constructor(...e){var n,t;let o=(n=e[0])!=null?n:{};Array.isArray(o)&&(i.deprecation("6.0.0","MultiColorReplaceFilter constructor params are now options object. See params: { replacements, tolerance, maxColors }"),o={replacements:o},e[1]&&(o.tolerance=e[1]),e[2]&&(o.maxColors=e[2])),o=mr(mr({},xt.DEFAULT_OPTIONS),o);const u=(t=o.maxColors)!=null?t:o.replacements.length,l=i.GpuProgram.from({vertex:{source:m,entryPoint:"mainVertex"},fragment:{source:Tu.replace(/\$\{MAX_COLORS\}/g,u.toFixed(0)),entryPoint:"mainFragment"}}),a=i.GlProgram.from({vertex:c,fragment:Cu.replace(/\$\{MAX_COLORS\}/g,u.toFixed(0)),name:"multi-color-replace-filter"});super({gpuProgram:l,glProgram:a,resources:{multiColorReplaceUniforms:{uOriginalColors:{value:new Float32Array(3*u),type:"vec3",size:u},uTargetColors:{value:new Float32Array(3*u),type:"vec3",size:u},uTolerance:{value:o.tolerance,type:"f32"}}}}),k(this,"uniforms"),k(this,"_replacements",[]),k(this,"_maxColors"),this._maxColors=u,this.uniforms=this.resources.multiColorReplaceUniforms.uniforms,this.replacements=o.replacements}set replacements(e){const n=this.uniforms.uOriginalColors,t=this.uniforms.uTargetColors,o=e.length,u=new i.Color;if(o>this._maxColors)throw new Error(`Length of replacements (${o}) exceeds the maximum colors length (${this._maxColors})`);n[o*3]=-1;let l,a,p;for(let v=0;v 0.5) then: 1 - 2 * (1 - dst) * (1 - src) + return vec3((dst.x <= 0.5) ? (2.0 * src.x * dst.x) : (1.0 - 2.0 * (1.0 - dst.x) * (1.0 - src.x)), + (dst.y <= 0.5) ? (2.0 * src.y * dst.y) : (1.0 - 2.0 * (1.0 - dst.y) * (1.0 - src.y)), + (dst.z <= 0.5) ? (2.0 * src.z * dst.z) : (1.0 - 2.0 * (1.0 - dst.z) * (1.0 - src.z))); +} + + +void main() +{ + finalColor = texture(uTexture, vTextureCoord); + vec3 color = finalColor.rgb; + + if (uSepia > 0.0) + { + float gray = (color.x + color.y + color.z) / 3.0; + vec3 grayscale = vec3(gray); + + color = Overlay(SEPIA_RGB, grayscale); + + color = grayscale + uSepia * (color - grayscale); + } + + vec2 coord = vTextureCoord * uInputSize.xy / uDimensions.xy; + + float vignette = uVignetting[0]; + float vignetteAlpha = uVignetting[1]; + float vignetteBlur = uVignetting[2]; + + if (vignette > 0.0) + { + float outter = SQRT_2 - vignette * SQRT_2; + vec2 dir = vec2(vec2(0.5, 0.5) - coord); + dir.y *= uDimensions.y / uDimensions.x; + float darker = clamp((outter - length(dir) * SQRT_2) / ( 0.00001 + vignetteBlur * SQRT_2), 0.0, 1.0); + color.rgb *= darker + (1.0 - darker) * (1.0 - vignetteAlpha); + } + + float scratch = uScratch[0]; + float scratchDensity = uScratch[1]; + float scratchWidth = uScratch[2]; + + if (scratchDensity > uSeed && scratch != 0.0) + { + float phase = uSeed * 256.0; + float s = mod(floor(phase), 2.0); + float dist = 1.0 / scratchDensity; + float d = distance(coord, vec2(uSeed * dist, abs(s - uSeed * dist))); + if (d < uSeed * 0.6 + 0.4) + { + highp float period = scratchDensity * 10.0; + + float xx = coord.x * period + phase; + float aa = abs(mod(xx, 0.5) * 4.0); + float bb = mod(floor(xx / 0.5), 2.0); + float yy = (1.0 - bb) * aa + bb * (2.0 - aa); + + float kk = 2.0 * period; + float dw = scratchWidth / uDimensions.x * (0.75 + uSeed); + float dh = dw * kk; + + float tine = (yy - (2.0 - dh)); + + if (tine > 0.0) { + float _sign = sign(scratch); + + tine = s * tine / period + scratch + 0.1; + tine = clamp(tine + 1.0, 0.5 + _sign * 0.5, 1.5 + _sign * 0.5); + + color.rgb *= tine; + } + } + } + + float noise = uNoise[0]; + float noiseSize = uNoise[1]; + + if (noise > 0.0 && noiseSize > 0.0) + { + vec2 pixelCoord = vTextureCoord.xy * uInputSize.xy; + pixelCoord.x = floor(pixelCoord.x / noiseSize); + pixelCoord.y = floor(pixelCoord.y / noiseSize); + // vec2 d = pixelCoord * noiseSize * vec2(1024.0 + uSeed * 512.0, 1024.0 - uSeed * 512.0); + // float _noise = snoise(d) * 0.5; + float _noise = rand(pixelCoord * noiseSize * uSeed) - 0.5; + color += _noise * noise; + } + + finalColor.rgb = color; +}`,Au=`struct OldFilmUniforms { + uSepia: f32, + uNoise: vec2, + uScratch: vec3, + uVignetting: vec3, + uSeed: f32, + uDimensions: vec2, +}; + +struct GlobalFilterUniforms { + uInputSize:vec4, + uInputPixel:vec4, + uInputClamp:vec4, + uOutputFrame:vec4, + uGlobalFrame:vec4, + uOutputTexture:vec4, +}; + +@group(0) @binding(0) var gfu: GlobalFilterUniforms; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var oldFilmUniforms : OldFilmUniforms; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 +) -> @location(0) vec4 { + var color: vec4 = textureSample(uTexture, uSampler, uv); + + if (oldFilmUniforms.uSepia > 0.) + { + color = vec4(sepia(color.rgb), color.a); + } + + let coord: vec2 = uv * gfu.uInputSize.xy / oldFilmUniforms.uDimensions; + + if (oldFilmUniforms.uVignetting[0] > 0.) + { + color *= vec4(vec3(vignette(color.rgb, coord)), color.a); + } + + let uScratch = oldFilmUniforms.uScratch; + + if (uScratch[1] > oldFilmUniforms.uSeed && uScratch[0] != 0.) + { + color = vec4(scratch(color.rgb, coord), color.a); + } + + let uNoise = oldFilmUniforms.uNoise; + + if (uNoise[0] > 0.0 && uNoise[1] > 0.0) + { + color += vec4(vec3(noise(uv)), color.a); + } + + return color; +} + +const SQRT_2: f32 = 1.414213; +const SEPIA_RGB: vec3 = vec3(112.0 / 255.0, 66.0 / 255.0, 20.0 / 255.0); + +fn modulo(x: f32, y: f32) -> f32 +{ + return x - y * floor(x/y); +} + +fn rand(co: vec2) -> f32 +{ + return fract(sin(dot(co, vec2(12.9898, 78.233))) * 43758.5453); +} + +fn overlay(src: vec3, dst: vec3) -> vec3 +{ + // if (dst <= 0.5) then: 2 * src * dst + // if (dst > 0.5) then: 1 - 2 * (1 - dst) * (1 - src) + + return vec3( + select((1.0 - 2.0 * (1.0 - dst.x) * (1.0 - src.x)), (2.0 * src.x * dst.x), (dst.x <= 0.5)), + select((1.0 - 2.0 * (1.0 - dst.y) * (1.0 - src.y)), (2.0 * src.y * dst.y), (dst.y <= 0.5)), + select((1.0 - 2.0 * (1.0 - dst.z) * (1.0 - src.z)), (2.0 * src.z * dst.z), (dst.z <= 0.5)) + ); +} + +fn sepia(co: vec3) -> vec3 +{ + let gray: f32 = (co.x + co.y + co.z) / 3.0; + let grayscale: vec3 = vec3(gray); + let color = overlay(SEPIA_RGB, grayscale); + return grayscale + oldFilmUniforms.uSepia * (color - grayscale); +} + +fn vignette(co: vec3, coord: vec2) -> f32 +{ + let uVignetting = oldFilmUniforms.uVignetting; + let uDimensions = oldFilmUniforms.uDimensions; + + let outter: f32 = SQRT_2 - uVignetting[0] * SQRT_2; + var dir: vec2 = vec2(vec2(0.5) - coord); + dir.y *= uDimensions.y / uDimensions.x; + let darker: f32 = clamp((outter - length(dir) * SQRT_2) / ( 0.00001 + uVignetting[2] * SQRT_2), 0.0, 1.0); + return darker + (1.0 - darker) * (1.0 - uVignetting[1]); +} + +fn scratch(co: vec3, coord: vec2) -> vec3 +{ + var color = co; + let uScratch = oldFilmUniforms.uScratch; + let uSeed = oldFilmUniforms.uSeed; + let uDimensions = oldFilmUniforms.uDimensions; + + let phase: f32 = uSeed * 256.0; + let s: f32 = modulo(floor(phase), 2.0); + let dist: f32 = 1.0 / uScratch[1]; + let d: f32 = distance(coord, vec2(uSeed * dist, abs(s - uSeed * dist))); + + if (d < uSeed * 0.6 + 0.4) + { + let period: f32 = uScratch[1] * 10.0; + + let xx: f32 = coord.x * period + phase; + let aa: f32 = abs(modulo(xx, 0.5) * 4.0); + let bb: f32 = modulo(floor(xx / 0.5), 2.0); + let yy: f32 = (1.0 - bb) * aa + bb * (2.0 - aa); + + let kk: f32 = 2.0 * period; + let dw: f32 = uScratch[2] / uDimensions.x * (0.75 + uSeed); + let dh: f32 = dw * kk; + + var tine: f32 = (yy - (2.0 - dh)); + + if (tine > 0.0) { + let _sign: f32 = sign(uScratch[0]); + + tine = s * tine / period + uScratch[0] + 0.1; + tine = clamp(tine + 1.0, 0.5 + _sign * 0.5, 1.5 + _sign * 0.5); + + color *= tine; + } + } + + return color; +} + +fn noise(coord: vec2) -> f32 +{ + let uNoise = oldFilmUniforms.uNoise; + let uSeed = oldFilmUniforms.uSeed; + + var pixelCoord: vec2 = coord * gfu.uInputSize.xy; + pixelCoord.x = floor(pixelCoord.x / uNoise[1]); + pixelCoord.y = floor(pixelCoord.y / uNoise[1]); + return (rand(pixelCoord * uNoise[1] * uSeed) - 0.5) * uNoise[0]; +}`,Iu=Object.defineProperty,vr=Object.getOwnPropertySymbols,Uu=Object.prototype.hasOwnProperty,_u=Object.prototype.propertyIsEnumerable,Oe=(r,e,n)=>e in r?Iu(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,gr=(r,e)=>{for(var n in e||(e={}))Uu.call(e,n)&&Oe(r,n,e[n]);if(vr)for(var n of vr(e))_u.call(e,n)&&Oe(r,n,e[n]);return r},ze=(r,e,n)=>(Oe(r,typeof e!="symbol"?e+"":e,n),n);const dr=class yt extends i.Filter{constructor(e){e=gr(gr({},yt.DEFAULT_OPTIONS),e);const n=i.GpuProgram.from({vertex:{source:m,entryPoint:"mainVertex"},fragment:{source:Au,entryPoint:"mainFragment"}}),t=i.GlProgram.from({vertex:c,fragment:wu,name:"old-film-filter"});super({gpuProgram:n,glProgram:t,resources:{oldFilmUniforms:{uSepia:{value:e.sepia,type:"f32"},uNoise:{value:new Float32Array(2),type:"vec2"},uScratch:{value:new Float32Array(3),type:"vec3"},uVignetting:{value:new Float32Array(3),type:"vec3"},uSeed:{value:e.seed,type:"f32"},uDimensions:{value:new Float32Array(2),type:"vec2"}}}}),ze(this,"uniforms"),ze(this,"seed"),this.uniforms=this.resources.oldFilmUniforms.uniforms,Object.assign(this,e)}apply(e,n,t,o){this.uniforms.uDimensions[0]=n.frame.width,this.uniforms.uDimensions[1]=n.frame.height,this.uniforms.uSeed=this.seed,e.applyFilter(this,n,t,o)}get sepia(){return this.uniforms.uSepia}set sepia(e){this.uniforms.uSepia=e}get noise(){return this.uniforms.uNoise[0]}set noise(e){this.uniforms.uNoise[0]=e}get noiseSize(){return this.uniforms.uNoise[1]}set noiseSize(e){this.uniforms.uNoise[1]=e}get scratch(){return this.uniforms.uScratch[0]}set scratch(e){this.uniforms.uScratch[0]=e}get scratchDensity(){return this.uniforms.uScratch[1]}set scratchDensity(e){this.uniforms.uScratch[1]=e}get scratchWidth(){return this.uniforms.uScratch[2]}set scratchWidth(e){this.uniforms.uScratch[2]=e}get vignetting(){return this.uniforms.uVignetting[0]}set vignetting(e){this.uniforms.uVignetting[0]=e}get vignettingAlpha(){return this.uniforms.uVignetting[1]}set vignettingAlpha(e){this.uniforms.uVignetting[1]=e}get vignettingBlur(){return this.uniforms.uVignetting[2]}set vignettingBlur(e){this.uniforms.uVignetting[2]=e}};ze(dr,"DEFAULT_OPTIONS",{sepia:.3,noise:.3,noiseSize:1,scratch:.5,scratchDensity:.3,scratchWidth:1,vignetting:.3,vignettingAlpha:1,vignettingBlur:.3,seed:0});let Ru=dr;var Du=`precision highp float; +in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform vec2 uThickness; +uniform vec3 uColor; +uniform float uAlpha; +uniform float uKnockout; + +uniform vec4 uInputClamp; + +const float DOUBLE_PI = 2. * 3.14159265358979323846264; +const float ANGLE_STEP = \${ANGLE_STEP}; + +float outlineMaxAlphaAtPos(vec2 pos) { + if (uThickness.x == 0. || uThickness.y == 0.) { + return 0.; + } + + vec4 displacedColor; + vec2 displacedPos; + float maxAlpha = 0.; + + for (float angle = 0.; angle <= DOUBLE_PI; angle += ANGLE_STEP) { + displacedPos.x = vTextureCoord.x + uThickness.x * cos(angle); + displacedPos.y = vTextureCoord.y + uThickness.y * sin(angle); + displacedColor = texture(uTexture, clamp(displacedPos, uInputClamp.xy, uInputClamp.zw)); + maxAlpha = max(maxAlpha, displacedColor.a); + } + + return maxAlpha; +} + +void main(void) { + vec4 sourceColor = texture(uTexture, vTextureCoord); + vec4 contentColor = sourceColor * float(uKnockout < 0.5); + float outlineAlpha = uAlpha * outlineMaxAlphaAtPos(vTextureCoord.xy) * (1.-sourceColor.a); + vec4 outlineColor = vec4(vec3(uColor) * outlineAlpha, outlineAlpha); + finalColor = contentColor + outlineColor; +} +`,$u=`struct OutlineUniforms { + uThickness:vec2, + uColor:vec3, + uAlpha:f32, + uAngleStep:f32, + uKnockout:f32, +}; + +struct GlobalFilterUniforms { + uInputSize:vec4, + uInputPixel:vec4, + uInputClamp:vec4, + uOutputFrame:vec4, + uGlobalFrame:vec4, + uOutputTexture:vec4, +}; + +@group(0) @binding(0) var gfu: GlobalFilterUniforms; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var outlineUniforms : OutlineUniforms; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 +) -> @location(0) vec4 { + let sourceColor: vec4 = textureSample(uTexture, uSampler, uv); + let contentColor: vec4 = sourceColor * (1. - outlineUniforms.uKnockout); + + let outlineAlpha: f32 = outlineUniforms.uAlpha * outlineMaxAlphaAtPos(uv) * (1. - sourceColor.a); + let outlineColor: vec4 = vec4(vec3(outlineUniforms.uColor) * outlineAlpha, outlineAlpha); + + return contentColor + outlineColor; +} + +fn outlineMaxAlphaAtPos(uv: vec2) -> f32 { + let thickness = outlineUniforms.uThickness; + + if (thickness.x == 0. || thickness.y == 0.) { + return 0.; + } + + let angleStep = outlineUniforms.uAngleStep; + + var displacedColor: vec4; + var displacedPos: vec2; + + var maxAlpha: f32 = 0.; + var displaced: vec2; + var curColor: vec4; + + for (var angle = 0.; angle <= DOUBLE_PI; angle += angleStep) + { + displaced.x = uv.x + thickness.x * cos(angle); + displaced.y = uv.y + thickness.y * sin(angle); + curColor = textureSample(uTexture, uSampler, clamp(displaced, gfu.uInputClamp.xy, gfu.uInputClamp.zw)); + maxAlpha = max(maxAlpha, curColor.a); + } + + return maxAlpha; +} + +const DOUBLE_PI: f32 = 3.14159265358979323846264 * 2.;`,Gu=Object.defineProperty,hr=Object.getOwnPropertySymbols,Mu=Object.prototype.hasOwnProperty,Eu=Object.prototype.propertyIsEnumerable,Fe=(r,e,n)=>e in r?Gu(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,xr=(r,e)=>{for(var n in e||(e={}))Mu.call(e,n)&&Fe(r,n,e[n]);if(hr)for(var n of hr(e))Eu.call(e,n)&&Fe(r,n,e[n]);return r},z=(r,e,n)=>(Fe(r,typeof e!="symbol"?e+"":e,n),n);const B=class F extends i.Filter{constructor(...e){var n,t,o;let u=(n=e[0])!=null?n:{};typeof u=="number"&&(i.deprecation("6.0.0","OutlineFilter constructor params are now options object. See params: { thickness, color, quality, alpha, knockout }"),u={thickness:u},e[1]!==void 0&&(u.color=e[1]),e[2]!==void 0&&(u.quality=e[2]),e[3]!==void 0&&(u.alpha=e[3]),e[4]!==void 0&&(u.knockout=e[4])),u=xr(xr({},F.DEFAULT_OPTIONS),u);const l=(t=u.quality)!=null?t:.1,a=i.GpuProgram.from({vertex:{source:m,entryPoint:"mainVertex"},fragment:{source:$u,entryPoint:"mainFragment"}}),p=i.GlProgram.from({vertex:c,fragment:Du.replace(/\$\{ANGLE_STEP\}/,F.getAngleStep(l).toFixed(7)),name:"outline-filter"});super({gpuProgram:a,glProgram:p,resources:{outlineUniforms:{uThickness:{value:new Float32Array(2),type:"vec2"},uColor:{value:new Float32Array(3),type:"vec3"},uAlpha:{value:u.alpha,type:"f32"},uAngleStep:{value:0,type:"f32"},uKnockout:{value:u.knockout?1:0,type:"f32"}}}}),z(this,"uniforms"),z(this,"_thickness"),z(this,"_quality"),z(this,"_color"),this.uniforms=this.resources.outlineUniforms.uniforms,this.uniforms.uAngleStep=F.getAngleStep(l),this._color=new i.Color,this.color=(o=u.color)!=null?o:0,Object.assign(this,u)}apply(e,n,t,o){this.uniforms.uThickness[0]=this.thickness/n.source.width,this.uniforms.uThickness[1]=this.thickness/n.source.height,e.applyFilter(this,n,t,o)}static getAngleStep(e){return parseFloat((Math.PI*2/Math.max(e*F.MAX_SAMPLES,F.MIN_SAMPLES)).toFixed(7))}get thickness(){return this._thickness}set thickness(e){this._thickness=this.padding=e}get color(){return this._color.value}set color(e){this._color.setValue(e);const[n,t,o]=this._color.toArray();this.uniforms.uColor[0]=n,this.uniforms.uColor[1]=t,this.uniforms.uColor[2]=o}get alpha(){return this.uniforms.uAlpha}set alpha(e){this.uniforms.uAlpha=e}get quality(){return this._quality}set quality(e){this._quality=e,this.uniforms.uAngleStep=F.getAngleStep(e)}get knockout(){return this.uniforms.uKnockout===1}set knockout(e){this.uniforms.uKnockout=e?1:0}};z(B,"DEFAULT_OPTIONS",{thickness:1,color:0,alpha:1,quality:.1,knockout:!1}),z(B,"MIN_SAMPLES",1),z(B,"MAX_SAMPLES",100);let Lu=B;var ku=`precision highp float; +in vec2 vTextureCoord; +out vec4 finalColor; + +uniform vec2 uSize; +uniform sampler2D uTexture; +uniform vec4 uInputSize; + +vec2 mapCoord( vec2 coord ) +{ + coord *= uInputSize.xy; + coord += uInputSize.zw; + + return coord; +} + +vec2 unmapCoord( vec2 coord ) +{ + coord -= uInputSize.zw; + coord /= uInputSize.xy; + + return coord; +} + +vec2 pixelate(vec2 coord, vec2 uSize) +{ + return floor( coord / uSize ) * uSize; +} + +void main(void) +{ + vec2 coord = mapCoord(vTextureCoord); + coord = pixelate(coord, uSize); + coord = unmapCoord(coord); + finalColor = texture(uTexture, coord); +} +`,Bu=`struct PixelateUniforms { + uSize:vec2, +}; + +struct GlobalFilterUniforms { + uInputSize:vec4, + uInputPixel:vec4, + uInputClamp:vec4, + uOutputFrame:vec4, + uGlobalFrame:vec4, + uOutputTexture:vec4, +}; + +@group(0) @binding(0) var gfu: GlobalFilterUniforms; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var pixelateUniforms : PixelateUniforms; + +@fragment +fn mainFragment( + @location(0) uv: vec2, + @builtin(position) position: vec4 +) -> @location(0) vec4 { + let pixelSize: vec2 = pixelateUniforms.uSize; + let coord: vec2 = mapCoord(uv); + + var pixCoord: vec2 = pixelate(coord, pixelSize); + pixCoord = unmapCoord(pixCoord); + + return textureSample(uTexture, uSampler, pixCoord); +} + +fn mapCoord(coord: vec2 ) -> vec2 +{ + var mappedCoord: vec2 = coord; + mappedCoord *= gfu.uInputSize.xy; + mappedCoord += gfu.uOutputFrame.xy; + return mappedCoord; +} + +fn unmapCoord(coord: vec2 ) -> vec2 +{ + var mappedCoord: vec2 = coord; + mappedCoord -= gfu.uOutputFrame.xy; + mappedCoord /= gfu.uInputSize.xy; + return mappedCoord; +} + +fn pixelate(coord: vec2, size: vec2) -> vec2 +{ + return floor( coord / size ) * size; +} + +`;class Nu extends i.Filter{constructor(e=10){const n=i.GpuProgram.from({vertex:{source:m,entryPoint:"mainVertex"},fragment:{source:Bu,entryPoint:"mainFragment"}}),t=i.GlProgram.from({vertex:c,fragment:ku,name:"pixelate-filter"});super({gpuProgram:n,glProgram:t,resources:{pixelateUniforms:{uSize:{value:new Float32Array(2),type:"vec2"}}}}),this.size=e}get size(){return this.resources.pixelateUniforms.uniforms.uSize}set size(e){e instanceof i.Point?(this.sizeX=e.x,this.sizeY=e.y):Array.isArray(e)?this.resources.pixelateUniforms.uniforms.uSize=e:this.sizeX=this.sizeY=e}get sizeX(){return this.resources.pixelateUniforms.uniforms.uSize[0]}set sizeX(e){this.resources.pixelateUniforms.uniforms.uSize[0]=e}get sizeY(){return this.resources.pixelateUniforms.uniforms.uSize[1]}set sizeY(e){this.resources.pixelateUniforms.uniforms.uSize[1]=e}}var Vu=`precision highp float; +in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform float uRadian; +uniform vec2 uCenter; +uniform float uRadius; +uniform int uKernelSize; + +uniform vec4 uInputSize; + +const int MAX_KERNEL_SIZE = 2048; + +void main(void) +{ + vec4 color = texture(uTexture, vTextureCoord); + + if (uKernelSize == 0) + { + finalColor = color; + return; + } + + float aspect = uInputSize.y / uInputSize.x; + vec2 center = uCenter.xy / uInputSize.xy; + float gradient = uRadius / uInputSize.x * 0.3; + float radius = uRadius / uInputSize.x - gradient * 0.5; + int k = uKernelSize - 1; + + vec2 coord = vTextureCoord; + vec2 dir = vec2(center - coord); + float dist = length(vec2(dir.x, dir.y * aspect)); + + float radianStep = uRadian; + if (radius >= 0.0 && dist > radius) { + float delta = dist - radius; + float gap = gradient; + float scale = 1.0 - abs(delta / gap); + if (scale <= 0.0) { + finalColor = color; + return; + } + radianStep *= scale; + } + radianStep /= float(k); + + float s = sin(radianStep); + float c = cos(radianStep); + mat2 rotationMatrix = mat2(vec2(c, -s), vec2(s, c)); + + for(int i = 0; i < MAX_KERNEL_SIZE - 1; i++) { + if (i == k) { + break; + } + + coord -= center; + coord.y *= aspect; + coord = rotationMatrix * coord; + coord.y /= aspect; + coord += center; + + vec4 sample = texture(uTexture, coord); + + // switch to pre-multiplied alpha to correctly blur transparent images + // sample.rgb *= sample.a; + + color += sample; + } + + finalColor = color / float(uKernelSize); +} +`,Xu=`struct RadialBlurUniforms { + uRadian: f32, + uCenter: vec2, + uKernelSize: f32, + uRadius: f32, +}; + +struct GlobalFilterUniforms { + uInputSize:vec4, + uInputPixel:vec4, + uInputClamp:vec4, + uOutputFrame:vec4, + uGlobalFrame:vec4, + uOutputTexture:vec4, +}; + +@group(0) @binding(0) var gfu: GlobalFilterUniforms; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var radialBlurUniforms : RadialBlurUniforms; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 +) -> @location(0) vec4 { + let uRadian = radialBlurUniforms.uRadian; + let uCenter = radialBlurUniforms.uCenter; + let uKernelSize = radialBlurUniforms.uKernelSize; + let uRadius = radialBlurUniforms.uRadius; + + var returnColorOnly = false; + + if (uKernelSize == 0) + { + returnColorOnly = true; + } + + let aspect: f32 = gfu.uInputSize.y / gfu.uInputSize.x; + let center: vec2 = uCenter.xy / gfu.uInputSize.xy; + let gradient: f32 = uRadius / gfu.uInputSize.x * 0.3; + let radius: f32 = uRadius / gfu.uInputSize.x - gradient * 0.5; + let k: i32 = i32(uKernelSize - 1); + + var coord: vec2 = uv; + let dir: vec2 = vec2(center - coord); + let dist: f32 = length(vec2(dir.x, dir.y * aspect)); + + var radianStep: f32 = uRadian; + + if (radius >= 0.0 && dist > radius) + { + let delta: f32 = dist - radius; + let gap: f32 = gradient; + let scale: f32 = 1.0 - abs(delta / gap); + if (scale <= 0.0) { + returnColorOnly = true; + } + radianStep *= scale; + } + + radianStep /= f32(k); + + let s: f32 = sin(radianStep); + let c: f32 = cos(radianStep); + let rotationMatrix: mat2x2 = mat2x2(vec2(c, -s), vec2(s, c)); + + var color: vec4 = textureSample(uTexture, uSampler, uv); + let baseColor = vec4(color); + + let minK: i32 = min(i32(uKernelSize) - 1, MAX_KERNEL_SIZE - 1); + + for(var i: i32 = 0; i < minK; i += 1) + { + coord -= center; + coord.y *= aspect; + coord = rotationMatrix * coord; + coord.y /= aspect; + coord += center; + let sample: vec4 = textureSample(uTexture, uSampler, coord); + // switch to pre-multiplied alpha to correctly blur transparent images + // sample.rgb *= sample.a; + color += sample; + } + + return select(color / f32(uKernelSize), baseColor, returnColorOnly); +} + +const MAX_KERNEL_SIZE: i32 = 2048;`,Yu=Object.defineProperty,yr=Object.getOwnPropertySymbols,Ku=Object.prototype.hasOwnProperty,Wu=Object.prototype.propertyIsEnumerable,we=(r,e,n)=>e in r?Yu(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,Sr=(r,e)=>{for(var n in e||(e={}))Ku.call(e,n)&&we(r,n,e[n]);if(yr)for(var n of yr(e))Wu.call(e,n)&&we(r,n,e[n]);return r},N=(r,e,n)=>(we(r,typeof e!="symbol"?e+"":e,n),n);const br=class St extends i.Filter{constructor(...e){var n;let t=(n=e[0])!=null?n:{};if(typeof t=="number"){if(i.deprecation("6.0.0","RadialBlurFilter constructor params are now options object. See params: { angle, center, kernelSize, radius }"),t={angle:t},e[1]){const l="x"in e[1]?e[1].x:e[1][0],a="y"in e[1]?e[1].y:e[1][1];t.center={x:l,y:a}}e[2]&&(t.kernelSize=e[2]),e[3]&&(t.radius=e[3])}t=Sr(Sr({},St.DEFAULT_OPTIONS),t);const o=i.GpuProgram.from({vertex:{source:m,entryPoint:"mainVertex"},fragment:{source:Xu,entryPoint:"mainFragment"}}),u=i.GlProgram.from({vertex:c,fragment:Vu,name:"radial-blur-filter"});super({gpuProgram:o,glProgram:u,resources:{radialBlurUniforms:{uRadian:{value:0,type:"f32"},uCenter:{value:t.center,type:"vec2"},uKernelSize:{value:t.kernelSize,type:"i32"},uRadius:{value:t.radius,type:"f32"}}}}),N(this,"uniforms"),N(this,"_angle"),N(this,"_kernelSize"),this.uniforms=this.resources.radialBlurUniforms.uniforms,Object.assign(this,t)}_updateKernelSize(){this.uniforms.uKernelSize=this._angle!==0?this.kernelSize:0}get angle(){return this._angle}set angle(e){this._angle=e,this.uniforms.uRadian=e*Math.PI/180,this._updateKernelSize()}get center(){return this.uniforms.uCenter}set center(e){Array.isArray(e)&&(e={x:e[0],y:e[1]}),this.uniforms.uCenter=e}get centerX(){return this.center.x}set centerX(e){this.center.x=e}get centerY(){return this.center.y}set centerY(e){this.center.y=e}get kernelSize(){return this._kernelSize}set kernelSize(e){this._kernelSize=e,this._updateKernelSize()}get radius(){return this.uniforms.uRadius}set radius(e){this.uniforms.uRadius=e<0||e===1/0?-1:e}};N(br,"DEFAULT_OPTIONS",{angle:0,center:{x:0,y:0},kernelSize:5,radius:-1});let qu=br;var ju=`precision highp float; +in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform float uMirror; +uniform float uBoundary; +uniform vec2 uAmplitude; +uniform vec2 uWavelength; +uniform vec2 uAlpha; +uniform float uTime; +uniform vec2 uDimensions; + +uniform vec4 uInputSize; +uniform vec4 uInputClamp; + +float rand(vec2 co) { + return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453); +} + +void main(void) +{ + vec2 pixelCoord = vTextureCoord.xy * uInputSize.xy; + vec2 coord = pixelCoord / uDimensions; + + if (coord.y < uBoundary) { + finalColor = texture(uTexture, vTextureCoord); + return; + } + + float k = (coord.y - uBoundary) / (1. - uBoundary + 0.0001); + float areaY = uBoundary * uDimensions.y / uInputSize.y; + float v = areaY + areaY - vTextureCoord.y; + float y = uMirror > 0.5 ? v : vTextureCoord.y; + + float _amplitude = ((uAmplitude.y - uAmplitude.x) * k + uAmplitude.x ) / uInputSize.x; + float _waveLength = ((uWavelength.y - uWavelength.x) * k + uWavelength.x) / uInputSize.y; + float _alpha = (uAlpha.y - uAlpha.x) * k + uAlpha.x; + + float x = vTextureCoord.x + cos(v * 6.28 / _waveLength - uTime) * _amplitude; + x = clamp(x, uInputClamp.x, uInputClamp.z); + + vec4 color = texture(uTexture, vec2(x, y)); + + finalColor = color * _alpha; +} +`,Hu=`struct ReflectionUniforms { + uMirror: f32, + uBoundary: f32, + uAmplitude: vec2, + uWavelength: vec2, + uAlpha: vec2, + uTime: f32, + uDimensions: vec2, +}; + +struct GlobalFilterUniforms { + uInputSize:vec4, + uInputPixel:vec4, + uInputClamp:vec4, + uOutputFrame:vec4, + uGlobalFrame:vec4, + uOutputTexture:vec4, +}; + +@group(0) @binding(0) var gfu: GlobalFilterUniforms; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var reflectionUniforms : ReflectionUniforms; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 +) -> @location(0) vec4 { + let uDimensions: vec2 = reflectionUniforms.uDimensions; + let uBoundary: f32 = reflectionUniforms.uBoundary; + let uMirror: bool = reflectionUniforms.uMirror > 0.5; + let uAmplitude: vec2 = reflectionUniforms.uAmplitude; + let uWavelength: vec2 = reflectionUniforms.uWavelength; + let uAlpha: vec2 = reflectionUniforms.uAlpha; + let uTime: f32 = reflectionUniforms.uTime; + + let pixelCoord: vec2 = uv * gfu.uInputSize.xy; + let coord: vec2 = pixelCoord /uDimensions; + var returnColorOnly: bool = false; + + if (coord.y < uBoundary) { + returnColorOnly = true; + } + + let k: f32 = (coord.y - uBoundary) / (1. - uBoundary + 0.0001); + let areaY: f32 = uBoundary * uDimensions.y / gfu.uInputSize.y; + let v: f32 = areaY + areaY - uv.y; + let y: f32 = select(uv.y, v, uMirror); + + let amplitude: f32 = ((uAmplitude.y - uAmplitude.x) * k + uAmplitude.x ) / gfu.uInputSize.x; + let waveLength: f32 = ((uWavelength.y - uWavelength.x) * k + uWavelength.x) / gfu.uInputSize.y; + let alpha: f32 = select((uAlpha.y - uAlpha.x) * k + uAlpha.x, 1., returnColorOnly); + + var x: f32 = uv.x + cos(v * 6.28 / waveLength - uTime) * amplitude; + x = clamp(x, gfu.uInputClamp.x, gfu.uInputClamp.z); + + return textureSample(uTexture, uSampler, select(vec2(x, y), uv, returnColorOnly)) * alpha; +} + +fn rand(co: vec2) -> f32 +{ + return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453); +}`,Zu=Object.defineProperty,Cr=Object.getOwnPropertySymbols,Qu=Object.prototype.hasOwnProperty,Ju=Object.prototype.propertyIsEnumerable,Ae=(r,e,n)=>e in r?Zu(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,Tr=(r,e)=>{for(var n in e||(e={}))Qu.call(e,n)&&Ae(r,n,e[n]);if(Cr)for(var n of Cr(e))Ju.call(e,n)&&Ae(r,n,e[n]);return r},Ie=(r,e,n)=>(Ae(r,typeof e!="symbol"?e+"":e,n),n);const Pr=class bt extends i.Filter{constructor(e){e=Tr(Tr({},bt.DEFAULT_OPTIONS),e);const n=i.GpuProgram.from({vertex:{source:m,entryPoint:"mainVertex"},fragment:{source:Hu,entryPoint:"mainFragment"}}),t=i.GlProgram.from({vertex:c,fragment:ju,name:"reflection-filter"});super({gpuProgram:n,glProgram:t,resources:{reflectionUniforms:{uMirror:{value:e.mirror?1:0,type:"f32"},uBoundary:{value:e.boundary,type:"f32"},uAmplitude:{value:e.amplitude,type:"vec2"},uWavelength:{value:e.waveLength,type:"vec2"},uAlpha:{value:e.alpha,type:"vec2"},uTime:{value:e.time,type:"f32"},uDimensions:{value:new Float32Array(2),type:"vec2"}}}}),Ie(this,"uniforms"),Ie(this,"time",0),this.uniforms=this.resources.reflectionUniforms.uniforms,Object.assign(this,e)}apply(e,n,t,o){this.uniforms.uDimensions[0]=n.frame.width,this.uniforms.uDimensions[1]=n.frame.height,this.uniforms.uTime=this.time,e.applyFilter(this,n,t,o)}get mirror(){return this.uniforms.uMirror>.5}set mirror(e){this.uniforms.uMirror=e?1:0}get boundary(){return this.uniforms.uBoundary}set boundary(e){this.uniforms.uBoundary=e}get amplitude(){return Array.from(this.uniforms.uAmplitude)}set amplitude(e){this.uniforms.uAmplitude[0]=e[0],this.uniforms.uAmplitude[1]=e[1]}get amplitudeStart(){return this.uniforms.uAmplitude[0]}set amplitudeStart(e){this.uniforms.uAmplitude[0]=e}get amplitudeEnd(){return this.uniforms.uAmplitude[1]}set amplitudeEnd(e){this.uniforms.uAmplitude[1]=e}get waveLength(){return Array.from(this.uniforms.uWavelength)}set waveLength(e){this.uniforms.uWavelength[0]=e[0],this.uniforms.uWavelength[1]=e[1]}get wavelengthStart(){return this.uniforms.uWavelength[0]}set wavelengthStart(e){this.uniforms.uWavelength[0]=e}get wavelengthEnd(){return this.uniforms.uWavelength[1]}set wavelengthEnd(e){this.uniforms.uWavelength[1]=e}get alpha(){return Array.from(this.uniforms.uAlpha)}set alpha(e){this.uniforms.uAlpha[0]=e[0],this.uniforms.uAlpha[1]=e[1]}get alphaStart(){return this.uniforms.uAlpha[0]}set alphaStart(e){this.uniforms.uAlpha[0]=e}get alphaEnd(){return this.uniforms.uAlpha[1]}set alphaEnd(e){this.uniforms.uAlpha[1]=e}};Ie(Pr,"DEFAULT_OPTIONS",{mirror:!0,boundary:.5,amplitude:[0,20],waveLength:[30,100],alpha:[1,1],time:0});let el=Pr;var nl=`precision highp float; +in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform vec4 uInputSize; +uniform vec2 uRed; +uniform vec2 uGreen; +uniform vec2 uBlue; + +void main(void) +{ + float r = texture(uTexture, vTextureCoord + uRed/uInputSize.xy).r; + float g = texture(uTexture, vTextureCoord + uGreen/uInputSize.xy).g; + float b = texture(uTexture, vTextureCoord + uBlue/uInputSize.xy).b; + float a = texture(uTexture, vTextureCoord).a; + finalColor = vec4(r, g, b, a); +} +`,rl=`struct RgbSplitUniforms { + uRed: vec2, + uGreen: vec2, + uBlue: vec3, +}; + +struct GlobalFilterUniforms { + uInputSize:vec4, + uInputPixel:vec4, + uInputClamp:vec4, + uOutputFrame:vec4, + uGlobalFrame:vec4, + uOutputTexture:vec4, +}; + +@group(0) @binding(0) var gfu: GlobalFilterUniforms; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var rgbSplitUniforms : RgbSplitUniforms; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 +) -> @location(0) vec4 { + let r = textureSample(uTexture, uSampler, uv + vec2(rgbSplitUniforms.uRed.x / gfu.uInputSize.x, rgbSplitUniforms.uRed.y / gfu.uInputSize.y)).r; + let g = textureSample(uTexture, uSampler, uv + vec2(rgbSplitUniforms.uGreen.x / gfu.uInputSize.x, rgbSplitUniforms.uGreen.y / gfu.uInputSize.y)).g; + let b = textureSample(uTexture, uSampler, uv + vec2(rgbSplitUniforms.uBlue.x / gfu.uInputSize.x, rgbSplitUniforms.uBlue.y / gfu.uInputSize.y)).b; + let a = textureSample(uTexture, uSampler, uv).a; + return vec4(r, g, b, a); +} +`,tl=Object.defineProperty,Or=Object.getOwnPropertySymbols,ol=Object.prototype.hasOwnProperty,il=Object.prototype.propertyIsEnumerable,Ue=(r,e,n)=>e in r?tl(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,zr=(r,e)=>{for(var n in e||(e={}))ol.call(e,n)&&Ue(r,n,e[n]);if(Or)for(var n of Or(e))il.call(e,n)&&Ue(r,n,e[n]);return r},Fr=(r,e,n)=>(Ue(r,typeof e!="symbol"?e+"":e,n),n);const wr=class Ct extends i.Filter{constructor(...e){var n;let t=(n=e[0])!=null?n:{};(Array.isArray(t)||"x"in t&&"y"in t)&&(i.deprecation("6.0.0","RGBSplitFilter constructor params are now options object. See params: { red, green, blue }"),t={red:t},e[1]!==void 0&&(t.green=e[1]),e[2]!==void 0&&(t.blue=e[2])),t=zr(zr({},Ct.DEFAULT_OPTIONS),t);const o=i.GpuProgram.from({vertex:{source:m,entryPoint:"mainVertex"},fragment:{source:rl,entryPoint:"mainFragment"}}),u=i.GlProgram.from({vertex:c,fragment:nl,name:"rgb-split-filter"});super({gpuProgram:o,glProgram:u,resources:{rgbSplitUniforms:{uRed:{value:t.red,type:"vec2"},uGreen:{value:t.green,type:"vec2"},uBlue:{value:t.blue,type:"vec2"}}}}),Fr(this,"uniforms"),this.uniforms=this.resources.rgbSplitUniforms.uniforms,Object.assign(this,t)}get red(){return this.uniforms.uRed}set red(e){Array.isArray(e)&&(e={x:e[0],y:e[1]}),this.uniforms.uRed=e}get redX(){return this.red.x}set redX(e){this.red.x=e}get redY(){return this.red.y}set redY(e){this.red.y=e}get green(){return this.uniforms.uGreen}set green(e){Array.isArray(e)&&(e={x:e[0],y:e[1]}),this.uniforms.uGreen=e}get greenX(){return this.green.x}set greenX(e){this.green.x=e}get greenY(){return this.green.y}set greenY(e){this.green.y=e}get blue(){return this.uniforms.uBlue}set blue(e){Array.isArray(e)&&(e={x:e[0],y:e[1]}),this.uniforms.uBlue=e}get blueX(){return this.blue.x}set blueX(e){this.blue.x=e}get blueY(){return this.blue.y}set blueY(e){this.blue.y=e}};Fr(wr,"DEFAULT_OPTIONS",{red:{x:-10,y:0},green:{x:0,y:10},blue:{x:0,y:0}});let ul=wr;var ll=` +precision highp float; +in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform vec2 uCenter; +uniform float uTime; +uniform float uSpeed; +uniform vec4 uWave; + +uniform vec4 uInputSize; +uniform vec4 uInputClamp; + +const float PI = 3.14159; + +void main() +{ + float uAmplitude = uWave[0]; + float uWavelength = uWave[1]; + float uBrightness = uWave[2]; + float uRadius = uWave[3]; + + float halfWavelength = uWavelength * 0.5 / uInputSize.x; + float maxRadius = uRadius / uInputSize.x; + float currentRadius = uTime * uSpeed / uInputSize.x; + + float fade = 1.0; + + if (maxRadius > 0.0) { + if (currentRadius > maxRadius) { + finalColor = texture(uTexture, vTextureCoord); + return; + } + fade = 1.0 - pow(currentRadius / maxRadius, 2.0); + } + + vec2 dir = vec2(vTextureCoord - uCenter / uInputSize.xy); + dir.y *= uInputSize.y / uInputSize.x; + float dist = length(dir); + + if (dist <= 0.0 || dist < currentRadius - halfWavelength || dist > currentRadius + halfWavelength) { + finalColor = texture(uTexture, vTextureCoord); + return; + } + + vec2 diffUV = normalize(dir); + + float diff = (dist - currentRadius) / halfWavelength; + + float p = 1.0 - pow(abs(diff), 2.0); + + // float powDiff = diff * pow(p, 2.0) * ( amplitude * fade ); + float powDiff = 1.25 * sin(diff * PI) * p * ( uAmplitude * fade ); + + vec2 offset = diffUV * powDiff / uInputSize.xy; + + // Do clamp : + vec2 coord = vTextureCoord + offset; + vec2 clampedCoord = clamp(coord, uInputClamp.xy, uInputClamp.zw); + vec4 color = texture(uTexture, clampedCoord); + if (coord != clampedCoord) { + color *= max(0.0, 1.0 - length(coord - clampedCoord)); + } + + // No clamp : + // finalColor = texture(uTexture, vTextureCoord + offset); + + color.rgb *= 1.0 + (uBrightness - 1.0) * p * fade; + + finalColor = color; +} +`,al=` +struct ShockWaveUniforms { + uTime: f32, + uOffset: vec2, + uSpeed: f32, + uWave: vec4, +}; + +struct GlobalFilterUniforms { + uInputSize:vec4, + uInputPixel:vec4, + uInputClamp:vec4, + uOutputFrame:vec4, + uGlobalFrame:vec4, + uOutputTexture:vec4, +}; + +@group(0) @binding(0) var gfu: GlobalFilterUniforms; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var shockwaveUniforms : ShockWaveUniforms; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 +) -> @location(0) vec4 { + + let uTime = shockwaveUniforms.uTime; + let uOffset = shockwaveUniforms.uOffset; + let uSpeed = shockwaveUniforms.uSpeed; + let uAmplitude = shockwaveUniforms.uWave[0]; + let uWavelength = shockwaveUniforms.uWave[1]; + let uBrightness = shockwaveUniforms.uWave[2]; + let uRadius = shockwaveUniforms.uWave[3]; + let halfWavelength: f32 = uWavelength * 0.5 / gfu.uInputSize.x; + let maxRadius: f32 = uRadius / gfu.uInputSize.x; + let currentRadius: f32 = uTime * uSpeed / gfu.uInputSize.x; + var fade: f32 = 1.0; + var returnColorOnly: bool = false; + + if (maxRadius > 0.0) { + if (currentRadius > maxRadius) { + returnColorOnly = true; + } + fade = 1.0 - pow(currentRadius / maxRadius, 2.0); + } + var dir: vec2 = vec2(uv - uOffset / gfu.uInputSize.xy); + dir.y *= gfu.uInputSize.y / gfu.uInputSize.x; + + let dist:f32 = length(dir); + + if (dist <= 0.0 || dist < currentRadius - halfWavelength || dist > currentRadius + halfWavelength) { + returnColorOnly = true; + } + + let diffUV: vec2 = normalize(dir); + let diff: f32 = (dist - currentRadius) / halfWavelength; + let p: f32 = 1.0 - pow(abs(diff), 2.0); + let powDiff: f32 = 1.25 * sin(diff * PI) * p * ( uAmplitude * fade ); + let offset: vec2 = diffUV * powDiff / gfu.uInputSize.xy; + // Do clamp : + let coord: vec2 = uv + offset; + let clampedCoord: vec2 = clamp(coord, gfu.uInputClamp.xy, gfu.uInputClamp.zw); + + var clampedColor: vec4 = textureSample(uTexture, uSampler, clampedCoord); + + if (boolVec2(coord, clampedCoord)) + { + clampedColor *= max(0.0, 1.0 - length(coord - clampedCoord)); + } + // No clamp : + var finalColor = clampedColor; + + return select(finalColor, textureSample(uTexture, uSampler, uv), returnColorOnly); +} + +fn boolVec2(x: vec2, y: vec2) -> bool +{ + if (x.x == y.x && x.y == y.y) + { + return true; + } + + return false; +} + +const PI: f32 = 3.14159265358979323846264; +`,sl=Object.defineProperty,Ar=Object.getOwnPropertySymbols,fl=Object.prototype.hasOwnProperty,cl=Object.prototype.propertyIsEnumerable,_e=(r,e,n)=>e in r?sl(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,Re=(r,e)=>{for(var n in e||(e={}))fl.call(e,n)&&_e(r,n,e[n]);if(Ar)for(var n of Ar(e))cl.call(e,n)&&_e(r,n,e[n]);return r},De=(r,e,n)=>(_e(r,typeof e!="symbol"?e+"":e,n),n);const Ir=class Tt extends i.Filter{constructor(...e){var n;let t=(n=e[0])!=null?n:{};(Array.isArray(t)||"x"in t&&"y"in t)&&(i.deprecation("6.0.0","ShockwaveFilter constructor params are now options object. See params: { center, speed, amplitude, wavelength, brightness, radius, time }"),t=Re({center:t},e[1]),e[2]!==void 0&&(t.time=e[2])),t=Re(Re({},Tt.DEFAULT_OPTIONS),t);const o=i.GpuProgram.from({vertex:{source:m,entryPoint:"mainVertex"},fragment:{source:al,entryPoint:"mainFragment"}}),u=i.GlProgram.from({vertex:c,fragment:ll,name:"shockwave-filter"});super({gpuProgram:o,glProgram:u,resources:{shockwaveUniforms:{uTime:{value:t.time,type:"f32"},uCenter:{value:t.center,type:"vec2"},uSpeed:{value:t.speed,type:"f32"},uWave:{value:new Float32Array(4),type:"vec4"}}}}),De(this,"uniforms"),De(this,"time"),this.time=0,this.uniforms=this.resources.shockwaveUniforms.uniforms,Object.assign(this,t)}apply(e,n,t,o){this.uniforms.uTime=this.time,e.applyFilter(this,n,t,o)}get center(){return this.uniforms.uCenter}set center(e){Array.isArray(e)&&(e={x:e[0],y:e[1]}),this.uniforms.uCenter=e}get centerX(){return this.uniforms.uCenter.x}set centerX(e){this.uniforms.uCenter.x=e}get centerY(){return this.uniforms.uCenter.y}set centerY(e){this.uniforms.uCenter.y=e}get speed(){return this.uniforms.uSpeed}set speed(e){this.uniforms.uSpeed=e}get amplitude(){return this.uniforms.uWave[0]}set amplitude(e){this.uniforms.uWave[0]=e}get wavelength(){return this.uniforms.uWave[1]}set wavelength(e){this.uniforms.uWave[1]=e}get brightness(){return this.uniforms.uWave[2]}set brightness(e){this.uniforms.uWave[2]=e}get radius(){return this.uniforms.uWave[3]}set radius(e){this.uniforms.uWave[3]=e}};De(Ir,"DEFAULT_OPTIONS",{center:{x:0,y:0},speed:500,amplitude:30,wavelength:160,brightness:1,radius:-1});let ml=Ir;var pl=`precision highp float; +in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform sampler2D uMapTexture; +uniform vec3 uColor; +uniform float uAlpha; +uniform vec2 uDimensions; + +uniform vec4 uInputSize; + +void main() { + vec4 diffuseColor = texture(uTexture, vTextureCoord); + vec2 lightCoord = (vTextureCoord * uInputSize.xy) / uDimensions; + vec4 light = texture(uMapTexture, lightCoord); + vec3 ambient = uColor.rgb * uAlpha; + vec3 intensity = ambient + light.rgb; + vec3 color = diffuseColor.rgb * intensity; + finalColor = vec4(color, diffuseColor.a); +} +`,vl=`struct SimpleLightmapUniforms { + uColor: vec3, + uAlpha: f32, + uDimensions: vec2, +}; + +struct GlobalFilterUniforms { + uInputSize:vec4, + uInputPixel:vec4, + uInputClamp:vec4, + uOutputFrame:vec4, + uGlobalFrame:vec4, + uOutputTexture:vec4, +}; + +@group(0) @binding(0) var gfu: GlobalFilterUniforms; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var simpleLightmapUniforms : SimpleLightmapUniforms; +@group(1) @binding(1) var uMapTexture: texture_2d; +@group(1) @binding(2) var uMapSampler: sampler; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2, +) -> @location(0) vec4 { + let uColor = simpleLightmapUniforms.uColor; + let uAlpha = simpleLightmapUniforms.uAlpha; + let uDimensions = simpleLightmapUniforms.uDimensions; + + let diffuseColor: vec4 = textureSample(uTexture, uSampler, uv); + let lightCoord: vec2 = (uv * gfu.uInputSize.xy) / simpleLightmapUniforms.uDimensions; + let light: vec4 = textureSample(uMapTexture, uMapSampler, lightCoord); + let ambient: vec3 = uColor * uAlpha; + let intensity: vec3 = ambient + light.rgb; + let finalColor: vec3 = diffuseColor.rgb * intensity; + return vec4(finalColor, diffuseColor.a); +}`,gl=Object.defineProperty,Ur=Object.getOwnPropertySymbols,dl=Object.prototype.hasOwnProperty,hl=Object.prototype.propertyIsEnumerable,$e=(r,e,n)=>e in r?gl(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,_r=(r,e)=>{for(var n in e||(e={}))dl.call(e,n)&&$e(r,n,e[n]);if(Ur)for(var n of Ur(e))hl.call(e,n)&&$e(r,n,e[n]);return r},V=(r,e,n)=>($e(r,typeof e!="symbol"?e+"":e,n),n);const Rr=class Pt extends i.Filter{constructor(...e){var n,t;let o=(n=e[0])!=null?n:{};if(o instanceof i.Texture&&(i.deprecation("6.0.0","SimpleLightmapFilter constructor params are now options object. See params: { lightMap, color, alpha }"),o={lightMap:o},e[1]!==void 0&&(o.color=e[1]),e[2]!==void 0&&(o.alpha=e[2])),o=_r(_r({},Pt.DEFAULT_OPTIONS),o),!o.lightMap)throw Error("No light map texture source was provided to SimpleLightmapFilter");const u=i.GpuProgram.from({vertex:{source:m,entryPoint:"mainVertex"},fragment:{source:vl,entryPoint:"mainFragment"}}),l=i.GlProgram.from({vertex:c,fragment:pl,name:"simple-lightmap-filter"});super({gpuProgram:u,glProgram:l,resources:{simpleLightmapUniforms:{uColor:{value:new Float32Array(3),type:"vec3"},uAlpha:{value:o.alpha,type:"f32"},uDimensions:{value:new Float32Array(2),type:"vec2"}},uMapTexture:o.lightMap.source,uMapSampler:o.lightMap.source.style}}),V(this,"uniforms"),V(this,"_color"),V(this,"_lightMap"),this.uniforms=this.resources.simpleLightmapUniforms.uniforms,this._color=new i.Color,this.color=(t=o.color)!=null?t:0,Object.assign(this,o)}apply(e,n,t,o){this.uniforms.uDimensions[0]=n.frame.width,this.uniforms.uDimensions[1]=n.frame.height,e.applyFilter(this,n,t,o)}get lightMap(){return this._lightMap}set lightMap(e){this._lightMap=e,this.resources.uMapTexture=e.source,this.resources.uMapSampler=e.source.style}get color(){return this._color.value}set color(e){this._color.setValue(e);const[n,t,o]=this._color.toArray();this.uniforms.uColor[0]=n,this.uniforms.uColor[1]=t,this.uniforms.uColor[2]=o}get alpha(){return this.uniforms.uAlpha}set alpha(e){this.uniforms.uAlpha=e}};V(Rr,"DEFAULT_OPTIONS",{lightMap:i.Texture.WHITE,color:0,alpha:1});let xl=Rr;var yl=`in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform vec2 uBlur; +uniform vec2 uStart; +uniform vec2 uEnd; +uniform vec2 uDelta; +uniform vec2 uTexSize; + +float random(vec3 scale, float seed) +{ + return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed); +} + +void main(void) +{ + vec4 color = vec4(0.0); + float total = 0.0; + + float blur = uBlur[0]; + float gradientBlur = uBlur[1]; + + float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0); + vec2 normal = normalize(vec2(uStart.y - uEnd.y, uEnd.x - uStart.x)); + float radius = smoothstep(0.0, 1.0, abs(dot(vTextureCoord * uTexSize - uStart, normal)) / gradientBlur) * blur; + + for (float t = -30.0; t <= 30.0; t++) + { + float percent = (t + offset - 0.5) / 30.0; + float weight = 1.0 - abs(percent); + vec4 sample = texture(uTexture, vTextureCoord + uDelta / uTexSize * percent * radius); + sample.rgb *= sample.a; + color += sample * weight; + total += weight; + } + + color /= total; + color.rgb /= color.a + 0.00001; + + finalColor = color; +} +`,Sl=`struct TiltShiftUniforms { + uBlur: vec2, + uStart: vec2, + uEnd: vec2, + uDelta: vec2, + uTexSize: vec2, +}; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var tiltShiftUniforms : TiltShiftUniforms; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 +) -> @location(0) vec4 { + let uBlur = tiltShiftUniforms.uBlur[0]; + let uBlurGradient = tiltShiftUniforms.uBlur[1]; + let uStart = tiltShiftUniforms.uStart; + let uEnd = tiltShiftUniforms.uEnd; + let uDelta = tiltShiftUniforms.uDelta; + let uTexSize = tiltShiftUniforms.uTexSize; + + var color: vec4 = vec4(0.0); + var total: f32 = 0.0; + + let offset: f32 = random(position, vec3(12.9898, 78.233, 151.7182), 0.0); + let normal: vec2 = normalize(vec2(uStart.y - uEnd.y, uEnd.x - uStart.x)); + let radius: f32 = smoothstep(0.0, 1.0, abs(dot(uv * uTexSize - uStart, normal)) / uBlurGradient) * uBlur; + + for (var t: f32 = -30.0; t <= 30.0; t += 1.0) + { + var percent: f32 = (t + offset - 0.5) / 30.0; + var weight: f32 = 1.0 - abs(percent); + var sample: vec4 = textureSample(uTexture, uSampler, uv + uDelta / uTexSize * percent * radius); + sample = vec4(sample.xyz * sample.a, sample.a); // multiply sample.rgb with sample.a + color += sample * weight; + total += weight; + } + + color /= total; + color = vec4(color.xyz / (color.a + 0.00001), color.a); // divide color.rgb by color.a + 0.00001 + + return color; +} + + +fn random(position: vec4, scale: vec3, seed: f32) -> f32 +{ + return fract(sin(dot(position.xyz + seed, scale)) * 43758.5453 + seed); +}`,bl=Object.defineProperty,Dr=Object.getOwnPropertySymbols,Cl=Object.prototype.hasOwnProperty,Tl=Object.prototype.propertyIsEnumerable,Ge=(r,e,n)=>e in r?bl(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,$r=(r,e)=>{for(var n in e||(e={}))Cl.call(e,n)&&Ge(r,n,e[n]);if(Dr)for(var n of Dr(e))Tl.call(e,n)&&Ge(r,n,e[n]);return r},Me=(r,e,n)=>(Ge(r,typeof e!="symbol"?e+"":e,n),n);const Gr=class Ot extends i.Filter{constructor(e){var n,t;e=$r($r({},Ot.DEFAULT_OPTIONS),e);const o=i.GpuProgram.from({vertex:{source:m,entryPoint:"mainVertex"},fragment:{source:Sl,entryPoint:"mainFragment"}}),u=i.GlProgram.from({vertex:c,fragment:yl,name:"tilt-shift-axis-filter"});super({gpuProgram:o,glProgram:u,resources:{tiltShiftUniforms:{uBlur:{value:new Float32Array([(n=e.blur)!=null?n:100,(t=e.gradientBlur)!=null?t:600]),type:"vec2"},uStart:{value:e.start,type:"vec2"},uEnd:{value:e.end,type:"vec2"},uDelta:{value:new Float32Array([30,30]),type:"vec2"},uTexSize:{value:new Float32Array([window.innerWidth,window.innerHeight]),type:"vec2"}}}}),Me(this,"uniforms"),Me(this,"_tiltAxis"),this.uniforms=this.resources.tiltShiftUniforms.uniforms,this._tiltAxis=e.axis,this.updateDelta()}updateDelta(){if(this.uniforms.uDelta[0]=0,this.uniforms.uDelta[1]=0,this._tiltAxis===void 0)return;const e=this.uniforms.uEnd,n=this.uniforms.uStart,t=e.x-n.x,o=e.y-n.y,u=Math.sqrt(t*t+o*o),l=this._tiltAxis==="vertical";this.uniforms.uDelta[0]=l?-o/u:t/u,this.uniforms.uDelta[1]=l?t/u:o/u}};Me(Gr,"DEFAULT_OPTIONS",{blur:100,gradientBlur:600,start:{x:0,y:window.innerHeight/2},end:{x:600,y:window.innerHeight/2}});let X=Gr;var Pl=Object.defineProperty,Ol=Object.defineProperties,zl=Object.getOwnPropertyDescriptors,Mr=Object.getOwnPropertySymbols,Fl=Object.prototype.hasOwnProperty,wl=Object.prototype.propertyIsEnumerable,Ee=(r,e,n)=>e in r?Pl(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,Y=(r,e)=>{for(var n in e||(e={}))Fl.call(e,n)&&Ee(r,n,e[n]);if(Mr)for(var n of Mr(e))wl.call(e,n)&&Ee(r,n,e[n]);return r},Er=(r,e)=>Ol(r,zl(e)),Al=(r,e,n)=>(Ee(r,typeof e!="symbol"?e+"":e,n),n);class Il extends X{constructor(e){e=Y(Y({},X.DEFAULT_OPTIONS),e),super(Er(Y({},e),{axis:"horizontal"})),Al(this,"_tiltShiftYFilter"),this._tiltShiftYFilter=new X(Er(Y({},e),{axis:"vertical"})),Object.assign(this,e)}apply(e,n,t,o){const u=i.TexturePool.getSameSizeTexture(n);e.applyFilter(this,n,u,!0),e.applyFilter(this._tiltShiftYFilter,u,t,o),i.TexturePool.returnTexture(u)}get blur(){return this.uniforms.uBlur[0]}set blur(e){this.uniforms.uBlur[0]=this._tiltShiftYFilter.uniforms.uBlur[0]=e}get gradientBlur(){return this.uniforms.uBlur[1]}set gradientBlur(e){this.uniforms.uBlur[1]=this._tiltShiftYFilter.uniforms.uBlur[1]=e}get start(){return this.uniforms.uStart}set start(e){this.uniforms.uStart=this._tiltShiftYFilter.uniforms.uStart=e}get startX(){return this.start.x}set startX(e){this.start.x=e}get startY(){return this.start.y}set startY(e){this.start.y=e}get end(){return this.uniforms.uEnd}set end(e){this.uniforms.uEnd=this._tiltShiftYFilter.uniforms.uEnd=e}get endX(){return this.end.x}set endX(e){this.end.x=e}get endY(){return this.end.y}set endY(e){this.end.y=e}}var Ul=`precision highp float; +in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform vec2 uTwist; +uniform vec2 uOffset; +uniform vec4 uInputSize; + +vec2 mapCoord( vec2 coord ) +{ + coord *= uInputSize.xy; + coord += uInputSize.zw; + + return coord; +} + +vec2 unmapCoord( vec2 coord ) +{ + coord -= uInputSize.zw; + coord /= uInputSize.xy; + + return coord; +} + +vec2 twist(vec2 coord) +{ + coord -= uOffset; + + float dist = length(coord); + float uRadius = uTwist[0]; + float uAngle = uTwist[1]; + + if (dist < uRadius) + { + float ratioDist = (uRadius - dist) / uRadius; + float angleMod = ratioDist * ratioDist * uAngle; + float s = sin(angleMod); + float c = cos(angleMod); + coord = vec2(coord.x * c - coord.y * s, coord.x * s + coord.y * c); + } + + coord += uOffset; + + return coord; +} + +void main(void) +{ + vec2 coord = mapCoord(vTextureCoord); + coord = twist(coord); + coord = unmapCoord(coord); + finalColor = texture(uTexture, coord); +} +`,_l=`struct TwistUniforms { + uTwist:vec2, + uOffset:vec2, +}; + +struct GlobalFilterUniforms { + uInputSize:vec4, + uInputPixel:vec4, + uInputClamp:vec4, + uOutputFrame:vec4, + uGlobalFrame:vec4, + uOutputTexture:vec4, +}; + +@group(0) @binding(0) var gfu: GlobalFilterUniforms; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var twistUniforms : TwistUniforms; + +@fragment +fn mainFragment( + @location(0) uv: vec2, + @builtin(position) position: vec4 +) -> @location(0) vec4 { + return textureSample(uTexture, uSampler, unmapCoord(twist(mapCoord(uv)))); +} + +fn mapCoord(coord: vec2 ) -> vec2 +{ + var mappedCoord: vec2 = coord; + mappedCoord *= gfu.uInputSize.xy; + mappedCoord += gfu.uOutputFrame.xy; + return mappedCoord; +} + +fn unmapCoord(coord: vec2 ) -> vec2 +{ + var mappedCoord: vec2 = coord; + mappedCoord -= gfu.uOutputFrame.xy; + mappedCoord /= gfu.uInputSize.xy; + return mappedCoord; +} + +fn twist(coord: vec2) -> vec2 +{ + var twistedCoord: vec2 = coord; + let uRadius = twistUniforms.uTwist[0]; + let uAngle = twistUniforms.uTwist[1]; + let uOffset = twistUniforms.uOffset; + + twistedCoord -= uOffset; + + let dist = length(twistedCoord); + + if (dist < uRadius) + { + let ratioDist: f32 = (uRadius - dist) / uRadius; + let angleMod: f32 = ratioDist * ratioDist * uAngle; + let s: f32 = sin(angleMod); + let c: f32 = cos(angleMod); + twistedCoord = vec2(twistedCoord.x * c - twistedCoord.y * s, twistedCoord.x * s + twistedCoord.y * c); + } + + twistedCoord += uOffset; + return twistedCoord; +} +`,Rl=Object.defineProperty,Lr=Object.getOwnPropertySymbols,Dl=Object.prototype.hasOwnProperty,$l=Object.prototype.propertyIsEnumerable,Le=(r,e,n)=>e in r?Rl(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,ke=(r,e)=>{for(var n in e||(e={}))Dl.call(e,n)&&Le(r,n,e[n]);if(Lr)for(var n of Lr(e))$l.call(e,n)&&Le(r,n,e[n]);return r},kr=(r,e,n)=>(Le(r,typeof e!="symbol"?e+"":e,n),n);const Br=class zt extends i.Filter{constructor(e){var n,t;e=ke(ke({},zt.DEFAULT_OPTIONS),e);const o=i.GpuProgram.from({vertex:{source:m,entryPoint:"mainVertex"},fragment:{source:_l,entryPoint:"mainFragment"}}),u=i.GlProgram.from({vertex:c,fragment:Ul,name:"twist-filter"});super(ke({gpuProgram:o,glProgram:u,resources:{twistUniforms:{uTwist:{value:[(n=e.radius)!=null?n:0,(t=e.angle)!=null?t:0],type:"vec2"},uOffset:{value:e.offset,type:"vec2"}}}},e)),kr(this,"uniforms"),this.uniforms=this.resources.twistUniforms.uniforms}get radius(){return this.uniforms.uTwist[0]}set radius(e){this.uniforms.uTwist[0]=e}get angle(){return this.uniforms.uTwist[1]}set angle(e){this.uniforms.uTwist[1]=e}get offset(){return this.uniforms.uOffset}set offset(e){this.uniforms.uOffset=e}get offsetX(){return this.offset.x}set offsetX(e){this.offset.x=e}get offsetY(){return this.offset.y}set offsetY(e){this.offset.y=e}};kr(Br,"DEFAULT_OPTIONS",{padding:20,radius:200,angle:4,offset:{x:0,y:0}});let Gl=Br;var Ml=`precision highp float; +in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform float uStrength; +uniform vec2 uCenter; +uniform vec2 uRadii; + +uniform vec4 uInputSize; + +const float MAX_KERNEL_SIZE = \${MAX_KERNEL_SIZE}; + +// author: http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/ +highp float rand(vec2 co, float seed) { + const highp float a = 12.9898, b = 78.233, c = 43758.5453; + highp float dt = dot(co + seed, vec2(a, b)), sn = mod(dt, 3.14159); + return fract(sin(sn) * c + seed); +} + +void main() { + float minGradient = uRadii[0] * 0.3; + float innerRadius = (uRadii[0] + minGradient * 0.5) / uInputSize.x; + + float gradient = uRadii[1] * 0.3; + float radius = (uRadii[1] - gradient * 0.5) / uInputSize.x; + + float countLimit = MAX_KERNEL_SIZE; + + vec2 dir = vec2(uCenter.xy / uInputSize.xy - vTextureCoord); + float dist = length(vec2(dir.x, dir.y * uInputSize.y / uInputSize.x)); + + float strength = uStrength; + + float delta = 0.0; + float gap; + if (dist < innerRadius) { + delta = innerRadius - dist; + gap = minGradient; + } else if (radius >= 0.0 && dist > radius) { // radius < 0 means it's infinity + delta = dist - radius; + gap = gradient; + } + + if (delta > 0.0) { + float normalCount = gap / uInputSize.x; + delta = (normalCount - delta) / normalCount; + countLimit *= delta; + strength *= delta; + if (countLimit < 1.0) + { + gl_FragColor = texture(uTexture, vTextureCoord); + return; + } + } + + // randomize the lookup values to hide the fixed number of samples + float offset = rand(vTextureCoord, 0.0); + + float total = 0.0; + vec4 color = vec4(0.0); + + dir *= strength; + + for (float t = 0.0; t < MAX_KERNEL_SIZE; t++) { + float percent = (t + offset) / MAX_KERNEL_SIZE; + float weight = 4.0 * (percent - percent * percent); + vec2 p = vTextureCoord + dir * percent; + vec4 sample = texture(uTexture, p); + + // switch to pre-multiplied alpha to correctly blur transparent images + // sample.rgb *= sample.a; + + color += sample * weight; + total += weight; + + if (t > countLimit){ + break; + } + } + + color /= total; + // switch back from pre-multiplied alpha + // color.rgb /= color.a + 0.00001; + + gl_FragColor = color; +} +`,El=`struct ZoomBlurUniforms { + uStrength:f32, + uCenter:vec2, + uRadii:vec2, +}; + +struct GlobalFilterUniforms { + uInputSize:vec4, + uInputPixel:vec4, + uInputClamp:vec4, + uOutputFrame:vec4, + uGlobalFrame:vec4, + uOutputTexture:vec4, +}; + +@group(0) @binding(0) var gfu: GlobalFilterUniforms; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var zoomBlurUniforms : ZoomBlurUniforms; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 +) -> @location(0) vec4 { + let uStrength = zoomBlurUniforms.uStrength; + let uCenter = zoomBlurUniforms.uCenter; + let uRadii = zoomBlurUniforms.uRadii; + + let minGradient: f32 = uRadii[0] * 0.3; + let innerRadius: f32 = (uRadii[0] + minGradient * 0.5) / gfu.uInputSize.x; + + let gradient: f32 = uRadii[1] * 0.3; + let radius: f32 = (uRadii[1] - gradient * 0.5) / gfu.uInputSize.x; + + let MAX_KERNEL_SIZE: f32 = \${MAX_KERNEL_SIZE}; + + var countLimit: f32 = MAX_KERNEL_SIZE; + + var dir: vec2 = vec2(uCenter / gfu.uInputSize.xy - uv); + let dist: f32 = length(vec2(dir.x, dir.y * gfu.uInputSize.y / gfu.uInputSize.x)); + + var strength: f32 = uStrength; + + var delta: f32 = 0.0; + var gap: f32; + + if (dist < innerRadius) { + delta = innerRadius - dist; + gap = minGradient; + } else if (radius >= 0.0 && dist > radius) { // radius < 0 means it's infinity + delta = dist - radius; + gap = gradient; + } + + var returnColorOnly: bool = false; + + if (delta > 0.0) { + let normalCount: f32 = gap / gfu.uInputSize.x; + delta = (normalCount - delta) / normalCount; + countLimit *= delta; + strength *= delta; + + if (countLimit < 1.0) + { + returnColorOnly = true;; + } + } + + // randomize the lookup values to hide the fixed number of samples + let offset: f32 = rand(uv, 0.0); + + var total: f32 = 0.0; + var color: vec4 = vec4(0.); + + dir *= strength; + + for (var t = 0.0; t < MAX_KERNEL_SIZE; t += 1.0) { + let percent: f32 = (t + offset) / MAX_KERNEL_SIZE; + let weight: f32 = 4.0 * (percent - percent * percent); + let p: vec2 = uv + dir * percent; + let sample: vec4 = textureSample(uTexture, uSampler, p); + + if (t < countLimit) + { + color += sample * weight; + total += weight; + } + } + + color /= total; + + return select(color, textureSample(uTexture, uSampler, uv), returnColorOnly); +} + +fn modulo(x: f32, y: f32) -> f32 +{ + return x - y * floor(x/y); +} + +// author: http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/ +fn rand(co: vec2, seed: f32) -> f32 +{ + let a: f32 = 12.9898; + let b: f32 = 78.233; + let c: f32 = 43758.5453; + let dt: f32 = dot(co + seed, vec2(a, b)); + let sn: f32 = modulo(dt, 3.14159); + return fract(sin(sn) * c + seed); +}`,Ll=Object.defineProperty,Nr=Object.getOwnPropertySymbols,kl=Object.prototype.hasOwnProperty,Bl=Object.prototype.propertyIsEnumerable,Be=(r,e,n)=>e in r?Ll(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,Vr=(r,e)=>{for(var n in e||(e={}))kl.call(e,n)&&Be(r,n,e[n]);if(Nr)for(var n of Nr(e))Bl.call(e,n)&&Be(r,n,e[n]);return r},Xr=(r,e,n)=>(Be(r,typeof e!="symbol"?e+"":e,n),n);const Yr=class Ft extends i.Filter{constructor(e){var n;e=Vr(Vr({},Ft.DEFAULT_OPTIONS),e);const t=(n=e.maxKernelSize)!=null?n:32,o=i.GpuProgram.from({vertex:{source:m,entryPoint:"mainVertex"},fragment:{source:El.replace("${MAX_KERNEL_SIZE}",t.toFixed(1)),entryPoint:"mainFragment"}}),u=i.GlProgram.from({vertex:c,fragment:Ml.replace("${MAX_KERNEL_SIZE}",t.toFixed(1)),name:"zoom-blur-filter"});super({gpuProgram:o,glProgram:u,resources:{zoomBlurUniforms:{uStrength:{value:e.strength,type:"f32"},uCenter:{value:e.center,type:"vec2"},uRadii:{value:new Float32Array(2),type:"vec2"}}}}),Xr(this,"uniforms"),this.uniforms=this.resources.zoomBlurUniforms.uniforms,Object.assign(this,e)}get strength(){return this.uniforms.uStrength}set strength(e){this.uniforms.uStrength=e}get center(){return this.uniforms.uCenter}set center(e){Array.isArray(e)&&(e={x:e[0],y:e[1]}),this.uniforms.uCenter=e}get centerX(){return this.uniforms.uCenter.x}set centerX(e){this.uniforms.uCenter.x=e}get centerY(){return this.uniforms.uCenter.y}set centerY(e){this.uniforms.uCenter.y=e}get innerRadius(){return this.uniforms.uRadii[0]}set innerRadius(e){this.uniforms.uRadii[0]=e}get radius(){return this.uniforms.uRadii[1]}set radius(e){this.uniforms.uRadii[1]=e<0||e===1/0?-1:e}};Xr(Yr,"DEFAULT_OPTIONS",{strength:.1,center:{x:0,y:0},innerRadius:0,radius:-1,maxKernelSize:32});let Nl=Yr;return s.AdjustmentFilter=Rt,s.AdvancedBloomFilter=Qt,s.AsciiFilter=oo,s.BackdropBlurFilter=fo,s.BevelFilter=ho,s.BloomFilter=To,s.BulgePinchFilter=Ao,s.CRTFilter=Si,s.ColorGradientFilter=Bo,s.ColorMapFilter=Wo,s.ColorOverlayFilter=Jo,s.ColorReplaceFilter=ii,s.ConvolutionFilter=ci,s.CrossHatchFilter=vi,s.DotFilter=Fi,s.DropShadowFilter=Ri,s.EmbossFilter=Li,s.GlitchFilter=Ki,s.GlowFilter=Qi,s.GodrayFilter=uu,s.GrayscaleFilter=su,s.HslAdjustmentFilter=gu,s.KawaseBlurFilter=Z,s.MotionBlurFilter=bu,s.MultiColorReplaceFilter=Fu,s.OldFilmFilter=Ru,s.OutlineFilter=Lu,s.PixelateFilter=Nu,s.RGBSplitFilter=ul,s.RadialBlurFilter=qu,s.ReflectionFilter=el,s.ShockwaveFilter=ml,s.SimpleLightmapFilter=xl,s.TiltShiftAxisFilter=X,s.TiltShiftFilter=Il,s.TwistFilter=Gl,s.ZoomBlurFilter=Nl,s.angleFromCssOrientation=Pn,s.angleFromDirectionalValue=On,s.colorAsStringFromCssStop=Cn,s.offsetsFromCssColorStops=Tn,s.parseCssGradient=yn,s.stopsFromCssStops=bn,s.trimCssGradient=zn,s.typeFromCssType=Sn,s.vertex=c,s.wgslVertex=m,Object.defineProperty(s,"__esModule",{value:!0}),s}({},PIXI); +//# sourceMappingURL=pixi-filters.js.map diff --git a/dist/pixi-filters.js.map b/dist/pixi-filters.js.map new file mode 100644 index 000000000..1631030f1 --- /dev/null +++ b/dist/pixi-filters.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pixi-filters.js","sources":["../src/adjustment/AdjustmentFilter.ts","../src/kawase-blur/KawaseBlurFilter.ts","../src/advanced-bloom/ExtractBrightnessFilter.ts","../src/advanced-bloom/AdvancedBloomFilter.ts","../src/ascii/AsciiFilter.ts","../src/backdrop-blur/BackdropBlurFilter.ts","../src/bevel/BevelFilter.ts","../src/bloom/BloomFilter.ts","../src/bulge-pinch/BulgePinchFilter.ts","../node_modules/gradient-parser/build/node.js","../src/color-gradient/CssGradientParser.ts","../src/color-gradient/ColorGradientFilter.ts","../src/color-map/ColorMapFilter.ts","../src/color-overlay/ColorOverlayFilter.ts","../src/color-replace/ColorReplaceFilter.ts","../src/convolution/ConvolutionFilter.ts","../src/cross-hatch/CrossHatchFilter.ts","../src/crt/CRTFilter.ts","../src/dot/DotFilter.ts","../src/drop-shadow/DropShadowFilter.ts","../src/emboss/EmbossFilter.ts","../src/glitch/GlitchFilter.ts","../src/glow/GlowFilter.ts","../src/godray/GodrayFilter.ts","../src/grayscale/GrayscaleFilter.ts","../src/hsl-adjustment/HslAdjustmentFilter.ts","../src/motion-blur/MotionBlurFilter.ts","../src/multi-color-replace/MultiColorReplaceFilter.ts","../src/old-film/OldFilmFilter.ts","../src/outline/OutlineFilter.ts","../src/pixelate/PixelateFilter.ts","../src/radial-blur/RadialBlurFilter.ts","../src/reflection/ReflectionFilter.ts","../src/rgb-split/RGBSplitFilter.ts","../src/shockwave/ShockwaveFilter.ts","../src/simple-lightmap/SimpleLightmapFilter.ts","../src/tilt-shift/TiltShiftAxisFilter.ts","../src/tilt-shift/TiltShiftFilter.ts","../src/twist/TwistFilter.ts","../src/zoom-blur/ZoomBlurFilter.ts"],"sourcesContent":["import { Filter, GlProgram, GpuProgram } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './adjustment.frag';\nimport source from './adjustment.wgsl';\n\n/** Options for the AdjustmentFilter constructor */\nexport interface AdjustmentFilterOptions\n{\n /**\n * The amount of luminance\n * @default 1\n */\n gamma?: number;\n /**\n * The amount of contrast\n * @default 1\n */\n contrast?: number;\n /**\n * The amount of color saturation\n * @default 1\n */\n saturation?: number;\n /**\n * The overall brightness\n * @default 1\n */\n brightness?: number;\n /**\n * The multiplied red channel\n * @default 1\n */\n red?: number;\n /**\n * The multiplied green channel\n * @default 1\n */\n green?: number;\n /**\n * The multiplied blue channel\n * @default 1\n */\n blue?: number;\n /**\n * The overall alpha channel\n * @default 1\n */\n alpha?: number;\n}\n\n/**\n * The ability to adjust gamma, contrast, saturation, brightness, alpha or color-channel shift.\n * This is a faster and much simpler to use than\n * {@link http://pixijs.download/release/docs/ColorMatrixFilter.html ColorMatrixFilter}\n * because it does not use a matrix.
\n * ![original](../screenshots/original.png)![filter](../screenshots/adjustment.png)\n *\n * @class\n * @extends Filter\n */\nexport class AdjustmentFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: AdjustmentFilterOptions = {\n gamma: 1,\n contrast: 1,\n saturation: 1,\n brightness: 1,\n red: 1,\n green: 1,\n blue: 1,\n alpha: 1,\n };\n\n public uniforms: {\n uGamma: number;\n uContrast: number;\n uSaturation: number;\n uBrightness: number;\n uColor: Float32Array;\n };\n\n /**\n * @param options - The options of the adjustment filter.\n */\n constructor(options?: AdjustmentFilterOptions)\n {\n options = { ...AdjustmentFilter.DEFAULT_OPTIONS, ...options };\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'adjustment-filter'\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n adjustmentUniforms: {\n uGamma: { value: options.gamma, type: 'f32' },\n uContrast: { value: options.contrast, type: 'f32' },\n uSaturation: { value: options.saturation, type: 'f32' },\n uBrightness: { value: options.brightness, type: 'f32' },\n uColor: {\n value: [\n options.red,\n options.green,\n options.blue,\n options.alpha,\n ],\n type: 'vec4',\n },\n }\n },\n });\n\n this.uniforms = this.resources.adjustmentUniforms.uniforms;\n }\n\n /**\n * Amount of luminance\n * @default 1\n */\n get gamma(): number { return this.uniforms.uGamma; }\n set gamma(value: number) { this.uniforms.uGamma = value; }\n\n /**\n * Amount of contrast\n * @default 1\n */\n get contrast(): number { return this.uniforms.uContrast; }\n set contrast(value: number) { this.uniforms.uContrast = value; }\n\n /**\n * Amount of color saturation\n * @default 1\n */\n get saturation(): number { return this.uniforms.uSaturation; }\n set saturation(value: number) { this.uniforms.uSaturation = value; }\n\n /**\n * The overall brightness\n * @default 1\n */\n get brightness(): number { return this.uniforms.uBrightness; }\n set brightness(value: number) { this.uniforms.uBrightness = value; }\n\n /**\n * The multiplied red channel\n * @default 1\n */\n get red(): number { return this.uniforms.uColor[0]; }\n set red(value: number) { this.uniforms.uColor[0] = value; }\n\n /**\n * The multiplied blue channel\n * @default 1\n */\n get green(): number { return this.uniforms.uColor[1]; }\n set green(value: number) { this.uniforms.uColor[1] = value; }\n\n /**\n * The multiplied green channel\n * @default 1\n */\n get blue(): number { return this.uniforms.uColor[2]; }\n set blue(value: number) { this.uniforms.uColor[2] = value; }\n\n /**\n * The overall alpha channel\n * @default 1\n */\n get alpha(): number { return this.uniforms.uColor[3]; }\n set alpha(value: number) { this.uniforms.uColor[3] = value; }\n}\n","import { deprecation, Filter, GlProgram, GpuProgram, TexturePool } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './kawase-blur.frag';\nimport source from './kawase-blur.wgsl';\nimport fragmentClamp from './kawase-blur-clamp.frag';\nimport sourceClamp from './kawase-blur-clamp.wgsl';\n\nimport type { FilterSystem, PointData, RenderSurface, Texture } from 'pixi.js';\n\n/** Options for the KawaseBlurFilter constructor. */\nexport interface KawaseBlurFilterOptions\n{\n /**\n * The blur of the filter. Should be greater than `0`.\n * If value is an Array, setting kernels.\n * @default 4\n */\n strength?: number | [number, number];\n /**\n * The quality of the filter. Should be an integer greater than `1`\n * @default 3\n */\n quality?: number;\n /**\n * Clamp edges, useful for removing dark edges from fullscreen filters or bleeding to the edge of filterArea.\n * @default false\n */\n clamp?: boolean;\n /**\n * Sets the pixel size of the filter. Large size is blurrier. For advanced usage.\n * @default {x:1,y:1}\n */\n pixelSize?: PointData | number[] | number;\n}\n\n/**\n * A much faster blur than Gaussian blur, but more complicated to use.
\n * ![original](../screenshots/original.png)![filter](../screenshots/kawase-blur.png)\n *\n * @see https://software.intel.com/en-us/blogs/2014/07/15/an-investigation-of-fast-real-time-gpu-based-image-blur-algorithms\n * @class\n * @extends Filter\n */\nexport class KawaseBlurFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: KawaseBlurFilterOptions = {\n strength: 4,\n quality: 3,\n clamp: false,\n pixelSize: { x: 1, y: 1 },\n };\n\n public uniforms: {\n uOffset: Float32Array;\n };\n\n private _pixelSize = { x: 0, y: 0 };\n private _clamp: boolean;\n private _kernels: number[] = [];\n private _blur!: number;\n private _quality!: number;\n\n /**\n * @param options - Options for the KawaseBlurFilter constructor.\n */\n constructor(options?: KawaseBlurFilterOptions);\n /**\n * @deprecated since 6.0.0\n *\n * @param {number|number[]} [blur=4] - The blur of the filter. Should be greater than `0`. If\n * value is an Array, setting kernels.\n * @param {number} [quality=3] - The quality of the filter. Should be an integer greater than `1`.\n * @param {boolean} [clamp=false] - Clamp edges, useful for removing dark edges\n * from fullscreen filters or bleeding to the edge of filterArea.\n */\n constructor(blur?: number | number[], quality?: number, clamp?: boolean);\n /** @ignore */\n constructor(...args: [KawaseBlurFilterOptions?] | [(number | number[])?, number?, boolean?])\n {\n let options = args[0] ?? {};\n\n if (typeof options === 'number' || Array.isArray(options))\n {\n // eslint-disable-next-line max-len\n deprecation('6.0.0', 'KawaseBlurFilter constructor params are now options object. See params: { strength, quality, clamp, pixelSize }');\n\n options = { strength: options as number | [number, number] };\n\n if (args[1] !== undefined) options.quality = args[1];\n if (args[2] !== undefined) options.clamp = args[2];\n }\n\n options = { ...KawaseBlurFilter.DEFAULT_OPTIONS, ...options };\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source: options?.clamp ? sourceClamp : source,\n entryPoint: 'mainFragment',\n },\n });\n const glProgram = GlProgram.from({\n vertex,\n fragment: options?.clamp ? fragmentClamp : fragment,\n name: 'kawase-blur-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n kawaseBlurUniforms: {\n uOffset: { value: new Float32Array(2), type: 'vec2' },\n }\n },\n });\n\n this.uniforms = this.resources.kawaseBlurUniforms.uniforms;\n\n this.pixelSize = options.pixelSize ?? { x: 1, y: 1 };\n\n if (Array.isArray(options.strength))\n {\n this.kernels = options.strength;\n }\n else if (typeof options.strength === 'number')\n {\n this._blur = options.strength;\n this.quality = options.quality ?? 3;\n }\n\n this._clamp = !!options.clamp;\n }\n\n /**\n * Override existing apply method in `Filter`\n * @override\n * @ignore\n */\n public override apply(\n filterManager: FilterSystem,\n input: Texture,\n output: RenderSurface,\n clearMode: boolean\n ): void\n {\n const uvX = this.pixelSizeX / input.source.width;\n const uvY = this.pixelSizeY / input.source.height;\n let offset;\n\n if (this._quality === 1 || this._blur === 0)\n {\n offset = this._kernels[0] + 0.5;\n this.uniforms.uOffset[0] = offset * uvX;\n this.uniforms.uOffset[1] = offset * uvY;\n filterManager.applyFilter(this, input, output, clearMode);\n }\n else\n {\n const renderTarget = TexturePool.getSameSizeTexture(input);\n\n let source = input;\n let target = renderTarget;\n let tmp;\n\n const last = this._quality - 1;\n\n for (let i = 0; i < last; i++)\n {\n offset = this._kernels[i] + 0.5;\n this.uniforms.uOffset[0] = offset * uvX;\n this.uniforms.uOffset[1] = offset * uvY;\n filterManager.applyFilter(this, source, target, true);\n\n tmp = source;\n source = target;\n target = tmp;\n }\n\n offset = this._kernels[last] + 0.5;\n this.uniforms.uOffset[0] = offset * uvX;\n this.uniforms.uOffset[1] = offset * uvY;\n\n filterManager.applyFilter(this, source, output, clearMode);\n TexturePool.returnTexture(renderTarget);\n }\n }\n\n /**\n * The amount of blur, value greater than `0`.\n * @default 4\n */\n get strength(): number { return this._blur; }\n set strength(value: number)\n {\n this._blur = value;\n this._generateKernels();\n }\n\n /**\n * The quality of the filter, integer greater than `1`.\n * @default 3\n */\n get quality(): number { return this._quality; }\n set quality(value: number)\n {\n this._quality = Math.max(1, Math.round(value));\n this._generateKernels();\n }\n\n /**\n * The kernel size of the blur filter, for advanced usage\n * @default [0]\n */\n get kernels(): number[] { return this._kernels; }\n set kernels(value: number[])\n {\n if (Array.isArray(value) && value.length > 0)\n {\n this._kernels = value;\n this._quality = value.length;\n this._blur = Math.max(...value);\n }\n else\n {\n // If value is invalid, set default value\n this._kernels = [0];\n this._quality = 1;\n }\n }\n\n /**\n * The size of the pixels. Large size is blurrier. For advanced usage.\n * @default {x:1,y:1}\n */\n get pixelSize(): PointData { return this._pixelSize; }\n set pixelSize(value: PointData | number[] | number)\n {\n if (typeof value === 'number')\n {\n this.pixelSizeX = this.pixelSizeY = value;\n\n return;\n }\n\n if (Array.isArray(value))\n {\n this.pixelSizeX = value[0];\n this.pixelSizeY = value[1];\n\n return;\n }\n\n this._pixelSize = value;\n }\n\n /**\n * The size of the pixels on the `x` axis. Large size is blurrier. For advanced usage.\n * @default 1\n */\n get pixelSizeX(): number { return this.pixelSize.x; }\n set pixelSizeX(value: number) { this.pixelSize.x = value; }\n\n /**\n * The size of the pixels on the `y` axis. Large size is blurrier. For advanced usage.\n * @default 1\n */\n get pixelSizeY(): number { return this.pixelSize.y; }\n set pixelSizeY(value: number) { this.pixelSize.y = value; }\n\n /**\n * Get the if the filter is clamped\n * @default false\n */\n get clamp(): boolean { return this._clamp; }\n\n /** Update padding based on kernel data */\n private _updatePadding()\n {\n this.padding = Math.ceil(this._kernels.reduce((acc, v) => acc + v + 0.5, 0));\n }\n\n /** Auto generate kernels by blur & quality */\n private _generateKernels()\n {\n const blur = this._blur;\n const quality = this._quality;\n const kernels: number[] = [blur];\n\n if (blur > 0)\n {\n let k = blur;\n const step = blur / quality;\n\n for (let i = 1; i < quality; i++)\n {\n k -= step;\n kernels.push(k);\n }\n }\n\n this._kernels = kernels;\n this._updatePadding();\n }\n}\n","import { Filter, GlProgram, GpuProgram } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './extract-brightness.frag';\nimport source from './extract-brightness.wgsl';\n\nexport interface ExtractBrightnessFilterOptions\n{\n /**\n * Defines how bright a color needs to be extracted.\n */\n threshold?: number;\n}\n\n/**\n * Internal filter for retrieving the brightness of the source image.\n * @class\n * @private\n */\nexport class ExtractBrightnessFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: ExtractBrightnessFilterOptions = {\n threshold: 0.5\n };\n\n public uniforms: {\n uThreshold: number;\n };\n\n constructor(options?: ExtractBrightnessFilterOptions)\n {\n options = { ...ExtractBrightnessFilter.DEFAULT_OPTIONS, ...options };\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'extract-brightness-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n extractBrightnessUniforms: {\n uThreshold: { value: options.threshold, type: 'f32' },\n }\n },\n });\n\n this.uniforms = this.resources.extractBrightnessUniforms.uniforms;\n }\n\n /**\n * Defines how bright a color needs to be extracted.\n * @default 0.5\n */\n get threshold(): number { return this.uniforms.uThreshold; }\n set threshold(value: number) { this.uniforms.uThreshold = value; }\n}\n","import {\n Filter,\n FilterSystem,\n GlProgram,\n GpuProgram,\n PointData,\n RenderSurface,\n Texture,\n TexturePool,\n} from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport { KawaseBlurFilter } from '../kawase-blur/KawaseBlurFilter';\nimport fragment from './advanced-bloom.frag';\nimport source from './advanced-bloom.wgsl';\nimport { ExtractBrightnessFilter } from './ExtractBrightnessFilter';\n\n/** Options for the AdvancedBloomFilter constructor. */\nexport interface AdvancedBloomFilterOptions\n{\n /**\n * Defines how bright a color needs to be to affect bloom.\n * @default 1\n */\n threshold?: number,\n /**\n * To adjust the strength of the bloom. Higher values is more intense brightness.\n * @default 1\n */\n bloomScale?: number,\n /**\n * The brightness, lower value is more subtle brightness, higher value is blown-out.\n * @default 1\n */\n brightness?: number,\n /** The strength of the Blur properties simultaneously */\n blur?: number,\n /**\n * The kernel size of the blur filter.\n */\n kernels?: number[],\n /** The quality of the Blur filter. */\n quality?: number,\n /**\n * The pixel size of the blur filter. Large size is blurrier. For advanced usage.\n * @default {x:1,y:1}\n */\n pixelSize?: PointData | number[] | number,\n}\n\n/**\n * The AdvancedBloomFilter applies a Bloom Effect to an object. Unlike the normal BloomFilter\n * this had some advanced controls for adjusting the look of the bloom. Note: this filter\n * is slower than normal BloomFilter.
\n * ![original](../screenshots/original.png)![filter](../screenshots/advanced-bloom.png)\n *\n * @class\n * @extends Filter\n */\nexport class AdvancedBloomFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: AdvancedBloomFilterOptions = {\n threshold: 0.5,\n bloomScale: 1,\n brightness: 1,\n blur: 8,\n quality: 4,\n pixelSize: { x: 1, y: 1 },\n };\n\n public uniforms: {\n uBloomScale: number;\n uBrightness: number;\n };\n\n /** To adjust the strength of the bloom. Higher values is more intense brightness. */\n public bloomScale = 1;\n\n /** The brightness, lower value is more subtle brightness, higher value is blown-out. */\n public brightness = 1;\n\n private _extractFilter: ExtractBrightnessFilter;\n private _blurFilter: KawaseBlurFilter;\n\n /**\n * @param options - Options for the AdvancedBloomFilter constructor.\n */\n constructor(options?: AdvancedBloomFilterOptions)\n {\n options = { ...AdvancedBloomFilter.DEFAULT_OPTIONS, ...options };\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'advanced-bloom-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n advancedBloomUniforms: {\n uBloomScale: { value: options.bloomScale, type: 'f32' },\n uBrightness: { value: options.brightness, type: 'f32' },\n },\n uMapTexture: Texture.WHITE,\n },\n });\n\n this.uniforms = this.resources.advancedBloomUniforms.uniforms;\n\n this._extractFilter = new ExtractBrightnessFilter({\n threshold: options.threshold\n });\n\n this._blurFilter = new KawaseBlurFilter({\n strength: options.kernels as [number, number] ?? options.blur,\n quality: options.kernels ? undefined : options.quality,\n });\n\n Object.assign(this, options);\n }\n\n /**\n * Override existing apply method in `Filter`\n * @override\n * @ignore\n */\n public override apply(\n filterManager: FilterSystem,\n input: Texture,\n output: RenderSurface,\n clearMode: boolean\n ): void\n {\n const brightTarget = TexturePool.getSameSizeTexture(input);\n\n this._extractFilter.apply(filterManager, input, brightTarget, true);\n\n const bloomTarget = TexturePool.getSameSizeTexture(input);\n\n this._blurFilter.apply(filterManager, brightTarget, bloomTarget, true);\n\n this.uniforms.uBloomScale = this.bloomScale;\n this.uniforms.uBrightness = this.brightness;\n\n this.resources.uMapTexture = bloomTarget.source;\n\n filterManager.applyFilter(this, input, output, clearMode);\n\n TexturePool.returnTexture(bloomTarget);\n TexturePool.returnTexture(brightTarget);\n }\n\n /**\n * Defines how bright a color needs to be extracted.\n * @default 0.5\n */\n get threshold(): number { return this._extractFilter.threshold; }\n set threshold(value: number) { this._extractFilter.threshold = value; }\n\n /** The kernels of the Blur Filter */\n get kernels(): number[] { return this._blurFilter.kernels; }\n set kernels(value: number[]) { this._blurFilter.kernels = value; }\n\n /**\n * The strength of the Blur properties simultaneously\n * @default 2\n */\n get blur(): number { return this._blurFilter.strength; }\n set blur(value: number) { this._blurFilter.strength = value; }\n\n /**\n * The quality of the Blur Filter\n * @default 4\n */\n get quality(): number { return this._blurFilter.quality; }\n set quality(value: number) { this._blurFilter.quality = value; }\n\n /**\n * The pixel size of the Kawase Blur filter\n * @default {x:1,y:1}\n */\n get pixelSize(): PointData { return this._blurFilter.pixelSize; }\n set pixelSize(value: PointData | number[] | number)\n {\n if (typeof value === 'number')\n {\n value = { x: value, y: value };\n }\n\n if (Array.isArray(value))\n {\n value = { x: value[0], y: value[1] };\n }\n\n this._blurFilter.pixelSize = value;\n }\n\n /**\n * The horizontal pixelSize of the Kawase Blur filter\n * @default 1\n */\n get pixelSizeX(): number { return this._blurFilter.pixelSizeX; }\n set pixelSizeX(value: number) { this._blurFilter.pixelSizeX = value; }\n\n /**\n * The vertical pixel size of the Kawase Blur filter\n * @default 1\n */\n get pixelSizeY(): number { return this._blurFilter.pixelSizeY; }\n set pixelSizeY(value: number) { this._blurFilter.pixelSizeY = value; }\n}\n","import { Color, ColorSource, deprecation, Filter, GlProgram, GpuProgram } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './ascii.frag';\nimport source from './ascii.wgsl';\n\n// This WebGPU filter has been ported from the WebGL renderer that was originally created by Vico (@vicocotea)\n\n/** Options for AsciiFilter constructor. */\nexport interface AsciiFilterOptions\n{\n /**\n * The pixel size used by the filter\n * @default 8\n */\n size?: number;\n /**\n * A color to set the ascii characters to. If not set, the color will be taken from the source.\n * @example [1.0, 1.0, 1.0] = 0xffffff\n * @default 0x000000\n */\n color?: ColorSource;\n /**\n * Determine whether or not to replace the source colors with the provided.\n *\n * Will automatically be assigned to `true` if `color` is provided.\n * Set `replaceColor` to `false` to prevent that.\n * @default false\n */\n replaceColor?: boolean;\n}\n\n/**\n * An ASCII filter.
\n * ![original](../screenshots/original.png)![filter](../screenshots/ascii.png)\n *\n * @class\n * @extends Filter\n */\nexport class AsciiFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: AsciiFilterOptions = {\n size: 8,\n color: 0xffffff,\n replaceColor: false,\n };\n\n public uniforms: {\n uSize: number;\n uColor: Float32Array;\n uReplaceColor: number;\n };\n\n private _color!: Color;\n\n /**\n * Constructor.\n * @param {AsciiFilterOptions} options - The options of the ASCII filter.\n */\n constructor(options?: AsciiFilterOptions);\n /**\n * @deprecated since 6.0.0\n *\n * @param {number} [size=8] - Size of the font\n */\n constructor(size: number);\n /** @ignore */\n constructor(...args: [AsciiFilterOptions?] | [number])\n {\n let options = args[0] ?? {};\n\n if (typeof options === 'number')\n {\n // eslint-disable-next-line max-len\n deprecation('6.0.0', 'AsciiFilter constructor params are now options object. See params: { size, color, replaceColor }');\n\n options = { size: options };\n }\n\n const replaceColor = options?.color && options.replaceColor !== false;\n\n options = { ...AsciiFilter.DEFAULT_OPTIONS, ...options } as AsciiFilterOptions;\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'ascii-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n asciiUniforms: {\n uSize: { value: options.size, type: 'f32' },\n uColor: { value: new Float32Array(3), type: 'vec3' },\n uReplaceColor: { value: Number(replaceColor), type: 'f32' },\n },\n },\n });\n\n this.uniforms = this.resources.asciiUniforms.uniforms;\n this._color = new Color();\n this.color = options.color ?? 0xffffff;\n }\n\n /**\n * The pixel size used by the filter.\n * @default 8\n */\n get size(): number { return this.uniforms.uSize; }\n set size(value: number) { this.uniforms.uSize = value; }\n\n /**\n * The resulting color of the ascii characters, as a 3 component RGB or numerical hex\n * @example [1.0, 1.0, 1.0] = 0xffffff\n * @default 0xffffff\n */\n get color(): ColorSource { return this._color.value as ColorSource; }\n set color(value: ColorSource)\n {\n this._color.setValue(value);\n const [r, g, b] = this._color.toArray();\n\n this.uniforms.uColor[0] = r;\n this.uniforms.uColor[1] = g;\n this.uniforms.uColor[2] = b;\n }\n\n /**\n * Determine whether or not to replace the source colors with the provided.\n */\n get replaceColor(): boolean { return this.uniforms.uReplaceColor > 0.5; }\n set replaceColor(value: boolean) { this.uniforms.uReplaceColor = value ? 1 : 0; }\n}\n","import {\n BlurFilter,\n BlurFilterOptions,\n Filter,\n FilterSystem,\n GlProgram,\n GpuProgram,\n RenderSurface,\n Texture,\n TexturePool,\n} from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './backdrop-blur-blend.frag';\nimport wgslFragment from './backdrop-blur-blend.wgsl';\n\n/**\n * The BackdropBlurFilter applies a Gaussian blur to everything behind an object, and then draws the object on top of it.
\n * ![original](../screenshots/original.png)![filter](../screenshots/backdrop-blur.png)\n *\n * @class\n * @extends BlurFilter\n */\nexport class BackdropBlurFilter extends BlurFilter\n{\n private _blendPass: Filter;\n\n /**\n * @param options - The options of the blur filter.\n */\n constructor(options?: BlurFilterOptions)\n {\n super(options);\n\n this.blendRequired = true;\n this.padding = 0;\n\n this._blendPass = new Filter({\n gpuProgram: GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source: wgslFragment,\n entryPoint: 'mainFragment',\n },\n }),\n glProgram: GlProgram.from({\n vertex,\n fragment,\n name: 'drop-shadow-filter',\n }),\n resources: {\n uBackground: Texture.EMPTY,\n },\n });\n }\n\n /**\n * Override existing apply method in `Filter`\n * @override\n * @ignore\n */\n public apply(\n filterManager: FilterSystem,\n input: Texture,\n output: RenderSurface,\n clearMode: boolean\n ): void\n {\n // @ts-expect-error - this should probably not be grabbed from a private property\n const backTexture = filterManager._activeFilterData.backTexture;\n\n const blurredBackground = TexturePool.getSameSizeTexture(input);\n\n super.apply(filterManager, backTexture, blurredBackground, true);\n\n this._blendPass.resources.uBackground = blurredBackground.source;\n this._blendPass.apply(filterManager, input, output, clearMode);\n\n TexturePool.returnTexture(blurredBackground);\n }\n\n protected updatePadding(): void\n {\n this.padding = 0;\n }\n}\n","import { Color, ColorSource, DEG_TO_RAD, Filter, GlProgram, GpuProgram } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './bevel.frag';\nimport source from './bevel.wgsl';\n\n/** Options for the BevelFilter constructor. */\nexport interface BevelFilterOptions\n{\n /**\n * The angle of the light in degrees\n * @default 45\n */\n rotation?: number,\n /**\n * The thickness of the bevel\n * @default 2\n */\n thickness?: number,\n /**\n * The color value of the left & top bevel.\n * @example [1.0, 1.0, 1.0] = 0xffffff\n * @default 0xffffff\n */\n lightColor?: ColorSource,\n /**\n * The alpha value of the left & top bevel.\n * @default 0.7\n */\n lightAlpha?: number,\n /**\n * The color value of the right & bottom bevel.\n * @example [1.0, 1.0, 1.0] = 0xffffff\n * @default 0x000000\n */\n shadowColor?: ColorSource,\n /**\n * The alpha value of the right & bottom bevel.\n * @default 0.7\n */\n shadowAlpha?: number,\n}\n\n/**\n * Bevel Filter.
\n * ![original](../screenshots/original.png)![filter](../screenshots/bevel.png)\n *\n * @class\n * @extends Filter\n */\nexport class BevelFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: BevelFilterOptions = {\n rotation: 45,\n thickness: 2,\n lightColor: 0xffffff,\n lightAlpha: 0.7,\n shadowColor: 0x000000,\n shadowAlpha: 0.7,\n };\n\n public uniforms: {\n uLightColor: Float32Array;\n uLightAlpha: number;\n uShadowColor: Float32Array;\n uShadowAlpha: number;\n uTransform: Float32Array;\n };\n\n private _thickness!: number;\n private _rotation!: number;\n private _lightColor: Color;\n private _shadowColor: Color;\n\n /**\n * @param options - Options for the BevelFilter constructor.\n */\n constructor(options?: BevelFilterOptions)\n {\n options = { ...BevelFilter.DEFAULT_OPTIONS, ...options };\n\n const rotation = (options.rotation ?? 45) * DEG_TO_RAD;\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'bevel-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n bevelUniforms: {\n uLightColor: { value: new Float32Array(3), type: 'vec3' },\n uLightAlpha: { value: options.lightAlpha, type: 'f32' },\n uShadowColor: { value: new Float32Array(3), type: 'vec3' },\n uShadowAlpha: { value: options.shadowAlpha, type: 'f32' },\n uTransform: { value: new Float32Array(2), type: 'vec2' },\n }\n },\n // Workaround: https://github.com/pixijs/filters/issues/230\n // applies correctly only if there is at least a single-pixel padding with alpha=0 around an image\n // To solve this problem, a padding of 1 put on the filter should suffice\n padding: 1,\n });\n\n this.uniforms = this.resources.bevelUniforms.uniforms;\n this._lightColor = new Color();\n this._shadowColor = new Color();\n this.lightColor = options.lightColor ?? 0xffffff;\n this.shadowColor = options.shadowColor ?? 0x000000;\n\n Object.assign(this, options, { rotation });\n }\n\n /**\n * The angle of the light in degrees\n * @default 45\n */\n get rotation(): number { return this._rotation / DEG_TO_RAD; }\n set rotation(value: number)\n {\n this._rotation = value * DEG_TO_RAD;\n this._updateTransform();\n }\n\n /**\n * The thickness of the bevel\n * @default 2\n */\n get thickness(): number { return this._thickness; }\n set thickness(value: number)\n {\n this._thickness = value;\n this._updateTransform();\n }\n\n /**\n * The color value of the left & top bevel.\n * @example [1.0, 1.0, 1.0] = 0xffffff\n * @default 0xffffff\n */\n get lightColor(): ColorSource { return this._lightColor.value as ColorSource; }\n set lightColor(value: ColorSource)\n {\n this._lightColor.setValue(value);\n const [r, g, b] = this._lightColor.toArray();\n\n this.uniforms.uLightColor[0] = r;\n this.uniforms.uLightColor[1] = g;\n this.uniforms.uLightColor[2] = b;\n }\n\n /**\n * The alpha value of the left & top bevel.\n * @default 0.7\n */\n get lightAlpha(): number { return this.uniforms.uLightAlpha; }\n set lightAlpha(value: number) { this.uniforms.uLightAlpha = value; }\n\n /**\n * The color value of the right & bottom bevel.\n * @default 0xffffff\n */\n get shadowColor(): ColorSource { return this._shadowColor.value as ColorSource; }\n set shadowColor(value: ColorSource)\n {\n this._shadowColor.setValue(value);\n const [r, g, b] = this._shadowColor.toArray();\n\n this.uniforms.uShadowColor[0] = r;\n this.uniforms.uShadowColor[1] = g;\n this.uniforms.uShadowColor[2] = b;\n }\n\n /**\n * The alpha value of the right & bottom bevel.\n * @default 0.7\n */\n get shadowAlpha(): number { return this.uniforms.uShadowAlpha; }\n set shadowAlpha(value: number) { this.uniforms.uShadowAlpha = value; }\n\n /**\n * Update the transform matrix of offset angle.\n * @private\n */\n private _updateTransform()\n {\n this.uniforms.uTransform[0] = this.thickness * Math.cos(this._rotation);\n this.uniforms.uTransform[1] = this.thickness * Math.sin(this._rotation);\n }\n}\n","/* eslint-disable max-len */\nimport {\n AlphaFilter,\n BlurFilterPass,\n deprecation,\n FilterSystem,\n PointData,\n RenderSurface,\n Texture,\n TexturePool,\n} from 'pixi.js';\n\ntype DeprecatedBlurValue = number | PointData | number[];\n\n/** Options for the BloomFilter constructor. */\nexport interface BloomFilterOptions\n{\n /**\n * Sets the strength of the blur. If only a number is provided, it will assign to both x and y.\n * @default {x:2,y:2}\n */\n strength?: PointData | number;\n /**\n * The quality of the blur.\n * @default 4\n */\n quality?: number;\n /**\n * The resolution of the blurX & blurY filter.\n * @default 1\n */\n resolution?: number;\n /**\n * The kernel size of the blur filter. Must be an odd number between 5 and 15 (inclusive).\n * @default 5\n */\n kernelSize?: number;\n}\n\n/**\n * The BloomFilter applies a Gaussian blur to an object.\n * The strength of the blur can be set for x- and y-axis separately.
\n * ![original](../screenshots/original.png)![filter](../screenshots/bloom.png)\n *\n * @class\n * @extends Filter\n */\nexport class BloomFilter extends AlphaFilter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: BloomFilterOptions = {\n strength: { x: 2, y: 2 },\n quality: 4,\n resolution: 1,\n kernelSize: 5\n };\n\n private _blurXFilter: BlurFilterPass;\n private _blurYFilter: BlurFilterPass;\n private _strength: PointData;\n\n /**\n * @param {BloomFilterOptions} options - Options for the BloomFilter constructor.\n */\n constructor(options?: BloomFilterOptions);\n /**\n * @deprecated since 6.0.0\n *\n * @param {number|PIXI.PointData|number[]} [blur=2] - Sets the strength of both the blurX and blurY properties simultaneously\n * @param {number} [quality=4] - The quality of the blurX & blurY filter.\n * @param {number} [resolution=1] - The resolution of the blurX & blurY filter.\n * @param {number} [kernelSize=5] - The kernelSize of the blurX & blurY filter.Options: 5, 7, 9, 11, 13, 15.\n */\n constructor(blur?: DeprecatedBlurValue, quality?: number, resolution?: number, kernelSize?: number);\n /** @ignore */\n constructor(...args: [BloomFilterOptions?] | [DeprecatedBlurValue?, number?, number?, number?])\n {\n let options = args[0] ?? {};\n\n if (typeof options === 'number' || Array.isArray(options) || ('x' in options && 'y' in options))\n {\n // eslint-disable-next-line max-len\n deprecation('6.0.0', 'BloomFilter constructor params are now options object. See params: { strength, quality, resolution, kernelSize }');\n\n let strength = options;\n\n if (Array.isArray(strength)) strength = { x: strength[0], y: strength[1] };\n\n options = { strength };\n\n if (args[1] !== undefined) options.quality = args[1];\n if (args[2] !== undefined) options.resolution = args[2];\n if (args[3] !== undefined) options.kernelSize = args[3];\n }\n\n options = { ...BloomFilter.DEFAULT_OPTIONS, ...options } as BloomFilterOptions;\n\n super();\n\n this._strength = { x: 2, y: 2 };\n\n if (options.strength)\n {\n if (typeof options.strength === 'number')\n {\n this._strength.x = options.strength;\n this._strength.y = options.strength;\n }\n else\n {\n this._strength.x = options.strength.x;\n this._strength.y = options.strength.y;\n }\n }\n\n this._blurXFilter = new BlurFilterPass({\n ...options,\n horizontal: true,\n strength: this.strengthX,\n });\n\n this._blurYFilter = new BlurFilterPass({\n ...options,\n horizontal: false,\n strength: this.strengthY,\n });\n\n this._blurYFilter.blendMode = 'screen';\n\n Object.assign(this, options);\n }\n\n /**\n * Override existing apply method in `Filter`\n * @override\n * @ignore\n */\n public override apply(\n filterManager: FilterSystem,\n input: Texture,\n output: RenderSurface,\n clear: boolean,\n ): void\n {\n const renderTarget = TexturePool.getSameSizeTexture(input);\n\n filterManager.applyFilter(this, input, output, clear);\n this._blurXFilter.apply(filterManager, input, renderTarget, true);\n this._blurYFilter.apply(filterManager, renderTarget, output, false);\n\n TexturePool.returnTexture(renderTarget);\n }\n\n /**\n * Sets the strength of both the blurX and blurY properties simultaneously\n * @default 2\n */\n get strength(): PointData { return this._strength; }\n set strength(value: PointData | number)\n {\n this._strength = typeof value === 'number' ? { x: value, y: value } : value;\n this._updateStrength();\n }\n\n /**\n * Sets the strength of the blur on the `x` axis\n * @default 2\n */\n get strengthX(): number { return this.strength.x; }\n set strengthX(value: number)\n {\n this.strength.x = value;\n this._updateStrength();\n }\n\n /**\n * Sets the strength of the blur on the `y` axis\n * @default 2\n */\n get strengthY(): number { return this.strength.y; }\n set strengthY(value: number)\n {\n this.strength.y = value;\n this._updateStrength();\n }\n\n private _updateStrength()\n {\n this._blurXFilter.blur = this.strengthX;\n this._blurYFilter.blur = this.strengthY;\n }\n\n /**\n * @deprecated since 6.0.0\n *\n * The strength of both the blurX and blurY properties simultaneously\n * @default 2\n * @see BloomFilter#strength\n */\n get blur(): number\n {\n deprecation('6.0.0', 'BloomFilter.blur is deprecated, please use BloomFilter.strength instead');\n\n return this.strengthX;\n }\n set blur(value: number)\n {\n deprecation('6.0.0', 'BloomFilter.blur is deprecated, please use BloomFilter.strength instead');\n\n this.strength = value;\n }\n\n /**\n * @deprecated since 6.0.0\n *\n * The strength of the blurX property\n * @default 2\n * @see BloomFilter#strengthX\n */\n get blurX(): number\n {\n deprecation('6.0.0', 'BloomFilter.blurX is deprecated, please use BloomFilter.strengthX instead');\n\n return this.strengthX;\n }\n set blurX(value: number)\n {\n deprecation('6.0.0', 'BloomFilter.blurX is deprecated, please use BloomFilter.strengthX instead');\n\n this.strengthX = value;\n }\n\n /**\n * @deprecated since 6.0.0\n *\n * The strength of the blurY property\n * @default 2\n * @see BloomFilter#strengthY\n */\n get blurY(): number\n {\n deprecation('6.0.0', 'BloomFilter.blurY is deprecated, please use BloomFilter.strengthY instead');\n\n return this.strengthY;\n }\n set blurY(value: number)\n {\n deprecation('6.0.0', 'BloomFilter.blurY is deprecated, please use BloomFilter.strengthY instead');\n\n this.strengthY = value;\n }\n}\n","import { Filter, GlProgram, GpuProgram } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './bulge-pinch.frag';\nimport source from './bulge-pinch.wgsl';\n\nimport type { FilterSystem, PointData, RenderSurface, Texture } from 'pixi.js';\n\n// This WebGPU filter has been ported from the WebGL renderer that was originally created by Julien CLEREL (@JuloxRox)\n\n/** Options for the BulgePinchFilter constructor. */\nexport interface BulgePinchFilterOptions\n{\n /**\n * Offset coordinates to change the position of the center of the circle of effect.\n * @default {x:0,y:0}\n */\n center?: PointData | number[] | number;\n /**\n * The radius of the circle of effect\n * @default 100\n */\n radius?: number;\n /**\n * A value between -1 and 1 (-1 is strong pinch, 0 is no effect, 1 is strong bulge)\n * @default 1\n */\n strength?: number;\n}\n\n/**\n * Bulges or pinches the image in a circle.
\n * ![original](../screenshots/original.png)![filter](../screenshots/bulge-pinch.gif)\n *\n * @class\n * @extends Filter\n */\nexport class BulgePinchFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: BulgePinchFilterOptions = {\n center: { x: 0.5, y: 0.5 },\n radius: 100,\n strength: 1\n };\n\n public uniforms: {\n uDimensions: Float32Array;\n uCenter: PointData;\n uRadius: number;\n uStrength: number;\n };\n\n /**\n * @param options - Options for the BulgePinchFilter constructor.\n */\n constructor(options?: BulgePinchFilterOptions)\n {\n options = { ...BulgePinchFilter.DEFAULT_OPTIONS, ...options };\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'bulge-pinch-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n bulgePinchUniforms: {\n uDimensions: { value: [0, 0], type: 'vec2' },\n uCenter: { value: options.center, type: 'vec2' },\n uRadius: { value: options.radius, type: 'f32' },\n uStrength: { value: options.strength, type: 'f32' },\n }\n },\n });\n\n this.uniforms = this.resources.bulgePinchUniforms.uniforms;\n\n Object.assign(this, options);\n }\n\n /**\n * Override existing apply method in `Filter`\n * @override\n * @ignore\n */\n public apply(\n filterManager: FilterSystem,\n input: Texture,\n output: RenderSurface,\n clearMode: boolean\n ): void\n {\n this.uniforms.uDimensions[0] = input.frame.width;\n this.uniforms.uDimensions[1] = input.frame.height;\n\n filterManager.applyFilter(this, input, output, clearMode);\n }\n\n /**\n * Sets the center of the effect in normalized screen coords.\n * { x: 0, y: 0 } means top-left and { x: 1, y: 1 } mean bottom-right\n * @default {x:0.5,y:0.5}\n */\n get center(): PointData { return this.uniforms.uCenter; }\n set center(value: PointData | number[] | number)\n {\n if (typeof value === 'number')\n {\n value = { x: value, y: value };\n }\n\n if (Array.isArray(value))\n {\n value = { x: value[0], y: value[1] };\n }\n\n this.uniforms.uCenter = value;\n }\n\n /**\n * Sets the center of the effect in normalized screen coords on the `x` axis\n * @default 0\n */\n get centerX(): number { return this.uniforms.uCenter.x; }\n set centerX(value: number) { this.uniforms.uCenter.x = value; }\n\n /**\n * Sets the center of the effect in normalized screen coords on the `y` axis\n * @default 0\n */\n get centerY(): number { return this.uniforms.uCenter.y; }\n set centerY(value: number) { this.uniforms.uCenter.y = value; }\n\n /**\n * The radius of the circle of effect\n * @default 100\n */\n get radius(): number { return this.uniforms.uRadius; }\n set radius(value: number) { this.uniforms.uRadius = value; }\n\n /**\n * A value between -1 and 1 (-1 is strong pinch, 0 is no effect, 1 is strong bulge)\n * @default 1\n */\n get strength(): number { return this.uniforms.uStrength; }\n set strength(value: number) { this.uniforms.uStrength = value; }\n}\n","// Copyright (c) 2014 Rafael Caricio. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nvar GradientParser = (GradientParser || {});\n\nGradientParser.stringify = (function() {\n\n var visitor = {\n\n 'visit_linear-gradient': function(node) {\n return visitor.visit_gradient(node);\n },\n\n 'visit_repeating-linear-gradient': function(node) {\n return visitor.visit_gradient(node);\n },\n\n 'visit_radial-gradient': function(node) {\n return visitor.visit_gradient(node);\n },\n\n 'visit_repeating-radial-gradient': function(node) {\n return visitor.visit_gradient(node);\n },\n\n 'visit_gradient': function(node) {\n var orientation = visitor.visit(node.orientation);\n if (orientation) {\n orientation += ', ';\n }\n\n return node.type + '(' + orientation + visitor.visit(node.colorStops) + ')';\n },\n\n 'visit_shape': function(node) {\n var result = node.value,\n at = visitor.visit(node.at),\n style = visitor.visit(node.style);\n\n if (style) {\n result += ' ' + style;\n }\n\n if (at) {\n result += ' at ' + at;\n }\n\n return result;\n },\n\n 'visit_default-radial': function(node) {\n var result = '',\n at = visitor.visit(node.at);\n\n if (at) {\n result += at;\n }\n return result;\n },\n\n 'visit_extent-keyword': function(node) {\n var result = node.value,\n at = visitor.visit(node.at);\n\n if (at) {\n result += ' at ' + at;\n }\n\n return result;\n },\n\n 'visit_position-keyword': function(node) {\n return node.value;\n },\n\n 'visit_position': function(node) {\n return visitor.visit(node.value.x) + ' ' + visitor.visit(node.value.y);\n },\n\n 'visit_%': function(node) {\n return node.value + '%';\n },\n\n 'visit_em': function(node) {\n return node.value + 'em';\n },\n\n 'visit_px': function(node) {\n return node.value + 'px';\n },\n\n 'visit_literal': function(node) {\n return visitor.visit_color(node.value, node);\n },\n\n 'visit_hex': function(node) {\n return visitor.visit_color('#' + node.value, node);\n },\n\n 'visit_rgb': function(node) {\n return visitor.visit_color('rgb(' + node.value.join(', ') + ')', node);\n },\n\n 'visit_rgba': function(node) {\n return visitor.visit_color('rgba(' + node.value.join(', ') + ')', node);\n },\n\n 'visit_color': function(resultColor, node) {\n var result = resultColor,\n length = visitor.visit(node.length);\n\n if (length) {\n result += ' ' + length;\n }\n return result;\n },\n\n 'visit_angular': function(node) {\n return node.value + 'deg';\n },\n\n 'visit_directional': function(node) {\n return 'to ' + node.value;\n },\n\n 'visit_array': function(elements) {\n var result = '',\n size = elements.length;\n\n elements.forEach(function(element, i) {\n result += visitor.visit(element);\n if (i < size - 1) {\n result += ', ';\n }\n });\n\n return result;\n },\n\n 'visit': function(element) {\n if (!element) {\n return '';\n }\n var result = '';\n\n if (element instanceof Array) {\n return visitor.visit_array(element, result);\n } else if (element.type) {\n var nodeVisitor = visitor['visit_' + element.type];\n if (nodeVisitor) {\n return nodeVisitor(element);\n } else {\n throw Error('Missing visitor visit_' + element.type);\n }\n } else {\n throw Error('Invalid node.');\n }\n }\n\n };\n\n return function(root) {\n return visitor.visit(root);\n };\n})();\n\n// Copyright (c) 2014 Rafael Caricio. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nvar GradientParser = (GradientParser || {});\n\nGradientParser.parse = (function() {\n\n var tokens = {\n linearGradient: /^(\\-(webkit|o|ms|moz)\\-)?(linear\\-gradient)/i,\n repeatingLinearGradient: /^(\\-(webkit|o|ms|moz)\\-)?(repeating\\-linear\\-gradient)/i,\n radialGradient: /^(\\-(webkit|o|ms|moz)\\-)?(radial\\-gradient)/i,\n repeatingRadialGradient: /^(\\-(webkit|o|ms|moz)\\-)?(repeating\\-radial\\-gradient)/i,\n sideOrCorner: /^to (left (top|bottom)|right (top|bottom)|left|right|top|bottom)/i,\n extentKeywords: /^(closest\\-side|closest\\-corner|farthest\\-side|farthest\\-corner|contain|cover)/,\n positionKeywords: /^(left|center|right|top|bottom)/i,\n pixelValue: /^(-?(([0-9]*\\.[0-9]+)|([0-9]+\\.?)))px/,\n percentageValue: /^(-?(([0-9]*\\.[0-9]+)|([0-9]+\\.?)))\\%/,\n emValue: /^(-?(([0-9]*\\.[0-9]+)|([0-9]+\\.?)))em/,\n angleValue: /^(-?(([0-9]*\\.[0-9]+)|([0-9]+\\.?)))deg/,\n startCall: /^\\(/,\n endCall: /^\\)/,\n comma: /^,/,\n hexColor: /^\\#([0-9a-fA-F]+)/,\n literalColor: /^([a-zA-Z]+)/,\n rgbColor: /^rgb/i,\n rgbaColor: /^rgba/i,\n number: /^(([0-9]*\\.[0-9]+)|([0-9]+\\.?))/\n };\n\n var input = '';\n\n function error(msg) {\n var err = new Error(input + ': ' + msg);\n err.source = input;\n throw err;\n }\n\n function getAST() {\n var ast = matchListDefinitions();\n\n if (input.length > 0) {\n error('Invalid input not EOF');\n }\n\n return ast;\n }\n\n function matchListDefinitions() {\n return matchListing(matchDefinition);\n }\n\n function matchDefinition() {\n return matchGradient(\n 'linear-gradient',\n tokens.linearGradient,\n matchLinearOrientation) ||\n\n matchGradient(\n 'repeating-linear-gradient',\n tokens.repeatingLinearGradient,\n matchLinearOrientation) ||\n\n matchGradient(\n 'radial-gradient',\n tokens.radialGradient,\n matchListRadialOrientations) ||\n\n matchGradient(\n 'repeating-radial-gradient',\n tokens.repeatingRadialGradient,\n matchListRadialOrientations);\n }\n\n function matchGradient(gradientType, pattern, orientationMatcher) {\n return matchCall(pattern, function(captures) {\n\n var orientation = orientationMatcher();\n if (orientation) {\n if (!scan(tokens.comma)) {\n error('Missing comma before color stops');\n }\n }\n\n return {\n type: gradientType,\n orientation: orientation,\n colorStops: matchListing(matchColorStop)\n };\n });\n }\n\n function matchCall(pattern, callback) {\n var captures = scan(pattern);\n\n if (captures) {\n if (!scan(tokens.startCall)) {\n error('Missing (');\n }\n\n var result = callback(captures);\n\n if (!scan(tokens.endCall)) {\n error('Missing )');\n }\n\n return result;\n }\n }\n\n function matchLinearOrientation() {\n return matchSideOrCorner() ||\n matchAngle();\n }\n\n function matchSideOrCorner() {\n return match('directional', tokens.sideOrCorner, 1);\n }\n\n function matchAngle() {\n return match('angular', tokens.angleValue, 1);\n }\n\n function matchListRadialOrientations() {\n var radialOrientations,\n radialOrientation = matchRadialOrientation(),\n lookaheadCache;\n\n if (radialOrientation) {\n radialOrientations = [];\n radialOrientations.push(radialOrientation);\n\n lookaheadCache = input;\n if (scan(tokens.comma)) {\n radialOrientation = matchRadialOrientation();\n if (radialOrientation) {\n radialOrientations.push(radialOrientation);\n } else {\n input = lookaheadCache;\n }\n }\n }\n\n return radialOrientations;\n }\n\n function matchRadialOrientation() {\n var radialType = matchCircle() ||\n matchEllipse();\n\n if (radialType) {\n radialType.at = matchAtPosition();\n } else {\n var extent = matchExtentKeyword();\n if (extent) {\n radialType = extent;\n var positionAt = matchAtPosition();\n if (positionAt) {\n radialType.at = positionAt;\n }\n } else {\n var defaultPosition = matchPositioning();\n if (defaultPosition) {\n radialType = {\n type: 'default-radial',\n at: defaultPosition\n };\n }\n }\n }\n\n return radialType;\n }\n\n function matchCircle() {\n var circle = match('shape', /^(circle)/i, 0);\n\n if (circle) {\n circle.style = matchLength() || matchExtentKeyword();\n }\n\n return circle;\n }\n\n function matchEllipse() {\n var ellipse = match('shape', /^(ellipse)/i, 0);\n\n if (ellipse) {\n ellipse.style = matchDistance() || matchExtentKeyword();\n }\n\n return ellipse;\n }\n\n function matchExtentKeyword() {\n return match('extent-keyword', tokens.extentKeywords, 1);\n }\n\n function matchAtPosition() {\n if (match('position', /^at/, 0)) {\n var positioning = matchPositioning();\n\n if (!positioning) {\n error('Missing positioning value');\n }\n\n return positioning;\n }\n }\n\n function matchPositioning() {\n var location = matchCoordinates();\n\n if (location.x || location.y) {\n return {\n type: 'position',\n value: location\n };\n }\n }\n\n function matchCoordinates() {\n return {\n x: matchDistance(),\n y: matchDistance()\n };\n }\n\n function matchListing(matcher) {\n var captures = matcher(),\n result = [];\n\n if (captures) {\n result.push(captures);\n while (scan(tokens.comma)) {\n captures = matcher();\n if (captures) {\n result.push(captures);\n } else {\n error('One extra comma');\n }\n }\n }\n\n return result;\n }\n\n function matchColorStop() {\n var color = matchColor();\n\n if (!color) {\n error('Expected color definition');\n }\n\n color.length = matchDistance();\n return color;\n }\n\n function matchColor() {\n return matchHexColor() ||\n matchRGBAColor() ||\n matchRGBColor() ||\n matchLiteralColor();\n }\n\n function matchLiteralColor() {\n return match('literal', tokens.literalColor, 0);\n }\n\n function matchHexColor() {\n return match('hex', tokens.hexColor, 1);\n }\n\n function matchRGBColor() {\n return matchCall(tokens.rgbColor, function() {\n return {\n type: 'rgb',\n value: matchListing(matchNumber)\n };\n });\n }\n\n function matchRGBAColor() {\n return matchCall(tokens.rgbaColor, function() {\n return {\n type: 'rgba',\n value: matchListing(matchNumber)\n };\n });\n }\n\n function matchNumber() {\n return scan(tokens.number)[1];\n }\n\n function matchDistance() {\n return match('%', tokens.percentageValue, 1) ||\n matchPositionKeyword() ||\n matchLength();\n }\n\n function matchPositionKeyword() {\n return match('position-keyword', tokens.positionKeywords, 1);\n }\n\n function matchLength() {\n return match('px', tokens.pixelValue, 1) ||\n match('em', tokens.emValue, 1);\n }\n\n function match(type, pattern, captureIndex) {\n var captures = scan(pattern);\n if (captures) {\n return {\n type: type,\n value: captures[captureIndex]\n };\n }\n }\n\n function scan(regexp) {\n var captures,\n blankCaptures;\n\n blankCaptures = /^[\\n\\r\\t\\s]+/.exec(input);\n if (blankCaptures) {\n consume(blankCaptures[0].length);\n }\n\n captures = regexp.exec(input);\n if (captures) {\n consume(captures[0].length);\n }\n\n return captures;\n }\n\n function consume(size) {\n input = input.substr(size);\n }\n\n return function(code) {\n input = code.toString();\n return getAST();\n };\n})();\n\nexports.parse = GradientParser.parse;\nexports.stringify = GradientParser.stringify;\n","import {\n AngularNode,\n ColorStop as CssColorStop,\n DefaultRadialNode,\n DirectionalNode,\n ExtentKeywordNode,\n GradientNode,\n parse,\n ShapeNode\n} from 'gradient-parser';\nimport { Color } from 'pixi.js';\nimport { ColorStop } from './ColorGradientFilter';\n\nexport type ParseResult = {\n type: number;\n stops: ColorStop[];\n angle: number;\n};\n\nexport function parseCssGradient(cssGradient: string): ParseResult\n{\n const cssGradientNodes: GradientNode[] = parse(trimCssGradient(cssGradient));\n\n if (cssGradientNodes.length === 0)\n {\n throw new Error('Invalid CSS gradient.');\n }\n else if (cssGradientNodes.length !== 1)\n {\n throw new Error('Unsupported CSS gradient (multiple gradients is not supported).');\n }\n\n const cssGradientNode = cssGradientNodes[0];\n\n const type = typeFromCssType(cssGradientNode.type);\n const stops = stopsFromCssStops(cssGradientNode.colorStops);\n const angle = angleFromCssOrientation(cssGradientNode.orientation);\n\n return {\n type,\n stops,\n angle,\n };\n}\n\nexport function typeFromCssType(type: string): number\n{\n const supportedTypes: { [key: string]: number } = {\n 'linear-gradient': 0,\n 'radial-gradient': 1,\n };\n\n if (!(type in supportedTypes))\n {\n throw new Error(`Unsupported gradient type \"${type}\"`);\n }\n\n return supportedTypes[type];\n}\n\nexport function stopsFromCssStops(stops: CssColorStop[]): ColorStop[]\n{\n const offsets: number[] = offsetsFromCssColorStops(stops);\n const result: ColorStop[] = [];\n const color = new Color();\n\n for (let i = 0; i < stops.length; i++)\n {\n const colorString = colorAsStringFromCssStop(stops[i]);\n const rgbaColor = color.setValue(colorString).toArray();\n\n result.push({\n offset: offsets[i],\n color: rgbaColor.slice(0, 3),\n alpha: rgbaColor[3]\n });\n }\n\n return result;\n}\n\nexport function colorAsStringFromCssStop(stop: CssColorStop): string\n{\n switch (stop.type)\n {\n case 'hex':\n return `#${stop.value}`;\n case 'literal':\n return stop.value;\n default:\n return `${stop.type}(${stop.value.join(',')})`;\n }\n}\n\nexport function offsetsFromCssColorStops(stops: CssColorStop[]): number[]\n{\n const offsets: number[] = [];\n const dynamicOffset = -1;\n\n for (let i = 0; i < stops.length; i++)\n {\n const cssStop = stops[i];\n let stopOffset = dynamicOffset;\n\n if (cssStop.type === 'literal')\n {\n if (cssStop.length && 'type' in cssStop.length && cssStop.length.type === '%' && 'value' in cssStop.length)\n {\n stopOffset = parseFloat(cssStop.length.value) / 100;\n }\n }\n\n offsets.push(stopOffset);\n }\n\n const findNextFixedStop = (fromIndex: number): { indexDelta: number; offset: number; } =>\n {\n for (let k = fromIndex; k < offsets.length; k++)\n {\n if (offsets[k] !== dynamicOffset)\n {\n return {\n indexDelta: k - fromIndex,\n offset: offsets[k]\n };\n }\n }\n\n return {\n indexDelta: (offsets.length - 1) - fromIndex,\n offset: 1.0\n };\n };\n\n let prevFixedOffset = 0;\n\n for (let i = 0; i < offsets.length; i++)\n {\n const offset = offsets[i];\n\n if (offset !== dynamicOffset)\n {\n prevFixedOffset = offset;\n }\n else if (i === 0)\n {\n offsets[i] = 0;\n }\n else if (i + 1 === offsets.length)\n {\n offsets[i] = 1.0;\n }\n else\n {\n const nextFixed = findNextFixedStop(i);\n const offsetDelta = nextFixed.offset - prevFixedOffset;\n const stepSize = offsetDelta / (1 + nextFixed.indexDelta);\n\n for (let s = 0; s <= nextFixed.indexDelta; s++)\n {\n offsets[i + s] = prevFixedOffset + ((s + 1) * stepSize);\n }\n\n i += nextFixed.indexDelta;\n prevFixedOffset = offsets[i];\n }\n }\n\n return offsets.map(fixFloatRounding);\n}\n\n// fixes issues like 0.3 - 0.1 = 0.19999999999999998\nfunction fixFloatRounding(value: number): number\n{\n const maxLength = 6;\n\n if (value.toString().length > maxLength)\n {\n return parseFloat(value.toString().substring(0, maxLength));\n }\n\n return value;\n}\n\ntype CssOrientation = DirectionalNode | AngularNode | (ShapeNode | DefaultRadialNode | ExtentKeywordNode)[] | undefined;\n\nexport function angleFromCssOrientation(orientation: CssOrientation): number\n{\n if (typeof orientation === 'undefined')\n {\n return 0;\n }\n\n if ('type' in orientation && 'value' in orientation)\n {\n switch (orientation.type)\n {\n case 'angular':\n return parseFloat(orientation.value);\n case 'directional':\n return angleFromDirectionalValue(orientation.value);\n }\n }\n\n return 0;\n}\n\nexport function angleFromDirectionalValue(value: string): number\n{\n const supportedValues: { [key: string]: number } = {\n left: 270,\n top: 0,\n bottom: 180,\n right: 90,\n 'left top': 315,\n 'top left': 315,\n 'left bottom': 225,\n 'bottom left': 225,\n 'right top': 45,\n 'top right': 45,\n 'right bottom': 135,\n 'bottom right': 135,\n };\n\n if (!(value in supportedValues))\n {\n throw new Error(`Unsupported directional value \"${value}\"`);\n }\n\n return supportedValues[value];\n}\n\nexport function trimCssGradient(value: string) : string\n{\n let value_ = value.replace(/\\s{2,}/gu, ' ');\n\n value_ = value_.replace(/;/g, '');\n value_ = value_.replace(/ ,/g, ',');\n value_ = value_.replace(/\\( /g, '(');\n value_ = value_.replace(/ \\)/g, ')');\n\n return value_.trim();\n}\n","import { Color, ColorSource, Filter, GlProgram, GpuProgram } from 'pixi.js';\nimport fragment from './color-gradient.frag';\nimport vertex from './color-gradient.vert';\nimport source from './color-gradient.wgsl';\nimport { parseCssGradient } from './CssGradientParser';\n\n/** Color stop object. */\nexport interface ColorStop\n{\n offset: number;\n color: ColorSource;\n alpha: number;\n}\n\n/** Options for ColorGradientFilter constructor. */\nexport interface ColorGradientFilterOptions\n{\n /**\n * Linear = 0, Radial = 1, Conic = 2\n * @default ColorGradientFilter.LINEAR\n */\n type: number;\n /** Collection of stops, must be 2+ */\n stops: ColorStop[];\n /**\n * Angle for linear gradients, in degrees.\n * @default 90\n */\n angle?: number;\n /**\n * Alpha value for the gradient.\n * @default 1\n */\n alpha?: number;\n /**\n * Maximum number of colors to render (0 = no limit)\n * @default 0\n */\n maxColors?: number;\n /**\n * If true, the gradient will replace the existing color, otherwise it will be multiplied with it\n * @default false\n */\n replace?: boolean;\n}\n\n/** Options for CSS-style gradient for use with constructor. */\nexport interface ColorGradientFilterCSSOptions\n{\n /** CSS-style gradient string */\n css: string;\n /**\n * Alpha value for the gradient.\n * @default 1\n */\n alpha?: number;\n /**\n * Maximum number of colors to render (0 = no limit)\n * @default 0\n */\n maxColors?: number;\n}\n\nconst ANGLE_OFFSET = 90; // align degrees with CSS\n\nfunction sortColorStops(stops: ColorStop[]): ColorStop[]\n{\n return [...stops].sort((a, b) => a.offset - b.offset);\n}\n\n/**\n * Render a colored gradient.
\n * ![original](../screenshots/original.png)![filter](../screenshots/color-gradient.png)\n *\n * @class\n * @extends Filter\n */\nexport class ColorGradientFilter extends Filter\n{\n /** Gradient types */\n static readonly LINEAR = 0;\n static readonly RADIAL = 1;\n static readonly CONIC = 2;\n\n /** Default constructor options */\n public static readonly defaults: ColorGradientFilterOptions = {\n type: ColorGradientFilter.LINEAR,\n stops: [\n { offset: 0.0, color: 0xff0000, alpha: 1.0 },\n { offset: 1.0, color: 0x0000ff, alpha: 1.0 },\n ],\n alpha: 1.0,\n angle: 90.0,\n maxColors: 0,\n replace: false,\n };\n\n public baseUniforms: {\n uOptions: Float32Array;\n uCounts: Float32Array;\n };\n\n public stopsUniforms: {\n uColors: Float32Array;\n uStops: Float32Array;\n };\n\n private _stops: ColorStop[] = [];\n\n /**\n * @param options - Options for the ColorGradientFilter constructor.\n */\n constructor(options?: ColorGradientFilterOptions | ColorGradientFilterCSSOptions)\n {\n if (options && 'css' in options)\n {\n options = {\n ...parseCssGradient(options.css || ''),\n alpha: options.alpha ?? ColorGradientFilter.defaults.alpha,\n maxColors: options.maxColors ?? ColorGradientFilter.defaults.maxColors,\n };\n }\n else\n {\n options = { ...ColorGradientFilter.defaults, ...options };\n }\n\n if (!options.stops || options.stops.length < 2)\n {\n throw new Error('ColorGradientFilter requires at least 2 color stops.');\n }\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'color-gradient-filter',\n });\n\n const maxStops = 32;\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n baseUniforms: {\n uOptions: {\n value: [\n // Gradient Type\n options.type,\n // Gradient Angle\n options.angle ?? ANGLE_OFFSET,\n // Master Alpha\n options.alpha,\n // Replace Base Color\n options.replace ? 1 : 0,\n ],\n type: 'vec4',\n },\n uCounts: {\n value: [\n // Number of Stops\n options.stops.length,\n // Max Gradient Colors\n options.maxColors,\n ],\n type: 'vec2',\n },\n },\n stopsUniforms: {\n uColors: { value: new Float32Array(maxStops * 3), type: 'vec3', size: maxStops },\n\n // We only need vec2, but we need to pad to eliminate the WGSL warning, TODO: @Mat ?\n uStops: { value: new Float32Array(maxStops * 4), type: 'vec4', size: maxStops },\n }\n },\n });\n\n this.baseUniforms = this.resources.baseUniforms.uniforms;\n this.stopsUniforms = this.resources.stopsUniforms.uniforms;\n\n Object.assign(this, options);\n }\n\n get stops(): ColorStop[]\n {\n return this._stops;\n }\n\n set stops(stops: ColorStop[])\n {\n const sortedStops = sortColorStops(stops);\n const color = new Color();\n let r;\n let g;\n let b;\n\n for (let i = 0; i < sortedStops.length; i++)\n {\n color.setValue(sortedStops[i].color);\n const indexStart = i * 3;\n\n [r, g, b] = color.toArray();\n this.stopsUniforms.uColors[indexStart] = r;\n this.stopsUniforms.uColors[indexStart + 1] = g;\n this.stopsUniforms.uColors[indexStart + 2] = b;\n\n this.stopsUniforms.uStops[i * 4] = sortedStops[i].offset;\n this.stopsUniforms.uStops[(i * 4) + 1] = sortedStops[i].alpha;\n }\n\n this.baseUniforms.uCounts[0] = sortedStops.length;\n this._stops = sortedStops;\n }\n\n /**\n * The type of gradient\n * @default ColorGradientFilter.LINEAR\n */\n get type(): number { return this.baseUniforms.uOptions[0]; }\n set type(value: number) { this.baseUniforms.uOptions[0] = value; }\n\n /**\n * The angle of the gradient in degrees\n * @default 90\n */\n get angle(): number { return this.baseUniforms.uOptions[1] + ANGLE_OFFSET; }\n set angle(value: number) { this.baseUniforms.uOptions[1] = value - ANGLE_OFFSET; }\n\n /**\n * The alpha value of the gradient (0-1)\n * @default 1\n */\n get alpha(): number { return this.baseUniforms.uOptions[2]; }\n set alpha(value: number) { this.baseUniforms.uOptions[2] = value; }\n\n /**\n * The maximum number of colors to render (0 = no limit)\n * @default 0\n */\n get maxColors(): number { return this.baseUniforms.uCounts[1]; }\n set maxColors(value: number) { this.baseUniforms.uCounts[1] = value; }\n\n /**\n * If true, the gradient will replace the existing color, otherwise it\n * will be multiplied with it\n * @default false\n */\n get replace(): boolean { return this.baseUniforms.uOptions[3] > 0.5; }\n set replace(value: boolean) { this.baseUniforms.uOptions[3] = value ? 1 : 0; }\n}\n\n","import { deprecation, Filter, GlProgram, GpuProgram, SCALE_MODE, Texture, TextureSource } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './color-map.frag';\nimport source from './color-map.wgsl';\n\ntype ColorMapTexture = TextureSource | Texture;\n\n/** Options for the ColorMapFilter constructor. */\nexport interface ColorMapFilterOptions\n{\n /** The colorMap texture of the filter. */\n colorMap: ColorMapTexture;\n /**\n * The mix from 0 to 1, where 0 is the original image and 1 is the color mapped image.\n * @default 1\n */\n mix?: number;\n /**\n * Whether use NEAREST scale mode for `colorMap` texture.\n * @default false\n */\n nearest?: boolean;\n}\n\n/**\n * The ColorMapFilter applies a color-map effect to an object.
\n * ![original](../screenshots/original.png)![filter](../screenshots/color-map.png)\n *\n * @class\n * @extends Filter\n */\nexport class ColorMapFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: ColorMapFilterOptions = {\n colorMap: Texture.WHITE,\n nearest: false,\n mix: 1\n };\n\n public uniforms: {\n uMix: number;\n uSize: number;\n uSliceSize: number;\n uSlicePixelSize: number;\n uSliceInnerSize: number;\n };\n\n private _size = 0;\n private _sliceSize = 0;\n private _slicePixelSize = 0;\n private _sliceInnerSize = 0;\n private _nearest = false;\n private _scaleMode: SCALE_MODE = 'linear';\n private _colorMap!: ColorMapTexture;\n\n /**\n * @param options - Options for the ColorMapFilter constructor.\n */\n constructor(options: ColorMapFilterOptions);\n /**\n * @deprecated since 6.0.0\n *\n * @param {HTMLImageElement|HTMLCanvasElement|PIXI.BaseTexture|PIXI.Texture} [colorMap] - The\n * colorMap texture of the filter.\n * @param {boolean} [nearest=false] - Whether use NEAREST for colorMap texture.\n * @param {number} [mix=1] - The mix from 0 to 1, where 0 is the original image and 1 is the color mapped image.\n */\n constructor(colorMap: ColorMapTexture, nearest?: boolean, mix?: number);\n /** @ignore */\n constructor(...args: [ColorMapFilterOptions] | [ColorMapTexture, boolean?, number?])\n {\n let options = args[0] ?? {};\n\n if (options instanceof Texture || options instanceof TextureSource)\n {\n // eslint-disable-next-line max-len\n deprecation('6.0.0', 'ColorMapFilter constructor params are now options object. See params: { colorMap, nearest, mix }');\n\n options = { colorMap: options };\n\n if (args[1] !== undefined) options.nearest = args[1];\n if (args[2] !== undefined) options.mix = args[2];\n }\n\n options = { ...ColorMapFilter.DEFAULT_OPTIONS, ...options };\n\n if (!options.colorMap) throw Error('No color map texture source was provided to ColorMapFilter');\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'color-map-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n colorMapUniforms: {\n uMix: { value: options.mix, type: 'f32' },\n uSize: { value: 0, type: 'f32' },\n uSliceSize: { value: 0, type: 'f32' },\n uSlicePixelSize: { value: 0, type: 'f32' },\n uSliceInnerSize: { value: 0, type: 'f32' },\n },\n uMapTexture: options.colorMap.source,\n uMapSampler: options.colorMap.source.style,\n },\n });\n\n this.uniforms = this.resources.colorMapUniforms.uniforms;\n\n Object.assign(this, options);\n }\n\n /** The mix from 0 to 1, where 0 is the original image and 1 is the color mapped image. */\n get mix(): number { return this.uniforms.uMix; }\n set mix(value: number) { this.uniforms.uMix = value; }\n\n /**\n * The size of one color slice.\n * @readonly\n */\n get colorSize(): number { return this._size; }\n\n /** The colorMap texture. */\n get colorMap(): ColorMapTexture { return this._colorMap; }\n set colorMap(value: ColorMapTexture)\n {\n if (!value || value === this.colorMap) return;\n\n const source = value instanceof Texture ? value.source : value;\n\n source.style.scaleMode = this._scaleMode;\n source.autoGenerateMipmaps = false;\n\n this._size = source.height;\n this._sliceSize = 1 / this._size;\n this._slicePixelSize = this._sliceSize / this._size;\n this._sliceInnerSize = this._slicePixelSize * (this._size - 1);\n\n this.uniforms.uSize = this._size;\n this.uniforms.uSliceSize = this._sliceSize;\n this.uniforms.uSlicePixelSize = this._slicePixelSize;\n this.uniforms.uSliceInnerSize = this._sliceInnerSize;\n\n this.resources.uMapTexture = source;\n this._colorMap = value;\n }\n\n /** Whether use NEAREST for colorMap texture. */\n get nearest(): boolean { return this._nearest; }\n set nearest(nearest: boolean)\n {\n this._nearest = nearest;\n this._scaleMode = nearest ? 'nearest' : 'linear';\n\n const texture = this._colorMap;\n\n if (texture && texture.source)\n {\n texture.source.scaleMode = this._scaleMode;\n texture.source.autoGenerateMipmaps = false;\n texture.source.style.update();\n texture.source.update();\n }\n }\n\n /**\n * If the colorMap is based on canvas,\n * and the content of canvas has changed, then call `updateColorMap` for update texture.\n */\n updateColorMap(): void\n {\n const texture = this._colorMap;\n\n if (texture?.source)\n {\n texture.source.update();\n this.colorMap = texture;\n }\n }\n\n /**\n * Destroys this filter\n * @default false\n */\n destroy(): void\n {\n this._colorMap?.destroy(/** true | TODO: Should base texture be destroyed? **/);\n super.destroy();\n }\n}\n","import { Color, ColorSource, deprecation, Filter, GlProgram, GpuProgram } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './color-overlay.frag';\nimport source from './color-overlay.wgsl';\n\ntype DeprecatedColor = number | number[] | Float32Array;\n\n/** Options for the ColorOverlayFilter constructor. */\nexport interface ColorOverlayFilterOptions\n{\n /**\n * The color of the overlay\n * @default 0x000000\n */\n color?: ColorSource;\n /**\n * The alpha of the overlay\n * @default 1\n */\n alpha?: number;\n}\n\n/**\n * Overlay a source graphic with a color.
\n *\n * @class\n * @extends Filter\n */\nexport class ColorOverlayFilter extends Filter\n{\n /** Default shockwave filter options */\n public static readonly DEFAULT_OPTIONS: ColorOverlayFilterOptions = {\n /** The color of the overlay */\n color: 0x000000,\n /** The alpha of the overlay */\n alpha: 1,\n };\n\n public uniforms: {\n uColor: Float32Array;\n uAlpha: number;\n };\n\n private _color: Color;\n\n /**\n * @param options - Options for the ColorOverlayFilter constructor.\n */\n constructor(options?: ColorOverlayFilterOptions);\n /**\n * @deprecated since 6.0.0\n *\n * @param {number|Array} [color=0x000000] - The resulting color, as a 3 component RGB e.g. [1.0, 0.5, 1.0]\n * @param {number} [alpha=1] - The alpha value of the color\n */\n constructor(color?: DeprecatedColor, alpha?: number);\n /** @ignore */\n constructor(...args: [ColorOverlayFilterOptions?] | [DeprecatedColor?, number?])\n {\n let options = args[0] ?? {};\n\n if (typeof options === 'number' || Array.isArray(options) || options instanceof Float32Array)\n {\n // eslint-disable-next-line max-len\n deprecation('6.0.0', 'ColorOverlayFilter constructor params are now options object. See params: { color, alpha }');\n\n options = { color: options };\n\n if (args[1] !== undefined) options.alpha = args[1];\n }\n\n options = { ...ColorOverlayFilter.DEFAULT_OPTIONS, ...options };\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'color-overlay-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n colorOverlayUniforms: {\n uColor: { value: new Float32Array(3), type: 'vec3' },\n uAlpha: { value: options.alpha, type: 'f32' },\n },\n },\n });\n\n this.uniforms = this.resources.colorOverlayUniforms.uniforms;\n\n this._color = new Color();\n this.color = options.color ?? 0x000000;\n }\n\n /**\n * The over color source\n * @member {number|Array|Float32Array}\n * @default 0x000000\n */\n get color(): ColorSource { return this._color.value as ColorSource; }\n set color(value: ColorSource)\n {\n this._color.setValue(value);\n const [r, g, b] = this._color.toArray();\n\n this.uniforms.uColor[0] = r;\n this.uniforms.uColor[1] = g;\n this.uniforms.uColor[2] = b;\n }\n\n /**\n * The alpha value of the color\n * @default 1\n */\n get alpha(): number { return this.uniforms.uAlpha; }\n set alpha(value: number) { this.uniforms.uAlpha = value; }\n}\n","import { Color, ColorSource, deprecation, Filter, GlProgram, GpuProgram } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './color-replace.frag';\nimport source from './color-replace.wgsl';\n\n/**\n * This WebGPU filter has been ported from the WebGL renderer that was originally created by mishaa, updated by timetocode\n * http://www.html5gamedevs.com/topic/10640-outline-a-sprite-change-certain-colors/?p=69966\n */\n\ntype DeprecatedColor = number | number[] | Float32Array;\n\n/** Options for the ColorReplaceFilter constructor. */\nexport interface ColorReplaceFilterOptions\n{\n /**\n * The color that will be changed.\n * @example [1.0, 1.0, 1.0] = 0xffffff\n * @default 0xff0000\n */\n originalColor?: ColorSource;\n /**\n * The resulting color.\n * @example [1.0, 1.0, 1.0] = 0xffffff\n * @default 0x000000\n */\n targetColor?: ColorSource;\n /**\n * Tolerance/sensitivity of the floating-point comparison between colors (lower = more exact, higher = more inclusive)\n * @default 0.4\n */\n tolerance?: number;\n}\n\n/**\n * ColorReplaceFilter, originally by mishaa, updated by timetocode\n * http://www.html5gamedevs.com/topic/10640-outline-a-sprite-change-certain-colors/?p=69966
\n * ![original](../screenshots/original.png)![filter](../screenshots/color-replace.png)\n *\n * @class\n * @extends Filter\n *\n * @example\n * // replaces true red with true blue\n * someSprite.filters = [new ColorReplaceFilter({\n * originalColor: [1, 0, 0],\n * targetColor: [0, 0, 1],\n * tolerance: 0.001\n * })];\n * // replaces the RGB color 220, 220, 220 with the RGB color 225, 200, 215\n * someOtherSprite.filters = [new ColorReplaceFilter({\n * originalColor: [220/255.0, 220/255.0, 220/255.0],\n * targetColor: [225/255.0, 200/255.0, 215/255.0],\n * tolerance: 0.001\n * })];\n * // replaces the RGB color 220, 220, 220 with the RGB color 225, 200, 215\n * someOtherSprite.filters = [new ColorReplaceFilter({ originalColor: 0xdcdcdc, targetColor: 0xe1c8d7, tolerance: 0.001 })];\n *\n */\nexport class ColorReplaceFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: ColorReplaceFilterOptions = {\n originalColor: 0xff0000,\n targetColor: 0x000000,\n tolerance: 0.4\n };\n\n public uniforms: {\n uOriginalColor: Float32Array,\n uTargetColor: Float32Array,\n uTolerance: number,\n };\n\n private _originalColor: Color;\n private _targetColor: Color;\n\n /**\n * @param options - Options for the ColorReplaceFilter constructor.\n */\n constructor(options?: ColorReplaceFilterOptions);\n /**\n * @deprecated since 6.0.0\n *\n * @param {number|Array|Float32Array} [originalColor=0xFF0000] - The color that will be changed,\n * as a 3 component RGB e.g. `[1.0, 1.0, 1.0]`\n * @param {number|Array|Float32Array} [newColor=0x000000] - The resulting color, as a 3 component\n * RGB e.g. `[1.0, 0.5, 1.0]`\n * @param {number} [epsilon=0.4] - Tolerance/sensitivity of the floating-point comparison between colors\n * (lower = more exact, higher = more inclusive)\n */\n constructor(originalColor?: number, newColor?: number, epsilon?: number);\n /** @ignore */\n constructor(...args: [ColorReplaceFilterOptions?] | [DeprecatedColor?, DeprecatedColor?, number?])\n {\n let options = args[0] ?? {};\n\n if (typeof options === 'number' || Array.isArray(options) || options instanceof Float32Array)\n {\n // eslint-disable-next-line max-len\n deprecation('6.0.0', 'ColorReplaceFilter constructor params are now options object. See params: { originalColor, targetColor, tolerance }');\n\n options = { originalColor: options };\n\n if (args[1] !== undefined) options.targetColor = args[1];\n if (args[2] !== undefined) options.tolerance = args[2];\n }\n\n options = { ...ColorReplaceFilter.DEFAULT_OPTIONS, ...options };\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'color-replace-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n colorReplaceUniforms: {\n uOriginalColor: { value: new Float32Array(3), type: 'vec3' },\n uTargetColor: { value: new Float32Array(3), type: 'vec3' },\n uTolerance: { value: options.tolerance, type: 'f32' },\n }\n },\n });\n\n this.uniforms = this.resources.colorReplaceUniforms.uniforms;\n\n this._originalColor = new Color();\n this._targetColor = new Color();\n this.originalColor = options.originalColor ?? 0xff0000;\n this.targetColor = options.targetColor ?? 0x000000;\n\n Object.assign(this, options);\n }\n\n /**\n * The color that will be changed.\n * @example [1.0, 1.0, 1.0] = 0xffffff\n * @default 0xff0000\n */\n get originalColor(): ColorSource { return this._originalColor.value as ColorSource; }\n set originalColor(value: ColorSource)\n {\n this._originalColor.setValue(value);\n const [r, g, b] = this._originalColor.toArray();\n\n this.uniforms.uOriginalColor[0] = r;\n this.uniforms.uOriginalColor[1] = g;\n this.uniforms.uOriginalColor[2] = b;\n }\n\n /**\n * The resulting color.\n * @example [1.0, 1.0, 1.0] = 0xffffff\n * @default 0x000000\n */\n get targetColor(): ColorSource { return this._targetColor.value as ColorSource; }\n set targetColor(value: ColorSource)\n {\n this._targetColor.setValue(value);\n const [r, g, b] = this._targetColor.toArray();\n\n this.uniforms.uTargetColor[0] = r;\n this.uniforms.uTargetColor[1] = g;\n this.uniforms.uTargetColor[2] = b;\n }\n\n /**\n * Tolerance/sensitivity of the floating-point comparison between colors (lower = more exact, higher = more inclusive)\n * @default 0.4\n */\n get tolerance(): number { return this.uniforms.uTolerance; }\n set tolerance(value: number) { this.uniforms.uTolerance = value; }\n\n /**\n * @deprecated since 6.0.0\n *\n * The resulting color, as a 3 component RGB e.g. [1.0, 0.5, 1.0]\n * @member {number|Array|Float32Array}\n * @default 0x000000\n * @see ColorReplaceFilter#targetColor\n */\n set newColor(value: DeprecatedColor)\n {\n deprecation('6.0.0', 'ColorReplaceFilter.newColor is deprecated, please use ColorReplaceFilter.targetColor instead');\n\n this.targetColor = value;\n }\n get newColor(): DeprecatedColor\n {\n deprecation('6.0.0', 'ColorReplaceFilter.newColor is deprecated, please use ColorReplaceFilter.targetColor instead');\n\n return this.targetColor as DeprecatedColor;\n }\n\n /**\n * @deprecated since 6.0.0\n *\n * Tolerance/sensitivity of the floating-point comparison between colors (lower = more exact, higher = more inclusive)\n * @default 0.4\n * @see ColorReplaceFilter#tolerance\n */\n set epsilon(value: number)\n {\n deprecation('6.0.0', 'ColorReplaceFilter.epsilon is deprecated, please use ColorReplaceFilter.tolerance instead');\n\n this.tolerance = value;\n }\n get epsilon(): number\n {\n deprecation('6.0.0', 'ColorReplaceFilter.epsilon is deprecated, please use ColorReplaceFilter.tolerance instead');\n\n return this.tolerance;\n }\n}\n","import { deprecation, Filter, GlProgram, GpuProgram, PointData } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './convolution.frag';\nimport source from './convolution.wgsl';\n\ntype FixedArray = [ T, ...Array ] & { length: L };\n\nexport type ConvolutionMatrix = Float32Array | FixedArray;\n\n/** Options for the ConvolutionFilter constructor. */\nexport interface ConvolutionFilterOptions\n{\n /**\n * An array of values used for matrix transformation, specified as a 9 point Array\n * @example\n * const matrix = new Float32Array(9); // 9 elements of value 0\n * const matrix = [0,0.5,0,0.5,1,0.5,0,0.5,0];\n * @default [0,0,0,0,0,0,0,0,0]\n */\n matrix?: ConvolutionMatrix;\n /**\n * Width of the object you are transforming\n * @default 200\n */\n width?: number;\n /**\n * Height of the object you are transforming\n * @default 200\n */\n height?: number;\n}\n\n/**\n * The ConvolutionFilter class applies a matrix convolution filter effect.\n * A convolution combines pixels in the input image with neighboring pixels to produce a new image.\n * A wide variety of image effects can be achieved through convolutions, including blurring, edge\n * detection, sharpening, embossing, and beveling. The matrix should be specified as a 9 point Array.\n * See https://docs.gimp.org/2.10/en/gimp-filter-convolution-matrix.html for more info.
\n * ![original](../screenshots/original.png)![filter](../screenshots/convolution.png)\n *\n * @class\n * @extends Filter\n */\nexport class ConvolutionFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: ConvolutionFilterOptions = {\n matrix: new Float32Array(9),\n width: 200,\n height: 200,\n };\n\n public uniforms: {\n uMatrix: ConvolutionMatrix;\n uTexelSize: PointData;\n };\n\n /**\n * @param options - Options for the ConvolutionFilter constructor.\n */\n constructor(options?: ConvolutionFilterOptions);\n /**\n * @deprecated since 6.0.0\n *\n * @param {number[]} [matrix=[0,0,0,0,0,0,0,0,0]] - An array of values used for matrix transformation.\n * Specified as a 9 point Array.\n * @param {number} [width=200] - Width of the object you are transforming\n * @param {number} [height=200] - Height of the object you are transforming\n */\n constructor(matrix: number[], width?: number, height?: number);\n /** @ignore */\n constructor(...args: [ConvolutionFilterOptions?] | [number[], number?, number?])\n {\n let options = args[0] ?? {};\n\n if (Array.isArray(options))\n {\n // eslint-disable-next-line max-len\n deprecation('6.0.0', 'ConvolutionFilter constructor params are now options object. See params: { matrix, width, height }');\n\n options = { matrix: options as ConvolutionMatrix };\n\n if (args[1] !== undefined) options.width = args[1];\n if (args[2] !== undefined) options.height = args[2];\n }\n\n options = { ...ConvolutionFilter.DEFAULT_OPTIONS, ...options };\n\n const width = options.width ?? 200;\n const height = options.height ?? 200;\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'convolution-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n convolutionUniforms: {\n uMatrix: { value: options.matrix, type: 'mat3x3' },\n uTexelSize: { value: { x: 1 / width, y: 1 / height }, type: 'vec2' },\n },\n },\n });\n\n this.uniforms = this.resources.convolutionUniforms.uniforms;\n\n this.width = width;\n this.height = height;\n }\n\n /**\n * An array of values used for matrix transformation, specified as a 9 point Array\n * @example\n * const matrix = new Float32Array(9); // 9 elements of value 0\n * const matrix = [0,0.5,0,0.5,1,0.5,0,0.5,0];\n * @default [0,0,0,0,0,0,0,0,0]\n */\n get matrix(): ConvolutionMatrix { return this.uniforms.uMatrix; }\n set matrix(matrix: ConvolutionMatrix)\n {\n matrix.forEach((v, i) =>\n {\n this.uniforms.uMatrix[i] = v;\n });\n }\n\n /**\n * Width of the object you are transforming\n * @default 200\n */\n get width(): number { return 1 / this.uniforms.uTexelSize.x; }\n set width(value: number) { this.uniforms.uTexelSize.x = 1 / value; }\n\n /**\n * Height of the object you are transforming\n * @default 200\n */\n get height(): number { return 1 / this.uniforms.uTexelSize.y; }\n set height(value: number) { this.uniforms.uTexelSize.y = 1 / value; }\n}\n","import { Filter, GlProgram, GpuProgram } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './crosshatch.frag';\nimport source from './crosshatch.wgsl';\n\n/**\n * A Cross Hatch effect filter.
\n * ![original](../screenshots/original.png)![filter](../screenshots/cross-hatch.png)\n *\n * @class\n * @extends Filter\n */\nexport class CrossHatchFilter extends Filter\n{\n constructor()\n {\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'cross-hatch-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {},\n });\n }\n}\n","import { Filter, GlProgram, GpuProgram } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './crt.frag';\nimport source from './crt.wgsl';\n\nimport type { FilterSystem, RenderSurface, Texture } from 'pixi.js';\n\n/** Options for the CRTFilter constructor. */\nexport interface CRTFilterOptions\n{\n /**\n * Bend of interlaced lines, higher value means more bend\n * @default 1\n */\n curvature?: number,\n /**\n * Width of the interlaced lines\n * @default 1\n */\n lineWidth?: number,\n /**\n * Contrast of interlaced lines\n * @default 0.25\n */\n lineContrast?: number,\n /**\n * The orientation of the line:\n *\n * `true` create vertical lines, `false` creates horizontal lines\n * @default false\n */\n verticalLine?: boolean,\n /**\n * For animating interlaced lines\n * @default 0\n */\n time?: number,\n /**\n * Opacity/intensity of the noise effect between `0` and `1`\n * @default 0.3\n */\n noise?: number,\n /**\n * The size of the noise particles\n * @default 1\n */\n noiseSize?: number,\n /**\n * A seed value to apply to the random noise generation\n * @default 0\n */\n seed?: number,\n /**\n * The radius of the vignette effect, smaller values produces a smaller vignette\n * @default 0.3\n */\n vignetting?: number,\n /**\n * Amount of opacity on the vignette\n * @default 1\n */\n vignettingAlpha?: number,\n /**\n * Blur intensity of the vignette\n * @default 0.3\n */\n vignettingBlur?: number,\n}\n\n/**\n * The CRTFilter applies a CRT effect to an object.
\n * ![original](../screenshots/original.png)![filter](../screenshots/crt.png)\n *\n * @class\n * @extends Filter\n */\nexport class CRTFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: CRTFilterOptions = {\n curvature: 1.0,\n lineWidth: 1.0,\n lineContrast: 0.25,\n verticalLine: false,\n noise: 0.0,\n noiseSize: 1.0,\n vignetting: 0.3,\n vignettingAlpha: 1.0,\n vignettingBlur: 0.3,\n time: 0.0,\n seed: 0.0,\n };\n\n public uniforms: {\n uLine: Float32Array;\n uNoise: Float32Array;\n uVignette: Float32Array;\n uSeed: number;\n uTime: number;\n uDimensions: Float32Array;\n };\n\n /**\n * A seed value to apply to the random noise generation\n * @default 0\n */\n public seed!: number;\n\n /**\n * Opacity/intensity of the noise effect between `0` and `1`\n * @default 0.3\n */\n public time!: number;\n\n /**\n * @param options - Options for the CRTFilter constructor.\n */\n constructor(options?: CRTFilterOptions)\n {\n options = { ...CRTFilter.DEFAULT_OPTIONS, ...options };\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'crt-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n crtUniforms: {\n uLine: { value: new Float32Array(4), type: 'vec4' },\n uNoise: { value: new Float32Array(2), type: 'vec2' },\n uVignette: { value: new Float32Array(3), type: 'vec3' },\n uSeed: { value: options.seed, type: 'f32' },\n uTime: { value: options.time, type: 'f32' },\n uDimensions: { value: new Float32Array(2), type: 'vec2' },\n }\n },\n });\n\n this.uniforms = this.resources.crtUniforms.uniforms;\n\n Object.assign(this, options);\n }\n\n /**\n * Override existing apply method in `Filter`\n * @override\n * @ignore\n */\n public override apply(\n filterManager: FilterSystem,\n input: Texture,\n output: RenderSurface,\n clearMode: boolean\n ): void\n {\n this.uniforms.uDimensions[0] = input.frame.width;\n this.uniforms.uDimensions[1] = input.frame.height;\n\n this.uniforms.uSeed = this.seed;\n this.uniforms.uTime = this.time;\n\n filterManager.applyFilter(this, input, output, clearMode);\n }\n\n /**\n * Bend of interlaced lines, higher value means more bend\n * @default 1\n */\n get curvature(): number { return this.uniforms.uLine[0]; }\n set curvature(value: number) { this.uniforms.uLine[0] = value; }\n\n /**\n * Width of interlaced lines\n * @default 1\n */\n get lineWidth(): number { return this.uniforms.uLine[1]; }\n set lineWidth(value: number) { this.uniforms.uLine[1] = value; }\n\n /**\n * Contrast of interlaced lines\n * @default 0.25\n */\n get lineContrast(): number { return this.uniforms.uLine[2]; }\n set lineContrast(value: number) { this.uniforms.uLine[2] = value; }\n\n /**\n * The orientation of the line:\n *\n * `true` create vertical lines, `false` creates horizontal lines\n * @default false\n */\n get verticalLine(): boolean { return this.uniforms.uLine[3] > 0.5; }\n set verticalLine(value: boolean) { this.uniforms.uLine[3] = value ? 1 : 0; }\n\n /**\n * Opacity/intensity of the noise effect between `0` and `1`\n * @default 0.3\n */\n get noise(): number { return this.uniforms.uNoise[0]; }\n set noise(value: number) { this.uniforms.uNoise[0] = value; }\n\n /**\n * The size of the noise particles\n * @default 0\n */\n get noiseSize(): number { return this.uniforms.uNoise[1]; }\n set noiseSize(value: number) { this.uniforms.uNoise[1] = value; }\n\n /**\n * The radius of the vignette effect, smaller values produces a smaller vignette\n * @default 0.3\n */\n get vignetting(): number { return this.uniforms.uVignette[0]; }\n set vignetting(value: number) { this.uniforms.uVignette[0] = value; }\n\n /**\n * Amount of opacity of vignette\n * @default 1\n */\n get vignettingAlpha(): number { return this.uniforms.uVignette[1]; }\n set vignettingAlpha(value: number) { this.uniforms.uVignette[1] = value; }\n\n /**\n * Blur intensity of the vignette\n * @default 0.3\n */\n get vignettingBlur(): number { return this.uniforms.uVignette[2]; }\n set vignettingBlur(value: number) { this.uniforms.uVignette[2] = value; }\n}\n","import { deprecation, Filter, GlProgram, GpuProgram } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './dot.frag';\nimport source from './dot.wgsl';\n\n/** Options for the DotFilter constructor. */\nexport interface DotFilterOptions\n{\n /**\n * The scale of the effect\n * @default 1\n */\n scale?: number;\n /**\n * The angle of the effect\n * @default 5\n */\n angle?: number;\n /**\n * Whether to rendering it in gray scale\n * @default true\n */\n grayscale?: boolean;\n}\n\n/**\n * This filter applies a dotscreen effect making display objects appear to be made out of\n * black and white halftone dots like an old printer.
\n * ![original](../screenshots/original.png)![filter](../screenshots/dot.png)\n *\n * {@link https://github.com/evanw/glfx.js/blob/master/src/filters/fun/dotscreen.js Original filter}\n *\n * @class\n * @extends Filter\n */\nexport class DotFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: DotFilterOptions = {\n scale: 1,\n angle: 5,\n grayscale: true\n };\n\n /**\n * @param options - Options for the DotFilter constructor.\n */\n constructor(options?: DotFilterOptions);\n /**\n * @deprecated since 6.0.0\n *\n * @param {number} [scale=1] - The scale of the effect.\n * @param {number} [angle=5] - The radius of the effect.\n * @param {boolean} [grayscale=true] - Render as grayscale.\n */\n constructor(scale?: number, angle?: number, grayscale?: boolean);\n /** @ignore */\n constructor(...args: [DotFilterOptions?] | [number?, number?, boolean?])\n {\n let options = args[0] ?? {};\n\n if (typeof options === 'number')\n {\n // eslint-disable-next-line max-len\n deprecation('6.0.0', 'DotFilter constructor params are now options object. See params: { scale, angle, grayscale }');\n\n options = { scale: options };\n\n if (args[1] !== undefined) options.angle = args[1];\n if (args[2] !== undefined) options.grayscale = args[2];\n }\n\n options = { ...DotFilter.DEFAULT_OPTIONS, ...options };\n\n const dotUniforms = {\n uScale: { value: options.scale, type: 'f32' },\n uAngle: { value: options.angle, type: 'f32' },\n uGrayScale: { value: options.grayscale ? 1 : 0, type: 'f32' },\n };\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'dot-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n dotUniforms,\n },\n });\n }\n\n /**\n * The scale of the effect.\n * @default 1\n */\n get scale(): number { return this.resources.dotUniforms.uniforms.uScale; }\n set scale(value: number) { this.resources.dotUniforms.uniforms.uScale = value; }\n\n /**\n * The radius of the effect.\n * @default 5\n */\n get angle(): number { return this.resources.dotUniforms.uniforms.uAngle; }\n set angle(value: number) { this.resources.dotUniforms.uniforms.uAngle = value; }\n\n /**\n * Whether to rendering it in gray scale.\n * @default true\n */\n get grayscale(): boolean { return this.resources.dotUniforms.uniforms.uGrayScale === 1; }\n set grayscale(value: boolean) { this.resources.dotUniforms.uniforms.uGrayScale = value ? 1 : 0; }\n}\n","import {\n Color,\n ColorSource,\n Filter,\n FilterSystem,\n GlProgram,\n GpuProgram,\n PointData,\n RenderSurface,\n Texture,\n TexturePool,\n} from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport { KawaseBlurFilter } from '../kawase-blur/KawaseBlurFilter';\nimport fragment from './drop-shadow.frag';\nimport source from './drop-shadow.wgsl';\n\n/** Options for the DropShadowFilter constructor. */\nexport interface DropShadowFilterOptions\n{\n /**\n * The offset position of the drop-shadow relative to the original image.\n * @default {x:4,y:4}\n */\n offset?: PointData;\n /**\n * The color value of shadow.\n * @example [0.0, 0.0, 0.0] = 0x000000\n * @default 0x000000\n */\n color?: ColorSource;\n /**\n * Coefficient for alpha multiplication.\n * @default 1\n */\n alpha?: number;\n /**\n * Hide the contents, only show the shadow.\n * @default false\n */\n shadowOnly?: boolean;\n /**\n * The strength of the shadow's blur.\n * @default 2\n */\n blur?: number;\n /**\n * The quality of the Blur Filter.\n * @default 4\n */\n quality?: number;\n /**\n * The kernel size of the blur filter.\n * @default null\n */\n kernels?: number[];\n /**\n * The pixelSize of the Kawase Blur filter\n * @default {x:1,y:1}\n */\n pixelSize?: PointData | number[] | number;\n /**\n * The resolution of the Kawase Blur filter\n * @default 1\n */\n resolution?: number;\n}\n\n/**\n * Drop shadow filter.
\n * ![original](../screenshots/original.png)![filter](../screenshots/drop-shadow.png)\n * @class\n * @extends Filter\n */\nexport class DropShadowFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: DropShadowFilterOptions = {\n offset: { x: 4, y: 4 },\n color: 0x000000,\n alpha: 0.5,\n shadowOnly: false,\n kernels: undefined,\n blur: 2,\n quality: 3,\n pixelSize: { x: 1, y: 1 },\n resolution: 1,\n };\n\n public uniforms: {\n uAlpha: number;\n uColor: Float32Array;\n uOffset: PointData;\n };\n\n /**\n * Hide the contents, only show the shadow.\n * @default false\n */\n public shadowOnly = false;\n\n private _color!: Color;\n private _blurFilter: KawaseBlurFilter;\n private _basePass: Filter;\n\n /**\n * @param options - Options for the DropShadowFilter constructor.\n */\n constructor(options?: DropShadowFilterOptions)\n {\n options = { ...DropShadowFilter.DEFAULT_OPTIONS, ...options };\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'drop-shadow-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n dropShadowUniforms: {\n uAlpha: { value: options.alpha, type: 'f32' },\n uColor: { value: new Float32Array(3), type: 'vec3' },\n uOffset: { value: options.offset, type: 'vec2' },\n }\n },\n resolution: options.resolution,\n });\n\n this.uniforms = this.resources.dropShadowUniforms.uniforms;\n this._color = new Color();\n this.color = options.color ?? 0x000000;\n\n this._blurFilter = new KawaseBlurFilter({\n strength: options.kernels as [number, number] ?? options.blur,\n quality: options.kernels ? undefined : options.quality,\n });\n\n this._basePass = new Filter({\n gpuProgram: GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source: `\n @group(0) @binding(1) var uTexture: texture_2d; \n @group(0) @binding(2) var uSampler: sampler;\n @fragment\n fn mainFragment(\n @builtin(position) position: vec4,\n @location(0) uv : vec2\n ) -> @location(0) vec4 {\n return textureSample(uTexture, uSampler, uv);\n }\n `,\n entryPoint: 'mainFragment',\n },\n }),\n glProgram: GlProgram.from({\n vertex,\n fragment: `\n in vec2 vTextureCoord;\n out vec4 finalColor;\n uniform sampler2D uTexture;\n\n void main(void){\n finalColor = texture(uTexture, vTextureCoord);\n }\n `,\n name: 'drop-shadow-filter',\n }),\n resources: {},\n });\n\n Object.assign(this, options);\n }\n\n /**\n * Override existing apply method in `Filter`\n * @override\n * @ignore\n */\n public override apply(\n filterManager: FilterSystem,\n input: Texture,\n output: RenderSurface,\n clearMode: boolean,\n ): void\n {\n const renderTarget = TexturePool.getSameSizeTexture(input);\n\n filterManager.applyFilter(this, input, renderTarget, true);\n this._blurFilter.apply(filterManager, renderTarget, output, clearMode);\n\n if (!this.shadowOnly)\n {\n filterManager.applyFilter(this._basePass, input, output, false);\n }\n\n TexturePool.returnTexture(renderTarget);\n }\n\n /**\n * Set the offset position of the drop-shadow relative to the original image.\n * @default [4,4]\n */\n public get offset(): PointData { return this.uniforms.uOffset; }\n public set offset(value: PointData)\n {\n this.uniforms.uOffset = value;\n this._updatePadding();\n }\n\n /**\n * Set the offset position of the drop-shadow relative to the original image on the `x` axis\n * @default 4\n */\n get offsetX(): number { return this.offset.x; }\n set offsetX(value: number)\n {\n this.offset.x = value;\n this._updatePadding();\n }\n\n /**\n * Set the offset position of the drop-shadow relative to the original image on the `y` axis\n * @default 4\n */\n get offsetY(): number { return this.offset.y; }\n set offsetY(value: number)\n {\n this.offset.y = value;\n this._updatePadding();\n }\n\n /**\n * The color value of shadow.\n * @example [0.0, 0.0, 0.0] = 0x000000\n * @default 0x000000\n */\n get color(): ColorSource { return this._color.value as ColorSource; }\n set color(value: ColorSource)\n {\n this._color.setValue(value);\n const [r, g, b] = this._color.toArray();\n\n this.uniforms.uColor[0] = r;\n this.uniforms.uColor[1] = g;\n this.uniforms.uColor[2] = b;\n }\n\n /**\n * Coefficient for alpha multiplication\n * @default 1\n */\n get alpha(): number { return this.uniforms.uAlpha; }\n set alpha(value: number) { this.uniforms.uAlpha = value; }\n\n /**\n * The strength of the shadow's blur.\n * @default 2\n */\n get blur(): number { return this._blurFilter.strength; }\n set blur(value: number)\n {\n this._blurFilter.strength = value;\n this._updatePadding();\n }\n\n /**\n * Sets the quality of the Blur Filter\n * @default 4\n */\n get quality(): number { return this._blurFilter.quality; }\n set quality(value: number)\n {\n this._blurFilter.quality = value;\n this._updatePadding();\n }\n\n /** Sets the kernels of the Blur Filter */\n get kernels(): number[] { return this._blurFilter.kernels; }\n set kernels(value: number[]) { this._blurFilter.kernels = value; }\n\n /**\n * Sets the pixelSize of the Kawase Blur filter\n * @default [1,1]\n */\n get pixelSize(): PointData\n {\n return this._blurFilter.pixelSize as PointData;\n }\n set pixelSize(value: PointData | number[] | number)\n {\n if (typeof value === 'number')\n {\n value = { x: value, y: value };\n }\n\n if (Array.isArray(value))\n {\n value = { x: value[0], y: value[1] };\n }\n\n this._blurFilter.pixelSize = value;\n }\n\n /**\n * Sets the pixelSize of the Kawase Blur filter on the `x` axis\n * @default 1\n */\n get pixelSizeX(): number { return this._blurFilter.pixelSizeX; }\n set pixelSizeX(value: number) { this._blurFilter.pixelSizeX = value; }\n\n /**\n * Sets the pixelSize of the Kawase Blur filter on the `y` axis\n * @default 1\n */\n get pixelSizeY(): number { return this._blurFilter.pixelSizeY; }\n set pixelSizeY(value: number) { this._blurFilter.pixelSizeY = value; }\n\n /**\n * Recalculate the proper padding amount.\n * @private\n */\n private _updatePadding()\n {\n const offsetPadding = Math.max(\n Math.abs(this.offsetX),\n Math.abs(this.offsetY),\n );\n\n this.padding = offsetPadding + (this.blur * 2) + (this.quality * 4);\n }\n}\n","import { Filter, GlProgram, GpuProgram } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './emboss.frag';\nimport source from './emboss.wgsl';\n\n/**\n * An RGB Split Filter.
\n * ![original](../screenshots/original.png)![filter](../screenshots/emboss.png)\n *\n * @class\n * @extends Filter\n */\nexport class EmbossFilter extends Filter\n{\n public uniforms: {\n uStrength: number;\n };\n\n /**\n * @param {number} [strength=5] - Strength of the emboss.\n */\n constructor(strength = 5)\n {\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'emboss-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n embossUniforms: {\n uStrength: { value: strength, type: 'f32' },\n }\n },\n });\n\n this.uniforms = this.resources.embossUniforms.uniforms;\n }\n\n /**\n * Strength of the emboss\n * @default 5\n */\n get strength(): number { return this.uniforms.uStrength; }\n set strength(value: number) { this.uniforms.uStrength = value; }\n}\n","import { DEG_TO_RAD, Filter, GlProgram, GpuProgram, ImageSource, Texture } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './glitch.frag';\nimport source from './glitch.wgsl';\n\nimport type { FilterSystem, PointData, RenderSurface } from 'pixi.js';\n\nenum FILL_MODES\n {\n TRANSPARENT = 0,\n ORIGINAL = 1,\n LOOP = 2,\n CLAMP = 3,\n MIRROR = 4,\n}\n\n/** Options for the GlitchFilter constructor. */\nexport interface GlitchFilterOptions\n{\n /**\n * The count of glitch slices.\n * @default 5\n */\n slices?: number;\n /**\n * The maximum offset amount of slices.\n * @default 100\n */\n offset?: number;\n /**\n * The angle in degree of the offset of slices.\n * @default 0\n */\n direction?: number;\n /**\n * The fill mode of the space after the offset.\n * @default FILL_MODES.TRANSPARENT\n */\n fillMode?: number;\n /**\n * A seed value for randomizing glitch effect.\n * @default 0\n */\n seed?: number;\n /**\n * `true` will divide the bands roughly based on equal amounts\n * where as setting to `false` will vary the band sizes dramatically (more random looking).\n * @default false\n */\n average?: boolean;\n /**\n * Minimum size of slices as a portion of the `sampleSize`\n * @default 8\n */\n minSize?: number;\n /**\n * Height of the displacement map canvas.\n * @default 512\n */\n sampleSize?: number;\n /**\n * Red channel offset.\n * @default {x:0,y:0}\n */\n red?: PointData | number[];\n /**\n * Green channel offset.\n * @default {x:0,y:0}\n */\n green?: PointData | number[];\n /**\n * Blue offset.\n * @default {x:0,y:0}\n */\n blue?: PointData | number[];\n}\n\n/**\n * The GlitchFilter applies a glitch effect to an object.
\n * ![original](../screenshots/original.png)![filter](../screenshots/glitch.png)\n *\n * @class\n * @extends Filter\n */\nexport class GlitchFilter extends Filter\n{\n /** Default constructor options. */\n public static readonly defaults: GlitchFilterOptions = {\n slices: 5,\n offset: 100,\n direction: 0,\n fillMode: 0,\n average: false,\n seed: 0,\n red: { x: 0, y: 0 },\n green: { x: 0, y: 0 },\n blue: { x: 0, y: 0 },\n minSize: 8,\n sampleSize: 512,\n };\n\n public uniforms: {\n uSeed: number\n uDimensions: Float32Array,\n uAspect: number,\n uFillMode: number,\n uOffset: number,\n uDirection: number,\n uRed: PointData,\n uGreen: PointData,\n uBlue: PointData,\n };\n\n /**\n * `true` will divide the bands roughly based on equal amounts\n * where as setting to `false` will vary the band sizes dramatically (more random looking).\n */\n public average = false;\n\n /** Minimum size of slices as a portion of the `sampleSize` */\n public minSize = 8;\n\n /** Height of the displacement map canvas. */\n public sampleSize = 512;\n\n /** Internally generated canvas. */\n private _canvas: HTMLCanvasElement;\n\n /**\n * The displacement map is used to generate the bands.\n * If using your own texture, `slices` will be ignored.\n *\n * @member {Texture}\n * @readonly\n */\n public texture: Texture;\n\n /** Internal number of slices */\n private _slices = 0;\n\n private _sizes: Float32Array = new Float32Array(1);\n private _offsets: Float32Array = new Float32Array(1);\n\n /**\n * @param options - Options for the GlitchFilter constructor.\n */\n constructor(options?: GlitchFilterOptions)\n {\n options = { ...GlitchFilter.defaults, ...options };\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'glitch-filter',\n });\n\n const canvas = document.createElement('canvas');\n\n canvas.width = 4;\n canvas.height = options.sampleSize ?? 512;\n\n const texture = new Texture({\n source: new ImageSource({ resource: canvas })\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n glitchUniforms: {\n uSeed: { value: options?.seed ?? 0, type: 'f32' },\n uDimensions: { value: new Float32Array(2), type: 'vec2' },\n uAspect: { value: 1, type: 'f32' },\n uFillMode: { value: options?.fillMode ?? 0, type: 'f32' },\n uOffset: { value: options?.offset ?? 100, type: 'f32' },\n uDirection: { value: options?.direction ?? 0, type: 'f32' },\n uRed: { value: options.red, type: 'vec2' },\n uGreen: { value: options.green, type: 'vec2' },\n uBlue: { value: options.blue, type: 'vec2' },\n },\n uDisplacementMap: texture.source,\n uDisplacementSampler: texture.source.style,\n },\n });\n\n this.uniforms = this.resources.glitchUniforms.uniforms;\n\n this._canvas = canvas;\n this.texture = texture;\n\n Object.assign(this, options);\n }\n\n /**\n * Override existing apply method in Filter\n * @private\n */\n apply(\n filterManager: FilterSystem,\n input: Texture,\n output: RenderSurface,\n clearMode: boolean\n ): void\n {\n const { width, height } = input.frame;\n\n this.uniforms.uDimensions[0] = width;\n this.uniforms.uDimensions[1] = height;\n this.uniforms.uAspect = height / width;\n\n filterManager.applyFilter(this, input, output, clearMode);\n }\n\n /**\n * Randomize the slices size (heights).\n *\n * @private\n */\n private _randomizeSizes()\n {\n const arr = this._sizes;\n const last = this._slices - 1;\n const size = this.sampleSize;\n const min = Math.min(this.minSize / size, 0.9 / this._slices);\n\n if (this.average)\n {\n const count = this._slices;\n let rest = 1;\n\n for (let i = 0; i < last; i++)\n {\n const averageWidth = rest / (count - i);\n const w = Math.max(averageWidth * (1 - (Math.random() * 0.6)), min);\n\n arr[i] = w;\n rest -= w;\n }\n arr[last] = rest;\n }\n else\n {\n let rest = 1;\n const ratio = Math.sqrt(1 / this._slices);\n\n for (let i = 0; i < last; i++)\n {\n const w = Math.max(ratio * rest * Math.random(), min);\n\n arr[i] = w;\n rest -= w;\n }\n arr[last] = rest;\n }\n\n this.shuffle();\n }\n\n /**\n * Shuffle the sizes of the slices, advanced usage.\n */\n shuffle(): void\n {\n const arr = this._sizes;\n const last = this._slices - 1;\n\n // shuffle\n for (let i = last; i > 0; i--)\n {\n const rand = (Math.random() * i) >> 0;\n const temp = arr[i];\n\n arr[i] = arr[rand];\n arr[rand] = temp;\n }\n }\n\n /**\n * Randomize the values for offset from -1 to 1\n *\n * @private\n */\n private _randomizeOffsets(): void\n {\n for (let i = 0; i < this._slices; i++)\n {\n this._offsets[i] = Math.random() * (Math.random() < 0.5 ? -1 : 1);\n }\n }\n\n /**\n * Regenerating random size, offsets for slices.\n */\n refresh(): void\n {\n this._randomizeSizes();\n this._randomizeOffsets();\n this.redraw();\n }\n\n /**\n * Redraw displacement bitmap texture, advanced usage.\n */\n redraw(): void\n {\n const size = this.sampleSize;\n const texture = this.texture;\n const ctx = this._canvas.getContext('2d') as CanvasRenderingContext2D;\n\n ctx.clearRect(0, 0, 8, size);\n\n let offset;\n let y = 0;\n\n for (let i = 0; i < this._slices; i++)\n {\n offset = Math.floor(this._offsets[i] * 256);\n const height = this._sizes[i] * size;\n const red = offset > 0 ? offset : 0;\n const green = offset < 0 ? -offset : 0;\n\n ctx.fillStyle = `rgba(${red}, ${green}, 0, 1)`;\n ctx.fillRect(0, y >> 0, size, height + 1 >> 0);\n y += height;\n }\n\n texture.source.update();\n }\n\n /**\n * Manually custom slices size (height) of displacement bitmap\n *\n * @member {number[]|Float32Array}\n */\n set sizes(sizes: Float32Array)\n {\n const len = Math.min(this._slices, sizes.length);\n\n for (let i = 0; i < len; i++)\n {\n this._sizes[i] = sizes[i];\n }\n }\n get sizes(): Float32Array\n {\n return this._sizes;\n }\n\n /**\n * Manually set custom slices offset of displacement bitmap, this is\n * a collection of values from -1 to 1. To change the max offset value\n * set `offset`.\n *\n * @member {number[]|Float32Array}\n */\n set offsets(offsets: Float32Array)\n {\n const len = Math.min(this._slices, offsets.length);\n\n for (let i = 0; i < len; i++)\n {\n this._offsets[i] = offsets[i];\n }\n }\n get offsets(): Float32Array { return this._offsets; }\n\n /**\n * The count of slices.\n * @default 5\n */\n get slices(): number { return this._slices; }\n set slices(value: number)\n {\n if (this._slices === value) return;\n this._slices = value;\n this._sizes = new Float32Array(value);\n this._offsets = new Float32Array(value);\n this.refresh();\n }\n\n /**\n * The maximum offset amount of slices.\n * @default 100\n */\n get offset(): number { return this.uniforms.uOffset; }\n set offset(value: number) { this.uniforms.uOffset = value; }\n\n /**\n * A seed value for randomizing glitch effect.\n * @default 0\n */\n get seed(): number { return this.uniforms.uSeed; }\n set seed(value: number) { this.uniforms.uSeed = value; }\n\n /**\n * The fill mode of the space after the offset.\n * @default FILL_MODES.TRANSPARENT\n */\n get fillMode(): FILL_MODES { return this.uniforms.uFillMode; }\n set fillMode(value: FILL_MODES) { this.uniforms.uFillMode = value; }\n\n /**\n * The angle in degree of the offset of slices.\n * @default 0\n */\n get direction(): number { return this.uniforms.uDirection / DEG_TO_RAD; }\n set direction(value: number) { this.uniforms.uDirection = value * DEG_TO_RAD; }\n\n /**\n * Red channel offset.\n * @default {x:0,y:0}\n */\n get red(): PointData { return this.uniforms.uRed; }\n set red(value: PointData | number[])\n {\n if (Array.isArray(value))\n {\n value = { x: value[0], y: value[1] };\n }\n\n this.uniforms.uRed = value;\n }\n\n /**\n * Green channel offset.\n * @default {x:0,y:0}\n */\n get green(): PointData { return this.uniforms.uGreen; }\n set green(value: PointData | number[])\n {\n if (Array.isArray(value))\n {\n value = { x: value[0], y: value[1] };\n }\n\n this.uniforms.uGreen = value;\n }\n\n /**\n * Blue offset.\n * @default {x:0,y:0}\n */\n get blue(): PointData { return this.uniforms.uBlue; }\n set blue(value: PointData | number[])\n {\n if (Array.isArray(value))\n {\n value = { x: value[0], y: value[1] };\n }\n\n this.uniforms.uBlue = value;\n }\n\n /**\n * Removes all references\n */\n destroy(): void\n {\n this.texture?.destroy(true);\n this.texture\n = this._canvas\n = this.red\n = this.green\n = this.blue\n = this._sizes\n = this._offsets = null as any;\n }\n}\n","import { Color, ColorSource, Filter, GlProgram, GpuProgram } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './glow.frag';\nimport source from './glow.wgsl';\n\n/**\n * Options for the GlowFilter constructor.\n */\nexport interface GlowFilterOptions\n{\n /**\n * The distance of the glow\n * @default 10\n */\n distance?: number;\n /**\n * The strength of the glow outward from the edge of the sprite\n * @default 4\n */\n outerStrength?: number;\n /**\n * The strength of the glow inward from the edge of the sprite\n * @default 0\n */\n innerStrength?: number;\n /**\n * The color of the glow\n * @default 0xffffff\n */\n color?: ColorSource;\n /**\n * The alpha of the glow\n * @default 1\n */\n alpha?: number;\n /**\n * A number between 0 and 1 that describes the quality of the glow. The higher the number the less performant\n * @default 0.1\n */\n quality?: number;\n /**\n * Toggle to hide the contents and only show glow\n * @default false\n */\n knockout?: boolean;\n}\n\n/**\n * GlowFilter, originally by mishaa\n * [codepen]{@link http://codepen.io/mishaa/pen/raKzrm}.
\n * ![original](../screenshots/original.png)![filter](../screenshots/glow.png)\n * @class\n *\n * @extends Filter\n *\n * @example\n * someSprite.filters = [\n * new GlowFilter({ distance: 15, outerStrength: 2 })\n * ];\n */\nexport class GlowFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: GlowFilterOptions = {\n distance: 10,\n outerStrength: 4,\n innerStrength: 0,\n color: 0xffffff,\n alpha: 1,\n quality: 0.1,\n knockout: false,\n };\n\n public uniforms: {\n uDistance: number;\n uStrength: Float32Array;\n uColor: Float32Array;\n uAlpha: number;\n uQuality: number;\n uKnockout: number;\n };\n\n private _color!: Color;\n\n /**\n * @param options - Options for the GlowFilter constructor.\n */\n constructor(options?: GlowFilterOptions)\n {\n options = { ...GlowFilter.DEFAULT_OPTIONS, ...options };\n\n const distance = options.distance ?? 10;\n const quality = options.quality ?? 0.1;\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n // Altering uDistance and uQuality won't have any affect on WebGL\n // since we hard-assign them during creation to allow\n // for the values to be used in GLSL loops\n const glProgram = GlProgram.from({\n vertex,\n fragment: fragment\n .replace(/__ANGLE_STEP_SIZE__/gi, `${(1 / quality / distance).toFixed(7)}`)\n .replace(/__DIST__/gi, `${distance.toFixed(0)}.0`),\n name: 'glow-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n glowUniforms: {\n uDistance: { value: distance, type: 'f32' },\n uStrength: { value: [options.innerStrength, options.outerStrength], type: 'vec2' },\n uColor: { value: new Float32Array(3), type: 'vec3' },\n uAlpha: { value: options.alpha, type: 'f32' },\n uQuality: { value: quality, type: 'f32' },\n uKnockout: { value: (options?.knockout ?? false) ? 1 : 0, type: 'f32' },\n }\n },\n padding: distance,\n });\n\n this.uniforms = this.resources.glowUniforms.uniforms;\n this._color = new Color();\n this.color = options.color ?? 0xffffff;\n }\n\n /**\n * Only draw the glow, not the texture itself\n * @default false\n */\n get distance(): number { return this.uniforms.uDistance; }\n set distance(value: number) { this.uniforms.uDistance = this.padding = value; }\n\n /**\n * The strength of the glow inward from the edge of the sprite.\n * @default 0\n */\n get innerStrength(): number { return this.uniforms.uStrength[0]; }\n set innerStrength(value: number) { this.uniforms.uStrength[0] = value; }\n\n /**\n * The strength of the glow outward from the edge of the sprite.\n * @default 4\n */\n get outerStrength(): number { return this.uniforms.uStrength[1]; }\n set outerStrength(value: number) { this.uniforms.uStrength[1] = value; }\n\n /**\n * The color of the glow.\n * @default 0xFFFFFF\n */\n get color(): ColorSource { return this._color.value as ColorSource; }\n set color(value: ColorSource)\n {\n this._color.setValue(value);\n const [r, g, b] = this._color.toArray();\n\n this.uniforms.uColor[0] = r;\n this.uniforms.uColor[1] = g;\n this.uniforms.uColor[2] = b;\n }\n\n /**\n * The alpha of the glow\n * @default 1\n */\n get alpha(): number { return this.uniforms.uAlpha; }\n set alpha(value: number) { this.uniforms.uAlpha = value; }\n\n /**\n * A number between 0 and 1 that describes the quality of the glow. The higher the number the less performant\n * @default 0.1\n */\n get quality(): number { return this.uniforms.uQuality; }\n set quality(value: number) { this.uniforms.uQuality = value; }\n\n /**\n * Only draw the glow, not the texture itself\n * @default false\n */\n get knockout(): boolean { return this.uniforms.uKnockout === 1; }\n set knockout(value: boolean) { this.uniforms.uKnockout = value ? 1 : 0; }\n}\n","import { DEG_TO_RAD, Filter, GlProgram, GpuProgram } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './god-ray.frag';\nimport source from './god-ray.wgsl';\nimport perlin from './perlin.frag';\nimport sourcePerlin from './perlin.wgsl';\n\nimport type { FilterSystem, PointData, RenderSurface, Texture } from 'pixi.js';\n\n/** Options for the GodrayFilter constructor. */\nexport interface GodrayFilterOptions\n{\n /**\n * The angle/light-source of the rays in degrees. For instance,\n * a value of 0 is vertical rays, values of 90 or -90 produce horizontal rays.\n * @default 30\n */\n angle?: number;\n /**\n * `true` if light rays are parallel (uses angle), `false` to use the focal `center` point\n * @default true\n */\n parallel?: boolean;\n /**\n * Focal point for non-parallel rays, to use this `parallel` must be set to `false`.\n * This should be a size 2 array or an object containing `x` and `y` values, you cannot change types\n * once defined in the constructor\n * @default {x:0,y:0}\n */\n center?: PointData | number[];\n /**\n * General intensity of the effect. A value closer to 1 will produce a more intense effect,\n * where a value closer to 0 will produce a subtler effect.\n * @default 0.5\n */\n gain?: number;\n /**\n * The density of the fractal noise\n * @default 2.5\n */\n lacunarity?: number;\n /**\n * The current time position\n * @default 0\n */\n time?: number;\n /**\n * The alpha (opacity) of the rays. 0 is fully transparent, 1 is fully opaque.\n * @default 1\n */\n alpha?: number;\n}\n\n/**\n * GordayFilter, {@link https://codepen.io/alaingalvan originally} by Alain Galvan\n *\n *\n *\n * ![original](../screenshots/original.png)![filter](../screenshots/godray.gif)\n * @class\n * @extends Filter\n *\n * @example\n * displayObject.filters = [new GodrayFilter()];\n */\nexport class GodrayFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: GodrayFilterOptions = {\n angle: 30,\n gain: 0.5,\n lacunarity: 2.5,\n parallel: true,\n time: 0,\n center: { x: 0, y: 0 },\n alpha: 1,\n };\n\n public uniforms: {\n uLight: Float32Array;\n uParallel: number;\n uAspect: number;\n uTime: number;\n uRay: Float32Array;\n uDimensions: Float32Array;\n };\n\n /**\n * The current time position\n * @default 0\n */\n public time = 0;\n\n private _angleLight: [number, number] = [0, 0];\n private _angle = 0;\n private _center!: PointData;\n\n /**\n * @param options - Options for the GodrayFilter constructor.\n */\n constructor(options?: GodrayFilterOptions)\n {\n options = { ...GodrayFilter.DEFAULT_OPTIONS, ...options };\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source: source.replace('${PERLIN}', sourcePerlin),\n entryPoint: 'mainFragment',\n },\n });\n const glProgram = GlProgram.from({\n vertex,\n fragment: fragment.replace('${PERLIN}', perlin),\n name: 'god-ray-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n godrayUniforms: {\n uLight: { value: new Float32Array(2), type: 'vec2' },\n uParallel: { value: 0, type: 'f32' },\n uAspect: { value: 0, type: 'f32' },\n uTime: { value: options.time, type: 'f32' },\n uRay: { value: new Float32Array(3), type: 'vec3' },\n uDimensions: { value: new Float32Array(2), type: 'vec2' },\n }\n },\n });\n\n this.uniforms = this.resources.godrayUniforms.uniforms;\n\n Object.assign(this, options);\n }\n\n /**\n * Override existing apply method in Filter\n * @override\n * @ignore\n */\n public override apply(\n filterManager: FilterSystem,\n input: Texture,\n output: RenderSurface,\n clearMode: boolean\n ): void\n {\n const width = input.frame.width;\n const height = input.frame.height;\n\n this.uniforms.uLight[0] = this.parallel ? this._angleLight[0] : this._center.x;\n this.uniforms.uLight[1] = this.parallel ? this._angleLight[1] : this._center.y;\n this.uniforms.uDimensions[0] = width;\n this.uniforms.uDimensions[1] = height;\n this.uniforms.uAspect = height / width;\n this.uniforms.uTime = this.time;\n\n // draw the filter...\n filterManager.applyFilter(this, input, output, clearMode);\n }\n\n /**\n * The angle/light-source of the rays in degrees. For instance,\n * a value of 0 is vertical rays, values of 90 or -90 produce horizontal rays\n * @default 30\n */\n get angle(): number { return this._angle; }\n set angle(value: number)\n {\n this._angle = value;\n\n const radians = value * DEG_TO_RAD;\n\n this._angleLight[0] = Math.cos(radians);\n this._angleLight[1] = Math.sin(radians);\n }\n\n /**\n * `true` if light rays are parallel (uses angle), `false` to use the focal `center` point\n * @default true\n */\n get parallel(): boolean { return this.uniforms.uParallel > 0.5; }\n set parallel(value: boolean) { this.uniforms.uParallel = value ? 1 : 0; }\n\n /**\n * Focal point for non-parallel rays, to use this `parallel` must be set to `false`.\n * @default {x:0,y:0}\n */\n get center(): PointData { return this._center; }\n set center(value: PointData | number[])\n {\n if (Array.isArray(value))\n {\n value = { x: value[0], y: value[1] };\n }\n\n this._center = value;\n }\n\n /**\n * Focal point for non-parallel rays on the `x` axis, to use this `parallel` must be set to `false`.\n * @default 0\n */\n get centerX(): number { return this.center.x; }\n set centerX(value: number) { this.center.x = value; }\n\n /**\n * Focal point for non-parallel rays on the `y` axis, to use this `parallel` must be set to `false`.\n * @default 0\n */\n get centerY(): number { return this.center.y; }\n set centerY(value: number) { this.center.y = value; }\n\n /**\n * General intensity of the effect. A value closer to 1 will produce a more intense effect,\n * where a value closer to 0 will produce a subtler effect\n * @default 0.5\n */\n get gain(): number { return this.uniforms.uRay[0]; }\n set gain(value: number) { this.uniforms.uRay[0] = value; }\n\n /**\n * The density of the fractal noise.\n * A higher amount produces more rays and a smaller amount produces fewer waves\n * @default 2.5\n */\n get lacunarity(): number { return this.uniforms.uRay[1]; }\n set lacunarity(value: number) { this.uniforms.uRay[1] = value; }\n\n /**\n * The alpha (opacity) of the rays. 0 is fully transparent, 1 is fully opaque.\n * @default 1\n */\n get alpha(): number { return this.uniforms.uRay[2]; }\n set alpha(value: number) { this.uniforms.uRay[2] = value; }\n}\n","import { Filter, GlProgram, GpuProgram } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './grayscale.frag';\nimport source from './grayscale.wgsl';\n\n/**\n * This filter applies a grayscale effect.
\n * ![original](../screenshots/original.png)![filter](../screenshots/grayscale.png)\n *\n * @class\n * @extends Filter\n */\nexport class GrayscaleFilter extends Filter\n{\n constructor()\n {\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'grayscale-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {},\n });\n }\n}\n","import { Filter, GlProgram, GpuProgram } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './hsladjustment.frag';\nimport source from './hsladjustment.wgsl';\n\n/**\n * Options for the HslAdjustmentFilter constructor.\n */\nexport interface HslAdjustmentFilterOptions\n{\n /**\n * The amount of hue in degrees (-180 to 180)\n * @default 0\n */\n hue: number;\n /**\n * The amount of color saturation (-1 to 1)\n * @default 0\n */\n saturation: number;\n /**\n * The amount of lightness (-1 to 1)\n * @default 0\n */\n lightness: number;\n /**\n * Whether to colorize the image\n * @default false\n */\n colorize: boolean;\n /**\n * The amount of alpha (0 to 1)\n * @default 1\n */\n alpha: number;\n}\n\n/**\n * ![original](../screenshots/original.png)![filter](../screenshots/hsl-adjustment.png)\n *\n * This WebGPU filter has been ported from the WebGL renderer that was originally created by Viktor Persson (@vikpe)\n *\n * @class\n * @extends Filter\n */\nexport class HslAdjustmentFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: HslAdjustmentFilterOptions = {\n hue: 0,\n saturation: 0,\n lightness: 0,\n colorize: false,\n alpha: 1,\n };\n\n public uniforms: {\n uHsl: Float32Array;\n uColorize: number;\n uAlpha: number;\n };\n\n private _hue!: number;\n\n /**\n * @param options - Options for the HslAdjustmentFilter constructor.\n */\n constructor(options?: HslAdjustmentFilterOptions)\n {\n options = { ...HslAdjustmentFilter.DEFAULT_OPTIONS, ...options };\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'hsl-adjustment-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n hslUniforms: {\n uHsl: { value: new Float32Array(3), type: 'vec3' },\n uColorize: { value: options.colorize ? 1 : 0, type: 'f32' },\n uAlpha: { value: options.alpha, type: 'f32' },\n },\n },\n });\n\n this.uniforms = this.resources.hslUniforms.uniforms;\n this.hue = options.hue;\n }\n\n /**\n * The amount of hue in degrees (-180 to 180)\n * @default 0\n */\n get hue(): number { return this._hue; }\n set hue(value: number)\n {\n this._hue = value;\n this.resources.hslUniforms.uniforms.uHsl[0] = value * (Math.PI / 180);\n }\n\n /**\n * The amount of lightness (-1 to 1)\n * @default 0\n */\n get saturation(): number { return this.resources.hslUniforms.uniforms.uHsl[1]; }\n set saturation(value: number) { this.resources.hslUniforms.uniforms.uHsl[1] = value; }\n\n /**\n * The amount of lightness (-1 to 1)\n * @default 0\n */\n get lightness(): number { return this.resources.hslUniforms.uniforms.uHsl[2]; }\n set lightness(value: number) { this.resources.hslUniforms.uniforms.uHsl[2] = value; }\n\n /**\n * Whether to colorize the image\n * @default false\n */\n get colorize(): boolean { return this.resources.hslUniforms.uniforms.uColorize === 1; }\n set colorize(value: boolean) { this.resources.hslUniforms.uniforms.uColorize = value ? 1 : 0; }\n\n /**\n * The amount of alpha (0 to 1)\n * @default 1\n */\n get alpha(): number { return this.resources.hslUniforms.uniforms.uAlpha; }\n set alpha(value: number) { this.resources.hslUniforms.uniforms.uAlpha = value; }\n}\n","/* eslint-disable max-len */\nimport { deprecation, Filter, GlProgram, GpuProgram, ObservablePoint, PointData } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './motion-blur.frag';\nimport source from './motion-blur.wgsl';\n\n/** Options for the MotionBlurFilter constructor. */\nexport interface MotionBlurFilterOptions\n{\n /**\n * Sets the velocity of the motion for blur effect\n * This should be a size 2 array or an object containing `x` and `y` values, you cannot change types\n * once defined in the constructor\n * @default {x:0,y:0}\n */\n velocity?: PointData | number[];\n /**\n * The kernelSize of the blur filter. Must be odd number >= 5\n * @default 5\n */\n kernelSize?: number;\n /**\n * The offset of the blur filter\n * @default 0\n */\n offset?: number;\n}\n\n/**\n * The MotionBlurFilter applies a Motion blur to an object.
\n * ![original](../screenshots/original.png)![filter](../screenshots/motion-blur.png)\n *\n * @class\n * @extends Filter\n */\nexport class MotionBlurFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: MotionBlurFilterOptions = {\n velocity: { x: 0, y: 0 },\n kernelSize: 5,\n offset: 0,\n };\n\n public uniforms: {\n uVelocity: PointData;\n uKernelSize: number;\n uOffset: number;\n };\n\n private _kernelSize!: number;\n\n /**\n * @param options - Options for the MotionBlurFilter constructor.\n */\n constructor(options?: MotionBlurFilterOptions);\n /**\n * @deprecated since 8.0.0\n *\n * @param {PIXI.ObservablePoint|PIXI.PointData|number[]} [velocity=[0, 0]] - Sets the velocity of the motion for blur effect.\n * @param {number} [kernelSize=5] - The kernelSize of the blur filter. Must be odd number >= 5\n * @param {number} [offset=0] - The offset of the blur filter.\n */\n constructor(velocity?: number[] | PointData | ObservablePoint, kernelSize?: number, offset?: number);\n /** @ignore */\n constructor(...args: [MotionBlurFilterOptions?] | [(number[] | PointData | ObservablePoint)?, number?, number?])\n {\n let options = args[0] ?? {};\n\n if (Array.isArray(options) || ('x' in options && 'y' in options) || options instanceof ObservablePoint)\n {\n // eslint-disable-next-line max-len\n deprecation('6.0.0', 'MotionBlurFilter constructor params are now options object. See params: { velocity, kernelSize, offset }');\n\n const x = 'x' in options ? options.x : options[0];\n const y = 'y' in options ? options.y : options[1];\n\n options = { velocity: { x, y } };\n\n if (args[1] !== undefined) options.kernelSize = args[1];\n if (args[2] !== undefined) options.offset = args[2];\n }\n\n options = { ...MotionBlurFilter.DEFAULT_OPTIONS, ...options };\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'motion-blur-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n motionBlurUniforms: {\n uVelocity: { value: options.velocity, type: 'vec2' },\n uKernelSize: { value: Math.trunc(options.kernelSize ?? 5), type: 'f32' },\n uOffset: { value: options.offset, type: 'f32' },\n }\n },\n });\n\n this.uniforms = this.resources.motionBlurUniforms.uniforms;\n\n Object.assign(this, options);\n }\n\n /**\n * Sets the velocity of the motion for blur effect\n * This should be a size 2 array or an object containing `x` and `y` values, you cannot change types\n * once defined in the constructor\n * @default {x:0,y:0}\n */\n get velocity(): PointData { return this.uniforms.uVelocity; }\n set velocity(value: PointData | number[])\n {\n if (Array.isArray(value))\n {\n value = { x: value[0], y: value[1] };\n }\n\n this.uniforms.uVelocity = value;\n this._updateDirty();\n }\n\n /**\n * Sets the velocity of the motion for blur effect on the `x` axis\n * @default 0\n */\n get velocityX(): number { return this.velocity.x; }\n set velocityX(value: number)\n {\n this.velocity.x = value;\n this._updateDirty();\n }\n\n /**\n * Sets the velocity of the motion for blur effect on the `x` axis\n * @default 0\n */\n get velocityY(): number { return this.velocity.y; }\n set velocityY(value: number)\n {\n this.velocity.y = value;\n this._updateDirty();\n }\n\n /**\n * The kernelSize of the blur filter. Must be odd number >= 5\n * @default 5\n */\n get kernelSize(): number { return this._kernelSize; }\n set kernelSize(value: number)\n {\n this._kernelSize = value;\n this._updateDirty();\n }\n\n /**\n * The offset of the blur filter\n * @default 0\n */\n get offset(): number { return this.uniforms.uOffset; }\n set offset(value: number) { this.uniforms.uOffset = value; }\n\n private _updateDirty()\n {\n // The padding will be increased as the velocity and intern the blur size is changed\n this.padding = (Math.max(Math.abs(this.velocityX), Math.abs(this.velocityY)) >> 0) + 1;\n this.uniforms.uKernelSize = (this.velocityX !== 0 || this.velocityY !== 0) ? this._kernelSize : 0;\n }\n}\n","import { Color, ColorSource, deprecation, Filter, GlProgram, GpuProgram } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './multi-color-replace.frag';\nimport source from './multi-color-replace.wgsl';\n\ntype DeprecatedColor = number | number[] | Float32Array;\n\n/** Options for the MultiColorReplaceFilter constructor. */\nexport interface MultiColorReplaceFilterOptions\n{\n /**\n * The collection of replacement items. Each item is color-pair\n * (an array length is 2). In the pair, the first value is original color , the second value is target color\n *\n * _If you wish to change individual elements on the replacement array after instantiation,\n * use the `refresh` function to update the uniforms once you've made the changes_\n */\n replacements: Array<[ColorSource, ColorSource]>;\n /**\n * Tolerance/sensitivity of the floating-point comparison between colors (lower = more exact, higher = more inclusive)\n * @default 0.05\n */\n tolerance?: number\n /**\n * The maximum number of replacements filter is able to use.\n * Because the fragment is only compiled once, this cannot be changed after construction.\n * If omitted, the default value is the length of `replacements`\n */\n maxColors?: number;\n}\n\n/**\n * Filter for replacing a color with another color. Similar to ColorReplaceFilter, but support multiple\n * colors.
\n * ![original](../screenshots/original.png)![filter](../screenshots/multi-color-replace.png)\n * @class\n * @extends Filter\n *\n * @example\n * // replaces pure red with pure blue, and replaces pure green with pure white\n * someSprite.filters = [new MultiColorReplaceFilter({\n * replacements: [\n * [0xFF0000, 0x0000FF],\n * [0x00FF00, 0xFFFFFF]\n * ],\n * tolerance: 0.001\n * })];\n *\n * You also could use [R, G, B] as the color\n * someOtherSprite.filters = [new MultiColorReplaceFilter({\n * replacements: [\n * [ [1,0,0], [0,0,1] ],\n * [ [0,1,0], [1,1,1] ]\n * ],\n * tolerance: 0.001\n * })];\n *\n */\nexport class MultiColorReplaceFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: MultiColorReplaceFilterOptions = {\n replacements: [[0xff0000, 0x0000ff]],\n tolerance: 0.05,\n maxColors: undefined,\n };\n\n public uniforms: {\n uOriginalColors: Float32Array;\n uTargetColors: Float32Array;\n uTolerance: number;\n };\n\n private _replacements: Array<[ColorSource, ColorSource]> = [];\n private _maxColors: number;\n\n /**\n * @param options - Options for the MultiColorReplaceFilter constructor.\n */\n constructor(options?: MultiColorReplaceFilterOptions);\n /**\n * @deprecated since 6.0.0\n *\n * @param {Array} replacements - The collection of replacement items. Each item is color-pair\n * (an array length is 2). In the pair, the first value is original color , the second value\n * is target color.\n * @param {number} [epsilon=0.05] - Tolerance of the floating-point comparison between colors\n * (lower = more exact, higher = more inclusive)\n * @param {number} [maxColors] - The maximum number of replacements filter is able to use. Because the\n * fragment is only compiled once, this cannot be changed after construction.\n * If omitted, the default value is the length of `replacements`.\n */\n constructor(replacements: Array<[DeprecatedColor, DeprecatedColor]>, epsilon?: number, maxColors?: number);\n /** @ignore */\n constructor(...args: [MultiColorReplaceFilterOptions?] | [Array<[DeprecatedColor, DeprecatedColor]>, number?, number?])\n {\n let options = args[0] ?? {} as MultiColorReplaceFilterOptions;\n\n if (Array.isArray(options))\n {\n // eslint-disable-next-line max-len\n deprecation('6.0.0', 'MultiColorReplaceFilter constructor params are now options object. See params: { replacements, tolerance, maxColors }');\n\n options = { replacements: options };\n\n if (args[1]) options.tolerance = args[1];\n if (args[2]) options.maxColors = args[2];\n }\n\n options = { ...MultiColorReplaceFilter.DEFAULT_OPTIONS, ...options };\n\n const maxColors = options.maxColors ?? options.replacements.length;\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source: source.replace(/\\$\\{MAX_COLORS\\}/g, (maxColors).toFixed(0)),\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment: fragment.replace(/\\$\\{MAX_COLORS\\}/g, (maxColors).toFixed(0)),\n name: 'multi-color-replace-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n multiColorReplaceUniforms: {\n uOriginalColors: {\n value: new Float32Array(3 * maxColors),\n type: 'vec3',\n size: maxColors\n },\n uTargetColors: {\n value: new Float32Array(3 * maxColors),\n type: 'vec3',\n size: maxColors\n },\n uTolerance: { value: options.tolerance, type: 'f32' },\n }\n },\n });\n\n this._maxColors = maxColors;\n\n this.uniforms = this.resources.multiColorReplaceUniforms.uniforms;\n\n this.replacements = options.replacements;\n }\n\n /**\n * The collection of replacement items. Each item is color-pair\n * (an array length is 2). In the pair, the first value is original color , the second value is target color\n */\n set replacements(replacements: Array<[ColorSource, ColorSource]>)\n {\n const originals = this.uniforms.uOriginalColors;\n const targets = this.uniforms.uTargetColors;\n const colorCount = replacements.length;\n const color = new Color();\n\n if (colorCount > this._maxColors)\n {\n throw new Error(`Length of replacements (${colorCount}) exceeds the maximum colors length (${this._maxColors})`);\n }\n\n // Fill with negative values\n originals[colorCount * 3] = -1;\n\n let r;\n let g;\n let b;\n\n for (let i = 0; i < colorCount; i++)\n {\n const pair = replacements[i];\n\n // for original colors\n color.setValue(pair[0]);\n\n [r, g, b] = color.toArray();\n\n originals[i * 3] = r;\n originals[(i * 3) + 1] = g;\n originals[(i * 3) + 2] = b;\n\n // for target colors\n color.setValue(pair[1]);\n\n [r, g, b] = color.toArray();\n\n targets[i * 3] = r;\n targets[(i * 3) + 1] = g;\n targets[(i * 3) + 2] = b;\n }\n\n this._replacements = replacements;\n }\n\n get replacements(): Array<[ColorSource, ColorSource]>\n {\n return this._replacements;\n }\n\n /**\n * Should be called after changing any of the contents of the replacements.\n * This is a convenience method for resetting the `replacements`.\n * @todo implement nested proxy to remove the need for this function\n */\n refresh(): void\n {\n this.replacements = this._replacements;\n }\n\n /**\n * The maximum number of color replacements supported by this filter. Can be changed\n * _only_ during construction.\n * @readonly\n */\n get maxColors(): number { return this._maxColors; }\n\n /**\n * Tolerance of the floating-point comparison between colors (lower = more exact, higher = more inclusive)\n * @default 0.05\n */\n get tolerance(): number { return this.uniforms.uTolerance; }\n set tolerance(value: number) { this.uniforms.uTolerance = value; }\n\n /**\n * @deprecated since 6.0.0\n *\n * Tolerance of the floating-point comparison between colors (lower = more exact, higher = more inclusive)\n * @default 0.05\n */\n set epsilon(value: number)\n {\n // eslint-disable-next-line max-len\n deprecation('6.0.0', 'MultiColorReplaceFilter.epsilon is deprecated, please use MultiColorReplaceFilter.tolerance instead');\n this.tolerance = value;\n }\n get epsilon(): number\n {\n // eslint-disable-next-line max-len\n deprecation('6.0.0', 'MultiColorReplaceFilter.epsilon is deprecated, please use MultiColorReplaceFilter.tolerance instead');\n\n return this.tolerance;\n }\n}\n","import { Filter, GlProgram, GpuProgram } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './old-film.frag';\nimport source from './old-film.wgsl';\n\nimport type { FilterSystem, RenderSurface, Texture } from 'pixi.js';\n\n/** Options for the OldFilmFilter constructor. */\nexport interface OldFilmFilterOptions\n{\n /**\n * The amount of saturation of sepia effect,\n * a value of `1` is more saturation and closer to `0` is less, and a value of `0` produces no sepia effect\n * @default 0.3\n */\n sepia?: number;\n /**\n * Opacity/intensity of the noise effect between `0` and `1`\n * @default 0.3\n */\n noise?: number;\n /**\n * The size of the noise particles\n * @default 1\n */\n noiseSize?: number;\n /**\n * How often scratches appear\n * @default 0.5\n */\n scratch?: number;\n /**\n * The density of the number of scratches\n * @default 0.3\n */\n scratchDensity?: number;\n /**\n * The width of the scratches\n * @default 1\n */\n scratchWidth?: number;\n /**\n * The radius of the vignette effect, smaller values produces a smaller vignette\n * @default 0.3\n */\n vignetting?: number;\n /**\n * Amount of opacity on the vignette\n * @default 1\n */\n vignettingAlpha?: number;\n /**\n * Blur intensity of the vignette\n * @default 1\n */\n vignettingBlur?: number;\n /**\n * A seed value to apply to the random noise generation\n * @default 0\n */\n seed?: number;\n}\n\n/**\n * The OldFilmFilter applies a Old film effect to an object.
\n * ![original](../screenshots/original.png)![filter](../screenshots/old-film.gif)\n *\n * @class\n * @extends Filter\n */\nexport class OldFilmFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: OldFilmFilterOptions = {\n sepia: 0.3,\n noise: 0.3,\n noiseSize: 1,\n scratch: 0.5,\n scratchDensity: 0.3,\n scratchWidth: 1,\n vignetting: 0.3,\n vignettingAlpha: 1,\n vignettingBlur: 0.3,\n seed: 0\n };\n\n public uniforms: {\n uSepia: number;\n uNoise: Float32Array;\n uScratch: Float32Array;\n uVignetting: Float32Array;\n uSeed: number;\n uDimensions: Float32Array;\n };\n\n /**\n * A seed value to apply to the random noise generation\n * @default 0\n */\n public seed!: number;\n\n /**\n * @param options - Options for the OldFilmFilter constructor.\n */\n constructor(options?: OldFilmFilterOptions)\n {\n options = { ...OldFilmFilter.DEFAULT_OPTIONS, ...options };\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'old-film-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n oldFilmUniforms: {\n uSepia: { value: options.sepia, type: 'f32' },\n uNoise: { value: new Float32Array(2), type: 'vec2' },\n uScratch: { value: new Float32Array(3), type: 'vec3' },\n uVignetting: { value: new Float32Array(3), type: 'vec3' },\n uSeed: { value: options.seed, type: 'f32' },\n uDimensions: { value: new Float32Array(2), type: 'vec2' },\n }\n },\n });\n\n this.uniforms = this.resources.oldFilmUniforms.uniforms;\n\n Object.assign(this, options);\n }\n\n /**\n * Override existing apply method in `Filter`\n * @override\n * @ignore\n */\n public override apply(\n filterManager: FilterSystem,\n input: Texture,\n output: RenderSurface,\n clearMode: boolean\n ): void\n {\n this.uniforms.uDimensions[0] = input.frame.width;\n this.uniforms.uDimensions[1] = input.frame.height;\n this.uniforms.uSeed = this.seed;\n\n filterManager.applyFilter(this, input, output, clearMode);\n }\n\n /**\n * The amount of saturation of sepia effect,\n * a value of `1` is more saturation and closer to `0` is less, and a value of `0` produces no sepia effect\n * @default 0.3\n */\n get sepia(): number { return this.uniforms.uSepia; }\n set sepia(value: number) { this.uniforms.uSepia = value; }\n\n /**\n * Opacity/intensity of the noise effect between `0` and `1`\n * @default 0.3\n */\n get noise(): number { return this.uniforms.uNoise[0]; }\n set noise(value: number) { this.uniforms.uNoise[0] = value; }\n\n /**\n * The size of the noise particles\n * @default 1\n */\n get noiseSize(): number { return this.uniforms.uNoise[1]; }\n set noiseSize(value: number) { this.uniforms.uNoise[1] = value; }\n\n /**\n * How often scratches appear\n * @default 0.5\n */\n get scratch(): number { return this.uniforms.uScratch[0]; }\n set scratch(value: number) { this.uniforms.uScratch[0] = value; }\n\n /**\n * The density of the number of scratches\n * @default 0.3\n */\n get scratchDensity(): number { return this.uniforms.uScratch[1]; }\n set scratchDensity(value: number) { this.uniforms.uScratch[1] = value; }\n\n /**\n * The width of the scratches\n * @default 1\n */\n get scratchWidth(): number { return this.uniforms.uScratch[2]; }\n set scratchWidth(value: number) { this.uniforms.uScratch[2] = value; }\n\n /**\n * The radius of the vignette effect, smaller values produces a smaller vignette\n * @default 0.3\n */\n get vignetting(): number { return this.uniforms.uVignetting[0]; }\n set vignetting(value: number) { this.uniforms.uVignetting[0] = value; }\n\n /**\n * Amount of opacity on the vignette\n * @default 1\n */\n get vignettingAlpha(): number { return this.uniforms.uVignetting[1]; }\n set vignettingAlpha(value: number) { this.uniforms.uVignetting[1] = value; }\n\n /**\n * Blur intensity of the vignette\n * @default 1\n */\n get vignettingBlur(): number { return this.uniforms.uVignetting[2]; }\n set vignettingBlur(value: number) { this.uniforms.uVignetting[2] = value; }\n}\n","import { Color, deprecation, Filter, GlProgram, GpuProgram } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './outline.frag';\nimport source from './outline.wgsl';\n\nimport type { ColorSource, FilterSystem, RenderSurface, Texture } from 'pixi.js';\n\n/** Options for the OutlineFilter constructor. */\nexport interface OutlineFilterOptions\n{\n /**\n * The thickness of the outline\n * @default 1\n */\n thickness?: number;\n /**\n * The color of the outline\n * @example [1.0, 1.0, 1.0] = 0xffffff\n * @default 0x000000\n */\n color?: ColorSource;\n /**\n * The alpha of the outline\n * @default 1\n */\n alpha?: number;\n /**\n * The quality of the outline from `0` to `1`.\n * Using a higher quality setting will result in more accuracy but slower performance\n * @default 0.1\n */\n quality?: number;\n /**\n * Whether to only render outline, not the contents.\n * @default false\n */\n knockout?: boolean;\n}\n\n/**\n * OutlineFilter, originally by mishaa\n * http://www.html5gamedevs.com/topic/10640-outline-a-sprite-change-certain-colors/?p=69966\n * http://codepen.io/mishaa/pen/emGNRB
\n * ![original](../screenshots/original.png)![filter](../screenshots/outline.png)\n *\n * @class\n * @extends Filter *\n * @example\n * someSprite.filters = [new OutlineFilter(2, 0x99ff99)];\n */\nexport class OutlineFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: OutlineFilterOptions = {\n thickness: 1,\n color: 0x000000,\n alpha: 1,\n quality: 0.1,\n knockout: false,\n };\n\n /** The minimum number of samples for rendering outline. */\n public static MIN_SAMPLES = 1;\n\n /** The maximum number of samples for rendering outline. */\n public static MAX_SAMPLES = 100;\n\n public uniforms: {\n uThickness: Float32Array,\n uColor: Float32Array,\n uAlpha: number;\n uAngleStep: number,\n uKnockout: number,\n };\n\n private _thickness!: number;\n private _quality!: number;\n private _color!: Color;\n\n /**\n * @param options - Options for the OutlineFilter constructor.\n */\n constructor(options?: OutlineFilterOptions);\n /**\n * @deprecated since 6.0.0\n *\n * @param {number} [thickness=1] - The tickness of the outline. Make it 2 times more for resolution 2\n * @param {number} [color=0x000000] - The color of the outline.\n * @param {number} [quality=0.1] - The quality of the outline from `0` to `1`, using a higher quality\n * setting will result in slower performance and more accuracy.\n * @param {number} [alpha=1.0] - The alpha of the outline.\n * @param {boolean} [knockout=false] - Only render outline, not the contents.\n */\n constructor(thickness?: number, color?: number, quality?: number, alpha?: number, knockout?: boolean);\n /** @ignore */\n constructor(...args: [OutlineFilterOptions?] | [number?, number?, number?, number?, boolean?])\n {\n let options = args[0] ?? {};\n\n if (typeof options === 'number')\n {\n // eslint-disable-next-line max-len\n deprecation('6.0.0', 'OutlineFilter constructor params are now options object. See params: { thickness, color, quality, alpha, knockout }');\n\n options = { thickness: options };\n\n if (args[1] !== undefined) options.color = args[1];\n if (args[2] !== undefined) options.quality = args[2];\n if (args[3] !== undefined) options.alpha = args[3];\n if (args[4] !== undefined) options.knockout = args[4];\n }\n\n options = { ...OutlineFilter.DEFAULT_OPTIONS, ...options };\n\n const quality = options.quality ?? 0.1;\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment: fragment.replace(/\\$\\{ANGLE_STEP\\}/, OutlineFilter.getAngleStep(quality).toFixed(7)),\n name: 'outline-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n outlineUniforms: {\n uThickness: { value: new Float32Array(2), type: 'vec2' },\n uColor: { value: new Float32Array(3), type: 'vec3' },\n uAlpha: { value: options.alpha, type: 'f32' },\n uAngleStep: { value: 0, type: 'f32' },\n uKnockout: { value: options.knockout ? 1 : 0, type: 'f32' },\n }\n },\n });\n\n this.uniforms = this.resources.outlineUniforms.uniforms;\n this.uniforms.uAngleStep = OutlineFilter.getAngleStep(quality);\n this._color = new Color();\n this.color = options.color ?? 0x000000;\n\n Object.assign(this, options);\n }\n\n /**\n * Override existing apply method in `Filter`\n * @override\n * @ignore\n */\n public override apply(\n filterManager: FilterSystem,\n input: Texture,\n output: RenderSurface,\n clearMode: boolean\n ): void\n {\n this.uniforms.uThickness[0] = this.thickness / input.source.width;\n this.uniforms.uThickness[1] = this.thickness / input.source.height;\n\n filterManager.applyFilter(this, input, output, clearMode);\n }\n\n /**\n * Get the angleStep by quality\n * @param quality\n */\n private static getAngleStep(quality: number): number\n {\n return parseFloat(((Math.PI * 2) / Math.max(\n quality * OutlineFilter.MAX_SAMPLES,\n OutlineFilter.MIN_SAMPLES,\n )).toFixed(7));\n }\n\n /**\n * The thickness of the outline\n * @default 1\n */\n get thickness(): number { return this._thickness; }\n set thickness(value: number) { this._thickness = this.padding = value; }\n\n /**\n * The color value of the ambient color\n * @example [1.0, 1.0, 1.0] = 0xffffff\n * @default 0x000000\n */\n get color(): ColorSource { return this._color.value as ColorSource; }\n set color(value: ColorSource)\n {\n this._color.setValue(value);\n const [r, g, b] = this._color.toArray();\n\n this.uniforms.uColor[0] = r;\n this.uniforms.uColor[1] = g;\n this.uniforms.uColor[2] = b;\n }\n\n /**\n * Coefficient for alpha multiplication\n * @default 1\n */\n get alpha(): number { return this.uniforms.uAlpha; }\n set alpha(value: number) { this.uniforms.uAlpha = value; }\n\n /**\n * The quality of the outline from `0` to `1`.\n * Using a higher quality setting will result in more accuracy but slower performance\n * @default 0.1\n */\n get quality(): number { return this._quality; }\n set quality(value: number)\n {\n this._quality = value;\n this.uniforms.uAngleStep = OutlineFilter.getAngleStep(value);\n }\n\n /**\n * Whether to only render outline, not the contents.\n * @default false\n */\n get knockout(): boolean { return this.uniforms.uKnockout === 1; }\n set knockout(value: boolean) { this.uniforms.uKnockout = value ? 1 : 0; }\n}\n","import { Filter, GlProgram, GpuProgram, Point } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './pixelate.frag';\nimport source from './pixelate.wgsl';\n\ntype Size = number | number[] | Point;\n\n/**\n * This filter applies a pixelate effect making display objects appear 'blocky'.
\n * ![original](../screenshots/original.png)![filter](../screenshots/pixelate.png)\n *\n * @class\n * @extends Filter\n */\nexport class PixelateFilter extends Filter\n{\n /**\n * @param {Point|Array|number} [size=10] - Either the width/height of the size of the pixels, or square size\n */\n constructor(size: Size = 10)\n {\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'pixelate-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n pixelateUniforms: {\n uSize: { value: new Float32Array(2), type: 'vec2' },\n },\n },\n });\n\n this.size = size;\n }\n\n /**\n * The size of the pixels\n * @default [10,10]\n */\n get size(): Size { return this.resources.pixelateUniforms.uniforms.uSize; }\n set size(value: Size)\n {\n if (value instanceof Point)\n {\n this.sizeX = value.x;\n this.sizeY = value.y;\n }\n else if (Array.isArray(value))\n {\n this.resources.pixelateUniforms.uniforms.uSize = value;\n }\n else\n {\n this.sizeX = this.sizeY = value;\n }\n }\n\n /**\n * The size of the pixels on the `x` axis\n * @default 10\n */\n get sizeX(): number { return this.resources.pixelateUniforms.uniforms.uSize[0]; }\n set sizeX(value: number) { this.resources.pixelateUniforms.uniforms.uSize[0] = value; }\n\n /**\n * The size of the pixels on the `y` axis\n * @default 10\n */\n get sizeY(): number { return this.resources.pixelateUniforms.uniforms.uSize[1]; }\n set sizeY(value: number) { this.resources.pixelateUniforms.uniforms.uSize[1] = value; }\n}\n","import { deprecation, Filter, GlProgram, GpuProgram } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './radial-blur.frag';\nimport source from './radial-blur.wgsl';\n\nimport type { PointData } from 'pixi.js';\n\n/** Options for the RadialBlurFilter constructor. */\nexport interface RadialBlurFilterOptions\n{\n /**\n * Sets the angle of the motion for blur effect\n * @default 0\n */\n angle?: number;\n /**\n * The `x` and `y` offset coordinates to change the position of the center of the circle of effect.\n * This should be a size 2 array or an object containing `x` and `y` values, you cannot change types\n * once defined in the constructor\n * @default {x:0,y:0}\n */\n center?: PointData | number[];\n /**\n * The kernelSize of the blur filter. Must be odd number >= 3\n * @default 5\n */\n kernelSize?: number;\n /**\n * The maximum size of the blur radius, less than `0` equates to infinity\n * @default -1\n */\n radius?: number\n}\n\n/**\n * The RadialBlurFilter applies a Motion blur to an object.
\n * ![original](../screenshots/original.png)![filter](../screenshots/radial-blur.png)\n *\n * @class\n * @extends Filter\n */\nexport class RadialBlurFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: RadialBlurFilterOptions = {\n angle: 0,\n center: { x: 0, y: 0 },\n kernelSize: 5,\n radius: -1,\n };\n\n public uniforms: {\n uRadian: number;\n uCenter: PointData;\n uKernelSize: number;\n uRadius: number;\n };\n\n private _angle!: number;\n private _kernelSize!: number;\n\n /**\n * @param options - Options for the RadialBlurFilter constructor.\n */\n constructor(options?: RadialBlurFilterOptions);\n /**\n * @deprecated since 6.0.0\n *\n * @param {number} [angle=0] - Sets the angle of the motion for blur effect.\n * @param {PIXI.Point|number[]} [center=[0,0]] - The center of the radial.\n * @param {number} [kernelSize=5] - The kernelSize of the blur filter. Must be odd number >= 3\n * @param {number} [radius=-1] - The maximum size of the blur radius, `-1` is infinite\n */\n constructor(angle?: number, center?: PointData | number[], kernelSize?: number, radius?: number);\n /** @ignore */\n constructor(...args: [RadialBlurFilterOptions?] | [number?, (PointData | number[])?, number?, number?])\n {\n let options = args[0] ?? {};\n\n if (typeof options === 'number')\n {\n // eslint-disable-next-line max-len\n deprecation('6.0.0', 'RadialBlurFilter constructor params are now options object. See params: { angle, center, kernelSize, radius }');\n\n options = { angle: options };\n\n if (args[1])\n {\n const x = 'x' in args[1] ? args[1].x : args[1][0];\n const y = 'y' in args[1] ? args[1].y : args[1][1];\n\n options.center = { x, y };\n }\n if (args[2]) options.kernelSize = args[2];\n if (args[3]) options.radius = args[3];\n }\n\n options = { ...RadialBlurFilter.DEFAULT_OPTIONS, ...options };\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'radial-blur-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n radialBlurUniforms: {\n uRadian: { value: 0, type: 'f32' },\n uCenter: { value: options.center, type: 'vec2' },\n uKernelSize: { value: options.kernelSize, type: 'i32' },\n uRadius: { value: options.radius, type: 'f32' },\n }\n },\n });\n\n this.uniforms = this.resources.radialBlurUniforms.uniforms;\n\n Object.assign(this, options);\n }\n\n private _updateKernelSize()\n {\n this.uniforms.uKernelSize = this._angle !== 0 ? this.kernelSize : 0;\n }\n\n /**\n * Sets the angle in degrees of the motion for blur effect.\n * @default 0\n */\n get angle(): number { return this._angle; }\n set angle(value: number)\n {\n this._angle = value;\n this.uniforms.uRadian = value * Math.PI / 180;\n this._updateKernelSize();\n }\n\n /**\n * The `x` and `y` offset coordinates to change the position of the center of the circle of effect.\n * This should be a size 2 array or an object containing `x` and `y` values, you cannot change types\n * once defined in the constructor\n * @default {x:0,y:0}\n */\n get center(): PointData { return this.uniforms.uCenter; }\n set center(value: PointData | number[])\n {\n if (Array.isArray(value))\n {\n value = { x: value[0], y: value[1] };\n }\n\n this.uniforms.uCenter = value;\n }\n\n /**\n * Sets the velocity of the motion for blur effect on the `x` axis\n * @default 0\n */\n get centerX(): number { return this.center.x; }\n set centerX(value: number) { this.center.x = value; }\n\n /**\n * Sets the velocity of the motion for blur effect on the `x` axis\n * @default 0\n */\n get centerY(): number { return this.center.y; }\n set centerY(value: number) { this.center.y = value; }\n\n /**\n * The kernelSize of the blur filter. Must be odd number >= 3\n * @default 5\n */\n get kernelSize(): number { return this._kernelSize; }\n set kernelSize(value: number)\n {\n this._kernelSize = value;\n this._updateKernelSize();\n }\n\n /**\n * The maximum size of the blur radius, less than `0` equates to infinity\n * @default -1\n */\n get radius(): number { return this.uniforms.uRadius; }\n set radius(value: number) { this.uniforms.uRadius = value < 0 || value === Infinity ? -1 : value; }\n}\n","import { Filter, GlProgram, GpuProgram } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './reflection.frag';\nimport source from './reflection.wgsl';\n\nimport type { FilterSystem, RenderSurface, Texture } from 'pixi.js';\n\n/** [MIN, MAX] */\ntype Range = [number, number] | Float32Array;\n\n/** Options for the ReflectionFilter constructor. */\nexport interface ReflectionFilterOptions\n{\n /**\n * `true` to reflect the image, `false` for waves-only\n * @default true\n */\n mirror?: boolean;\n /**\n * Vertical position of the reflection point, `0.5` equates to the middle\n * smaller numbers produce a larger reflection, larger numbers produce a smaller reflection\n * @default 0.5\n */\n boundary?: number;\n /**\n * Starting and ending amplitude of waves\n * @default [0,20]\n */\n amplitude?: Range;\n /**\n * Starting and ending length of waves\n * @default [30,100]\n */\n waveLength?: Range;\n /**\n * Starting and ending alpha values\n * @default [1,1]\n */\n alpha?: Range;\n /**\n * Time for animating position of waves\n * @default 0\n */\n time?: number;\n}\n\n/**\n * Applies a reflection effect to simulate the reflection on water with waves.
\n * ![original](../screenshots/original.png)![filter](../screenshots/reflection.png)\n *\n * @class\n * @extends Filter\n */\nexport class ReflectionFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: ReflectionFilterOptions = {\n mirror: true,\n boundary: 0.5,\n amplitude: [0, 20],\n waveLength: [30, 100],\n alpha: [1, 1],\n time: 0,\n };\n\n public uniforms: {\n uMirror: number;\n uBoundary: number;\n uAmplitude: Float32Array;\n uWavelength: Float32Array;\n uAlpha: Float32Array;\n uTime: number;\n uDimensions: Float32Array;\n };\n\n /**\n * Time for animating position of waves\n * @default 0\n */\n public time = 0;\n\n /**\n * @param options - Options for the ReflectionFilter constructor.\n */\n constructor(options?: ReflectionFilterOptions)\n {\n options = { ...ReflectionFilter.DEFAULT_OPTIONS, ...options };\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'reflection-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n reflectionUniforms: {\n uMirror: { value: options.mirror ? 1 : 0, type: 'f32' },\n uBoundary: { value: options.boundary, type: 'f32' },\n uAmplitude: { value: options.amplitude, type: 'vec2' },\n uWavelength: { value: options.waveLength, type: 'vec2' },\n uAlpha: { value: options.alpha, type: 'vec2' },\n uTime: { value: options.time, type: 'f32' },\n uDimensions: { value: new Float32Array(2), type: 'vec2' },\n }\n },\n });\n\n this.uniforms = this.resources.reflectionUniforms.uniforms;\n\n Object.assign(this, options);\n }\n\n /**\n * Override existing apply method in `Filter`\n * @override\n * @ignore\n */\n public override apply(\n filterManager: FilterSystem,\n input: Texture,\n output: RenderSurface,\n clearMode: boolean\n ): void\n {\n this.uniforms.uDimensions[0] = input.frame.width;\n this.uniforms.uDimensions[1] = input.frame.height;\n\n this.uniforms.uTime = this.time;\n\n filterManager.applyFilter(this, input, output, clearMode);\n }\n\n /**\n * `true` to reflect the image, `false` for waves-only\n * @default true\n */\n get mirror(): boolean { return this.uniforms.uMirror > 0.5; }\n set mirror(value: boolean) { this.uniforms.uMirror = value ? 1 : 0; }\n\n /**\n * Vertical position of the reflection point, default is 50% (middle)\n * smaller numbers produce a larger reflection, larger numbers produce a smaller reflection.\n * @default 0.5\n */\n get boundary(): number { return this.uniforms.uBoundary; }\n set boundary(value: number) { this.uniforms.uBoundary = value; }\n\n /**\n * Starting and ending amplitude of waves\n * @default [0,20]\n */\n get amplitude(): Range { return Array.from(this.uniforms.uAmplitude) as Range; }\n set amplitude(value: Range)\n {\n this.uniforms.uAmplitude[0] = value[0];\n this.uniforms.uAmplitude[1] = value[1];\n }\n\n /**\n * Starting amplitude of waves\n * @default 0\n */\n get amplitudeStart(): number { return this.uniforms.uAmplitude[0]; }\n set amplitudeStart(value: number) { this.uniforms.uAmplitude[0] = value; }\n\n /**\n * Starting amplitude of waves\n * @default 20\n */\n get amplitudeEnd(): number { return this.uniforms.uAmplitude[1]; }\n set amplitudeEnd(value: number) { this.uniforms.uAmplitude[1] = value; }\n\n /**\n * Starting and ending length of waves\n * @default [30,100]\n */\n get waveLength(): Range { return Array.from(this.uniforms.uWavelength) as Range; }\n set waveLength(value: Range)\n {\n this.uniforms.uWavelength[0] = value[0];\n this.uniforms.uWavelength[1] = value[1];\n }\n\n /**\n * Starting wavelength of waves\n * @default 30\n */\n get wavelengthStart(): number { return this.uniforms.uWavelength[0]; }\n set wavelengthStart(value: number) { this.uniforms.uWavelength[0] = value; }\n\n /**\n * Starting wavelength of waves\n * @default 100\n */\n get wavelengthEnd(): number { return this.uniforms.uWavelength[1]; }\n set wavelengthEnd(value: number) { this.uniforms.uWavelength[1] = value; }\n\n /**\n * Starting and ending alpha values\n * @default [1,1]\n */\n get alpha(): Range { return Array.from(this.uniforms.uAlpha) as Range; }\n set alpha(value: Range)\n {\n this.uniforms.uAlpha[0] = value[0];\n this.uniforms.uAlpha[1] = value[1];\n }\n\n /**\n * Starting wavelength of waves\n * @default 1\n */\n get alphaStart(): number { return this.uniforms.uAlpha[0]; }\n set alphaStart(value: number) { this.uniforms.uAlpha[0] = value; }\n\n /**\n * Starting wavelength of waves\n * @default 1\n */\n get alphaEnd(): number { return this.uniforms.uAlpha[1]; }\n set alphaEnd(value: number) { this.uniforms.uAlpha[1] = value; }\n}\n","import { deprecation, Filter, GlProgram, GpuProgram, PointData } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './rgb-split.frag';\nimport source from './rgb-split.wgsl';\n\ntype OffsetType = PointData | [number, number];\n\n/** Options for the RGBSplitFilter constructor. */\nexport interface RGBSplitFilterOptions\n{\n /**\n * The amount of offset for the red channel.\n * @default {x:-10,y:0}\n */\n red?: OffsetType;\n /**\n * The amount of offset for the green channel.\n * @default {x:0,y:10}\n */\n green?: OffsetType;\n /**\n * The amount of offset for the blue channel.\n * @default {x:0,y:0}\n */\n blue?: OffsetType;\n}\n\n/**\n * An RGB Split Filter.
\n * ![original](../screenshots/original.png)![filter](../screenshots/rgb.png)\n *\n * @class\n * @extends Filter\n */\nexport class RGBSplitFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: RGBSplitFilterOptions = {\n red: { x: -10, y: 0 },\n green: { x: 0, y: 10 },\n blue: { x: 0, y: 0 },\n };\n\n public uniforms: {\n uRed: PointData;\n uGreen: PointData;\n uBlue: PointData;\n };\n\n /**\n * @param options - Options for the RGBSplitFilter constructor.\n */\n constructor(options?: RGBSplitFilterOptions);\n /**\n * @deprecated since 6.0.0\n *\n * @param {PIXI.PointData | number[]} [red=[-10,0]] - Red channel offset\n * @param {PIXI.PointData | number[]} [green=[0, 10]] - Green channel offset\n * @param {PIXI.PointData | number[]} [blue=[0, 0]] - Blue channel offset\n */\n constructor(red?: OffsetType, green?: OffsetType, blue?: OffsetType);\n /** @ignore */\n constructor(...args: [RGBSplitFilterOptions?] | [OffsetType?, OffsetType?, OffsetType?])\n {\n let options = args[0] ?? {};\n\n if (Array.isArray(options) || ('x' in options && 'y' in options))\n {\n // eslint-disable-next-line max-len\n deprecation('6.0.0', 'RGBSplitFilter constructor params are now options object. See params: { red, green, blue }');\n\n options = { red: options };\n\n if (args[1] !== undefined) options.green = args[1];\n if (args[2] !== undefined) options.blue = args[2];\n }\n\n options = { ...RGBSplitFilter.DEFAULT_OPTIONS, ...options };\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'rgb-split-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n rgbSplitUniforms: {\n uRed: { value: options.red, type: 'vec2' },\n uGreen: { value: options.green, type: 'vec2' },\n uBlue: { value: options.blue, type: 'vec2' },\n }\n },\n });\n\n this.uniforms = this.resources.rgbSplitUniforms.uniforms;\n\n Object.assign(this, options);\n }\n\n /**\n * Red channel offset.\n * @default {x:-10,y:0}\n */\n get red(): PointData { return this.uniforms.uRed; }\n set red(value: OffsetType)\n {\n if (Array.isArray(value))\n {\n value = { x: value[0], y: value[1] };\n }\n\n this.uniforms.uRed = value;\n }\n\n /**\n * Amount of x-axis offset for the red channel.\n * @default -10\n */\n get redX(): number { return this.red.x; }\n set redX(value: number) { this.red.x = value; }\n\n /**\n * Amount of y-axis offset for the red channel.\n * @default 0\n */\n get redY(): number { return this.red.y; }\n set redY(value: number) { this.red.y = value; }\n\n /**\n * Green channel offset.\n * @default {x:0,y:10}\n */\n get green(): PointData { return this.uniforms.uGreen; }\n set green(value: OffsetType)\n {\n if (Array.isArray(value))\n {\n value = { x: value[0], y: value[1] };\n }\n\n this.uniforms.uGreen = value;\n }\n\n /**\n * Amount of x-axis offset for the green channel.\n * @default 0\n */\n get greenX(): number { return this.green.x; }\n set greenX(value: number) { this.green.x = value; }\n\n /**\n * Amount of y-axis offset for the green channel.\n * @default 10\n */\n get greenY(): number { return this.green.y; }\n set greenY(value: number) { this.green.y = value; }\n\n /**\n * Blue channel offset.\n * @default {x:0,y:0}\n */\n get blue(): PointData { return this.uniforms.uBlue; }\n set blue(value: OffsetType)\n {\n if (Array.isArray(value))\n {\n value = { x: value[0], y: value[1] };\n }\n\n this.uniforms.uBlue = value;\n }\n\n /**\n * Amount of x-axis offset for the blue channel.\n * @default 0\n */\n get blueX(): number { return this.blue.x; }\n set blueX(value: number) { this.blue.x = value; }\n\n /**\n * Amount of y-axis offset for the blue channel.\n * @default 0\n */\n get blueY(): number { return this.blue.y; }\n set blueY(value: number) { this.blue.y = value; }\n}\n","import {\n deprecation,\n Filter,\n FilterSystem,\n GlProgram,\n GpuProgram,\n PointData,\n RenderSurface,\n Texture,\n} from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './shockwave.frag';\nimport source from './shockwave.wgsl';\n\n/** Options for the ShockwaveFilter constructor. */\nexport interface ShockwaveFilterOptions\n{\n /**\n * The `x` and `y` center coordinates to change the position of the center of the circle of effect.\n * @default {x:0,y:0}\n */\n center?: PointData;\n /**\n * The speed about the shockwave ripples out. The unit is `pixel-per-second`\n * @default 500\n */\n speed?: number;\n /**\n * The amplitude of the shockwave\n * @default 30\n */\n amplitude?: number;\n /**\n * The wavelength of the shockwave\n * @default 160\n */\n wavelength?: number;\n /**\n * The brightness of the shockwave\n * @default 1\n */\n brightness?: number;\n /**\n * The maximum radius of shockwave. less than `0` means the max is an infinite distance\n * @default -1\n */\n radius?: number;\n /**\n * Sets the elapsed time of the shockwave.\n * @default 0\n */\n time?: number;\n}\n\n/**\n * Create a visual wrinkle effect by like a pond or blast wave.
\n * ![original](../screenshots/original.png)![filter](../screenshots/shockwave.gif)\n *\n * {@link https://github.com/evanw/glfx.js/blob/master/src/filters/adjust/noise.js original filter}\n * @author Vico @vicocotea\n */\nexport class ShockwaveFilter extends Filter\n{\n /** Default shockwave filter options */\n public static readonly DEFAULT_OPTIONS: ShockwaveFilterOptions = {\n /** The `x` and `y` center coordinates to change the position of the center of the circle of effect. */\n center: { x: 0, y: 0 },\n /** The speed about the shockwave ripples out. The unit is `pixel-per-second` */\n speed: 500,\n /** The amplitude of the shockwave */\n amplitude: 30,\n /** The wavelength of the shockwave */\n wavelength: 160,\n /** The brightness of the shockwave */\n brightness: 1,\n /** The maximum radius of shockwave. less than `0` means the max is an infinite distance */\n radius: -1,\n };\n\n public uniforms: {\n uTime: number;\n uCenter: PointData;\n uSpeed: number;\n uWave: Float32Array;\n };\n\n /** Sets the elapsed time of the shockwave. It could control the current size of shockwave. */\n public time: number;\n\n /**\n * @param options - Options for the ShockwaveFilter constructor.\n */\n constructor(options?: ShockwaveFilterOptions);\n /**\n * @deprecated since 6.0.0\n *\n * @param {PIXI.PointData|number[]} [center=[0.5, 0.5]] - See `center` property.\n * @param {object} [options] - The optional parameters of shockwave filter.\n * @param {number} [options.amplitude=0.5] - See `amplitude`` property.\n * @param {number} [options.wavelength=1.0] - See `wavelength` property.\n * @param {number} [options.speed=500.0] - See `speed` property.\n * @param {number} [options.brightness=8] - See `brightness` property.\n * @param {number} [options.radius=4] - See `radius` property.\n * @param {number} [time=0] - See `time` property.\n */\n constructor(center?: PointData | number[], options?: Omit, time?: number);\n /** @ignore */\n // eslint-disable-next-line max-len\n constructor(...args: [ShockwaveFilterOptions?] | [(PointData | number[])?, Omit?, number?])\n {\n let options = args[0] ?? {};\n\n if (Array.isArray(options) || ('x' in options && 'y' in options))\n {\n // eslint-disable-next-line max-len\n deprecation('6.0.0', 'ShockwaveFilter constructor params are now options object. See params: { center, speed, amplitude, wavelength, brightness, radius, time }');\n\n options = { center: options, ...args[1] } as ShockwaveFilterOptions;\n\n if (args[2] !== undefined) options.time = args[2];\n }\n\n options = { ...ShockwaveFilter.DEFAULT_OPTIONS, ...options };\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'shockwave-filter'\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n shockwaveUniforms: {\n uTime: { value: options.time, type: 'f32' },\n uCenter: { value: options.center, type: 'vec2' },\n uSpeed: { value: options.speed, type: 'f32' },\n uWave: { value: new Float32Array(4), type: 'vec4' },\n },\n },\n });\n\n this.time = 0;\n\n this.uniforms = this.resources.shockwaveUniforms.uniforms;\n\n Object.assign(this, options);\n }\n\n public override apply(\n filterManager: FilterSystem,\n input: Texture,\n output: RenderSurface,\n clearMode: boolean\n ): void\n {\n // There is no set/get of `time`, for performance.\n // Because in the most real cases, `time` will be changed in ever game tick.\n // Use set/get will take more function-call.\n this.uniforms.uTime = this.time;\n filterManager.applyFilter(this, input, output, clearMode);\n }\n\n /**\n * The `x` and `y` center coordinates to change the position of the center of the circle of effect.\n * @default [0,0]\n */\n get center(): PointData { return this.uniforms.uCenter; }\n set center(value: PointData | number[])\n {\n if (Array.isArray(value))\n {\n value = { x: value[0], y: value[1] };\n }\n\n this.uniforms.uCenter = value;\n }\n\n /**\n * Sets the center of the effect in normalized screen coords on the `x` axis\n * @default 0\n */\n get centerX(): number { return this.uniforms.uCenter.x; }\n set centerX(value: number) { this.uniforms.uCenter.x = value; }\n\n /**\n * Sets the center of the effect in normalized screen coords on the `y` axis\n * @default 0\n */\n get centerY(): number { return this.uniforms.uCenter.y; }\n set centerY(value: number) { this.uniforms.uCenter.y = value; }\n\n /**\n * The speed about the shockwave ripples out. The unit is `pixel-per-second`\n * @default 500\n */\n get speed(): number { return this.uniforms.uSpeed; }\n set speed(value: number) { this.uniforms.uSpeed = value; }\n\n /**\n * The amplitude of the shockwave\n * @default 30\n */\n get amplitude(): number { return this.uniforms.uWave[0]; }\n set amplitude(value: number) { this.uniforms.uWave[0] = value; }\n\n /**\n * The wavelength of the shockwave\n * @default 160\n */\n get wavelength(): number { return this.uniforms.uWave[1]; }\n set wavelength(value: number) { this.uniforms.uWave[1] = value; }\n\n /**\n * The brightness of the shockwave\n * @default 1\n */\n get brightness(): number { return this.uniforms.uWave[2]; }\n set brightness(value: number) { this.uniforms.uWave[2] = value; }\n\n /**\n * The maximum radius of shockwave. less than `0` means the max is an infinite distance\n * @default -1\n */\n get radius(): number { return this.uniforms.uWave[3]; }\n set radius(value: number) { this.uniforms.uWave[3] = value; }\n}\n","import {\n Color,\n ColorSource,\n deprecation,\n Filter,\n FilterSystem,\n GlProgram,\n GpuProgram,\n RenderSurface,\n Texture,\n} from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './simple-lightmap.frag';\nimport source from './simple-lightmap.wgsl';\n\ntype DeprecatedColor = number | number[];\n\n/** Options for the SimpleLightmapFilter constructor. */\nexport interface SimpleLightmapFilterOptions\n{\n /** A texture where your lightmap is rendered */\n lightMap: Texture;\n /**\n * The color value of the ambient color\n * @example [1.0, 1.0, 1.0] = 0xffffff\n * @default 0x000000\n */\n color?: ColorSource;\n /**\n * Coefficient for alpha multiplication\n * @default 1\n */\n alpha?: number;\n}\n\n/**\n* SimpleLightmap, originally by Oza94\n* {@link http://www.html5gamedevs.com/topic/20027-pixijs-simple-lightmapping/}\n* {@link http://codepen.io/Oza94/pen/EPoRxj}\n*\n* You have to specify filterArea, or suffer consequences.\n* You may have to use it with `filter.dontFit = true`,\n* until we rewrite this using same approach as for DisplacementFilter.\n*\n* ![original](../screenshots/original.png)![filter](../screenshots/simple-lightmap.png)\n* @class\n* @extends Filter\n* @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n*\n* @example\n* displayObject.filters = [new SimpleLightmapFilter(texture, 0x666666)];\n*/\nexport class SimpleLightmapFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: SimpleLightmapFilterOptions = {\n lightMap: Texture.WHITE,\n color: 0x000000,\n alpha: 1\n };\n\n public uniforms: {\n uColor: Float32Array;\n uAlpha: number;\n uDimensions: Float32Array;\n };\n\n private _color!: Color;\n private _lightMap!: Texture;\n\n /**\n * @param options - Options for the SimpleLightmapFilter constructor.\n */\n constructor(options: SimpleLightmapFilterOptions);\n /**\n * @deprecated since 6.0.0\n *\n * @param {PIXI.Texture} texture - a texture where your lightmap is rendered\n * @param {Array|number} [color=0x000000] - An RGBA array of the ambient color\n * @param {number} [alpha=1] - Default alpha set independent of color (if it's a number, not array).\n */\n constructor(texture: Texture, color?: DeprecatedColor, alpha?: number);\n /** @ignore */\n constructor(...args: [SimpleLightmapFilterOptions] | [Texture, DeprecatedColor?, number?])\n {\n let options = args[0] ?? {};\n\n if (options instanceof Texture)\n {\n // eslint-disable-next-line max-len\n deprecation('6.0.0', 'SimpleLightmapFilter constructor params are now options object. See params: { lightMap, color, alpha }');\n\n options = { lightMap: options };\n\n if (args[1] !== undefined) options.color = args[1];\n if (args[2] !== undefined) options.alpha = args[2];\n }\n\n options = { ...SimpleLightmapFilter.DEFAULT_OPTIONS, ...options };\n\n if (!options.lightMap) throw Error('No light map texture source was provided to SimpleLightmapFilter');\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'simple-lightmap-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n simpleLightmapUniforms: {\n uColor: { value: new Float32Array(3), type: 'vec3' },\n uAlpha: { value: options.alpha, type: 'f32' },\n uDimensions: { value: new Float32Array(2), type: 'vec2' },\n },\n uMapTexture: options.lightMap.source,\n uMapSampler: options.lightMap.source.style,\n },\n });\n\n this.uniforms = this.resources.simpleLightmapUniforms.uniforms;\n this._color = new Color();\n this.color = options.color ?? 0x000000;\n\n Object.assign(this, options);\n }\n\n /**\n * Override existing apply method in `Filter`\n * @override\n * @ignore\n */\n public override apply(\n filterManager: FilterSystem,\n input: Texture,\n output: RenderSurface,\n clearMode: boolean,\n ): void\n {\n this.uniforms.uDimensions[0] = input.frame.width;\n this.uniforms.uDimensions[1] = input.frame.height;\n\n // draw the filter...\n filterManager.applyFilter(this, input, output, clearMode);\n }\n\n /** A sprite where your lightmap is rendered */\n get lightMap(): Texture { return this._lightMap; }\n set lightMap(value: Texture)\n {\n this._lightMap = value;\n this.resources.uMapTexture = value.source;\n this.resources.uMapSampler = value.source.style;\n }\n\n /**\n * The color value of the ambient color\n * @example [1.0, 1.0, 1.0] = 0xffffff\n * @default 0x000000\n */\n get color(): ColorSource { return this._color.value as ColorSource; }\n set color(value: ColorSource)\n {\n this._color.setValue(value);\n const [r, g, b] = this._color.toArray();\n\n this.uniforms.uColor[0] = r;\n this.uniforms.uColor[1] = g;\n this.uniforms.uColor[2] = b;\n }\n\n /**\n * Coefficient for alpha multiplication\n * @default 1\n */\n get alpha(): number { return this.uniforms.uAlpha; }\n set alpha(value: number) { this.uniforms.uAlpha = value; }\n}\n","import { Filter, GlProgram, GpuProgram, PointData } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './tilt-shift.frag';\nimport source from './tilt-shift.wgsl';\n\n// @author Vico @vicocotea\n// original filter https://github.com/evanw/glfx.js/blob/master/src/filters/blur/tiltshift.js\n// by Evan Wallace : http://madebyevan.com/\n\n/**\n * Options for creating filter.\n */\ninterface TiltShiftAxisFilterOptions\n{\n /** The strength of the blur. */\n blur?: number;\n /** The strength of the blur gradient */\n gradientBlur?: number;\n /** The position to start the effect at. */\n start?: PointData;\n /** The position to end the effect at. */\n end?: PointData;\n /** The axis that the filter is calculating for. */\n axis?: 'vertical' | 'horizontal';\n}\n\n/**\n * A TiltShiftAxisFilter.\n *\n * @class\n * @extends Filter\n * @private\n */\nexport class TiltShiftAxisFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: TiltShiftAxisFilterOptions = {\n /** The strength of the blur. */\n blur: 100,\n /** The strength of the blur gradient */\n gradientBlur: 600,\n /** The position to start the effect at. */\n start: { x: 0, y: window.innerHeight / 2 },\n /** The position to end the effect at. */\n end: { x: 600, y: window.innerHeight / 2 },\n };\n\n public uniforms: {\n uBlur: Float32Array;\n uStart: PointData\n uEnd: PointData;\n uDelta: Float32Array;\n uTexSize: Float32Array;\n };\n\n private _tiltAxis: TiltShiftAxisFilterOptions['axis'];\n\n constructor(options?: TiltShiftAxisFilterOptions)\n {\n options = { ...TiltShiftAxisFilter.DEFAULT_OPTIONS, ...options } as TiltShiftAxisFilterOptions;\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'tilt-shift-axis-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n tiltShiftUniforms: {\n uBlur: {\n value: new Float32Array([\n options.blur ?? 100,\n options.gradientBlur ?? 600\n ]), type: 'vec2'\n },\n uStart: { value: options.start, type: 'vec2' },\n uEnd: { value: options.end, type: 'vec2' },\n uDelta: { value: new Float32Array([30, 30]), type: 'vec2' },\n uTexSize: { value: new Float32Array([window.innerWidth, window.innerHeight]), type: 'vec2' },\n },\n },\n });\n\n this.uniforms = this.resources.tiltShiftUniforms.uniforms;\n this._tiltAxis = options.axis;\n this.updateDelta();\n }\n\n /** Updates the filter delta values. */\n protected updateDelta(): void\n {\n this.uniforms.uDelta[0] = 0;\n this.uniforms.uDelta[1] = 0;\n\n if (this._tiltAxis === undefined) return;\n\n const end = this.uniforms.uEnd;\n const start = this.uniforms.uStart;\n\n const dx = end.x - start.x;\n const dy = end.y - start.y;\n const d = Math.sqrt((dx * dx) + (dy * dy));\n\n const isVert = this._tiltAxis === 'vertical';\n\n this.uniforms.uDelta[0] = !isVert ? dx / d : -dy / d;\n this.uniforms.uDelta[1] = !isVert ? dy / d : dx / d;\n }\n\n // /** The strength of the blur. */\n // get blur(): number { return this.uniforms.uBlur[0]; }\n // set blur(value: number) { this.uniforms.uBlur[0] = value; }\n\n // /** The strength of the gradient blur. */\n // get gradientBlur(): number { return this.uniforms.uBlur[1]; }\n // set gradientBlur(value: number) { this.uniforms.uBlur[1] = value; }\n\n // /** The start position of the effect. */\n // get start(): PointData { return this.uniforms.uStart; }\n // set start(value: PointData)\n // {\n // this.uniforms.uStart = value;\n // this.updateDelta();\n // }\n\n // /** The start position of the effect on the `x` axis. */\n // get startX(): number { return this.start.x; }\n // set startX(value: number)\n // {\n // this.start.x = value;\n // this.updateDelta();\n // }\n\n // /** The start position of the effect on the `y` axis. */\n // get startY(): number { return this.startY; }\n // set startY(value: number)\n // {\n // this.start.y = value;\n // this.updateDelta();\n // }\n\n // /** The end position of the effect. */\n // get end(): PointData { return this.uniforms.uEnd; }\n // set end(value: PointData)\n // {\n // this.uniforms.uEnd = value;\n // this.updateDelta();\n // }\n\n // /** The end position of the effect on the `x` axis. */\n // get endX(): number { return this.end.x; }\n // set endX(value: number)\n // {\n // this.end.x = value;\n // this.updateDelta();\n // }\n\n // /** The end position of the effect on the `y` axis. */\n // get endY(): number { return this.end.y; }\n // set endY(value: number)\n // {\n // this.end.y = value;\n // this.updateDelta();\n // }\n}\n","import { FilterSystem, TexturePool } from 'pixi.js';\nimport { TiltShiftAxisFilter } from './TiltShiftAxisFilter';\n\nimport type { PointData, RenderSurface, Texture } from 'pixi.js';\n\n/** Options for the TiltShiftFilter constructor. */\nexport interface TiltShiftFilterOptions\n{\n /** The strength of the blur. */\n blur?: number;\n /** The strength of the blur gradient */\n gradientBlur?: number;\n /** The position to start the effect at. */\n start?: PointData;\n /** The position to end the effect at. */\n end?: PointData;\n}\n\n/**\n * A TiltShift Filter. Manages the pass of both a TiltShiftXFilter and TiltShiftYFilter.
\n * ![original](../screenshots/original.png)![filter](../screenshots/tilt-shift.png)\n *\n * author Vico @vicocotea\n * {@link https://github.com/evanw/glfx.js/blob/master/src/filters/blur/tiltshift.js original filter }\n * by {@link http://madebyevan.com/ Evan Wallace }\n *\n * @class\n * @extends Filter\n */\nexport class TiltShiftFilter extends TiltShiftAxisFilter\n{\n private _tiltShiftYFilter: TiltShiftAxisFilter;\n\n /**\n * @param options - Options for the TiltShiftFilter constructor.\n */\n constructor(options?: TiltShiftFilterOptions)\n {\n options = { ...TiltShiftAxisFilter.DEFAULT_OPTIONS, ...options };\n\n super({ ...options, axis: 'horizontal' });\n this._tiltShiftYFilter = new TiltShiftAxisFilter({ ...options, axis: 'vertical' });\n\n Object.assign(this, options);\n }\n\n /**\n * Override existing apply method in `Filter`\n * @override\n * @ignore\n */\n public override apply(\n filterManager: FilterSystem,\n input: Texture,\n output: RenderSurface,\n clearMode: boolean,\n ): void\n {\n const renderTarget = TexturePool.getSameSizeTexture(input);\n\n filterManager.applyFilter(this, input, renderTarget, true);\n filterManager.applyFilter(this._tiltShiftYFilter, renderTarget, output, clearMode);\n\n TexturePool.returnTexture(renderTarget);\n }\n\n /** The strength of the blur. */\n get blur(): number { return this.uniforms.uBlur[0]; }\n set blur(value: number) { this.uniforms.uBlur[0] = this._tiltShiftYFilter.uniforms.uBlur[0] = value; }\n\n /** The strength of the gradient blur. */\n get gradientBlur(): number { return this.uniforms.uBlur[1]; }\n set gradientBlur(value: number) { this.uniforms.uBlur[1] = this._tiltShiftYFilter.uniforms.uBlur[1] = value; }\n\n /** The position to start the effect at. */\n get start(): PointData { return this.uniforms.uStart; }\n set start(value: PointData) { this.uniforms.uStart = this._tiltShiftYFilter.uniforms.uStart = value; }\n\n /** The position to start the effect at on the `x` axis. */\n get startX(): number { return this.start.x; }\n set startX(value: number) { this.start.x = value; }\n\n /** The position to start the effect at on the `x` axis. */\n get startY(): number { return this.start.y; }\n set startY(value: number) { this.start.y = value; }\n\n /** The position to end the effect at. */\n get end(): PointData { return this.uniforms.uEnd; }\n set end(value: PointData) { this.uniforms.uEnd = this._tiltShiftYFilter.uniforms.uEnd = value; }\n\n /** The position to end the effect at on the `x` axis. */\n get endX(): number { return this.end.x; }\n set endX(value: number) { this.end.x = value; }\n\n /** The position to end the effect at on the `y` axis. */\n get endY(): number { return this.end.y; }\n set endY(value: number) { this.end.y = value; }\n}\n\n","import { Filter, GlProgram, GpuProgram, PointData } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './twist.frag';\nimport source from './twist.wgsl';\n\n/** Options for the TwistFilter constructor. */\nexport interface TwistFilterOptions\n{\n /**\n * Padding for the filter area\n * @default 20\n */\n padding?: number;\n /**\n * The radius of the twist\n * @default 200\n */\n radius?: number;\n /**\n * The angle of the twist\n * @default 4\n */\n angle?: number;\n /**\n * The `x` and `y` offset coordinates to change the position of the center of the circle of effect.\n * This should be a size 2 array or an object containing `x` and `y` values, you cannot change types\n * once defined in the constructor\n * @default {x:0,y:0}\n */\n offset?: PointData;\n}\n\n/**\n * This filter applies a twist effect making display objects appear twisted in the given direction.
\n * ![original](../screenshots/original.png)![filter](../screenshots/twist.png)\n *\n * @class\n * @extends Filter\n */\nexport class TwistFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: TwistFilterOptions = {\n padding: 20,\n radius: 200,\n angle: 4,\n offset: { x: 0, y: 0 },\n };\n\n public uniforms: {\n uTwist: Float32Array;\n uOffset: PointData;\n };\n\n /**\n * @param options - Options for the TwistFilter constructor.\n */\n constructor(options?: Partial)\n {\n options = { ...TwistFilter.DEFAULT_OPTIONS, ...options };\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'twist-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n twistUniforms: {\n uTwist: {\n value: [options.radius ?? 0, options.angle ?? 0],\n type: 'vec2'\n },\n uOffset: {\n value: options.offset,\n type: 'vec2'\n },\n }\n },\n ...options,\n });\n\n this.uniforms = this.resources.twistUniforms.uniforms;\n }\n\n /**\n * The radius of the twist\n * @default 200\n */\n get radius(): number { return this.uniforms.uTwist[0]; }\n set radius(value: number) { this.uniforms.uTwist[0] = value; }\n\n /**\n * The angle of the twist\n * @default 4\n */\n get angle(): number { return this.uniforms.uTwist[1]; }\n set angle(value: number) { this.uniforms.uTwist[1] = value; }\n\n /**\n * The `x` offset coordinate to change the position of the center of the circle of effect\n * @default 0\n */\n get offset(): PointData { return this.uniforms.uOffset; }\n set offset(value: PointData) { this.uniforms.uOffset = value; }\n\n /**\n * The `x` offset coordinate to change the position of the center of the circle of effect\n * @default 0\n */\n get offsetX(): number { return this.offset.x; }\n set offsetX(value: number) { this.offset.x = value; }\n\n /**\n * The `y` offset coordinate to change the position of the center of the circle of effect\n * @default 0\n */\n get offsetY(): number { return this.offset.y; }\n set offsetY(value: number) { this.offset.y = value; }\n}\n","import { Filter, GlProgram, GpuProgram, PointData } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './zoom-blur.frag';\nimport source from './zoom-blur.wgsl';\n\n/** Options for the ZoomBlurFilter constructor. */\nexport interface ZoomBlurFilterOptions\n{\n /**\n * Sets the strength of the zoom blur effect\n * @default 0.1\n */\n strength?: number;\n /**\n * The `x` and `y` offset coordinates to change the position of the center of the circle of effect.\n * This should be a size 2 array or an object containing `x` and `y` values, you cannot change types\n * once defined in the constructor\n * @default {x:0,y:0}\n */\n center?: PointData | number[];\n /**\n * The inner radius of zoom. The part in inner circle won't apply zoom blur effect\n * @default 0\n */\n innerRadius?: number;\n /**\n * Outer radius of the effect. less than `0` equates to infinity\n * @default -1\n */\n radius?: number;\n /**\n * On older iOS devices, it's better to not go above `13.0`.\n * Decreasing this value will produce a lower-quality blur effect with more dithering\n * @default 32\n */\n maxKernelSize?: number;\n}\n\n/**\n * The ZoomFilter applies a Zoom blur to an object.
\n * ![original](../screenshots/original.png)![filter](../screenshots/zoom-blur.png)\n *\n * @class\n * @extends Filter\n */\nexport class ZoomBlurFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: ZoomBlurFilterOptions = {\n strength: 0.1,\n center: { x: 0, y: 0 },\n innerRadius: 0,\n radius: -1,\n maxKernelSize: 32,\n };\n\n public uniforms: {\n uStrength: number;\n uCenter: PointData;\n uRadii: Float32Array\n };\n\n /**\n * @param options - Options for the ZoomBlurFilter constructor.\n */\n constructor(options?: ZoomBlurFilterOptions)\n {\n options = { ...ZoomBlurFilter.DEFAULT_OPTIONS, ...options };\n\n const kernelSize = options.maxKernelSize ?? 32;\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source: source.replace('${MAX_KERNEL_SIZE}', kernelSize.toFixed(1)),\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment: fragment.replace('${MAX_KERNEL_SIZE}', kernelSize.toFixed(1)),\n name: 'zoom-blur-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n zoomBlurUniforms: {\n uStrength: { value: options.strength, type: 'f32' },\n uCenter: { value: options.center, type: 'vec2' },\n uRadii: { value: new Float32Array(2), type: 'vec2' },\n }\n },\n });\n\n this.uniforms = this.resources.zoomBlurUniforms.uniforms;\n\n Object.assign(this, options);\n }\n\n /**\n * Sets the strength of the zoom blur effect\n * @default 0.1\n */\n get strength(): number { return this.uniforms.uStrength; }\n set strength(value: number) { this.uniforms.uStrength = value; }\n\n /**\n * The center of the zoom\n * @default [0,0]\n */\n get center(): PointData { return this.uniforms.uCenter; }\n set center(value: PointData | number[])\n {\n if (Array.isArray(value))\n {\n value = { x: value[0], y: value[1] };\n }\n\n this.uniforms.uCenter = value;\n }\n\n /**\n * Sets the center of the effect in normalized screen coords on the `x` axis\n * @default 0\n */\n get centerX(): number { return this.uniforms.uCenter.x; }\n set centerX(value: number) { this.uniforms.uCenter.x = value; }\n\n /**\n * Sets the center of the effect in normalized screen coords on the `y` axis\n * @default 0\n */\n get centerY(): number { return this.uniforms.uCenter.y; }\n set centerY(value: number) { this.uniforms.uCenter.y = value; }\n\n /**\n * The inner radius of zoom. The part in inner circle won't apply zoom blur effect\n * @default 0\n */\n get innerRadius(): number { return this.uniforms.uRadii[0]; }\n set innerRadius(value: number) { this.uniforms.uRadii[0] = value; }\n\n /**\n * Outer radius of the effect. less than `0` equates to infinity\n * @default -1\n */\n get radius(): number { return this.uniforms.uRadii[1]; }\n set radius(value: number) { this.uniforms.uRadii[1] = (value < 0 || value === Infinity) ? -1 : value; }\n}\n"],"names":["b","a","g","f","n","t","r","s","m","_AdjustmentFilter","Filter","options","__spreadValues","gpuProgram","GpuProgram","wgslVertex","source","glProgram","GlProgram","vertex","fragment","__publicField","value","AdjustmentFilter","z","_","d","q","e","c","u","_KawaseBlurFilter","args","_a","_b","_c","deprecation","sourceClamp","fragmentClamp","filterManager","input","output","clearMode","uvX","uvY","offset","renderTarget","TexturePool","target","tmp","last","i","acc","v","blur","quality","kernels","k","step","KawaseBlurFilter","l","o","_ExtractBrightnessFilter","ExtractBrightnessFilter","_AdvancedBloomFilter","h","Texture","brightTarget","bloomTarget","AdvancedBloomFilter","C","_AsciiFilter","replaceColor","Color","AsciiFilter","BackdropBlurFilter","BlurFilter","wgslFragment","backTexture","blurredBackground","_BevelFilter","rotation","DEG_TO_RAD","BevelFilter","_BloomFilter","AlphaFilter","strength","BlurFilterPass","__spreadProps","clear","BloomFilter","_BulgePinchFilter","BulgePinchFilter","GradientParser","visitor","node","orientation","result","at","style","resultColor","length","elements","size","element","nodeVisitor","root","tokens","error","msg","err","getAST","ast","matchListDefinitions","matchListing","matchDefinition","matchGradient","matchLinearOrientation","matchListRadialOrientations","gradientType","pattern","orientationMatcher","matchCall","captures","scan","matchColorStop","callback","matchSideOrCorner","matchAngle","match","radialOrientations","radialOrientation","matchRadialOrientation","lookaheadCache","radialType","matchCircle","matchEllipse","matchAtPosition","extent","matchExtentKeyword","positionAt","defaultPosition","matchPositioning","circle","matchLength","ellipse","matchDistance","positioning","location","matchCoordinates","matcher","color","matchColor","matchHexColor","matchRGBAColor","matchRGBColor","matchLiteralColor","matchNumber","matchPositionKeyword","type","captureIndex","regexp","blankCaptures","consume","code","parse","stringify","parseCssGradient","cssGradient","cssGradientNodes","trimCssGradient","cssGradientNode","typeFromCssType","stops","stopsFromCssStops","angle","angleFromCssOrientation","supportedTypes","offsets","offsetsFromCssColorStops","colorString","colorAsStringFromCssStop","rgbaColor","stop","cssStop","stopOffset","findNextFixedStop","fromIndex","prevFixedOffset","nextFixed","stepSize","fixFloatRounding","angleFromDirectionalValue","supportedValues","value_","U","y","S","x","O","ANGLE_OFFSET","sortColorStops","_ColorGradientFilter","maxStops","sortedStops","indexStart","ColorGradientFilter","_ColorMapFilter","TextureSource","nearest","texture","ColorMapFilter","_ColorOverlayFilter","ColorOverlayFilter","F","_ColorReplaceFilter","ColorReplaceFilter","_ConvolutionFilter","width","height","matrix","ConvolutionFilter","CrossHatchFilter","_CRTFilter","CRTFilter","_DotFilter","dotUniforms","DotFilter","_DropShadowFilter","offsetPadding","DropShadowFilter","EmbossFilter","FILL_MODES","_GlitchFilter","_d","_e","canvas","ImageSource","arr","min","count","rest","averageWidth","w","ratio","rand","temp","ctx","red","green","sizes","len","GlitchFilter","_GlowFilter","distance","GlowFilter","_GodrayFilter","sourcePerlin","perlin","radians","GodrayFilter","GrayscaleFilter","_HslAdjustmentFilter","HslAdjustmentFilter","p","_MotionBlurFilter","ObservablePoint","MotionBlurFilter","_MultiColorReplaceFilter","maxColors","replacements","originals","targets","colorCount","pair","MultiColorReplaceFilter","_OldFilmFilter","OldFilmFilter","_OutlineFilter","OutlineFilter","PixelateFilter","Point","_RadialBlurFilter","RadialBlurFilter","_ReflectionFilter","ReflectionFilter","_RGBSplitFilter","RGBSplitFilter","_ShockwaveFilter","ShockwaveFilter","_SimpleLightmapFilter","SimpleLightmapFilter","_TiltShiftAxisFilter","end","start","dx","dy","isVert","TiltShiftAxisFilter","TiltShiftFilter","_TwistFilter","TwistFilter","_ZoomBlurFilter","kernelSize","ZoomBlurFilter"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAAA,GAAA,OAAA,eAAAC,GAAA,OAAA,sBAAAC,GAAA,OAAA,UAAA,eAAAC,GAAA,OAAA,UAAA,qBAAAC,EAAA,CAAAC,EAAA,EAAAC,IAAA,KAAAD,EAAAL,GAAAK,EAAA,EAAA,CAAA,WAAA,GAAA,aAAA,GAAA,SAAA,GAAA,MAAAC,CAAA,CAAA,EAAAD,EAAA,CAAA,EAAAC,EAAAC,GAAA,CAAAF,EAAA,IAAA,CAAA,QAAAC,KAAA,IAAA,EAAA,CAAA,GAAAJ,GAAA,KAAA,EAAAI,CAAA,GAAAF,EAAAC,EAAAC,EAAA,EAAAA,CAAA,CAAA,EAAA,GAAAL,GAAA,QAAAK,KAAAL,GAAA,CAAA,EAAAE,GAAA,KAAA,EAAAG,CAAA,GAAAF,EAAAC,EAAAC,EAAA,EAAAA,CAAA,CAAA,EAAA,OAAAD,CAAA,EAAAG,GAAA,CAAAH,EAAA,EAAAC,KAAAF,EAAAC,EAAA,OAAA,GAAA,SAAA,EAAA,GAAA,EAAAC,CAAA,EAAAA,GA4DO,MAAMG,GAAN,MAAMA,WAAyBC,EACtC,MAAA,CAwBI,YAAYC,EACZ,CAC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AAS,OAAO,CAAC,EAAKA,EAAQ,GAAKA,IAAU,IAAY,GAAKA,CAAO,CAC1G,EA1GID,GAHSyR,GAGc,kBAAyC,CAC5D,SAAU,GACV,OAAQ,CAAE,EAAG,EAAG,EAAG,CAAE,EACrB,YAAa,EACb,OAAQ,GACR,cAAe,EACnB,CAAA,MATSE,GAANF"} \ No newline at end of file diff --git a/dist/pixi-filters.mjs b/dist/pixi-filters.mjs new file mode 100644 index 000000000..8e63bf8b3 --- /dev/null +++ b/dist/pixi-filters.mjs @@ -0,0 +1,4290 @@ +/*! + * pixi-filters - v6.0.0 + * Compiled Thu, 07 Mar 2024 01:51:58 UTC + * + * pixi-filters is licensed under the MIT License. + * http://www.opensource.org/licenses/mit-license + * + * Copyright 2024, undefined, All Rights Reserved + */import{Filter as s,GpuProgram as f,GlProgram as c,deprecation as h,TexturePool as y,Texture as _,Color as S,BlurFilter as Vt,DEG_TO_RAD as R,AlphaFilter as Xt,BlurFilterPass as nn,TextureSource as Yt,ImageSource as Kt,ObservablePoint as Wt,Point as qt}from"pixi.js";var m=`in vec2 aPosition; +out vec2 vTextureCoord; + +uniform vec4 uInputSize; +uniform vec4 uOutputFrame; +uniform vec4 uOutputTexture; + +vec4 filterVertexPosition( void ) +{ + vec2 position = aPosition * uOutputFrame.zw + uOutputFrame.xy; + + position.x = position.x * (2.0 / uOutputTexture.x) - 1.0; + position.y = position.y * (2.0*uOutputTexture.z / uOutputTexture.y) - uOutputTexture.z; + + return vec4(position, 0.0, 1.0); +} + +vec2 filterTextureCoord( void ) +{ + return aPosition * (uOutputFrame.zw * uInputSize.zw); +} + +void main(void) +{ + gl_Position = filterVertexPosition(); + vTextureCoord = filterTextureCoord(); +} +`,p=`struct GlobalFilterUniforms { + uInputSize:vec4, + uInputPixel:vec4, + uInputClamp:vec4, + uOutputFrame:vec4, + uGlobalFrame:vec4, + uOutputTexture:vec4, +}; + +@group(0) @binding(0) var gfu: GlobalFilterUniforms; + +struct VSOutput { + @builtin(position) position: vec4, + @location(0) uv : vec2 + }; + +fn filterVertexPosition(aPosition:vec2) -> vec4 +{ + var position = aPosition * gfu.uOutputFrame.zw + gfu.uOutputFrame.xy; + + position.x = position.x * (2.0 / gfu.uOutputTexture.x) - 1.0; + position.y = position.y * (2.0*gfu.uOutputTexture.z / gfu.uOutputTexture.y) - gfu.uOutputTexture.z; + + return vec4(position, 0.0, 1.0); +} + +fn filterTextureCoord( aPosition:vec2 ) -> vec2 +{ + return aPosition * (gfu.uOutputFrame.zw * gfu.uInputSize.zw); +} + +fn globalTextureCoord( aPosition:vec2 ) -> vec2 +{ + return (aPosition.xy / gfu.uGlobalFrame.zw) + (gfu.uGlobalFrame.xy / gfu.uGlobalFrame.zw); +} + +fn getSize() -> vec2 +{ + return gfu.uGlobalFrame.zw; +} + +@vertex +fn mainVertex( + @location(0) aPosition : vec2, +) -> VSOutput { + return VSOutput( + filterVertexPosition(aPosition), + filterTextureCoord(aPosition) + ); +}`,Ht=`in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform float uGamma; +uniform float uContrast; +uniform float uSaturation; +uniform float uBrightness; +uniform vec4 uColor; + +void main() +{ + vec4 c = texture(uTexture, vTextureCoord); + + if (c.a > 0.0) { + c.rgb /= c.a; + + vec3 rgb = pow(c.rgb, vec3(1. / uGamma)); + rgb = mix(vec3(.5), mix(vec3(dot(vec3(.2125, .7154, .0721), rgb)), rgb, uSaturation), uContrast); + rgb.r *= uColor.r; + rgb.g *= uColor.g; + rgb.b *= uColor.b; + c.rgb = rgb * uBrightness; + + c.rgb *= c.a; + } + + finalColor = c * uColor.a; +} +`,Zt=`struct AdjustmentUniforms { + uGamma: f32, + uContrast: f32, + uSaturation: f32, + uBrightness: f32, + uColor: vec4, +}; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var adjustmentUniforms : AdjustmentUniforms; + +@fragment +fn mainFragment( + @location(0) uv: vec2, + @builtin(position) position: vec4 +) -> @location(0) vec4 { + var sample = textureSample(uTexture, uSampler, uv); + let color = adjustmentUniforms.uColor; + + if (sample.a > 0.0) + { + sample = vec4(sample.rgb / sample.a, sample.a); + var rgb: vec3 = pow(sample.rgb, vec3(1. / adjustmentUniforms.uGamma)); + rgb = mix(vec3(.5), mix(vec3(dot(vec3(.2125, .7154, .0721), rgb)), rgb, adjustmentUniforms.uSaturation), adjustmentUniforms.uContrast); + rgb.r *= color.r; + rgb.g *= color.g; + rgb.b *= color.b; + sample = vec4(rgb.rgb * adjustmentUniforms.uBrightness, sample.a); + sample = vec4(sample.rgb * sample.a, sample.a); + } + + return sample * color.a; +}`,Qt=Object.defineProperty,rn=Object.getOwnPropertySymbols,Jt=Object.prototype.hasOwnProperty,eo=Object.prototype.propertyIsEnumerable,re=(r,e,n)=>e in r?Qt(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,tn=(r,e)=>{for(var n in e||(e={}))Jt.call(e,n)&&re(r,n,e[n]);if(rn)for(var n of rn(e))eo.call(e,n)&&re(r,n,e[n]);return r},on=(r,e,n)=>(re(r,typeof e!="symbol"?e+"":e,n),n);const un=class it extends s{constructor(e){e=tn(tn({},it.DEFAULT_OPTIONS),e);const n=f.from({vertex:{source:p,entryPoint:"mainVertex"},fragment:{source:Zt,entryPoint:"mainFragment"}}),t=c.from({vertex:m,fragment:Ht,name:"adjustment-filter"});super({gpuProgram:n,glProgram:t,resources:{adjustmentUniforms:{uGamma:{value:e.gamma,type:"f32"},uContrast:{value:e.contrast,type:"f32"},uSaturation:{value:e.saturation,type:"f32"},uBrightness:{value:e.brightness,type:"f32"},uColor:{value:[e.red,e.green,e.blue,e.alpha],type:"vec4"}}}}),on(this,"uniforms"),this.uniforms=this.resources.adjustmentUniforms.uniforms}get gamma(){return this.uniforms.uGamma}set gamma(e){this.uniforms.uGamma=e}get contrast(){return this.uniforms.uContrast}set contrast(e){this.uniforms.uContrast=e}get saturation(){return this.uniforms.uSaturation}set saturation(e){this.uniforms.uSaturation=e}get brightness(){return this.uniforms.uBrightness}set brightness(e){this.uniforms.uBrightness=e}get red(){return this.uniforms.uColor[0]}set red(e){this.uniforms.uColor[0]=e}get green(){return this.uniforms.uColor[1]}set green(e){this.uniforms.uColor[1]=e}get blue(){return this.uniforms.uColor[2]}set blue(e){this.uniforms.uColor[2]=e}get alpha(){return this.uniforms.uColor[3]}set alpha(e){this.uniforms.uColor[3]=e}};on(un,"DEFAULT_OPTIONS",{gamma:1,contrast:1,saturation:1,brightness:1,red:1,green:1,blue:1,alpha:1});let no=un;var ro=` +in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform vec2 uOffset; + +void main(void) +{ + vec4 color = vec4(0.0); + + // Sample top left pixel + color += texture(uTexture, vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y + uOffset.y)); + + // Sample top right pixel + color += texture(uTexture, vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y + uOffset.y)); + + // Sample bottom right pixel + color += texture(uTexture, vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y - uOffset.y)); + + // Sample bottom left pixel + color += texture(uTexture, vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y - uOffset.y)); + + // Average + color *= 0.25; + + finalColor = color; +}`,to=`struct KawaseBlurUniforms { + uOffset:vec2, +}; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var kawaseBlurUniforms : KawaseBlurUniforms; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 +) -> @location(0) vec4 { + let uOffset = kawaseBlurUniforms.uOffset; + var color: vec4 = vec4(0.0); + + // Sample top left pixel + color += textureSample(uTexture, uSampler, vec2(uv.x - uOffset.x, uv.y + uOffset.y)); + // Sample top right pixel + color += textureSample(uTexture, uSampler, vec2(uv.x + uOffset.x, uv.y + uOffset.y)); + // Sample bottom right pixel + color += textureSample(uTexture, uSampler, vec2(uv.x + uOffset.x, uv.y - uOffset.y)); + // Sample bottom left pixel + color += textureSample(uTexture, uSampler, vec2(uv.x - uOffset.x, uv.y - uOffset.y)); + // Average + color *= 0.25; + + return color; +}`,oo=` +precision highp float; +in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform vec2 uOffset; + +uniform vec4 uInputClamp; + +void main(void) +{ + vec4 color = vec4(0.0); + + // Sample top left pixel + color += texture(uTexture, clamp(vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y + uOffset.y), uInputClamp.xy, uInputClamp.zw)); + + // Sample top right pixel + color += texture(uTexture, clamp(vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y + uOffset.y), uInputClamp.xy, uInputClamp.zw)); + + // Sample bottom right pixel + color += texture(uTexture, clamp(vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y - uOffset.y), uInputClamp.xy, uInputClamp.zw)); + + // Sample bottom left pixel + color += texture(uTexture, clamp(vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y - uOffset.y), uInputClamp.xy, uInputClamp.zw)); + + // Average + color *= 0.25; + + finalColor = color; +} +`,io=`struct KawaseBlurUniforms { + uOffset:vec2, +}; + +struct GlobalFilterUniforms { + uInputSize:vec4, + uInputPixel:vec4, + uInputClamp:vec4, + uOutputFrame:vec4, + uGlobalFrame:vec4, + uOutputTexture:vec4, +}; + +@group(0) @binding(0) var gfu: GlobalFilterUniforms; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var kawaseBlurUniforms : KawaseBlurUniforms; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 +) -> @location(0) vec4 { + let uOffset = kawaseBlurUniforms.uOffset; + var color: vec4 = vec4(0.0); + + // Sample top left pixel + color += textureSample(uTexture, uSampler, clamp(vec2(uv.x - uOffset.x, uv.y + uOffset.y), gfu.uInputClamp.xy, gfu.uInputClamp.zw)); + // Sample top right pixel + color += textureSample(uTexture, uSampler, clamp(vec2(uv.x + uOffset.x, uv.y + uOffset.y), gfu.uInputClamp.xy, gfu.uInputClamp.zw)); + // Sample bottom right pixel + color += textureSample(uTexture, uSampler, clamp(vec2(uv.x + uOffset.x, uv.y - uOffset.y), gfu.uInputClamp.xy, gfu.uInputClamp.zw)); + // Sample bottom left pixel + color += textureSample(uTexture, uSampler, clamp(vec2(uv.x - uOffset.x, uv.y - uOffset.y), gfu.uInputClamp.xy, gfu.uInputClamp.zw)); + // Average + color *= 0.25; + + return color; +}`,uo=Object.defineProperty,ln=Object.getOwnPropertySymbols,lo=Object.prototype.hasOwnProperty,ao=Object.prototype.propertyIsEnumerable,te=(r,e,n)=>e in r?uo(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,an=(r,e)=>{for(var n in e||(e={}))lo.call(e,n)&&te(r,n,e[n]);if(ln)for(var n of ln(e))ao.call(e,n)&&te(r,n,e[n]);return r},w=(r,e,n)=>(te(r,typeof e!="symbol"?e+"":e,n),n);const sn=class ut extends s{constructor(...e){var n,t,o;let i=(n=e[0])!=null?n:{};(typeof i=="number"||Array.isArray(i))&&(h("6.0.0","KawaseBlurFilter constructor params are now options object. See params: { strength, quality, clamp, pixelSize }"),i={strength:i},e[1]!==void 0&&(i.quality=e[1]),e[2]!==void 0&&(i.clamp=e[2])),i=an(an({},ut.DEFAULT_OPTIONS),i);const u=f.from({vertex:{source:p,entryPoint:"mainVertex"},fragment:{source:i!=null&&i.clamp?io:to,entryPoint:"mainFragment"}}),l=c.from({vertex:m,fragment:i!=null&&i.clamp?oo:ro,name:"kawase-blur-filter"});super({gpuProgram:u,glProgram:l,resources:{kawaseBlurUniforms:{uOffset:{value:new Float32Array(2),type:"vec2"}}}}),w(this,"uniforms"),w(this,"_pixelSize",{x:0,y:0}),w(this,"_clamp"),w(this,"_kernels",[]),w(this,"_blur"),w(this,"_quality"),this.uniforms=this.resources.kawaseBlurUniforms.uniforms,this.pixelSize=(t=i.pixelSize)!=null?t:{x:1,y:1},Array.isArray(i.strength)?this.kernels=i.strength:typeof i.strength=="number"&&(this._blur=i.strength,this.quality=(o=i.quality)!=null?o:3),this._clamp=!!i.clamp}apply(e,n,t,o){const i=this.pixelSizeX/n.source.width,u=this.pixelSizeY/n.source.height;let l;if(this._quality===1||this._blur===0)l=this._kernels[0]+.5,this.uniforms.uOffset[0]=l*i,this.uniforms.uOffset[1]=l*u,e.applyFilter(this,n,t,o);else{const v=y.getSameSizeTexture(n);let g=n,b=v,k;const j=this._quality-1;for(let G=0;G0?(this._kernels=e,this._quality=e.length,this._blur=Math.max(...e)):(this._kernels=[0],this._quality=1)}get pixelSize(){return this._pixelSize}set pixelSize(e){if(typeof e=="number"){this.pixelSizeX=this.pixelSizeY=e;return}if(Array.isArray(e)){this.pixelSizeX=e[0],this.pixelSizeY=e[1];return}this._pixelSize=e}get pixelSizeX(){return this.pixelSize.x}set pixelSizeX(e){this.pixelSize.x=e}get pixelSizeY(){return this.pixelSize.y}set pixelSizeY(e){this.pixelSize.y=e}get clamp(){return this._clamp}_updatePadding(){this.padding=Math.ceil(this._kernels.reduce((e,n)=>e+n+.5,0))}_generateKernels(){const e=this._blur,n=this._quality,t=[e];if(e>0){let o=e;const i=e/n;for(let u=1;u; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var advancedBloomUniforms : AdvancedBloomUniforms; +@group(1) @binding(1) var uMapTexture: texture_2d; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 +) -> @location(0) vec4 { + var color = textureSample(uTexture, uSampler, uv); + color = vec4(color.rgb * advancedBloomUniforms.uBrightness, color.a); + + var bloomColor = vec4(textureSample(uMapTexture, uSampler, uv).rgb, 0.0); + bloomColor = vec4(bloomColor.rgb * advancedBloomUniforms.uBloomScale, bloomColor.a); + + return color + bloomColor; +} +`,co=` +in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform float uThreshold; + +void main() { + vec4 color = texture(uTexture, vTextureCoord); + + // A simple & fast algorithm for getting brightness. + // It's inaccuracy , but good enought for this feature. + float _max = max(max(color.r, color.g), color.b); + float _min = min(min(color.r, color.g), color.b); + float brightness = (_max + _min) * 0.5; + + if(brightness > uThreshold) { + finalColor = color; + } else { + finalColor = vec4(0.0, 0.0, 0.0, 0.0); + } +} +`,mo=`struct ExtractBrightnessUniforms { + uThreshold: f32, +}; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var extractBrightnessUniforms : ExtractBrightnessUniforms; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 +) -> @location(0) vec4 { + let color: vec4 = textureSample(uTexture, uSampler, uv); + + // A simple & fast algorithm for getting brightness. + // It's inaccurate, but good enough for this feature. + let max: f32 = max(max(color.r, color.g), color.b); + let min: f32 = min(min(color.r, color.g), color.b); + let brightness: f32 = (max + min) * 0.5; + + return select(vec4(0.), color, brightness > extractBrightnessUniforms.uThreshold); +} +`,po=Object.defineProperty,fn=Object.getOwnPropertySymbols,vo=Object.prototype.hasOwnProperty,go=Object.prototype.propertyIsEnumerable,ie=(r,e,n)=>e in r?po(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,cn=(r,e)=>{for(var n in e||(e={}))vo.call(e,n)&&ie(r,n,e[n]);if(fn)for(var n of fn(e))go.call(e,n)&&ie(r,n,e[n]);return r},mn=(r,e,n)=>(ie(r,typeof e!="symbol"?e+"":e,n),n);const pn=class lt extends s{constructor(e){e=cn(cn({},lt.DEFAULT_OPTIONS),e);const n=f.from({vertex:{source:p,entryPoint:"mainVertex"},fragment:{source:mo,entryPoint:"mainFragment"}}),t=c.from({vertex:m,fragment:co,name:"extract-brightness-filter"});super({gpuProgram:n,glProgram:t,resources:{extractBrightnessUniforms:{uThreshold:{value:e.threshold,type:"f32"}}}}),mn(this,"uniforms"),this.uniforms=this.resources.extractBrightnessUniforms.uniforms}get threshold(){return this.uniforms.uThreshold}set threshold(e){this.uniforms.uThreshold=e}};mn(pn,"DEFAULT_OPTIONS",{threshold:.5});let ho=pn;var xo=Object.defineProperty,vn=Object.getOwnPropertySymbols,yo=Object.prototype.hasOwnProperty,So=Object.prototype.propertyIsEnumerable,ue=(r,e,n)=>e in r?xo(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,gn=(r,e)=>{for(var n in e||(e={}))yo.call(e,n)&&ue(r,n,e[n]);if(vn)for(var n of vn(e))So.call(e,n)&&ue(r,n,e[n]);return r},D=(r,e,n)=>(ue(r,typeof e!="symbol"?e+"":e,n),n);const dn=class at extends s{constructor(e){var n;e=gn(gn({},at.DEFAULT_OPTIONS),e);const t=f.from({vertex:{source:p,entryPoint:"mainVertex"},fragment:{source:fo,entryPoint:"mainFragment"}}),o=c.from({vertex:m,fragment:so,name:"advanced-bloom-filter"});super({gpuProgram:t,glProgram:o,resources:{advancedBloomUniforms:{uBloomScale:{value:e.bloomScale,type:"f32"},uBrightness:{value:e.brightness,type:"f32"}},uMapTexture:_.WHITE}}),D(this,"uniforms"),D(this,"bloomScale",1),D(this,"brightness",1),D(this,"_extractFilter"),D(this,"_blurFilter"),this.uniforms=this.resources.advancedBloomUniforms.uniforms,this._extractFilter=new ho({threshold:e.threshold}),this._blurFilter=new oe({strength:(n=e.kernels)!=null?n:e.blur,quality:e.kernels?void 0:e.quality}),Object.assign(this,e)}apply(e,n,t,o){const i=y.getSameSizeTexture(n);this._extractFilter.apply(e,n,i,!0);const u=y.getSameSizeTexture(n);this._blurFilter.apply(e,i,u,!0),this.uniforms.uBloomScale=this.bloomScale,this.uniforms.uBrightness=this.brightness,this.resources.uMapTexture=u.source,e.applyFilter(this,n,t,o),y.returnTexture(u),y.returnTexture(i)}get threshold(){return this._extractFilter.threshold}set threshold(e){this._extractFilter.threshold=e}get kernels(){return this._blurFilter.kernels}set kernels(e){this._blurFilter.kernels=e}get blur(){return this._blurFilter.strength}set blur(e){this._blurFilter.strength=e}get quality(){return this._blurFilter.quality}set quality(e){this._blurFilter.quality=e}get pixelSize(){return this._blurFilter.pixelSize}set pixelSize(e){typeof e=="number"&&(e={x:e,y:e}),Array.isArray(e)&&(e={x:e[0],y:e[1]}),this._blurFilter.pixelSize=e}get pixelSizeX(){return this._blurFilter.pixelSizeX}set pixelSizeX(e){this._blurFilter.pixelSizeX=e}get pixelSizeY(){return this._blurFilter.pixelSizeY}set pixelSizeY(e){this._blurFilter.pixelSizeY=e}};D(dn,"DEFAULT_OPTIONS",{threshold:.5,bloomScale:1,brightness:1,blur:8,quality:4,pixelSize:{x:1,y:1}});let bo=dn;var Co=`precision highp float; +in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform float uSize; +uniform vec3 uColor; +uniform float uReplaceColor; + +uniform vec4 uInputSize; + +vec2 mapCoord( vec2 coord ) +{ + coord *= uInputSize.xy; + coord += uInputSize.zw; + + return coord; +} + +vec2 unmapCoord( vec2 coord ) +{ + coord -= uInputSize.zw; + coord /= uInputSize.xy; + + return coord; +} + +vec2 pixelate(vec2 coord, vec2 size) +{ + return floor(coord / size) * size; +} + +vec2 getMod(vec2 coord, vec2 size) +{ + return mod(coord, size) / size; +} + +float character(float n, vec2 p) +{ + p = floor(p*vec2(4.0, 4.0) + 2.5); + + if (clamp(p.x, 0.0, 4.0) == p.x) + { + if (clamp(p.y, 0.0, 4.0) == p.y) + { + if (int(mod(n/exp2(p.x + 5.0*p.y), 2.0)) == 1) return 1.0; + } + } + return 0.0; +} + +void main() +{ + vec2 coord = mapCoord(vTextureCoord); + + // get the grid position + vec2 pixCoord = pixelate(coord, vec2(uSize)); + pixCoord = unmapCoord(pixCoord); + + // sample the color at grid position + vec4 color = texture(uTexture, pixCoord); + + // brightness of the color as it's perceived by the human eye + float gray = 0.3 * color.r + 0.59 * color.g + 0.11 * color.b; + + // determine the character to use + float n = 65536.0; // . + if (gray > 0.2) n = 65600.0; // : + if (gray > 0.3) n = 332772.0; // * + if (gray > 0.4) n = 15255086.0; // o + if (gray > 0.5) n = 23385164.0; // & + if (gray > 0.6) n = 15252014.0; // 8 + if (gray > 0.7) n = 13199452.0; // @ + if (gray > 0.8) n = 11512810.0; // # + + // get the mod.. + vec2 modd = getMod(coord, vec2(uSize)); + + finalColor = (uReplaceColor > 0.5 ? vec4(uColor, 1.) : color) * character( n, vec2(-1.0) + modd * 2.0); +} +`,To=`struct AsciiUniforms { + uSize: f32, + uColor: vec3, + uReplaceColor: f32, +}; + +struct GlobalFilterUniforms { + uInputSize:vec4, + uInputPixel:vec4, + uInputClamp:vec4, + uOutputFrame:vec4, + uGlobalFrame:vec4, + uOutputTexture:vec4, +}; + +@group(0) @binding(0) var gfu: GlobalFilterUniforms; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var asciiUniforms : AsciiUniforms; + +@fragment +fn mainFragment( + @location(0) uv: vec2, + @builtin(position) position: vec4 +) -> @location(0) vec4 { + let pixelSize: f32 = asciiUniforms.uSize; + let coord: vec2 = mapCoord(uv); + + // get the rounded color.. + var pixCoord: vec2 = pixelate(coord, vec2(pixelSize)); + pixCoord = unmapCoord(pixCoord); + + var color = textureSample(uTexture, uSampler, pixCoord); + + // determine the character to use + let gray: f32 = 0.3 * color.r + 0.59 * color.g + 0.11 * color.b; + + var n: f32 = 65536.0; // . + if (gray > 0.2) { + n = 65600.0; // : + } + if (gray > 0.3) { + n = 332772.0; // * + } + if (gray > 0.4) { + n = 15255086.0; // o + } + if (gray > 0.5) { + n = 23385164.0; // & + } + if (gray > 0.6) { + n = 15252014.0; // 8 + } + if (gray > 0.7) { + n = 13199452.0; // @ + } + if (gray > 0.8) { + n = 11512810.0; // # + } + + // get the mod.. + let modd: vec2 = getMod(coord, vec2(pixelSize)); + return select(color, vec4(asciiUniforms.uColor, 1.), asciiUniforms.uReplaceColor > 0.5) * character(n, vec2(-1.0) + modd * 2.0); +} + +fn pixelate(coord: vec2, size: vec2) -> vec2 +{ + return floor( coord / size ) * size; +} + +fn getMod(coord: vec2, size: vec2) -> vec2 +{ + return moduloVec2( coord , size) / size; +} + +fn character(n: f32, p: vec2) -> f32 +{ + var q: vec2 = floor(p*vec2(4.0, 4.0) + 2.5); + + if (clamp(q.x, 0.0, 4.0) == q.x) + { + if (clamp(q.y, 0.0, 4.0) == q.y) + { + if (i32(modulo(n/exp2(q.x + 5.0*q.y), 2.0)) == 1) + { + return 1.0; + } + } + } + + return 0.0; +} + +fn modulo(x: f32, y: f32) -> f32 +{ + return x - y * floor(x/y); +} + +fn moduloVec2(x: vec2, y: vec2) -> vec2 +{ + return x - y * floor(x/y); +} + +fn mapCoord(coord: vec2 ) -> vec2 +{ + var mappedCoord: vec2 = coord; + mappedCoord *= gfu.uInputSize.xy; + mappedCoord += gfu.uOutputFrame.xy; + return mappedCoord; +} + +fn unmapCoord(coord: vec2 ) -> vec2 +{ + var mappedCoord: vec2 = coord; + mappedCoord -= gfu.uOutputFrame.xy; + mappedCoord /= gfu.uInputSize.xy; + return mappedCoord; +}`,zo=Object.defineProperty,hn=Object.getOwnPropertySymbols,Oo=Object.prototype.hasOwnProperty,Po=Object.prototype.propertyIsEnumerable,le=(r,e,n)=>e in r?zo(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,xn=(r,e)=>{for(var n in e||(e={}))Oo.call(e,n)&&le(r,n,e[n]);if(hn)for(var n of hn(e))Po.call(e,n)&&le(r,n,e[n]);return r},ae=(r,e,n)=>(le(r,typeof e!="symbol"?e+"":e,n),n);const yn=class st extends s{constructor(...e){var n,t;let o=(n=e[0])!=null?n:{};typeof o=="number"&&(h("6.0.0","AsciiFilter constructor params are now options object. See params: { size, color, replaceColor }"),o={size:o});const i=(o==null?void 0:o.color)&&o.replaceColor!==!1;o=xn(xn({},st.DEFAULT_OPTIONS),o);const u=f.from({vertex:{source:p,entryPoint:"mainVertex"},fragment:{source:To,entryPoint:"mainFragment"}}),l=c.from({vertex:m,fragment:Co,name:"ascii-filter"});super({gpuProgram:u,glProgram:l,resources:{asciiUniforms:{uSize:{value:o.size,type:"f32"},uColor:{value:new Float32Array(3),type:"vec3"},uReplaceColor:{value:Number(i),type:"f32"}}}}),ae(this,"uniforms"),ae(this,"_color"),this.uniforms=this.resources.asciiUniforms.uniforms,this._color=new S,this.color=(t=o.color)!=null?t:16777215}get size(){return this.uniforms.uSize}set size(e){this.uniforms.uSize=e}get color(){return this._color.value}set color(e){this._color.setValue(e);const[n,t,o]=this._color.toArray();this.uniforms.uColor[0]=n,this.uniforms.uColor[1]=t,this.uniforms.uColor[2]=o}get replaceColor(){return this.uniforms.uReplaceColor>.5}set replaceColor(e){this.uniforms.uReplaceColor=e?1:0}};ae(yn,"DEFAULT_OPTIONS",{size:8,color:16777215,replaceColor:!1});let _o=yn;var wo=`precision highp float; +in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform sampler2D uBackground; + +void main(void){ + vec4 front = texture(uTexture, vTextureCoord); + vec4 back = texture(uBackground, vTextureCoord); + + if (front.a == 0.0) { + discard; + } + + vec3 color = mix(back.rgb, front.rgb / front.a, front.a); + + finalColor = vec4(color, 1.0); +}`,Ao=`@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var uBackground: texture_2d; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 +) -> @location(0) vec4 { + var front: vec4 = textureSample(uTexture, uSampler, uv); + var back: vec4 = textureSample(uBackground, uSampler, uv); + + if (front.a == 0.0) { + discard; + } + + var color: vec3 = mix(back.rgb, front.rgb / front.a, front.a); + + return vec4(color, 1.0); +}`,Fo=Object.defineProperty,Io=(r,e,n)=>e in r?Fo(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,Uo=(r,e,n)=>(Io(r,typeof e!="symbol"?e+"":e,n),n);class Ro extends Vt{constructor(e){super(e),Uo(this,"_blendPass"),this.blendRequired=!0,this.padding=0,this._blendPass=new s({gpuProgram:f.from({vertex:{source:p,entryPoint:"mainVertex"},fragment:{source:Ao,entryPoint:"mainFragment"}}),glProgram:c.from({vertex:m,fragment:wo,name:"drop-shadow-filter"}),resources:{uBackground:_.EMPTY}})}apply(e,n,t,o){const i=e._activeFilterData.backTexture,u=y.getSameSizeTexture(n);super.apply(e,i,u,!0),this._blendPass.resources.uBackground=u.source,this._blendPass.apply(e,n,t,o),y.returnTexture(u)}updatePadding(){this.padding=0}}var Do=`precision highp float; +in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform vec2 uTransform; +uniform vec3 uLightColor; +uniform float uLightAlpha; +uniform vec3 uShadowColor; +uniform float uShadowAlpha; + +uniform vec4 uInputSize; + +void main(void) { + vec2 transform = vec2(1.0 / uInputSize) * vec2(uTransform.x, uTransform.y); + vec4 color = texture(uTexture, vTextureCoord); + float light = texture(uTexture, vTextureCoord - transform).a; + float shadow = texture(uTexture, vTextureCoord + transform).a; + + color.rgb = mix(color.rgb, uLightColor, clamp((color.a - light) * uLightAlpha, 0.0, 1.0)); + color.rgb = mix(color.rgb, uShadowColor, clamp((color.a - shadow) * uShadowAlpha, 0.0, 1.0)); + finalColor = vec4(color.rgb * color.a, color.a); +} +`,$o=`struct BevelUniforms { + uLightColor: vec3, + uLightAlpha: f32, + uShadowColor: vec3, + uShadowAlpha: f32, + uTransform: vec2, +}; + +struct GlobalFilterUniforms { + uInputSize:vec4, + uInputPixel:vec4, + uInputClamp:vec4, + uOutputFrame:vec4, + uGlobalFrame:vec4, + uOutputTexture:vec4, +}; + +@group(0) @binding(0) var gfu: GlobalFilterUniforms; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var bevelUniforms : BevelUniforms; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 +) -> @location(0) vec4 { + let transform = vec2(1.0 / gfu.uInputSize.xy) * vec2(bevelUniforms.uTransform.x, bevelUniforms.uTransform.y); + var color: vec4 = textureSample(uTexture, uSampler, uv); + let lightSample: f32 = textureSample(uTexture, uSampler, uv - transform).a; + let shadowSample: f32 = textureSample(uTexture, uSampler, uv + transform).a; + + let light = vec4(bevelUniforms.uLightColor, bevelUniforms.uLightAlpha); + let shadow = vec4(bevelUniforms.uShadowColor, bevelUniforms.uShadowAlpha); + + color = vec4(mix(color.rgb, light.rgb, clamp((color.a - lightSample) * light.a, 0.0, 1.0)), color.a); + color = vec4(mix(color.rgb, shadow.rgb, clamp((color.a - shadowSample) * shadow.a, 0.0, 1.0)), color.a); + + return vec4(color.rgb * color.a, color.a); +}`,Mo=Object.defineProperty,Sn=Object.getOwnPropertySymbols,Eo=Object.prototype.hasOwnProperty,Lo=Object.prototype.propertyIsEnumerable,se=(r,e,n)=>e in r?Mo(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,bn=(r,e)=>{for(var n in e||(e={}))Eo.call(e,n)&&se(r,n,e[n]);if(Sn)for(var n of Sn(e))Lo.call(e,n)&&se(r,n,e[n]);return r},$=(r,e,n)=>(se(r,typeof e!="symbol"?e+"":e,n),n);const Cn=class ft extends s{constructor(e){var n,t,o;e=bn(bn({},ft.DEFAULT_OPTIONS),e);const i=((n=e.rotation)!=null?n:45)*R,u=f.from({vertex:{source:p,entryPoint:"mainVertex"},fragment:{source:$o,entryPoint:"mainFragment"}}),l=c.from({vertex:m,fragment:Do,name:"bevel-filter"});super({gpuProgram:u,glProgram:l,resources:{bevelUniforms:{uLightColor:{value:new Float32Array(3),type:"vec3"},uLightAlpha:{value:e.lightAlpha,type:"f32"},uShadowColor:{value:new Float32Array(3),type:"vec3"},uShadowAlpha:{value:e.shadowAlpha,type:"f32"},uTransform:{value:new Float32Array(2),type:"vec2"}}},padding:1}),$(this,"uniforms"),$(this,"_thickness"),$(this,"_rotation"),$(this,"_lightColor"),$(this,"_shadowColor"),this.uniforms=this.resources.bevelUniforms.uniforms,this._lightColor=new S,this._shadowColor=new S,this.lightColor=(t=e.lightColor)!=null?t:16777215,this.shadowColor=(o=e.shadowColor)!=null?o:0,Object.assign(this,e,{rotation:i})}get rotation(){return this._rotation/R}set rotation(e){this._rotation=e*R,this._updateTransform()}get thickness(){return this._thickness}set thickness(e){this._thickness=e,this._updateTransform()}get lightColor(){return this._lightColor.value}set lightColor(e){this._lightColor.setValue(e);const[n,t,o]=this._lightColor.toArray();this.uniforms.uLightColor[0]=n,this.uniforms.uLightColor[1]=t,this.uniforms.uLightColor[2]=o}get lightAlpha(){return this.uniforms.uLightAlpha}set lightAlpha(e){this.uniforms.uLightAlpha=e}get shadowColor(){return this._shadowColor.value}set shadowColor(e){this._shadowColor.setValue(e);const[n,t,o]=this._shadowColor.toArray();this.uniforms.uShadowColor[0]=n,this.uniforms.uShadowColor[1]=t,this.uniforms.uShadowColor[2]=o}get shadowAlpha(){return this.uniforms.uShadowAlpha}set shadowAlpha(e){this.uniforms.uShadowAlpha=e}_updateTransform(){this.uniforms.uTransform[0]=this.thickness*Math.cos(this._rotation),this.uniforms.uTransform[1]=this.thickness*Math.sin(this._rotation)}};$(Cn,"DEFAULT_OPTIONS",{rotation:45,thickness:2,lightColor:16777215,lightAlpha:.7,shadowColor:0,shadowAlpha:.7});let ko=Cn;var jo=Object.defineProperty,Go=Object.defineProperties,Bo=Object.getOwnPropertyDescriptors,Tn=Object.getOwnPropertySymbols,No=Object.prototype.hasOwnProperty,Vo=Object.prototype.propertyIsEnumerable,fe=(r,e,n)=>e in r?jo(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,V=(r,e)=>{for(var n in e||(e={}))No.call(e,n)&&fe(r,n,e[n]);if(Tn)for(var n of Tn(e))Vo.call(e,n)&&fe(r,n,e[n]);return r},zn=(r,e)=>Go(r,Bo(e)),X=(r,e,n)=>(fe(r,typeof e!="symbol"?e+"":e,n),n);const On=class ct extends Xt{constructor(...e){var n;let t=(n=e[0])!=null?n:{};if(typeof t=="number"||Array.isArray(t)||"x"in t&&"y"in t){h("6.0.0","BloomFilter constructor params are now options object. See params: { strength, quality, resolution, kernelSize }");let o=t;Array.isArray(o)&&(o={x:o[0],y:o[1]}),t={strength:o},e[1]!==void 0&&(t.quality=e[1]),e[2]!==void 0&&(t.resolution=e[2]),e[3]!==void 0&&(t.kernelSize=e[3])}t=V(V({},ct.DEFAULT_OPTIONS),t),super(),X(this,"_blurXFilter"),X(this,"_blurYFilter"),X(this,"_strength"),this._strength={x:2,y:2},t.strength&&(typeof t.strength=="number"?(this._strength.x=t.strength,this._strength.y=t.strength):(this._strength.x=t.strength.x,this._strength.y=t.strength.y)),this._blurXFilter=new nn(zn(V({},t),{horizontal:!0,strength:this.strengthX})),this._blurYFilter=new nn(zn(V({},t),{horizontal:!1,strength:this.strengthY})),this._blurYFilter.blendMode="screen",Object.assign(this,t)}apply(e,n,t,o){const i=y.getSameSizeTexture(n);e.applyFilter(this,n,t,o),this._blurXFilter.apply(e,n,i,!0),this._blurYFilter.apply(e,i,t,!1),y.returnTexture(i)}get strength(){return this._strength}set strength(e){this._strength=typeof e=="number"?{x:e,y:e}:e,this._updateStrength()}get strengthX(){return this.strength.x}set strengthX(e){this.strength.x=e,this._updateStrength()}get strengthY(){return this.strength.y}set strengthY(e){this.strength.y=e,this._updateStrength()}_updateStrength(){this._blurXFilter.blur=this.strengthX,this._blurYFilter.blur=this.strengthY}get blur(){return h("6.0.0","BloomFilter.blur is deprecated, please use BloomFilter.strength instead"),this.strengthX}set blur(e){h("6.0.0","BloomFilter.blur is deprecated, please use BloomFilter.strength instead"),this.strength=e}get blurX(){return h("6.0.0","BloomFilter.blurX is deprecated, please use BloomFilter.strengthX instead"),this.strengthX}set blurX(e){h("6.0.0","BloomFilter.blurX is deprecated, please use BloomFilter.strengthX instead"),this.strengthX=e}get blurY(){return h("6.0.0","BloomFilter.blurY is deprecated, please use BloomFilter.strengthY instead"),this.strengthY}set blurY(e){h("6.0.0","BloomFilter.blurY is deprecated, please use BloomFilter.strengthY instead"),this.strengthY=e}};X(On,"DEFAULT_OPTIONS",{strength:{x:2,y:2},quality:4,resolution:1,kernelSize:5});let Xo=On;var Yo=`precision highp float; +in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform vec2 uDimensions; +uniform vec2 uCenter; +uniform float uRadius; +uniform float uStrength; + +uniform vec4 uInputSize; +uniform vec4 uInputClamp; + +void main() +{ + vec2 coord = vTextureCoord * uInputSize.xy; + coord -= uCenter * uDimensions.xy; + float distance = length(coord); + + if (distance < uRadius) { + float percent = distance / uRadius; + if (uStrength > 0.0) { + coord *= mix(1.0, smoothstep(0.0, uRadius / distance, percent), uStrength * 0.75); + } else { + coord *= mix(1.0, pow(percent, 1.0 + uStrength * 0.75) * uRadius / distance, 1.0 - percent); + } + } + + coord += uCenter * uDimensions.xy; + coord /= uInputSize.xy; + vec2 clampedCoord = clamp(coord, uInputClamp.xy, uInputClamp.zw); + vec4 color = texture(uTexture, clampedCoord); + + if (coord != clampedCoord) { + color *= max(0.0, 1.0 - length(coord - clampedCoord)); + } + + finalColor = color; +} +`,Ko=`struct BulgePinchUniforms { + uDimensions: vec2, + uCenter: vec2, + uRadius: f32, + uStrength: f32, +}; + +struct GlobalFilterUniforms { + uInputSize:vec4, + uInputPixel:vec4, + uInputClamp:vec4, + uOutputFrame:vec4, + uGlobalFrame:vec4, + uOutputTexture:vec4, +}; + +@group(0) @binding(0) var gfu: GlobalFilterUniforms; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var bulgePinchUniforms : BulgePinchUniforms; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 +) -> @location(0) vec4 { + let dimensions: vec2 = bulgePinchUniforms.uDimensions; + let center: vec2 = bulgePinchUniforms.uCenter; + let radius: f32 = bulgePinchUniforms.uRadius; + let strength: f32 = bulgePinchUniforms.uStrength; + var coord: vec2 = (uv * gfu.uInputSize.xy) - center * dimensions.xy; + + let distance: f32 = length(coord); + + if (distance < radius) { + let percent: f32 = distance / radius; + if (strength > 0.0) { + coord *= mix(1.0, smoothstep(0.0, radius / distance, percent), strength * 0.75); + } else { + coord *= mix(1.0, pow(percent, 1.0 + strength * 0.75) * radius / distance, 1.0 - percent); + } + } + coord += (center * dimensions.xy); + coord /= gfu.uInputSize.xy; + + let clampedCoord: vec2 = clamp(coord, gfu.uInputClamp.xy, gfu.uInputClamp.zw); + var color: vec4 = textureSample(uTexture, uSampler, clampedCoord); + if (coord.x != clampedCoord.x && coord.y != clampedCoord.y) { + color *= max(0.0, 1.0 - length(coord - clampedCoord)); + } + + return color; +} + +fn compareVec2(x: vec2, y: vec2) -> bool +{ + if (x.x == y.x && x.y == y.y) + { + return true; + } + + return false; +}`,Wo=Object.defineProperty,Pn=Object.getOwnPropertySymbols,qo=Object.prototype.hasOwnProperty,Ho=Object.prototype.propertyIsEnumerable,ce=(r,e,n)=>e in r?Wo(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,_n=(r,e)=>{for(var n in e||(e={}))qo.call(e,n)&&ce(r,n,e[n]);if(Pn)for(var n of Pn(e))Ho.call(e,n)&&ce(r,n,e[n]);return r},wn=(r,e,n)=>(ce(r,typeof e!="symbol"?e+"":e,n),n);const An=class mt extends s{constructor(e){e=_n(_n({},mt.DEFAULT_OPTIONS),e);const n=f.from({vertex:{source:p,entryPoint:"mainVertex"},fragment:{source:Ko,entryPoint:"mainFragment"}}),t=c.from({vertex:m,fragment:Yo,name:"bulge-pinch-filter"});super({gpuProgram:n,glProgram:t,resources:{bulgePinchUniforms:{uDimensions:{value:[0,0],type:"vec2"},uCenter:{value:e.center,type:"vec2"},uRadius:{value:e.radius,type:"f32"},uStrength:{value:e.strength,type:"f32"}}}}),wn(this,"uniforms"),this.uniforms=this.resources.bulgePinchUniforms.uniforms,Object.assign(this,e)}apply(e,n,t,o){this.uniforms.uDimensions[0]=n.frame.width,this.uniforms.uDimensions[1]=n.frame.height,e.applyFilter(this,n,t,o)}get center(){return this.uniforms.uCenter}set center(e){typeof e=="number"&&(e={x:e,y:e}),Array.isArray(e)&&(e={x:e[0],y:e[1]}),this.uniforms.uCenter=e}get centerX(){return this.uniforms.uCenter.x}set centerX(e){this.uniforms.uCenter.x=e}get centerY(){return this.uniforms.uCenter.y}set centerY(e){this.uniforms.uCenter.y=e}get radius(){return this.uniforms.uRadius}set radius(e){this.uniforms.uRadius=e}get strength(){return this.uniforms.uStrength}set strength(e){this.uniforms.uStrength=e}};wn(An,"DEFAULT_OPTIONS",{center:{x:.5,y:.5},radius:100,strength:1});let Zo=An;var Qo=`precision highp float; +in vec2 vTextureCoord; +in vec2 vFilterCoord; +out vec4 finalColor; + +const int TYPE_LINEAR = 0; +const int TYPE_RADIAL = 1; +const int TYPE_CONIC = 2; +const int MAX_STOPS = 32; + +uniform sampler2D uTexture; +uniform vec4 uOptions; +uniform vec2 uCounts; +uniform vec3 uColors[MAX_STOPS]; +uniform vec4 uStops[MAX_STOPS]; + +const float PI = 3.1415926538; +const float PI_2 = PI*2.; + +struct ColorStop { + float offset; + vec3 color; + float alpha; +}; + +mat2 rotate2d(float angle){ + return mat2(cos(angle), -sin(angle), + sin(angle), cos(angle)); +} + +float projectLinearPosition(vec2 pos, float angle){ + vec2 center = vec2(0.5); + vec2 result = pos - center; + result = rotate2d(angle) * result; + result = result + center; + return clamp(result.x, 0., 1.); +} + +float projectRadialPosition(vec2 pos) { + float r = distance(pos, vec2(0.5)); + return clamp(2.*r, 0., 1.); +} + +float projectAnglePosition(vec2 pos, float angle) { + vec2 center = pos - vec2(0.5); + float polarAngle=atan(-center.y, center.x); + return mod(polarAngle + angle, PI_2) / PI_2; +} + +float projectPosition(vec2 pos, int type, float angle) { + if (type == TYPE_LINEAR) { + return projectLinearPosition(pos, angle); + } else if (type == TYPE_RADIAL) { + return projectRadialPosition(pos); + } else if (type == TYPE_CONIC) { + return projectAnglePosition(pos, angle); + } + + return pos.y; +} + +void main(void) { + int uType = int(uOptions[0]); + float uAngle = uOptions[1]; + float uAlpha = uOptions[2]; + float uReplace = uOptions[3]; + + int uNumStops = int(uCounts[0]); + float uMaxColors = uCounts[1]; + + // current/original color + vec4 currentColor = texture(uTexture, vTextureCoord); + + // skip calculations if gradient alpha is 0 + if (0.0 == uAlpha) { + finalColor = currentColor; + return; + } + + // project position + float y = projectPosition(vFilterCoord, int(uType), radians(uAngle)); + + // check gradient bounds + float offsetMin = uStops[0][0]; + float offsetMax = 0.0; + + int numStops = int(uNumStops); + + for (int i = 0; i < MAX_STOPS; i++) { + if (i == numStops-1){ // last index + offsetMax = uStops[i][0]; + } + } + + if (y < offsetMin || y > offsetMax) { + finalColor = currentColor; + return; + } + + // limit colors + if (uMaxColors > 0.) { + float stepSize = 1./uMaxColors; + float stepNumber = float(floor(y/stepSize)); + y = stepSize * (stepNumber + 0.5);// offset by 0.5 to use color from middle of segment + } + + // find color stops + ColorStop from; + ColorStop to; + + for (int i = 0; i < MAX_STOPS; i++) { + if (y >= uStops[i][0]) { + from = ColorStop(uStops[i][0], uColors[i], uStops[i][1]); + to = ColorStop(uStops[i+1][0], uColors[i+1], uStops[i+1][1]); + } + + if (i == numStops-1){ // last index + break; + } + } + + // mix colors from stops + vec4 colorFrom = vec4(from.color * from.alpha, from.alpha); + vec4 colorTo = vec4(to.color * to.alpha, to.alpha); + + float segmentHeight = to.offset - from.offset; + float relativePos = y - from.offset;// position from 0 to [segmentHeight] + float relativePercent = relativePos / segmentHeight;// position in percent between [from.offset] and [to.offset]. + + float gradientAlpha = uAlpha * currentColor.a; + vec4 gradientColor = mix(colorFrom, colorTo, relativePercent) * gradientAlpha; + + if (uReplace < 0.5) { + // mix resulting color with current color + finalColor = gradientColor + currentColor*(1.-gradientColor.a); + } else { + // replace with gradient color + finalColor = gradientColor; + } +} +`,Jo=`in vec2 aPosition; +out vec2 vTextureCoord; +out vec2 vFilterCoord; + +uniform vec4 uInputSize; +uniform vec4 uOutputFrame; +uniform vec4 uOutputTexture; + +vec4 filterVertexPosition( void ) +{ + vec2 position = aPosition * uOutputFrame.zw + uOutputFrame.xy; + + position.x = position.x * (2.0 / uOutputTexture.x) - 1.0; + position.y = position.y * (2.0*uOutputTexture.z / uOutputTexture.y) - uOutputTexture.z; + + return vec4(position, 0.0, 1.0); +} + +vec2 filterTextureCoord( void ) +{ + return aPosition * (uOutputFrame.zw * uInputSize.zw); +} + +void main(void) +{ + gl_Position = filterVertexPosition(); + vTextureCoord = filterTextureCoord(); + vFilterCoord = vTextureCoord * uInputSize.xy / uOutputFrame.zw; +} +`,Fn=`struct BaseUniforms { + uOptions: vec4, + uCounts: vec2, +}; + +struct StopsUniforms { + uColors: array, MAX_STOPS>, + uStops: array, MAX_STOPS>, +}; + +struct GlobalFilterUniforms { + uInputSize:vec4, + uInputPixel:vec4, + uInputClamp:vec4, + uOutputFrame:vec4, + uGlobalFrame:vec4, + uOutputTexture:vec4, +}; + +@group(0) @binding(0) var gfu: GlobalFilterUniforms; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var baseUniforms : BaseUniforms; +@group(1) @binding(1) var stopsUniforms : StopsUniforms; + +struct VSOutput { + @builtin(position) position: vec4, + @location(0) uv : vec2, + @location(1) coord : vec2 +}; + +fn filterVertexPosition(aPosition:vec2) -> vec4 +{ + var position = aPosition * gfu.uOutputFrame.zw + gfu.uOutputFrame.xy; + + position.x = position.x * (2.0 / gfu.uOutputTexture.x) - 1.0; + position.y = position.y * (2.0*gfu.uOutputTexture.z / gfu.uOutputTexture.y) - gfu.uOutputTexture.z; + + return vec4(position, 0.0, 1.0); +} + +fn filterTextureCoord( aPosition:vec2 ) -> vec2 +{ + return aPosition * (gfu.uOutputFrame.zw * gfu.uInputSize.zw); +} + +fn filterCoord( vTextureCoord:vec2 ) -> vec2 +{ + return vTextureCoord * gfu.uInputSize.xy / gfu.uOutputFrame.zw; +} + +fn globalTextureCoord( aPosition:vec2 ) -> vec2 +{ + return (aPosition.xy / gfu.uGlobalFrame.zw) + (gfu.uGlobalFrame.xy / gfu.uGlobalFrame.zw); +} + +fn getSize() -> vec2 +{ + return gfu.uGlobalFrame.zw; +} + +@vertex +fn mainVertex( + @location(0) aPosition : vec2, +) -> VSOutput { + let vTextureCoord: vec2 = filterTextureCoord(aPosition); + return VSOutput( + filterVertexPosition(aPosition), + vTextureCoord, + filterCoord(vTextureCoord), + ); +} + +struct ColorStop { + offset: f32, + color: vec3, + alpha: f32, +}; + +fn rotate2d(angle: f32) -> mat2x2{ + return mat2x2(cos(angle), -sin(angle), + sin(angle), cos(angle)); +} + +fn projectLinearPosition(pos: vec2, angle: f32) -> f32 { + var center: vec2 = vec2(0.5); + var result: vec2 = pos - center; + result = rotate2d(angle) * result; + result = result + center; + return clamp(result.x, 0.0, 1.0); +} + +fn projectRadialPosition(pos: vec2) -> f32 { + var r: f32 = distance(pos, vec2(0.5)); + return clamp(2.0 * r, 0.0, 1.0); +} + +fn projectAnglePosition(pos: vec2, angle: f32) -> f32 { + var center: vec2 = pos - vec2(0.5, 0.5); + var polarAngle: f32 = atan2(-center.y, center.x); + return ((polarAngle + angle) % PI_2) / PI_2; +} + +fn projectPosition(pos: vec2, gradientType: i32, angle: f32) -> f32 { + if (gradientType == TYPE_LINEAR) { + return projectLinearPosition(pos, angle); + } else if (gradientType == TYPE_RADIAL) { + return projectRadialPosition(pos); + } else if (gradientType == TYPE_CONIC) { + return projectAnglePosition(pos, angle); + } + + return pos.y; +} + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2, + @location(1) coord : vec2 +) -> @location(0) vec4 { + let uType: i32 = i32(baseUniforms.uOptions[0]); + let uAngle: f32 = baseUniforms.uOptions[1]; + let uAlpha: f32 = baseUniforms.uOptions[2]; + let uReplace: f32 = baseUniforms.uOptions[3]; + + let uNumStops: i32 = i32(baseUniforms.uCounts[0]); + let uMaxColors: f32 = baseUniforms.uCounts[1]; + + // current/original color + var currentColor: vec4 = textureSample(uTexture, uSampler, uv); + + // skip calculations if gradient alpha is 0 + if (uAlpha == 0.0) { return currentColor; } + + // project position + var y: f32 = projectPosition(coord, uType, radians(uAngle)); + + // check gradient bounds + var offsetMin: f32 = stopsUniforms.uStops[0][0]; + var offsetMax: f32 = 0.0; + + let numStops: i32 = uNumStops; + + for (var i: i32 = 0; i < MAX_STOPS; i = i + 1) { + if (i == numStops - 1) { // last index + offsetMax = stopsUniforms.uStops[i][0]; + } + } + + if (y < offsetMin || y > offsetMax) { return currentColor; } + + // limit colors + if (uMaxColors > 0.0) { + var stepSize: f32 = 1.0 / uMaxColors; + var stepNumber: f32 = floor(y / stepSize); + y = stepSize * (stepNumber + 0.5); // offset by 0.5 to use color from middle of segment + } + + // find color stops + var stopFrom: ColorStop; + var stopTo: ColorStop; + + for (var i: i32 = 0; i < MAX_STOPS; i = i + 1) { + if (y >= stopsUniforms.uStops[i][0]) { + stopFrom = ColorStop(stopsUniforms.uStops[i][0], stopsUniforms.uColors[i], stopsUniforms.uStops[i][1]); + stopTo = ColorStop(stopsUniforms.uStops[i + 1][0], stopsUniforms.uColors[i + 1], stopsUniforms.uStops[i + 1][1]); + } + + if (i == numStops - 1) { // last index + break; + } + } + + // mix colors from stops + var colorFrom: vec4 = vec4(stopFrom.color * stopFrom.alpha, stopFrom.alpha); + var colorTo: vec4 = vec4(stopTo.color * stopTo.alpha, stopTo.alpha); + + var segmentHeight: f32 = stopTo.offset - stopFrom.offset; + var relativePos: f32 = y - stopFrom.offset; // position from 0 to [segmentHeight] + var relativePercent: f32 = relativePos / segmentHeight; // position in percent between [from.offset] and [to.offset]. + + var gradientAlpha: f32 = uAlpha * currentColor.a; + var gradientColor: vec4 = mix(colorFrom, colorTo, relativePercent) * gradientAlpha; + + if (uReplace < 0.5) { + // mix resulting color with current color + return gradientColor + currentColor * (1.0 - gradientColor.a); + } else { + // replace with gradient color + return gradientColor; + } +} + +const PI: f32 = 3.14159265358979323846264; +const PI_2: f32 = PI * 2.0; + +const TYPE_LINEAR: i32 = 0; +const TYPE_RADIAL: i32 = 1; +const TYPE_CONIC: i32 = 2; +const MAX_STOPS: i32 = 32;`,ma=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function pa(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function va(r){return r&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function ga(r){return r&&Object.prototype.hasOwnProperty.call(r,"default")&&Object.keys(r).length===1?r.default:r}function da(r){if(r.__esModule)return r;var e=r.default;if(typeof e=="function"){var n=function t(){if(this instanceof t){var o=[null];o.push.apply(o,arguments);var i=Function.bind.apply(e,o);return new i}return e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(r).forEach(function(t){var o=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(n,t,o.get?o:{enumerable:!0,get:function(){return r[t]}})}),n}var In={},I=I||{};I.stringify=function(){var r={"visit_linear-gradient":function(e){return r.visit_gradient(e)},"visit_repeating-linear-gradient":function(e){return r.visit_gradient(e)},"visit_radial-gradient":function(e){return r.visit_gradient(e)},"visit_repeating-radial-gradient":function(e){return r.visit_gradient(e)},visit_gradient:function(e){var n=r.visit(e.orientation);return n&&(n+=", "),e.type+"("+n+r.visit(e.colorStops)+")"},visit_shape:function(e){var n=e.value,t=r.visit(e.at),o=r.visit(e.style);return o&&(n+=" "+o),t&&(n+=" at "+t),n},"visit_default-radial":function(e){var n="",t=r.visit(e.at);return t&&(n+=t),n},"visit_extent-keyword":function(e){var n=e.value,t=r.visit(e.at);return t&&(n+=" at "+t),n},"visit_position-keyword":function(e){return e.value},visit_position:function(e){return r.visit(e.value.x)+" "+r.visit(e.value.y)},"visit_%":function(e){return e.value+"%"},visit_em:function(e){return e.value+"em"},visit_px:function(e){return e.value+"px"},visit_literal:function(e){return r.visit_color(e.value,e)},visit_hex:function(e){return r.visit_color("#"+e.value,e)},visit_rgb:function(e){return r.visit_color("rgb("+e.value.join(", ")+")",e)},visit_rgba:function(e){return r.visit_color("rgba("+e.value.join(", ")+")",e)},visit_color:function(e,n){var t=e,o=r.visit(n.length);return o&&(t+=" "+o),t},visit_angular:function(e){return e.value+"deg"},visit_directional:function(e){return"to "+e.value},visit_array:function(e){var n="",t=e.length;return e.forEach(function(o,i){n+=r.visit(o),i0&&n("Invalid input not EOF"),a}function o(){return B(i)}function i(){return u("linear-gradient",r.linearGradient,v)||u("repeating-linear-gradient",r.repeatingLinearGradient,v)||u("radial-gradient",r.radialGradient,k)||u("repeating-radial-gradient",r.repeatingRadialGradient,k)}function u(a,d,x){return l(d,function(P){var en=x();return en&&(O(r.comma)||n("Missing comma before color stops")),{type:a,orientation:en,colorStops:B(Et)}})}function l(a,d){var x=O(a);if(x){O(r.startCall)||n("Missing (");var P=d(x);return O(r.endCall)||n("Missing )"),P}}function v(){return g()||b()}function g(){return C("directional",r.sideOrCorner,1)}function b(){return C("angular",r.angleValue,1)}function k(){var a,d=j(),x;return d&&(a=[],a.push(d),x=e,O(r.comma)&&(d=j(),d?a.push(d):e=x)),a}function j(){var a=G()||$t();if(a)a.at=qe();else{var d=ne();if(d){a=d;var x=qe();x&&(a.at=x)}else{var P=He();P&&(a={type:"default-radial",at:P})}}return a}function G(){var a=C("shape",/^(circle)/i,0);return a&&(a.style=Qe()||ne()),a}function $t(){var a=C("shape",/^(ellipse)/i,0);return a&&(a.style=N()||ne()),a}function ne(){return C("extent-keyword",r.extentKeywords,1)}function qe(){if(C("position",/^at/,0)){var a=He();return a||n("Missing positioning value"),a}}function He(){var a=Mt();if(a.x||a.y)return{type:"position",value:a}}function Mt(){return{x:N(),y:N()}}function B(a){var d=a(),x=[];if(d)for(x.push(d);O(r.comma);)d=a(),d?x.push(d):n("One extra comma");return x}function Et(){var a=Lt();return a||n("Expected color definition"),a.length=N(),a}function Lt(){return jt()||Bt()||Gt()||kt()}function kt(){return C("literal",r.literalColor,0)}function jt(){return C("hex",r.hexColor,1)}function Gt(){return l(r.rgbColor,function(){return{type:"rgb",value:B(Ze)}})}function Bt(){return l(r.rgbaColor,function(){return{type:"rgba",value:B(Ze)}})}function Ze(){return O(r.number)[1]}function N(){return C("%",r.percentageValue,1)||Nt()||Qe()}function Nt(){return C("position-keyword",r.positionKeywords,1)}function Qe(){return C("px",r.pixelValue,1)||C("em",r.emValue,1)}function C(a,d,x){var P=O(d);if(P)return{type:a,value:P[x]}}function O(a){var d,x;return x=/^[\n\r\t\s]+/.exec(e),x&&Je(x[0].length),d=a.exec(e),d&&Je(d[0].length),d}function Je(a){e=e.substr(a)}return function(a){return e=a.toString(),t()}}();var ei=In.parse=I.parse,ha=In.stringify=I.stringify;function Un(r){const e=ei(kn(r));if(e.length===0)throw new Error("Invalid CSS gradient.");if(e.length!==1)throw new Error("Unsupported CSS gradient (multiple gradients is not supported).");const n=e[0],t=Rn(n.type),o=Dn(n.colorStops),i=En(n.orientation);return{type:t,stops:o,angle:i}}function Rn(r){const e={"linear-gradient":0,"radial-gradient":1};if(!(r in e))throw new Error(`Unsupported gradient type "${r}"`);return e[r]}function Dn(r){const e=Mn(r),n=[],t=new S;for(let o=0;o{for(let i=o;i6?parseFloat(r.toString().substring(0,6)):r}function En(r){if(typeof r=="undefined")return 0;if("type"in r&&"value"in r)switch(r.type){case"angular":return parseFloat(r.value);case"directional":return Ln(r.value)}return 0}function Ln(r){const e={left:270,top:0,bottom:180,right:90,"left top":315,"top left":315,"left bottom":225,"bottom left":225,"right top":45,"top right":45,"right bottom":135,"bottom right":135};if(!(r in e))throw new Error(`Unsupported directional value "${r}"`);return e[r]}function kn(r){let e=r.replace(/\s{2,}/gu," ");return e=e.replace(/;/g,""),e=e.replace(/ ,/g,","),e=e.replace(/\( /g,"("),e=e.replace(/ \)/g,")"),e.trim()}var ri=Object.defineProperty,ti=Object.defineProperties,oi=Object.getOwnPropertyDescriptors,jn=Object.getOwnPropertySymbols,ii=Object.prototype.hasOwnProperty,ui=Object.prototype.propertyIsEnumerable,me=(r,e,n)=>e in r?ri(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,pe=(r,e)=>{for(var n in e||(e={}))ii.call(e,n)&&me(r,n,e[n]);if(jn)for(var n of jn(e))ui.call(e,n)&&me(r,n,e[n]);return r},li=(r,e)=>ti(r,oi(e)),A=(r,e,n)=>(me(r,typeof e!="symbol"?e+"":e,n),n);const ve=90;function ai(r){return[...r].sort((e,n)=>e.offset-n.offset)}const M=class ee extends s{constructor(e){var n,t,o;if(e&&"css"in e?e=li(pe({},Un(e.css||"")),{alpha:(n=e.alpha)!=null?n:ee.defaults.alpha,maxColors:(t=e.maxColors)!=null?t:ee.defaults.maxColors}):e=pe(pe({},ee.defaults),e),!e.stops||e.stops.length<2)throw new Error("ColorGradientFilter requires at least 2 color stops.");const i=f.from({vertex:{source:Fn,entryPoint:"mainVertex"},fragment:{source:Fn,entryPoint:"mainFragment"}}),u=c.from({vertex:Jo,fragment:Qo,name:"color-gradient-filter"}),l=32;super({gpuProgram:i,glProgram:u,resources:{baseUniforms:{uOptions:{value:[e.type,(o=e.angle)!=null?o:ve,e.alpha,e.replace?1:0],type:"vec4"},uCounts:{value:[e.stops.length,e.maxColors],type:"vec2"}},stopsUniforms:{uColors:{value:new Float32Array(l*3),type:"vec3",size:l},uStops:{value:new Float32Array(l*4),type:"vec4",size:l}}}}),A(this,"baseUniforms"),A(this,"stopsUniforms"),A(this,"_stops",[]),this.baseUniforms=this.resources.baseUniforms.uniforms,this.stopsUniforms=this.resources.stopsUniforms.uniforms,Object.assign(this,e)}get stops(){return this._stops}set stops(e){const n=ai(e),t=new S;let o,i,u;for(let l=0;l.5}set replace(e){this.baseUniforms.uOptions[3]=e?1:0}};A(M,"LINEAR",0),A(M,"RADIAL",1),A(M,"CONIC",2),A(M,"defaults",{type:M.LINEAR,stops:[{offset:0,color:16711680,alpha:1},{offset:1,color:255,alpha:1}],alpha:1,angle:90,maxColors:0,replace:!1});let si=M;var fi=`in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform sampler2D uMapTexture; +uniform float uMix; +uniform float uSize; +uniform float uSliceSize; +uniform float uSlicePixelSize; +uniform float uSliceInnerSize; + +void main() { + vec4 color = texture(uTexture, vTextureCoord.xy); + vec4 adjusted; + + if (color.a > 0.0) { + color.rgb /= color.a; + float innerWidth = uSize - 1.0; + float zSlice0 = min(floor(color.b * innerWidth), innerWidth); + float zSlice1 = min(zSlice0 + 1.0, innerWidth); + float xOffset = uSlicePixelSize * 0.5 + color.r * uSliceInnerSize; + float s0 = xOffset + (zSlice0 * uSliceSize); + float s1 = xOffset + (zSlice1 * uSliceSize); + float yOffset = uSliceSize * 0.5 + color.g * (1.0 - uSliceSize); + vec4 slice0Color = texture(uMapTexture, vec2(s0,yOffset)); + vec4 slice1Color = texture(uMapTexture, vec2(s1,yOffset)); + float zOffset = fract(color.b * innerWidth); + adjusted = mix(slice0Color, slice1Color, zOffset); + + color.rgb *= color.a; + } + + finalColor = vec4(mix(color, adjusted, uMix).rgb, color.a); + +}`,ci=`struct ColorMapUniforms { + uMix: f32, + uSize: f32, + uSliceSize: f32, + uSlicePixelSize: f32, + uSliceInnerSize: f32, +}; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var colorMapUniforms : ColorMapUniforms; +@group(1) @binding(1) var uMapTexture: texture_2d; +@group(1) @binding(2) var uMapSampler: sampler; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 +) -> @location(0) vec4 { + var color:vec4 = textureSample(uTexture, uSampler, uv); + + var adjusted: vec4; + + var altColor: vec4 = vec4(color.rgb / color.a, color.a); + let innerWidth: f32 = colorMapUniforms.uSize - 1.0; + let zSlice0: f32 = min(floor(color.b * innerWidth), innerWidth); + let zSlice1: f32 = min(zSlice0 + 1.0, innerWidth); + let xOffset: f32 = colorMapUniforms.uSlicePixelSize * 0.5 + color.r * colorMapUniforms.uSliceInnerSize; + let s0: f32 = xOffset + (zSlice0 * colorMapUniforms.uSliceSize); + let s1: f32 = xOffset + (zSlice1 * colorMapUniforms.uSliceSize); + let yOffset: f32 = colorMapUniforms.uSliceSize * 0.5 + color.g * (1.0 - colorMapUniforms.uSliceSize); + let slice0Color: vec4 = textureSample(uMapTexture, uMapSampler, vec2(s0,yOffset)); + let slice1Color: vec4 = textureSample(uMapTexture, uMapSampler, vec2(s1,yOffset)); + let zOffset: f32 = fract(color.b * innerWidth); + adjusted = mix(slice0Color, slice1Color, zOffset); + altColor = vec4(color.rgb * color.a, color.a); + + let realColor: vec4 = select(color, altColor, color.a > 0.0); + + return vec4(mix(realColor, adjusted, colorMapUniforms.uMix).rgb, realColor.a); +}`,mi=Object.defineProperty,Gn=Object.getOwnPropertySymbols,pi=Object.prototype.hasOwnProperty,vi=Object.prototype.propertyIsEnumerable,ge=(r,e,n)=>e in r?mi(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,Bn=(r,e)=>{for(var n in e||(e={}))pi.call(e,n)&&ge(r,n,e[n]);if(Gn)for(var n of Gn(e))vi.call(e,n)&&ge(r,n,e[n]);return r},z=(r,e,n)=>(ge(r,typeof e!="symbol"?e+"":e,n),n);const Nn=class pt extends s{constructor(...e){var n;let t=(n=e[0])!=null?n:{};if((t instanceof _||t instanceof Yt)&&(h("6.0.0","ColorMapFilter constructor params are now options object. See params: { colorMap, nearest, mix }"),t={colorMap:t},e[1]!==void 0&&(t.nearest=e[1]),e[2]!==void 0&&(t.mix=e[2])),t=Bn(Bn({},pt.DEFAULT_OPTIONS),t),!t.colorMap)throw Error("No color map texture source was provided to ColorMapFilter");const o=f.from({vertex:{source:p,entryPoint:"mainVertex"},fragment:{source:ci,entryPoint:"mainFragment"}}),i=c.from({vertex:m,fragment:fi,name:"color-map-filter"});super({gpuProgram:o,glProgram:i,resources:{colorMapUniforms:{uMix:{value:t.mix,type:"f32"},uSize:{value:0,type:"f32"},uSliceSize:{value:0,type:"f32"},uSlicePixelSize:{value:0,type:"f32"},uSliceInnerSize:{value:0,type:"f32"}},uMapTexture:t.colorMap.source,uMapSampler:t.colorMap.source.style}}),z(this,"uniforms"),z(this,"_size",0),z(this,"_sliceSize",0),z(this,"_slicePixelSize",0),z(this,"_sliceInnerSize",0),z(this,"_nearest",!1),z(this,"_scaleMode","linear"),z(this,"_colorMap"),this.uniforms=this.resources.colorMapUniforms.uniforms,Object.assign(this,t)}get mix(){return this.uniforms.uMix}set mix(e){this.uniforms.uMix=e}get colorSize(){return this._size}get colorMap(){return this._colorMap}set colorMap(e){if(!e||e===this.colorMap)return;const n=e instanceof _?e.source:e;n.style.scaleMode=this._scaleMode,n.autoGenerateMipmaps=!1,this._size=n.height,this._sliceSize=1/this._size,this._slicePixelSize=this._sliceSize/this._size,this._sliceInnerSize=this._slicePixelSize*(this._size-1),this.uniforms.uSize=this._size,this.uniforms.uSliceSize=this._sliceSize,this.uniforms.uSlicePixelSize=this._slicePixelSize,this.uniforms.uSliceInnerSize=this._sliceInnerSize,this.resources.uMapTexture=n,this._colorMap=e}get nearest(){return this._nearest}set nearest(e){this._nearest=e,this._scaleMode=e?"nearest":"linear";const n=this._colorMap;n&&n.source&&(n.source.scaleMode=this._scaleMode,n.source.autoGenerateMipmaps=!1,n.source.style.update(),n.source.update())}updateColorMap(){const e=this._colorMap;e!=null&&e.source&&(e.source.update(),this.colorMap=e)}destroy(){var e;(e=this._colorMap)==null||e.destroy(),super.destroy()}};z(Nn,"DEFAULT_OPTIONS",{colorMap:_.WHITE,nearest:!1,mix:1});let gi=Nn;var di=`in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform vec3 uColor; +uniform float uAlpha; + +void main(void) { + vec4 c = texture(uTexture, vTextureCoord); + finalColor = vec4(mix(c.rgb, uColor.rgb, c.a * uAlpha), c.a); +} +`,hi=`struct ColorOverlayUniforms { + uColor: vec3, + uAlpha: f32, +}; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var colorOverlayUniforms : ColorOverlayUniforms; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 +) -> @location(0) vec4 { + let c = textureSample(uTexture, uSampler, uv); + return vec4(mix(c.rgb, colorOverlayUniforms.uColor.rgb, c.a * colorOverlayUniforms.uAlpha), c.a); +} +`,xi=Object.defineProperty,Vn=Object.getOwnPropertySymbols,yi=Object.prototype.hasOwnProperty,Si=Object.prototype.propertyIsEnumerable,de=(r,e,n)=>e in r?xi(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,Xn=(r,e)=>{for(var n in e||(e={}))yi.call(e,n)&&de(r,n,e[n]);if(Vn)for(var n of Vn(e))Si.call(e,n)&&de(r,n,e[n]);return r},he=(r,e,n)=>(de(r,typeof e!="symbol"?e+"":e,n),n);const Yn=class vt extends s{constructor(...e){var n,t;let o=(n=e[0])!=null?n:{};(typeof o=="number"||Array.isArray(o)||o instanceof Float32Array)&&(h("6.0.0","ColorOverlayFilter constructor params are now options object. See params: { color, alpha }"),o={color:o},e[1]!==void 0&&(o.alpha=e[1])),o=Xn(Xn({},vt.DEFAULT_OPTIONS),o);const i=f.from({vertex:{source:p,entryPoint:"mainVertex"},fragment:{source:hi,entryPoint:"mainFragment"}}),u=c.from({vertex:m,fragment:di,name:"color-overlay-filter"});super({gpuProgram:i,glProgram:u,resources:{colorOverlayUniforms:{uColor:{value:new Float32Array(3),type:"vec3"},uAlpha:{value:o.alpha,type:"f32"}}}}),he(this,"uniforms"),he(this,"_color"),this.uniforms=this.resources.colorOverlayUniforms.uniforms,this._color=new S,this.color=(t=o.color)!=null?t:0}get color(){return this._color.value}set color(e){this._color.setValue(e);const[n,t,o]=this._color.toArray();this.uniforms.uColor[0]=n,this.uniforms.uColor[1]=t,this.uniforms.uColor[2]=o}get alpha(){return this.uniforms.uAlpha}set alpha(e){this.uniforms.uAlpha=e}};he(Yn,"DEFAULT_OPTIONS",{color:0,alpha:1});let bi=Yn;var Ci=`in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform vec3 uOriginalColor; +uniform vec3 uTargetColor; +uniform float uTolerance; + +void main(void) { + vec4 c = texture(uTexture, vTextureCoord); + vec3 colorDiff = uOriginalColor - (c.rgb / max(c.a, 0.0000000001)); + float colorDistance = length(colorDiff); + float doReplace = step(colorDistance, uTolerance); + finalColor = vec4(mix(c.rgb, (uTargetColor + colorDiff) * c.a, doReplace), c.a); +} +`,Ti=`struct ColorReplaceUniforms { + uOriginalColor: vec3, + uTargetColor: vec3, + uTolerance: f32, +}; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var colorReplaceUniforms : ColorReplaceUniforms; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 +) -> @location(0) vec4 { + let sample: vec4 = textureSample(uTexture, uSampler, uv); + + let colorDiff: vec3 = colorReplaceUniforms.uOriginalColor - (sample.rgb / max(sample.a, 0.0000000001)); + let colorDistance: f32 = length(colorDiff); + let doReplace: f32 = step(colorDistance, colorReplaceUniforms.uTolerance); + + return vec4(mix(sample.rgb, (colorReplaceUniforms.uTargetColor + colorDiff) * sample.a, doReplace), sample.a); +}`,zi=Object.defineProperty,Kn=Object.getOwnPropertySymbols,Oi=Object.prototype.hasOwnProperty,Pi=Object.prototype.propertyIsEnumerable,xe=(r,e,n)=>e in r?zi(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,Wn=(r,e)=>{for(var n in e||(e={}))Oi.call(e,n)&&xe(r,n,e[n]);if(Kn)for(var n of Kn(e))Pi.call(e,n)&&xe(r,n,e[n]);return r},Y=(r,e,n)=>(xe(r,typeof e!="symbol"?e+"":e,n),n);const qn=class gt extends s{constructor(...e){var n,t,o;let i=(n=e[0])!=null?n:{};(typeof i=="number"||Array.isArray(i)||i instanceof Float32Array)&&(h("6.0.0","ColorReplaceFilter constructor params are now options object. See params: { originalColor, targetColor, tolerance }"),i={originalColor:i},e[1]!==void 0&&(i.targetColor=e[1]),e[2]!==void 0&&(i.tolerance=e[2])),i=Wn(Wn({},gt.DEFAULT_OPTIONS),i);const u=f.from({vertex:{source:p,entryPoint:"mainVertex"},fragment:{source:Ti,entryPoint:"mainFragment"}}),l=c.from({vertex:m,fragment:Ci,name:"color-replace-filter"});super({gpuProgram:u,glProgram:l,resources:{colorReplaceUniforms:{uOriginalColor:{value:new Float32Array(3),type:"vec3"},uTargetColor:{value:new Float32Array(3),type:"vec3"},uTolerance:{value:i.tolerance,type:"f32"}}}}),Y(this,"uniforms"),Y(this,"_originalColor"),Y(this,"_targetColor"),this.uniforms=this.resources.colorReplaceUniforms.uniforms,this._originalColor=new S,this._targetColor=new S,this.originalColor=(t=i.originalColor)!=null?t:16711680,this.targetColor=(o=i.targetColor)!=null?o:0,Object.assign(this,i)}get originalColor(){return this._originalColor.value}set originalColor(e){this._originalColor.setValue(e);const[n,t,o]=this._originalColor.toArray();this.uniforms.uOriginalColor[0]=n,this.uniforms.uOriginalColor[1]=t,this.uniforms.uOriginalColor[2]=o}get targetColor(){return this._targetColor.value}set targetColor(e){this._targetColor.setValue(e);const[n,t,o]=this._targetColor.toArray();this.uniforms.uTargetColor[0]=n,this.uniforms.uTargetColor[1]=t,this.uniforms.uTargetColor[2]=o}get tolerance(){return this.uniforms.uTolerance}set tolerance(e){this.uniforms.uTolerance=e}set newColor(e){h("6.0.0","ColorReplaceFilter.newColor is deprecated, please use ColorReplaceFilter.targetColor instead"),this.targetColor=e}get newColor(){return h("6.0.0","ColorReplaceFilter.newColor is deprecated, please use ColorReplaceFilter.targetColor instead"),this.targetColor}set epsilon(e){h("6.0.0","ColorReplaceFilter.epsilon is deprecated, please use ColorReplaceFilter.tolerance instead"),this.tolerance=e}get epsilon(){return h("6.0.0","ColorReplaceFilter.epsilon is deprecated, please use ColorReplaceFilter.tolerance instead"),this.tolerance}};Y(qn,"DEFAULT_OPTIONS",{originalColor:16711680,targetColor:0,tolerance:.4});let _i=qn;var wi=`in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform vec2 uTexelSize; +uniform mat3 uMatrix; + +void main(void) +{ + vec4 c11 = texture(uTexture, vTextureCoord - uTexelSize); // top left + vec4 c12 = texture(uTexture, vec2(vTextureCoord.x, vTextureCoord.y - uTexelSize.y)); // top center + vec4 c13 = texture(uTexture, vec2(vTextureCoord.x + uTexelSize.x, vTextureCoord.y - uTexelSize.y)); // top right + + vec4 c21 = texture(uTexture, vec2(vTextureCoord.x - uTexelSize.x, vTextureCoord.y)); // mid left + vec4 c22 = texture(uTexture, vTextureCoord); // mid center + vec4 c23 = texture(uTexture, vec2(vTextureCoord.x + uTexelSize.x, vTextureCoord.y)); // mid right + + vec4 c31 = texture(uTexture, vec2(vTextureCoord.x - uTexelSize.x, vTextureCoord.y + uTexelSize.y)); // bottom left + vec4 c32 = texture(uTexture, vec2(vTextureCoord.x, vTextureCoord.y + uTexelSize.y)); // bottom center + vec4 c33 = texture(uTexture, vTextureCoord + uTexelSize); // bottom right + + finalColor = + c11 * uMatrix[0][0] + c12 * uMatrix[0][1] + c13 * uMatrix[0][2] + + c21 * uMatrix[1][0] + c22 * uMatrix[1][1] + c23 * uMatrix[1][2] + + c31 * uMatrix[2][0] + c32 * uMatrix[2][1] + c33 * uMatrix[2][2]; + + finalColor.a = c22.a; +}`,Ai=`struct ConvolutionUniforms { + uMatrix: mat3x3, + uTexelSize: vec2, +}; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var convolutionUniforms : ConvolutionUniforms; + +@fragment +fn mainFragment( + @location(0) uv: vec2, + @builtin(position) position: vec4 +) -> @location(0) vec4 { + let texelSize = convolutionUniforms.uTexelSize; + let matrix = convolutionUniforms.uMatrix; + + let c11: vec4 = textureSample(uTexture, uSampler, uv - texelSize); // top left + let c12: vec4 = textureSample(uTexture, uSampler, vec2(uv.x, uv.y - texelSize.y)); // top center + let c13: vec4 = textureSample(uTexture, uSampler, vec2(uv.x + texelSize.x, uv.y - texelSize.y)); // top right + + let c21: vec4 = textureSample(uTexture, uSampler, vec2(uv.x - texelSize.x, uv.y)); // mid left + let c22: vec4 = textureSample(uTexture, uSampler, uv); // mid center + let c23: vec4 = textureSample(uTexture, uSampler, vec2(uv.x + texelSize.x, uv.y)); // mid right + + let c31: vec4 = textureSample(uTexture, uSampler, vec2(uv.x - texelSize.x, uv.y + texelSize.y)); // bottom left + let c32: vec4 = textureSample(uTexture, uSampler, vec2(uv.x, uv.y + texelSize.y)); // bottom center + let c33: vec4 = textureSample(uTexture, uSampler, uv + texelSize); // bottom right + + var finalColor: vec4 = vec4( + c11 * matrix[0][0] + c12 * matrix[0][1] + c13 * matrix[0][2] + + c21 * matrix[1][0] + c22 * matrix[1][1] + c23 * matrix[1][2] + + c31 * matrix[2][0] + c32 * matrix[2][1] + c33 * matrix[2][2] + ); + + finalColor.a = c22.a; + + return finalColor; +}`,Fi=Object.defineProperty,Hn=Object.getOwnPropertySymbols,Ii=Object.prototype.hasOwnProperty,Ui=Object.prototype.propertyIsEnumerable,ye=(r,e,n)=>e in r?Fi(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,Zn=(r,e)=>{for(var n in e||(e={}))Ii.call(e,n)&&ye(r,n,e[n]);if(Hn)for(var n of Hn(e))Ui.call(e,n)&&ye(r,n,e[n]);return r},Qn=(r,e,n)=>(ye(r,typeof e!="symbol"?e+"":e,n),n);const Jn=class dt extends s{constructor(...e){var n,t,o;let i=(n=e[0])!=null?n:{};Array.isArray(i)&&(h("6.0.0","ConvolutionFilter constructor params are now options object. See params: { matrix, width, height }"),i={matrix:i},e[1]!==void 0&&(i.width=e[1]),e[2]!==void 0&&(i.height=e[2])),i=Zn(Zn({},dt.DEFAULT_OPTIONS),i);const u=(t=i.width)!=null?t:200,l=(o=i.height)!=null?o:200,v=f.from({vertex:{source:p,entryPoint:"mainVertex"},fragment:{source:Ai,entryPoint:"mainFragment"}}),g=c.from({vertex:m,fragment:wi,name:"convolution-filter"});super({gpuProgram:v,glProgram:g,resources:{convolutionUniforms:{uMatrix:{value:i.matrix,type:"mat3x3"},uTexelSize:{value:{x:1/u,y:1/l},type:"vec2"}}}}),Qn(this,"uniforms"),this.uniforms=this.resources.convolutionUniforms.uniforms,this.width=u,this.height=l}get matrix(){return this.uniforms.uMatrix}set matrix(e){e.forEach((n,t)=>{this.uniforms.uMatrix[t]=n})}get width(){return 1/this.uniforms.uTexelSize.x}set width(e){this.uniforms.uTexelSize.x=1/e}get height(){return 1/this.uniforms.uTexelSize.y}set height(e){this.uniforms.uTexelSize.y=1/e}};Qn(Jn,"DEFAULT_OPTIONS",{matrix:new Float32Array(9),width:200,height:200});let Ri=Jn;var Di=`in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; + +void main(void) +{ + float lum = length(texture(uTexture, vTextureCoord.xy).rgb); + + finalColor = vec4(1.0, 1.0, 1.0, 1.0); + + if (lum < 1.00) + { + if (mod(gl_FragCoord.x + gl_FragCoord.y, 10.0) == 0.0) + { + finalColor = vec4(0.0, 0.0, 0.0, 1.0); + } + } + + if (lum < 0.75) + { + if (mod(gl_FragCoord.x - gl_FragCoord.y, 10.0) == 0.0) + { + finalColor = vec4(0.0, 0.0, 0.0, 1.0); + } + } + + if (lum < 0.50) + { + if (mod(gl_FragCoord.x + gl_FragCoord.y - 5.0, 10.0) == 0.0) + { + finalColor = vec4(0.0, 0.0, 0.0, 1.0); + } + } + + if (lum < 0.3) + { + if (mod(gl_FragCoord.x - gl_FragCoord.y - 5.0, 10.0) == 0.0) + { + finalColor = vec4(0.0, 0.0, 0.0, 1.0); + } + } +} +`,$i=`@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; + +@fragment +fn mainFragment( + @location(0) uv: vec2, + @builtin(position) position: vec4 +) -> @location(0) vec4 { + let lum: f32 = length(textureSample(uTexture, uSampler, uv).rgb); + + if (lum < 1.00) + { + if (modulo(position.x + position.y, 10.0) == 0.0) + { + return vec4(0.0, 0.0, 0.0, 1.0); + } + } + + if (lum < 0.75) + { + if (modulo(position.x - position.y, 10.0) == 0.0) + { + return vec4(0.0, 0.0, 0.0, 1.0); + } + } + + if (lum < 0.50) + { + if (modulo(position.x + position.y - 5.0, 10.0) == 0.0) + { + return vec4(0.0, 0.0, 0.0, 1.0); + } + } + + if (lum < 0.3) + { + if (modulo(position.x - position.y - 5.0, 10.0) == 0.0) + { + return vec4(0.0, 0.0, 0.0, 1.0); + } + } + + return vec4(1.0); +} + +fn modulo(x: f32, y: f32) -> f32 +{ + return x - y * floor(x/y); +}`;class Mi extends s{constructor(){const e=f.from({vertex:{source:p,entryPoint:"mainVertex"},fragment:{source:$i,entryPoint:"mainFragment"}}),n=c.from({vertex:m,fragment:Di,name:"cross-hatch-filter"});super({gpuProgram:e,glProgram:n,resources:{}})}}var Ei=`precision highp float; +in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform vec4 uLine; +uniform vec2 uNoise; +uniform vec3 uVignette; +uniform float uSeed; +uniform float uTime; +uniform vec2 uDimensions; + +uniform vec4 uInputSize; + +const float SQRT_2 = 1.414213; + +float rand(vec2 co) { + return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453); +} + +float vignette(vec3 co, vec2 coord) +{ + float outter = SQRT_2 - uVignette[0] * SQRT_2; + vec2 dir = vec2(0.5) - coord; + dir.y *= uDimensions.y / uDimensions.x; + float darker = clamp((outter - length(dir) * SQRT_2) / ( 0.00001 + uVignette[2] * SQRT_2), 0.0, 1.0); + return darker + (1.0 - darker) * (1.0 - uVignette[1]); +} + +float noise(vec2 coord) +{ + vec2 pixelCoord = coord * uInputSize.xy; + pixelCoord.x = floor(pixelCoord.x / uNoise[1]); + pixelCoord.y = floor(pixelCoord.y / uNoise[1]); + return (rand(pixelCoord * uNoise[1] * uSeed) - 0.5) * uNoise[0]; +} + +vec3 interlaceLines(vec3 co, vec2 coord) +{ + vec3 color = co; + + float curvature = uLine[0]; + float lineWidth = uLine[1]; + float lineContrast = uLine[2]; + float verticalLine = uLine[3]; + + vec2 dir = vec2(coord * uInputSize.xy / uDimensions - 0.5); + + float _c = curvature > 0. ? curvature : 1.; + float k = curvature > 0. ? (length(dir * dir) * 0.25 * _c * _c + 0.935 * _c) : 1.; + vec2 uv = dir * k; + float v = verticalLine > 0.5 ? uv.x * uDimensions.x : uv.y * uDimensions.y; + v *= min(1.0, 2.0 / lineWidth ) / _c; + float j = 1. + cos(v * 1.2 - uTime) * 0.5 * lineContrast; + color *= j; + + float segment = verticalLine > 0.5 ? mod((dir.x + .5) * uDimensions.x, 4.) : mod((dir.y + .5) * uDimensions.y, 4.); + color *= 0.99 + ceil(segment) * 0.015; + + return color; +} + +void main(void) +{ + finalColor = texture(uTexture, vTextureCoord); + vec2 coord = vTextureCoord * uInputSize.xy / uDimensions; + + if (uNoise[0] > 0.0 && uNoise[1] > 0.0) + { + float n = noise(vTextureCoord); + finalColor += vec4(n, n, n, finalColor.a); + } + + if (uVignette[0] > 0.) + { + float v = vignette(finalColor.rgb, coord); + finalColor *= vec4(v, v, v, finalColor.a); + } + + if (uLine[1] > 0.0) + { + finalColor = vec4(interlaceLines(finalColor.rgb, vTextureCoord), finalColor.a); + } +} +`,Li=`struct CRTUniforms { + uLine: vec4, + uNoise: vec2, + uVignette: vec3, + uSeed: f32, + uTime: f32, + uDimensions: vec2, +}; + +struct GlobalFilterUniforms { + uInputSize:vec4, + uInputPixel:vec4, + uInputClamp:vec4, + uOutputFrame:vec4, + uGlobalFrame:vec4, + uOutputTexture:vec4, +}; + +@group(0) @binding(0) var gfu: GlobalFilterUniforms; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var crtUniforms : CRTUniforms; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 +) -> @location(0) vec4 { + + var color: vec4 = textureSample(uTexture, uSampler, uv); + let coord: vec2 = uv * gfu.uInputSize.xy / crtUniforms.uDimensions; + + let uNoise = crtUniforms.uNoise; + + if (uNoise[0] > 0.0 && uNoise[1] > 0.0) + { + color += vec4(vec3(noise(uv)), color.a); + } + + if (crtUniforms.uVignette[0] > 0.) + { + color *= vec4(vec3(vignette(color.rgb, coord)), color.a); + } + + if (crtUniforms.uLine[1] > 0.0) + { + color = vec4(vec3(interlaceLines(color.rgb, uv)), color.a); + } + + return color; +} + +const SQRT_2: f32 = 1.414213; + +fn modulo(x: f32, y: f32) -> f32 +{ + return x - y * floor(x/y); +} + +fn rand(co: vec2) -> f32 +{ + return fract(sin(dot(co, vec2(12.9898, 78.233))) * 43758.5453); +} + +fn vignette(co: vec3, coord: vec2) -> f32 +{ + let uVignette = crtUniforms.uVignette; + let uDimensions = crtUniforms.uDimensions; + + let outter: f32 = SQRT_2 - uVignette[0] * SQRT_2; + var dir: vec2 = vec2(0.5) - coord; + dir.y *= uDimensions.y / uDimensions.x; + let darker: f32 = clamp((outter - length(dir) * SQRT_2) / ( 0.00001 + uVignette[2] * SQRT_2), 0.0, 1.0); + return darker + (1.0 - darker) * (1.0 - uVignette[1]); +} + +fn noise(coord: vec2) -> f32 +{ + let uNoise = crtUniforms.uNoise; + let uSeed = crtUniforms.uSeed; + + var pixelCoord: vec2 = coord * gfu.uInputSize.xy; + pixelCoord.x = floor(pixelCoord.x / uNoise[1]); + pixelCoord.y = floor(pixelCoord.y / uNoise[1]); + return (rand(pixelCoord * uNoise[1] * uSeed) - 0.5) * uNoise[0]; +} + +fn interlaceLines(co: vec3, coord: vec2) -> vec3 +{ + var color = co; + + let uDimensions = crtUniforms.uDimensions; + + let curvature: f32 = crtUniforms.uLine[0]; + let lineWidth: f32 = crtUniforms.uLine[1]; + let lineContrast: f32 = crtUniforms.uLine[2]; + let verticalLine: f32 = crtUniforms.uLine[3]; + + let dir: vec2 = vec2(coord * gfu.uInputSize.xy / uDimensions - 0.5); + + let _c: f32 = select(1., curvature, curvature > 0.); + let k: f32 = select(1., (length(dir * dir) * 0.25 * _c * _c + 0.935 * _c), curvature > 0.); + let uv: vec2 = dir * k; + let v: f32 = select(uv.y * uDimensions.y, uv.x * uDimensions.x, verticalLine > 0.5) * min(1.0, 2.0 / lineWidth ) / _c; + let j: f32 = 1. + cos(v * 1.2 - crtUniforms.uTime) * 0.5 * lineContrast; + color *= j; + + let segment: f32 = select(modulo((dir.y + .5) * uDimensions.y, 4.), modulo((dir.x + .5) * uDimensions.x, 4.), verticalLine > 0.5); + color *= 0.99 + ceil(segment) * 0.015; + + return color; +}`,ki=Object.defineProperty,er=Object.getOwnPropertySymbols,ji=Object.prototype.hasOwnProperty,Gi=Object.prototype.propertyIsEnumerable,Se=(r,e,n)=>e in r?ki(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,nr=(r,e)=>{for(var n in e||(e={}))ji.call(e,n)&&Se(r,n,e[n]);if(er)for(var n of er(e))Gi.call(e,n)&&Se(r,n,e[n]);return r},K=(r,e,n)=>(Se(r,typeof e!="symbol"?e+"":e,n),n);const rr=class ht extends s{constructor(e){e=nr(nr({},ht.DEFAULT_OPTIONS),e);const n=f.from({vertex:{source:p,entryPoint:"mainVertex"},fragment:{source:Li,entryPoint:"mainFragment"}}),t=c.from({vertex:m,fragment:Ei,name:"crt-filter"});super({gpuProgram:n,glProgram:t,resources:{crtUniforms:{uLine:{value:new Float32Array(4),type:"vec4"},uNoise:{value:new Float32Array(2),type:"vec2"},uVignette:{value:new Float32Array(3),type:"vec3"},uSeed:{value:e.seed,type:"f32"},uTime:{value:e.time,type:"f32"},uDimensions:{value:new Float32Array(2),type:"vec2"}}}}),K(this,"uniforms"),K(this,"seed"),K(this,"time"),this.uniforms=this.resources.crtUniforms.uniforms,Object.assign(this,e)}apply(e,n,t,o){this.uniforms.uDimensions[0]=n.frame.width,this.uniforms.uDimensions[1]=n.frame.height,this.uniforms.uSeed=this.seed,this.uniforms.uTime=this.time,e.applyFilter(this,n,t,o)}get curvature(){return this.uniforms.uLine[0]}set curvature(e){this.uniforms.uLine[0]=e}get lineWidth(){return this.uniforms.uLine[1]}set lineWidth(e){this.uniforms.uLine[1]=e}get lineContrast(){return this.uniforms.uLine[2]}set lineContrast(e){this.uniforms.uLine[2]=e}get verticalLine(){return this.uniforms.uLine[3]>.5}set verticalLine(e){this.uniforms.uLine[3]=e?1:0}get noise(){return this.uniforms.uNoise[0]}set noise(e){this.uniforms.uNoise[0]=e}get noiseSize(){return this.uniforms.uNoise[1]}set noiseSize(e){this.uniforms.uNoise[1]=e}get vignetting(){return this.uniforms.uVignette[0]}set vignetting(e){this.uniforms.uVignette[0]=e}get vignettingAlpha(){return this.uniforms.uVignette[1]}set vignettingAlpha(e){this.uniforms.uVignette[1]=e}get vignettingBlur(){return this.uniforms.uVignette[2]}set vignettingBlur(e){this.uniforms.uVignette[2]=e}};K(rr,"DEFAULT_OPTIONS",{curvature:1,lineWidth:1,lineContrast:.25,verticalLine:!1,noise:0,noiseSize:1,vignetting:.3,vignettingAlpha:1,vignettingBlur:.3,time:0,seed:0});let Bi=rr;var Ni=`precision highp float; +in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform float uAngle; +uniform float uScale; +uniform bool uGrayScale; + +uniform vec4 uInputSize; + +float pattern() +{ + float s = sin(uAngle), c = cos(uAngle); + vec2 tex = vTextureCoord * uInputSize.xy; + vec2 point = vec2( + c * tex.x - s * tex.y, + s * tex.x + c * tex.y + ) * uScale; + return (sin(point.x) * sin(point.y)) * 4.0; + } + + void main() + { + vec4 color = texture(uTexture, vTextureCoord); + vec3 colorRGB = vec3(color); + + if (uGrayScale) + { + colorRGB = vec3(color.r + color.g + color.b) / 3.0; + } + + finalColor = vec4(colorRGB * 10.0 - 5.0 + pattern(), color.a); +} +`,Vi=`struct DotUniforms { + uScale:f32, + uAngle:f32, + uGrayScale:f32, +}; + +struct GlobalFilterUniforms { + uInputSize:vec4, + uInputPixel:vec4, + uInputClamp:vec4, + uOutputFrame:vec4, + uGlobalFrame:vec4, + uOutputTexture:vec4, +}; + +@group(0) @binding(0) var gfu: GlobalFilterUniforms; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var dotUniforms : DotUniforms; + +@fragment +fn mainFragment( + @location(0) uv: vec2, + @builtin(position) position: vec4 +) -> @location(0) vec4 { + let color: vec4 = textureSample(uTexture, uSampler, uv); + let gray: vec3 = vec3(dot(color.rgb, vec3(0.299, 0.587, 0.114))); + // dotUniforms.uGrayScale == 1 doesn't ever pass so it is converted to a float and compared to 0.5 instead + let finalColor: vec3 = select(color.rgb, gray, f32(dotUniforms.uGrayScale) >= 0.5); + + return vec4(finalColor * 10.0 - 5.0 + pattern(uv), color.a); +} + +fn pattern(uv: vec2) -> f32 +{ + let s: f32 = sin(dotUniforms.uAngle); + let c: f32 = cos(dotUniforms.uAngle); + + let tex: vec2 = uv * gfu.uInputSize.xy; + + let p: vec2 = vec2( + c * tex.x - s * tex.y, + s * tex.x + c * tex.y + ) * dotUniforms.uScale; + + return (sin(p.x) * sin(p.y)) * 4.0; +}`,Xi=Object.defineProperty,tr=Object.getOwnPropertySymbols,Yi=Object.prototype.hasOwnProperty,Ki=Object.prototype.propertyIsEnumerable,be=(r,e,n)=>e in r?Xi(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,or=(r,e)=>{for(var n in e||(e={}))Yi.call(e,n)&&be(r,n,e[n]);if(tr)for(var n of tr(e))Ki.call(e,n)&&be(r,n,e[n]);return r},Wi=(r,e,n)=>(be(r,typeof e!="symbol"?e+"":e,n),n);const ir=class xt extends s{constructor(...e){var n;let t=(n=e[0])!=null?n:{};typeof t=="number"&&(h("6.0.0","DotFilter constructor params are now options object. See params: { scale, angle, grayscale }"),t={scale:t},e[1]!==void 0&&(t.angle=e[1]),e[2]!==void 0&&(t.grayscale=e[2])),t=or(or({},xt.DEFAULT_OPTIONS),t);const o={uScale:{value:t.scale,type:"f32"},uAngle:{value:t.angle,type:"f32"},uGrayScale:{value:t.grayscale?1:0,type:"f32"}},i=f.from({vertex:{source:p,entryPoint:"mainVertex"},fragment:{source:Vi,entryPoint:"mainFragment"}}),u=c.from({vertex:m,fragment:Ni,name:"dot-filter"});super({gpuProgram:i,glProgram:u,resources:{dotUniforms:o}})}get scale(){return this.resources.dotUniforms.uniforms.uScale}set scale(e){this.resources.dotUniforms.uniforms.uScale=e}get angle(){return this.resources.dotUniforms.uniforms.uAngle}set angle(e){this.resources.dotUniforms.uniforms.uAngle=e}get grayscale(){return this.resources.dotUniforms.uniforms.uGrayScale===1}set grayscale(e){this.resources.dotUniforms.uniforms.uGrayScale=e?1:0}};Wi(ir,"DEFAULT_OPTIONS",{scale:1,angle:5,grayscale:!0});let qi=ir;var Hi=`precision highp float; +in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform float uAlpha; +uniform vec3 uColor; +uniform vec2 uOffset; + +uniform vec4 uInputSize; + +void main(void){ + vec4 sample = texture(uTexture, vTextureCoord - uOffset * uInputSize.zw); + + // Premultiply alpha + sample.rgb = uColor.rgb * sample.a; + + // alpha user alpha + sample *= uAlpha; + + finalColor = sample; +}`,Zi=`struct DropShadowUniforms { + uAlpha: f32, + uColor: vec3, + uOffset: vec2, +}; + +struct GlobalFilterUniforms { + uInputSize:vec4, + uInputPixel:vec4, + uInputClamp:vec4, + uOutputFrame:vec4, + uGlobalFrame:vec4, + uOutputTexture:vec4, +}; + +@group(0) @binding(0) var gfu: GlobalFilterUniforms; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var dropShadowUniforms : DropShadowUniforms; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 +) -> @location(0) vec4 { + var color: vec4 = textureSample(uTexture, uSampler, uv - dropShadowUniforms.uOffset * gfu.uInputSize.zw); + + // Premultiply alpha + color = vec4(vec3(dropShadowUniforms.uColor.rgb * color.a), color.a); + // alpha user alpha + color *= dropShadowUniforms.uAlpha; + + return color; +}`,Qi=Object.defineProperty,ur=Object.getOwnPropertySymbols,Ji=Object.prototype.hasOwnProperty,eu=Object.prototype.propertyIsEnumerable,Ce=(r,e,n)=>e in r?Qi(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,lr=(r,e)=>{for(var n in e||(e={}))Ji.call(e,n)&&Ce(r,n,e[n]);if(ur)for(var n of ur(e))eu.call(e,n)&&Ce(r,n,e[n]);return r},E=(r,e,n)=>(Ce(r,typeof e!="symbol"?e+"":e,n),n);const ar=class yt extends s{constructor(e){var n,t;e=lr(lr({},yt.DEFAULT_OPTIONS),e);const o=f.from({vertex:{source:p,entryPoint:"mainVertex"},fragment:{source:Zi,entryPoint:"mainFragment"}}),i=c.from({vertex:m,fragment:Hi,name:"drop-shadow-filter"});super({gpuProgram:o,glProgram:i,resources:{dropShadowUniforms:{uAlpha:{value:e.alpha,type:"f32"},uColor:{value:new Float32Array(3),type:"vec3"},uOffset:{value:e.offset,type:"vec2"}}},resolution:e.resolution}),E(this,"uniforms"),E(this,"shadowOnly",!1),E(this,"_color"),E(this,"_blurFilter"),E(this,"_basePass"),this.uniforms=this.resources.dropShadowUniforms.uniforms,this._color=new S,this.color=(n=e.color)!=null?n:0,this._blurFilter=new oe({strength:(t=e.kernels)!=null?t:e.blur,quality:e.kernels?void 0:e.quality}),this._basePass=new s({gpuProgram:f.from({vertex:{source:p,entryPoint:"mainVertex"},fragment:{source:` + @group(0) @binding(1) var uTexture: texture_2d; + @group(0) @binding(2) var uSampler: sampler; + @fragment + fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 + ) -> @location(0) vec4 { + return textureSample(uTexture, uSampler, uv); + } + `,entryPoint:"mainFragment"}}),glProgram:c.from({vertex:m,fragment:` + in vec2 vTextureCoord; + out vec4 finalColor; + uniform sampler2D uTexture; + + void main(void){ + finalColor = texture(uTexture, vTextureCoord); + } + `,name:"drop-shadow-filter"}),resources:{}}),Object.assign(this,e)}apply(e,n,t,o){const i=y.getSameSizeTexture(n);e.applyFilter(this,n,i,!0),this._blurFilter.apply(e,i,t,o),this.shadowOnly||e.applyFilter(this._basePass,n,t,!1),y.returnTexture(i)}get offset(){return this.uniforms.uOffset}set offset(e){this.uniforms.uOffset=e,this._updatePadding()}get offsetX(){return this.offset.x}set offsetX(e){this.offset.x=e,this._updatePadding()}get offsetY(){return this.offset.y}set offsetY(e){this.offset.y=e,this._updatePadding()}get color(){return this._color.value}set color(e){this._color.setValue(e);const[n,t,o]=this._color.toArray();this.uniforms.uColor[0]=n,this.uniforms.uColor[1]=t,this.uniforms.uColor[2]=o}get alpha(){return this.uniforms.uAlpha}set alpha(e){this.uniforms.uAlpha=e}get blur(){return this._blurFilter.strength}set blur(e){this._blurFilter.strength=e,this._updatePadding()}get quality(){return this._blurFilter.quality}set quality(e){this._blurFilter.quality=e,this._updatePadding()}get kernels(){return this._blurFilter.kernels}set kernels(e){this._blurFilter.kernels=e}get pixelSize(){return this._blurFilter.pixelSize}set pixelSize(e){typeof e=="number"&&(e={x:e,y:e}),Array.isArray(e)&&(e={x:e[0],y:e[1]}),this._blurFilter.pixelSize=e}get pixelSizeX(){return this._blurFilter.pixelSizeX}set pixelSizeX(e){this._blurFilter.pixelSizeX=e}get pixelSizeY(){return this._blurFilter.pixelSizeY}set pixelSizeY(e){this._blurFilter.pixelSizeY=e}_updatePadding(){const e=Math.max(Math.abs(this.offsetX),Math.abs(this.offsetY));this.padding=e+this.blur*2+this.quality*4}};E(ar,"DEFAULT_OPTIONS",{offset:{x:4,y:4},color:0,alpha:.5,shadowOnly:!1,kernels:void 0,blur:2,quality:3,pixelSize:{x:1,y:1},resolution:1});let nu=ar;var ru=`precision highp float; +in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform float uStrength; + +uniform vec4 uInputSize; + +void main(void) +{ + vec2 onePixel = vec2(1.0 / uInputSize); + + vec4 color; + + color.rgb = vec3(0.5); + + color -= texture(uTexture, vTextureCoord - onePixel) * uStrength; + color += texture(uTexture, vTextureCoord + onePixel) * uStrength; + + color.rgb = vec3((color.r + color.g + color.b) / 3.0); + + float alpha = texture(uTexture, vTextureCoord).a; + + finalColor = vec4(color.rgb * alpha, alpha); +} +`,tu=`struct EmbossUniforms { + uStrength:f32, +}; + +struct GlobalFilterUniforms { + uInputSize:vec4, + uInputPixel:vec4, + uInputClamp:vec4, + uOutputFrame:vec4, + uGlobalFrame:vec4, + uOutputTexture:vec4, +}; + +@group(0) @binding(0) var gfu: GlobalFilterUniforms; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var embossUniforms : EmbossUniforms; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 +) -> @location(0) vec4 { + let onePixel: vec2 = vec2(1.0 / gfu.uInputSize.xy); + var color: vec3 = vec3(0.5); + + color -= (textureSample(uTexture, uSampler, uv - onePixel) * embossUniforms.uStrength).rgb; + color += (textureSample(uTexture, uSampler, uv + onePixel) * embossUniforms.uStrength).rgb; + + color = vec3((color.r + color.g + color.b) / 3.0); + + let blendColor: vec4 = textureSample(uTexture, uSampler, uv); + + return vec4(color.rgb * blendColor.a, blendColor.a); +}`,ou=Object.defineProperty,iu=(r,e,n)=>e in r?ou(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,uu=(r,e,n)=>(iu(r,typeof e!="symbol"?e+"":e,n),n);class lu extends s{constructor(e=5){const n=f.from({vertex:{source:p,entryPoint:"mainVertex"},fragment:{source:tu,entryPoint:"mainFragment"}}),t=c.from({vertex:m,fragment:ru,name:"emboss-filter"});super({gpuProgram:n,glProgram:t,resources:{embossUniforms:{uStrength:{value:e,type:"f32"}}}}),uu(this,"uniforms"),this.uniforms=this.resources.embossUniforms.uniforms}get strength(){return this.uniforms.uStrength}set strength(e){this.uniforms.uStrength=e}}var au=`precision highp float; +in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform sampler2D uDisplacementMap; +uniform float uSeed; +uniform vec2 uDimensions; +uniform float uAspect; +uniform float uFillMode; +uniform float uOffset; +uniform float uDirection; +uniform vec2 uRed; +uniform vec2 uGreen; +uniform vec2 uBlue; + +uniform vec4 uInputSize; +uniform vec4 uInputClamp; + +const int TRANSPARENT = 0; +const int ORIGINAL = 1; +const int LOOP = 2; +const int CLAMP = 3; +const int MIRROR = 4; + +void main(void) +{ + vec2 coord = (vTextureCoord * uInputSize.xy) / uDimensions; + + if (coord.x > 1.0 || coord.y > 1.0) { + return; + } + + float sinDir = sin(uDirection); + float cosDir = cos(uDirection); + + float cx = coord.x - 0.5; + float cy = (coord.y - 0.5) * uAspect; + float ny = (-sinDir * cx + cosDir * cy) / uAspect + 0.5; + + // displacementMap: repeat + // ny = ny > 1.0 ? ny - 1.0 : (ny < 0.0 ? 1.0 + ny : ny); + + // displacementMap: mirror + ny = ny > 1.0 ? 2.0 - ny : (ny < 0.0 ? -ny : ny); + + vec4 dc = texture(uDisplacementMap, vec2(0.5, ny)); + + float displacement = (dc.r - dc.g) * (uOffset / uInputSize.x); + + coord = vTextureCoord + vec2(cosDir * displacement, sinDir * displacement * uAspect); + + int fillMode = int(uFillMode); + + if (fillMode == CLAMP) { + coord = clamp(coord, uInputClamp.xy, uInputClamp.zw); + } else { + if( coord.x > uInputClamp.z ) { + if (fillMode == TRANSPARENT) { + discard; + } else if (fillMode == LOOP) { + coord.x -= uInputClamp.z; + } else if (fillMode == MIRROR) { + coord.x = uInputClamp.z * 2.0 - coord.x; + } + } else if( coord.x < uInputClamp.x ) { + if (fillMode == TRANSPARENT) { + discard; + } else if (fillMode == LOOP) { + coord.x += uInputClamp.z; + } else if (fillMode == MIRROR) { + coord.x *= -uInputClamp.z; + } + } + + if( coord.y > uInputClamp.w ) { + if (fillMode == TRANSPARENT) { + discard; + } else if (fillMode == LOOP) { + coord.y -= uInputClamp.w; + } else if (fillMode == MIRROR) { + coord.y = uInputClamp.w * 2.0 - coord.y; + } + } else if( coord.y < uInputClamp.y ) { + if (fillMode == TRANSPARENT) { + discard; + } else if (fillMode == LOOP) { + coord.y += uInputClamp.w; + } else if (fillMode == MIRROR) { + coord.y *= -uInputClamp.w; + } + } + } + + finalColor.r = texture(uTexture, coord + uRed * (1.0 - uSeed * 0.4) / uInputSize.xy).r; + finalColor.g = texture(uTexture, coord + uGreen * (1.0 - uSeed * 0.3) / uInputSize.xy).g; + finalColor.b = texture(uTexture, coord + uBlue * (1.0 - uSeed * 0.2) / uInputSize.xy).b; + finalColor.a = texture(uTexture, coord).a; +} +`,su=`struct GlitchUniforms { + uSeed: f32, + uDimensions: vec2, + uAspect: f32, + uFillMode: f32, + uOffset: f32, + uDirection: f32, + uRed: vec2, + uGreen: vec2, + uBlue: vec2, +}; + +struct GlobalFilterUniforms { + uInputSize:vec4, + uInputPixel:vec4, + uInputClamp:vec4, + uOutputFrame:vec4, + uGlobalFrame:vec4, + uOutputTexture:vec4, +}; + +@group(0) @binding(0) var gfu: GlobalFilterUniforms; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var glitchUniforms : GlitchUniforms; +@group(1) @binding(1) var uDisplacementMap: texture_2d; +@group(1) @binding(2) var uDisplacementSampler: sampler; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 +) -> @location(0) vec4 { + let uSeed: f32 = glitchUniforms.uSeed; + let uDimensions: vec2 = glitchUniforms.uDimensions; + let uAspect: f32 = glitchUniforms.uAspect; + let uOffset: f32 = glitchUniforms.uOffset; + let uDirection: f32 = glitchUniforms.uDirection; + let uRed: vec2 = glitchUniforms.uRed; + let uGreen: vec2 = glitchUniforms.uGreen; + let uBlue: vec2 = glitchUniforms.uBlue; + + let uInputSize: vec4 = gfu.uInputSize; + let uInputClamp: vec4 = gfu.uInputClamp; + + var discarded: bool = false; + var coord: vec2 = (uv * uInputSize.xy) / uDimensions; + + if (coord.x > 1.0 || coord.y > 1.0) { + discarded = true; + } + + let sinDir: f32 = sin(uDirection); + let cosDir: f32 = cos(uDirection); + + let cx: f32 = coord.x - 0.5; + let cy: f32 = (coord.y - 0.5) * uAspect; + var ny: f32 = (-sinDir * cx + cosDir * cy) / uAspect + 0.5; + + ny = select(select(ny, -ny, ny < 0.0), 2.0 - ny, ny > 1.0); + + let dc: vec4 = textureSample(uDisplacementMap, uDisplacementSampler, vec2(0.5, ny)); + + let displacement: f32 = (dc.r - dc.g) * (uOffset / uInputSize.x); + + coord = uv + vec2(cosDir * displacement, sinDir * displacement * uAspect); + + let fillMode: i32 = i32(glitchUniforms.uFillMode); + + if (fillMode == CLAMP) { + coord = clamp(coord, uInputClamp.xy, uInputClamp.zw); + } else { + if (coord.x > uInputClamp.z) { + if (fillMode == TRANSPARENT) { + discarded = true; + } else if (fillMode == LOOP) { + coord.x = coord.x - uInputClamp.z; + } else if (fillMode == MIRROR) { + coord.x = uInputClamp.z * 2.0 - coord.x; + } + } else if (coord.x < uInputClamp.x) { + if (fillMode == TRANSPARENT) { + discarded = true; + } else if (fillMode == LOOP) { + coord.x = coord.x + uInputClamp.z; + } else if (fillMode == MIRROR) { + coord.x = coord.x * -uInputClamp.z; + } + } + + if (coord.y > uInputClamp.w) { + if (fillMode == TRANSPARENT) { + discarded = true; + } else if (fillMode == LOOP) { + coord.y = coord.y - uInputClamp.w; + } else if (fillMode == MIRROR) { + coord.y = uInputClamp.w * 2.0 - coord.y; + } + } else if (coord.y < uInputClamp.y) { + if (fillMode == TRANSPARENT) { + discarded = true; + } else if (fillMode == LOOP) { + coord.y = coord.y + uInputClamp.w; + } else if (fillMode == MIRROR) { + coord.y = coord.y * -uInputClamp.w; + } + } + } + + let seedR: f32 = 1.0 - uSeed * 0.4; + let seedG: f32 = 1.0 - uSeed * 0.3; + let seedB: f32 = 1.0 - uSeed * 0.2; + + let offsetR: vec2 = vec2(uRed.x * seedR / uInputSize.x, uRed.y * seedR / uInputSize.y); + let offsetG: vec2 = vec2(uGreen.x * seedG / uInputSize.x, uGreen.y * seedG / uInputSize.y); + let offsetB: vec2 = vec2(uBlue.x * seedB / uInputSize.x, uBlue.y * seedB / uInputSize.y); + + let r = textureSample(uTexture, uSampler, coord + offsetR).r; + let g = textureSample(uTexture, uSampler, coord + offsetG).g; + let b = textureSample(uTexture, uSampler, coord + offsetB).b; + let a = textureSample(uTexture, uSampler, coord).a; + + return select(vec4(r, g, b, a), vec4(0.0,0.0,0.0,0.0), discarded); +} + +const TRANSPARENT: i32 = 0; +const ORIGINAL: i32 = 1; +const LOOP: i32 = 2; +const CLAMP: i32 = 3; +const MIRROR: i32 = 4;`,fu=Object.defineProperty,sr=Object.getOwnPropertySymbols,cu=Object.prototype.hasOwnProperty,mu=Object.prototype.propertyIsEnumerable,Te=(r,e,n)=>e in r?fu(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,fr=(r,e)=>{for(var n in e||(e={}))cu.call(e,n)&&Te(r,n,e[n]);if(sr)for(var n of sr(e))mu.call(e,n)&&Te(r,n,e[n]);return r},T=(r,e,n)=>(Te(r,typeof e!="symbol"?e+"":e,n),n),pu=(r=>(r[r.TRANSPARENT=0]="TRANSPARENT",r[r.ORIGINAL=1]="ORIGINAL",r[r.LOOP=2]="LOOP",r[r.CLAMP=3]="CLAMP",r[r.MIRROR=4]="MIRROR",r))(pu||{});const cr=class St extends s{constructor(e){var n,t,o,i,u;e=fr(fr({},St.defaults),e);const l=f.from({vertex:{source:p,entryPoint:"mainVertex"},fragment:{source:su,entryPoint:"mainFragment"}}),v=c.from({vertex:m,fragment:au,name:"glitch-filter"}),g=document.createElement("canvas");g.width=4,g.height=(n=e.sampleSize)!=null?n:512;const b=new _({source:new Kt({resource:g})});super({gpuProgram:l,glProgram:v,resources:{glitchUniforms:{uSeed:{value:(t=e==null?void 0:e.seed)!=null?t:0,type:"f32"},uDimensions:{value:new Float32Array(2),type:"vec2"},uAspect:{value:1,type:"f32"},uFillMode:{value:(o=e==null?void 0:e.fillMode)!=null?o:0,type:"f32"},uOffset:{value:(i=e==null?void 0:e.offset)!=null?i:100,type:"f32"},uDirection:{value:(u=e==null?void 0:e.direction)!=null?u:0,type:"f32"},uRed:{value:e.red,type:"vec2"},uGreen:{value:e.green,type:"vec2"},uBlue:{value:e.blue,type:"vec2"}},uDisplacementMap:b.source,uDisplacementSampler:b.source.style}}),T(this,"uniforms"),T(this,"average",!1),T(this,"minSize",8),T(this,"sampleSize",512),T(this,"_canvas"),T(this,"texture"),T(this,"_slices",0),T(this,"_sizes",new Float32Array(1)),T(this,"_offsets",new Float32Array(1)),this.uniforms=this.resources.glitchUniforms.uniforms,this._canvas=g,this.texture=b,Object.assign(this,e)}apply(e,n,t,o){const{width:i,height:u}=n.frame;this.uniforms.uDimensions[0]=i,this.uniforms.uDimensions[1]=u,this.uniforms.uAspect=u/i,e.applyFilter(this,n,t,o)}_randomizeSizes(){const e=this._sizes,n=this._slices-1,t=this.sampleSize,o=Math.min(this.minSize/t,.9/this._slices);if(this.average){const i=this._slices;let u=1;for(let l=0;l0;t--){const o=Math.random()*t>>0,i=e[t];e[t]=e[o],e[o]=i}}_randomizeOffsets(){for(let e=0;e0?o:0,g=o<0?-o:0;t.fillStyle=`rgba(${v}, ${g}, 0, 1)`,t.fillRect(0,i>>0,e,l+1>>0),i+=l}n.source.update()}set sizes(e){const n=Math.min(this._slices,e.length);for(let t=0;t .5; + float innerStrength = uStrength[0]; + float outerStrength = uStrength[1]; + + float alphaRatio = totalAlpha / MAX_TOTAL_ALPHA; + float innerGlowAlpha = (1. - alphaRatio) * innerStrength * curColor.a * uAlpha; + float innerGlowStrength = min(1., innerGlowAlpha); + + vec4 innerColor = mix(curColor, glowColor, innerGlowStrength); + float outerGlowAlpha = alphaRatio * outerStrength * (1. - curColor.a) * uAlpha; + float outerGlowStrength = min(1. - innerColor.a, outerGlowAlpha); + vec4 outerGlowColor = outerGlowStrength * glowColor.rgba; + + if (knockout) { + float resultAlpha = outerGlowAlpha + innerGlowAlpha; + finalColor = vec4(glowColor.rgb * resultAlpha, resultAlpha); + } + else { + finalColor = innerColor + outerGlowColor; + } +} +`,du=`struct GlowUniforms { + uDistance: f32, + uStrength: vec2, + uColor: vec3, + uAlpha: f32, + uQuality: f32, + uKnockout: f32, +}; + +struct GlobalFilterUniforms { + uInputSize:vec4, + uInputPixel:vec4, + uInputClamp:vec4, + uOutputFrame:vec4, + uGlobalFrame:vec4, + uOutputTexture:vec4, +}; + +@group(0) @binding(0) var gfu: GlobalFilterUniforms; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var glowUniforms : GlowUniforms; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 +) -> @location(0) vec4 { + let quality = glowUniforms.uQuality; + let distance = glowUniforms.uDistance; + + let dist: f32 = glowUniforms.uDistance; + let angleStepSize: f32 = min(1. / quality / distance, PI * 2.0); + let angleStepNum: f32 = ceil(PI * 2.0 / angleStepSize); + + let px: vec2 = vec2(1.0 / gfu.uInputSize.xy); + + var totalAlpha: f32 = 0.0; + + var direction: vec2; + var displaced: vec2; + var curColor: vec4; + + for (var angle = 0.0; angle < PI * 2.0; angle += angleStepSize) { + direction = vec2(cos(angle), sin(angle)) * px; + for (var curDistance = 0.0; curDistance < dist; curDistance+=1) { + displaced = vec2(clamp(uv + direction * (curDistance + 1.0), gfu.uInputClamp.xy, gfu.uInputClamp.zw)); + curColor = textureSample(uTexture, uSampler, displaced); + totalAlpha += (dist - curDistance) * curColor.a; + } + } + + curColor = textureSample(uTexture, uSampler, uv); + + let glowColorRGB = glowUniforms.uColor; + let glowAlpha = glowUniforms.uAlpha; + let glowColor = vec4(glowColorRGB, glowAlpha); + let knockout: bool = glowUniforms.uKnockout > 0.5; + let innerStrength = glowUniforms.uStrength[0]; + let outerStrength = glowUniforms.uStrength[1]; + + let alphaRatio: f32 = (totalAlpha / (angleStepNum * dist * (dist + 1.0) / 2.0)); + let innerGlowAlpha: f32 = (1.0 - alphaRatio) * innerStrength * curColor.a * glowAlpha; + let innerGlowStrength: f32 = min(1.0, innerGlowAlpha); + + let innerColor: vec4 = mix(curColor, glowColor, innerGlowStrength); + let outerGlowAlpha: f32 = alphaRatio * outerStrength * (1. - curColor.a) * glowAlpha; + let outerGlowStrength: f32 = min(1.0 - innerColor.a, outerGlowAlpha); + let outerGlowColor: vec4 = outerGlowStrength * glowColor.rgba; + + if (knockout) { + let resultAlpha: f32 = outerGlowAlpha + innerGlowAlpha; + return vec4(glowColor.rgb * resultAlpha, resultAlpha); + } + else { + return innerColor + outerGlowColor; + } +} + +const PI: f32 = 3.14159265358979323846264;`,hu=Object.defineProperty,mr=Object.getOwnPropertySymbols,xu=Object.prototype.hasOwnProperty,yu=Object.prototype.propertyIsEnumerable,ze=(r,e,n)=>e in r?hu(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,pr=(r,e)=>{for(var n in e||(e={}))xu.call(e,n)&&ze(r,n,e[n]);if(mr)for(var n of mr(e))yu.call(e,n)&&ze(r,n,e[n]);return r},Oe=(r,e,n)=>(ze(r,typeof e!="symbol"?e+"":e,n),n);const vr=class bt extends s{constructor(e){var n,t,o,i;e=pr(pr({},bt.DEFAULT_OPTIONS),e);const u=(n=e.distance)!=null?n:10,l=(t=e.quality)!=null?t:.1,v=f.from({vertex:{source:p,entryPoint:"mainVertex"},fragment:{source:du,entryPoint:"mainFragment"}}),g=c.from({vertex:m,fragment:gu.replace(/__ANGLE_STEP_SIZE__/gi,`${(1/l/u).toFixed(7)}`).replace(/__DIST__/gi,`${u.toFixed(0)}.0`),name:"glow-filter"});super({gpuProgram:v,glProgram:g,resources:{glowUniforms:{uDistance:{value:u,type:"f32"},uStrength:{value:[e.innerStrength,e.outerStrength],type:"vec2"},uColor:{value:new Float32Array(3),type:"vec3"},uAlpha:{value:e.alpha,type:"f32"},uQuality:{value:l,type:"f32"},uKnockout:{value:(o=e==null?void 0:e.knockout)!=null&&o?1:0,type:"f32"}}},padding:u}),Oe(this,"uniforms"),Oe(this,"_color"),this.uniforms=this.resources.glowUniforms.uniforms,this._color=new S,this.color=(i=e.color)!=null?i:16777215}get distance(){return this.uniforms.uDistance}set distance(e){this.uniforms.uDistance=this.padding=e}get innerStrength(){return this.uniforms.uStrength[0]}set innerStrength(e){this.uniforms.uStrength[0]=e}get outerStrength(){return this.uniforms.uStrength[1]}set outerStrength(e){this.uniforms.uStrength[1]=e}get color(){return this._color.value}set color(e){this._color.setValue(e);const[n,t,o]=this._color.toArray();this.uniforms.uColor[0]=n,this.uniforms.uColor[1]=t,this.uniforms.uColor[2]=o}get alpha(){return this.uniforms.uAlpha}set alpha(e){this.uniforms.uAlpha=e}get quality(){return this.uniforms.uQuality}set quality(e){this.uniforms.uQuality=e}get knockout(){return this.uniforms.uKnockout===1}set knockout(e){this.uniforms.uKnockout=e?1:0}};Oe(vr,"DEFAULT_OPTIONS",{distance:10,outerStrength:4,innerStrength:0,color:16777215,alpha:1,quality:.1,knockout:!1});let Su=vr;var bu=`precision highp float; +in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform vec2 uDimensions; +uniform float uParallel; +uniform vec2 uLight; +uniform float uAspect; +uniform float uTime; +uniform vec3 uRay; + +uniform vec4 uInputSize; + +\${PERLIN} + +void main(void) { + vec2 uDimensions = uDimensions; + bool uParallel = uParallel > 0.5; + vec2 uLight = uLight; + float uAspect = uAspect; + + vec2 coord = vTextureCoord * uInputSize.xy / uDimensions; + + float d; + + if (uParallel) { + float _cos = uLight.x; + float _sin = uLight.y; + d = (_cos * coord.x) + (_sin * coord.y * uAspect); + } else { + float dx = coord.x - uLight.x / uDimensions.x; + float dy = (coord.y - uLight.y / uDimensions.y) * uAspect; + float dis = sqrt(dx * dx + dy * dy) + 0.00001; + d = dy / dis; + } + + float uTime = uTime; + vec3 uRay = uRay; + + float gain = uRay[0]; + float lacunarity = uRay[1]; + float alpha = uRay[2]; + + vec3 dir = vec3(d, d, 0.0); + float noise = turb(dir + vec3(uTime, 0.0, 62.1 + uTime) * 0.05, vec3(480.0, 320.0, 480.0), lacunarity, gain); + noise = mix(noise, 0.0, 0.3); + //fade vertically. + vec4 mist = vec4(vec3(noise), 1.0) * (1.0 - coord.y); + mist.a = 1.0; + // apply user alpha + mist *= alpha; + + finalColor = texture(uTexture, vTextureCoord) + mist; +} +`,Cu=`struct GodrayUniforms { + uLight: vec2, + uParallel: f32, + uAspect: f32, + uTime: f32, + uRay: vec3, + uDimensions: vec2, +}; + +struct GlobalFilterUniforms { + uInputSize:vec4, + uInputPixel:vec4, + uInputClamp:vec4, + uOutputFrame:vec4, + uGlobalFrame:vec4, + uOutputTexture:vec4, +}; + +@group(0) @binding(0) var gfu: GlobalFilterUniforms; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var godrayUniforms : GodrayUniforms; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 +) -> @location(0) vec4 { + let uDimensions: vec2 = godrayUniforms.uDimensions; + let uParallel: bool = godrayUniforms.uParallel > 0.5; + let uLight: vec2 = godrayUniforms.uLight; + let uAspect: f32 = godrayUniforms.uAspect; + + let coord: vec2 = uv * gfu.uInputSize.xy / uDimensions; + + var d: f32; + + if (uParallel) { + let _cos: f32 = uLight.x; + let _sin: f32 = uLight.y; + d = (_cos * coord.x) + (_sin * coord.y * uAspect); + } else { + let dx: f32 = coord.x - uLight.x / uDimensions.x; + let dy: f32 = (coord.y - uLight.y / uDimensions.y) * uAspect; + let dis: f32 = sqrt(dx * dx + dy * dy) + 0.00001; + d = dy / dis; + } + + let uTime: f32 = godrayUniforms.uTime; + let uRay: vec3 = godrayUniforms.uRay; + + let gain = uRay[0]; + let lacunarity = uRay[1]; + let alpha = uRay[2]; + + let dir: vec3 = vec3(d, d, 0.0); + var noise: f32 = turb(dir + vec3(uTime, 0.0, 62.1 + uTime) * 0.05, vec3(480.0, 320.0, 480.0), lacunarity, gain); + noise = mix(noise, 0.0, 0.3); + //fade vertically. + var mist: vec4 = vec4(vec3(noise), 1.0) * (1.0 - coord.y); + mist.a = 1.0; + // apply user alpha + mist *= alpha; + return textureSample(uTexture, uSampler, uv) + mist; +} + +\${PERLIN}`,Tu=`vec3 mod289(vec3 x) +{ + return x - floor(x * (1.0 / 289.0)) * 289.0; +} +vec4 mod289(vec4 x) +{ + return x - floor(x * (1.0 / 289.0)) * 289.0; +} +vec4 permute(vec4 x) +{ + return mod289(((x * 34.0) + 1.0) * x); +} +vec4 taylorInvSqrt(vec4 r) +{ + return 1.79284291400159 - 0.85373472095314 * r; +} +vec3 fade(vec3 t) +{ + return t * t * t * (t * (t * 6.0 - 15.0) + 10.0); +} +// Classic Perlin noise, periodic variant +float pnoise(vec3 P, vec3 rep) +{ + vec3 Pi0 = mod(floor(P), rep); // Integer part, modulo period + vec3 Pi1 = mod(Pi0 + vec3(1.0), rep); // Integer part + 1, mod period + Pi0 = mod289(Pi0); + Pi1 = mod289(Pi1); + vec3 Pf0 = fract(P); // Fractional part for interpolation + vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0 + vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x); + vec4 iy = vec4(Pi0.yy, Pi1.yy); + vec4 iz0 = Pi0.zzzz; + vec4 iz1 = Pi1.zzzz; + vec4 ixy = permute(permute(ix) + iy); + vec4 ixy0 = permute(ixy + iz0); + vec4 ixy1 = permute(ixy + iz1); + vec4 gx0 = ixy0 * (1.0 / 7.0); + vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5; + gx0 = fract(gx0); + vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0); + vec4 sz0 = step(gz0, vec4(0.0)); + gx0 -= sz0 * (step(0.0, gx0) - 0.5); + gy0 -= sz0 * (step(0.0, gy0) - 0.5); + vec4 gx1 = ixy1 * (1.0 / 7.0); + vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5; + gx1 = fract(gx1); + vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1); + vec4 sz1 = step(gz1, vec4(0.0)); + gx1 -= sz1 * (step(0.0, gx1) - 0.5); + gy1 -= sz1 * (step(0.0, gy1) - 0.5); + vec3 g000 = vec3(gx0.x, gy0.x, gz0.x); + vec3 g100 = vec3(gx0.y, gy0.y, gz0.y); + vec3 g010 = vec3(gx0.z, gy0.z, gz0.z); + vec3 g110 = vec3(gx0.w, gy0.w, gz0.w); + vec3 g001 = vec3(gx1.x, gy1.x, gz1.x); + vec3 g101 = vec3(gx1.y, gy1.y, gz1.y); + vec3 g011 = vec3(gx1.z, gy1.z, gz1.z); + vec3 g111 = vec3(gx1.w, gy1.w, gz1.w); + vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110))); + g000 *= norm0.x; + g010 *= norm0.y; + g100 *= norm0.z; + g110 *= norm0.w; + vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111))); + g001 *= norm1.x; + g011 *= norm1.y; + g101 *= norm1.z; + g111 *= norm1.w; + float n000 = dot(g000, Pf0); + float n100 = dot(g100, vec3(Pf1.x, Pf0.yz)); + float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z)); + float n110 = dot(g110, vec3(Pf1.xy, Pf0.z)); + float n001 = dot(g001, vec3(Pf0.xy, Pf1.z)); + float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z)); + float n011 = dot(g011, vec3(Pf0.x, Pf1.yz)); + float n111 = dot(g111, Pf1); + vec3 fade_xyz = fade(Pf0); + vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z); + vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y); + float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x); + return 2.2 * n_xyz; +} +float turb(vec3 P, vec3 rep, float lacunarity, float gain) +{ + float sum = 0.0; + float sc = 1.0; + float totalgain = 1.0; + for (float i = 0.0; i < 6.0; i++) + { + sum += totalgain * pnoise(P * sc, rep); + sc *= lacunarity; + totalgain *= gain; + } + return abs(sum); +} +`,zu=`// Taken from https://gist.github.com/munrocket/236ed5ba7e409b8bdf1ff6eca5dcdc39 + +fn moduloVec3(x: vec3, y: vec3) -> vec3 +{ + return x - y * floor(x/y); +} +fn mod289Vec3(x: vec3) -> vec3 +{ + return x - floor(x * (1.0 / 289.0)) * 289.0; +} +fn mod289Vec4(x: vec4) -> vec4 +{ + return x - floor(x * (1.0 / 289.0)) * 289.0; +} +fn permute4(x: vec4) -> vec4 +{ + return mod289Vec4(((x * 34.0) + 1.0) * x); +} +fn taylorInvSqrt(r: vec4) -> vec4 +{ + return 1.79284291400159 - 0.85373472095314 * r; +} +fn fade3(t: vec3) -> vec3 +{ + return t * t * t * (t * (t * 6.0 - 15.0) + 10.0); +} +fn fade2(t: vec2) -> vec2 { return t * t * t * (t * (t * 6. - 15.) + 10.); } + +fn perlinNoise2(P: vec2) -> f32 { + var Pi: vec4 = floor(P.xyxy) + vec4(0., 0., 1., 1.); + let Pf = fract(P.xyxy) - vec4(0., 0., 1., 1.); + Pi = Pi % vec4(289.); // To avoid truncation effects in permutation + let ix = Pi.xzxz; + let iy = Pi.yyww; + let fx = Pf.xzxz; + let fy = Pf.yyww; + let i = permute4(permute4(ix) + iy); + var gx: vec4 = 2. * fract(i * 0.0243902439) - 1.; // 1/41 = 0.024... + let gy = abs(gx) - 0.5; + let tx = floor(gx + 0.5); + gx = gx - tx; + var g00: vec2 = vec2(gx.x, gy.x); + var g10: vec2 = vec2(gx.y, gy.y); + var g01: vec2 = vec2(gx.z, gy.z); + var g11: vec2 = vec2(gx.w, gy.w); + let norm = 1.79284291400159 - 0.85373472095314 * + vec4(dot(g00, g00), dot(g01, g01), dot(g10, g10), dot(g11, g11)); + g00 = g00 * norm.x; + g01 = g01 * norm.y; + g10 = g10 * norm.z; + g11 = g11 * norm.w; + let n00 = dot(g00, vec2(fx.x, fy.x)); + let n10 = dot(g10, vec2(fx.y, fy.y)); + let n01 = dot(g01, vec2(fx.z, fy.z)); + let n11 = dot(g11, vec2(fx.w, fy.w)); + let fade_xy = fade2(Pf.xy); + let n_x = mix(vec2(n00, n01), vec2(n10, n11), vec2(fade_xy.x)); + let n_xy = mix(n_x.x, n_x.y, fade_xy.y); + return 2.3 * n_xy; +} + +// Classic Perlin noise, periodic variant +fn perlinNoise3(P: vec3, rep: vec3) -> f32 +{ + var Pi0: vec3 = moduloVec3(floor(P), rep); // Integer part, modulo period + var Pi1: vec3 = moduloVec3(Pi0 + vec3(1.0), rep); // Integer part + 1, mod period + Pi0 = mod289Vec3(Pi0); + Pi1 = mod289Vec3(Pi1); + let Pf0: vec3 = fract(P); // Fractional part for interpolation + let Pf1: vec3 = Pf0 - vec3(1.0); // Fractional part - 1.0 + let ix: vec4 = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x); + let iy: vec4 = vec4(Pi0.yy, Pi1.yy); + let iz0: vec4 = Pi0.zzzz; + let iz1: vec4 = Pi1.zzzz; + let ixy: vec4 = permute4(permute4(ix) + iy); + let ixy0: vec4 = permute4(ixy + iz0); + let ixy1: vec4 = permute4(ixy + iz1); + var gx0: vec4 = ixy0 * (1.0 / 7.0); + var gy0: vec4 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5; + gx0 = fract(gx0); + let gz0: vec4 = vec4(0.5) - abs(gx0) - abs(gy0); + let sz0: vec4 = step(gz0, vec4(0.0)); + gx0 -= sz0 * (step(vec4(0.0), gx0) - 0.5); + gy0 -= sz0 * (step(vec4(0.0), gy0) - 0.5); + var gx1: vec4 = ixy1 * (1.0 / 7.0); + var gy1: vec4 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5; + gx1 = fract(gx1); + let gz1: vec4 = vec4(0.5) - abs(gx1) - abs(gy1); + let sz1: vec4 = step(gz1, vec4(0.0)); + gx1 -= sz1 * (step(vec4(0.0), gx1) - 0.5); + gy1 -= sz1 * (step(vec4(0.0), gy1) - 0.5); + var g000: vec3 = vec3(gx0.x, gy0.x, gz0.x); + var g100: vec3 = vec3(gx0.y, gy0.y, gz0.y); + var g010: vec3 = vec3(gx0.z, gy0.z, gz0.z); + var g110: vec3 = vec3(gx0.w, gy0.w, gz0.w); + var g001: vec3 = vec3(gx1.x, gy1.x, gz1.x); + var g101: vec3 = vec3(gx1.y, gy1.y, gz1.y); + var g011: vec3 = vec3(gx1.z, gy1.z, gz1.z); + var g111: vec3 = vec3(gx1.w, gy1.w, gz1.w); + let norm0: vec4 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110))); + g000 *= norm0.x; + g010 *= norm0.y; + g100 *= norm0.z; + g110 *= norm0.w; + let norm1: vec4 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111))); + g001 *= norm1.x; + g011 *= norm1.y; + g101 *= norm1.z; + g111 *= norm1.w; + let n000: f32 = dot(g000, Pf0); + let n100: f32 = dot(g100, vec3(Pf1.x, Pf0.yz)); + let n010: f32 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z)); + let n110: f32 = dot(g110, vec3(Pf1.xy, Pf0.z)); + let n001: f32 = dot(g001, vec3(Pf0.xy, Pf1.z)); + let n101: f32 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z)); + let n011: f32 = dot(g011, vec3(Pf0.x, Pf1.yz)); + let n111: f32 = dot(g111, Pf1); + let fade_xyz: vec3 = fade3(Pf0); + let n_z: vec4 = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z); + let n_yz: vec2 = mix(n_z.xy, n_z.zw, fade_xyz.y); + let n_xyz: f32 = mix(n_yz.x, n_yz.y, fade_xyz.x); + return 2.2 * n_xyz; +} +fn turb(P: vec3, rep: vec3, lacunarity: f32, gain: f32) -> f32 +{ + var sum: f32 = 0.0; + var sc: f32 = 1.0; + var totalgain: f32 = 1.0; + for (var i = 0.0; i < 6.0; i += 1) + { + sum += totalgain * perlinNoise3(P * sc, rep); + sc *= lacunarity; + totalgain *= gain; + } + return abs(sum); +}`,Ou=Object.defineProperty,gr=Object.getOwnPropertySymbols,Pu=Object.prototype.hasOwnProperty,_u=Object.prototype.propertyIsEnumerable,Pe=(r,e,n)=>e in r?Ou(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,dr=(r,e)=>{for(var n in e||(e={}))Pu.call(e,n)&&Pe(r,n,e[n]);if(gr)for(var n of gr(e))_u.call(e,n)&&Pe(r,n,e[n]);return r},L=(r,e,n)=>(Pe(r,typeof e!="symbol"?e+"":e,n),n);const hr=class Ct extends s{constructor(e){e=dr(dr({},Ct.DEFAULT_OPTIONS),e);const n=f.from({vertex:{source:p,entryPoint:"mainVertex"},fragment:{source:Cu.replace("${PERLIN}",zu),entryPoint:"mainFragment"}}),t=c.from({vertex:m,fragment:bu.replace("${PERLIN}",Tu),name:"god-ray-filter"});super({gpuProgram:n,glProgram:t,resources:{godrayUniforms:{uLight:{value:new Float32Array(2),type:"vec2"},uParallel:{value:0,type:"f32"},uAspect:{value:0,type:"f32"},uTime:{value:e.time,type:"f32"},uRay:{value:new Float32Array(3),type:"vec3"},uDimensions:{value:new Float32Array(2),type:"vec2"}}}}),L(this,"uniforms"),L(this,"time",0),L(this,"_angleLight",[0,0]),L(this,"_angle",0),L(this,"_center"),this.uniforms=this.resources.godrayUniforms.uniforms,Object.assign(this,e)}apply(e,n,t,o){const i=n.frame.width,u=n.frame.height;this.uniforms.uLight[0]=this.parallel?this._angleLight[0]:this._center.x,this.uniforms.uLight[1]=this.parallel?this._angleLight[1]:this._center.y,this.uniforms.uDimensions[0]=i,this.uniforms.uDimensions[1]=u,this.uniforms.uAspect=u/i,this.uniforms.uTime=this.time,e.applyFilter(this,n,t,o)}get angle(){return this._angle}set angle(e){this._angle=e;const n=e*R;this._angleLight[0]=Math.cos(n),this._angleLight[1]=Math.sin(n)}get parallel(){return this.uniforms.uParallel>.5}set parallel(e){this.uniforms.uParallel=e?1:0}get center(){return this._center}set center(e){Array.isArray(e)&&(e={x:e[0],y:e[1]}),this._center=e}get centerX(){return this.center.x}set centerX(e){this.center.x=e}get centerY(){return this.center.y}set centerY(e){this.center.y=e}get gain(){return this.uniforms.uRay[0]}set gain(e){this.uniforms.uRay[0]=e}get lacunarity(){return this.uniforms.uRay[1]}set lacunarity(e){this.uniforms.uRay[1]=e}get alpha(){return this.uniforms.uRay[2]}set alpha(e){this.uniforms.uRay[2]=e}};L(hr,"DEFAULT_OPTIONS",{angle:30,gain:.5,lacunarity:2.5,parallel:!0,time:0,center:{x:0,y:0},alpha:1});let wu=hr;var Au=`in vec2 vTextureCoord; + +out vec4 finalColor; + +uniform sampler2D uTexture; + +// https://en.wikipedia.org/wiki/Luma_(video) +const vec3 weight = vec3(0.299, 0.587, 0.114); + +void main() +{ + vec4 c = texture(uTexture, vTextureCoord); + finalColor = vec4( + vec3(c.r * weight.r + c.g * weight.g + c.b * weight.b), + c.a + ); +} +`,Fu=`@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; + +@fragment +fn mainFragment( + @location(0) uv: vec2, + @builtin(position) position: vec4 +) -> @location(0) vec4 { + let color: vec4 = textureSample(uTexture, uSampler, uv); + + let g: f32 = dot(color.rgb, vec3(0.299, 0.587, 0.114)); + return vec4(vec3(g), 1.); +}`;class Iu extends s{constructor(){const e=f.from({vertex:{source:p,entryPoint:"mainVertex"},fragment:{source:Fu,entryPoint:"mainFragment"}}),n=c.from({vertex:m,fragment:Au,name:"grayscale-filter"});super({gpuProgram:e,glProgram:n,resources:{}})}}var Uu=`in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform vec3 uHsl; +uniform float uAlpha; +uniform float uColorize; + +// https://en.wikipedia.org/wiki/Luma_(video) +const vec3 weight = vec3(0.299, 0.587, 0.114); + +float getWeightedAverage(vec3 rgb) { + return rgb.r * weight.r + rgb.g * weight.g + rgb.b * weight.b; +} + +// https://gist.github.com/mairod/a75e7b44f68110e1576d77419d608786?permalink_comment_id=3195243#gistcomment-3195243 +const vec3 k = vec3(0.57735, 0.57735, 0.57735); + +vec3 hueShift(vec3 color, float angle) { + float cosAngle = cos(angle); + return vec3( + color * cosAngle + + cross(k, color) * sin(angle) + + k * dot(k, color) * (1.0 - cosAngle) + ); +} + +void main() +{ + vec4 color = texture(uTexture, vTextureCoord); + vec3 resultRGB = color.rgb; + + float hue = uHsl[0]; + float saturation = uHsl[1]; + float lightness = uHsl[2]; + + // colorize + if (uColorize > 0.5) { + resultRGB = vec3(getWeightedAverage(resultRGB), 0., 0.); + } + + // hue + resultRGB = hueShift(resultRGB, hue); + + // saturation + // https://github.com/evanw/glfx.js/blob/master/src/filters/adjust/huesaturation.js + float average = (resultRGB.r + resultRGB.g + resultRGB.b) / 3.0; + + if (saturation > 0.) { + resultRGB += (average - resultRGB) * (1. - 1. / (1.001 - saturation)); + } else { + resultRGB -= (average - resultRGB) * saturation; + } + + // lightness + resultRGB = mix(resultRGB, vec3(ceil(lightness)) * color.a, abs(lightness)); + + // alpha + finalColor = mix(color, vec4(resultRGB, color.a), uAlpha); +} +`,Ru=`struct HslUniforms { + uHsl:vec3, + uColorize:f32, + uAlpha:f32, +}; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var hslUniforms : HslUniforms; + +@fragment +fn mainFragment( + @location(0) uv: vec2, + @builtin(position) position: vec4 +) -> @location(0) vec4 { + let color: vec4 = textureSample(uTexture, uSampler, uv); + var resultRGB: vec3 = color.rgb; + + let hue: f32 = hslUniforms.uHsl[0]; + let saturation: f32 = hslUniforms.uHsl[1]; + let lightness: f32 = hslUniforms.uHsl[2]; + + // colorize + if (hslUniforms.uColorize > 0.5) { + resultRGB = vec3(dot(color.rgb, vec3(0.299, 0.587, 0.114)), 0., 0.); + } + + // hue + resultRGB = hueShift(resultRGB, hue); + + // saturation + // https://github.com/evanw/glfx.js/blob/master/src/filters/adjust/huesaturation.js + let average: f32 = (resultRGB.r + resultRGB.g + resultRGB.b) / 3.0; + + if (saturation > 0.) { + resultRGB += (average - resultRGB) * (1. - 1. / (1.001 - saturation)); + } else { + resultRGB -= (average - resultRGB) * saturation; + } + + // lightness + resultRGB = mix(resultRGB, vec3(ceil(lightness)) * color.a, abs(lightness)); + + // alpha + return mix(color, vec4(resultRGB, color.a), hslUniforms.uAlpha); +} + +// https://gist.github.com/mairod/a75e7b44f68110e1576d77419d608786?permalink_comment_id=3195243#gistcomment-3195243 +const k: vec3 = vec3(0.57735, 0.57735, 0.57735); + +fn hueShift(color: vec3, angle: f32) -> vec3 +{ + let cosAngle: f32 = cos(angle); + return vec3( + color * cosAngle + + cross(k, color) * sin(angle) + + k * dot(k, color) * (1.0 - cosAngle) + ); +}`,Du=Object.defineProperty,xr=Object.getOwnPropertySymbols,$u=Object.prototype.hasOwnProperty,Mu=Object.prototype.propertyIsEnumerable,_e=(r,e,n)=>e in r?Du(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,yr=(r,e)=>{for(var n in e||(e={}))$u.call(e,n)&&_e(r,n,e[n]);if(xr)for(var n of xr(e))Mu.call(e,n)&&_e(r,n,e[n]);return r},we=(r,e,n)=>(_e(r,typeof e!="symbol"?e+"":e,n),n);const Sr=class Tt extends s{constructor(e){e=yr(yr({},Tt.DEFAULT_OPTIONS),e);const n=f.from({vertex:{source:p,entryPoint:"mainVertex"},fragment:{source:Ru,entryPoint:"mainFragment"}}),t=c.from({vertex:m,fragment:Uu,name:"hsl-adjustment-filter"});super({gpuProgram:n,glProgram:t,resources:{hslUniforms:{uHsl:{value:new Float32Array(3),type:"vec3"},uColorize:{value:e.colorize?1:0,type:"f32"},uAlpha:{value:e.alpha,type:"f32"}}}}),we(this,"uniforms"),we(this,"_hue"),this.uniforms=this.resources.hslUniforms.uniforms,this.hue=e.hue}get hue(){return this._hue}set hue(e){this._hue=e,this.resources.hslUniforms.uniforms.uHsl[0]=e*(Math.PI/180)}get saturation(){return this.resources.hslUniforms.uniforms.uHsl[1]}set saturation(e){this.resources.hslUniforms.uniforms.uHsl[1]=e}get lightness(){return this.resources.hslUniforms.uniforms.uHsl[2]}set lightness(e){this.resources.hslUniforms.uniforms.uHsl[2]=e}get colorize(){return this.resources.hslUniforms.uniforms.uColorize===1}set colorize(e){this.resources.hslUniforms.uniforms.uColorize=e?1:0}get alpha(){return this.resources.hslUniforms.uniforms.uAlpha}set alpha(e){this.resources.hslUniforms.uniforms.uAlpha=e}};we(Sr,"DEFAULT_OPTIONS",{hue:0,saturation:0,lightness:0,colorize:!1,alpha:1});let Eu=Sr;var Lu=`precision highp float; +in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform vec2 uVelocity; +uniform int uKernelSize; +uniform float uOffset; + +uniform vec4 uInputSize; + +const int MAX_KERNEL_SIZE = 2048; + +// Notice: +// the perfect way: +// int kernelSize = min(uKernelSize, MAX_KERNELSIZE); +// BUT in real use-case , uKernelSize < MAX_KERNELSIZE almost always. +// So use uKernelSize directly. + +void main(void) +{ + vec4 color = texture(uTexture, vTextureCoord); + + if (uKernelSize == 0) + { + finalColor = color; + return; + } + + vec2 velocity = uVelocity / uInputSize.xy; + float offset = -uOffset / length(uVelocity) - 0.5; + int k = uKernelSize - 1; + + for(int i = 0; i < MAX_KERNEL_SIZE - 1; i++) { + if (i == k) { + break; + } + vec2 bias = velocity * (float(i) / float(k) + offset); + color += texture(uTexture, vTextureCoord + bias); + } + finalColor = color / float(uKernelSize); +} +`,ku=`struct MotionBlurUniforms { + uVelocity: vec2, + uKernelSize: f32, + uOffset: f32, +}; + +struct GlobalFilterUniforms { + uInputSize:vec4, + uInputPixel:vec4, + uInputClamp:vec4, + uOutputFrame:vec4, + uGlobalFrame:vec4, + uOutputTexture:vec4, +}; + +@group(0) @binding(0) var gfu: GlobalFilterUniforms; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var motionBlurUniforms : MotionBlurUniforms; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 +) -> @location(0) vec4 { + let uVelocity = motionBlurUniforms.uVelocity; + let uKernelSize = motionBlurUniforms.uKernelSize; + let uOffset = motionBlurUniforms.uOffset; + + let velocity: vec2 = uVelocity / gfu.uInputSize.xy; + let offset: f32 = -uOffset / length(uVelocity) - 0.5; + let k: i32 = i32(min(uKernelSize - 1, MAX_KERNEL_SIZE - 1)); + + var color: vec4 = textureSample(uTexture, uSampler, uv); + + for(var i: i32 = 0; i < k; i += 1) { + let bias: vec2 = velocity * (f32(i) / f32(k) + offset); + color += textureSample(uTexture, uSampler, uv + bias); + } + + return select(color / f32(uKernelSize), textureSample(uTexture, uSampler, uv), uKernelSize == 0); +} + +const MAX_KERNEL_SIZE: f32 = 2048;`,ju=Object.defineProperty,br=Object.getOwnPropertySymbols,Gu=Object.prototype.hasOwnProperty,Bu=Object.prototype.propertyIsEnumerable,Ae=(r,e,n)=>e in r?ju(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,Cr=(r,e)=>{for(var n in e||(e={}))Gu.call(e,n)&&Ae(r,n,e[n]);if(br)for(var n of br(e))Bu.call(e,n)&&Ae(r,n,e[n]);return r},Fe=(r,e,n)=>(Ae(r,typeof e!="symbol"?e+"":e,n),n);const Tr=class zt extends s{constructor(...e){var n,t;let o=(n=e[0])!=null?n:{};if(Array.isArray(o)||"x"in o&&"y"in o||o instanceof Wt){h("6.0.0","MotionBlurFilter constructor params are now options object. See params: { velocity, kernelSize, offset }");const l="x"in o?o.x:o[0],v="y"in o?o.y:o[1];o={velocity:{x:l,y:v}},e[1]!==void 0&&(o.kernelSize=e[1]),e[2]!==void 0&&(o.offset=e[2])}o=Cr(Cr({},zt.DEFAULT_OPTIONS),o);const i=f.from({vertex:{source:p,entryPoint:"mainVertex"},fragment:{source:ku,entryPoint:"mainFragment"}}),u=c.from({vertex:m,fragment:Lu,name:"motion-blur-filter"});super({gpuProgram:i,glProgram:u,resources:{motionBlurUniforms:{uVelocity:{value:o.velocity,type:"vec2"},uKernelSize:{value:Math.trunc((t=o.kernelSize)!=null?t:5),type:"f32"},uOffset:{value:o.offset,type:"f32"}}}}),Fe(this,"uniforms"),Fe(this,"_kernelSize"),this.uniforms=this.resources.motionBlurUniforms.uniforms,Object.assign(this,o)}get velocity(){return this.uniforms.uVelocity}set velocity(e){Array.isArray(e)&&(e={x:e[0],y:e[1]}),this.uniforms.uVelocity=e,this._updateDirty()}get velocityX(){return this.velocity.x}set velocityX(e){this.velocity.x=e,this._updateDirty()}get velocityY(){return this.velocity.y}set velocityY(e){this.velocity.y=e,this._updateDirty()}get kernelSize(){return this._kernelSize}set kernelSize(e){this._kernelSize=e,this._updateDirty()}get offset(){return this.uniforms.uOffset}set offset(e){this.uniforms.uOffset=e}_updateDirty(){this.padding=(Math.max(Math.abs(this.velocityX),Math.abs(this.velocityY))>>0)+1,this.uniforms.uKernelSize=this.velocityX!==0||this.velocityY!==0?this._kernelSize:0}};Fe(Tr,"DEFAULT_OPTIONS",{velocity:{x:0,y:0},kernelSize:5,offset:0});let Nu=Tr;var Vu=`in vec2 vTextureCoord; +out vec4 finalColor; + +const int MAX_COLORS = \${MAX_COLORS}; + +uniform sampler2D uTexture; +uniform vec3 uOriginalColors[MAX_COLORS]; +uniform vec3 uTargetColors[MAX_COLORS]; +uniform float uTolerance; + +void main(void) +{ + finalColor = texture(uTexture, vTextureCoord); + + float alpha = finalColor.a; + if (alpha < 0.0001) + { + return; + } + + vec3 color = finalColor.rgb / alpha; + + for(int i = 0; i < MAX_COLORS; i++) + { + vec3 origColor = uOriginalColors[i]; + if (origColor.r < 0.0) + { + break; + } + vec3 colorDiff = origColor - color; + if (length(colorDiff) < uTolerance) + { + vec3 targetColor = uTargetColors[i]; + finalColor = vec4((targetColor + colorDiff) * alpha, alpha); + return; + } + } +} +`,Xu=`struct MultiColorReplaceUniforms { + uOriginalColors: array, MAX_COLORS>, + uTargetColors: array, MAX_COLORS>, + uTolerance:f32, +}; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var multiColorReplaceUniforms : MultiColorReplaceUniforms; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 +) -> @location(0) vec4 { + let uOriginalColors = multiColorReplaceUniforms.uOriginalColors; + let uTargetColors = multiColorReplaceUniforms.uTargetColors; + let uTolerance = multiColorReplaceUniforms.uTolerance; + + var color: vec4 = textureSample(uTexture, uSampler, uv); + + let alpha: f32 = color.a; + + if (alpha > 0.0001) + { + var modColor: vec3 = vec3(color.rgb) / alpha; + + for(var i: i32 = 0; i < MAX_COLORS; i += 1) + { + let origColor: vec3 = uOriginalColors[i]; + if (origColor.r < 0.0) + { + break; + } + let colorDiff: vec3 = origColor - modColor; + + if (length(colorDiff) < uTolerance) + { + let targetColor: vec3 = uTargetColors[i]; + color = vec4((targetColor + colorDiff) * alpha, alpha); + return color; + } + } + } + + return color; +} + +const MAX_COLORS: i32 = \${MAX_COLORS};`,Yu=Object.defineProperty,zr=Object.getOwnPropertySymbols,Ku=Object.prototype.hasOwnProperty,Wu=Object.prototype.propertyIsEnumerable,Ie=(r,e,n)=>e in r?Yu(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,Or=(r,e)=>{for(var n in e||(e={}))Ku.call(e,n)&&Ie(r,n,e[n]);if(zr)for(var n of zr(e))Wu.call(e,n)&&Ie(r,n,e[n]);return r},W=(r,e,n)=>(Ie(r,typeof e!="symbol"?e+"":e,n),n);const Pr=class Ot extends s{constructor(...e){var n,t;let o=(n=e[0])!=null?n:{};Array.isArray(o)&&(h("6.0.0","MultiColorReplaceFilter constructor params are now options object. See params: { replacements, tolerance, maxColors }"),o={replacements:o},e[1]&&(o.tolerance=e[1]),e[2]&&(o.maxColors=e[2])),o=Or(Or({},Ot.DEFAULT_OPTIONS),o);const i=(t=o.maxColors)!=null?t:o.replacements.length,u=f.from({vertex:{source:p,entryPoint:"mainVertex"},fragment:{source:Xu.replace(/\$\{MAX_COLORS\}/g,i.toFixed(0)),entryPoint:"mainFragment"}}),l=c.from({vertex:m,fragment:Vu.replace(/\$\{MAX_COLORS\}/g,i.toFixed(0)),name:"multi-color-replace-filter"});super({gpuProgram:u,glProgram:l,resources:{multiColorReplaceUniforms:{uOriginalColors:{value:new Float32Array(3*i),type:"vec3",size:i},uTargetColors:{value:new Float32Array(3*i),type:"vec3",size:i},uTolerance:{value:o.tolerance,type:"f32"}}}}),W(this,"uniforms"),W(this,"_replacements",[]),W(this,"_maxColors"),this._maxColors=i,this.uniforms=this.resources.multiColorReplaceUniforms.uniforms,this.replacements=o.replacements}set replacements(e){const n=this.uniforms.uOriginalColors,t=this.uniforms.uTargetColors,o=e.length,i=new S;if(o>this._maxColors)throw new Error(`Length of replacements (${o}) exceeds the maximum colors length (${this._maxColors})`);n[o*3]=-1;let u,l,v;for(let g=0;g 0.5) then: 1 - 2 * (1 - dst) * (1 - src) + return vec3((dst.x <= 0.5) ? (2.0 * src.x * dst.x) : (1.0 - 2.0 * (1.0 - dst.x) * (1.0 - src.x)), + (dst.y <= 0.5) ? (2.0 * src.y * dst.y) : (1.0 - 2.0 * (1.0 - dst.y) * (1.0 - src.y)), + (dst.z <= 0.5) ? (2.0 * src.z * dst.z) : (1.0 - 2.0 * (1.0 - dst.z) * (1.0 - src.z))); +} + + +void main() +{ + finalColor = texture(uTexture, vTextureCoord); + vec3 color = finalColor.rgb; + + if (uSepia > 0.0) + { + float gray = (color.x + color.y + color.z) / 3.0; + vec3 grayscale = vec3(gray); + + color = Overlay(SEPIA_RGB, grayscale); + + color = grayscale + uSepia * (color - grayscale); + } + + vec2 coord = vTextureCoord * uInputSize.xy / uDimensions.xy; + + float vignette = uVignetting[0]; + float vignetteAlpha = uVignetting[1]; + float vignetteBlur = uVignetting[2]; + + if (vignette > 0.0) + { + float outter = SQRT_2 - vignette * SQRT_2; + vec2 dir = vec2(vec2(0.5, 0.5) - coord); + dir.y *= uDimensions.y / uDimensions.x; + float darker = clamp((outter - length(dir) * SQRT_2) / ( 0.00001 + vignetteBlur * SQRT_2), 0.0, 1.0); + color.rgb *= darker + (1.0 - darker) * (1.0 - vignetteAlpha); + } + + float scratch = uScratch[0]; + float scratchDensity = uScratch[1]; + float scratchWidth = uScratch[2]; + + if (scratchDensity > uSeed && scratch != 0.0) + { + float phase = uSeed * 256.0; + float s = mod(floor(phase), 2.0); + float dist = 1.0 / scratchDensity; + float d = distance(coord, vec2(uSeed * dist, abs(s - uSeed * dist))); + if (d < uSeed * 0.6 + 0.4) + { + highp float period = scratchDensity * 10.0; + + float xx = coord.x * period + phase; + float aa = abs(mod(xx, 0.5) * 4.0); + float bb = mod(floor(xx / 0.5), 2.0); + float yy = (1.0 - bb) * aa + bb * (2.0 - aa); + + float kk = 2.0 * period; + float dw = scratchWidth / uDimensions.x * (0.75 + uSeed); + float dh = dw * kk; + + float tine = (yy - (2.0 - dh)); + + if (tine > 0.0) { + float _sign = sign(scratch); + + tine = s * tine / period + scratch + 0.1; + tine = clamp(tine + 1.0, 0.5 + _sign * 0.5, 1.5 + _sign * 0.5); + + color.rgb *= tine; + } + } + } + + float noise = uNoise[0]; + float noiseSize = uNoise[1]; + + if (noise > 0.0 && noiseSize > 0.0) + { + vec2 pixelCoord = vTextureCoord.xy * uInputSize.xy; + pixelCoord.x = floor(pixelCoord.x / noiseSize); + pixelCoord.y = floor(pixelCoord.y / noiseSize); + // vec2 d = pixelCoord * noiseSize * vec2(1024.0 + uSeed * 512.0, 1024.0 - uSeed * 512.0); + // float _noise = snoise(d) * 0.5; + float _noise = rand(pixelCoord * noiseSize * uSeed) - 0.5; + color += _noise * noise; + } + + finalColor.rgb = color; +}`,Zu=`struct OldFilmUniforms { + uSepia: f32, + uNoise: vec2, + uScratch: vec3, + uVignetting: vec3, + uSeed: f32, + uDimensions: vec2, +}; + +struct GlobalFilterUniforms { + uInputSize:vec4, + uInputPixel:vec4, + uInputClamp:vec4, + uOutputFrame:vec4, + uGlobalFrame:vec4, + uOutputTexture:vec4, +}; + +@group(0) @binding(0) var gfu: GlobalFilterUniforms; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var oldFilmUniforms : OldFilmUniforms; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 +) -> @location(0) vec4 { + var color: vec4 = textureSample(uTexture, uSampler, uv); + + if (oldFilmUniforms.uSepia > 0.) + { + color = vec4(sepia(color.rgb), color.a); + } + + let coord: vec2 = uv * gfu.uInputSize.xy / oldFilmUniforms.uDimensions; + + if (oldFilmUniforms.uVignetting[0] > 0.) + { + color *= vec4(vec3(vignette(color.rgb, coord)), color.a); + } + + let uScratch = oldFilmUniforms.uScratch; + + if (uScratch[1] > oldFilmUniforms.uSeed && uScratch[0] != 0.) + { + color = vec4(scratch(color.rgb, coord), color.a); + } + + let uNoise = oldFilmUniforms.uNoise; + + if (uNoise[0] > 0.0 && uNoise[1] > 0.0) + { + color += vec4(vec3(noise(uv)), color.a); + } + + return color; +} + +const SQRT_2: f32 = 1.414213; +const SEPIA_RGB: vec3 = vec3(112.0 / 255.0, 66.0 / 255.0, 20.0 / 255.0); + +fn modulo(x: f32, y: f32) -> f32 +{ + return x - y * floor(x/y); +} + +fn rand(co: vec2) -> f32 +{ + return fract(sin(dot(co, vec2(12.9898, 78.233))) * 43758.5453); +} + +fn overlay(src: vec3, dst: vec3) -> vec3 +{ + // if (dst <= 0.5) then: 2 * src * dst + // if (dst > 0.5) then: 1 - 2 * (1 - dst) * (1 - src) + + return vec3( + select((1.0 - 2.0 * (1.0 - dst.x) * (1.0 - src.x)), (2.0 * src.x * dst.x), (dst.x <= 0.5)), + select((1.0 - 2.0 * (1.0 - dst.y) * (1.0 - src.y)), (2.0 * src.y * dst.y), (dst.y <= 0.5)), + select((1.0 - 2.0 * (1.0 - dst.z) * (1.0 - src.z)), (2.0 * src.z * dst.z), (dst.z <= 0.5)) + ); +} + +fn sepia(co: vec3) -> vec3 +{ + let gray: f32 = (co.x + co.y + co.z) / 3.0; + let grayscale: vec3 = vec3(gray); + let color = overlay(SEPIA_RGB, grayscale); + return grayscale + oldFilmUniforms.uSepia * (color - grayscale); +} + +fn vignette(co: vec3, coord: vec2) -> f32 +{ + let uVignetting = oldFilmUniforms.uVignetting; + let uDimensions = oldFilmUniforms.uDimensions; + + let outter: f32 = SQRT_2 - uVignetting[0] * SQRT_2; + var dir: vec2 = vec2(vec2(0.5) - coord); + dir.y *= uDimensions.y / uDimensions.x; + let darker: f32 = clamp((outter - length(dir) * SQRT_2) / ( 0.00001 + uVignetting[2] * SQRT_2), 0.0, 1.0); + return darker + (1.0 - darker) * (1.0 - uVignetting[1]); +} + +fn scratch(co: vec3, coord: vec2) -> vec3 +{ + var color = co; + let uScratch = oldFilmUniforms.uScratch; + let uSeed = oldFilmUniforms.uSeed; + let uDimensions = oldFilmUniforms.uDimensions; + + let phase: f32 = uSeed * 256.0; + let s: f32 = modulo(floor(phase), 2.0); + let dist: f32 = 1.0 / uScratch[1]; + let d: f32 = distance(coord, vec2(uSeed * dist, abs(s - uSeed * dist))); + + if (d < uSeed * 0.6 + 0.4) + { + let period: f32 = uScratch[1] * 10.0; + + let xx: f32 = coord.x * period + phase; + let aa: f32 = abs(modulo(xx, 0.5) * 4.0); + let bb: f32 = modulo(floor(xx / 0.5), 2.0); + let yy: f32 = (1.0 - bb) * aa + bb * (2.0 - aa); + + let kk: f32 = 2.0 * period; + let dw: f32 = uScratch[2] / uDimensions.x * (0.75 + uSeed); + let dh: f32 = dw * kk; + + var tine: f32 = (yy - (2.0 - dh)); + + if (tine > 0.0) { + let _sign: f32 = sign(uScratch[0]); + + tine = s * tine / period + uScratch[0] + 0.1; + tine = clamp(tine + 1.0, 0.5 + _sign * 0.5, 1.5 + _sign * 0.5); + + color *= tine; + } + } + + return color; +} + +fn noise(coord: vec2) -> f32 +{ + let uNoise = oldFilmUniforms.uNoise; + let uSeed = oldFilmUniforms.uSeed; + + var pixelCoord: vec2 = coord * gfu.uInputSize.xy; + pixelCoord.x = floor(pixelCoord.x / uNoise[1]); + pixelCoord.y = floor(pixelCoord.y / uNoise[1]); + return (rand(pixelCoord * uNoise[1] * uSeed) - 0.5) * uNoise[0]; +}`,Qu=Object.defineProperty,_r=Object.getOwnPropertySymbols,Ju=Object.prototype.hasOwnProperty,el=Object.prototype.propertyIsEnumerable,Ue=(r,e,n)=>e in r?Qu(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,wr=(r,e)=>{for(var n in e||(e={}))Ju.call(e,n)&&Ue(r,n,e[n]);if(_r)for(var n of _r(e))el.call(e,n)&&Ue(r,n,e[n]);return r},Re=(r,e,n)=>(Ue(r,typeof e!="symbol"?e+"":e,n),n);const Ar=class Pt extends s{constructor(e){e=wr(wr({},Pt.DEFAULT_OPTIONS),e);const n=f.from({vertex:{source:p,entryPoint:"mainVertex"},fragment:{source:Zu,entryPoint:"mainFragment"}}),t=c.from({vertex:m,fragment:Hu,name:"old-film-filter"});super({gpuProgram:n,glProgram:t,resources:{oldFilmUniforms:{uSepia:{value:e.sepia,type:"f32"},uNoise:{value:new Float32Array(2),type:"vec2"},uScratch:{value:new Float32Array(3),type:"vec3"},uVignetting:{value:new Float32Array(3),type:"vec3"},uSeed:{value:e.seed,type:"f32"},uDimensions:{value:new Float32Array(2),type:"vec2"}}}}),Re(this,"uniforms"),Re(this,"seed"),this.uniforms=this.resources.oldFilmUniforms.uniforms,Object.assign(this,e)}apply(e,n,t,o){this.uniforms.uDimensions[0]=n.frame.width,this.uniforms.uDimensions[1]=n.frame.height,this.uniforms.uSeed=this.seed,e.applyFilter(this,n,t,o)}get sepia(){return this.uniforms.uSepia}set sepia(e){this.uniforms.uSepia=e}get noise(){return this.uniforms.uNoise[0]}set noise(e){this.uniforms.uNoise[0]=e}get noiseSize(){return this.uniforms.uNoise[1]}set noiseSize(e){this.uniforms.uNoise[1]=e}get scratch(){return this.uniforms.uScratch[0]}set scratch(e){this.uniforms.uScratch[0]=e}get scratchDensity(){return this.uniforms.uScratch[1]}set scratchDensity(e){this.uniforms.uScratch[1]=e}get scratchWidth(){return this.uniforms.uScratch[2]}set scratchWidth(e){this.uniforms.uScratch[2]=e}get vignetting(){return this.uniforms.uVignetting[0]}set vignetting(e){this.uniforms.uVignetting[0]=e}get vignettingAlpha(){return this.uniforms.uVignetting[1]}set vignettingAlpha(e){this.uniforms.uVignetting[1]=e}get vignettingBlur(){return this.uniforms.uVignetting[2]}set vignettingBlur(e){this.uniforms.uVignetting[2]=e}};Re(Ar,"DEFAULT_OPTIONS",{sepia:.3,noise:.3,noiseSize:1,scratch:.5,scratchDensity:.3,scratchWidth:1,vignetting:.3,vignettingAlpha:1,vignettingBlur:.3,seed:0});let nl=Ar;var rl=`precision highp float; +in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform vec2 uThickness; +uniform vec3 uColor; +uniform float uAlpha; +uniform float uKnockout; + +uniform vec4 uInputClamp; + +const float DOUBLE_PI = 2. * 3.14159265358979323846264; +const float ANGLE_STEP = \${ANGLE_STEP}; + +float outlineMaxAlphaAtPos(vec2 pos) { + if (uThickness.x == 0. || uThickness.y == 0.) { + return 0.; + } + + vec4 displacedColor; + vec2 displacedPos; + float maxAlpha = 0.; + + for (float angle = 0.; angle <= DOUBLE_PI; angle += ANGLE_STEP) { + displacedPos.x = vTextureCoord.x + uThickness.x * cos(angle); + displacedPos.y = vTextureCoord.y + uThickness.y * sin(angle); + displacedColor = texture(uTexture, clamp(displacedPos, uInputClamp.xy, uInputClamp.zw)); + maxAlpha = max(maxAlpha, displacedColor.a); + } + + return maxAlpha; +} + +void main(void) { + vec4 sourceColor = texture(uTexture, vTextureCoord); + vec4 contentColor = sourceColor * float(uKnockout < 0.5); + float outlineAlpha = uAlpha * outlineMaxAlphaAtPos(vTextureCoord.xy) * (1.-sourceColor.a); + vec4 outlineColor = vec4(vec3(uColor) * outlineAlpha, outlineAlpha); + finalColor = contentColor + outlineColor; +} +`,tl=`struct OutlineUniforms { + uThickness:vec2, + uColor:vec3, + uAlpha:f32, + uAngleStep:f32, + uKnockout:f32, +}; + +struct GlobalFilterUniforms { + uInputSize:vec4, + uInputPixel:vec4, + uInputClamp:vec4, + uOutputFrame:vec4, + uGlobalFrame:vec4, + uOutputTexture:vec4, +}; + +@group(0) @binding(0) var gfu: GlobalFilterUniforms; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var outlineUniforms : OutlineUniforms; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 +) -> @location(0) vec4 { + let sourceColor: vec4 = textureSample(uTexture, uSampler, uv); + let contentColor: vec4 = sourceColor * (1. - outlineUniforms.uKnockout); + + let outlineAlpha: f32 = outlineUniforms.uAlpha * outlineMaxAlphaAtPos(uv) * (1. - sourceColor.a); + let outlineColor: vec4 = vec4(vec3(outlineUniforms.uColor) * outlineAlpha, outlineAlpha); + + return contentColor + outlineColor; +} + +fn outlineMaxAlphaAtPos(uv: vec2) -> f32 { + let thickness = outlineUniforms.uThickness; + + if (thickness.x == 0. || thickness.y == 0.) { + return 0.; + } + + let angleStep = outlineUniforms.uAngleStep; + + var displacedColor: vec4; + var displacedPos: vec2; + + var maxAlpha: f32 = 0.; + var displaced: vec2; + var curColor: vec4; + + for (var angle = 0.; angle <= DOUBLE_PI; angle += angleStep) + { + displaced.x = uv.x + thickness.x * cos(angle); + displaced.y = uv.y + thickness.y * sin(angle); + curColor = textureSample(uTexture, uSampler, clamp(displaced, gfu.uInputClamp.xy, gfu.uInputClamp.zw)); + maxAlpha = max(maxAlpha, curColor.a); + } + + return maxAlpha; +} + +const DOUBLE_PI: f32 = 3.14159265358979323846264 * 2.;`,ol=Object.defineProperty,Fr=Object.getOwnPropertySymbols,il=Object.prototype.hasOwnProperty,ul=Object.prototype.propertyIsEnumerable,De=(r,e,n)=>e in r?ol(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,Ir=(r,e)=>{for(var n in e||(e={}))il.call(e,n)&&De(r,n,e[n]);if(Fr)for(var n of Fr(e))ul.call(e,n)&&De(r,n,e[n]);return r},F=(r,e,n)=>(De(r,typeof e!="symbol"?e+"":e,n),n);const q=class U extends s{constructor(...e){var n,t,o;let i=(n=e[0])!=null?n:{};typeof i=="number"&&(h("6.0.0","OutlineFilter constructor params are now options object. See params: { thickness, color, quality, alpha, knockout }"),i={thickness:i},e[1]!==void 0&&(i.color=e[1]),e[2]!==void 0&&(i.quality=e[2]),e[3]!==void 0&&(i.alpha=e[3]),e[4]!==void 0&&(i.knockout=e[4])),i=Ir(Ir({},U.DEFAULT_OPTIONS),i);const u=(t=i.quality)!=null?t:.1,l=f.from({vertex:{source:p,entryPoint:"mainVertex"},fragment:{source:tl,entryPoint:"mainFragment"}}),v=c.from({vertex:m,fragment:rl.replace(/\$\{ANGLE_STEP\}/,U.getAngleStep(u).toFixed(7)),name:"outline-filter"});super({gpuProgram:l,glProgram:v,resources:{outlineUniforms:{uThickness:{value:new Float32Array(2),type:"vec2"},uColor:{value:new Float32Array(3),type:"vec3"},uAlpha:{value:i.alpha,type:"f32"},uAngleStep:{value:0,type:"f32"},uKnockout:{value:i.knockout?1:0,type:"f32"}}}}),F(this,"uniforms"),F(this,"_thickness"),F(this,"_quality"),F(this,"_color"),this.uniforms=this.resources.outlineUniforms.uniforms,this.uniforms.uAngleStep=U.getAngleStep(u),this._color=new S,this.color=(o=i.color)!=null?o:0,Object.assign(this,i)}apply(e,n,t,o){this.uniforms.uThickness[0]=this.thickness/n.source.width,this.uniforms.uThickness[1]=this.thickness/n.source.height,e.applyFilter(this,n,t,o)}static getAngleStep(e){return parseFloat((Math.PI*2/Math.max(e*U.MAX_SAMPLES,U.MIN_SAMPLES)).toFixed(7))}get thickness(){return this._thickness}set thickness(e){this._thickness=this.padding=e}get color(){return this._color.value}set color(e){this._color.setValue(e);const[n,t,o]=this._color.toArray();this.uniforms.uColor[0]=n,this.uniforms.uColor[1]=t,this.uniforms.uColor[2]=o}get alpha(){return this.uniforms.uAlpha}set alpha(e){this.uniforms.uAlpha=e}get quality(){return this._quality}set quality(e){this._quality=e,this.uniforms.uAngleStep=U.getAngleStep(e)}get knockout(){return this.uniforms.uKnockout===1}set knockout(e){this.uniforms.uKnockout=e?1:0}};F(q,"DEFAULT_OPTIONS",{thickness:1,color:0,alpha:1,quality:.1,knockout:!1}),F(q,"MIN_SAMPLES",1),F(q,"MAX_SAMPLES",100);let ll=q;var al=`precision highp float; +in vec2 vTextureCoord; +out vec4 finalColor; + +uniform vec2 uSize; +uniform sampler2D uTexture; +uniform vec4 uInputSize; + +vec2 mapCoord( vec2 coord ) +{ + coord *= uInputSize.xy; + coord += uInputSize.zw; + + return coord; +} + +vec2 unmapCoord( vec2 coord ) +{ + coord -= uInputSize.zw; + coord /= uInputSize.xy; + + return coord; +} + +vec2 pixelate(vec2 coord, vec2 uSize) +{ + return floor( coord / uSize ) * uSize; +} + +void main(void) +{ + vec2 coord = mapCoord(vTextureCoord); + coord = pixelate(coord, uSize); + coord = unmapCoord(coord); + finalColor = texture(uTexture, coord); +} +`,sl=`struct PixelateUniforms { + uSize:vec2, +}; + +struct GlobalFilterUniforms { + uInputSize:vec4, + uInputPixel:vec4, + uInputClamp:vec4, + uOutputFrame:vec4, + uGlobalFrame:vec4, + uOutputTexture:vec4, +}; + +@group(0) @binding(0) var gfu: GlobalFilterUniforms; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var pixelateUniforms : PixelateUniforms; + +@fragment +fn mainFragment( + @location(0) uv: vec2, + @builtin(position) position: vec4 +) -> @location(0) vec4 { + let pixelSize: vec2 = pixelateUniforms.uSize; + let coord: vec2 = mapCoord(uv); + + var pixCoord: vec2 = pixelate(coord, pixelSize); + pixCoord = unmapCoord(pixCoord); + + return textureSample(uTexture, uSampler, pixCoord); +} + +fn mapCoord(coord: vec2 ) -> vec2 +{ + var mappedCoord: vec2 = coord; + mappedCoord *= gfu.uInputSize.xy; + mappedCoord += gfu.uOutputFrame.xy; + return mappedCoord; +} + +fn unmapCoord(coord: vec2 ) -> vec2 +{ + var mappedCoord: vec2 = coord; + mappedCoord -= gfu.uOutputFrame.xy; + mappedCoord /= gfu.uInputSize.xy; + return mappedCoord; +} + +fn pixelate(coord: vec2, size: vec2) -> vec2 +{ + return floor( coord / size ) * size; +} + +`;class fl extends s{constructor(e=10){const n=f.from({vertex:{source:p,entryPoint:"mainVertex"},fragment:{source:sl,entryPoint:"mainFragment"}}),t=c.from({vertex:m,fragment:al,name:"pixelate-filter"});super({gpuProgram:n,glProgram:t,resources:{pixelateUniforms:{uSize:{value:new Float32Array(2),type:"vec2"}}}}),this.size=e}get size(){return this.resources.pixelateUniforms.uniforms.uSize}set size(e){e instanceof qt?(this.sizeX=e.x,this.sizeY=e.y):Array.isArray(e)?this.resources.pixelateUniforms.uniforms.uSize=e:this.sizeX=this.sizeY=e}get sizeX(){return this.resources.pixelateUniforms.uniforms.uSize[0]}set sizeX(e){this.resources.pixelateUniforms.uniforms.uSize[0]=e}get sizeY(){return this.resources.pixelateUniforms.uniforms.uSize[1]}set sizeY(e){this.resources.pixelateUniforms.uniforms.uSize[1]=e}}var cl=`precision highp float; +in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform float uRadian; +uniform vec2 uCenter; +uniform float uRadius; +uniform int uKernelSize; + +uniform vec4 uInputSize; + +const int MAX_KERNEL_SIZE = 2048; + +void main(void) +{ + vec4 color = texture(uTexture, vTextureCoord); + + if (uKernelSize == 0) + { + finalColor = color; + return; + } + + float aspect = uInputSize.y / uInputSize.x; + vec2 center = uCenter.xy / uInputSize.xy; + float gradient = uRadius / uInputSize.x * 0.3; + float radius = uRadius / uInputSize.x - gradient * 0.5; + int k = uKernelSize - 1; + + vec2 coord = vTextureCoord; + vec2 dir = vec2(center - coord); + float dist = length(vec2(dir.x, dir.y * aspect)); + + float radianStep = uRadian; + if (radius >= 0.0 && dist > radius) { + float delta = dist - radius; + float gap = gradient; + float scale = 1.0 - abs(delta / gap); + if (scale <= 0.0) { + finalColor = color; + return; + } + radianStep *= scale; + } + radianStep /= float(k); + + float s = sin(radianStep); + float c = cos(radianStep); + mat2 rotationMatrix = mat2(vec2(c, -s), vec2(s, c)); + + for(int i = 0; i < MAX_KERNEL_SIZE - 1; i++) { + if (i == k) { + break; + } + + coord -= center; + coord.y *= aspect; + coord = rotationMatrix * coord; + coord.y /= aspect; + coord += center; + + vec4 sample = texture(uTexture, coord); + + // switch to pre-multiplied alpha to correctly blur transparent images + // sample.rgb *= sample.a; + + color += sample; + } + + finalColor = color / float(uKernelSize); +} +`,ml=`struct RadialBlurUniforms { + uRadian: f32, + uCenter: vec2, + uKernelSize: f32, + uRadius: f32, +}; + +struct GlobalFilterUniforms { + uInputSize:vec4, + uInputPixel:vec4, + uInputClamp:vec4, + uOutputFrame:vec4, + uGlobalFrame:vec4, + uOutputTexture:vec4, +}; + +@group(0) @binding(0) var gfu: GlobalFilterUniforms; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var radialBlurUniforms : RadialBlurUniforms; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 +) -> @location(0) vec4 { + let uRadian = radialBlurUniforms.uRadian; + let uCenter = radialBlurUniforms.uCenter; + let uKernelSize = radialBlurUniforms.uKernelSize; + let uRadius = radialBlurUniforms.uRadius; + + var returnColorOnly = false; + + if (uKernelSize == 0) + { + returnColorOnly = true; + } + + let aspect: f32 = gfu.uInputSize.y / gfu.uInputSize.x; + let center: vec2 = uCenter.xy / gfu.uInputSize.xy; + let gradient: f32 = uRadius / gfu.uInputSize.x * 0.3; + let radius: f32 = uRadius / gfu.uInputSize.x - gradient * 0.5; + let k: i32 = i32(uKernelSize - 1); + + var coord: vec2 = uv; + let dir: vec2 = vec2(center - coord); + let dist: f32 = length(vec2(dir.x, dir.y * aspect)); + + var radianStep: f32 = uRadian; + + if (radius >= 0.0 && dist > radius) + { + let delta: f32 = dist - radius; + let gap: f32 = gradient; + let scale: f32 = 1.0 - abs(delta / gap); + if (scale <= 0.0) { + returnColorOnly = true; + } + radianStep *= scale; + } + + radianStep /= f32(k); + + let s: f32 = sin(radianStep); + let c: f32 = cos(radianStep); + let rotationMatrix: mat2x2 = mat2x2(vec2(c, -s), vec2(s, c)); + + var color: vec4 = textureSample(uTexture, uSampler, uv); + let baseColor = vec4(color); + + let minK: i32 = min(i32(uKernelSize) - 1, MAX_KERNEL_SIZE - 1); + + for(var i: i32 = 0; i < minK; i += 1) + { + coord -= center; + coord.y *= aspect; + coord = rotationMatrix * coord; + coord.y /= aspect; + coord += center; + let sample: vec4 = textureSample(uTexture, uSampler, coord); + // switch to pre-multiplied alpha to correctly blur transparent images + // sample.rgb *= sample.a; + color += sample; + } + + return select(color / f32(uKernelSize), baseColor, returnColorOnly); +} + +const MAX_KERNEL_SIZE: i32 = 2048;`,pl=Object.defineProperty,Ur=Object.getOwnPropertySymbols,vl=Object.prototype.hasOwnProperty,gl=Object.prototype.propertyIsEnumerable,$e=(r,e,n)=>e in r?pl(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,Rr=(r,e)=>{for(var n in e||(e={}))vl.call(e,n)&&$e(r,n,e[n]);if(Ur)for(var n of Ur(e))gl.call(e,n)&&$e(r,n,e[n]);return r},H=(r,e,n)=>($e(r,typeof e!="symbol"?e+"":e,n),n);const Dr=class _t extends s{constructor(...e){var n;let t=(n=e[0])!=null?n:{};if(typeof t=="number"){if(h("6.0.0","RadialBlurFilter constructor params are now options object. See params: { angle, center, kernelSize, radius }"),t={angle:t},e[1]){const u="x"in e[1]?e[1].x:e[1][0],l="y"in e[1]?e[1].y:e[1][1];t.center={x:u,y:l}}e[2]&&(t.kernelSize=e[2]),e[3]&&(t.radius=e[3])}t=Rr(Rr({},_t.DEFAULT_OPTIONS),t);const o=f.from({vertex:{source:p,entryPoint:"mainVertex"},fragment:{source:ml,entryPoint:"mainFragment"}}),i=c.from({vertex:m,fragment:cl,name:"radial-blur-filter"});super({gpuProgram:o,glProgram:i,resources:{radialBlurUniforms:{uRadian:{value:0,type:"f32"},uCenter:{value:t.center,type:"vec2"},uKernelSize:{value:t.kernelSize,type:"i32"},uRadius:{value:t.radius,type:"f32"}}}}),H(this,"uniforms"),H(this,"_angle"),H(this,"_kernelSize"),this.uniforms=this.resources.radialBlurUniforms.uniforms,Object.assign(this,t)}_updateKernelSize(){this.uniforms.uKernelSize=this._angle!==0?this.kernelSize:0}get angle(){return this._angle}set angle(e){this._angle=e,this.uniforms.uRadian=e*Math.PI/180,this._updateKernelSize()}get center(){return this.uniforms.uCenter}set center(e){Array.isArray(e)&&(e={x:e[0],y:e[1]}),this.uniforms.uCenter=e}get centerX(){return this.center.x}set centerX(e){this.center.x=e}get centerY(){return this.center.y}set centerY(e){this.center.y=e}get kernelSize(){return this._kernelSize}set kernelSize(e){this._kernelSize=e,this._updateKernelSize()}get radius(){return this.uniforms.uRadius}set radius(e){this.uniforms.uRadius=e<0||e===1/0?-1:e}};H(Dr,"DEFAULT_OPTIONS",{angle:0,center:{x:0,y:0},kernelSize:5,radius:-1});let dl=Dr;var hl=`precision highp float; +in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform float uMirror; +uniform float uBoundary; +uniform vec2 uAmplitude; +uniform vec2 uWavelength; +uniform vec2 uAlpha; +uniform float uTime; +uniform vec2 uDimensions; + +uniform vec4 uInputSize; +uniform vec4 uInputClamp; + +float rand(vec2 co) { + return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453); +} + +void main(void) +{ + vec2 pixelCoord = vTextureCoord.xy * uInputSize.xy; + vec2 coord = pixelCoord / uDimensions; + + if (coord.y < uBoundary) { + finalColor = texture(uTexture, vTextureCoord); + return; + } + + float k = (coord.y - uBoundary) / (1. - uBoundary + 0.0001); + float areaY = uBoundary * uDimensions.y / uInputSize.y; + float v = areaY + areaY - vTextureCoord.y; + float y = uMirror > 0.5 ? v : vTextureCoord.y; + + float _amplitude = ((uAmplitude.y - uAmplitude.x) * k + uAmplitude.x ) / uInputSize.x; + float _waveLength = ((uWavelength.y - uWavelength.x) * k + uWavelength.x) / uInputSize.y; + float _alpha = (uAlpha.y - uAlpha.x) * k + uAlpha.x; + + float x = vTextureCoord.x + cos(v * 6.28 / _waveLength - uTime) * _amplitude; + x = clamp(x, uInputClamp.x, uInputClamp.z); + + vec4 color = texture(uTexture, vec2(x, y)); + + finalColor = color * _alpha; +} +`,xl=`struct ReflectionUniforms { + uMirror: f32, + uBoundary: f32, + uAmplitude: vec2, + uWavelength: vec2, + uAlpha: vec2, + uTime: f32, + uDimensions: vec2, +}; + +struct GlobalFilterUniforms { + uInputSize:vec4, + uInputPixel:vec4, + uInputClamp:vec4, + uOutputFrame:vec4, + uGlobalFrame:vec4, + uOutputTexture:vec4, +}; + +@group(0) @binding(0) var gfu: GlobalFilterUniforms; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var reflectionUniforms : ReflectionUniforms; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 +) -> @location(0) vec4 { + let uDimensions: vec2 = reflectionUniforms.uDimensions; + let uBoundary: f32 = reflectionUniforms.uBoundary; + let uMirror: bool = reflectionUniforms.uMirror > 0.5; + let uAmplitude: vec2 = reflectionUniforms.uAmplitude; + let uWavelength: vec2 = reflectionUniforms.uWavelength; + let uAlpha: vec2 = reflectionUniforms.uAlpha; + let uTime: f32 = reflectionUniforms.uTime; + + let pixelCoord: vec2 = uv * gfu.uInputSize.xy; + let coord: vec2 = pixelCoord /uDimensions; + var returnColorOnly: bool = false; + + if (coord.y < uBoundary) { + returnColorOnly = true; + } + + let k: f32 = (coord.y - uBoundary) / (1. - uBoundary + 0.0001); + let areaY: f32 = uBoundary * uDimensions.y / gfu.uInputSize.y; + let v: f32 = areaY + areaY - uv.y; + let y: f32 = select(uv.y, v, uMirror); + + let amplitude: f32 = ((uAmplitude.y - uAmplitude.x) * k + uAmplitude.x ) / gfu.uInputSize.x; + let waveLength: f32 = ((uWavelength.y - uWavelength.x) * k + uWavelength.x) / gfu.uInputSize.y; + let alpha: f32 = select((uAlpha.y - uAlpha.x) * k + uAlpha.x, 1., returnColorOnly); + + var x: f32 = uv.x + cos(v * 6.28 / waveLength - uTime) * amplitude; + x = clamp(x, gfu.uInputClamp.x, gfu.uInputClamp.z); + + return textureSample(uTexture, uSampler, select(vec2(x, y), uv, returnColorOnly)) * alpha; +} + +fn rand(co: vec2) -> f32 +{ + return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453); +}`,yl=Object.defineProperty,$r=Object.getOwnPropertySymbols,Sl=Object.prototype.hasOwnProperty,bl=Object.prototype.propertyIsEnumerable,Me=(r,e,n)=>e in r?yl(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,Mr=(r,e)=>{for(var n in e||(e={}))Sl.call(e,n)&&Me(r,n,e[n]);if($r)for(var n of $r(e))bl.call(e,n)&&Me(r,n,e[n]);return r},Ee=(r,e,n)=>(Me(r,typeof e!="symbol"?e+"":e,n),n);const Er=class wt extends s{constructor(e){e=Mr(Mr({},wt.DEFAULT_OPTIONS),e);const n=f.from({vertex:{source:p,entryPoint:"mainVertex"},fragment:{source:xl,entryPoint:"mainFragment"}}),t=c.from({vertex:m,fragment:hl,name:"reflection-filter"});super({gpuProgram:n,glProgram:t,resources:{reflectionUniforms:{uMirror:{value:e.mirror?1:0,type:"f32"},uBoundary:{value:e.boundary,type:"f32"},uAmplitude:{value:e.amplitude,type:"vec2"},uWavelength:{value:e.waveLength,type:"vec2"},uAlpha:{value:e.alpha,type:"vec2"},uTime:{value:e.time,type:"f32"},uDimensions:{value:new Float32Array(2),type:"vec2"}}}}),Ee(this,"uniforms"),Ee(this,"time",0),this.uniforms=this.resources.reflectionUniforms.uniforms,Object.assign(this,e)}apply(e,n,t,o){this.uniforms.uDimensions[0]=n.frame.width,this.uniforms.uDimensions[1]=n.frame.height,this.uniforms.uTime=this.time,e.applyFilter(this,n,t,o)}get mirror(){return this.uniforms.uMirror>.5}set mirror(e){this.uniforms.uMirror=e?1:0}get boundary(){return this.uniforms.uBoundary}set boundary(e){this.uniforms.uBoundary=e}get amplitude(){return Array.from(this.uniforms.uAmplitude)}set amplitude(e){this.uniforms.uAmplitude[0]=e[0],this.uniforms.uAmplitude[1]=e[1]}get amplitudeStart(){return this.uniforms.uAmplitude[0]}set amplitudeStart(e){this.uniforms.uAmplitude[0]=e}get amplitudeEnd(){return this.uniforms.uAmplitude[1]}set amplitudeEnd(e){this.uniforms.uAmplitude[1]=e}get waveLength(){return Array.from(this.uniforms.uWavelength)}set waveLength(e){this.uniforms.uWavelength[0]=e[0],this.uniforms.uWavelength[1]=e[1]}get wavelengthStart(){return this.uniforms.uWavelength[0]}set wavelengthStart(e){this.uniforms.uWavelength[0]=e}get wavelengthEnd(){return this.uniforms.uWavelength[1]}set wavelengthEnd(e){this.uniforms.uWavelength[1]=e}get alpha(){return Array.from(this.uniforms.uAlpha)}set alpha(e){this.uniforms.uAlpha[0]=e[0],this.uniforms.uAlpha[1]=e[1]}get alphaStart(){return this.uniforms.uAlpha[0]}set alphaStart(e){this.uniforms.uAlpha[0]=e}get alphaEnd(){return this.uniforms.uAlpha[1]}set alphaEnd(e){this.uniforms.uAlpha[1]=e}};Ee(Er,"DEFAULT_OPTIONS",{mirror:!0,boundary:.5,amplitude:[0,20],waveLength:[30,100],alpha:[1,1],time:0});let Cl=Er;var Tl=`precision highp float; +in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform vec4 uInputSize; +uniform vec2 uRed; +uniform vec2 uGreen; +uniform vec2 uBlue; + +void main(void) +{ + float r = texture(uTexture, vTextureCoord + uRed/uInputSize.xy).r; + float g = texture(uTexture, vTextureCoord + uGreen/uInputSize.xy).g; + float b = texture(uTexture, vTextureCoord + uBlue/uInputSize.xy).b; + float a = texture(uTexture, vTextureCoord).a; + finalColor = vec4(r, g, b, a); +} +`,zl=`struct RgbSplitUniforms { + uRed: vec2, + uGreen: vec2, + uBlue: vec3, +}; + +struct GlobalFilterUniforms { + uInputSize:vec4, + uInputPixel:vec4, + uInputClamp:vec4, + uOutputFrame:vec4, + uGlobalFrame:vec4, + uOutputTexture:vec4, +}; + +@group(0) @binding(0) var gfu: GlobalFilterUniforms; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var rgbSplitUniforms : RgbSplitUniforms; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 +) -> @location(0) vec4 { + let r = textureSample(uTexture, uSampler, uv + vec2(rgbSplitUniforms.uRed.x / gfu.uInputSize.x, rgbSplitUniforms.uRed.y / gfu.uInputSize.y)).r; + let g = textureSample(uTexture, uSampler, uv + vec2(rgbSplitUniforms.uGreen.x / gfu.uInputSize.x, rgbSplitUniforms.uGreen.y / gfu.uInputSize.y)).g; + let b = textureSample(uTexture, uSampler, uv + vec2(rgbSplitUniforms.uBlue.x / gfu.uInputSize.x, rgbSplitUniforms.uBlue.y / gfu.uInputSize.y)).b; + let a = textureSample(uTexture, uSampler, uv).a; + return vec4(r, g, b, a); +} +`,Ol=Object.defineProperty,Lr=Object.getOwnPropertySymbols,Pl=Object.prototype.hasOwnProperty,_l=Object.prototype.propertyIsEnumerable,Le=(r,e,n)=>e in r?Ol(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,kr=(r,e)=>{for(var n in e||(e={}))Pl.call(e,n)&&Le(r,n,e[n]);if(Lr)for(var n of Lr(e))_l.call(e,n)&&Le(r,n,e[n]);return r},jr=(r,e,n)=>(Le(r,typeof e!="symbol"?e+"":e,n),n);const Gr=class At extends s{constructor(...e){var n;let t=(n=e[0])!=null?n:{};(Array.isArray(t)||"x"in t&&"y"in t)&&(h("6.0.0","RGBSplitFilter constructor params are now options object. See params: { red, green, blue }"),t={red:t},e[1]!==void 0&&(t.green=e[1]),e[2]!==void 0&&(t.blue=e[2])),t=kr(kr({},At.DEFAULT_OPTIONS),t);const o=f.from({vertex:{source:p,entryPoint:"mainVertex"},fragment:{source:zl,entryPoint:"mainFragment"}}),i=c.from({vertex:m,fragment:Tl,name:"rgb-split-filter"});super({gpuProgram:o,glProgram:i,resources:{rgbSplitUniforms:{uRed:{value:t.red,type:"vec2"},uGreen:{value:t.green,type:"vec2"},uBlue:{value:t.blue,type:"vec2"}}}}),jr(this,"uniforms"),this.uniforms=this.resources.rgbSplitUniforms.uniforms,Object.assign(this,t)}get red(){return this.uniforms.uRed}set red(e){Array.isArray(e)&&(e={x:e[0],y:e[1]}),this.uniforms.uRed=e}get redX(){return this.red.x}set redX(e){this.red.x=e}get redY(){return this.red.y}set redY(e){this.red.y=e}get green(){return this.uniforms.uGreen}set green(e){Array.isArray(e)&&(e={x:e[0],y:e[1]}),this.uniforms.uGreen=e}get greenX(){return this.green.x}set greenX(e){this.green.x=e}get greenY(){return this.green.y}set greenY(e){this.green.y=e}get blue(){return this.uniforms.uBlue}set blue(e){Array.isArray(e)&&(e={x:e[0],y:e[1]}),this.uniforms.uBlue=e}get blueX(){return this.blue.x}set blueX(e){this.blue.x=e}get blueY(){return this.blue.y}set blueY(e){this.blue.y=e}};jr(Gr,"DEFAULT_OPTIONS",{red:{x:-10,y:0},green:{x:0,y:10},blue:{x:0,y:0}});let wl=Gr;var Al=` +precision highp float; +in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform vec2 uCenter; +uniform float uTime; +uniform float uSpeed; +uniform vec4 uWave; + +uniform vec4 uInputSize; +uniform vec4 uInputClamp; + +const float PI = 3.14159; + +void main() +{ + float uAmplitude = uWave[0]; + float uWavelength = uWave[1]; + float uBrightness = uWave[2]; + float uRadius = uWave[3]; + + float halfWavelength = uWavelength * 0.5 / uInputSize.x; + float maxRadius = uRadius / uInputSize.x; + float currentRadius = uTime * uSpeed / uInputSize.x; + + float fade = 1.0; + + if (maxRadius > 0.0) { + if (currentRadius > maxRadius) { + finalColor = texture(uTexture, vTextureCoord); + return; + } + fade = 1.0 - pow(currentRadius / maxRadius, 2.0); + } + + vec2 dir = vec2(vTextureCoord - uCenter / uInputSize.xy); + dir.y *= uInputSize.y / uInputSize.x; + float dist = length(dir); + + if (dist <= 0.0 || dist < currentRadius - halfWavelength || dist > currentRadius + halfWavelength) { + finalColor = texture(uTexture, vTextureCoord); + return; + } + + vec2 diffUV = normalize(dir); + + float diff = (dist - currentRadius) / halfWavelength; + + float p = 1.0 - pow(abs(diff), 2.0); + + // float powDiff = diff * pow(p, 2.0) * ( amplitude * fade ); + float powDiff = 1.25 * sin(diff * PI) * p * ( uAmplitude * fade ); + + vec2 offset = diffUV * powDiff / uInputSize.xy; + + // Do clamp : + vec2 coord = vTextureCoord + offset; + vec2 clampedCoord = clamp(coord, uInputClamp.xy, uInputClamp.zw); + vec4 color = texture(uTexture, clampedCoord); + if (coord != clampedCoord) { + color *= max(0.0, 1.0 - length(coord - clampedCoord)); + } + + // No clamp : + // finalColor = texture(uTexture, vTextureCoord + offset); + + color.rgb *= 1.0 + (uBrightness - 1.0) * p * fade; + + finalColor = color; +} +`,Fl=` +struct ShockWaveUniforms { + uTime: f32, + uOffset: vec2, + uSpeed: f32, + uWave: vec4, +}; + +struct GlobalFilterUniforms { + uInputSize:vec4, + uInputPixel:vec4, + uInputClamp:vec4, + uOutputFrame:vec4, + uGlobalFrame:vec4, + uOutputTexture:vec4, +}; + +@group(0) @binding(0) var gfu: GlobalFilterUniforms; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var shockwaveUniforms : ShockWaveUniforms; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 +) -> @location(0) vec4 { + + let uTime = shockwaveUniforms.uTime; + let uOffset = shockwaveUniforms.uOffset; + let uSpeed = shockwaveUniforms.uSpeed; + let uAmplitude = shockwaveUniforms.uWave[0]; + let uWavelength = shockwaveUniforms.uWave[1]; + let uBrightness = shockwaveUniforms.uWave[2]; + let uRadius = shockwaveUniforms.uWave[3]; + let halfWavelength: f32 = uWavelength * 0.5 / gfu.uInputSize.x; + let maxRadius: f32 = uRadius / gfu.uInputSize.x; + let currentRadius: f32 = uTime * uSpeed / gfu.uInputSize.x; + var fade: f32 = 1.0; + var returnColorOnly: bool = false; + + if (maxRadius > 0.0) { + if (currentRadius > maxRadius) { + returnColorOnly = true; + } + fade = 1.0 - pow(currentRadius / maxRadius, 2.0); + } + var dir: vec2 = vec2(uv - uOffset / gfu.uInputSize.xy); + dir.y *= gfu.uInputSize.y / gfu.uInputSize.x; + + let dist:f32 = length(dir); + + if (dist <= 0.0 || dist < currentRadius - halfWavelength || dist > currentRadius + halfWavelength) { + returnColorOnly = true; + } + + let diffUV: vec2 = normalize(dir); + let diff: f32 = (dist - currentRadius) / halfWavelength; + let p: f32 = 1.0 - pow(abs(diff), 2.0); + let powDiff: f32 = 1.25 * sin(diff * PI) * p * ( uAmplitude * fade ); + let offset: vec2 = diffUV * powDiff / gfu.uInputSize.xy; + // Do clamp : + let coord: vec2 = uv + offset; + let clampedCoord: vec2 = clamp(coord, gfu.uInputClamp.xy, gfu.uInputClamp.zw); + + var clampedColor: vec4 = textureSample(uTexture, uSampler, clampedCoord); + + if (boolVec2(coord, clampedCoord)) + { + clampedColor *= max(0.0, 1.0 - length(coord - clampedCoord)); + } + // No clamp : + var finalColor = clampedColor; + + return select(finalColor, textureSample(uTexture, uSampler, uv), returnColorOnly); +} + +fn boolVec2(x: vec2, y: vec2) -> bool +{ + if (x.x == y.x && x.y == y.y) + { + return true; + } + + return false; +} + +const PI: f32 = 3.14159265358979323846264; +`,Il=Object.defineProperty,Br=Object.getOwnPropertySymbols,Ul=Object.prototype.hasOwnProperty,Rl=Object.prototype.propertyIsEnumerable,ke=(r,e,n)=>e in r?Il(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,je=(r,e)=>{for(var n in e||(e={}))Ul.call(e,n)&&ke(r,n,e[n]);if(Br)for(var n of Br(e))Rl.call(e,n)&&ke(r,n,e[n]);return r},Ge=(r,e,n)=>(ke(r,typeof e!="symbol"?e+"":e,n),n);const Nr=class Ft extends s{constructor(...e){var n;let t=(n=e[0])!=null?n:{};(Array.isArray(t)||"x"in t&&"y"in t)&&(h("6.0.0","ShockwaveFilter constructor params are now options object. See params: { center, speed, amplitude, wavelength, brightness, radius, time }"),t=je({center:t},e[1]),e[2]!==void 0&&(t.time=e[2])),t=je(je({},Ft.DEFAULT_OPTIONS),t);const o=f.from({vertex:{source:p,entryPoint:"mainVertex"},fragment:{source:Fl,entryPoint:"mainFragment"}}),i=c.from({vertex:m,fragment:Al,name:"shockwave-filter"});super({gpuProgram:o,glProgram:i,resources:{shockwaveUniforms:{uTime:{value:t.time,type:"f32"},uCenter:{value:t.center,type:"vec2"},uSpeed:{value:t.speed,type:"f32"},uWave:{value:new Float32Array(4),type:"vec4"}}}}),Ge(this,"uniforms"),Ge(this,"time"),this.time=0,this.uniforms=this.resources.shockwaveUniforms.uniforms,Object.assign(this,t)}apply(e,n,t,o){this.uniforms.uTime=this.time,e.applyFilter(this,n,t,o)}get center(){return this.uniforms.uCenter}set center(e){Array.isArray(e)&&(e={x:e[0],y:e[1]}),this.uniforms.uCenter=e}get centerX(){return this.uniforms.uCenter.x}set centerX(e){this.uniforms.uCenter.x=e}get centerY(){return this.uniforms.uCenter.y}set centerY(e){this.uniforms.uCenter.y=e}get speed(){return this.uniforms.uSpeed}set speed(e){this.uniforms.uSpeed=e}get amplitude(){return this.uniforms.uWave[0]}set amplitude(e){this.uniforms.uWave[0]=e}get wavelength(){return this.uniforms.uWave[1]}set wavelength(e){this.uniforms.uWave[1]=e}get brightness(){return this.uniforms.uWave[2]}set brightness(e){this.uniforms.uWave[2]=e}get radius(){return this.uniforms.uWave[3]}set radius(e){this.uniforms.uWave[3]=e}};Ge(Nr,"DEFAULT_OPTIONS",{center:{x:0,y:0},speed:500,amplitude:30,wavelength:160,brightness:1,radius:-1});let Dl=Nr;var $l=`precision highp float; +in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform sampler2D uMapTexture; +uniform vec3 uColor; +uniform float uAlpha; +uniform vec2 uDimensions; + +uniform vec4 uInputSize; + +void main() { + vec4 diffuseColor = texture(uTexture, vTextureCoord); + vec2 lightCoord = (vTextureCoord * uInputSize.xy) / uDimensions; + vec4 light = texture(uMapTexture, lightCoord); + vec3 ambient = uColor.rgb * uAlpha; + vec3 intensity = ambient + light.rgb; + vec3 color = diffuseColor.rgb * intensity; + finalColor = vec4(color, diffuseColor.a); +} +`,Ml=`struct SimpleLightmapUniforms { + uColor: vec3, + uAlpha: f32, + uDimensions: vec2, +}; + +struct GlobalFilterUniforms { + uInputSize:vec4, + uInputPixel:vec4, + uInputClamp:vec4, + uOutputFrame:vec4, + uGlobalFrame:vec4, + uOutputTexture:vec4, +}; + +@group(0) @binding(0) var gfu: GlobalFilterUniforms; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var simpleLightmapUniforms : SimpleLightmapUniforms; +@group(1) @binding(1) var uMapTexture: texture_2d; +@group(1) @binding(2) var uMapSampler: sampler; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2, +) -> @location(0) vec4 { + let uColor = simpleLightmapUniforms.uColor; + let uAlpha = simpleLightmapUniforms.uAlpha; + let uDimensions = simpleLightmapUniforms.uDimensions; + + let diffuseColor: vec4 = textureSample(uTexture, uSampler, uv); + let lightCoord: vec2 = (uv * gfu.uInputSize.xy) / simpleLightmapUniforms.uDimensions; + let light: vec4 = textureSample(uMapTexture, uMapSampler, lightCoord); + let ambient: vec3 = uColor * uAlpha; + let intensity: vec3 = ambient + light.rgb; + let finalColor: vec3 = diffuseColor.rgb * intensity; + return vec4(finalColor, diffuseColor.a); +}`,El=Object.defineProperty,Vr=Object.getOwnPropertySymbols,Ll=Object.prototype.hasOwnProperty,kl=Object.prototype.propertyIsEnumerable,Be=(r,e,n)=>e in r?El(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,Xr=(r,e)=>{for(var n in e||(e={}))Ll.call(e,n)&&Be(r,n,e[n]);if(Vr)for(var n of Vr(e))kl.call(e,n)&&Be(r,n,e[n]);return r},Z=(r,e,n)=>(Be(r,typeof e!="symbol"?e+"":e,n),n);const Yr=class It extends s{constructor(...e){var n,t;let o=(n=e[0])!=null?n:{};if(o instanceof _&&(h("6.0.0","SimpleLightmapFilter constructor params are now options object. See params: { lightMap, color, alpha }"),o={lightMap:o},e[1]!==void 0&&(o.color=e[1]),e[2]!==void 0&&(o.alpha=e[2])),o=Xr(Xr({},It.DEFAULT_OPTIONS),o),!o.lightMap)throw Error("No light map texture source was provided to SimpleLightmapFilter");const i=f.from({vertex:{source:p,entryPoint:"mainVertex"},fragment:{source:Ml,entryPoint:"mainFragment"}}),u=c.from({vertex:m,fragment:$l,name:"simple-lightmap-filter"});super({gpuProgram:i,glProgram:u,resources:{simpleLightmapUniforms:{uColor:{value:new Float32Array(3),type:"vec3"},uAlpha:{value:o.alpha,type:"f32"},uDimensions:{value:new Float32Array(2),type:"vec2"}},uMapTexture:o.lightMap.source,uMapSampler:o.lightMap.source.style}}),Z(this,"uniforms"),Z(this,"_color"),Z(this,"_lightMap"),this.uniforms=this.resources.simpleLightmapUniforms.uniforms,this._color=new S,this.color=(t=o.color)!=null?t:0,Object.assign(this,o)}apply(e,n,t,o){this.uniforms.uDimensions[0]=n.frame.width,this.uniforms.uDimensions[1]=n.frame.height,e.applyFilter(this,n,t,o)}get lightMap(){return this._lightMap}set lightMap(e){this._lightMap=e,this.resources.uMapTexture=e.source,this.resources.uMapSampler=e.source.style}get color(){return this._color.value}set color(e){this._color.setValue(e);const[n,t,o]=this._color.toArray();this.uniforms.uColor[0]=n,this.uniforms.uColor[1]=t,this.uniforms.uColor[2]=o}get alpha(){return this.uniforms.uAlpha}set alpha(e){this.uniforms.uAlpha=e}};Z(Yr,"DEFAULT_OPTIONS",{lightMap:_.WHITE,color:0,alpha:1});let jl=Yr;var Gl=`in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform vec2 uBlur; +uniform vec2 uStart; +uniform vec2 uEnd; +uniform vec2 uDelta; +uniform vec2 uTexSize; + +float random(vec3 scale, float seed) +{ + return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed); +} + +void main(void) +{ + vec4 color = vec4(0.0); + float total = 0.0; + + float blur = uBlur[0]; + float gradientBlur = uBlur[1]; + + float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0); + vec2 normal = normalize(vec2(uStart.y - uEnd.y, uEnd.x - uStart.x)); + float radius = smoothstep(0.0, 1.0, abs(dot(vTextureCoord * uTexSize - uStart, normal)) / gradientBlur) * blur; + + for (float t = -30.0; t <= 30.0; t++) + { + float percent = (t + offset - 0.5) / 30.0; + float weight = 1.0 - abs(percent); + vec4 sample = texture(uTexture, vTextureCoord + uDelta / uTexSize * percent * radius); + sample.rgb *= sample.a; + color += sample * weight; + total += weight; + } + + color /= total; + color.rgb /= color.a + 0.00001; + + finalColor = color; +} +`,Bl=`struct TiltShiftUniforms { + uBlur: vec2, + uStart: vec2, + uEnd: vec2, + uDelta: vec2, + uTexSize: vec2, +}; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var tiltShiftUniforms : TiltShiftUniforms; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 +) -> @location(0) vec4 { + let uBlur = tiltShiftUniforms.uBlur[0]; + let uBlurGradient = tiltShiftUniforms.uBlur[1]; + let uStart = tiltShiftUniforms.uStart; + let uEnd = tiltShiftUniforms.uEnd; + let uDelta = tiltShiftUniforms.uDelta; + let uTexSize = tiltShiftUniforms.uTexSize; + + var color: vec4 = vec4(0.0); + var total: f32 = 0.0; + + let offset: f32 = random(position, vec3(12.9898, 78.233, 151.7182), 0.0); + let normal: vec2 = normalize(vec2(uStart.y - uEnd.y, uEnd.x - uStart.x)); + let radius: f32 = smoothstep(0.0, 1.0, abs(dot(uv * uTexSize - uStart, normal)) / uBlurGradient) * uBlur; + + for (var t: f32 = -30.0; t <= 30.0; t += 1.0) + { + var percent: f32 = (t + offset - 0.5) / 30.0; + var weight: f32 = 1.0 - abs(percent); + var sample: vec4 = textureSample(uTexture, uSampler, uv + uDelta / uTexSize * percent * radius); + sample = vec4(sample.xyz * sample.a, sample.a); // multiply sample.rgb with sample.a + color += sample * weight; + total += weight; + } + + color /= total; + color = vec4(color.xyz / (color.a + 0.00001), color.a); // divide color.rgb by color.a + 0.00001 + + return color; +} + + +fn random(position: vec4, scale: vec3, seed: f32) -> f32 +{ + return fract(sin(dot(position.xyz + seed, scale)) * 43758.5453 + seed); +}`,Nl=Object.defineProperty,Kr=Object.getOwnPropertySymbols,Vl=Object.prototype.hasOwnProperty,Xl=Object.prototype.propertyIsEnumerable,Ne=(r,e,n)=>e in r?Nl(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,Wr=(r,e)=>{for(var n in e||(e={}))Vl.call(e,n)&&Ne(r,n,e[n]);if(Kr)for(var n of Kr(e))Xl.call(e,n)&&Ne(r,n,e[n]);return r},Ve=(r,e,n)=>(Ne(r,typeof e!="symbol"?e+"":e,n),n);const qr=class Ut extends s{constructor(e){var n,t;e=Wr(Wr({},Ut.DEFAULT_OPTIONS),e);const o=f.from({vertex:{source:p,entryPoint:"mainVertex"},fragment:{source:Bl,entryPoint:"mainFragment"}}),i=c.from({vertex:m,fragment:Gl,name:"tilt-shift-axis-filter"});super({gpuProgram:o,glProgram:i,resources:{tiltShiftUniforms:{uBlur:{value:new Float32Array([(n=e.blur)!=null?n:100,(t=e.gradientBlur)!=null?t:600]),type:"vec2"},uStart:{value:e.start,type:"vec2"},uEnd:{value:e.end,type:"vec2"},uDelta:{value:new Float32Array([30,30]),type:"vec2"},uTexSize:{value:new Float32Array([window.innerWidth,window.innerHeight]),type:"vec2"}}}}),Ve(this,"uniforms"),Ve(this,"_tiltAxis"),this.uniforms=this.resources.tiltShiftUniforms.uniforms,this._tiltAxis=e.axis,this.updateDelta()}updateDelta(){if(this.uniforms.uDelta[0]=0,this.uniforms.uDelta[1]=0,this._tiltAxis===void 0)return;const e=this.uniforms.uEnd,n=this.uniforms.uStart,t=e.x-n.x,o=e.y-n.y,i=Math.sqrt(t*t+o*o),u=this._tiltAxis==="vertical";this.uniforms.uDelta[0]=u?-o/i:t/i,this.uniforms.uDelta[1]=u?t/i:o/i}};Ve(qr,"DEFAULT_OPTIONS",{blur:100,gradientBlur:600,start:{x:0,y:window.innerHeight/2},end:{x:600,y:window.innerHeight/2}});let Q=qr;var Yl=Object.defineProperty,Kl=Object.defineProperties,Wl=Object.getOwnPropertyDescriptors,Hr=Object.getOwnPropertySymbols,ql=Object.prototype.hasOwnProperty,Hl=Object.prototype.propertyIsEnumerable,Xe=(r,e,n)=>e in r?Yl(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,J=(r,e)=>{for(var n in e||(e={}))ql.call(e,n)&&Xe(r,n,e[n]);if(Hr)for(var n of Hr(e))Hl.call(e,n)&&Xe(r,n,e[n]);return r},Zr=(r,e)=>Kl(r,Wl(e)),Zl=(r,e,n)=>(Xe(r,typeof e!="symbol"?e+"":e,n),n);class Ql extends Q{constructor(e){e=J(J({},Q.DEFAULT_OPTIONS),e),super(Zr(J({},e),{axis:"horizontal"})),Zl(this,"_tiltShiftYFilter"),this._tiltShiftYFilter=new Q(Zr(J({},e),{axis:"vertical"})),Object.assign(this,e)}apply(e,n,t,o){const i=y.getSameSizeTexture(n);e.applyFilter(this,n,i,!0),e.applyFilter(this._tiltShiftYFilter,i,t,o),y.returnTexture(i)}get blur(){return this.uniforms.uBlur[0]}set blur(e){this.uniforms.uBlur[0]=this._tiltShiftYFilter.uniforms.uBlur[0]=e}get gradientBlur(){return this.uniforms.uBlur[1]}set gradientBlur(e){this.uniforms.uBlur[1]=this._tiltShiftYFilter.uniforms.uBlur[1]=e}get start(){return this.uniforms.uStart}set start(e){this.uniforms.uStart=this._tiltShiftYFilter.uniforms.uStart=e}get startX(){return this.start.x}set startX(e){this.start.x=e}get startY(){return this.start.y}set startY(e){this.start.y=e}get end(){return this.uniforms.uEnd}set end(e){this.uniforms.uEnd=this._tiltShiftYFilter.uniforms.uEnd=e}get endX(){return this.end.x}set endX(e){this.end.x=e}get endY(){return this.end.y}set endY(e){this.end.y=e}}var Jl=`precision highp float; +in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform vec2 uTwist; +uniform vec2 uOffset; +uniform vec4 uInputSize; + +vec2 mapCoord( vec2 coord ) +{ + coord *= uInputSize.xy; + coord += uInputSize.zw; + + return coord; +} + +vec2 unmapCoord( vec2 coord ) +{ + coord -= uInputSize.zw; + coord /= uInputSize.xy; + + return coord; +} + +vec2 twist(vec2 coord) +{ + coord -= uOffset; + + float dist = length(coord); + float uRadius = uTwist[0]; + float uAngle = uTwist[1]; + + if (dist < uRadius) + { + float ratioDist = (uRadius - dist) / uRadius; + float angleMod = ratioDist * ratioDist * uAngle; + float s = sin(angleMod); + float c = cos(angleMod); + coord = vec2(coord.x * c - coord.y * s, coord.x * s + coord.y * c); + } + + coord += uOffset; + + return coord; +} + +void main(void) +{ + vec2 coord = mapCoord(vTextureCoord); + coord = twist(coord); + coord = unmapCoord(coord); + finalColor = texture(uTexture, coord); +} +`,ea=`struct TwistUniforms { + uTwist:vec2, + uOffset:vec2, +}; + +struct GlobalFilterUniforms { + uInputSize:vec4, + uInputPixel:vec4, + uInputClamp:vec4, + uOutputFrame:vec4, + uGlobalFrame:vec4, + uOutputTexture:vec4, +}; + +@group(0) @binding(0) var gfu: GlobalFilterUniforms; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var twistUniforms : TwistUniforms; + +@fragment +fn mainFragment( + @location(0) uv: vec2, + @builtin(position) position: vec4 +) -> @location(0) vec4 { + return textureSample(uTexture, uSampler, unmapCoord(twist(mapCoord(uv)))); +} + +fn mapCoord(coord: vec2 ) -> vec2 +{ + var mappedCoord: vec2 = coord; + mappedCoord *= gfu.uInputSize.xy; + mappedCoord += gfu.uOutputFrame.xy; + return mappedCoord; +} + +fn unmapCoord(coord: vec2 ) -> vec2 +{ + var mappedCoord: vec2 = coord; + mappedCoord -= gfu.uOutputFrame.xy; + mappedCoord /= gfu.uInputSize.xy; + return mappedCoord; +} + +fn twist(coord: vec2) -> vec2 +{ + var twistedCoord: vec2 = coord; + let uRadius = twistUniforms.uTwist[0]; + let uAngle = twistUniforms.uTwist[1]; + let uOffset = twistUniforms.uOffset; + + twistedCoord -= uOffset; + + let dist = length(twistedCoord); + + if (dist < uRadius) + { + let ratioDist: f32 = (uRadius - dist) / uRadius; + let angleMod: f32 = ratioDist * ratioDist * uAngle; + let s: f32 = sin(angleMod); + let c: f32 = cos(angleMod); + twistedCoord = vec2(twistedCoord.x * c - twistedCoord.y * s, twistedCoord.x * s + twistedCoord.y * c); + } + + twistedCoord += uOffset; + return twistedCoord; +} +`,na=Object.defineProperty,Qr=Object.getOwnPropertySymbols,ra=Object.prototype.hasOwnProperty,ta=Object.prototype.propertyIsEnumerable,Ye=(r,e,n)=>e in r?na(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,Ke=(r,e)=>{for(var n in e||(e={}))ra.call(e,n)&&Ye(r,n,e[n]);if(Qr)for(var n of Qr(e))ta.call(e,n)&&Ye(r,n,e[n]);return r},Jr=(r,e,n)=>(Ye(r,typeof e!="symbol"?e+"":e,n),n);const et=class Rt extends s{constructor(e){var n,t;e=Ke(Ke({},Rt.DEFAULT_OPTIONS),e);const o=f.from({vertex:{source:p,entryPoint:"mainVertex"},fragment:{source:ea,entryPoint:"mainFragment"}}),i=c.from({vertex:m,fragment:Jl,name:"twist-filter"});super(Ke({gpuProgram:o,glProgram:i,resources:{twistUniforms:{uTwist:{value:[(n=e.radius)!=null?n:0,(t=e.angle)!=null?t:0],type:"vec2"},uOffset:{value:e.offset,type:"vec2"}}}},e)),Jr(this,"uniforms"),this.uniforms=this.resources.twistUniforms.uniforms}get radius(){return this.uniforms.uTwist[0]}set radius(e){this.uniforms.uTwist[0]=e}get angle(){return this.uniforms.uTwist[1]}set angle(e){this.uniforms.uTwist[1]=e}get offset(){return this.uniforms.uOffset}set offset(e){this.uniforms.uOffset=e}get offsetX(){return this.offset.x}set offsetX(e){this.offset.x=e}get offsetY(){return this.offset.y}set offsetY(e){this.offset.y=e}};Jr(et,"DEFAULT_OPTIONS",{padding:20,radius:200,angle:4,offset:{x:0,y:0}});let oa=et;var ia=`precision highp float; +in vec2 vTextureCoord; +out vec4 finalColor; + +uniform sampler2D uTexture; +uniform float uStrength; +uniform vec2 uCenter; +uniform vec2 uRadii; + +uniform vec4 uInputSize; + +const float MAX_KERNEL_SIZE = \${MAX_KERNEL_SIZE}; + +// author: http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/ +highp float rand(vec2 co, float seed) { + const highp float a = 12.9898, b = 78.233, c = 43758.5453; + highp float dt = dot(co + seed, vec2(a, b)), sn = mod(dt, 3.14159); + return fract(sin(sn) * c + seed); +} + +void main() { + float minGradient = uRadii[0] * 0.3; + float innerRadius = (uRadii[0] + minGradient * 0.5) / uInputSize.x; + + float gradient = uRadii[1] * 0.3; + float radius = (uRadii[1] - gradient * 0.5) / uInputSize.x; + + float countLimit = MAX_KERNEL_SIZE; + + vec2 dir = vec2(uCenter.xy / uInputSize.xy - vTextureCoord); + float dist = length(vec2(dir.x, dir.y * uInputSize.y / uInputSize.x)); + + float strength = uStrength; + + float delta = 0.0; + float gap; + if (dist < innerRadius) { + delta = innerRadius - dist; + gap = minGradient; + } else if (radius >= 0.0 && dist > radius) { // radius < 0 means it's infinity + delta = dist - radius; + gap = gradient; + } + + if (delta > 0.0) { + float normalCount = gap / uInputSize.x; + delta = (normalCount - delta) / normalCount; + countLimit *= delta; + strength *= delta; + if (countLimit < 1.0) + { + gl_FragColor = texture(uTexture, vTextureCoord); + return; + } + } + + // randomize the lookup values to hide the fixed number of samples + float offset = rand(vTextureCoord, 0.0); + + float total = 0.0; + vec4 color = vec4(0.0); + + dir *= strength; + + for (float t = 0.0; t < MAX_KERNEL_SIZE; t++) { + float percent = (t + offset) / MAX_KERNEL_SIZE; + float weight = 4.0 * (percent - percent * percent); + vec2 p = vTextureCoord + dir * percent; + vec4 sample = texture(uTexture, p); + + // switch to pre-multiplied alpha to correctly blur transparent images + // sample.rgb *= sample.a; + + color += sample * weight; + total += weight; + + if (t > countLimit){ + break; + } + } + + color /= total; + // switch back from pre-multiplied alpha + // color.rgb /= color.a + 0.00001; + + gl_FragColor = color; +} +`,ua=`struct ZoomBlurUniforms { + uStrength:f32, + uCenter:vec2, + uRadii:vec2, +}; + +struct GlobalFilterUniforms { + uInputSize:vec4, + uInputPixel:vec4, + uInputClamp:vec4, + uOutputFrame:vec4, + uGlobalFrame:vec4, + uOutputTexture:vec4, +}; + +@group(0) @binding(0) var gfu: GlobalFilterUniforms; + +@group(0) @binding(1) var uTexture: texture_2d; +@group(0) @binding(2) var uSampler: sampler; +@group(1) @binding(0) var zoomBlurUniforms : ZoomBlurUniforms; + +@fragment +fn mainFragment( + @builtin(position) position: vec4, + @location(0) uv : vec2 +) -> @location(0) vec4 { + let uStrength = zoomBlurUniforms.uStrength; + let uCenter = zoomBlurUniforms.uCenter; + let uRadii = zoomBlurUniforms.uRadii; + + let minGradient: f32 = uRadii[0] * 0.3; + let innerRadius: f32 = (uRadii[0] + minGradient * 0.5) / gfu.uInputSize.x; + + let gradient: f32 = uRadii[1] * 0.3; + let radius: f32 = (uRadii[1] - gradient * 0.5) / gfu.uInputSize.x; + + let MAX_KERNEL_SIZE: f32 = \${MAX_KERNEL_SIZE}; + + var countLimit: f32 = MAX_KERNEL_SIZE; + + var dir: vec2 = vec2(uCenter / gfu.uInputSize.xy - uv); + let dist: f32 = length(vec2(dir.x, dir.y * gfu.uInputSize.y / gfu.uInputSize.x)); + + var strength: f32 = uStrength; + + var delta: f32 = 0.0; + var gap: f32; + + if (dist < innerRadius) { + delta = innerRadius - dist; + gap = minGradient; + } else if (radius >= 0.0 && dist > radius) { // radius < 0 means it's infinity + delta = dist - radius; + gap = gradient; + } + + var returnColorOnly: bool = false; + + if (delta > 0.0) { + let normalCount: f32 = gap / gfu.uInputSize.x; + delta = (normalCount - delta) / normalCount; + countLimit *= delta; + strength *= delta; + + if (countLimit < 1.0) + { + returnColorOnly = true;; + } + } + + // randomize the lookup values to hide the fixed number of samples + let offset: f32 = rand(uv, 0.0); + + var total: f32 = 0.0; + var color: vec4 = vec4(0.); + + dir *= strength; + + for (var t = 0.0; t < MAX_KERNEL_SIZE; t += 1.0) { + let percent: f32 = (t + offset) / MAX_KERNEL_SIZE; + let weight: f32 = 4.0 * (percent - percent * percent); + let p: vec2 = uv + dir * percent; + let sample: vec4 = textureSample(uTexture, uSampler, p); + + if (t < countLimit) + { + color += sample * weight; + total += weight; + } + } + + color /= total; + + return select(color, textureSample(uTexture, uSampler, uv), returnColorOnly); +} + +fn modulo(x: f32, y: f32) -> f32 +{ + return x - y * floor(x/y); +} + +// author: http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/ +fn rand(co: vec2, seed: f32) -> f32 +{ + let a: f32 = 12.9898; + let b: f32 = 78.233; + let c: f32 = 43758.5453; + let dt: f32 = dot(co + seed, vec2(a, b)); + let sn: f32 = modulo(dt, 3.14159); + return fract(sin(sn) * c + seed); +}`,la=Object.defineProperty,nt=Object.getOwnPropertySymbols,aa=Object.prototype.hasOwnProperty,sa=Object.prototype.propertyIsEnumerable,We=(r,e,n)=>e in r?la(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,rt=(r,e)=>{for(var n in e||(e={}))aa.call(e,n)&&We(r,n,e[n]);if(nt)for(var n of nt(e))sa.call(e,n)&&We(r,n,e[n]);return r},tt=(r,e,n)=>(We(r,typeof e!="symbol"?e+"":e,n),n);const ot=class Dt extends s{constructor(e){var n;e=rt(rt({},Dt.DEFAULT_OPTIONS),e);const t=(n=e.maxKernelSize)!=null?n:32,o=f.from({vertex:{source:p,entryPoint:"mainVertex"},fragment:{source:ua.replace("${MAX_KERNEL_SIZE}",t.toFixed(1)),entryPoint:"mainFragment"}}),i=c.from({vertex:m,fragment:ia.replace("${MAX_KERNEL_SIZE}",t.toFixed(1)),name:"zoom-blur-filter"});super({gpuProgram:o,glProgram:i,resources:{zoomBlurUniforms:{uStrength:{value:e.strength,type:"f32"},uCenter:{value:e.center,type:"vec2"},uRadii:{value:new Float32Array(2),type:"vec2"}}}}),tt(this,"uniforms"),this.uniforms=this.resources.zoomBlurUniforms.uniforms,Object.assign(this,e)}get strength(){return this.uniforms.uStrength}set strength(e){this.uniforms.uStrength=e}get center(){return this.uniforms.uCenter}set center(e){Array.isArray(e)&&(e={x:e[0],y:e[1]}),this.uniforms.uCenter=e}get centerX(){return this.uniforms.uCenter.x}set centerX(e){this.uniforms.uCenter.x=e}get centerY(){return this.uniforms.uCenter.y}set centerY(e){this.uniforms.uCenter.y=e}get innerRadius(){return this.uniforms.uRadii[0]}set innerRadius(e){this.uniforms.uRadii[0]=e}get radius(){return this.uniforms.uRadii[1]}set radius(e){this.uniforms.uRadii[1]=e<0||e===1/0?-1:e}};tt(ot,"DEFAULT_OPTIONS",{strength:.1,center:{x:0,y:0},innerRadius:0,radius:-1,maxKernelSize:32});let fa=ot;export{no as AdjustmentFilter,bo as AdvancedBloomFilter,_o as AsciiFilter,Ro as BackdropBlurFilter,ko as BevelFilter,Xo as BloomFilter,Zo as BulgePinchFilter,Bi as CRTFilter,si as ColorGradientFilter,gi as ColorMapFilter,bi as ColorOverlayFilter,_i as ColorReplaceFilter,Ri as ConvolutionFilter,Mi as CrossHatchFilter,qi as DotFilter,nu as DropShadowFilter,lu as EmbossFilter,vu as GlitchFilter,Su as GlowFilter,wu as GodrayFilter,Iu as GrayscaleFilter,Eu as HslAdjustmentFilter,oe as KawaseBlurFilter,Nu as MotionBlurFilter,qu as MultiColorReplaceFilter,nl as OldFilmFilter,ll as OutlineFilter,fl as PixelateFilter,wl as RGBSplitFilter,dl as RadialBlurFilter,Cl as ReflectionFilter,Dl as ShockwaveFilter,jl as SimpleLightmapFilter,Q as TiltShiftAxisFilter,Ql as TiltShiftFilter,oa as TwistFilter,fa as ZoomBlurFilter,En as angleFromCssOrientation,Ln as angleFromDirectionalValue,$n as colorAsStringFromCssStop,Mn as offsetsFromCssColorStops,Un as parseCssGradient,Dn as stopsFromCssStops,kn as trimCssGradient,Rn as typeFromCssType,m as vertex,p as wgslVertex}; +//# sourceMappingURL=pixi-filters.mjs.map diff --git a/dist/pixi-filters.mjs.map b/dist/pixi-filters.mjs.map new file mode 100644 index 000000000..ac5b7b782 --- /dev/null +++ b/dist/pixi-filters.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"pixi-filters.mjs","sources":["../src/adjustment/AdjustmentFilter.ts","../src/kawase-blur/KawaseBlurFilter.ts","../src/advanced-bloom/ExtractBrightnessFilter.ts","../src/advanced-bloom/AdvancedBloomFilter.ts","../src/ascii/AsciiFilter.ts","../src/backdrop-blur/BackdropBlurFilter.ts","../src/bevel/BevelFilter.ts","../src/bloom/BloomFilter.ts","../src/bulge-pinch/BulgePinchFilter.ts","../node_modules/gradient-parser/build/node.js","../src/color-gradient/CssGradientParser.ts","../src/color-gradient/ColorGradientFilter.ts","../src/color-map/ColorMapFilter.ts","../src/color-overlay/ColorOverlayFilter.ts","../src/color-replace/ColorReplaceFilter.ts","../src/convolution/ConvolutionFilter.ts","../src/cross-hatch/CrossHatchFilter.ts","../src/crt/CRTFilter.ts","../src/dot/DotFilter.ts","../src/drop-shadow/DropShadowFilter.ts","../src/emboss/EmbossFilter.ts","../src/glitch/GlitchFilter.ts","../src/glow/GlowFilter.ts","../src/godray/GodrayFilter.ts","../src/grayscale/GrayscaleFilter.ts","../src/hsl-adjustment/HslAdjustmentFilter.ts","../src/motion-blur/MotionBlurFilter.ts","../src/multi-color-replace/MultiColorReplaceFilter.ts","../src/old-film/OldFilmFilter.ts","../src/outline/OutlineFilter.ts","../src/pixelate/PixelateFilter.ts","../src/radial-blur/RadialBlurFilter.ts","../src/reflection/ReflectionFilter.ts","../src/rgb-split/RGBSplitFilter.ts","../src/shockwave/ShockwaveFilter.ts","../src/simple-lightmap/SimpleLightmapFilter.ts","../src/tilt-shift/TiltShiftAxisFilter.ts","../src/tilt-shift/TiltShiftFilter.ts","../src/twist/TwistFilter.ts","../src/zoom-blur/ZoomBlurFilter.ts"],"sourcesContent":["import { Filter, GlProgram, GpuProgram } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './adjustment.frag';\nimport source from './adjustment.wgsl';\n\n/** Options for the AdjustmentFilter constructor */\nexport interface AdjustmentFilterOptions\n{\n /**\n * The amount of luminance\n * @default 1\n */\n gamma?: number;\n /**\n * The amount of contrast\n * @default 1\n */\n contrast?: number;\n /**\n * The amount of color saturation\n * @default 1\n */\n saturation?: number;\n /**\n * The overall brightness\n * @default 1\n */\n brightness?: number;\n /**\n * The multiplied red channel\n * @default 1\n */\n red?: number;\n /**\n * The multiplied green channel\n * @default 1\n */\n green?: number;\n /**\n * The multiplied blue channel\n * @default 1\n */\n blue?: number;\n /**\n * The overall alpha channel\n * @default 1\n */\n alpha?: number;\n}\n\n/**\n * The ability to adjust gamma, contrast, saturation, brightness, alpha or color-channel shift.\n * This is a faster and much simpler to use than\n * {@link http://pixijs.download/release/docs/ColorMatrixFilter.html ColorMatrixFilter}\n * because it does not use a matrix.
\n * ![original](../screenshots/original.png)![filter](../screenshots/adjustment.png)\n *\n * @class\n * @extends Filter\n */\nexport class AdjustmentFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: AdjustmentFilterOptions = {\n gamma: 1,\n contrast: 1,\n saturation: 1,\n brightness: 1,\n red: 1,\n green: 1,\n blue: 1,\n alpha: 1,\n };\n\n public uniforms: {\n uGamma: number;\n uContrast: number;\n uSaturation: number;\n uBrightness: number;\n uColor: Float32Array;\n };\n\n /**\n * @param options - The options of the adjustment filter.\n */\n constructor(options?: AdjustmentFilterOptions)\n {\n options = { ...AdjustmentFilter.DEFAULT_OPTIONS, ...options };\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'adjustment-filter'\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n adjustmentUniforms: {\n uGamma: { value: options.gamma, type: 'f32' },\n uContrast: { value: options.contrast, type: 'f32' },\n uSaturation: { value: options.saturation, type: 'f32' },\n uBrightness: { value: options.brightness, type: 'f32' },\n uColor: {\n value: [\n options.red,\n options.green,\n options.blue,\n options.alpha,\n ],\n type: 'vec4',\n },\n }\n },\n });\n\n this.uniforms = this.resources.adjustmentUniforms.uniforms;\n }\n\n /**\n * Amount of luminance\n * @default 1\n */\n get gamma(): number { return this.uniforms.uGamma; }\n set gamma(value: number) { this.uniforms.uGamma = value; }\n\n /**\n * Amount of contrast\n * @default 1\n */\n get contrast(): number { return this.uniforms.uContrast; }\n set contrast(value: number) { this.uniforms.uContrast = value; }\n\n /**\n * Amount of color saturation\n * @default 1\n */\n get saturation(): number { return this.uniforms.uSaturation; }\n set saturation(value: number) { this.uniforms.uSaturation = value; }\n\n /**\n * The overall brightness\n * @default 1\n */\n get brightness(): number { return this.uniforms.uBrightness; }\n set brightness(value: number) { this.uniforms.uBrightness = value; }\n\n /**\n * The multiplied red channel\n * @default 1\n */\n get red(): number { return this.uniforms.uColor[0]; }\n set red(value: number) { this.uniforms.uColor[0] = value; }\n\n /**\n * The multiplied blue channel\n * @default 1\n */\n get green(): number { return this.uniforms.uColor[1]; }\n set green(value: number) { this.uniforms.uColor[1] = value; }\n\n /**\n * The multiplied green channel\n * @default 1\n */\n get blue(): number { return this.uniforms.uColor[2]; }\n set blue(value: number) { this.uniforms.uColor[2] = value; }\n\n /**\n * The overall alpha channel\n * @default 1\n */\n get alpha(): number { return this.uniforms.uColor[3]; }\n set alpha(value: number) { this.uniforms.uColor[3] = value; }\n}\n","import { deprecation, Filter, GlProgram, GpuProgram, TexturePool } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './kawase-blur.frag';\nimport source from './kawase-blur.wgsl';\nimport fragmentClamp from './kawase-blur-clamp.frag';\nimport sourceClamp from './kawase-blur-clamp.wgsl';\n\nimport type { FilterSystem, PointData, RenderSurface, Texture } from 'pixi.js';\n\n/** Options for the KawaseBlurFilter constructor. */\nexport interface KawaseBlurFilterOptions\n{\n /**\n * The blur of the filter. Should be greater than `0`.\n * If value is an Array, setting kernels.\n * @default 4\n */\n strength?: number | [number, number];\n /**\n * The quality of the filter. Should be an integer greater than `1`\n * @default 3\n */\n quality?: number;\n /**\n * Clamp edges, useful for removing dark edges from fullscreen filters or bleeding to the edge of filterArea.\n * @default false\n */\n clamp?: boolean;\n /**\n * Sets the pixel size of the filter. Large size is blurrier. For advanced usage.\n * @default {x:1,y:1}\n */\n pixelSize?: PointData | number[] | number;\n}\n\n/**\n * A much faster blur than Gaussian blur, but more complicated to use.
\n * ![original](../screenshots/original.png)![filter](../screenshots/kawase-blur.png)\n *\n * @see https://software.intel.com/en-us/blogs/2014/07/15/an-investigation-of-fast-real-time-gpu-based-image-blur-algorithms\n * @class\n * @extends Filter\n */\nexport class KawaseBlurFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: KawaseBlurFilterOptions = {\n strength: 4,\n quality: 3,\n clamp: false,\n pixelSize: { x: 1, y: 1 },\n };\n\n public uniforms: {\n uOffset: Float32Array;\n };\n\n private _pixelSize = { x: 0, y: 0 };\n private _clamp: boolean;\n private _kernels: number[] = [];\n private _blur!: number;\n private _quality!: number;\n\n /**\n * @param options - Options for the KawaseBlurFilter constructor.\n */\n constructor(options?: KawaseBlurFilterOptions);\n /**\n * @deprecated since 6.0.0\n *\n * @param {number|number[]} [blur=4] - The blur of the filter. Should be greater than `0`. If\n * value is an Array, setting kernels.\n * @param {number} [quality=3] - The quality of the filter. Should be an integer greater than `1`.\n * @param {boolean} [clamp=false] - Clamp edges, useful for removing dark edges\n * from fullscreen filters or bleeding to the edge of filterArea.\n */\n constructor(blur?: number | number[], quality?: number, clamp?: boolean);\n /** @ignore */\n constructor(...args: [KawaseBlurFilterOptions?] | [(number | number[])?, number?, boolean?])\n {\n let options = args[0] ?? {};\n\n if (typeof options === 'number' || Array.isArray(options))\n {\n // eslint-disable-next-line max-len\n deprecation('6.0.0', 'KawaseBlurFilter constructor params are now options object. See params: { strength, quality, clamp, pixelSize }');\n\n options = { strength: options as number | [number, number] };\n\n if (args[1] !== undefined) options.quality = args[1];\n if (args[2] !== undefined) options.clamp = args[2];\n }\n\n options = { ...KawaseBlurFilter.DEFAULT_OPTIONS, ...options };\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source: options?.clamp ? sourceClamp : source,\n entryPoint: 'mainFragment',\n },\n });\n const glProgram = GlProgram.from({\n vertex,\n fragment: options?.clamp ? fragmentClamp : fragment,\n name: 'kawase-blur-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n kawaseBlurUniforms: {\n uOffset: { value: new Float32Array(2), type: 'vec2' },\n }\n },\n });\n\n this.uniforms = this.resources.kawaseBlurUniforms.uniforms;\n\n this.pixelSize = options.pixelSize ?? { x: 1, y: 1 };\n\n if (Array.isArray(options.strength))\n {\n this.kernels = options.strength;\n }\n else if (typeof options.strength === 'number')\n {\n this._blur = options.strength;\n this.quality = options.quality ?? 3;\n }\n\n this._clamp = !!options.clamp;\n }\n\n /**\n * Override existing apply method in `Filter`\n * @override\n * @ignore\n */\n public override apply(\n filterManager: FilterSystem,\n input: Texture,\n output: RenderSurface,\n clearMode: boolean\n ): void\n {\n const uvX = this.pixelSizeX / input.source.width;\n const uvY = this.pixelSizeY / input.source.height;\n let offset;\n\n if (this._quality === 1 || this._blur === 0)\n {\n offset = this._kernels[0] + 0.5;\n this.uniforms.uOffset[0] = offset * uvX;\n this.uniforms.uOffset[1] = offset * uvY;\n filterManager.applyFilter(this, input, output, clearMode);\n }\n else\n {\n const renderTarget = TexturePool.getSameSizeTexture(input);\n\n let source = input;\n let target = renderTarget;\n let tmp;\n\n const last = this._quality - 1;\n\n for (let i = 0; i < last; i++)\n {\n offset = this._kernels[i] + 0.5;\n this.uniforms.uOffset[0] = offset * uvX;\n this.uniforms.uOffset[1] = offset * uvY;\n filterManager.applyFilter(this, source, target, true);\n\n tmp = source;\n source = target;\n target = tmp;\n }\n\n offset = this._kernels[last] + 0.5;\n this.uniforms.uOffset[0] = offset * uvX;\n this.uniforms.uOffset[1] = offset * uvY;\n\n filterManager.applyFilter(this, source, output, clearMode);\n TexturePool.returnTexture(renderTarget);\n }\n }\n\n /**\n * The amount of blur, value greater than `0`.\n * @default 4\n */\n get strength(): number { return this._blur; }\n set strength(value: number)\n {\n this._blur = value;\n this._generateKernels();\n }\n\n /**\n * The quality of the filter, integer greater than `1`.\n * @default 3\n */\n get quality(): number { return this._quality; }\n set quality(value: number)\n {\n this._quality = Math.max(1, Math.round(value));\n this._generateKernels();\n }\n\n /**\n * The kernel size of the blur filter, for advanced usage\n * @default [0]\n */\n get kernels(): number[] { return this._kernels; }\n set kernels(value: number[])\n {\n if (Array.isArray(value) && value.length > 0)\n {\n this._kernels = value;\n this._quality = value.length;\n this._blur = Math.max(...value);\n }\n else\n {\n // If value is invalid, set default value\n this._kernels = [0];\n this._quality = 1;\n }\n }\n\n /**\n * The size of the pixels. Large size is blurrier. For advanced usage.\n * @default {x:1,y:1}\n */\n get pixelSize(): PointData { return this._pixelSize; }\n set pixelSize(value: PointData | number[] | number)\n {\n if (typeof value === 'number')\n {\n this.pixelSizeX = this.pixelSizeY = value;\n\n return;\n }\n\n if (Array.isArray(value))\n {\n this.pixelSizeX = value[0];\n this.pixelSizeY = value[1];\n\n return;\n }\n\n this._pixelSize = value;\n }\n\n /**\n * The size of the pixels on the `x` axis. Large size is blurrier. For advanced usage.\n * @default 1\n */\n get pixelSizeX(): number { return this.pixelSize.x; }\n set pixelSizeX(value: number) { this.pixelSize.x = value; }\n\n /**\n * The size of the pixels on the `y` axis. Large size is blurrier. For advanced usage.\n * @default 1\n */\n get pixelSizeY(): number { return this.pixelSize.y; }\n set pixelSizeY(value: number) { this.pixelSize.y = value; }\n\n /**\n * Get the if the filter is clamped\n * @default false\n */\n get clamp(): boolean { return this._clamp; }\n\n /** Update padding based on kernel data */\n private _updatePadding()\n {\n this.padding = Math.ceil(this._kernels.reduce((acc, v) => acc + v + 0.5, 0));\n }\n\n /** Auto generate kernels by blur & quality */\n private _generateKernels()\n {\n const blur = this._blur;\n const quality = this._quality;\n const kernels: number[] = [blur];\n\n if (blur > 0)\n {\n let k = blur;\n const step = blur / quality;\n\n for (let i = 1; i < quality; i++)\n {\n k -= step;\n kernels.push(k);\n }\n }\n\n this._kernels = kernels;\n this._updatePadding();\n }\n}\n","import { Filter, GlProgram, GpuProgram } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './extract-brightness.frag';\nimport source from './extract-brightness.wgsl';\n\nexport interface ExtractBrightnessFilterOptions\n{\n /**\n * Defines how bright a color needs to be extracted.\n */\n threshold?: number;\n}\n\n/**\n * Internal filter for retrieving the brightness of the source image.\n * @class\n * @private\n */\nexport class ExtractBrightnessFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: ExtractBrightnessFilterOptions = {\n threshold: 0.5\n };\n\n public uniforms: {\n uThreshold: number;\n };\n\n constructor(options?: ExtractBrightnessFilterOptions)\n {\n options = { ...ExtractBrightnessFilter.DEFAULT_OPTIONS, ...options };\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'extract-brightness-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n extractBrightnessUniforms: {\n uThreshold: { value: options.threshold, type: 'f32' },\n }\n },\n });\n\n this.uniforms = this.resources.extractBrightnessUniforms.uniforms;\n }\n\n /**\n * Defines how bright a color needs to be extracted.\n * @default 0.5\n */\n get threshold(): number { return this.uniforms.uThreshold; }\n set threshold(value: number) { this.uniforms.uThreshold = value; }\n}\n","import {\n Filter,\n FilterSystem,\n GlProgram,\n GpuProgram,\n PointData,\n RenderSurface,\n Texture,\n TexturePool,\n} from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport { KawaseBlurFilter } from '../kawase-blur/KawaseBlurFilter';\nimport fragment from './advanced-bloom.frag';\nimport source from './advanced-bloom.wgsl';\nimport { ExtractBrightnessFilter } from './ExtractBrightnessFilter';\n\n/** Options for the AdvancedBloomFilter constructor. */\nexport interface AdvancedBloomFilterOptions\n{\n /**\n * Defines how bright a color needs to be to affect bloom.\n * @default 1\n */\n threshold?: number,\n /**\n * To adjust the strength of the bloom. Higher values is more intense brightness.\n * @default 1\n */\n bloomScale?: number,\n /**\n * The brightness, lower value is more subtle brightness, higher value is blown-out.\n * @default 1\n */\n brightness?: number,\n /** The strength of the Blur properties simultaneously */\n blur?: number,\n /**\n * The kernel size of the blur filter.\n */\n kernels?: number[],\n /** The quality of the Blur filter. */\n quality?: number,\n /**\n * The pixel size of the blur filter. Large size is blurrier. For advanced usage.\n * @default {x:1,y:1}\n */\n pixelSize?: PointData | number[] | number,\n}\n\n/**\n * The AdvancedBloomFilter applies a Bloom Effect to an object. Unlike the normal BloomFilter\n * this had some advanced controls for adjusting the look of the bloom. Note: this filter\n * is slower than normal BloomFilter.
\n * ![original](../screenshots/original.png)![filter](../screenshots/advanced-bloom.png)\n *\n * @class\n * @extends Filter\n */\nexport class AdvancedBloomFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: AdvancedBloomFilterOptions = {\n threshold: 0.5,\n bloomScale: 1,\n brightness: 1,\n blur: 8,\n quality: 4,\n pixelSize: { x: 1, y: 1 },\n };\n\n public uniforms: {\n uBloomScale: number;\n uBrightness: number;\n };\n\n /** To adjust the strength of the bloom. Higher values is more intense brightness. */\n public bloomScale = 1;\n\n /** The brightness, lower value is more subtle brightness, higher value is blown-out. */\n public brightness = 1;\n\n private _extractFilter: ExtractBrightnessFilter;\n private _blurFilter: KawaseBlurFilter;\n\n /**\n * @param options - Options for the AdvancedBloomFilter constructor.\n */\n constructor(options?: AdvancedBloomFilterOptions)\n {\n options = { ...AdvancedBloomFilter.DEFAULT_OPTIONS, ...options };\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'advanced-bloom-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n advancedBloomUniforms: {\n uBloomScale: { value: options.bloomScale, type: 'f32' },\n uBrightness: { value: options.brightness, type: 'f32' },\n },\n uMapTexture: Texture.WHITE,\n },\n });\n\n this.uniforms = this.resources.advancedBloomUniforms.uniforms;\n\n this._extractFilter = new ExtractBrightnessFilter({\n threshold: options.threshold\n });\n\n this._blurFilter = new KawaseBlurFilter({\n strength: options.kernels as [number, number] ?? options.blur,\n quality: options.kernels ? undefined : options.quality,\n });\n\n Object.assign(this, options);\n }\n\n /**\n * Override existing apply method in `Filter`\n * @override\n * @ignore\n */\n public override apply(\n filterManager: FilterSystem,\n input: Texture,\n output: RenderSurface,\n clearMode: boolean\n ): void\n {\n const brightTarget = TexturePool.getSameSizeTexture(input);\n\n this._extractFilter.apply(filterManager, input, brightTarget, true);\n\n const bloomTarget = TexturePool.getSameSizeTexture(input);\n\n this._blurFilter.apply(filterManager, brightTarget, bloomTarget, true);\n\n this.uniforms.uBloomScale = this.bloomScale;\n this.uniforms.uBrightness = this.brightness;\n\n this.resources.uMapTexture = bloomTarget.source;\n\n filterManager.applyFilter(this, input, output, clearMode);\n\n TexturePool.returnTexture(bloomTarget);\n TexturePool.returnTexture(brightTarget);\n }\n\n /**\n * Defines how bright a color needs to be extracted.\n * @default 0.5\n */\n get threshold(): number { return this._extractFilter.threshold; }\n set threshold(value: number) { this._extractFilter.threshold = value; }\n\n /** The kernels of the Blur Filter */\n get kernels(): number[] { return this._blurFilter.kernels; }\n set kernels(value: number[]) { this._blurFilter.kernels = value; }\n\n /**\n * The strength of the Blur properties simultaneously\n * @default 2\n */\n get blur(): number { return this._blurFilter.strength; }\n set blur(value: number) { this._blurFilter.strength = value; }\n\n /**\n * The quality of the Blur Filter\n * @default 4\n */\n get quality(): number { return this._blurFilter.quality; }\n set quality(value: number) { this._blurFilter.quality = value; }\n\n /**\n * The pixel size of the Kawase Blur filter\n * @default {x:1,y:1}\n */\n get pixelSize(): PointData { return this._blurFilter.pixelSize; }\n set pixelSize(value: PointData | number[] | number)\n {\n if (typeof value === 'number')\n {\n value = { x: value, y: value };\n }\n\n if (Array.isArray(value))\n {\n value = { x: value[0], y: value[1] };\n }\n\n this._blurFilter.pixelSize = value;\n }\n\n /**\n * The horizontal pixelSize of the Kawase Blur filter\n * @default 1\n */\n get pixelSizeX(): number { return this._blurFilter.pixelSizeX; }\n set pixelSizeX(value: number) { this._blurFilter.pixelSizeX = value; }\n\n /**\n * The vertical pixel size of the Kawase Blur filter\n * @default 1\n */\n get pixelSizeY(): number { return this._blurFilter.pixelSizeY; }\n set pixelSizeY(value: number) { this._blurFilter.pixelSizeY = value; }\n}\n","import { Color, ColorSource, deprecation, Filter, GlProgram, GpuProgram } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './ascii.frag';\nimport source from './ascii.wgsl';\n\n// This WebGPU filter has been ported from the WebGL renderer that was originally created by Vico (@vicocotea)\n\n/** Options for AsciiFilter constructor. */\nexport interface AsciiFilterOptions\n{\n /**\n * The pixel size used by the filter\n * @default 8\n */\n size?: number;\n /**\n * A color to set the ascii characters to. If not set, the color will be taken from the source.\n * @example [1.0, 1.0, 1.0] = 0xffffff\n * @default 0x000000\n */\n color?: ColorSource;\n /**\n * Determine whether or not to replace the source colors with the provided.\n *\n * Will automatically be assigned to `true` if `color` is provided.\n * Set `replaceColor` to `false` to prevent that.\n * @default false\n */\n replaceColor?: boolean;\n}\n\n/**\n * An ASCII filter.
\n * ![original](../screenshots/original.png)![filter](../screenshots/ascii.png)\n *\n * @class\n * @extends Filter\n */\nexport class AsciiFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: AsciiFilterOptions = {\n size: 8,\n color: 0xffffff,\n replaceColor: false,\n };\n\n public uniforms: {\n uSize: number;\n uColor: Float32Array;\n uReplaceColor: number;\n };\n\n private _color!: Color;\n\n /**\n * Constructor.\n * @param {AsciiFilterOptions} options - The options of the ASCII filter.\n */\n constructor(options?: AsciiFilterOptions);\n /**\n * @deprecated since 6.0.0\n *\n * @param {number} [size=8] - Size of the font\n */\n constructor(size: number);\n /** @ignore */\n constructor(...args: [AsciiFilterOptions?] | [number])\n {\n let options = args[0] ?? {};\n\n if (typeof options === 'number')\n {\n // eslint-disable-next-line max-len\n deprecation('6.0.0', 'AsciiFilter constructor params are now options object. See params: { size, color, replaceColor }');\n\n options = { size: options };\n }\n\n const replaceColor = options?.color && options.replaceColor !== false;\n\n options = { ...AsciiFilter.DEFAULT_OPTIONS, ...options } as AsciiFilterOptions;\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'ascii-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n asciiUniforms: {\n uSize: { value: options.size, type: 'f32' },\n uColor: { value: new Float32Array(3), type: 'vec3' },\n uReplaceColor: { value: Number(replaceColor), type: 'f32' },\n },\n },\n });\n\n this.uniforms = this.resources.asciiUniforms.uniforms;\n this._color = new Color();\n this.color = options.color ?? 0xffffff;\n }\n\n /**\n * The pixel size used by the filter.\n * @default 8\n */\n get size(): number { return this.uniforms.uSize; }\n set size(value: number) { this.uniforms.uSize = value; }\n\n /**\n * The resulting color of the ascii characters, as a 3 component RGB or numerical hex\n * @example [1.0, 1.0, 1.0] = 0xffffff\n * @default 0xffffff\n */\n get color(): ColorSource { return this._color.value as ColorSource; }\n set color(value: ColorSource)\n {\n this._color.setValue(value);\n const [r, g, b] = this._color.toArray();\n\n this.uniforms.uColor[0] = r;\n this.uniforms.uColor[1] = g;\n this.uniforms.uColor[2] = b;\n }\n\n /**\n * Determine whether or not to replace the source colors with the provided.\n */\n get replaceColor(): boolean { return this.uniforms.uReplaceColor > 0.5; }\n set replaceColor(value: boolean) { this.uniforms.uReplaceColor = value ? 1 : 0; }\n}\n","import {\n BlurFilter,\n BlurFilterOptions,\n Filter,\n FilterSystem,\n GlProgram,\n GpuProgram,\n RenderSurface,\n Texture,\n TexturePool,\n} from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './backdrop-blur-blend.frag';\nimport wgslFragment from './backdrop-blur-blend.wgsl';\n\n/**\n * The BackdropBlurFilter applies a Gaussian blur to everything behind an object, and then draws the object on top of it.
\n * ![original](../screenshots/original.png)![filter](../screenshots/backdrop-blur.png)\n *\n * @class\n * @extends BlurFilter\n */\nexport class BackdropBlurFilter extends BlurFilter\n{\n private _blendPass: Filter;\n\n /**\n * @param options - The options of the blur filter.\n */\n constructor(options?: BlurFilterOptions)\n {\n super(options);\n\n this.blendRequired = true;\n this.padding = 0;\n\n this._blendPass = new Filter({\n gpuProgram: GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source: wgslFragment,\n entryPoint: 'mainFragment',\n },\n }),\n glProgram: GlProgram.from({\n vertex,\n fragment,\n name: 'drop-shadow-filter',\n }),\n resources: {\n uBackground: Texture.EMPTY,\n },\n });\n }\n\n /**\n * Override existing apply method in `Filter`\n * @override\n * @ignore\n */\n public apply(\n filterManager: FilterSystem,\n input: Texture,\n output: RenderSurface,\n clearMode: boolean\n ): void\n {\n // @ts-expect-error - this should probably not be grabbed from a private property\n const backTexture = filterManager._activeFilterData.backTexture;\n\n const blurredBackground = TexturePool.getSameSizeTexture(input);\n\n super.apply(filterManager, backTexture, blurredBackground, true);\n\n this._blendPass.resources.uBackground = blurredBackground.source;\n this._blendPass.apply(filterManager, input, output, clearMode);\n\n TexturePool.returnTexture(blurredBackground);\n }\n\n protected updatePadding(): void\n {\n this.padding = 0;\n }\n}\n","import { Color, ColorSource, DEG_TO_RAD, Filter, GlProgram, GpuProgram } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './bevel.frag';\nimport source from './bevel.wgsl';\n\n/** Options for the BevelFilter constructor. */\nexport interface BevelFilterOptions\n{\n /**\n * The angle of the light in degrees\n * @default 45\n */\n rotation?: number,\n /**\n * The thickness of the bevel\n * @default 2\n */\n thickness?: number,\n /**\n * The color value of the left & top bevel.\n * @example [1.0, 1.0, 1.0] = 0xffffff\n * @default 0xffffff\n */\n lightColor?: ColorSource,\n /**\n * The alpha value of the left & top bevel.\n * @default 0.7\n */\n lightAlpha?: number,\n /**\n * The color value of the right & bottom bevel.\n * @example [1.0, 1.0, 1.0] = 0xffffff\n * @default 0x000000\n */\n shadowColor?: ColorSource,\n /**\n * The alpha value of the right & bottom bevel.\n * @default 0.7\n */\n shadowAlpha?: number,\n}\n\n/**\n * Bevel Filter.
\n * ![original](../screenshots/original.png)![filter](../screenshots/bevel.png)\n *\n * @class\n * @extends Filter\n */\nexport class BevelFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: BevelFilterOptions = {\n rotation: 45,\n thickness: 2,\n lightColor: 0xffffff,\n lightAlpha: 0.7,\n shadowColor: 0x000000,\n shadowAlpha: 0.7,\n };\n\n public uniforms: {\n uLightColor: Float32Array;\n uLightAlpha: number;\n uShadowColor: Float32Array;\n uShadowAlpha: number;\n uTransform: Float32Array;\n };\n\n private _thickness!: number;\n private _rotation!: number;\n private _lightColor: Color;\n private _shadowColor: Color;\n\n /**\n * @param options - Options for the BevelFilter constructor.\n */\n constructor(options?: BevelFilterOptions)\n {\n options = { ...BevelFilter.DEFAULT_OPTIONS, ...options };\n\n const rotation = (options.rotation ?? 45) * DEG_TO_RAD;\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'bevel-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n bevelUniforms: {\n uLightColor: { value: new Float32Array(3), type: 'vec3' },\n uLightAlpha: { value: options.lightAlpha, type: 'f32' },\n uShadowColor: { value: new Float32Array(3), type: 'vec3' },\n uShadowAlpha: { value: options.shadowAlpha, type: 'f32' },\n uTransform: { value: new Float32Array(2), type: 'vec2' },\n }\n },\n // Workaround: https://github.com/pixijs/filters/issues/230\n // applies correctly only if there is at least a single-pixel padding with alpha=0 around an image\n // To solve this problem, a padding of 1 put on the filter should suffice\n padding: 1,\n });\n\n this.uniforms = this.resources.bevelUniforms.uniforms;\n this._lightColor = new Color();\n this._shadowColor = new Color();\n this.lightColor = options.lightColor ?? 0xffffff;\n this.shadowColor = options.shadowColor ?? 0x000000;\n\n Object.assign(this, options, { rotation });\n }\n\n /**\n * The angle of the light in degrees\n * @default 45\n */\n get rotation(): number { return this._rotation / DEG_TO_RAD; }\n set rotation(value: number)\n {\n this._rotation = value * DEG_TO_RAD;\n this._updateTransform();\n }\n\n /**\n * The thickness of the bevel\n * @default 2\n */\n get thickness(): number { return this._thickness; }\n set thickness(value: number)\n {\n this._thickness = value;\n this._updateTransform();\n }\n\n /**\n * The color value of the left & top bevel.\n * @example [1.0, 1.0, 1.0] = 0xffffff\n * @default 0xffffff\n */\n get lightColor(): ColorSource { return this._lightColor.value as ColorSource; }\n set lightColor(value: ColorSource)\n {\n this._lightColor.setValue(value);\n const [r, g, b] = this._lightColor.toArray();\n\n this.uniforms.uLightColor[0] = r;\n this.uniforms.uLightColor[1] = g;\n this.uniforms.uLightColor[2] = b;\n }\n\n /**\n * The alpha value of the left & top bevel.\n * @default 0.7\n */\n get lightAlpha(): number { return this.uniforms.uLightAlpha; }\n set lightAlpha(value: number) { this.uniforms.uLightAlpha = value; }\n\n /**\n * The color value of the right & bottom bevel.\n * @default 0xffffff\n */\n get shadowColor(): ColorSource { return this._shadowColor.value as ColorSource; }\n set shadowColor(value: ColorSource)\n {\n this._shadowColor.setValue(value);\n const [r, g, b] = this._shadowColor.toArray();\n\n this.uniforms.uShadowColor[0] = r;\n this.uniforms.uShadowColor[1] = g;\n this.uniforms.uShadowColor[2] = b;\n }\n\n /**\n * The alpha value of the right & bottom bevel.\n * @default 0.7\n */\n get shadowAlpha(): number { return this.uniforms.uShadowAlpha; }\n set shadowAlpha(value: number) { this.uniforms.uShadowAlpha = value; }\n\n /**\n * Update the transform matrix of offset angle.\n * @private\n */\n private _updateTransform()\n {\n this.uniforms.uTransform[0] = this.thickness * Math.cos(this._rotation);\n this.uniforms.uTransform[1] = this.thickness * Math.sin(this._rotation);\n }\n}\n","/* eslint-disable max-len */\nimport {\n AlphaFilter,\n BlurFilterPass,\n deprecation,\n FilterSystem,\n PointData,\n RenderSurface,\n Texture,\n TexturePool,\n} from 'pixi.js';\n\ntype DeprecatedBlurValue = number | PointData | number[];\n\n/** Options for the BloomFilter constructor. */\nexport interface BloomFilterOptions\n{\n /**\n * Sets the strength of the blur. If only a number is provided, it will assign to both x and y.\n * @default {x:2,y:2}\n */\n strength?: PointData | number;\n /**\n * The quality of the blur.\n * @default 4\n */\n quality?: number;\n /**\n * The resolution of the blurX & blurY filter.\n * @default 1\n */\n resolution?: number;\n /**\n * The kernel size of the blur filter. Must be an odd number between 5 and 15 (inclusive).\n * @default 5\n */\n kernelSize?: number;\n}\n\n/**\n * The BloomFilter applies a Gaussian blur to an object.\n * The strength of the blur can be set for x- and y-axis separately.
\n * ![original](../screenshots/original.png)![filter](../screenshots/bloom.png)\n *\n * @class\n * @extends Filter\n */\nexport class BloomFilter extends AlphaFilter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: BloomFilterOptions = {\n strength: { x: 2, y: 2 },\n quality: 4,\n resolution: 1,\n kernelSize: 5\n };\n\n private _blurXFilter: BlurFilterPass;\n private _blurYFilter: BlurFilterPass;\n private _strength: PointData;\n\n /**\n * @param {BloomFilterOptions} options - Options for the BloomFilter constructor.\n */\n constructor(options?: BloomFilterOptions);\n /**\n * @deprecated since 6.0.0\n *\n * @param {number|PIXI.PointData|number[]} [blur=2] - Sets the strength of both the blurX and blurY properties simultaneously\n * @param {number} [quality=4] - The quality of the blurX & blurY filter.\n * @param {number} [resolution=1] - The resolution of the blurX & blurY filter.\n * @param {number} [kernelSize=5] - The kernelSize of the blurX & blurY filter.Options: 5, 7, 9, 11, 13, 15.\n */\n constructor(blur?: DeprecatedBlurValue, quality?: number, resolution?: number, kernelSize?: number);\n /** @ignore */\n constructor(...args: [BloomFilterOptions?] | [DeprecatedBlurValue?, number?, number?, number?])\n {\n let options = args[0] ?? {};\n\n if (typeof options === 'number' || Array.isArray(options) || ('x' in options && 'y' in options))\n {\n // eslint-disable-next-line max-len\n deprecation('6.0.0', 'BloomFilter constructor params are now options object. See params: { strength, quality, resolution, kernelSize }');\n\n let strength = options;\n\n if (Array.isArray(strength)) strength = { x: strength[0], y: strength[1] };\n\n options = { strength };\n\n if (args[1] !== undefined) options.quality = args[1];\n if (args[2] !== undefined) options.resolution = args[2];\n if (args[3] !== undefined) options.kernelSize = args[3];\n }\n\n options = { ...BloomFilter.DEFAULT_OPTIONS, ...options } as BloomFilterOptions;\n\n super();\n\n this._strength = { x: 2, y: 2 };\n\n if (options.strength)\n {\n if (typeof options.strength === 'number')\n {\n this._strength.x = options.strength;\n this._strength.y = options.strength;\n }\n else\n {\n this._strength.x = options.strength.x;\n this._strength.y = options.strength.y;\n }\n }\n\n this._blurXFilter = new BlurFilterPass({\n ...options,\n horizontal: true,\n strength: this.strengthX,\n });\n\n this._blurYFilter = new BlurFilterPass({\n ...options,\n horizontal: false,\n strength: this.strengthY,\n });\n\n this._blurYFilter.blendMode = 'screen';\n\n Object.assign(this, options);\n }\n\n /**\n * Override existing apply method in `Filter`\n * @override\n * @ignore\n */\n public override apply(\n filterManager: FilterSystem,\n input: Texture,\n output: RenderSurface,\n clear: boolean,\n ): void\n {\n const renderTarget = TexturePool.getSameSizeTexture(input);\n\n filterManager.applyFilter(this, input, output, clear);\n this._blurXFilter.apply(filterManager, input, renderTarget, true);\n this._blurYFilter.apply(filterManager, renderTarget, output, false);\n\n TexturePool.returnTexture(renderTarget);\n }\n\n /**\n * Sets the strength of both the blurX and blurY properties simultaneously\n * @default 2\n */\n get strength(): PointData { return this._strength; }\n set strength(value: PointData | number)\n {\n this._strength = typeof value === 'number' ? { x: value, y: value } : value;\n this._updateStrength();\n }\n\n /**\n * Sets the strength of the blur on the `x` axis\n * @default 2\n */\n get strengthX(): number { return this.strength.x; }\n set strengthX(value: number)\n {\n this.strength.x = value;\n this._updateStrength();\n }\n\n /**\n * Sets the strength of the blur on the `y` axis\n * @default 2\n */\n get strengthY(): number { return this.strength.y; }\n set strengthY(value: number)\n {\n this.strength.y = value;\n this._updateStrength();\n }\n\n private _updateStrength()\n {\n this._blurXFilter.blur = this.strengthX;\n this._blurYFilter.blur = this.strengthY;\n }\n\n /**\n * @deprecated since 6.0.0\n *\n * The strength of both the blurX and blurY properties simultaneously\n * @default 2\n * @see BloomFilter#strength\n */\n get blur(): number\n {\n deprecation('6.0.0', 'BloomFilter.blur is deprecated, please use BloomFilter.strength instead');\n\n return this.strengthX;\n }\n set blur(value: number)\n {\n deprecation('6.0.0', 'BloomFilter.blur is deprecated, please use BloomFilter.strength instead');\n\n this.strength = value;\n }\n\n /**\n * @deprecated since 6.0.0\n *\n * The strength of the blurX property\n * @default 2\n * @see BloomFilter#strengthX\n */\n get blurX(): number\n {\n deprecation('6.0.0', 'BloomFilter.blurX is deprecated, please use BloomFilter.strengthX instead');\n\n return this.strengthX;\n }\n set blurX(value: number)\n {\n deprecation('6.0.0', 'BloomFilter.blurX is deprecated, please use BloomFilter.strengthX instead');\n\n this.strengthX = value;\n }\n\n /**\n * @deprecated since 6.0.0\n *\n * The strength of the blurY property\n * @default 2\n * @see BloomFilter#strengthY\n */\n get blurY(): number\n {\n deprecation('6.0.0', 'BloomFilter.blurY is deprecated, please use BloomFilter.strengthY instead');\n\n return this.strengthY;\n }\n set blurY(value: number)\n {\n deprecation('6.0.0', 'BloomFilter.blurY is deprecated, please use BloomFilter.strengthY instead');\n\n this.strengthY = value;\n }\n}\n","import { Filter, GlProgram, GpuProgram } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './bulge-pinch.frag';\nimport source from './bulge-pinch.wgsl';\n\nimport type { FilterSystem, PointData, RenderSurface, Texture } from 'pixi.js';\n\n// This WebGPU filter has been ported from the WebGL renderer that was originally created by Julien CLEREL (@JuloxRox)\n\n/** Options for the BulgePinchFilter constructor. */\nexport interface BulgePinchFilterOptions\n{\n /**\n * Offset coordinates to change the position of the center of the circle of effect.\n * @default {x:0,y:0}\n */\n center?: PointData | number[] | number;\n /**\n * The radius of the circle of effect\n * @default 100\n */\n radius?: number;\n /**\n * A value between -1 and 1 (-1 is strong pinch, 0 is no effect, 1 is strong bulge)\n * @default 1\n */\n strength?: number;\n}\n\n/**\n * Bulges or pinches the image in a circle.
\n * ![original](../screenshots/original.png)![filter](../screenshots/bulge-pinch.gif)\n *\n * @class\n * @extends Filter\n */\nexport class BulgePinchFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: BulgePinchFilterOptions = {\n center: { x: 0.5, y: 0.5 },\n radius: 100,\n strength: 1\n };\n\n public uniforms: {\n uDimensions: Float32Array;\n uCenter: PointData;\n uRadius: number;\n uStrength: number;\n };\n\n /**\n * @param options - Options for the BulgePinchFilter constructor.\n */\n constructor(options?: BulgePinchFilterOptions)\n {\n options = { ...BulgePinchFilter.DEFAULT_OPTIONS, ...options };\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'bulge-pinch-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n bulgePinchUniforms: {\n uDimensions: { value: [0, 0], type: 'vec2' },\n uCenter: { value: options.center, type: 'vec2' },\n uRadius: { value: options.radius, type: 'f32' },\n uStrength: { value: options.strength, type: 'f32' },\n }\n },\n });\n\n this.uniforms = this.resources.bulgePinchUniforms.uniforms;\n\n Object.assign(this, options);\n }\n\n /**\n * Override existing apply method in `Filter`\n * @override\n * @ignore\n */\n public apply(\n filterManager: FilterSystem,\n input: Texture,\n output: RenderSurface,\n clearMode: boolean\n ): void\n {\n this.uniforms.uDimensions[0] = input.frame.width;\n this.uniforms.uDimensions[1] = input.frame.height;\n\n filterManager.applyFilter(this, input, output, clearMode);\n }\n\n /**\n * Sets the center of the effect in normalized screen coords.\n * { x: 0, y: 0 } means top-left and { x: 1, y: 1 } mean bottom-right\n * @default {x:0.5,y:0.5}\n */\n get center(): PointData { return this.uniforms.uCenter; }\n set center(value: PointData | number[] | number)\n {\n if (typeof value === 'number')\n {\n value = { x: value, y: value };\n }\n\n if (Array.isArray(value))\n {\n value = { x: value[0], y: value[1] };\n }\n\n this.uniforms.uCenter = value;\n }\n\n /**\n * Sets the center of the effect in normalized screen coords on the `x` axis\n * @default 0\n */\n get centerX(): number { return this.uniforms.uCenter.x; }\n set centerX(value: number) { this.uniforms.uCenter.x = value; }\n\n /**\n * Sets the center of the effect in normalized screen coords on the `y` axis\n * @default 0\n */\n get centerY(): number { return this.uniforms.uCenter.y; }\n set centerY(value: number) { this.uniforms.uCenter.y = value; }\n\n /**\n * The radius of the circle of effect\n * @default 100\n */\n get radius(): number { return this.uniforms.uRadius; }\n set radius(value: number) { this.uniforms.uRadius = value; }\n\n /**\n * A value between -1 and 1 (-1 is strong pinch, 0 is no effect, 1 is strong bulge)\n * @default 1\n */\n get strength(): number { return this.uniforms.uStrength; }\n set strength(value: number) { this.uniforms.uStrength = value; }\n}\n","// Copyright (c) 2014 Rafael Caricio. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nvar GradientParser = (GradientParser || {});\n\nGradientParser.stringify = (function() {\n\n var visitor = {\n\n 'visit_linear-gradient': function(node) {\n return visitor.visit_gradient(node);\n },\n\n 'visit_repeating-linear-gradient': function(node) {\n return visitor.visit_gradient(node);\n },\n\n 'visit_radial-gradient': function(node) {\n return visitor.visit_gradient(node);\n },\n\n 'visit_repeating-radial-gradient': function(node) {\n return visitor.visit_gradient(node);\n },\n\n 'visit_gradient': function(node) {\n var orientation = visitor.visit(node.orientation);\n if (orientation) {\n orientation += ', ';\n }\n\n return node.type + '(' + orientation + visitor.visit(node.colorStops) + ')';\n },\n\n 'visit_shape': function(node) {\n var result = node.value,\n at = visitor.visit(node.at),\n style = visitor.visit(node.style);\n\n if (style) {\n result += ' ' + style;\n }\n\n if (at) {\n result += ' at ' + at;\n }\n\n return result;\n },\n\n 'visit_default-radial': function(node) {\n var result = '',\n at = visitor.visit(node.at);\n\n if (at) {\n result += at;\n }\n return result;\n },\n\n 'visit_extent-keyword': function(node) {\n var result = node.value,\n at = visitor.visit(node.at);\n\n if (at) {\n result += ' at ' + at;\n }\n\n return result;\n },\n\n 'visit_position-keyword': function(node) {\n return node.value;\n },\n\n 'visit_position': function(node) {\n return visitor.visit(node.value.x) + ' ' + visitor.visit(node.value.y);\n },\n\n 'visit_%': function(node) {\n return node.value + '%';\n },\n\n 'visit_em': function(node) {\n return node.value + 'em';\n },\n\n 'visit_px': function(node) {\n return node.value + 'px';\n },\n\n 'visit_literal': function(node) {\n return visitor.visit_color(node.value, node);\n },\n\n 'visit_hex': function(node) {\n return visitor.visit_color('#' + node.value, node);\n },\n\n 'visit_rgb': function(node) {\n return visitor.visit_color('rgb(' + node.value.join(', ') + ')', node);\n },\n\n 'visit_rgba': function(node) {\n return visitor.visit_color('rgba(' + node.value.join(', ') + ')', node);\n },\n\n 'visit_color': function(resultColor, node) {\n var result = resultColor,\n length = visitor.visit(node.length);\n\n if (length) {\n result += ' ' + length;\n }\n return result;\n },\n\n 'visit_angular': function(node) {\n return node.value + 'deg';\n },\n\n 'visit_directional': function(node) {\n return 'to ' + node.value;\n },\n\n 'visit_array': function(elements) {\n var result = '',\n size = elements.length;\n\n elements.forEach(function(element, i) {\n result += visitor.visit(element);\n if (i < size - 1) {\n result += ', ';\n }\n });\n\n return result;\n },\n\n 'visit': function(element) {\n if (!element) {\n return '';\n }\n var result = '';\n\n if (element instanceof Array) {\n return visitor.visit_array(element, result);\n } else if (element.type) {\n var nodeVisitor = visitor['visit_' + element.type];\n if (nodeVisitor) {\n return nodeVisitor(element);\n } else {\n throw Error('Missing visitor visit_' + element.type);\n }\n } else {\n throw Error('Invalid node.');\n }\n }\n\n };\n\n return function(root) {\n return visitor.visit(root);\n };\n})();\n\n// Copyright (c) 2014 Rafael Caricio. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nvar GradientParser = (GradientParser || {});\n\nGradientParser.parse = (function() {\n\n var tokens = {\n linearGradient: /^(\\-(webkit|o|ms|moz)\\-)?(linear\\-gradient)/i,\n repeatingLinearGradient: /^(\\-(webkit|o|ms|moz)\\-)?(repeating\\-linear\\-gradient)/i,\n radialGradient: /^(\\-(webkit|o|ms|moz)\\-)?(radial\\-gradient)/i,\n repeatingRadialGradient: /^(\\-(webkit|o|ms|moz)\\-)?(repeating\\-radial\\-gradient)/i,\n sideOrCorner: /^to (left (top|bottom)|right (top|bottom)|left|right|top|bottom)/i,\n extentKeywords: /^(closest\\-side|closest\\-corner|farthest\\-side|farthest\\-corner|contain|cover)/,\n positionKeywords: /^(left|center|right|top|bottom)/i,\n pixelValue: /^(-?(([0-9]*\\.[0-9]+)|([0-9]+\\.?)))px/,\n percentageValue: /^(-?(([0-9]*\\.[0-9]+)|([0-9]+\\.?)))\\%/,\n emValue: /^(-?(([0-9]*\\.[0-9]+)|([0-9]+\\.?)))em/,\n angleValue: /^(-?(([0-9]*\\.[0-9]+)|([0-9]+\\.?)))deg/,\n startCall: /^\\(/,\n endCall: /^\\)/,\n comma: /^,/,\n hexColor: /^\\#([0-9a-fA-F]+)/,\n literalColor: /^([a-zA-Z]+)/,\n rgbColor: /^rgb/i,\n rgbaColor: /^rgba/i,\n number: /^(([0-9]*\\.[0-9]+)|([0-9]+\\.?))/\n };\n\n var input = '';\n\n function error(msg) {\n var err = new Error(input + ': ' + msg);\n err.source = input;\n throw err;\n }\n\n function getAST() {\n var ast = matchListDefinitions();\n\n if (input.length > 0) {\n error('Invalid input not EOF');\n }\n\n return ast;\n }\n\n function matchListDefinitions() {\n return matchListing(matchDefinition);\n }\n\n function matchDefinition() {\n return matchGradient(\n 'linear-gradient',\n tokens.linearGradient,\n matchLinearOrientation) ||\n\n matchGradient(\n 'repeating-linear-gradient',\n tokens.repeatingLinearGradient,\n matchLinearOrientation) ||\n\n matchGradient(\n 'radial-gradient',\n tokens.radialGradient,\n matchListRadialOrientations) ||\n\n matchGradient(\n 'repeating-radial-gradient',\n tokens.repeatingRadialGradient,\n matchListRadialOrientations);\n }\n\n function matchGradient(gradientType, pattern, orientationMatcher) {\n return matchCall(pattern, function(captures) {\n\n var orientation = orientationMatcher();\n if (orientation) {\n if (!scan(tokens.comma)) {\n error('Missing comma before color stops');\n }\n }\n\n return {\n type: gradientType,\n orientation: orientation,\n colorStops: matchListing(matchColorStop)\n };\n });\n }\n\n function matchCall(pattern, callback) {\n var captures = scan(pattern);\n\n if (captures) {\n if (!scan(tokens.startCall)) {\n error('Missing (');\n }\n\n var result = callback(captures);\n\n if (!scan(tokens.endCall)) {\n error('Missing )');\n }\n\n return result;\n }\n }\n\n function matchLinearOrientation() {\n return matchSideOrCorner() ||\n matchAngle();\n }\n\n function matchSideOrCorner() {\n return match('directional', tokens.sideOrCorner, 1);\n }\n\n function matchAngle() {\n return match('angular', tokens.angleValue, 1);\n }\n\n function matchListRadialOrientations() {\n var radialOrientations,\n radialOrientation = matchRadialOrientation(),\n lookaheadCache;\n\n if (radialOrientation) {\n radialOrientations = [];\n radialOrientations.push(radialOrientation);\n\n lookaheadCache = input;\n if (scan(tokens.comma)) {\n radialOrientation = matchRadialOrientation();\n if (radialOrientation) {\n radialOrientations.push(radialOrientation);\n } else {\n input = lookaheadCache;\n }\n }\n }\n\n return radialOrientations;\n }\n\n function matchRadialOrientation() {\n var radialType = matchCircle() ||\n matchEllipse();\n\n if (radialType) {\n radialType.at = matchAtPosition();\n } else {\n var extent = matchExtentKeyword();\n if (extent) {\n radialType = extent;\n var positionAt = matchAtPosition();\n if (positionAt) {\n radialType.at = positionAt;\n }\n } else {\n var defaultPosition = matchPositioning();\n if (defaultPosition) {\n radialType = {\n type: 'default-radial',\n at: defaultPosition\n };\n }\n }\n }\n\n return radialType;\n }\n\n function matchCircle() {\n var circle = match('shape', /^(circle)/i, 0);\n\n if (circle) {\n circle.style = matchLength() || matchExtentKeyword();\n }\n\n return circle;\n }\n\n function matchEllipse() {\n var ellipse = match('shape', /^(ellipse)/i, 0);\n\n if (ellipse) {\n ellipse.style = matchDistance() || matchExtentKeyword();\n }\n\n return ellipse;\n }\n\n function matchExtentKeyword() {\n return match('extent-keyword', tokens.extentKeywords, 1);\n }\n\n function matchAtPosition() {\n if (match('position', /^at/, 0)) {\n var positioning = matchPositioning();\n\n if (!positioning) {\n error('Missing positioning value');\n }\n\n return positioning;\n }\n }\n\n function matchPositioning() {\n var location = matchCoordinates();\n\n if (location.x || location.y) {\n return {\n type: 'position',\n value: location\n };\n }\n }\n\n function matchCoordinates() {\n return {\n x: matchDistance(),\n y: matchDistance()\n };\n }\n\n function matchListing(matcher) {\n var captures = matcher(),\n result = [];\n\n if (captures) {\n result.push(captures);\n while (scan(tokens.comma)) {\n captures = matcher();\n if (captures) {\n result.push(captures);\n } else {\n error('One extra comma');\n }\n }\n }\n\n return result;\n }\n\n function matchColorStop() {\n var color = matchColor();\n\n if (!color) {\n error('Expected color definition');\n }\n\n color.length = matchDistance();\n return color;\n }\n\n function matchColor() {\n return matchHexColor() ||\n matchRGBAColor() ||\n matchRGBColor() ||\n matchLiteralColor();\n }\n\n function matchLiteralColor() {\n return match('literal', tokens.literalColor, 0);\n }\n\n function matchHexColor() {\n return match('hex', tokens.hexColor, 1);\n }\n\n function matchRGBColor() {\n return matchCall(tokens.rgbColor, function() {\n return {\n type: 'rgb',\n value: matchListing(matchNumber)\n };\n });\n }\n\n function matchRGBAColor() {\n return matchCall(tokens.rgbaColor, function() {\n return {\n type: 'rgba',\n value: matchListing(matchNumber)\n };\n });\n }\n\n function matchNumber() {\n return scan(tokens.number)[1];\n }\n\n function matchDistance() {\n return match('%', tokens.percentageValue, 1) ||\n matchPositionKeyword() ||\n matchLength();\n }\n\n function matchPositionKeyword() {\n return match('position-keyword', tokens.positionKeywords, 1);\n }\n\n function matchLength() {\n return match('px', tokens.pixelValue, 1) ||\n match('em', tokens.emValue, 1);\n }\n\n function match(type, pattern, captureIndex) {\n var captures = scan(pattern);\n if (captures) {\n return {\n type: type,\n value: captures[captureIndex]\n };\n }\n }\n\n function scan(regexp) {\n var captures,\n blankCaptures;\n\n blankCaptures = /^[\\n\\r\\t\\s]+/.exec(input);\n if (blankCaptures) {\n consume(blankCaptures[0].length);\n }\n\n captures = regexp.exec(input);\n if (captures) {\n consume(captures[0].length);\n }\n\n return captures;\n }\n\n function consume(size) {\n input = input.substr(size);\n }\n\n return function(code) {\n input = code.toString();\n return getAST();\n };\n})();\n\nexports.parse = GradientParser.parse;\nexports.stringify = GradientParser.stringify;\n","import {\n AngularNode,\n ColorStop as CssColorStop,\n DefaultRadialNode,\n DirectionalNode,\n ExtentKeywordNode,\n GradientNode,\n parse,\n ShapeNode\n} from 'gradient-parser';\nimport { Color } from 'pixi.js';\nimport { ColorStop } from './ColorGradientFilter';\n\nexport type ParseResult = {\n type: number;\n stops: ColorStop[];\n angle: number;\n};\n\nexport function parseCssGradient(cssGradient: string): ParseResult\n{\n const cssGradientNodes: GradientNode[] = parse(trimCssGradient(cssGradient));\n\n if (cssGradientNodes.length === 0)\n {\n throw new Error('Invalid CSS gradient.');\n }\n else if (cssGradientNodes.length !== 1)\n {\n throw new Error('Unsupported CSS gradient (multiple gradients is not supported).');\n }\n\n const cssGradientNode = cssGradientNodes[0];\n\n const type = typeFromCssType(cssGradientNode.type);\n const stops = stopsFromCssStops(cssGradientNode.colorStops);\n const angle = angleFromCssOrientation(cssGradientNode.orientation);\n\n return {\n type,\n stops,\n angle,\n };\n}\n\nexport function typeFromCssType(type: string): number\n{\n const supportedTypes: { [key: string]: number } = {\n 'linear-gradient': 0,\n 'radial-gradient': 1,\n };\n\n if (!(type in supportedTypes))\n {\n throw new Error(`Unsupported gradient type \"${type}\"`);\n }\n\n return supportedTypes[type];\n}\n\nexport function stopsFromCssStops(stops: CssColorStop[]): ColorStop[]\n{\n const offsets: number[] = offsetsFromCssColorStops(stops);\n const result: ColorStop[] = [];\n const color = new Color();\n\n for (let i = 0; i < stops.length; i++)\n {\n const colorString = colorAsStringFromCssStop(stops[i]);\n const rgbaColor = color.setValue(colorString).toArray();\n\n result.push({\n offset: offsets[i],\n color: rgbaColor.slice(0, 3),\n alpha: rgbaColor[3]\n });\n }\n\n return result;\n}\n\nexport function colorAsStringFromCssStop(stop: CssColorStop): string\n{\n switch (stop.type)\n {\n case 'hex':\n return `#${stop.value}`;\n case 'literal':\n return stop.value;\n default:\n return `${stop.type}(${stop.value.join(',')})`;\n }\n}\n\nexport function offsetsFromCssColorStops(stops: CssColorStop[]): number[]\n{\n const offsets: number[] = [];\n const dynamicOffset = -1;\n\n for (let i = 0; i < stops.length; i++)\n {\n const cssStop = stops[i];\n let stopOffset = dynamicOffset;\n\n if (cssStop.type === 'literal')\n {\n if (cssStop.length && 'type' in cssStop.length && cssStop.length.type === '%' && 'value' in cssStop.length)\n {\n stopOffset = parseFloat(cssStop.length.value) / 100;\n }\n }\n\n offsets.push(stopOffset);\n }\n\n const findNextFixedStop = (fromIndex: number): { indexDelta: number; offset: number; } =>\n {\n for (let k = fromIndex; k < offsets.length; k++)\n {\n if (offsets[k] !== dynamicOffset)\n {\n return {\n indexDelta: k - fromIndex,\n offset: offsets[k]\n };\n }\n }\n\n return {\n indexDelta: (offsets.length - 1) - fromIndex,\n offset: 1.0\n };\n };\n\n let prevFixedOffset = 0;\n\n for (let i = 0; i < offsets.length; i++)\n {\n const offset = offsets[i];\n\n if (offset !== dynamicOffset)\n {\n prevFixedOffset = offset;\n }\n else if (i === 0)\n {\n offsets[i] = 0;\n }\n else if (i + 1 === offsets.length)\n {\n offsets[i] = 1.0;\n }\n else\n {\n const nextFixed = findNextFixedStop(i);\n const offsetDelta = nextFixed.offset - prevFixedOffset;\n const stepSize = offsetDelta / (1 + nextFixed.indexDelta);\n\n for (let s = 0; s <= nextFixed.indexDelta; s++)\n {\n offsets[i + s] = prevFixedOffset + ((s + 1) * stepSize);\n }\n\n i += nextFixed.indexDelta;\n prevFixedOffset = offsets[i];\n }\n }\n\n return offsets.map(fixFloatRounding);\n}\n\n// fixes issues like 0.3 - 0.1 = 0.19999999999999998\nfunction fixFloatRounding(value: number): number\n{\n const maxLength = 6;\n\n if (value.toString().length > maxLength)\n {\n return parseFloat(value.toString().substring(0, maxLength));\n }\n\n return value;\n}\n\ntype CssOrientation = DirectionalNode | AngularNode | (ShapeNode | DefaultRadialNode | ExtentKeywordNode)[] | undefined;\n\nexport function angleFromCssOrientation(orientation: CssOrientation): number\n{\n if (typeof orientation === 'undefined')\n {\n return 0;\n }\n\n if ('type' in orientation && 'value' in orientation)\n {\n switch (orientation.type)\n {\n case 'angular':\n return parseFloat(orientation.value);\n case 'directional':\n return angleFromDirectionalValue(orientation.value);\n }\n }\n\n return 0;\n}\n\nexport function angleFromDirectionalValue(value: string): number\n{\n const supportedValues: { [key: string]: number } = {\n left: 270,\n top: 0,\n bottom: 180,\n right: 90,\n 'left top': 315,\n 'top left': 315,\n 'left bottom': 225,\n 'bottom left': 225,\n 'right top': 45,\n 'top right': 45,\n 'right bottom': 135,\n 'bottom right': 135,\n };\n\n if (!(value in supportedValues))\n {\n throw new Error(`Unsupported directional value \"${value}\"`);\n }\n\n return supportedValues[value];\n}\n\nexport function trimCssGradient(value: string) : string\n{\n let value_ = value.replace(/\\s{2,}/gu, ' ');\n\n value_ = value_.replace(/;/g, '');\n value_ = value_.replace(/ ,/g, ',');\n value_ = value_.replace(/\\( /g, '(');\n value_ = value_.replace(/ \\)/g, ')');\n\n return value_.trim();\n}\n","import { Color, ColorSource, Filter, GlProgram, GpuProgram } from 'pixi.js';\nimport fragment from './color-gradient.frag';\nimport vertex from './color-gradient.vert';\nimport source from './color-gradient.wgsl';\nimport { parseCssGradient } from './CssGradientParser';\n\n/** Color stop object. */\nexport interface ColorStop\n{\n offset: number;\n color: ColorSource;\n alpha: number;\n}\n\n/** Options for ColorGradientFilter constructor. */\nexport interface ColorGradientFilterOptions\n{\n /**\n * Linear = 0, Radial = 1, Conic = 2\n * @default ColorGradientFilter.LINEAR\n */\n type: number;\n /** Collection of stops, must be 2+ */\n stops: ColorStop[];\n /**\n * Angle for linear gradients, in degrees.\n * @default 90\n */\n angle?: number;\n /**\n * Alpha value for the gradient.\n * @default 1\n */\n alpha?: number;\n /**\n * Maximum number of colors to render (0 = no limit)\n * @default 0\n */\n maxColors?: number;\n /**\n * If true, the gradient will replace the existing color, otherwise it will be multiplied with it\n * @default false\n */\n replace?: boolean;\n}\n\n/** Options for CSS-style gradient for use with constructor. */\nexport interface ColorGradientFilterCSSOptions\n{\n /** CSS-style gradient string */\n css: string;\n /**\n * Alpha value for the gradient.\n * @default 1\n */\n alpha?: number;\n /**\n * Maximum number of colors to render (0 = no limit)\n * @default 0\n */\n maxColors?: number;\n}\n\nconst ANGLE_OFFSET = 90; // align degrees with CSS\n\nfunction sortColorStops(stops: ColorStop[]): ColorStop[]\n{\n return [...stops].sort((a, b) => a.offset - b.offset);\n}\n\n/**\n * Render a colored gradient.
\n * ![original](../screenshots/original.png)![filter](../screenshots/color-gradient.png)\n *\n * @class\n * @extends Filter\n */\nexport class ColorGradientFilter extends Filter\n{\n /** Gradient types */\n static readonly LINEAR = 0;\n static readonly RADIAL = 1;\n static readonly CONIC = 2;\n\n /** Default constructor options */\n public static readonly defaults: ColorGradientFilterOptions = {\n type: ColorGradientFilter.LINEAR,\n stops: [\n { offset: 0.0, color: 0xff0000, alpha: 1.0 },\n { offset: 1.0, color: 0x0000ff, alpha: 1.0 },\n ],\n alpha: 1.0,\n angle: 90.0,\n maxColors: 0,\n replace: false,\n };\n\n public baseUniforms: {\n uOptions: Float32Array;\n uCounts: Float32Array;\n };\n\n public stopsUniforms: {\n uColors: Float32Array;\n uStops: Float32Array;\n };\n\n private _stops: ColorStop[] = [];\n\n /**\n * @param options - Options for the ColorGradientFilter constructor.\n */\n constructor(options?: ColorGradientFilterOptions | ColorGradientFilterCSSOptions)\n {\n if (options && 'css' in options)\n {\n options = {\n ...parseCssGradient(options.css || ''),\n alpha: options.alpha ?? ColorGradientFilter.defaults.alpha,\n maxColors: options.maxColors ?? ColorGradientFilter.defaults.maxColors,\n };\n }\n else\n {\n options = { ...ColorGradientFilter.defaults, ...options };\n }\n\n if (!options.stops || options.stops.length < 2)\n {\n throw new Error('ColorGradientFilter requires at least 2 color stops.');\n }\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'color-gradient-filter',\n });\n\n const maxStops = 32;\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n baseUniforms: {\n uOptions: {\n value: [\n // Gradient Type\n options.type,\n // Gradient Angle\n options.angle ?? ANGLE_OFFSET,\n // Master Alpha\n options.alpha,\n // Replace Base Color\n options.replace ? 1 : 0,\n ],\n type: 'vec4',\n },\n uCounts: {\n value: [\n // Number of Stops\n options.stops.length,\n // Max Gradient Colors\n options.maxColors,\n ],\n type: 'vec2',\n },\n },\n stopsUniforms: {\n uColors: { value: new Float32Array(maxStops * 3), type: 'vec3', size: maxStops },\n\n // We only need vec2, but we need to pad to eliminate the WGSL warning, TODO: @Mat ?\n uStops: { value: new Float32Array(maxStops * 4), type: 'vec4', size: maxStops },\n }\n },\n });\n\n this.baseUniforms = this.resources.baseUniforms.uniforms;\n this.stopsUniforms = this.resources.stopsUniforms.uniforms;\n\n Object.assign(this, options);\n }\n\n get stops(): ColorStop[]\n {\n return this._stops;\n }\n\n set stops(stops: ColorStop[])\n {\n const sortedStops = sortColorStops(stops);\n const color = new Color();\n let r;\n let g;\n let b;\n\n for (let i = 0; i < sortedStops.length; i++)\n {\n color.setValue(sortedStops[i].color);\n const indexStart = i * 3;\n\n [r, g, b] = color.toArray();\n this.stopsUniforms.uColors[indexStart] = r;\n this.stopsUniforms.uColors[indexStart + 1] = g;\n this.stopsUniforms.uColors[indexStart + 2] = b;\n\n this.stopsUniforms.uStops[i * 4] = sortedStops[i].offset;\n this.stopsUniforms.uStops[(i * 4) + 1] = sortedStops[i].alpha;\n }\n\n this.baseUniforms.uCounts[0] = sortedStops.length;\n this._stops = sortedStops;\n }\n\n /**\n * The type of gradient\n * @default ColorGradientFilter.LINEAR\n */\n get type(): number { return this.baseUniforms.uOptions[0]; }\n set type(value: number) { this.baseUniforms.uOptions[0] = value; }\n\n /**\n * The angle of the gradient in degrees\n * @default 90\n */\n get angle(): number { return this.baseUniforms.uOptions[1] + ANGLE_OFFSET; }\n set angle(value: number) { this.baseUniforms.uOptions[1] = value - ANGLE_OFFSET; }\n\n /**\n * The alpha value of the gradient (0-1)\n * @default 1\n */\n get alpha(): number { return this.baseUniforms.uOptions[2]; }\n set alpha(value: number) { this.baseUniforms.uOptions[2] = value; }\n\n /**\n * The maximum number of colors to render (0 = no limit)\n * @default 0\n */\n get maxColors(): number { return this.baseUniforms.uCounts[1]; }\n set maxColors(value: number) { this.baseUniforms.uCounts[1] = value; }\n\n /**\n * If true, the gradient will replace the existing color, otherwise it\n * will be multiplied with it\n * @default false\n */\n get replace(): boolean { return this.baseUniforms.uOptions[3] > 0.5; }\n set replace(value: boolean) { this.baseUniforms.uOptions[3] = value ? 1 : 0; }\n}\n\n","import { deprecation, Filter, GlProgram, GpuProgram, SCALE_MODE, Texture, TextureSource } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './color-map.frag';\nimport source from './color-map.wgsl';\n\ntype ColorMapTexture = TextureSource | Texture;\n\n/** Options for the ColorMapFilter constructor. */\nexport interface ColorMapFilterOptions\n{\n /** The colorMap texture of the filter. */\n colorMap: ColorMapTexture;\n /**\n * The mix from 0 to 1, where 0 is the original image and 1 is the color mapped image.\n * @default 1\n */\n mix?: number;\n /**\n * Whether use NEAREST scale mode for `colorMap` texture.\n * @default false\n */\n nearest?: boolean;\n}\n\n/**\n * The ColorMapFilter applies a color-map effect to an object.
\n * ![original](../screenshots/original.png)![filter](../screenshots/color-map.png)\n *\n * @class\n * @extends Filter\n */\nexport class ColorMapFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: ColorMapFilterOptions = {\n colorMap: Texture.WHITE,\n nearest: false,\n mix: 1\n };\n\n public uniforms: {\n uMix: number;\n uSize: number;\n uSliceSize: number;\n uSlicePixelSize: number;\n uSliceInnerSize: number;\n };\n\n private _size = 0;\n private _sliceSize = 0;\n private _slicePixelSize = 0;\n private _sliceInnerSize = 0;\n private _nearest = false;\n private _scaleMode: SCALE_MODE = 'linear';\n private _colorMap!: ColorMapTexture;\n\n /**\n * @param options - Options for the ColorMapFilter constructor.\n */\n constructor(options: ColorMapFilterOptions);\n /**\n * @deprecated since 6.0.0\n *\n * @param {HTMLImageElement|HTMLCanvasElement|PIXI.BaseTexture|PIXI.Texture} [colorMap] - The\n * colorMap texture of the filter.\n * @param {boolean} [nearest=false] - Whether use NEAREST for colorMap texture.\n * @param {number} [mix=1] - The mix from 0 to 1, where 0 is the original image and 1 is the color mapped image.\n */\n constructor(colorMap: ColorMapTexture, nearest?: boolean, mix?: number);\n /** @ignore */\n constructor(...args: [ColorMapFilterOptions] | [ColorMapTexture, boolean?, number?])\n {\n let options = args[0] ?? {};\n\n if (options instanceof Texture || options instanceof TextureSource)\n {\n // eslint-disable-next-line max-len\n deprecation('6.0.0', 'ColorMapFilter constructor params are now options object. See params: { colorMap, nearest, mix }');\n\n options = { colorMap: options };\n\n if (args[1] !== undefined) options.nearest = args[1];\n if (args[2] !== undefined) options.mix = args[2];\n }\n\n options = { ...ColorMapFilter.DEFAULT_OPTIONS, ...options };\n\n if (!options.colorMap) throw Error('No color map texture source was provided to ColorMapFilter');\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'color-map-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n colorMapUniforms: {\n uMix: { value: options.mix, type: 'f32' },\n uSize: { value: 0, type: 'f32' },\n uSliceSize: { value: 0, type: 'f32' },\n uSlicePixelSize: { value: 0, type: 'f32' },\n uSliceInnerSize: { value: 0, type: 'f32' },\n },\n uMapTexture: options.colorMap.source,\n uMapSampler: options.colorMap.source.style,\n },\n });\n\n this.uniforms = this.resources.colorMapUniforms.uniforms;\n\n Object.assign(this, options);\n }\n\n /** The mix from 0 to 1, where 0 is the original image and 1 is the color mapped image. */\n get mix(): number { return this.uniforms.uMix; }\n set mix(value: number) { this.uniforms.uMix = value; }\n\n /**\n * The size of one color slice.\n * @readonly\n */\n get colorSize(): number { return this._size; }\n\n /** The colorMap texture. */\n get colorMap(): ColorMapTexture { return this._colorMap; }\n set colorMap(value: ColorMapTexture)\n {\n if (!value || value === this.colorMap) return;\n\n const source = value instanceof Texture ? value.source : value;\n\n source.style.scaleMode = this._scaleMode;\n source.autoGenerateMipmaps = false;\n\n this._size = source.height;\n this._sliceSize = 1 / this._size;\n this._slicePixelSize = this._sliceSize / this._size;\n this._sliceInnerSize = this._slicePixelSize * (this._size - 1);\n\n this.uniforms.uSize = this._size;\n this.uniforms.uSliceSize = this._sliceSize;\n this.uniforms.uSlicePixelSize = this._slicePixelSize;\n this.uniforms.uSliceInnerSize = this._sliceInnerSize;\n\n this.resources.uMapTexture = source;\n this._colorMap = value;\n }\n\n /** Whether use NEAREST for colorMap texture. */\n get nearest(): boolean { return this._nearest; }\n set nearest(nearest: boolean)\n {\n this._nearest = nearest;\n this._scaleMode = nearest ? 'nearest' : 'linear';\n\n const texture = this._colorMap;\n\n if (texture && texture.source)\n {\n texture.source.scaleMode = this._scaleMode;\n texture.source.autoGenerateMipmaps = false;\n texture.source.style.update();\n texture.source.update();\n }\n }\n\n /**\n * If the colorMap is based on canvas,\n * and the content of canvas has changed, then call `updateColorMap` for update texture.\n */\n updateColorMap(): void\n {\n const texture = this._colorMap;\n\n if (texture?.source)\n {\n texture.source.update();\n this.colorMap = texture;\n }\n }\n\n /**\n * Destroys this filter\n * @default false\n */\n destroy(): void\n {\n this._colorMap?.destroy(/** true | TODO: Should base texture be destroyed? **/);\n super.destroy();\n }\n}\n","import { Color, ColorSource, deprecation, Filter, GlProgram, GpuProgram } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './color-overlay.frag';\nimport source from './color-overlay.wgsl';\n\ntype DeprecatedColor = number | number[] | Float32Array;\n\n/** Options for the ColorOverlayFilter constructor. */\nexport interface ColorOverlayFilterOptions\n{\n /**\n * The color of the overlay\n * @default 0x000000\n */\n color?: ColorSource;\n /**\n * The alpha of the overlay\n * @default 1\n */\n alpha?: number;\n}\n\n/**\n * Overlay a source graphic with a color.
\n *\n * @class\n * @extends Filter\n */\nexport class ColorOverlayFilter extends Filter\n{\n /** Default shockwave filter options */\n public static readonly DEFAULT_OPTIONS: ColorOverlayFilterOptions = {\n /** The color of the overlay */\n color: 0x000000,\n /** The alpha of the overlay */\n alpha: 1,\n };\n\n public uniforms: {\n uColor: Float32Array;\n uAlpha: number;\n };\n\n private _color: Color;\n\n /**\n * @param options - Options for the ColorOverlayFilter constructor.\n */\n constructor(options?: ColorOverlayFilterOptions);\n /**\n * @deprecated since 6.0.0\n *\n * @param {number|Array} [color=0x000000] - The resulting color, as a 3 component RGB e.g. [1.0, 0.5, 1.0]\n * @param {number} [alpha=1] - The alpha value of the color\n */\n constructor(color?: DeprecatedColor, alpha?: number);\n /** @ignore */\n constructor(...args: [ColorOverlayFilterOptions?] | [DeprecatedColor?, number?])\n {\n let options = args[0] ?? {};\n\n if (typeof options === 'number' || Array.isArray(options) || options instanceof Float32Array)\n {\n // eslint-disable-next-line max-len\n deprecation('6.0.0', 'ColorOverlayFilter constructor params are now options object. See params: { color, alpha }');\n\n options = { color: options };\n\n if (args[1] !== undefined) options.alpha = args[1];\n }\n\n options = { ...ColorOverlayFilter.DEFAULT_OPTIONS, ...options };\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'color-overlay-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n colorOverlayUniforms: {\n uColor: { value: new Float32Array(3), type: 'vec3' },\n uAlpha: { value: options.alpha, type: 'f32' },\n },\n },\n });\n\n this.uniforms = this.resources.colorOverlayUniforms.uniforms;\n\n this._color = new Color();\n this.color = options.color ?? 0x000000;\n }\n\n /**\n * The over color source\n * @member {number|Array|Float32Array}\n * @default 0x000000\n */\n get color(): ColorSource { return this._color.value as ColorSource; }\n set color(value: ColorSource)\n {\n this._color.setValue(value);\n const [r, g, b] = this._color.toArray();\n\n this.uniforms.uColor[0] = r;\n this.uniforms.uColor[1] = g;\n this.uniforms.uColor[2] = b;\n }\n\n /**\n * The alpha value of the color\n * @default 1\n */\n get alpha(): number { return this.uniforms.uAlpha; }\n set alpha(value: number) { this.uniforms.uAlpha = value; }\n}\n","import { Color, ColorSource, deprecation, Filter, GlProgram, GpuProgram } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './color-replace.frag';\nimport source from './color-replace.wgsl';\n\n/**\n * This WebGPU filter has been ported from the WebGL renderer that was originally created by mishaa, updated by timetocode\n * http://www.html5gamedevs.com/topic/10640-outline-a-sprite-change-certain-colors/?p=69966\n */\n\ntype DeprecatedColor = number | number[] | Float32Array;\n\n/** Options for the ColorReplaceFilter constructor. */\nexport interface ColorReplaceFilterOptions\n{\n /**\n * The color that will be changed.\n * @example [1.0, 1.0, 1.0] = 0xffffff\n * @default 0xff0000\n */\n originalColor?: ColorSource;\n /**\n * The resulting color.\n * @example [1.0, 1.0, 1.0] = 0xffffff\n * @default 0x000000\n */\n targetColor?: ColorSource;\n /**\n * Tolerance/sensitivity of the floating-point comparison between colors (lower = more exact, higher = more inclusive)\n * @default 0.4\n */\n tolerance?: number;\n}\n\n/**\n * ColorReplaceFilter, originally by mishaa, updated by timetocode\n * http://www.html5gamedevs.com/topic/10640-outline-a-sprite-change-certain-colors/?p=69966
\n * ![original](../screenshots/original.png)![filter](../screenshots/color-replace.png)\n *\n * @class\n * @extends Filter\n *\n * @example\n * // replaces true red with true blue\n * someSprite.filters = [new ColorReplaceFilter({\n * originalColor: [1, 0, 0],\n * targetColor: [0, 0, 1],\n * tolerance: 0.001\n * })];\n * // replaces the RGB color 220, 220, 220 with the RGB color 225, 200, 215\n * someOtherSprite.filters = [new ColorReplaceFilter({\n * originalColor: [220/255.0, 220/255.0, 220/255.0],\n * targetColor: [225/255.0, 200/255.0, 215/255.0],\n * tolerance: 0.001\n * })];\n * // replaces the RGB color 220, 220, 220 with the RGB color 225, 200, 215\n * someOtherSprite.filters = [new ColorReplaceFilter({ originalColor: 0xdcdcdc, targetColor: 0xe1c8d7, tolerance: 0.001 })];\n *\n */\nexport class ColorReplaceFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: ColorReplaceFilterOptions = {\n originalColor: 0xff0000,\n targetColor: 0x000000,\n tolerance: 0.4\n };\n\n public uniforms: {\n uOriginalColor: Float32Array,\n uTargetColor: Float32Array,\n uTolerance: number,\n };\n\n private _originalColor: Color;\n private _targetColor: Color;\n\n /**\n * @param options - Options for the ColorReplaceFilter constructor.\n */\n constructor(options?: ColorReplaceFilterOptions);\n /**\n * @deprecated since 6.0.0\n *\n * @param {number|Array|Float32Array} [originalColor=0xFF0000] - The color that will be changed,\n * as a 3 component RGB e.g. `[1.0, 1.0, 1.0]`\n * @param {number|Array|Float32Array} [newColor=0x000000] - The resulting color, as a 3 component\n * RGB e.g. `[1.0, 0.5, 1.0]`\n * @param {number} [epsilon=0.4] - Tolerance/sensitivity of the floating-point comparison between colors\n * (lower = more exact, higher = more inclusive)\n */\n constructor(originalColor?: number, newColor?: number, epsilon?: number);\n /** @ignore */\n constructor(...args: [ColorReplaceFilterOptions?] | [DeprecatedColor?, DeprecatedColor?, number?])\n {\n let options = args[0] ?? {};\n\n if (typeof options === 'number' || Array.isArray(options) || options instanceof Float32Array)\n {\n // eslint-disable-next-line max-len\n deprecation('6.0.0', 'ColorReplaceFilter constructor params are now options object. See params: { originalColor, targetColor, tolerance }');\n\n options = { originalColor: options };\n\n if (args[1] !== undefined) options.targetColor = args[1];\n if (args[2] !== undefined) options.tolerance = args[2];\n }\n\n options = { ...ColorReplaceFilter.DEFAULT_OPTIONS, ...options };\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'color-replace-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n colorReplaceUniforms: {\n uOriginalColor: { value: new Float32Array(3), type: 'vec3' },\n uTargetColor: { value: new Float32Array(3), type: 'vec3' },\n uTolerance: { value: options.tolerance, type: 'f32' },\n }\n },\n });\n\n this.uniforms = this.resources.colorReplaceUniforms.uniforms;\n\n this._originalColor = new Color();\n this._targetColor = new Color();\n this.originalColor = options.originalColor ?? 0xff0000;\n this.targetColor = options.targetColor ?? 0x000000;\n\n Object.assign(this, options);\n }\n\n /**\n * The color that will be changed.\n * @example [1.0, 1.0, 1.0] = 0xffffff\n * @default 0xff0000\n */\n get originalColor(): ColorSource { return this._originalColor.value as ColorSource; }\n set originalColor(value: ColorSource)\n {\n this._originalColor.setValue(value);\n const [r, g, b] = this._originalColor.toArray();\n\n this.uniforms.uOriginalColor[0] = r;\n this.uniforms.uOriginalColor[1] = g;\n this.uniforms.uOriginalColor[2] = b;\n }\n\n /**\n * The resulting color.\n * @example [1.0, 1.0, 1.0] = 0xffffff\n * @default 0x000000\n */\n get targetColor(): ColorSource { return this._targetColor.value as ColorSource; }\n set targetColor(value: ColorSource)\n {\n this._targetColor.setValue(value);\n const [r, g, b] = this._targetColor.toArray();\n\n this.uniforms.uTargetColor[0] = r;\n this.uniforms.uTargetColor[1] = g;\n this.uniforms.uTargetColor[2] = b;\n }\n\n /**\n * Tolerance/sensitivity of the floating-point comparison between colors (lower = more exact, higher = more inclusive)\n * @default 0.4\n */\n get tolerance(): number { return this.uniforms.uTolerance; }\n set tolerance(value: number) { this.uniforms.uTolerance = value; }\n\n /**\n * @deprecated since 6.0.0\n *\n * The resulting color, as a 3 component RGB e.g. [1.0, 0.5, 1.0]\n * @member {number|Array|Float32Array}\n * @default 0x000000\n * @see ColorReplaceFilter#targetColor\n */\n set newColor(value: DeprecatedColor)\n {\n deprecation('6.0.0', 'ColorReplaceFilter.newColor is deprecated, please use ColorReplaceFilter.targetColor instead');\n\n this.targetColor = value;\n }\n get newColor(): DeprecatedColor\n {\n deprecation('6.0.0', 'ColorReplaceFilter.newColor is deprecated, please use ColorReplaceFilter.targetColor instead');\n\n return this.targetColor as DeprecatedColor;\n }\n\n /**\n * @deprecated since 6.0.0\n *\n * Tolerance/sensitivity of the floating-point comparison between colors (lower = more exact, higher = more inclusive)\n * @default 0.4\n * @see ColorReplaceFilter#tolerance\n */\n set epsilon(value: number)\n {\n deprecation('6.0.0', 'ColorReplaceFilter.epsilon is deprecated, please use ColorReplaceFilter.tolerance instead');\n\n this.tolerance = value;\n }\n get epsilon(): number\n {\n deprecation('6.0.0', 'ColorReplaceFilter.epsilon is deprecated, please use ColorReplaceFilter.tolerance instead');\n\n return this.tolerance;\n }\n}\n","import { deprecation, Filter, GlProgram, GpuProgram, PointData } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './convolution.frag';\nimport source from './convolution.wgsl';\n\ntype FixedArray = [ T, ...Array ] & { length: L };\n\nexport type ConvolutionMatrix = Float32Array | FixedArray;\n\n/** Options for the ConvolutionFilter constructor. */\nexport interface ConvolutionFilterOptions\n{\n /**\n * An array of values used for matrix transformation, specified as a 9 point Array\n * @example\n * const matrix = new Float32Array(9); // 9 elements of value 0\n * const matrix = [0,0.5,0,0.5,1,0.5,0,0.5,0];\n * @default [0,0,0,0,0,0,0,0,0]\n */\n matrix?: ConvolutionMatrix;\n /**\n * Width of the object you are transforming\n * @default 200\n */\n width?: number;\n /**\n * Height of the object you are transforming\n * @default 200\n */\n height?: number;\n}\n\n/**\n * The ConvolutionFilter class applies a matrix convolution filter effect.\n * A convolution combines pixels in the input image with neighboring pixels to produce a new image.\n * A wide variety of image effects can be achieved through convolutions, including blurring, edge\n * detection, sharpening, embossing, and beveling. The matrix should be specified as a 9 point Array.\n * See https://docs.gimp.org/2.10/en/gimp-filter-convolution-matrix.html for more info.
\n * ![original](../screenshots/original.png)![filter](../screenshots/convolution.png)\n *\n * @class\n * @extends Filter\n */\nexport class ConvolutionFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: ConvolutionFilterOptions = {\n matrix: new Float32Array(9),\n width: 200,\n height: 200,\n };\n\n public uniforms: {\n uMatrix: ConvolutionMatrix;\n uTexelSize: PointData;\n };\n\n /**\n * @param options - Options for the ConvolutionFilter constructor.\n */\n constructor(options?: ConvolutionFilterOptions);\n /**\n * @deprecated since 6.0.0\n *\n * @param {number[]} [matrix=[0,0,0,0,0,0,0,0,0]] - An array of values used for matrix transformation.\n * Specified as a 9 point Array.\n * @param {number} [width=200] - Width of the object you are transforming\n * @param {number} [height=200] - Height of the object you are transforming\n */\n constructor(matrix: number[], width?: number, height?: number);\n /** @ignore */\n constructor(...args: [ConvolutionFilterOptions?] | [number[], number?, number?])\n {\n let options = args[0] ?? {};\n\n if (Array.isArray(options))\n {\n // eslint-disable-next-line max-len\n deprecation('6.0.0', 'ConvolutionFilter constructor params are now options object. See params: { matrix, width, height }');\n\n options = { matrix: options as ConvolutionMatrix };\n\n if (args[1] !== undefined) options.width = args[1];\n if (args[2] !== undefined) options.height = args[2];\n }\n\n options = { ...ConvolutionFilter.DEFAULT_OPTIONS, ...options };\n\n const width = options.width ?? 200;\n const height = options.height ?? 200;\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'convolution-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n convolutionUniforms: {\n uMatrix: { value: options.matrix, type: 'mat3x3' },\n uTexelSize: { value: { x: 1 / width, y: 1 / height }, type: 'vec2' },\n },\n },\n });\n\n this.uniforms = this.resources.convolutionUniforms.uniforms;\n\n this.width = width;\n this.height = height;\n }\n\n /**\n * An array of values used for matrix transformation, specified as a 9 point Array\n * @example\n * const matrix = new Float32Array(9); // 9 elements of value 0\n * const matrix = [0,0.5,0,0.5,1,0.5,0,0.5,0];\n * @default [0,0,0,0,0,0,0,0,0]\n */\n get matrix(): ConvolutionMatrix { return this.uniforms.uMatrix; }\n set matrix(matrix: ConvolutionMatrix)\n {\n matrix.forEach((v, i) =>\n {\n this.uniforms.uMatrix[i] = v;\n });\n }\n\n /**\n * Width of the object you are transforming\n * @default 200\n */\n get width(): number { return 1 / this.uniforms.uTexelSize.x; }\n set width(value: number) { this.uniforms.uTexelSize.x = 1 / value; }\n\n /**\n * Height of the object you are transforming\n * @default 200\n */\n get height(): number { return 1 / this.uniforms.uTexelSize.y; }\n set height(value: number) { this.uniforms.uTexelSize.y = 1 / value; }\n}\n","import { Filter, GlProgram, GpuProgram } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './crosshatch.frag';\nimport source from './crosshatch.wgsl';\n\n/**\n * A Cross Hatch effect filter.
\n * ![original](../screenshots/original.png)![filter](../screenshots/cross-hatch.png)\n *\n * @class\n * @extends Filter\n */\nexport class CrossHatchFilter extends Filter\n{\n constructor()\n {\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'cross-hatch-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {},\n });\n }\n}\n","import { Filter, GlProgram, GpuProgram } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './crt.frag';\nimport source from './crt.wgsl';\n\nimport type { FilterSystem, RenderSurface, Texture } from 'pixi.js';\n\n/** Options for the CRTFilter constructor. */\nexport interface CRTFilterOptions\n{\n /**\n * Bend of interlaced lines, higher value means more bend\n * @default 1\n */\n curvature?: number,\n /**\n * Width of the interlaced lines\n * @default 1\n */\n lineWidth?: number,\n /**\n * Contrast of interlaced lines\n * @default 0.25\n */\n lineContrast?: number,\n /**\n * The orientation of the line:\n *\n * `true` create vertical lines, `false` creates horizontal lines\n * @default false\n */\n verticalLine?: boolean,\n /**\n * For animating interlaced lines\n * @default 0\n */\n time?: number,\n /**\n * Opacity/intensity of the noise effect between `0` and `1`\n * @default 0.3\n */\n noise?: number,\n /**\n * The size of the noise particles\n * @default 1\n */\n noiseSize?: number,\n /**\n * A seed value to apply to the random noise generation\n * @default 0\n */\n seed?: number,\n /**\n * The radius of the vignette effect, smaller values produces a smaller vignette\n * @default 0.3\n */\n vignetting?: number,\n /**\n * Amount of opacity on the vignette\n * @default 1\n */\n vignettingAlpha?: number,\n /**\n * Blur intensity of the vignette\n * @default 0.3\n */\n vignettingBlur?: number,\n}\n\n/**\n * The CRTFilter applies a CRT effect to an object.
\n * ![original](../screenshots/original.png)![filter](../screenshots/crt.png)\n *\n * @class\n * @extends Filter\n */\nexport class CRTFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: CRTFilterOptions = {\n curvature: 1.0,\n lineWidth: 1.0,\n lineContrast: 0.25,\n verticalLine: false,\n noise: 0.0,\n noiseSize: 1.0,\n vignetting: 0.3,\n vignettingAlpha: 1.0,\n vignettingBlur: 0.3,\n time: 0.0,\n seed: 0.0,\n };\n\n public uniforms: {\n uLine: Float32Array;\n uNoise: Float32Array;\n uVignette: Float32Array;\n uSeed: number;\n uTime: number;\n uDimensions: Float32Array;\n };\n\n /**\n * A seed value to apply to the random noise generation\n * @default 0\n */\n public seed!: number;\n\n /**\n * Opacity/intensity of the noise effect between `0` and `1`\n * @default 0.3\n */\n public time!: number;\n\n /**\n * @param options - Options for the CRTFilter constructor.\n */\n constructor(options?: CRTFilterOptions)\n {\n options = { ...CRTFilter.DEFAULT_OPTIONS, ...options };\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'crt-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n crtUniforms: {\n uLine: { value: new Float32Array(4), type: 'vec4' },\n uNoise: { value: new Float32Array(2), type: 'vec2' },\n uVignette: { value: new Float32Array(3), type: 'vec3' },\n uSeed: { value: options.seed, type: 'f32' },\n uTime: { value: options.time, type: 'f32' },\n uDimensions: { value: new Float32Array(2), type: 'vec2' },\n }\n },\n });\n\n this.uniforms = this.resources.crtUniforms.uniforms;\n\n Object.assign(this, options);\n }\n\n /**\n * Override existing apply method in `Filter`\n * @override\n * @ignore\n */\n public override apply(\n filterManager: FilterSystem,\n input: Texture,\n output: RenderSurface,\n clearMode: boolean\n ): void\n {\n this.uniforms.uDimensions[0] = input.frame.width;\n this.uniforms.uDimensions[1] = input.frame.height;\n\n this.uniforms.uSeed = this.seed;\n this.uniforms.uTime = this.time;\n\n filterManager.applyFilter(this, input, output, clearMode);\n }\n\n /**\n * Bend of interlaced lines, higher value means more bend\n * @default 1\n */\n get curvature(): number { return this.uniforms.uLine[0]; }\n set curvature(value: number) { this.uniforms.uLine[0] = value; }\n\n /**\n * Width of interlaced lines\n * @default 1\n */\n get lineWidth(): number { return this.uniforms.uLine[1]; }\n set lineWidth(value: number) { this.uniforms.uLine[1] = value; }\n\n /**\n * Contrast of interlaced lines\n * @default 0.25\n */\n get lineContrast(): number { return this.uniforms.uLine[2]; }\n set lineContrast(value: number) { this.uniforms.uLine[2] = value; }\n\n /**\n * The orientation of the line:\n *\n * `true` create vertical lines, `false` creates horizontal lines\n * @default false\n */\n get verticalLine(): boolean { return this.uniforms.uLine[3] > 0.5; }\n set verticalLine(value: boolean) { this.uniforms.uLine[3] = value ? 1 : 0; }\n\n /**\n * Opacity/intensity of the noise effect between `0` and `1`\n * @default 0.3\n */\n get noise(): number { return this.uniforms.uNoise[0]; }\n set noise(value: number) { this.uniforms.uNoise[0] = value; }\n\n /**\n * The size of the noise particles\n * @default 0\n */\n get noiseSize(): number { return this.uniforms.uNoise[1]; }\n set noiseSize(value: number) { this.uniforms.uNoise[1] = value; }\n\n /**\n * The radius of the vignette effect, smaller values produces a smaller vignette\n * @default 0.3\n */\n get vignetting(): number { return this.uniforms.uVignette[0]; }\n set vignetting(value: number) { this.uniforms.uVignette[0] = value; }\n\n /**\n * Amount of opacity of vignette\n * @default 1\n */\n get vignettingAlpha(): number { return this.uniforms.uVignette[1]; }\n set vignettingAlpha(value: number) { this.uniforms.uVignette[1] = value; }\n\n /**\n * Blur intensity of the vignette\n * @default 0.3\n */\n get vignettingBlur(): number { return this.uniforms.uVignette[2]; }\n set vignettingBlur(value: number) { this.uniforms.uVignette[2] = value; }\n}\n","import { deprecation, Filter, GlProgram, GpuProgram } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './dot.frag';\nimport source from './dot.wgsl';\n\n/** Options for the DotFilter constructor. */\nexport interface DotFilterOptions\n{\n /**\n * The scale of the effect\n * @default 1\n */\n scale?: number;\n /**\n * The angle of the effect\n * @default 5\n */\n angle?: number;\n /**\n * Whether to rendering it in gray scale\n * @default true\n */\n grayscale?: boolean;\n}\n\n/**\n * This filter applies a dotscreen effect making display objects appear to be made out of\n * black and white halftone dots like an old printer.
\n * ![original](../screenshots/original.png)![filter](../screenshots/dot.png)\n *\n * {@link https://github.com/evanw/glfx.js/blob/master/src/filters/fun/dotscreen.js Original filter}\n *\n * @class\n * @extends Filter\n */\nexport class DotFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: DotFilterOptions = {\n scale: 1,\n angle: 5,\n grayscale: true\n };\n\n /**\n * @param options - Options for the DotFilter constructor.\n */\n constructor(options?: DotFilterOptions);\n /**\n * @deprecated since 6.0.0\n *\n * @param {number} [scale=1] - The scale of the effect.\n * @param {number} [angle=5] - The radius of the effect.\n * @param {boolean} [grayscale=true] - Render as grayscale.\n */\n constructor(scale?: number, angle?: number, grayscale?: boolean);\n /** @ignore */\n constructor(...args: [DotFilterOptions?] | [number?, number?, boolean?])\n {\n let options = args[0] ?? {};\n\n if (typeof options === 'number')\n {\n // eslint-disable-next-line max-len\n deprecation('6.0.0', 'DotFilter constructor params are now options object. See params: { scale, angle, grayscale }');\n\n options = { scale: options };\n\n if (args[1] !== undefined) options.angle = args[1];\n if (args[2] !== undefined) options.grayscale = args[2];\n }\n\n options = { ...DotFilter.DEFAULT_OPTIONS, ...options };\n\n const dotUniforms = {\n uScale: { value: options.scale, type: 'f32' },\n uAngle: { value: options.angle, type: 'f32' },\n uGrayScale: { value: options.grayscale ? 1 : 0, type: 'f32' },\n };\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'dot-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n dotUniforms,\n },\n });\n }\n\n /**\n * The scale of the effect.\n * @default 1\n */\n get scale(): number { return this.resources.dotUniforms.uniforms.uScale; }\n set scale(value: number) { this.resources.dotUniforms.uniforms.uScale = value; }\n\n /**\n * The radius of the effect.\n * @default 5\n */\n get angle(): number { return this.resources.dotUniforms.uniforms.uAngle; }\n set angle(value: number) { this.resources.dotUniforms.uniforms.uAngle = value; }\n\n /**\n * Whether to rendering it in gray scale.\n * @default true\n */\n get grayscale(): boolean { return this.resources.dotUniforms.uniforms.uGrayScale === 1; }\n set grayscale(value: boolean) { this.resources.dotUniforms.uniforms.uGrayScale = value ? 1 : 0; }\n}\n","import {\n Color,\n ColorSource,\n Filter,\n FilterSystem,\n GlProgram,\n GpuProgram,\n PointData,\n RenderSurface,\n Texture,\n TexturePool,\n} from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport { KawaseBlurFilter } from '../kawase-blur/KawaseBlurFilter';\nimport fragment from './drop-shadow.frag';\nimport source from './drop-shadow.wgsl';\n\n/** Options for the DropShadowFilter constructor. */\nexport interface DropShadowFilterOptions\n{\n /**\n * The offset position of the drop-shadow relative to the original image.\n * @default {x:4,y:4}\n */\n offset?: PointData;\n /**\n * The color value of shadow.\n * @example [0.0, 0.0, 0.0] = 0x000000\n * @default 0x000000\n */\n color?: ColorSource;\n /**\n * Coefficient for alpha multiplication.\n * @default 1\n */\n alpha?: number;\n /**\n * Hide the contents, only show the shadow.\n * @default false\n */\n shadowOnly?: boolean;\n /**\n * The strength of the shadow's blur.\n * @default 2\n */\n blur?: number;\n /**\n * The quality of the Blur Filter.\n * @default 4\n */\n quality?: number;\n /**\n * The kernel size of the blur filter.\n * @default null\n */\n kernels?: number[];\n /**\n * The pixelSize of the Kawase Blur filter\n * @default {x:1,y:1}\n */\n pixelSize?: PointData | number[] | number;\n /**\n * The resolution of the Kawase Blur filter\n * @default 1\n */\n resolution?: number;\n}\n\n/**\n * Drop shadow filter.
\n * ![original](../screenshots/original.png)![filter](../screenshots/drop-shadow.png)\n * @class\n * @extends Filter\n */\nexport class DropShadowFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: DropShadowFilterOptions = {\n offset: { x: 4, y: 4 },\n color: 0x000000,\n alpha: 0.5,\n shadowOnly: false,\n kernels: undefined,\n blur: 2,\n quality: 3,\n pixelSize: { x: 1, y: 1 },\n resolution: 1,\n };\n\n public uniforms: {\n uAlpha: number;\n uColor: Float32Array;\n uOffset: PointData;\n };\n\n /**\n * Hide the contents, only show the shadow.\n * @default false\n */\n public shadowOnly = false;\n\n private _color!: Color;\n private _blurFilter: KawaseBlurFilter;\n private _basePass: Filter;\n\n /**\n * @param options - Options for the DropShadowFilter constructor.\n */\n constructor(options?: DropShadowFilterOptions)\n {\n options = { ...DropShadowFilter.DEFAULT_OPTIONS, ...options };\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'drop-shadow-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n dropShadowUniforms: {\n uAlpha: { value: options.alpha, type: 'f32' },\n uColor: { value: new Float32Array(3), type: 'vec3' },\n uOffset: { value: options.offset, type: 'vec2' },\n }\n },\n resolution: options.resolution,\n });\n\n this.uniforms = this.resources.dropShadowUniforms.uniforms;\n this._color = new Color();\n this.color = options.color ?? 0x000000;\n\n this._blurFilter = new KawaseBlurFilter({\n strength: options.kernels as [number, number] ?? options.blur,\n quality: options.kernels ? undefined : options.quality,\n });\n\n this._basePass = new Filter({\n gpuProgram: GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source: `\n @group(0) @binding(1) var uTexture: texture_2d; \n @group(0) @binding(2) var uSampler: sampler;\n @fragment\n fn mainFragment(\n @builtin(position) position: vec4,\n @location(0) uv : vec2\n ) -> @location(0) vec4 {\n return textureSample(uTexture, uSampler, uv);\n }\n `,\n entryPoint: 'mainFragment',\n },\n }),\n glProgram: GlProgram.from({\n vertex,\n fragment: `\n in vec2 vTextureCoord;\n out vec4 finalColor;\n uniform sampler2D uTexture;\n\n void main(void){\n finalColor = texture(uTexture, vTextureCoord);\n }\n `,\n name: 'drop-shadow-filter',\n }),\n resources: {},\n });\n\n Object.assign(this, options);\n }\n\n /**\n * Override existing apply method in `Filter`\n * @override\n * @ignore\n */\n public override apply(\n filterManager: FilterSystem,\n input: Texture,\n output: RenderSurface,\n clearMode: boolean,\n ): void\n {\n const renderTarget = TexturePool.getSameSizeTexture(input);\n\n filterManager.applyFilter(this, input, renderTarget, true);\n this._blurFilter.apply(filterManager, renderTarget, output, clearMode);\n\n if (!this.shadowOnly)\n {\n filterManager.applyFilter(this._basePass, input, output, false);\n }\n\n TexturePool.returnTexture(renderTarget);\n }\n\n /**\n * Set the offset position of the drop-shadow relative to the original image.\n * @default [4,4]\n */\n public get offset(): PointData { return this.uniforms.uOffset; }\n public set offset(value: PointData)\n {\n this.uniforms.uOffset = value;\n this._updatePadding();\n }\n\n /**\n * Set the offset position of the drop-shadow relative to the original image on the `x` axis\n * @default 4\n */\n get offsetX(): number { return this.offset.x; }\n set offsetX(value: number)\n {\n this.offset.x = value;\n this._updatePadding();\n }\n\n /**\n * Set the offset position of the drop-shadow relative to the original image on the `y` axis\n * @default 4\n */\n get offsetY(): number { return this.offset.y; }\n set offsetY(value: number)\n {\n this.offset.y = value;\n this._updatePadding();\n }\n\n /**\n * The color value of shadow.\n * @example [0.0, 0.0, 0.0] = 0x000000\n * @default 0x000000\n */\n get color(): ColorSource { return this._color.value as ColorSource; }\n set color(value: ColorSource)\n {\n this._color.setValue(value);\n const [r, g, b] = this._color.toArray();\n\n this.uniforms.uColor[0] = r;\n this.uniforms.uColor[1] = g;\n this.uniforms.uColor[2] = b;\n }\n\n /**\n * Coefficient for alpha multiplication\n * @default 1\n */\n get alpha(): number { return this.uniforms.uAlpha; }\n set alpha(value: number) { this.uniforms.uAlpha = value; }\n\n /**\n * The strength of the shadow's blur.\n * @default 2\n */\n get blur(): number { return this._blurFilter.strength; }\n set blur(value: number)\n {\n this._blurFilter.strength = value;\n this._updatePadding();\n }\n\n /**\n * Sets the quality of the Blur Filter\n * @default 4\n */\n get quality(): number { return this._blurFilter.quality; }\n set quality(value: number)\n {\n this._blurFilter.quality = value;\n this._updatePadding();\n }\n\n /** Sets the kernels of the Blur Filter */\n get kernels(): number[] { return this._blurFilter.kernels; }\n set kernels(value: number[]) { this._blurFilter.kernels = value; }\n\n /**\n * Sets the pixelSize of the Kawase Blur filter\n * @default [1,1]\n */\n get pixelSize(): PointData\n {\n return this._blurFilter.pixelSize as PointData;\n }\n set pixelSize(value: PointData | number[] | number)\n {\n if (typeof value === 'number')\n {\n value = { x: value, y: value };\n }\n\n if (Array.isArray(value))\n {\n value = { x: value[0], y: value[1] };\n }\n\n this._blurFilter.pixelSize = value;\n }\n\n /**\n * Sets the pixelSize of the Kawase Blur filter on the `x` axis\n * @default 1\n */\n get pixelSizeX(): number { return this._blurFilter.pixelSizeX; }\n set pixelSizeX(value: number) { this._blurFilter.pixelSizeX = value; }\n\n /**\n * Sets the pixelSize of the Kawase Blur filter on the `y` axis\n * @default 1\n */\n get pixelSizeY(): number { return this._blurFilter.pixelSizeY; }\n set pixelSizeY(value: number) { this._blurFilter.pixelSizeY = value; }\n\n /**\n * Recalculate the proper padding amount.\n * @private\n */\n private _updatePadding()\n {\n const offsetPadding = Math.max(\n Math.abs(this.offsetX),\n Math.abs(this.offsetY),\n );\n\n this.padding = offsetPadding + (this.blur * 2) + (this.quality * 4);\n }\n}\n","import { Filter, GlProgram, GpuProgram } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './emboss.frag';\nimport source from './emboss.wgsl';\n\n/**\n * An RGB Split Filter.
\n * ![original](../screenshots/original.png)![filter](../screenshots/emboss.png)\n *\n * @class\n * @extends Filter\n */\nexport class EmbossFilter extends Filter\n{\n public uniforms: {\n uStrength: number;\n };\n\n /**\n * @param {number} [strength=5] - Strength of the emboss.\n */\n constructor(strength = 5)\n {\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'emboss-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n embossUniforms: {\n uStrength: { value: strength, type: 'f32' },\n }\n },\n });\n\n this.uniforms = this.resources.embossUniforms.uniforms;\n }\n\n /**\n * Strength of the emboss\n * @default 5\n */\n get strength(): number { return this.uniforms.uStrength; }\n set strength(value: number) { this.uniforms.uStrength = value; }\n}\n","import { DEG_TO_RAD, Filter, GlProgram, GpuProgram, ImageSource, Texture } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './glitch.frag';\nimport source from './glitch.wgsl';\n\nimport type { FilterSystem, PointData, RenderSurface } from 'pixi.js';\n\nenum FILL_MODES\n {\n TRANSPARENT = 0,\n ORIGINAL = 1,\n LOOP = 2,\n CLAMP = 3,\n MIRROR = 4,\n}\n\n/** Options for the GlitchFilter constructor. */\nexport interface GlitchFilterOptions\n{\n /**\n * The count of glitch slices.\n * @default 5\n */\n slices?: number;\n /**\n * The maximum offset amount of slices.\n * @default 100\n */\n offset?: number;\n /**\n * The angle in degree of the offset of slices.\n * @default 0\n */\n direction?: number;\n /**\n * The fill mode of the space after the offset.\n * @default FILL_MODES.TRANSPARENT\n */\n fillMode?: number;\n /**\n * A seed value for randomizing glitch effect.\n * @default 0\n */\n seed?: number;\n /**\n * `true` will divide the bands roughly based on equal amounts\n * where as setting to `false` will vary the band sizes dramatically (more random looking).\n * @default false\n */\n average?: boolean;\n /**\n * Minimum size of slices as a portion of the `sampleSize`\n * @default 8\n */\n minSize?: number;\n /**\n * Height of the displacement map canvas.\n * @default 512\n */\n sampleSize?: number;\n /**\n * Red channel offset.\n * @default {x:0,y:0}\n */\n red?: PointData | number[];\n /**\n * Green channel offset.\n * @default {x:0,y:0}\n */\n green?: PointData | number[];\n /**\n * Blue offset.\n * @default {x:0,y:0}\n */\n blue?: PointData | number[];\n}\n\n/**\n * The GlitchFilter applies a glitch effect to an object.
\n * ![original](../screenshots/original.png)![filter](../screenshots/glitch.png)\n *\n * @class\n * @extends Filter\n */\nexport class GlitchFilter extends Filter\n{\n /** Default constructor options. */\n public static readonly defaults: GlitchFilterOptions = {\n slices: 5,\n offset: 100,\n direction: 0,\n fillMode: 0,\n average: false,\n seed: 0,\n red: { x: 0, y: 0 },\n green: { x: 0, y: 0 },\n blue: { x: 0, y: 0 },\n minSize: 8,\n sampleSize: 512,\n };\n\n public uniforms: {\n uSeed: number\n uDimensions: Float32Array,\n uAspect: number,\n uFillMode: number,\n uOffset: number,\n uDirection: number,\n uRed: PointData,\n uGreen: PointData,\n uBlue: PointData,\n };\n\n /**\n * `true` will divide the bands roughly based on equal amounts\n * where as setting to `false` will vary the band sizes dramatically (more random looking).\n */\n public average = false;\n\n /** Minimum size of slices as a portion of the `sampleSize` */\n public minSize = 8;\n\n /** Height of the displacement map canvas. */\n public sampleSize = 512;\n\n /** Internally generated canvas. */\n private _canvas: HTMLCanvasElement;\n\n /**\n * The displacement map is used to generate the bands.\n * If using your own texture, `slices` will be ignored.\n *\n * @member {Texture}\n * @readonly\n */\n public texture: Texture;\n\n /** Internal number of slices */\n private _slices = 0;\n\n private _sizes: Float32Array = new Float32Array(1);\n private _offsets: Float32Array = new Float32Array(1);\n\n /**\n * @param options - Options for the GlitchFilter constructor.\n */\n constructor(options?: GlitchFilterOptions)\n {\n options = { ...GlitchFilter.defaults, ...options };\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'glitch-filter',\n });\n\n const canvas = document.createElement('canvas');\n\n canvas.width = 4;\n canvas.height = options.sampleSize ?? 512;\n\n const texture = new Texture({\n source: new ImageSource({ resource: canvas })\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n glitchUniforms: {\n uSeed: { value: options?.seed ?? 0, type: 'f32' },\n uDimensions: { value: new Float32Array(2), type: 'vec2' },\n uAspect: { value: 1, type: 'f32' },\n uFillMode: { value: options?.fillMode ?? 0, type: 'f32' },\n uOffset: { value: options?.offset ?? 100, type: 'f32' },\n uDirection: { value: options?.direction ?? 0, type: 'f32' },\n uRed: { value: options.red, type: 'vec2' },\n uGreen: { value: options.green, type: 'vec2' },\n uBlue: { value: options.blue, type: 'vec2' },\n },\n uDisplacementMap: texture.source,\n uDisplacementSampler: texture.source.style,\n },\n });\n\n this.uniforms = this.resources.glitchUniforms.uniforms;\n\n this._canvas = canvas;\n this.texture = texture;\n\n Object.assign(this, options);\n }\n\n /**\n * Override existing apply method in Filter\n * @private\n */\n apply(\n filterManager: FilterSystem,\n input: Texture,\n output: RenderSurface,\n clearMode: boolean\n ): void\n {\n const { width, height } = input.frame;\n\n this.uniforms.uDimensions[0] = width;\n this.uniforms.uDimensions[1] = height;\n this.uniforms.uAspect = height / width;\n\n filterManager.applyFilter(this, input, output, clearMode);\n }\n\n /**\n * Randomize the slices size (heights).\n *\n * @private\n */\n private _randomizeSizes()\n {\n const arr = this._sizes;\n const last = this._slices - 1;\n const size = this.sampleSize;\n const min = Math.min(this.minSize / size, 0.9 / this._slices);\n\n if (this.average)\n {\n const count = this._slices;\n let rest = 1;\n\n for (let i = 0; i < last; i++)\n {\n const averageWidth = rest / (count - i);\n const w = Math.max(averageWidth * (1 - (Math.random() * 0.6)), min);\n\n arr[i] = w;\n rest -= w;\n }\n arr[last] = rest;\n }\n else\n {\n let rest = 1;\n const ratio = Math.sqrt(1 / this._slices);\n\n for (let i = 0; i < last; i++)\n {\n const w = Math.max(ratio * rest * Math.random(), min);\n\n arr[i] = w;\n rest -= w;\n }\n arr[last] = rest;\n }\n\n this.shuffle();\n }\n\n /**\n * Shuffle the sizes of the slices, advanced usage.\n */\n shuffle(): void\n {\n const arr = this._sizes;\n const last = this._slices - 1;\n\n // shuffle\n for (let i = last; i > 0; i--)\n {\n const rand = (Math.random() * i) >> 0;\n const temp = arr[i];\n\n arr[i] = arr[rand];\n arr[rand] = temp;\n }\n }\n\n /**\n * Randomize the values for offset from -1 to 1\n *\n * @private\n */\n private _randomizeOffsets(): void\n {\n for (let i = 0; i < this._slices; i++)\n {\n this._offsets[i] = Math.random() * (Math.random() < 0.5 ? -1 : 1);\n }\n }\n\n /**\n * Regenerating random size, offsets for slices.\n */\n refresh(): void\n {\n this._randomizeSizes();\n this._randomizeOffsets();\n this.redraw();\n }\n\n /**\n * Redraw displacement bitmap texture, advanced usage.\n */\n redraw(): void\n {\n const size = this.sampleSize;\n const texture = this.texture;\n const ctx = this._canvas.getContext('2d') as CanvasRenderingContext2D;\n\n ctx.clearRect(0, 0, 8, size);\n\n let offset;\n let y = 0;\n\n for (let i = 0; i < this._slices; i++)\n {\n offset = Math.floor(this._offsets[i] * 256);\n const height = this._sizes[i] * size;\n const red = offset > 0 ? offset : 0;\n const green = offset < 0 ? -offset : 0;\n\n ctx.fillStyle = `rgba(${red}, ${green}, 0, 1)`;\n ctx.fillRect(0, y >> 0, size, height + 1 >> 0);\n y += height;\n }\n\n texture.source.update();\n }\n\n /**\n * Manually custom slices size (height) of displacement bitmap\n *\n * @member {number[]|Float32Array}\n */\n set sizes(sizes: Float32Array)\n {\n const len = Math.min(this._slices, sizes.length);\n\n for (let i = 0; i < len; i++)\n {\n this._sizes[i] = sizes[i];\n }\n }\n get sizes(): Float32Array\n {\n return this._sizes;\n }\n\n /**\n * Manually set custom slices offset of displacement bitmap, this is\n * a collection of values from -1 to 1. To change the max offset value\n * set `offset`.\n *\n * @member {number[]|Float32Array}\n */\n set offsets(offsets: Float32Array)\n {\n const len = Math.min(this._slices, offsets.length);\n\n for (let i = 0; i < len; i++)\n {\n this._offsets[i] = offsets[i];\n }\n }\n get offsets(): Float32Array { return this._offsets; }\n\n /**\n * The count of slices.\n * @default 5\n */\n get slices(): number { return this._slices; }\n set slices(value: number)\n {\n if (this._slices === value) return;\n this._slices = value;\n this._sizes = new Float32Array(value);\n this._offsets = new Float32Array(value);\n this.refresh();\n }\n\n /**\n * The maximum offset amount of slices.\n * @default 100\n */\n get offset(): number { return this.uniforms.uOffset; }\n set offset(value: number) { this.uniforms.uOffset = value; }\n\n /**\n * A seed value for randomizing glitch effect.\n * @default 0\n */\n get seed(): number { return this.uniforms.uSeed; }\n set seed(value: number) { this.uniforms.uSeed = value; }\n\n /**\n * The fill mode of the space after the offset.\n * @default FILL_MODES.TRANSPARENT\n */\n get fillMode(): FILL_MODES { return this.uniforms.uFillMode; }\n set fillMode(value: FILL_MODES) { this.uniforms.uFillMode = value; }\n\n /**\n * The angle in degree of the offset of slices.\n * @default 0\n */\n get direction(): number { return this.uniforms.uDirection / DEG_TO_RAD; }\n set direction(value: number) { this.uniforms.uDirection = value * DEG_TO_RAD; }\n\n /**\n * Red channel offset.\n * @default {x:0,y:0}\n */\n get red(): PointData { return this.uniforms.uRed; }\n set red(value: PointData | number[])\n {\n if (Array.isArray(value))\n {\n value = { x: value[0], y: value[1] };\n }\n\n this.uniforms.uRed = value;\n }\n\n /**\n * Green channel offset.\n * @default {x:0,y:0}\n */\n get green(): PointData { return this.uniforms.uGreen; }\n set green(value: PointData | number[])\n {\n if (Array.isArray(value))\n {\n value = { x: value[0], y: value[1] };\n }\n\n this.uniforms.uGreen = value;\n }\n\n /**\n * Blue offset.\n * @default {x:0,y:0}\n */\n get blue(): PointData { return this.uniforms.uBlue; }\n set blue(value: PointData | number[])\n {\n if (Array.isArray(value))\n {\n value = { x: value[0], y: value[1] };\n }\n\n this.uniforms.uBlue = value;\n }\n\n /**\n * Removes all references\n */\n destroy(): void\n {\n this.texture?.destroy(true);\n this.texture\n = this._canvas\n = this.red\n = this.green\n = this.blue\n = this._sizes\n = this._offsets = null as any;\n }\n}\n","import { Color, ColorSource, Filter, GlProgram, GpuProgram } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './glow.frag';\nimport source from './glow.wgsl';\n\n/**\n * Options for the GlowFilter constructor.\n */\nexport interface GlowFilterOptions\n{\n /**\n * The distance of the glow\n * @default 10\n */\n distance?: number;\n /**\n * The strength of the glow outward from the edge of the sprite\n * @default 4\n */\n outerStrength?: number;\n /**\n * The strength of the glow inward from the edge of the sprite\n * @default 0\n */\n innerStrength?: number;\n /**\n * The color of the glow\n * @default 0xffffff\n */\n color?: ColorSource;\n /**\n * The alpha of the glow\n * @default 1\n */\n alpha?: number;\n /**\n * A number between 0 and 1 that describes the quality of the glow. The higher the number the less performant\n * @default 0.1\n */\n quality?: number;\n /**\n * Toggle to hide the contents and only show glow\n * @default false\n */\n knockout?: boolean;\n}\n\n/**\n * GlowFilter, originally by mishaa\n * [codepen]{@link http://codepen.io/mishaa/pen/raKzrm}.
\n * ![original](../screenshots/original.png)![filter](../screenshots/glow.png)\n * @class\n *\n * @extends Filter\n *\n * @example\n * someSprite.filters = [\n * new GlowFilter({ distance: 15, outerStrength: 2 })\n * ];\n */\nexport class GlowFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: GlowFilterOptions = {\n distance: 10,\n outerStrength: 4,\n innerStrength: 0,\n color: 0xffffff,\n alpha: 1,\n quality: 0.1,\n knockout: false,\n };\n\n public uniforms: {\n uDistance: number;\n uStrength: Float32Array;\n uColor: Float32Array;\n uAlpha: number;\n uQuality: number;\n uKnockout: number;\n };\n\n private _color!: Color;\n\n /**\n * @param options - Options for the GlowFilter constructor.\n */\n constructor(options?: GlowFilterOptions)\n {\n options = { ...GlowFilter.DEFAULT_OPTIONS, ...options };\n\n const distance = options.distance ?? 10;\n const quality = options.quality ?? 0.1;\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n // Altering uDistance and uQuality won't have any affect on WebGL\n // since we hard-assign them during creation to allow\n // for the values to be used in GLSL loops\n const glProgram = GlProgram.from({\n vertex,\n fragment: fragment\n .replace(/__ANGLE_STEP_SIZE__/gi, `${(1 / quality / distance).toFixed(7)}`)\n .replace(/__DIST__/gi, `${distance.toFixed(0)}.0`),\n name: 'glow-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n glowUniforms: {\n uDistance: { value: distance, type: 'f32' },\n uStrength: { value: [options.innerStrength, options.outerStrength], type: 'vec2' },\n uColor: { value: new Float32Array(3), type: 'vec3' },\n uAlpha: { value: options.alpha, type: 'f32' },\n uQuality: { value: quality, type: 'f32' },\n uKnockout: { value: (options?.knockout ?? false) ? 1 : 0, type: 'f32' },\n }\n },\n padding: distance,\n });\n\n this.uniforms = this.resources.glowUniforms.uniforms;\n this._color = new Color();\n this.color = options.color ?? 0xffffff;\n }\n\n /**\n * Only draw the glow, not the texture itself\n * @default false\n */\n get distance(): number { return this.uniforms.uDistance; }\n set distance(value: number) { this.uniforms.uDistance = this.padding = value; }\n\n /**\n * The strength of the glow inward from the edge of the sprite.\n * @default 0\n */\n get innerStrength(): number { return this.uniforms.uStrength[0]; }\n set innerStrength(value: number) { this.uniforms.uStrength[0] = value; }\n\n /**\n * The strength of the glow outward from the edge of the sprite.\n * @default 4\n */\n get outerStrength(): number { return this.uniforms.uStrength[1]; }\n set outerStrength(value: number) { this.uniforms.uStrength[1] = value; }\n\n /**\n * The color of the glow.\n * @default 0xFFFFFF\n */\n get color(): ColorSource { return this._color.value as ColorSource; }\n set color(value: ColorSource)\n {\n this._color.setValue(value);\n const [r, g, b] = this._color.toArray();\n\n this.uniforms.uColor[0] = r;\n this.uniforms.uColor[1] = g;\n this.uniforms.uColor[2] = b;\n }\n\n /**\n * The alpha of the glow\n * @default 1\n */\n get alpha(): number { return this.uniforms.uAlpha; }\n set alpha(value: number) { this.uniforms.uAlpha = value; }\n\n /**\n * A number between 0 and 1 that describes the quality of the glow. The higher the number the less performant\n * @default 0.1\n */\n get quality(): number { return this.uniforms.uQuality; }\n set quality(value: number) { this.uniforms.uQuality = value; }\n\n /**\n * Only draw the glow, not the texture itself\n * @default false\n */\n get knockout(): boolean { return this.uniforms.uKnockout === 1; }\n set knockout(value: boolean) { this.uniforms.uKnockout = value ? 1 : 0; }\n}\n","import { DEG_TO_RAD, Filter, GlProgram, GpuProgram } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './god-ray.frag';\nimport source from './god-ray.wgsl';\nimport perlin from './perlin.frag';\nimport sourcePerlin from './perlin.wgsl';\n\nimport type { FilterSystem, PointData, RenderSurface, Texture } from 'pixi.js';\n\n/** Options for the GodrayFilter constructor. */\nexport interface GodrayFilterOptions\n{\n /**\n * The angle/light-source of the rays in degrees. For instance,\n * a value of 0 is vertical rays, values of 90 or -90 produce horizontal rays.\n * @default 30\n */\n angle?: number;\n /**\n * `true` if light rays are parallel (uses angle), `false` to use the focal `center` point\n * @default true\n */\n parallel?: boolean;\n /**\n * Focal point for non-parallel rays, to use this `parallel` must be set to `false`.\n * This should be a size 2 array or an object containing `x` and `y` values, you cannot change types\n * once defined in the constructor\n * @default {x:0,y:0}\n */\n center?: PointData | number[];\n /**\n * General intensity of the effect. A value closer to 1 will produce a more intense effect,\n * where a value closer to 0 will produce a subtler effect.\n * @default 0.5\n */\n gain?: number;\n /**\n * The density of the fractal noise\n * @default 2.5\n */\n lacunarity?: number;\n /**\n * The current time position\n * @default 0\n */\n time?: number;\n /**\n * The alpha (opacity) of the rays. 0 is fully transparent, 1 is fully opaque.\n * @default 1\n */\n alpha?: number;\n}\n\n/**\n * GordayFilter, {@link https://codepen.io/alaingalvan originally} by Alain Galvan\n *\n *\n *\n * ![original](../screenshots/original.png)![filter](../screenshots/godray.gif)\n * @class\n * @extends Filter\n *\n * @example\n * displayObject.filters = [new GodrayFilter()];\n */\nexport class GodrayFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: GodrayFilterOptions = {\n angle: 30,\n gain: 0.5,\n lacunarity: 2.5,\n parallel: true,\n time: 0,\n center: { x: 0, y: 0 },\n alpha: 1,\n };\n\n public uniforms: {\n uLight: Float32Array;\n uParallel: number;\n uAspect: number;\n uTime: number;\n uRay: Float32Array;\n uDimensions: Float32Array;\n };\n\n /**\n * The current time position\n * @default 0\n */\n public time = 0;\n\n private _angleLight: [number, number] = [0, 0];\n private _angle = 0;\n private _center!: PointData;\n\n /**\n * @param options - Options for the GodrayFilter constructor.\n */\n constructor(options?: GodrayFilterOptions)\n {\n options = { ...GodrayFilter.DEFAULT_OPTIONS, ...options };\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source: source.replace('${PERLIN}', sourcePerlin),\n entryPoint: 'mainFragment',\n },\n });\n const glProgram = GlProgram.from({\n vertex,\n fragment: fragment.replace('${PERLIN}', perlin),\n name: 'god-ray-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n godrayUniforms: {\n uLight: { value: new Float32Array(2), type: 'vec2' },\n uParallel: { value: 0, type: 'f32' },\n uAspect: { value: 0, type: 'f32' },\n uTime: { value: options.time, type: 'f32' },\n uRay: { value: new Float32Array(3), type: 'vec3' },\n uDimensions: { value: new Float32Array(2), type: 'vec2' },\n }\n },\n });\n\n this.uniforms = this.resources.godrayUniforms.uniforms;\n\n Object.assign(this, options);\n }\n\n /**\n * Override existing apply method in Filter\n * @override\n * @ignore\n */\n public override apply(\n filterManager: FilterSystem,\n input: Texture,\n output: RenderSurface,\n clearMode: boolean\n ): void\n {\n const width = input.frame.width;\n const height = input.frame.height;\n\n this.uniforms.uLight[0] = this.parallel ? this._angleLight[0] : this._center.x;\n this.uniforms.uLight[1] = this.parallel ? this._angleLight[1] : this._center.y;\n this.uniforms.uDimensions[0] = width;\n this.uniforms.uDimensions[1] = height;\n this.uniforms.uAspect = height / width;\n this.uniforms.uTime = this.time;\n\n // draw the filter...\n filterManager.applyFilter(this, input, output, clearMode);\n }\n\n /**\n * The angle/light-source of the rays in degrees. For instance,\n * a value of 0 is vertical rays, values of 90 or -90 produce horizontal rays\n * @default 30\n */\n get angle(): number { return this._angle; }\n set angle(value: number)\n {\n this._angle = value;\n\n const radians = value * DEG_TO_RAD;\n\n this._angleLight[0] = Math.cos(radians);\n this._angleLight[1] = Math.sin(radians);\n }\n\n /**\n * `true` if light rays are parallel (uses angle), `false` to use the focal `center` point\n * @default true\n */\n get parallel(): boolean { return this.uniforms.uParallel > 0.5; }\n set parallel(value: boolean) { this.uniforms.uParallel = value ? 1 : 0; }\n\n /**\n * Focal point for non-parallel rays, to use this `parallel` must be set to `false`.\n * @default {x:0,y:0}\n */\n get center(): PointData { return this._center; }\n set center(value: PointData | number[])\n {\n if (Array.isArray(value))\n {\n value = { x: value[0], y: value[1] };\n }\n\n this._center = value;\n }\n\n /**\n * Focal point for non-parallel rays on the `x` axis, to use this `parallel` must be set to `false`.\n * @default 0\n */\n get centerX(): number { return this.center.x; }\n set centerX(value: number) { this.center.x = value; }\n\n /**\n * Focal point for non-parallel rays on the `y` axis, to use this `parallel` must be set to `false`.\n * @default 0\n */\n get centerY(): number { return this.center.y; }\n set centerY(value: number) { this.center.y = value; }\n\n /**\n * General intensity of the effect. A value closer to 1 will produce a more intense effect,\n * where a value closer to 0 will produce a subtler effect\n * @default 0.5\n */\n get gain(): number { return this.uniforms.uRay[0]; }\n set gain(value: number) { this.uniforms.uRay[0] = value; }\n\n /**\n * The density of the fractal noise.\n * A higher amount produces more rays and a smaller amount produces fewer waves\n * @default 2.5\n */\n get lacunarity(): number { return this.uniforms.uRay[1]; }\n set lacunarity(value: number) { this.uniforms.uRay[1] = value; }\n\n /**\n * The alpha (opacity) of the rays. 0 is fully transparent, 1 is fully opaque.\n * @default 1\n */\n get alpha(): number { return this.uniforms.uRay[2]; }\n set alpha(value: number) { this.uniforms.uRay[2] = value; }\n}\n","import { Filter, GlProgram, GpuProgram } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './grayscale.frag';\nimport source from './grayscale.wgsl';\n\n/**\n * This filter applies a grayscale effect.
\n * ![original](../screenshots/original.png)![filter](../screenshots/grayscale.png)\n *\n * @class\n * @extends Filter\n */\nexport class GrayscaleFilter extends Filter\n{\n constructor()\n {\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'grayscale-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {},\n });\n }\n}\n","import { Filter, GlProgram, GpuProgram } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './hsladjustment.frag';\nimport source from './hsladjustment.wgsl';\n\n/**\n * Options for the HslAdjustmentFilter constructor.\n */\nexport interface HslAdjustmentFilterOptions\n{\n /**\n * The amount of hue in degrees (-180 to 180)\n * @default 0\n */\n hue: number;\n /**\n * The amount of color saturation (-1 to 1)\n * @default 0\n */\n saturation: number;\n /**\n * The amount of lightness (-1 to 1)\n * @default 0\n */\n lightness: number;\n /**\n * Whether to colorize the image\n * @default false\n */\n colorize: boolean;\n /**\n * The amount of alpha (0 to 1)\n * @default 1\n */\n alpha: number;\n}\n\n/**\n * ![original](../screenshots/original.png)![filter](../screenshots/hsl-adjustment.png)\n *\n * This WebGPU filter has been ported from the WebGL renderer that was originally created by Viktor Persson (@vikpe)\n *\n * @class\n * @extends Filter\n */\nexport class HslAdjustmentFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: HslAdjustmentFilterOptions = {\n hue: 0,\n saturation: 0,\n lightness: 0,\n colorize: false,\n alpha: 1,\n };\n\n public uniforms: {\n uHsl: Float32Array;\n uColorize: number;\n uAlpha: number;\n };\n\n private _hue!: number;\n\n /**\n * @param options - Options for the HslAdjustmentFilter constructor.\n */\n constructor(options?: HslAdjustmentFilterOptions)\n {\n options = { ...HslAdjustmentFilter.DEFAULT_OPTIONS, ...options };\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'hsl-adjustment-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n hslUniforms: {\n uHsl: { value: new Float32Array(3), type: 'vec3' },\n uColorize: { value: options.colorize ? 1 : 0, type: 'f32' },\n uAlpha: { value: options.alpha, type: 'f32' },\n },\n },\n });\n\n this.uniforms = this.resources.hslUniforms.uniforms;\n this.hue = options.hue;\n }\n\n /**\n * The amount of hue in degrees (-180 to 180)\n * @default 0\n */\n get hue(): number { return this._hue; }\n set hue(value: number)\n {\n this._hue = value;\n this.resources.hslUniforms.uniforms.uHsl[0] = value * (Math.PI / 180);\n }\n\n /**\n * The amount of lightness (-1 to 1)\n * @default 0\n */\n get saturation(): number { return this.resources.hslUniforms.uniforms.uHsl[1]; }\n set saturation(value: number) { this.resources.hslUniforms.uniforms.uHsl[1] = value; }\n\n /**\n * The amount of lightness (-1 to 1)\n * @default 0\n */\n get lightness(): number { return this.resources.hslUniforms.uniforms.uHsl[2]; }\n set lightness(value: number) { this.resources.hslUniforms.uniforms.uHsl[2] = value; }\n\n /**\n * Whether to colorize the image\n * @default false\n */\n get colorize(): boolean { return this.resources.hslUniforms.uniforms.uColorize === 1; }\n set colorize(value: boolean) { this.resources.hslUniforms.uniforms.uColorize = value ? 1 : 0; }\n\n /**\n * The amount of alpha (0 to 1)\n * @default 1\n */\n get alpha(): number { return this.resources.hslUniforms.uniforms.uAlpha; }\n set alpha(value: number) { this.resources.hslUniforms.uniforms.uAlpha = value; }\n}\n","/* eslint-disable max-len */\nimport { deprecation, Filter, GlProgram, GpuProgram, ObservablePoint, PointData } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './motion-blur.frag';\nimport source from './motion-blur.wgsl';\n\n/** Options for the MotionBlurFilter constructor. */\nexport interface MotionBlurFilterOptions\n{\n /**\n * Sets the velocity of the motion for blur effect\n * This should be a size 2 array or an object containing `x` and `y` values, you cannot change types\n * once defined in the constructor\n * @default {x:0,y:0}\n */\n velocity?: PointData | number[];\n /**\n * The kernelSize of the blur filter. Must be odd number >= 5\n * @default 5\n */\n kernelSize?: number;\n /**\n * The offset of the blur filter\n * @default 0\n */\n offset?: number;\n}\n\n/**\n * The MotionBlurFilter applies a Motion blur to an object.
\n * ![original](../screenshots/original.png)![filter](../screenshots/motion-blur.png)\n *\n * @class\n * @extends Filter\n */\nexport class MotionBlurFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: MotionBlurFilterOptions = {\n velocity: { x: 0, y: 0 },\n kernelSize: 5,\n offset: 0,\n };\n\n public uniforms: {\n uVelocity: PointData;\n uKernelSize: number;\n uOffset: number;\n };\n\n private _kernelSize!: number;\n\n /**\n * @param options - Options for the MotionBlurFilter constructor.\n */\n constructor(options?: MotionBlurFilterOptions);\n /**\n * @deprecated since 8.0.0\n *\n * @param {PIXI.ObservablePoint|PIXI.PointData|number[]} [velocity=[0, 0]] - Sets the velocity of the motion for blur effect.\n * @param {number} [kernelSize=5] - The kernelSize of the blur filter. Must be odd number >= 5\n * @param {number} [offset=0] - The offset of the blur filter.\n */\n constructor(velocity?: number[] | PointData | ObservablePoint, kernelSize?: number, offset?: number);\n /** @ignore */\n constructor(...args: [MotionBlurFilterOptions?] | [(number[] | PointData | ObservablePoint)?, number?, number?])\n {\n let options = args[0] ?? {};\n\n if (Array.isArray(options) || ('x' in options && 'y' in options) || options instanceof ObservablePoint)\n {\n // eslint-disable-next-line max-len\n deprecation('6.0.0', 'MotionBlurFilter constructor params are now options object. See params: { velocity, kernelSize, offset }');\n\n const x = 'x' in options ? options.x : options[0];\n const y = 'y' in options ? options.y : options[1];\n\n options = { velocity: { x, y } };\n\n if (args[1] !== undefined) options.kernelSize = args[1];\n if (args[2] !== undefined) options.offset = args[2];\n }\n\n options = { ...MotionBlurFilter.DEFAULT_OPTIONS, ...options };\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'motion-blur-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n motionBlurUniforms: {\n uVelocity: { value: options.velocity, type: 'vec2' },\n uKernelSize: { value: Math.trunc(options.kernelSize ?? 5), type: 'f32' },\n uOffset: { value: options.offset, type: 'f32' },\n }\n },\n });\n\n this.uniforms = this.resources.motionBlurUniforms.uniforms;\n\n Object.assign(this, options);\n }\n\n /**\n * Sets the velocity of the motion for blur effect\n * This should be a size 2 array or an object containing `x` and `y` values, you cannot change types\n * once defined in the constructor\n * @default {x:0,y:0}\n */\n get velocity(): PointData { return this.uniforms.uVelocity; }\n set velocity(value: PointData | number[])\n {\n if (Array.isArray(value))\n {\n value = { x: value[0], y: value[1] };\n }\n\n this.uniforms.uVelocity = value;\n this._updateDirty();\n }\n\n /**\n * Sets the velocity of the motion for blur effect on the `x` axis\n * @default 0\n */\n get velocityX(): number { return this.velocity.x; }\n set velocityX(value: number)\n {\n this.velocity.x = value;\n this._updateDirty();\n }\n\n /**\n * Sets the velocity of the motion for blur effect on the `x` axis\n * @default 0\n */\n get velocityY(): number { return this.velocity.y; }\n set velocityY(value: number)\n {\n this.velocity.y = value;\n this._updateDirty();\n }\n\n /**\n * The kernelSize of the blur filter. Must be odd number >= 5\n * @default 5\n */\n get kernelSize(): number { return this._kernelSize; }\n set kernelSize(value: number)\n {\n this._kernelSize = value;\n this._updateDirty();\n }\n\n /**\n * The offset of the blur filter\n * @default 0\n */\n get offset(): number { return this.uniforms.uOffset; }\n set offset(value: number) { this.uniforms.uOffset = value; }\n\n private _updateDirty()\n {\n // The padding will be increased as the velocity and intern the blur size is changed\n this.padding = (Math.max(Math.abs(this.velocityX), Math.abs(this.velocityY)) >> 0) + 1;\n this.uniforms.uKernelSize = (this.velocityX !== 0 || this.velocityY !== 0) ? this._kernelSize : 0;\n }\n}\n","import { Color, ColorSource, deprecation, Filter, GlProgram, GpuProgram } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './multi-color-replace.frag';\nimport source from './multi-color-replace.wgsl';\n\ntype DeprecatedColor = number | number[] | Float32Array;\n\n/** Options for the MultiColorReplaceFilter constructor. */\nexport interface MultiColorReplaceFilterOptions\n{\n /**\n * The collection of replacement items. Each item is color-pair\n * (an array length is 2). In the pair, the first value is original color , the second value is target color\n *\n * _If you wish to change individual elements on the replacement array after instantiation,\n * use the `refresh` function to update the uniforms once you've made the changes_\n */\n replacements: Array<[ColorSource, ColorSource]>;\n /**\n * Tolerance/sensitivity of the floating-point comparison between colors (lower = more exact, higher = more inclusive)\n * @default 0.05\n */\n tolerance?: number\n /**\n * The maximum number of replacements filter is able to use.\n * Because the fragment is only compiled once, this cannot be changed after construction.\n * If omitted, the default value is the length of `replacements`\n */\n maxColors?: number;\n}\n\n/**\n * Filter for replacing a color with another color. Similar to ColorReplaceFilter, but support multiple\n * colors.
\n * ![original](../screenshots/original.png)![filter](../screenshots/multi-color-replace.png)\n * @class\n * @extends Filter\n *\n * @example\n * // replaces pure red with pure blue, and replaces pure green with pure white\n * someSprite.filters = [new MultiColorReplaceFilter({\n * replacements: [\n * [0xFF0000, 0x0000FF],\n * [0x00FF00, 0xFFFFFF]\n * ],\n * tolerance: 0.001\n * })];\n *\n * You also could use [R, G, B] as the color\n * someOtherSprite.filters = [new MultiColorReplaceFilter({\n * replacements: [\n * [ [1,0,0], [0,0,1] ],\n * [ [0,1,0], [1,1,1] ]\n * ],\n * tolerance: 0.001\n * })];\n *\n */\nexport class MultiColorReplaceFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: MultiColorReplaceFilterOptions = {\n replacements: [[0xff0000, 0x0000ff]],\n tolerance: 0.05,\n maxColors: undefined,\n };\n\n public uniforms: {\n uOriginalColors: Float32Array;\n uTargetColors: Float32Array;\n uTolerance: number;\n };\n\n private _replacements: Array<[ColorSource, ColorSource]> = [];\n private _maxColors: number;\n\n /**\n * @param options - Options for the MultiColorReplaceFilter constructor.\n */\n constructor(options?: MultiColorReplaceFilterOptions);\n /**\n * @deprecated since 6.0.0\n *\n * @param {Array} replacements - The collection of replacement items. Each item is color-pair\n * (an array length is 2). In the pair, the first value is original color , the second value\n * is target color.\n * @param {number} [epsilon=0.05] - Tolerance of the floating-point comparison between colors\n * (lower = more exact, higher = more inclusive)\n * @param {number} [maxColors] - The maximum number of replacements filter is able to use. Because the\n * fragment is only compiled once, this cannot be changed after construction.\n * If omitted, the default value is the length of `replacements`.\n */\n constructor(replacements: Array<[DeprecatedColor, DeprecatedColor]>, epsilon?: number, maxColors?: number);\n /** @ignore */\n constructor(...args: [MultiColorReplaceFilterOptions?] | [Array<[DeprecatedColor, DeprecatedColor]>, number?, number?])\n {\n let options = args[0] ?? {} as MultiColorReplaceFilterOptions;\n\n if (Array.isArray(options))\n {\n // eslint-disable-next-line max-len\n deprecation('6.0.0', 'MultiColorReplaceFilter constructor params are now options object. See params: { replacements, tolerance, maxColors }');\n\n options = { replacements: options };\n\n if (args[1]) options.tolerance = args[1];\n if (args[2]) options.maxColors = args[2];\n }\n\n options = { ...MultiColorReplaceFilter.DEFAULT_OPTIONS, ...options };\n\n const maxColors = options.maxColors ?? options.replacements.length;\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source: source.replace(/\\$\\{MAX_COLORS\\}/g, (maxColors).toFixed(0)),\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment: fragment.replace(/\\$\\{MAX_COLORS\\}/g, (maxColors).toFixed(0)),\n name: 'multi-color-replace-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n multiColorReplaceUniforms: {\n uOriginalColors: {\n value: new Float32Array(3 * maxColors),\n type: 'vec3',\n size: maxColors\n },\n uTargetColors: {\n value: new Float32Array(3 * maxColors),\n type: 'vec3',\n size: maxColors\n },\n uTolerance: { value: options.tolerance, type: 'f32' },\n }\n },\n });\n\n this._maxColors = maxColors;\n\n this.uniforms = this.resources.multiColorReplaceUniforms.uniforms;\n\n this.replacements = options.replacements;\n }\n\n /**\n * The collection of replacement items. Each item is color-pair\n * (an array length is 2). In the pair, the first value is original color , the second value is target color\n */\n set replacements(replacements: Array<[ColorSource, ColorSource]>)\n {\n const originals = this.uniforms.uOriginalColors;\n const targets = this.uniforms.uTargetColors;\n const colorCount = replacements.length;\n const color = new Color();\n\n if (colorCount > this._maxColors)\n {\n throw new Error(`Length of replacements (${colorCount}) exceeds the maximum colors length (${this._maxColors})`);\n }\n\n // Fill with negative values\n originals[colorCount * 3] = -1;\n\n let r;\n let g;\n let b;\n\n for (let i = 0; i < colorCount; i++)\n {\n const pair = replacements[i];\n\n // for original colors\n color.setValue(pair[0]);\n\n [r, g, b] = color.toArray();\n\n originals[i * 3] = r;\n originals[(i * 3) + 1] = g;\n originals[(i * 3) + 2] = b;\n\n // for target colors\n color.setValue(pair[1]);\n\n [r, g, b] = color.toArray();\n\n targets[i * 3] = r;\n targets[(i * 3) + 1] = g;\n targets[(i * 3) + 2] = b;\n }\n\n this._replacements = replacements;\n }\n\n get replacements(): Array<[ColorSource, ColorSource]>\n {\n return this._replacements;\n }\n\n /**\n * Should be called after changing any of the contents of the replacements.\n * This is a convenience method for resetting the `replacements`.\n * @todo implement nested proxy to remove the need for this function\n */\n refresh(): void\n {\n this.replacements = this._replacements;\n }\n\n /**\n * The maximum number of color replacements supported by this filter. Can be changed\n * _only_ during construction.\n * @readonly\n */\n get maxColors(): number { return this._maxColors; }\n\n /**\n * Tolerance of the floating-point comparison between colors (lower = more exact, higher = more inclusive)\n * @default 0.05\n */\n get tolerance(): number { return this.uniforms.uTolerance; }\n set tolerance(value: number) { this.uniforms.uTolerance = value; }\n\n /**\n * @deprecated since 6.0.0\n *\n * Tolerance of the floating-point comparison between colors (lower = more exact, higher = more inclusive)\n * @default 0.05\n */\n set epsilon(value: number)\n {\n // eslint-disable-next-line max-len\n deprecation('6.0.0', 'MultiColorReplaceFilter.epsilon is deprecated, please use MultiColorReplaceFilter.tolerance instead');\n this.tolerance = value;\n }\n get epsilon(): number\n {\n // eslint-disable-next-line max-len\n deprecation('6.0.0', 'MultiColorReplaceFilter.epsilon is deprecated, please use MultiColorReplaceFilter.tolerance instead');\n\n return this.tolerance;\n }\n}\n","import { Filter, GlProgram, GpuProgram } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './old-film.frag';\nimport source from './old-film.wgsl';\n\nimport type { FilterSystem, RenderSurface, Texture } from 'pixi.js';\n\n/** Options for the OldFilmFilter constructor. */\nexport interface OldFilmFilterOptions\n{\n /**\n * The amount of saturation of sepia effect,\n * a value of `1` is more saturation and closer to `0` is less, and a value of `0` produces no sepia effect\n * @default 0.3\n */\n sepia?: number;\n /**\n * Opacity/intensity of the noise effect between `0` and `1`\n * @default 0.3\n */\n noise?: number;\n /**\n * The size of the noise particles\n * @default 1\n */\n noiseSize?: number;\n /**\n * How often scratches appear\n * @default 0.5\n */\n scratch?: number;\n /**\n * The density of the number of scratches\n * @default 0.3\n */\n scratchDensity?: number;\n /**\n * The width of the scratches\n * @default 1\n */\n scratchWidth?: number;\n /**\n * The radius of the vignette effect, smaller values produces a smaller vignette\n * @default 0.3\n */\n vignetting?: number;\n /**\n * Amount of opacity on the vignette\n * @default 1\n */\n vignettingAlpha?: number;\n /**\n * Blur intensity of the vignette\n * @default 1\n */\n vignettingBlur?: number;\n /**\n * A seed value to apply to the random noise generation\n * @default 0\n */\n seed?: number;\n}\n\n/**\n * The OldFilmFilter applies a Old film effect to an object.
\n * ![original](../screenshots/original.png)![filter](../screenshots/old-film.gif)\n *\n * @class\n * @extends Filter\n */\nexport class OldFilmFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: OldFilmFilterOptions = {\n sepia: 0.3,\n noise: 0.3,\n noiseSize: 1,\n scratch: 0.5,\n scratchDensity: 0.3,\n scratchWidth: 1,\n vignetting: 0.3,\n vignettingAlpha: 1,\n vignettingBlur: 0.3,\n seed: 0\n };\n\n public uniforms: {\n uSepia: number;\n uNoise: Float32Array;\n uScratch: Float32Array;\n uVignetting: Float32Array;\n uSeed: number;\n uDimensions: Float32Array;\n };\n\n /**\n * A seed value to apply to the random noise generation\n * @default 0\n */\n public seed!: number;\n\n /**\n * @param options - Options for the OldFilmFilter constructor.\n */\n constructor(options?: OldFilmFilterOptions)\n {\n options = { ...OldFilmFilter.DEFAULT_OPTIONS, ...options };\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'old-film-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n oldFilmUniforms: {\n uSepia: { value: options.sepia, type: 'f32' },\n uNoise: { value: new Float32Array(2), type: 'vec2' },\n uScratch: { value: new Float32Array(3), type: 'vec3' },\n uVignetting: { value: new Float32Array(3), type: 'vec3' },\n uSeed: { value: options.seed, type: 'f32' },\n uDimensions: { value: new Float32Array(2), type: 'vec2' },\n }\n },\n });\n\n this.uniforms = this.resources.oldFilmUniforms.uniforms;\n\n Object.assign(this, options);\n }\n\n /**\n * Override existing apply method in `Filter`\n * @override\n * @ignore\n */\n public override apply(\n filterManager: FilterSystem,\n input: Texture,\n output: RenderSurface,\n clearMode: boolean\n ): void\n {\n this.uniforms.uDimensions[0] = input.frame.width;\n this.uniforms.uDimensions[1] = input.frame.height;\n this.uniforms.uSeed = this.seed;\n\n filterManager.applyFilter(this, input, output, clearMode);\n }\n\n /**\n * The amount of saturation of sepia effect,\n * a value of `1` is more saturation and closer to `0` is less, and a value of `0` produces no sepia effect\n * @default 0.3\n */\n get sepia(): number { return this.uniforms.uSepia; }\n set sepia(value: number) { this.uniforms.uSepia = value; }\n\n /**\n * Opacity/intensity of the noise effect between `0` and `1`\n * @default 0.3\n */\n get noise(): number { return this.uniforms.uNoise[0]; }\n set noise(value: number) { this.uniforms.uNoise[0] = value; }\n\n /**\n * The size of the noise particles\n * @default 1\n */\n get noiseSize(): number { return this.uniforms.uNoise[1]; }\n set noiseSize(value: number) { this.uniforms.uNoise[1] = value; }\n\n /**\n * How often scratches appear\n * @default 0.5\n */\n get scratch(): number { return this.uniforms.uScratch[0]; }\n set scratch(value: number) { this.uniforms.uScratch[0] = value; }\n\n /**\n * The density of the number of scratches\n * @default 0.3\n */\n get scratchDensity(): number { return this.uniforms.uScratch[1]; }\n set scratchDensity(value: number) { this.uniforms.uScratch[1] = value; }\n\n /**\n * The width of the scratches\n * @default 1\n */\n get scratchWidth(): number { return this.uniforms.uScratch[2]; }\n set scratchWidth(value: number) { this.uniforms.uScratch[2] = value; }\n\n /**\n * The radius of the vignette effect, smaller values produces a smaller vignette\n * @default 0.3\n */\n get vignetting(): number { return this.uniforms.uVignetting[0]; }\n set vignetting(value: number) { this.uniforms.uVignetting[0] = value; }\n\n /**\n * Amount of opacity on the vignette\n * @default 1\n */\n get vignettingAlpha(): number { return this.uniforms.uVignetting[1]; }\n set vignettingAlpha(value: number) { this.uniforms.uVignetting[1] = value; }\n\n /**\n * Blur intensity of the vignette\n * @default 1\n */\n get vignettingBlur(): number { return this.uniforms.uVignetting[2]; }\n set vignettingBlur(value: number) { this.uniforms.uVignetting[2] = value; }\n}\n","import { Color, deprecation, Filter, GlProgram, GpuProgram } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './outline.frag';\nimport source from './outline.wgsl';\n\nimport type { ColorSource, FilterSystem, RenderSurface, Texture } from 'pixi.js';\n\n/** Options for the OutlineFilter constructor. */\nexport interface OutlineFilterOptions\n{\n /**\n * The thickness of the outline\n * @default 1\n */\n thickness?: number;\n /**\n * The color of the outline\n * @example [1.0, 1.0, 1.0] = 0xffffff\n * @default 0x000000\n */\n color?: ColorSource;\n /**\n * The alpha of the outline\n * @default 1\n */\n alpha?: number;\n /**\n * The quality of the outline from `0` to `1`.\n * Using a higher quality setting will result in more accuracy but slower performance\n * @default 0.1\n */\n quality?: number;\n /**\n * Whether to only render outline, not the contents.\n * @default false\n */\n knockout?: boolean;\n}\n\n/**\n * OutlineFilter, originally by mishaa\n * http://www.html5gamedevs.com/topic/10640-outline-a-sprite-change-certain-colors/?p=69966\n * http://codepen.io/mishaa/pen/emGNRB
\n * ![original](../screenshots/original.png)![filter](../screenshots/outline.png)\n *\n * @class\n * @extends Filter *\n * @example\n * someSprite.filters = [new OutlineFilter(2, 0x99ff99)];\n */\nexport class OutlineFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: OutlineFilterOptions = {\n thickness: 1,\n color: 0x000000,\n alpha: 1,\n quality: 0.1,\n knockout: false,\n };\n\n /** The minimum number of samples for rendering outline. */\n public static MIN_SAMPLES = 1;\n\n /** The maximum number of samples for rendering outline. */\n public static MAX_SAMPLES = 100;\n\n public uniforms: {\n uThickness: Float32Array,\n uColor: Float32Array,\n uAlpha: number;\n uAngleStep: number,\n uKnockout: number,\n };\n\n private _thickness!: number;\n private _quality!: number;\n private _color!: Color;\n\n /**\n * @param options - Options for the OutlineFilter constructor.\n */\n constructor(options?: OutlineFilterOptions);\n /**\n * @deprecated since 6.0.0\n *\n * @param {number} [thickness=1] - The tickness of the outline. Make it 2 times more for resolution 2\n * @param {number} [color=0x000000] - The color of the outline.\n * @param {number} [quality=0.1] - The quality of the outline from `0` to `1`, using a higher quality\n * setting will result in slower performance and more accuracy.\n * @param {number} [alpha=1.0] - The alpha of the outline.\n * @param {boolean} [knockout=false] - Only render outline, not the contents.\n */\n constructor(thickness?: number, color?: number, quality?: number, alpha?: number, knockout?: boolean);\n /** @ignore */\n constructor(...args: [OutlineFilterOptions?] | [number?, number?, number?, number?, boolean?])\n {\n let options = args[0] ?? {};\n\n if (typeof options === 'number')\n {\n // eslint-disable-next-line max-len\n deprecation('6.0.0', 'OutlineFilter constructor params are now options object. See params: { thickness, color, quality, alpha, knockout }');\n\n options = { thickness: options };\n\n if (args[1] !== undefined) options.color = args[1];\n if (args[2] !== undefined) options.quality = args[2];\n if (args[3] !== undefined) options.alpha = args[3];\n if (args[4] !== undefined) options.knockout = args[4];\n }\n\n options = { ...OutlineFilter.DEFAULT_OPTIONS, ...options };\n\n const quality = options.quality ?? 0.1;\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment: fragment.replace(/\\$\\{ANGLE_STEP\\}/, OutlineFilter.getAngleStep(quality).toFixed(7)),\n name: 'outline-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n outlineUniforms: {\n uThickness: { value: new Float32Array(2), type: 'vec2' },\n uColor: { value: new Float32Array(3), type: 'vec3' },\n uAlpha: { value: options.alpha, type: 'f32' },\n uAngleStep: { value: 0, type: 'f32' },\n uKnockout: { value: options.knockout ? 1 : 0, type: 'f32' },\n }\n },\n });\n\n this.uniforms = this.resources.outlineUniforms.uniforms;\n this.uniforms.uAngleStep = OutlineFilter.getAngleStep(quality);\n this._color = new Color();\n this.color = options.color ?? 0x000000;\n\n Object.assign(this, options);\n }\n\n /**\n * Override existing apply method in `Filter`\n * @override\n * @ignore\n */\n public override apply(\n filterManager: FilterSystem,\n input: Texture,\n output: RenderSurface,\n clearMode: boolean\n ): void\n {\n this.uniforms.uThickness[0] = this.thickness / input.source.width;\n this.uniforms.uThickness[1] = this.thickness / input.source.height;\n\n filterManager.applyFilter(this, input, output, clearMode);\n }\n\n /**\n * Get the angleStep by quality\n * @param quality\n */\n private static getAngleStep(quality: number): number\n {\n return parseFloat(((Math.PI * 2) / Math.max(\n quality * OutlineFilter.MAX_SAMPLES,\n OutlineFilter.MIN_SAMPLES,\n )).toFixed(7));\n }\n\n /**\n * The thickness of the outline\n * @default 1\n */\n get thickness(): number { return this._thickness; }\n set thickness(value: number) { this._thickness = this.padding = value; }\n\n /**\n * The color value of the ambient color\n * @example [1.0, 1.0, 1.0] = 0xffffff\n * @default 0x000000\n */\n get color(): ColorSource { return this._color.value as ColorSource; }\n set color(value: ColorSource)\n {\n this._color.setValue(value);\n const [r, g, b] = this._color.toArray();\n\n this.uniforms.uColor[0] = r;\n this.uniforms.uColor[1] = g;\n this.uniforms.uColor[2] = b;\n }\n\n /**\n * Coefficient for alpha multiplication\n * @default 1\n */\n get alpha(): number { return this.uniforms.uAlpha; }\n set alpha(value: number) { this.uniforms.uAlpha = value; }\n\n /**\n * The quality of the outline from `0` to `1`.\n * Using a higher quality setting will result in more accuracy but slower performance\n * @default 0.1\n */\n get quality(): number { return this._quality; }\n set quality(value: number)\n {\n this._quality = value;\n this.uniforms.uAngleStep = OutlineFilter.getAngleStep(value);\n }\n\n /**\n * Whether to only render outline, not the contents.\n * @default false\n */\n get knockout(): boolean { return this.uniforms.uKnockout === 1; }\n set knockout(value: boolean) { this.uniforms.uKnockout = value ? 1 : 0; }\n}\n","import { Filter, GlProgram, GpuProgram, Point } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './pixelate.frag';\nimport source from './pixelate.wgsl';\n\ntype Size = number | number[] | Point;\n\n/**\n * This filter applies a pixelate effect making display objects appear 'blocky'.
\n * ![original](../screenshots/original.png)![filter](../screenshots/pixelate.png)\n *\n * @class\n * @extends Filter\n */\nexport class PixelateFilter extends Filter\n{\n /**\n * @param {Point|Array|number} [size=10] - Either the width/height of the size of the pixels, or square size\n */\n constructor(size: Size = 10)\n {\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'pixelate-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n pixelateUniforms: {\n uSize: { value: new Float32Array(2), type: 'vec2' },\n },\n },\n });\n\n this.size = size;\n }\n\n /**\n * The size of the pixels\n * @default [10,10]\n */\n get size(): Size { return this.resources.pixelateUniforms.uniforms.uSize; }\n set size(value: Size)\n {\n if (value instanceof Point)\n {\n this.sizeX = value.x;\n this.sizeY = value.y;\n }\n else if (Array.isArray(value))\n {\n this.resources.pixelateUniforms.uniforms.uSize = value;\n }\n else\n {\n this.sizeX = this.sizeY = value;\n }\n }\n\n /**\n * The size of the pixels on the `x` axis\n * @default 10\n */\n get sizeX(): number { return this.resources.pixelateUniforms.uniforms.uSize[0]; }\n set sizeX(value: number) { this.resources.pixelateUniforms.uniforms.uSize[0] = value; }\n\n /**\n * The size of the pixels on the `y` axis\n * @default 10\n */\n get sizeY(): number { return this.resources.pixelateUniforms.uniforms.uSize[1]; }\n set sizeY(value: number) { this.resources.pixelateUniforms.uniforms.uSize[1] = value; }\n}\n","import { deprecation, Filter, GlProgram, GpuProgram } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './radial-blur.frag';\nimport source from './radial-blur.wgsl';\n\nimport type { PointData } from 'pixi.js';\n\n/** Options for the RadialBlurFilter constructor. */\nexport interface RadialBlurFilterOptions\n{\n /**\n * Sets the angle of the motion for blur effect\n * @default 0\n */\n angle?: number;\n /**\n * The `x` and `y` offset coordinates to change the position of the center of the circle of effect.\n * This should be a size 2 array or an object containing `x` and `y` values, you cannot change types\n * once defined in the constructor\n * @default {x:0,y:0}\n */\n center?: PointData | number[];\n /**\n * The kernelSize of the blur filter. Must be odd number >= 3\n * @default 5\n */\n kernelSize?: number;\n /**\n * The maximum size of the blur radius, less than `0` equates to infinity\n * @default -1\n */\n radius?: number\n}\n\n/**\n * The RadialBlurFilter applies a Motion blur to an object.
\n * ![original](../screenshots/original.png)![filter](../screenshots/radial-blur.png)\n *\n * @class\n * @extends Filter\n */\nexport class RadialBlurFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: RadialBlurFilterOptions = {\n angle: 0,\n center: { x: 0, y: 0 },\n kernelSize: 5,\n radius: -1,\n };\n\n public uniforms: {\n uRadian: number;\n uCenter: PointData;\n uKernelSize: number;\n uRadius: number;\n };\n\n private _angle!: number;\n private _kernelSize!: number;\n\n /**\n * @param options - Options for the RadialBlurFilter constructor.\n */\n constructor(options?: RadialBlurFilterOptions);\n /**\n * @deprecated since 6.0.0\n *\n * @param {number} [angle=0] - Sets the angle of the motion for blur effect.\n * @param {PIXI.Point|number[]} [center=[0,0]] - The center of the radial.\n * @param {number} [kernelSize=5] - The kernelSize of the blur filter. Must be odd number >= 3\n * @param {number} [radius=-1] - The maximum size of the blur radius, `-1` is infinite\n */\n constructor(angle?: number, center?: PointData | number[], kernelSize?: number, radius?: number);\n /** @ignore */\n constructor(...args: [RadialBlurFilterOptions?] | [number?, (PointData | number[])?, number?, number?])\n {\n let options = args[0] ?? {};\n\n if (typeof options === 'number')\n {\n // eslint-disable-next-line max-len\n deprecation('6.0.0', 'RadialBlurFilter constructor params are now options object. See params: { angle, center, kernelSize, radius }');\n\n options = { angle: options };\n\n if (args[1])\n {\n const x = 'x' in args[1] ? args[1].x : args[1][0];\n const y = 'y' in args[1] ? args[1].y : args[1][1];\n\n options.center = { x, y };\n }\n if (args[2]) options.kernelSize = args[2];\n if (args[3]) options.radius = args[3];\n }\n\n options = { ...RadialBlurFilter.DEFAULT_OPTIONS, ...options };\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'radial-blur-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n radialBlurUniforms: {\n uRadian: { value: 0, type: 'f32' },\n uCenter: { value: options.center, type: 'vec2' },\n uKernelSize: { value: options.kernelSize, type: 'i32' },\n uRadius: { value: options.radius, type: 'f32' },\n }\n },\n });\n\n this.uniforms = this.resources.radialBlurUniforms.uniforms;\n\n Object.assign(this, options);\n }\n\n private _updateKernelSize()\n {\n this.uniforms.uKernelSize = this._angle !== 0 ? this.kernelSize : 0;\n }\n\n /**\n * Sets the angle in degrees of the motion for blur effect.\n * @default 0\n */\n get angle(): number { return this._angle; }\n set angle(value: number)\n {\n this._angle = value;\n this.uniforms.uRadian = value * Math.PI / 180;\n this._updateKernelSize();\n }\n\n /**\n * The `x` and `y` offset coordinates to change the position of the center of the circle of effect.\n * This should be a size 2 array or an object containing `x` and `y` values, you cannot change types\n * once defined in the constructor\n * @default {x:0,y:0}\n */\n get center(): PointData { return this.uniforms.uCenter; }\n set center(value: PointData | number[])\n {\n if (Array.isArray(value))\n {\n value = { x: value[0], y: value[1] };\n }\n\n this.uniforms.uCenter = value;\n }\n\n /**\n * Sets the velocity of the motion for blur effect on the `x` axis\n * @default 0\n */\n get centerX(): number { return this.center.x; }\n set centerX(value: number) { this.center.x = value; }\n\n /**\n * Sets the velocity of the motion for blur effect on the `x` axis\n * @default 0\n */\n get centerY(): number { return this.center.y; }\n set centerY(value: number) { this.center.y = value; }\n\n /**\n * The kernelSize of the blur filter. Must be odd number >= 3\n * @default 5\n */\n get kernelSize(): number { return this._kernelSize; }\n set kernelSize(value: number)\n {\n this._kernelSize = value;\n this._updateKernelSize();\n }\n\n /**\n * The maximum size of the blur radius, less than `0` equates to infinity\n * @default -1\n */\n get radius(): number { return this.uniforms.uRadius; }\n set radius(value: number) { this.uniforms.uRadius = value < 0 || value === Infinity ? -1 : value; }\n}\n","import { Filter, GlProgram, GpuProgram } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './reflection.frag';\nimport source from './reflection.wgsl';\n\nimport type { FilterSystem, RenderSurface, Texture } from 'pixi.js';\n\n/** [MIN, MAX] */\ntype Range = [number, number] | Float32Array;\n\n/** Options for the ReflectionFilter constructor. */\nexport interface ReflectionFilterOptions\n{\n /**\n * `true` to reflect the image, `false` for waves-only\n * @default true\n */\n mirror?: boolean;\n /**\n * Vertical position of the reflection point, `0.5` equates to the middle\n * smaller numbers produce a larger reflection, larger numbers produce a smaller reflection\n * @default 0.5\n */\n boundary?: number;\n /**\n * Starting and ending amplitude of waves\n * @default [0,20]\n */\n amplitude?: Range;\n /**\n * Starting and ending length of waves\n * @default [30,100]\n */\n waveLength?: Range;\n /**\n * Starting and ending alpha values\n * @default [1,1]\n */\n alpha?: Range;\n /**\n * Time for animating position of waves\n * @default 0\n */\n time?: number;\n}\n\n/**\n * Applies a reflection effect to simulate the reflection on water with waves.
\n * ![original](../screenshots/original.png)![filter](../screenshots/reflection.png)\n *\n * @class\n * @extends Filter\n */\nexport class ReflectionFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: ReflectionFilterOptions = {\n mirror: true,\n boundary: 0.5,\n amplitude: [0, 20],\n waveLength: [30, 100],\n alpha: [1, 1],\n time: 0,\n };\n\n public uniforms: {\n uMirror: number;\n uBoundary: number;\n uAmplitude: Float32Array;\n uWavelength: Float32Array;\n uAlpha: Float32Array;\n uTime: number;\n uDimensions: Float32Array;\n };\n\n /**\n * Time for animating position of waves\n * @default 0\n */\n public time = 0;\n\n /**\n * @param options - Options for the ReflectionFilter constructor.\n */\n constructor(options?: ReflectionFilterOptions)\n {\n options = { ...ReflectionFilter.DEFAULT_OPTIONS, ...options };\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'reflection-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n reflectionUniforms: {\n uMirror: { value: options.mirror ? 1 : 0, type: 'f32' },\n uBoundary: { value: options.boundary, type: 'f32' },\n uAmplitude: { value: options.amplitude, type: 'vec2' },\n uWavelength: { value: options.waveLength, type: 'vec2' },\n uAlpha: { value: options.alpha, type: 'vec2' },\n uTime: { value: options.time, type: 'f32' },\n uDimensions: { value: new Float32Array(2), type: 'vec2' },\n }\n },\n });\n\n this.uniforms = this.resources.reflectionUniforms.uniforms;\n\n Object.assign(this, options);\n }\n\n /**\n * Override existing apply method in `Filter`\n * @override\n * @ignore\n */\n public override apply(\n filterManager: FilterSystem,\n input: Texture,\n output: RenderSurface,\n clearMode: boolean\n ): void\n {\n this.uniforms.uDimensions[0] = input.frame.width;\n this.uniforms.uDimensions[1] = input.frame.height;\n\n this.uniforms.uTime = this.time;\n\n filterManager.applyFilter(this, input, output, clearMode);\n }\n\n /**\n * `true` to reflect the image, `false` for waves-only\n * @default true\n */\n get mirror(): boolean { return this.uniforms.uMirror > 0.5; }\n set mirror(value: boolean) { this.uniforms.uMirror = value ? 1 : 0; }\n\n /**\n * Vertical position of the reflection point, default is 50% (middle)\n * smaller numbers produce a larger reflection, larger numbers produce a smaller reflection.\n * @default 0.5\n */\n get boundary(): number { return this.uniforms.uBoundary; }\n set boundary(value: number) { this.uniforms.uBoundary = value; }\n\n /**\n * Starting and ending amplitude of waves\n * @default [0,20]\n */\n get amplitude(): Range { return Array.from(this.uniforms.uAmplitude) as Range; }\n set amplitude(value: Range)\n {\n this.uniforms.uAmplitude[0] = value[0];\n this.uniforms.uAmplitude[1] = value[1];\n }\n\n /**\n * Starting amplitude of waves\n * @default 0\n */\n get amplitudeStart(): number { return this.uniforms.uAmplitude[0]; }\n set amplitudeStart(value: number) { this.uniforms.uAmplitude[0] = value; }\n\n /**\n * Starting amplitude of waves\n * @default 20\n */\n get amplitudeEnd(): number { return this.uniforms.uAmplitude[1]; }\n set amplitudeEnd(value: number) { this.uniforms.uAmplitude[1] = value; }\n\n /**\n * Starting and ending length of waves\n * @default [30,100]\n */\n get waveLength(): Range { return Array.from(this.uniforms.uWavelength) as Range; }\n set waveLength(value: Range)\n {\n this.uniforms.uWavelength[0] = value[0];\n this.uniforms.uWavelength[1] = value[1];\n }\n\n /**\n * Starting wavelength of waves\n * @default 30\n */\n get wavelengthStart(): number { return this.uniforms.uWavelength[0]; }\n set wavelengthStart(value: number) { this.uniforms.uWavelength[0] = value; }\n\n /**\n * Starting wavelength of waves\n * @default 100\n */\n get wavelengthEnd(): number { return this.uniforms.uWavelength[1]; }\n set wavelengthEnd(value: number) { this.uniforms.uWavelength[1] = value; }\n\n /**\n * Starting and ending alpha values\n * @default [1,1]\n */\n get alpha(): Range { return Array.from(this.uniforms.uAlpha) as Range; }\n set alpha(value: Range)\n {\n this.uniforms.uAlpha[0] = value[0];\n this.uniforms.uAlpha[1] = value[1];\n }\n\n /**\n * Starting wavelength of waves\n * @default 1\n */\n get alphaStart(): number { return this.uniforms.uAlpha[0]; }\n set alphaStart(value: number) { this.uniforms.uAlpha[0] = value; }\n\n /**\n * Starting wavelength of waves\n * @default 1\n */\n get alphaEnd(): number { return this.uniforms.uAlpha[1]; }\n set alphaEnd(value: number) { this.uniforms.uAlpha[1] = value; }\n}\n","import { deprecation, Filter, GlProgram, GpuProgram, PointData } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './rgb-split.frag';\nimport source from './rgb-split.wgsl';\n\ntype OffsetType = PointData | [number, number];\n\n/** Options for the RGBSplitFilter constructor. */\nexport interface RGBSplitFilterOptions\n{\n /**\n * The amount of offset for the red channel.\n * @default {x:-10,y:0}\n */\n red?: OffsetType;\n /**\n * The amount of offset for the green channel.\n * @default {x:0,y:10}\n */\n green?: OffsetType;\n /**\n * The amount of offset for the blue channel.\n * @default {x:0,y:0}\n */\n blue?: OffsetType;\n}\n\n/**\n * An RGB Split Filter.
\n * ![original](../screenshots/original.png)![filter](../screenshots/rgb.png)\n *\n * @class\n * @extends Filter\n */\nexport class RGBSplitFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: RGBSplitFilterOptions = {\n red: { x: -10, y: 0 },\n green: { x: 0, y: 10 },\n blue: { x: 0, y: 0 },\n };\n\n public uniforms: {\n uRed: PointData;\n uGreen: PointData;\n uBlue: PointData;\n };\n\n /**\n * @param options - Options for the RGBSplitFilter constructor.\n */\n constructor(options?: RGBSplitFilterOptions);\n /**\n * @deprecated since 6.0.0\n *\n * @param {PIXI.PointData | number[]} [red=[-10,0]] - Red channel offset\n * @param {PIXI.PointData | number[]} [green=[0, 10]] - Green channel offset\n * @param {PIXI.PointData | number[]} [blue=[0, 0]] - Blue channel offset\n */\n constructor(red?: OffsetType, green?: OffsetType, blue?: OffsetType);\n /** @ignore */\n constructor(...args: [RGBSplitFilterOptions?] | [OffsetType?, OffsetType?, OffsetType?])\n {\n let options = args[0] ?? {};\n\n if (Array.isArray(options) || ('x' in options && 'y' in options))\n {\n // eslint-disable-next-line max-len\n deprecation('6.0.0', 'RGBSplitFilter constructor params are now options object. See params: { red, green, blue }');\n\n options = { red: options };\n\n if (args[1] !== undefined) options.green = args[1];\n if (args[2] !== undefined) options.blue = args[2];\n }\n\n options = { ...RGBSplitFilter.DEFAULT_OPTIONS, ...options };\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'rgb-split-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n rgbSplitUniforms: {\n uRed: { value: options.red, type: 'vec2' },\n uGreen: { value: options.green, type: 'vec2' },\n uBlue: { value: options.blue, type: 'vec2' },\n }\n },\n });\n\n this.uniforms = this.resources.rgbSplitUniforms.uniforms;\n\n Object.assign(this, options);\n }\n\n /**\n * Red channel offset.\n * @default {x:-10,y:0}\n */\n get red(): PointData { return this.uniforms.uRed; }\n set red(value: OffsetType)\n {\n if (Array.isArray(value))\n {\n value = { x: value[0], y: value[1] };\n }\n\n this.uniforms.uRed = value;\n }\n\n /**\n * Amount of x-axis offset for the red channel.\n * @default -10\n */\n get redX(): number { return this.red.x; }\n set redX(value: number) { this.red.x = value; }\n\n /**\n * Amount of y-axis offset for the red channel.\n * @default 0\n */\n get redY(): number { return this.red.y; }\n set redY(value: number) { this.red.y = value; }\n\n /**\n * Green channel offset.\n * @default {x:0,y:10}\n */\n get green(): PointData { return this.uniforms.uGreen; }\n set green(value: OffsetType)\n {\n if (Array.isArray(value))\n {\n value = { x: value[0], y: value[1] };\n }\n\n this.uniforms.uGreen = value;\n }\n\n /**\n * Amount of x-axis offset for the green channel.\n * @default 0\n */\n get greenX(): number { return this.green.x; }\n set greenX(value: number) { this.green.x = value; }\n\n /**\n * Amount of y-axis offset for the green channel.\n * @default 10\n */\n get greenY(): number { return this.green.y; }\n set greenY(value: number) { this.green.y = value; }\n\n /**\n * Blue channel offset.\n * @default {x:0,y:0}\n */\n get blue(): PointData { return this.uniforms.uBlue; }\n set blue(value: OffsetType)\n {\n if (Array.isArray(value))\n {\n value = { x: value[0], y: value[1] };\n }\n\n this.uniforms.uBlue = value;\n }\n\n /**\n * Amount of x-axis offset for the blue channel.\n * @default 0\n */\n get blueX(): number { return this.blue.x; }\n set blueX(value: number) { this.blue.x = value; }\n\n /**\n * Amount of y-axis offset for the blue channel.\n * @default 0\n */\n get blueY(): number { return this.blue.y; }\n set blueY(value: number) { this.blue.y = value; }\n}\n","import {\n deprecation,\n Filter,\n FilterSystem,\n GlProgram,\n GpuProgram,\n PointData,\n RenderSurface,\n Texture,\n} from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './shockwave.frag';\nimport source from './shockwave.wgsl';\n\n/** Options for the ShockwaveFilter constructor. */\nexport interface ShockwaveFilterOptions\n{\n /**\n * The `x` and `y` center coordinates to change the position of the center of the circle of effect.\n * @default {x:0,y:0}\n */\n center?: PointData;\n /**\n * The speed about the shockwave ripples out. The unit is `pixel-per-second`\n * @default 500\n */\n speed?: number;\n /**\n * The amplitude of the shockwave\n * @default 30\n */\n amplitude?: number;\n /**\n * The wavelength of the shockwave\n * @default 160\n */\n wavelength?: number;\n /**\n * The brightness of the shockwave\n * @default 1\n */\n brightness?: number;\n /**\n * The maximum radius of shockwave. less than `0` means the max is an infinite distance\n * @default -1\n */\n radius?: number;\n /**\n * Sets the elapsed time of the shockwave.\n * @default 0\n */\n time?: number;\n}\n\n/**\n * Create a visual wrinkle effect by like a pond or blast wave.
\n * ![original](../screenshots/original.png)![filter](../screenshots/shockwave.gif)\n *\n * {@link https://github.com/evanw/glfx.js/blob/master/src/filters/adjust/noise.js original filter}\n * @author Vico @vicocotea\n */\nexport class ShockwaveFilter extends Filter\n{\n /** Default shockwave filter options */\n public static readonly DEFAULT_OPTIONS: ShockwaveFilterOptions = {\n /** The `x` and `y` center coordinates to change the position of the center of the circle of effect. */\n center: { x: 0, y: 0 },\n /** The speed about the shockwave ripples out. The unit is `pixel-per-second` */\n speed: 500,\n /** The amplitude of the shockwave */\n amplitude: 30,\n /** The wavelength of the shockwave */\n wavelength: 160,\n /** The brightness of the shockwave */\n brightness: 1,\n /** The maximum radius of shockwave. less than `0` means the max is an infinite distance */\n radius: -1,\n };\n\n public uniforms: {\n uTime: number;\n uCenter: PointData;\n uSpeed: number;\n uWave: Float32Array;\n };\n\n /** Sets the elapsed time of the shockwave. It could control the current size of shockwave. */\n public time: number;\n\n /**\n * @param options - Options for the ShockwaveFilter constructor.\n */\n constructor(options?: ShockwaveFilterOptions);\n /**\n * @deprecated since 6.0.0\n *\n * @param {PIXI.PointData|number[]} [center=[0.5, 0.5]] - See `center` property.\n * @param {object} [options] - The optional parameters of shockwave filter.\n * @param {number} [options.amplitude=0.5] - See `amplitude`` property.\n * @param {number} [options.wavelength=1.0] - See `wavelength` property.\n * @param {number} [options.speed=500.0] - See `speed` property.\n * @param {number} [options.brightness=8] - See `brightness` property.\n * @param {number} [options.radius=4] - See `radius` property.\n * @param {number} [time=0] - See `time` property.\n */\n constructor(center?: PointData | number[], options?: Omit, time?: number);\n /** @ignore */\n // eslint-disable-next-line max-len\n constructor(...args: [ShockwaveFilterOptions?] | [(PointData | number[])?, Omit?, number?])\n {\n let options = args[0] ?? {};\n\n if (Array.isArray(options) || ('x' in options && 'y' in options))\n {\n // eslint-disable-next-line max-len\n deprecation('6.0.0', 'ShockwaveFilter constructor params are now options object. See params: { center, speed, amplitude, wavelength, brightness, radius, time }');\n\n options = { center: options, ...args[1] } as ShockwaveFilterOptions;\n\n if (args[2] !== undefined) options.time = args[2];\n }\n\n options = { ...ShockwaveFilter.DEFAULT_OPTIONS, ...options };\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'shockwave-filter'\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n shockwaveUniforms: {\n uTime: { value: options.time, type: 'f32' },\n uCenter: { value: options.center, type: 'vec2' },\n uSpeed: { value: options.speed, type: 'f32' },\n uWave: { value: new Float32Array(4), type: 'vec4' },\n },\n },\n });\n\n this.time = 0;\n\n this.uniforms = this.resources.shockwaveUniforms.uniforms;\n\n Object.assign(this, options);\n }\n\n public override apply(\n filterManager: FilterSystem,\n input: Texture,\n output: RenderSurface,\n clearMode: boolean\n ): void\n {\n // There is no set/get of `time`, for performance.\n // Because in the most real cases, `time` will be changed in ever game tick.\n // Use set/get will take more function-call.\n this.uniforms.uTime = this.time;\n filterManager.applyFilter(this, input, output, clearMode);\n }\n\n /**\n * The `x` and `y` center coordinates to change the position of the center of the circle of effect.\n * @default [0,0]\n */\n get center(): PointData { return this.uniforms.uCenter; }\n set center(value: PointData | number[])\n {\n if (Array.isArray(value))\n {\n value = { x: value[0], y: value[1] };\n }\n\n this.uniforms.uCenter = value;\n }\n\n /**\n * Sets the center of the effect in normalized screen coords on the `x` axis\n * @default 0\n */\n get centerX(): number { return this.uniforms.uCenter.x; }\n set centerX(value: number) { this.uniforms.uCenter.x = value; }\n\n /**\n * Sets the center of the effect in normalized screen coords on the `y` axis\n * @default 0\n */\n get centerY(): number { return this.uniforms.uCenter.y; }\n set centerY(value: number) { this.uniforms.uCenter.y = value; }\n\n /**\n * The speed about the shockwave ripples out. The unit is `pixel-per-second`\n * @default 500\n */\n get speed(): number { return this.uniforms.uSpeed; }\n set speed(value: number) { this.uniforms.uSpeed = value; }\n\n /**\n * The amplitude of the shockwave\n * @default 30\n */\n get amplitude(): number { return this.uniforms.uWave[0]; }\n set amplitude(value: number) { this.uniforms.uWave[0] = value; }\n\n /**\n * The wavelength of the shockwave\n * @default 160\n */\n get wavelength(): number { return this.uniforms.uWave[1]; }\n set wavelength(value: number) { this.uniforms.uWave[1] = value; }\n\n /**\n * The brightness of the shockwave\n * @default 1\n */\n get brightness(): number { return this.uniforms.uWave[2]; }\n set brightness(value: number) { this.uniforms.uWave[2] = value; }\n\n /**\n * The maximum radius of shockwave. less than `0` means the max is an infinite distance\n * @default -1\n */\n get radius(): number { return this.uniforms.uWave[3]; }\n set radius(value: number) { this.uniforms.uWave[3] = value; }\n}\n","import {\n Color,\n ColorSource,\n deprecation,\n Filter,\n FilterSystem,\n GlProgram,\n GpuProgram,\n RenderSurface,\n Texture,\n} from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './simple-lightmap.frag';\nimport source from './simple-lightmap.wgsl';\n\ntype DeprecatedColor = number | number[];\n\n/** Options for the SimpleLightmapFilter constructor. */\nexport interface SimpleLightmapFilterOptions\n{\n /** A texture where your lightmap is rendered */\n lightMap: Texture;\n /**\n * The color value of the ambient color\n * @example [1.0, 1.0, 1.0] = 0xffffff\n * @default 0x000000\n */\n color?: ColorSource;\n /**\n * Coefficient for alpha multiplication\n * @default 1\n */\n alpha?: number;\n}\n\n/**\n* SimpleLightmap, originally by Oza94\n* {@link http://www.html5gamedevs.com/topic/20027-pixijs-simple-lightmapping/}\n* {@link http://codepen.io/Oza94/pen/EPoRxj}\n*\n* You have to specify filterArea, or suffer consequences.\n* You may have to use it with `filter.dontFit = true`,\n* until we rewrite this using same approach as for DisplacementFilter.\n*\n* ![original](../screenshots/original.png)![filter](../screenshots/simple-lightmap.png)\n* @class\n* @extends Filter\n* @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n*\n* @example\n* displayObject.filters = [new SimpleLightmapFilter(texture, 0x666666)];\n*/\nexport class SimpleLightmapFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: SimpleLightmapFilterOptions = {\n lightMap: Texture.WHITE,\n color: 0x000000,\n alpha: 1\n };\n\n public uniforms: {\n uColor: Float32Array;\n uAlpha: number;\n uDimensions: Float32Array;\n };\n\n private _color!: Color;\n private _lightMap!: Texture;\n\n /**\n * @param options - Options for the SimpleLightmapFilter constructor.\n */\n constructor(options: SimpleLightmapFilterOptions);\n /**\n * @deprecated since 6.0.0\n *\n * @param {PIXI.Texture} texture - a texture where your lightmap is rendered\n * @param {Array|number} [color=0x000000] - An RGBA array of the ambient color\n * @param {number} [alpha=1] - Default alpha set independent of color (if it's a number, not array).\n */\n constructor(texture: Texture, color?: DeprecatedColor, alpha?: number);\n /** @ignore */\n constructor(...args: [SimpleLightmapFilterOptions] | [Texture, DeprecatedColor?, number?])\n {\n let options = args[0] ?? {};\n\n if (options instanceof Texture)\n {\n // eslint-disable-next-line max-len\n deprecation('6.0.0', 'SimpleLightmapFilter constructor params are now options object. See params: { lightMap, color, alpha }');\n\n options = { lightMap: options };\n\n if (args[1] !== undefined) options.color = args[1];\n if (args[2] !== undefined) options.alpha = args[2];\n }\n\n options = { ...SimpleLightmapFilter.DEFAULT_OPTIONS, ...options };\n\n if (!options.lightMap) throw Error('No light map texture source was provided to SimpleLightmapFilter');\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'simple-lightmap-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n simpleLightmapUniforms: {\n uColor: { value: new Float32Array(3), type: 'vec3' },\n uAlpha: { value: options.alpha, type: 'f32' },\n uDimensions: { value: new Float32Array(2), type: 'vec2' },\n },\n uMapTexture: options.lightMap.source,\n uMapSampler: options.lightMap.source.style,\n },\n });\n\n this.uniforms = this.resources.simpleLightmapUniforms.uniforms;\n this._color = new Color();\n this.color = options.color ?? 0x000000;\n\n Object.assign(this, options);\n }\n\n /**\n * Override existing apply method in `Filter`\n * @override\n * @ignore\n */\n public override apply(\n filterManager: FilterSystem,\n input: Texture,\n output: RenderSurface,\n clearMode: boolean,\n ): void\n {\n this.uniforms.uDimensions[0] = input.frame.width;\n this.uniforms.uDimensions[1] = input.frame.height;\n\n // draw the filter...\n filterManager.applyFilter(this, input, output, clearMode);\n }\n\n /** A sprite where your lightmap is rendered */\n get lightMap(): Texture { return this._lightMap; }\n set lightMap(value: Texture)\n {\n this._lightMap = value;\n this.resources.uMapTexture = value.source;\n this.resources.uMapSampler = value.source.style;\n }\n\n /**\n * The color value of the ambient color\n * @example [1.0, 1.0, 1.0] = 0xffffff\n * @default 0x000000\n */\n get color(): ColorSource { return this._color.value as ColorSource; }\n set color(value: ColorSource)\n {\n this._color.setValue(value);\n const [r, g, b] = this._color.toArray();\n\n this.uniforms.uColor[0] = r;\n this.uniforms.uColor[1] = g;\n this.uniforms.uColor[2] = b;\n }\n\n /**\n * Coefficient for alpha multiplication\n * @default 1\n */\n get alpha(): number { return this.uniforms.uAlpha; }\n set alpha(value: number) { this.uniforms.uAlpha = value; }\n}\n","import { Filter, GlProgram, GpuProgram, PointData } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './tilt-shift.frag';\nimport source from './tilt-shift.wgsl';\n\n// @author Vico @vicocotea\n// original filter https://github.com/evanw/glfx.js/blob/master/src/filters/blur/tiltshift.js\n// by Evan Wallace : http://madebyevan.com/\n\n/**\n * Options for creating filter.\n */\ninterface TiltShiftAxisFilterOptions\n{\n /** The strength of the blur. */\n blur?: number;\n /** The strength of the blur gradient */\n gradientBlur?: number;\n /** The position to start the effect at. */\n start?: PointData;\n /** The position to end the effect at. */\n end?: PointData;\n /** The axis that the filter is calculating for. */\n axis?: 'vertical' | 'horizontal';\n}\n\n/**\n * A TiltShiftAxisFilter.\n *\n * @class\n * @extends Filter\n * @private\n */\nexport class TiltShiftAxisFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: TiltShiftAxisFilterOptions = {\n /** The strength of the blur. */\n blur: 100,\n /** The strength of the blur gradient */\n gradientBlur: 600,\n /** The position to start the effect at. */\n start: { x: 0, y: window.innerHeight / 2 },\n /** The position to end the effect at. */\n end: { x: 600, y: window.innerHeight / 2 },\n };\n\n public uniforms: {\n uBlur: Float32Array;\n uStart: PointData\n uEnd: PointData;\n uDelta: Float32Array;\n uTexSize: Float32Array;\n };\n\n private _tiltAxis: TiltShiftAxisFilterOptions['axis'];\n\n constructor(options?: TiltShiftAxisFilterOptions)\n {\n options = { ...TiltShiftAxisFilter.DEFAULT_OPTIONS, ...options } as TiltShiftAxisFilterOptions;\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'tilt-shift-axis-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n tiltShiftUniforms: {\n uBlur: {\n value: new Float32Array([\n options.blur ?? 100,\n options.gradientBlur ?? 600\n ]), type: 'vec2'\n },\n uStart: { value: options.start, type: 'vec2' },\n uEnd: { value: options.end, type: 'vec2' },\n uDelta: { value: new Float32Array([30, 30]), type: 'vec2' },\n uTexSize: { value: new Float32Array([window.innerWidth, window.innerHeight]), type: 'vec2' },\n },\n },\n });\n\n this.uniforms = this.resources.tiltShiftUniforms.uniforms;\n this._tiltAxis = options.axis;\n this.updateDelta();\n }\n\n /** Updates the filter delta values. */\n protected updateDelta(): void\n {\n this.uniforms.uDelta[0] = 0;\n this.uniforms.uDelta[1] = 0;\n\n if (this._tiltAxis === undefined) return;\n\n const end = this.uniforms.uEnd;\n const start = this.uniforms.uStart;\n\n const dx = end.x - start.x;\n const dy = end.y - start.y;\n const d = Math.sqrt((dx * dx) + (dy * dy));\n\n const isVert = this._tiltAxis === 'vertical';\n\n this.uniforms.uDelta[0] = !isVert ? dx / d : -dy / d;\n this.uniforms.uDelta[1] = !isVert ? dy / d : dx / d;\n }\n\n // /** The strength of the blur. */\n // get blur(): number { return this.uniforms.uBlur[0]; }\n // set blur(value: number) { this.uniforms.uBlur[0] = value; }\n\n // /** The strength of the gradient blur. */\n // get gradientBlur(): number { return this.uniforms.uBlur[1]; }\n // set gradientBlur(value: number) { this.uniforms.uBlur[1] = value; }\n\n // /** The start position of the effect. */\n // get start(): PointData { return this.uniforms.uStart; }\n // set start(value: PointData)\n // {\n // this.uniforms.uStart = value;\n // this.updateDelta();\n // }\n\n // /** The start position of the effect on the `x` axis. */\n // get startX(): number { return this.start.x; }\n // set startX(value: number)\n // {\n // this.start.x = value;\n // this.updateDelta();\n // }\n\n // /** The start position of the effect on the `y` axis. */\n // get startY(): number { return this.startY; }\n // set startY(value: number)\n // {\n // this.start.y = value;\n // this.updateDelta();\n // }\n\n // /** The end position of the effect. */\n // get end(): PointData { return this.uniforms.uEnd; }\n // set end(value: PointData)\n // {\n // this.uniforms.uEnd = value;\n // this.updateDelta();\n // }\n\n // /** The end position of the effect on the `x` axis. */\n // get endX(): number { return this.end.x; }\n // set endX(value: number)\n // {\n // this.end.x = value;\n // this.updateDelta();\n // }\n\n // /** The end position of the effect on the `y` axis. */\n // get endY(): number { return this.end.y; }\n // set endY(value: number)\n // {\n // this.end.y = value;\n // this.updateDelta();\n // }\n}\n","import { FilterSystem, TexturePool } from 'pixi.js';\nimport { TiltShiftAxisFilter } from './TiltShiftAxisFilter';\n\nimport type { PointData, RenderSurface, Texture } from 'pixi.js';\n\n/** Options for the TiltShiftFilter constructor. */\nexport interface TiltShiftFilterOptions\n{\n /** The strength of the blur. */\n blur?: number;\n /** The strength of the blur gradient */\n gradientBlur?: number;\n /** The position to start the effect at. */\n start?: PointData;\n /** The position to end the effect at. */\n end?: PointData;\n}\n\n/**\n * A TiltShift Filter. Manages the pass of both a TiltShiftXFilter and TiltShiftYFilter.
\n * ![original](../screenshots/original.png)![filter](../screenshots/tilt-shift.png)\n *\n * author Vico @vicocotea\n * {@link https://github.com/evanw/glfx.js/blob/master/src/filters/blur/tiltshift.js original filter }\n * by {@link http://madebyevan.com/ Evan Wallace }\n *\n * @class\n * @extends Filter\n */\nexport class TiltShiftFilter extends TiltShiftAxisFilter\n{\n private _tiltShiftYFilter: TiltShiftAxisFilter;\n\n /**\n * @param options - Options for the TiltShiftFilter constructor.\n */\n constructor(options?: TiltShiftFilterOptions)\n {\n options = { ...TiltShiftAxisFilter.DEFAULT_OPTIONS, ...options };\n\n super({ ...options, axis: 'horizontal' });\n this._tiltShiftYFilter = new TiltShiftAxisFilter({ ...options, axis: 'vertical' });\n\n Object.assign(this, options);\n }\n\n /**\n * Override existing apply method in `Filter`\n * @override\n * @ignore\n */\n public override apply(\n filterManager: FilterSystem,\n input: Texture,\n output: RenderSurface,\n clearMode: boolean,\n ): void\n {\n const renderTarget = TexturePool.getSameSizeTexture(input);\n\n filterManager.applyFilter(this, input, renderTarget, true);\n filterManager.applyFilter(this._tiltShiftYFilter, renderTarget, output, clearMode);\n\n TexturePool.returnTexture(renderTarget);\n }\n\n /** The strength of the blur. */\n get blur(): number { return this.uniforms.uBlur[0]; }\n set blur(value: number) { this.uniforms.uBlur[0] = this._tiltShiftYFilter.uniforms.uBlur[0] = value; }\n\n /** The strength of the gradient blur. */\n get gradientBlur(): number { return this.uniforms.uBlur[1]; }\n set gradientBlur(value: number) { this.uniforms.uBlur[1] = this._tiltShiftYFilter.uniforms.uBlur[1] = value; }\n\n /** The position to start the effect at. */\n get start(): PointData { return this.uniforms.uStart; }\n set start(value: PointData) { this.uniforms.uStart = this._tiltShiftYFilter.uniforms.uStart = value; }\n\n /** The position to start the effect at on the `x` axis. */\n get startX(): number { return this.start.x; }\n set startX(value: number) { this.start.x = value; }\n\n /** The position to start the effect at on the `x` axis. */\n get startY(): number { return this.start.y; }\n set startY(value: number) { this.start.y = value; }\n\n /** The position to end the effect at. */\n get end(): PointData { return this.uniforms.uEnd; }\n set end(value: PointData) { this.uniforms.uEnd = this._tiltShiftYFilter.uniforms.uEnd = value; }\n\n /** The position to end the effect at on the `x` axis. */\n get endX(): number { return this.end.x; }\n set endX(value: number) { this.end.x = value; }\n\n /** The position to end the effect at on the `y` axis. */\n get endY(): number { return this.end.y; }\n set endY(value: number) { this.end.y = value; }\n}\n\n","import { Filter, GlProgram, GpuProgram, PointData } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './twist.frag';\nimport source from './twist.wgsl';\n\n/** Options for the TwistFilter constructor. */\nexport interface TwistFilterOptions\n{\n /**\n * Padding for the filter area\n * @default 20\n */\n padding?: number;\n /**\n * The radius of the twist\n * @default 200\n */\n radius?: number;\n /**\n * The angle of the twist\n * @default 4\n */\n angle?: number;\n /**\n * The `x` and `y` offset coordinates to change the position of the center of the circle of effect.\n * This should be a size 2 array or an object containing `x` and `y` values, you cannot change types\n * once defined in the constructor\n * @default {x:0,y:0}\n */\n offset?: PointData;\n}\n\n/**\n * This filter applies a twist effect making display objects appear twisted in the given direction.
\n * ![original](../screenshots/original.png)![filter](../screenshots/twist.png)\n *\n * @class\n * @extends Filter\n */\nexport class TwistFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: TwistFilterOptions = {\n padding: 20,\n radius: 200,\n angle: 4,\n offset: { x: 0, y: 0 },\n };\n\n public uniforms: {\n uTwist: Float32Array;\n uOffset: PointData;\n };\n\n /**\n * @param options - Options for the TwistFilter constructor.\n */\n constructor(options?: Partial)\n {\n options = { ...TwistFilter.DEFAULT_OPTIONS, ...options };\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source,\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment,\n name: 'twist-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n twistUniforms: {\n uTwist: {\n value: [options.radius ?? 0, options.angle ?? 0],\n type: 'vec2'\n },\n uOffset: {\n value: options.offset,\n type: 'vec2'\n },\n }\n },\n ...options,\n });\n\n this.uniforms = this.resources.twistUniforms.uniforms;\n }\n\n /**\n * The radius of the twist\n * @default 200\n */\n get radius(): number { return this.uniforms.uTwist[0]; }\n set radius(value: number) { this.uniforms.uTwist[0] = value; }\n\n /**\n * The angle of the twist\n * @default 4\n */\n get angle(): number { return this.uniforms.uTwist[1]; }\n set angle(value: number) { this.uniforms.uTwist[1] = value; }\n\n /**\n * The `x` offset coordinate to change the position of the center of the circle of effect\n * @default 0\n */\n get offset(): PointData { return this.uniforms.uOffset; }\n set offset(value: PointData) { this.uniforms.uOffset = value; }\n\n /**\n * The `x` offset coordinate to change the position of the center of the circle of effect\n * @default 0\n */\n get offsetX(): number { return this.offset.x; }\n set offsetX(value: number) { this.offset.x = value; }\n\n /**\n * The `y` offset coordinate to change the position of the center of the circle of effect\n * @default 0\n */\n get offsetY(): number { return this.offset.y; }\n set offsetY(value: number) { this.offset.y = value; }\n}\n","import { Filter, GlProgram, GpuProgram, PointData } from 'pixi.js';\nimport { vertex, wgslVertex } from '../defaults';\nimport fragment from './zoom-blur.frag';\nimport source from './zoom-blur.wgsl';\n\n/** Options for the ZoomBlurFilter constructor. */\nexport interface ZoomBlurFilterOptions\n{\n /**\n * Sets the strength of the zoom blur effect\n * @default 0.1\n */\n strength?: number;\n /**\n * The `x` and `y` offset coordinates to change the position of the center of the circle of effect.\n * This should be a size 2 array or an object containing `x` and `y` values, you cannot change types\n * once defined in the constructor\n * @default {x:0,y:0}\n */\n center?: PointData | number[];\n /**\n * The inner radius of zoom. The part in inner circle won't apply zoom blur effect\n * @default 0\n */\n innerRadius?: number;\n /**\n * Outer radius of the effect. less than `0` equates to infinity\n * @default -1\n */\n radius?: number;\n /**\n * On older iOS devices, it's better to not go above `13.0`.\n * Decreasing this value will produce a lower-quality blur effect with more dithering\n * @default 32\n */\n maxKernelSize?: number;\n}\n\n/**\n * The ZoomFilter applies a Zoom blur to an object.
\n * ![original](../screenshots/original.png)![filter](../screenshots/zoom-blur.png)\n *\n * @class\n * @extends Filter\n */\nexport class ZoomBlurFilter extends Filter\n{\n /** Default values for options. */\n public static readonly DEFAULT_OPTIONS: ZoomBlurFilterOptions = {\n strength: 0.1,\n center: { x: 0, y: 0 },\n innerRadius: 0,\n radius: -1,\n maxKernelSize: 32,\n };\n\n public uniforms: {\n uStrength: number;\n uCenter: PointData;\n uRadii: Float32Array\n };\n\n /**\n * @param options - Options for the ZoomBlurFilter constructor.\n */\n constructor(options?: ZoomBlurFilterOptions)\n {\n options = { ...ZoomBlurFilter.DEFAULT_OPTIONS, ...options };\n\n const kernelSize = options.maxKernelSize ?? 32;\n\n const gpuProgram = GpuProgram.from({\n vertex: {\n source: wgslVertex,\n entryPoint: 'mainVertex',\n },\n fragment: {\n source: source.replace('${MAX_KERNEL_SIZE}', kernelSize.toFixed(1)),\n entryPoint: 'mainFragment',\n },\n });\n\n const glProgram = GlProgram.from({\n vertex,\n fragment: fragment.replace('${MAX_KERNEL_SIZE}', kernelSize.toFixed(1)),\n name: 'zoom-blur-filter',\n });\n\n super({\n gpuProgram,\n glProgram,\n resources: {\n zoomBlurUniforms: {\n uStrength: { value: options.strength, type: 'f32' },\n uCenter: { value: options.center, type: 'vec2' },\n uRadii: { value: new Float32Array(2), type: 'vec2' },\n }\n },\n });\n\n this.uniforms = this.resources.zoomBlurUniforms.uniforms;\n\n Object.assign(this, options);\n }\n\n /**\n * Sets the strength of the zoom blur effect\n * @default 0.1\n */\n get strength(): number { return this.uniforms.uStrength; }\n set strength(value: number) { this.uniforms.uStrength = value; }\n\n /**\n * The center of the zoom\n * @default [0,0]\n */\n get center(): PointData { return this.uniforms.uCenter; }\n set center(value: PointData | number[])\n {\n if (Array.isArray(value))\n {\n value = { x: value[0], y: value[1] };\n }\n\n this.uniforms.uCenter = value;\n }\n\n /**\n * Sets the center of the effect in normalized screen coords on the `x` axis\n * @default 0\n */\n get centerX(): number { return this.uniforms.uCenter.x; }\n set centerX(value: number) { this.uniforms.uCenter.x = value; }\n\n /**\n * Sets the center of the effect in normalized screen coords on the `y` axis\n * @default 0\n */\n get centerY(): number { return this.uniforms.uCenter.y; }\n set centerY(value: number) { this.uniforms.uCenter.y = value; }\n\n /**\n * The inner radius of zoom. The part in inner circle won't apply zoom blur effect\n * @default 0\n */\n get innerRadius(): number { return this.uniforms.uRadii[0]; }\n set innerRadius(value: number) { this.uniforms.uRadii[0] = value; }\n\n /**\n * Outer radius of the effect. less than `0` equates to infinity\n * @default -1\n */\n get radius(): number { return this.uniforms.uRadii[1]; }\n set radius(value: number) { this.uniforms.uRadii[1] = (value < 0 || value === Infinity) ? -1 : value; }\n}\n"],"names":["b","a","g","f","n","t","r","s","m","_AdjustmentFilter","Filter","options","__spreadValues","gpuProgram","GpuProgram","wgslVertex","source","glProgram","GlProgram","vertex","fragment","__publicField","value","AdjustmentFilter","z","_","d","q","e","c","u","_KawaseBlurFilter","args","_a","_b","_c","deprecation","sourceClamp","fragmentClamp","filterManager","input","output","clearMode","uvX","uvY","offset","renderTarget","TexturePool","target","tmp","last","i","acc","v","blur","quality","kernels","k","step","KawaseBlurFilter","l","o","_ExtractBrightnessFilter","ExtractBrightnessFilter","_AdvancedBloomFilter","h","Texture","brightTarget","bloomTarget","AdvancedBloomFilter","C","_AsciiFilter","replaceColor","Color","AsciiFilter","BackdropBlurFilter","BlurFilter","wgslFragment","backTexture","blurredBackground","_BevelFilter","rotation","DEG_TO_RAD","BevelFilter","_BloomFilter","AlphaFilter","strength","BlurFilterPass","__spreadProps","clear","BloomFilter","_BulgePinchFilter","BulgePinchFilter","GradientParser","visitor","node","orientation","result","at","style","resultColor","length","elements","size","element","nodeVisitor","root","tokens","error","msg","err","getAST","ast","matchListDefinitions","matchListing","matchDefinition","matchGradient","matchLinearOrientation","matchListRadialOrientations","gradientType","pattern","orientationMatcher","matchCall","captures","scan","matchColorStop","callback","matchSideOrCorner","matchAngle","match","radialOrientations","radialOrientation","matchRadialOrientation","lookaheadCache","radialType","matchCircle","matchEllipse","matchAtPosition","extent","matchExtentKeyword","positionAt","defaultPosition","matchPositioning","circle","matchLength","ellipse","matchDistance","positioning","location","matchCoordinates","matcher","color","matchColor","matchHexColor","matchRGBAColor","matchRGBColor","matchLiteralColor","matchNumber","matchPositionKeyword","type","captureIndex","regexp","blankCaptures","consume","code","parse","stringify","parseCssGradient","cssGradient","cssGradientNodes","trimCssGradient","cssGradientNode","typeFromCssType","stops","stopsFromCssStops","angle","angleFromCssOrientation","supportedTypes","offsets","offsetsFromCssColorStops","colorString","colorAsStringFromCssStop","rgbaColor","stop","cssStop","stopOffset","findNextFixedStop","fromIndex","prevFixedOffset","nextFixed","stepSize","fixFloatRounding","angleFromDirectionalValue","supportedValues","value_","U","y","S","x","O","ANGLE_OFFSET","sortColorStops","_ColorGradientFilter","maxStops","sortedStops","indexStart","ColorGradientFilter","_ColorMapFilter","TextureSource","nearest","texture","ColorMapFilter","_ColorOverlayFilter","ColorOverlayFilter","F","_ColorReplaceFilter","ColorReplaceFilter","_ConvolutionFilter","width","height","matrix","ConvolutionFilter","CrossHatchFilter","_CRTFilter","CRTFilter","_DotFilter","dotUniforms","DotFilter","_DropShadowFilter","offsetPadding","DropShadowFilter","EmbossFilter","FILL_MODES","_GlitchFilter","_d","_e","canvas","ImageSource","arr","min","count","rest","averageWidth","w","ratio","rand","temp","ctx","red","green","sizes","len","GlitchFilter","_GlowFilter","distance","GlowFilter","_GodrayFilter","sourcePerlin","perlin","radians","GodrayFilter","GrayscaleFilter","_HslAdjustmentFilter","HslAdjustmentFilter","p","_MotionBlurFilter","ObservablePoint","MotionBlurFilter","_MultiColorReplaceFilter","maxColors","replacements","originals","targets","colorCount","pair","MultiColorReplaceFilter","_OldFilmFilter","OldFilmFilter","_OutlineFilter","OutlineFilter","PixelateFilter","Point","_RadialBlurFilter","RadialBlurFilter","_ReflectionFilter","ReflectionFilter","_RGBSplitFilter","RGBSplitFilter","_ShockwaveFilter","ShockwaveFilter","_SimpleLightmapFilter","SimpleLightmapFilter","_TiltShiftAxisFilter","end","start","dx","dy","isVert","TiltShiftAxisFilter","TiltShiftFilter","_TwistFilter","TwistFilter","_ZoomBlurFilter","kernelSize","ZoomBlurFilter"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAAA,GAAA,OAAA,eAAAC,GAAA,OAAA,sBAAAC,GAAA,OAAA,UAAA,eAAAC,GAAA,OAAA,UAAA,qBAAAC,GAAA,CAAAC,EAAA,EAAAC,IAAA,KAAAD,EAAAL,GAAAK,EAAA,EAAA,CAAA,WAAA,GAAA,aAAA,GAAA,SAAA,GAAA,MAAAC,CAAA,CAAA,EAAAD,EAAA,CAAA,EAAAC,EAAAC,GAAA,CAAAF,EAAA,IAAA,CAAA,QAAAC,KAAA,IAAA,EAAA,CAAA,GAAAJ,GAAA,KAAA,EAAAI,CAAA,GAAAF,GAAAC,EAAAC,EAAA,EAAAA,CAAA,CAAA,EAAA,GAAAL,GAAA,QAAAK,KAAAL,GAAA,CAAA,EAAAE,GAAA,KAAA,EAAAG,CAAA,GAAAF,GAAAC,EAAAC,EAAA,EAAAA,CAAA,CAAA,EAAA,OAAAD,CAAA,EAAAG,GAAA,CAAAH,EAAA,EAAAC,KAAAF,GAAAC,EAAA,OAAA,GAAA,SAAA,EAAA,GAAA,EAAAC,CAAA,EAAAA,GA4DO,MAAMG,GAAN,MAAMA,WAAyBC,CACtC,CAwBI,YAAYC,EACZ,CACIA,EAAUC,MAAA,CAAKH,EAAAA,GAAiB,eAAoBE,EAAAA,CAAAA,EAE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AK,SAAS,OAAO,CAAC,CAAG,CAC5D,IAAI,YAAYA,EAAe,CAAE,KAAK,SAAS,OAAO,CAAC,EAAIA,CAAO,CAMlE,IAAI,QAAiB,CAAE,OAAO,KAAK,SAAS,OAAO,CAAC,CAAG,CACvD,IAAI,OAAOA,EAAe,CAAE,KAAK,SAAS,OAAO,CAAC,EAAKA,EAAQ,GAAKA,IAAU,IAAY,GAAKA,CAAO,CAC1G,EA1GID,GAHSyR,GAGc,kBAAyC,CAC5D,SAAU,GACV,OAAQ,CAAE,EAAG,EAAG,EAAG,CAAE,EACrB,YAAa,EACb,OAAQ,GACR,cAAe,EACnB,CAAA,MATSE,GAANF"} \ No newline at end of file diff --git a/docs/AdjustmentFilter.html b/docs/AdjustmentFilter.html new file mode 100644 index 000000000..c88211b70 --- /dev/null +++ b/docs/AdjustmentFilter.html @@ -0,0 +1,2887 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Class: AdjustmentFilter +

+ + + +
+ +
+
+

+ AdjustmentFilter + + +

+ + + +

The ability to adjust gamma, contrast, saturation, brightness, alpha or color-channel shift. +This is a faster and much simpler to use than +ColorMatrixFilter +because it does not use a matrix.
+originalfilter

+ +
+
+ +
+
+ + +
+
+

+ + + + new AdjustmentFilter + + + (options) + + + + +

+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + AdjustmentFilterOptions + + + + <optional>
+ + + + + +
+

The options of the adjustment filter.

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + +

Extends

+ +
    + +
  • Filter
  • + +
+ + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + DEFAULT_OPTIONS + AdjustmentFilterOptions + + staticreadonly + + +

+
+
+
+ +

Default values for options.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + alpha + number + + + + +

+
+
+
+ + +
+

The overall alpha channel

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + blue + number + + + + +

+
+
+
+ + +
+

The multiplied green channel

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + brightness + number + + + + +

+
+
+
+ + +
+

The overall brightness

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + contrast + number + + + + +

+
+
+
+ + +
+

Amount of contrast

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + gamma + number + + + + +

+
+
+
+ + +
+

Amount of luminance

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + green + number + + + + +

+
+
+
+ + +
+

The multiplied blue channel

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + red + number + + + + +

+
+
+
+ + +
+

The multiplied red channel

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + saturation + number + + + + +

+
+
+
+ + +
+

Amount of color saturation

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/AdjustmentFilterOptions.html b/docs/AdjustmentFilterOptions.html new file mode 100644 index 000000000..9ebcf5e05 --- /dev/null +++ b/docs/AdjustmentFilterOptions.html @@ -0,0 +1,2991 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Interface: AdjustmentFilterOptions +

+ + + +
+ +
+
+

+ AdjustmentFilterOptions + + +

+ + +

Options for the AdjustmentFilter constructor

+ + +
+
+ +
+
+ + + +
+ + +
Properties:
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
alpha + + number + + + + 1 + + + +

The overall alpha channel

+ +
blue + + number + + + + 1 + + + +

The multiplied blue channel

+ +
brightness + + number + + + + 1 + + + +

The overall brightness

+ +
contrast + + number + + + + 1 + + + +

The amount of contrast

+ +
gamma + + number + + + + 1 + + + +

The amount of luminance

+ +
green + + number + + + + 1 + + + +

The multiplied green channel

+ +
red + + number + + + + 1 + + + +

The multiplied red channel

+ +
saturation + + number + + + + 1 + + + +

The amount of color saturation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + alpha + number + + + + +

+
+
+
+ + +
+

The overall alpha channel

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + blue + number + + + + +

+
+
+
+ + +
+

The multiplied blue channel

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + brightness + number + + + + +

+
+
+
+ + +
+

The overall brightness

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + contrast + number + + + + +

+
+
+
+ + +
+

The amount of contrast

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + gamma + number + + + + +

+
+
+
+ + +
+

The amount of luminance

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + green + number + + + + +

+
+
+
+ + +
+

The multiplied green channel

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + red + number + + + + +

+
+
+
+ + +
+

The multiplied red channel

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + saturation + number + + + + +

+
+
+
+ + +
+

The amount of color saturation

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/AdvancedBloomFilter.html b/docs/AdvancedBloomFilter.html new file mode 100644 index 000000000..cd257977a --- /dev/null +++ b/docs/AdvancedBloomFilter.html @@ -0,0 +1,2932 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Class: AdvancedBloomFilter +

+ + + +
+ +
+
+

+ AdvancedBloomFilter + + +

+ + + +

The AdvancedBloomFilter applies a Bloom Effect to an object. Unlike the normal BloomFilter +this had some advanced controls for adjusting the look of the bloom. Note: this filter +is slower than normal BloomFilter.
+originalfilter

+ +
+
+ +
+
+ + +
+
+

+ + + + new AdvancedBloomFilter + + + (options) + + + + +

+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + AdvancedBloomFilterOptions + + + + <optional>
+ + + + + +
+

Options for the AdvancedBloomFilter constructor.

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + +

Extends

+ +
    + +
  • Filter
  • + +
+ + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + DEFAULT_OPTIONS + AdvancedBloomFilterOptions + + staticreadonly + + +

+
+
+
+ +

Default values for options.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + bloomScale + number + + + + +

+
+
+
+ +

To adjust the strength of the bloom. Higher values is more intense brightness.

+ + + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + blur + number + + + + +

+
+
+
+ + +
+

The strength of the Blur properties simultaneously

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 2
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + brightness + number + + + + +

+
+
+
+ +

The brightness, lower value is more subtle brightness, higher value is blown-out.

+ + + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + kernels + number[] + + + + +

+
+
+
+ +

The kernels of the Blur Filter

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + pixelSize + PointData + + + + +

+
+
+
+ + +
+

The pixel size of the Kawase Blur filter

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • {x:1,y:1}
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + pixelSizeX + number + + + + +

+
+
+
+ + +
+

The horizontal pixelSize of the Kawase Blur filter

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + pixelSizeY + number + + + + +

+
+
+
+ + +
+

The vertical pixel size of the Kawase Blur filter

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + quality + number + + + + +

+
+
+
+ + +
+

The quality of the Blur Filter

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 4
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + threshold + number + + + + +

+
+
+
+ + +
+

Defines how bright a color needs to be extracted.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0.5
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/AdvancedBloomFilterOptions.html b/docs/AdvancedBloomFilterOptions.html new file mode 100644 index 000000000..bec88b27e --- /dev/null +++ b/docs/AdvancedBloomFilterOptions.html @@ -0,0 +1,2882 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Interface: AdvancedBloomFilterOptions +

+ + + +
+ +
+
+

+ AdvancedBloomFilterOptions + + +

+ + +

Options for the AdvancedBloomFilter constructor.

+ + +
+
+ +
+
+ + + +
+ + +
Properties:
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
bloomScale + + number + + + + 1 + + + +

To adjust the strength of the bloom. Higher values is more intense brightness.

+ +
blur + + number + + + + +

The strength of the Blur properties simultaneously

+ + +
brightness + + number + + + + 1 + + + +

The brightness, lower value is more subtle brightness, higher value is blown-out.

+ +
kernels + + number[] + + + + +

The kernel size of the blur filter.

+ + +
pixelSize + + PointData | number[] | number + + + + {x:1,y:1} + + + +

The pixel size of the blur filter. Large size is blurrier. For advanced usage.

+ +
quality + + number + + + + +

The quality of the Blur filter.

+ + +
threshold + + number + + + + 1 + + + +

Defines how bright a color needs to be to affect bloom.

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + bloomScale + number + + + + +

+
+
+
+ + +
+

To adjust the strength of the bloom. Higher values is more intense brightness.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + blur + number + + + + +

+
+
+
+ +

The strength of the Blur properties simultaneously

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + brightness + number + + + + +

+
+
+
+ + +
+

The brightness, lower value is more subtle brightness, higher value is blown-out.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + kernels + number[] + + + + +

+
+
+
+ +

The kernel size of the blur filter.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + pixelSize + PointData | number[] | number + + + + +

+
+
+
+ + +
+

The pixel size of the blur filter. Large size is blurrier. For advanced usage.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • {x:1,y:1}
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + quality + number + + + + +

+
+
+
+ +

The quality of the Blur filter.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + threshold + number + + + + +

+
+
+
+ + +
+

Defines how bright a color needs to be to affect bloom.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/AsciiFilter.html b/docs/AsciiFilter.html new file mode 100644 index 000000000..8c5a87348 --- /dev/null +++ b/docs/AsciiFilter.html @@ -0,0 +1,2613 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Class: AsciiFilter +

+ + + +
+ +
+
+

+ AsciiFilter + + +

+ + + +

An ASCII filter.
+originalfilter

+ +
+
+ +
+
+ + +
+
+

+ + + + new AsciiFilter + + + (options) + + + + +

+ + +
+
+
+ + +
+

Constructor.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + AsciiFilterOptions + + + + <optional>
+ + + + + +
+

The options of the ASCII filter.

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + +

Extends

+ +
    + +
  • Filter
  • + +
+ + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + DEFAULT_OPTIONS + AsciiFilterOptions + + staticreadonly + + +

+
+
+
+ +

Default values for options.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + color + ColorSource + + + + +

+
+
+
+ + +
+

The resulting color of the ascii characters, as a 3 component RGB or numerical hex

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0xffffff
+ + + + + + + +
+ + + +
Example
+ +
[1.0, 1.0, 1.0] = 0xffffff
+ + +
+ + + +
+
+

+ + replaceColor + boolean + + + + +

+
+
+
+ +

Determine whether or not to replace the source colors with the provided.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + size + number + + + + +

+
+
+
+ + +
+

The pixel size used by the filter.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 8
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/AsciiFilterOptions.html b/docs/AsciiFilterOptions.html new file mode 100644 index 000000000..f1b851d4d --- /dev/null +++ b/docs/AsciiFilterOptions.html @@ -0,0 +1,2560 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Interface: AsciiFilterOptions +

+ + + +
+ +
+
+

+ AsciiFilterOptions + + +

+ + +

Options for AsciiFilter constructor.

+ + +
+
+ +
+
+ + + +
+ + +
Properties:
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
color + + ColorSource + + + + 0x000000 + + + +

A color to set the ascii characters to. If not set, the color will be taken from the source.

+ +
replaceColor + + boolean + + + + false + + +

Determine whether or not to replace the source colors with the provided.

+

Will automatically be assigned to true if color is provided. +Set replaceColor to false to prevent that.

+ +
size + + number + + + + 8 + + + +

The pixel size used by the filter

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + color + ColorSource + + + + +

+
+
+
+ + +
+

A color to set the ascii characters to. If not set, the color will be taken from the source.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0x000000
+ + + + + + + +
+ + + +
Example
+ +
[1.0, 1.0, 1.0] = 0xffffff
+ + +
+ + + +
+
+

+ + replaceColor + boolean + + + + +

+
+
+
+ +

Determine whether or not to replace the source colors with the provided.

+ + +
+

Will automatically be assigned to true if color is provided. +Set replaceColor to false to prevent that.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • false
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + size + number + + + + +

+
+
+
+ + +
+

The pixel size used by the filter

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 8
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/BackdropBlurFilter.html b/docs/BackdropBlurFilter.html new file mode 100644 index 000000000..cecd40afe --- /dev/null +++ b/docs/BackdropBlurFilter.html @@ -0,0 +1,2390 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Class: BackdropBlurFilter +

+ + + +
+ +
+
+

+ BackdropBlurFilter + + +

+ + + +

The BackdropBlurFilter applies a Gaussian blur to everything behind an object, and then draws the object on top of it.
+originalfilter

+ +
+
+ +
+
+ + +
+
+

+ + + + new BackdropBlurFilter + + + (options) + + + + +

+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + BlurFilterOptions + + + + <optional>
+ + + + + +
+

The options of the blur filter.

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + +

Extends

+ +
    + +
  • BlurFilter
  • + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/BevelFilter.html b/docs/BevelFilter.html new file mode 100644 index 000000000..ecbbccbae --- /dev/null +++ b/docs/BevelFilter.html @@ -0,0 +1,2779 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Class: BevelFilter +

+ + + +
+ +
+
+

+ BevelFilter + + +

+ + + +

Bevel Filter.
+originalfilter

+ +
+
+ +
+
+ + +
+
+

+ + + + new BevelFilter + + + (options) + + + + +

+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + BevelFilterOptions + + + + <optional>
+ + + + + +
+

Options for the BevelFilter constructor.

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + +

Extends

+ +
    + +
  • Filter
  • + +
+ + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + DEFAULT_OPTIONS + BevelFilterOptions + + staticreadonly + + +

+
+
+
+ +

Default values for options.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + lightAlpha + number + + + + +

+
+
+
+ + +
+

The alpha value of the left & top bevel.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0.7
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + lightColor + ColorSource + + + + +

+
+
+
+ + +
+

The color value of the left & top bevel.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0xffffff
+ + + + + + + +
+ + + +
Example
+ +
[1.0, 1.0, 1.0] = 0xffffff
+ + +
+ + + +
+
+

+ + rotation + number + + + + +

+
+
+
+ + +
+

The angle of the light in degrees

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 45
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + shadowAlpha + number + + + + +

+
+
+
+ + +
+

The alpha value of the right & bottom bevel.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0.7
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + shadowColor + ColorSource + + + + +

+
+
+
+ + +
+

The color value of the right & bottom bevel.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0xffffff
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + thickness + number + + + + +

+
+
+
+ + +
+

The thickness of the bevel

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 2
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/BevelFilterOptions.html b/docs/BevelFilterOptions.html new file mode 100644 index 000000000..7ef7c0119 --- /dev/null +++ b/docs/BevelFilterOptions.html @@ -0,0 +1,2825 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Interface: BevelFilterOptions +

+ + + +
+ +
+
+

+ BevelFilterOptions + + +

+ + +

Options for the BevelFilter constructor.

+ + +
+
+ +
+
+ + + +
+ + +
Properties:
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
lightAlpha + + number + + + + 0.7 + + + +

The alpha value of the left & top bevel.

+ +
lightColor + + ColorSource + + + + 0xffffff + + + +

The color value of the left & top bevel.

+ +
rotation + + number + + + + 45 + + + +

The angle of the light in degrees

+ +
shadowAlpha + + number + + + + 0.7 + + + +

The alpha value of the right & bottom bevel.

+ +
shadowColor + + ColorSource + + + + 0x000000 + + + +

The color value of the right & bottom bevel.

+ +
thickness + + number + + + + 2 + + + +

The thickness of the bevel

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + lightAlpha + number + + + + +

+
+
+
+ + +
+

The alpha value of the left & top bevel.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0.7
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + lightColor + ColorSource + + + + +

+
+
+
+ + +
+

The color value of the left & top bevel.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0xffffff
+ + + + + + + +
+ + + +
Example
+ +
[1.0, 1.0, 1.0] = 0xffffff
+ + +
+ + + +
+
+

+ + rotation + number + + + + +

+
+
+
+ + +
+

The angle of the light in degrees

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 45
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + shadowAlpha + number + + + + +

+
+
+
+ + +
+

The alpha value of the right & bottom bevel.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0.7
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + shadowColor + ColorSource + + + + +

+
+
+
+ + +
+

The color value of the right & bottom bevel.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0x000000
+ + + + + + + +
+ + + +
Example
+ +
[1.0, 1.0, 1.0] = 0xffffff
+ + +
+ + + +
+
+

+ + thickness + number + + + + +

+
+
+
+ + +
+

The thickness of the bevel

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 2
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/BloomFilter.html b/docs/BloomFilter.html new file mode 100644 index 000000000..ce91d1dc7 --- /dev/null +++ b/docs/BloomFilter.html @@ -0,0 +1,2811 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Class: BloomFilter +

+ + + +
+ +
+
+

+ BloomFilter + + +

+ + + +

The BloomFilter applies a Gaussian blur to an object. +The strength of the blur can be set for x- and y-axis separately.
+originalfilter

+ +
+
+ +
+
+ + +
+
+

+ + + + new BloomFilter + + + (options) + + + + +

+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + BloomFilterOptions + + + + <optional>
+ + + + + +
+

Options for the BloomFilter constructor.

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + +

Extends

+ +
    + +
  • Filter
  • + +
+ + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + DEFAULT_OPTIONS + BloomFilterOptions + + staticreadonly + + +

+
+
+
+ +

Default values for options.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + blur + number + + Deprecated + : since 6.0.0 + + + + + + +

+
+
+
+ + +
+

The strength of both the blurX and blurY properties simultaneously

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 2
+ + + + + +
See:
+
+ +
+ + + +
+ + + +
+ + + +
+
+

+ + blurX + number + + Deprecated + : since 6.0.0 + + + + + + +

+
+
+
+ + +
+

The strength of the blurX property

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 2
+ + + + + +
See:
+
+ +
+ + + +
+ + + +
+ + + +
+
+

+ + blurY + number + + Deprecated + : since 6.0.0 + + + + + + +

+
+
+
+ + +
+

The strength of the blurY property

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 2
+ + + + + +
See:
+
+ +
+ + + +
+ + + +
+ + + +
+
+

+ + strength + PointData + + + + +

+
+
+
+ + +
+

Sets the strength of both the blurX and blurY properties simultaneously

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 2
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + strengthX + number + + + + +

+
+
+
+ + +
+

Sets the strength of the blur on the x axis

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 2
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + strengthY + number + + + + +

+
+
+
+ + +
+

Sets the strength of the blur on the y axis

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 2
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/BloomFilterOptions.html b/docs/BloomFilterOptions.html new file mode 100644 index 000000000..a385a4e49 --- /dev/null +++ b/docs/BloomFilterOptions.html @@ -0,0 +1,2639 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Interface: BloomFilterOptions +

+ + + +
+ +
+
+

+ BloomFilterOptions + + +

+ + +

Options for the BloomFilter constructor.

+ + +
+
+ +
+
+ + + +
+ + +
Properties:
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
kernelSize + + number + + + + 5 + + + +

The kernel size of the blur filter. Must be an odd number between 5 and 15 (inclusive).

+ +
quality + + number + + + + 4 + + + +

The quality of the blur.

+ +
resolution + + number + + + + 1 + + + +

The resolution of the blurX & blurY filter.

+ +
strength + + PointData | number + + + + {x:2,y:2} + + + +

Sets the strength of the blur. If only a number is provided, it will assign to both x and y.

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + kernelSize + number + + + + +

+
+
+
+ + +
+

The kernel size of the blur filter. Must be an odd number between 5 and 15 (inclusive).

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 5
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + quality + number + + + + +

+
+
+
+ + +
+

The quality of the blur.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 4
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + resolution + number + + + + +

+
+
+
+ + +
+

The resolution of the blurX & blurY filter.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + strength + PointData | number + + + + +

+
+
+
+ + +
+

Sets the strength of the blur. If only a number is provided, it will assign to both x and y.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • {x:2,y:2}
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/BulgePinchFilter.html b/docs/BulgePinchFilter.html new file mode 100644 index 000000000..8d6e41f8b --- /dev/null +++ b/docs/BulgePinchFilter.html @@ -0,0 +1,2720 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Class: BulgePinchFilter +

+ + + +
+ +
+
+

+ BulgePinchFilter + + +

+ + + +

Bulges or pinches the image in a circle.
+originalfilter

+ +
+
+ +
+
+ + +
+
+

+ + + + new BulgePinchFilter + + + (options) + + + + +

+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + BulgePinchFilterOptions + + + + <optional>
+ + + + + +
+

Options for the BulgePinchFilter constructor.

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + +

Extends

+ +
    + +
  • Filter
  • + +
+ + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + DEFAULT_OPTIONS + BulgePinchFilterOptions + + staticreadonly + + +

+
+
+
+ +

Default values for options.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + center + PointData + + + + +

+
+
+
+ + +
+

Sets the center of the effect in normalized screen coords. +{ x: 0, y: 0 } means top-left and { x: 1, y: 1 } mean bottom-right

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • {x:0.5,y:0.5}
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + centerX + number + + + + +

+
+
+
+ + +
+

Sets the center of the effect in normalized screen coords on the x axis

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + centerY + number + + + + +

+
+
+
+ + +
+

Sets the center of the effect in normalized screen coords on the y axis

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + radius + number + + + + +

+
+
+
+ + +
+

The radius of the circle of effect

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 100
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + strength + number + + + + +

+
+
+
+ + +
+

A value between -1 and 1 (-1 is strong pinch, 0 is no effect, 1 is strong bulge)

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/BulgePinchFilterOptions.html b/docs/BulgePinchFilterOptions.html new file mode 100644 index 000000000..0dbbb2d36 --- /dev/null +++ b/docs/BulgePinchFilterOptions.html @@ -0,0 +1,2551 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Interface: BulgePinchFilterOptions +

+ + + +
+ +
+
+

+ BulgePinchFilterOptions + + +

+ + +

Options for the BulgePinchFilter constructor.

+ + +
+
+ +
+
+ + + +
+ + +
Properties:
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
center + + PointData | number[] | number + + + + {x:0,y:0} + + + +

Offset coordinates to change the position of the center of the circle of effect.

+ +
radius + + number + + + + 100 + + + +

The radius of the circle of effect

+ +
strength + + number + + + + 1 + + + +

A value between -1 and 1 (-1 is strong pinch, 0 is no effect, 1 is strong bulge)

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + center + PointData | number[] | number + + + + +

+
+
+
+ + +
+

Offset coordinates to change the position of the center of the circle of effect.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • {x:0,y:0}
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + radius + number + + + + +

+
+
+
+ + +
+

The radius of the circle of effect

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 100
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + strength + number + + + + +

+
+
+
+ + +
+

A value between -1 and 1 (-1 is strong pinch, 0 is no effect, 1 is strong bulge)

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/CRTFilter.html b/docs/CRTFilter.html new file mode 100644 index 000000000..81d7af1e7 --- /dev/null +++ b/docs/CRTFilter.html @@ -0,0 +1,3051 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Class: CRTFilter +

+ + + +
+ +
+
+

+ CRTFilter + + +

+ + + +

The CRTFilter applies a CRT effect to an object.
+originalfilter

+ +
+
+ +
+
+ + +
+
+

+ + + + new CRTFilter + + + (options) + + + + +

+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + CRTFilterOptions + + + + <optional>
+ + + + + +
+

Options for the CRTFilter constructor.

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + +

Extends

+ +
    + +
  • Filter
  • + +
+ + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + DEFAULT_OPTIONS + CRTFilterOptions + + staticreadonly + + +

+
+
+
+ +

Default values for options.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + curvature + number + + + + +

+
+
+
+ + +
+

Bend of interlaced lines, higher value means more bend

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + lineContrast + number + + + + +

+
+
+
+ + +
+

Contrast of interlaced lines

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0.25
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + lineWidth + number + + + + +

+
+
+
+ + +
+

Width of interlaced lines

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + noise + number + + + + +

+
+
+
+ + +
+

Opacity/intensity of the noise effect between 0 and 1

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0.3
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + noiseSize + number + + + + +

+
+
+
+ + +
+

The size of the noise particles

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + seed + number + + + + +

+
+
+
+ + +
+

A seed value to apply to the random noise generation

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + time + number + + + + +

+
+
+
+ + +
+

Opacity/intensity of the noise effect between 0 and 1

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0.3
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + verticalLine + boolean + + + + +

+
+
+
+ +

The orientation of the line:

+ + +
+

true create vertical lines, false creates horizontal lines

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • false
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + vignetting + number + + + + +

+
+
+
+ + +
+

The radius of the vignette effect, smaller values produces a smaller vignette

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0.3
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + vignettingAlpha + number + + + + +

+
+
+
+ + +
+

Amount of opacity of vignette

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + vignettingBlur + number + + + + +

+
+
+
+ + +
+

Blur intensity of the vignette

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0.3
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/CRTFilterOptions.html b/docs/CRTFilterOptions.html new file mode 100644 index 000000000..5ac635313 --- /dev/null +++ b/docs/CRTFilterOptions.html @@ -0,0 +1,3257 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Interface: CRTFilterOptions +

+ + + +
+ +
+
+

+ CRTFilterOptions + + +

+ + +

Options for the CRTFilter constructor.

+ + +
+
+ +
+
+ + + +
+ + +
Properties:
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
curvature + + number + + + + 1 + + + +

Bend of interlaced lines, higher value means more bend

+ +
lineContrast + + number + + + + 0.25 + + + +

Contrast of interlaced lines

+ +
lineWidth + + number + + + + 1 + + + +

Width of the interlaced lines

+ +
noise + + number + + + + 0.3 + + + +

Opacity/intensity of the noise effect between 0 and 1

+ +
noiseSize + + number + + + + 1 + + + +

The size of the noise particles

+ +
seed + + number + + + + 0 + + + +

A seed value to apply to the random noise generation

+ +
time + + number + + + + 0 + + + +

For animating interlaced lines

+ +
verticalLine + + boolean + + + + false + + +

The orientation of the line:

+

true create vertical lines, false creates horizontal lines

+ +
vignetting + + number + + + + 0.3 + + + +

The radius of the vignette effect, smaller values produces a smaller vignette

+ +
vignettingAlpha + + number + + + + 1 + + + +

Amount of opacity on the vignette

+ +
vignettingBlur + + number + + + + 0.3 + + + +

Blur intensity of the vignette

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + curvature + number + + + + +

+
+
+
+ + +
+

Bend of interlaced lines, higher value means more bend

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + lineContrast + number + + + + +

+
+
+
+ + +
+

Contrast of interlaced lines

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0.25
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + lineWidth + number + + + + +

+
+
+
+ + +
+

Width of the interlaced lines

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + noise + number + + + + +

+
+
+
+ + +
+

Opacity/intensity of the noise effect between 0 and 1

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0.3
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + noiseSize + number + + + + +

+
+
+
+ + +
+

The size of the noise particles

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + seed + number + + + + +

+
+
+
+ + +
+

A seed value to apply to the random noise generation

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + time + number + + + + +

+
+
+
+ + +
+

For animating interlaced lines

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + verticalLine + boolean + + + + +

+
+
+
+ +

The orientation of the line:

+ + +
+

true create vertical lines, false creates horizontal lines

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • false
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + vignetting + number + + + + +

+
+
+
+ + +
+

The radius of the vignette effect, smaller values produces a smaller vignette

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0.3
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + vignettingAlpha + number + + + + +

+
+
+
+ + +
+

Amount of opacity on the vignette

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + vignettingBlur + number + + + + +

+
+
+
+ + +
+

Blur intensity of the vignette

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0.3
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/ColorGradientFilter.html b/docs/ColorGradientFilter.html new file mode 100644 index 000000000..da2fe0619 --- /dev/null +++ b/docs/ColorGradientFilter.html @@ -0,0 +1,2773 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Class: ColorGradientFilter +

+ + + +
+ +
+
+

+ ColorGradientFilter + + +

+ + + +

Render a colored gradient.
+originalfilter

+ +
+
+ +
+
+ + +
+
+

+ + + + new ColorGradientFilter + + + (options) + + + + +

+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + ColorGradientFilterOptions | ColorGradientFilterCSSOptions + + + + <optional>
+ + + + + +
+

Options for the ColorGradientFilter constructor.

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + +

Extends

+ +
    + +
  • Filter
  • + +
+ + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + defaults + ColorGradientFilterOptions + + staticreadonly + + +

+
+
+
+ +

Default constructor options

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + LINEAR + number + + staticreadonly + + +

+
+
+
+ +

Gradient types

+ + + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + alpha + number + + + + +

+
+
+
+ + +
+

The alpha value of the gradient (0-1)

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + angle + number + + + + +

+
+
+
+ + +
+

The angle of the gradient in degrees

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 90
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + maxColors + number + + + + +

+
+
+
+ + +
+

The maximum number of colors to render (0 = no limit)

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + replace + boolean + + + + +

+
+
+
+ + +
+

If true, the gradient will replace the existing color, otherwise it +will be multiplied with it

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • false
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + type + number + + + + +

+
+
+
+ + +
+

The type of gradient

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • ColorGradientFilter.LINEAR
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/ColorGradientFilterCSSOptions.html b/docs/ColorGradientFilterCSSOptions.html new file mode 100644 index 000000000..c8e6d41c9 --- /dev/null +++ b/docs/ColorGradientFilterCSSOptions.html @@ -0,0 +1,2544 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Interface: ColorGradientFilterCSSOptions +

+ + + +
+ +
+
+

+ ColorGradientFilterCSSOptions + + +

+ + +

Options for CSS-style gradient for use with constructor.

+ + +
+
+ +
+
+ + + +
+ + +
Properties:
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
alpha + + number + + + + 1 + + + +

Alpha value for the gradient.

+ +
css + + string + + + + +

CSS-style gradient string

+ + +
maxColors + + number + + + + 0 + + + +

Maximum number of colors to render (0 = no limit)

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + alpha + number + + + + +

+
+
+
+ + +
+

Alpha value for the gradient.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + css + string + + + + +

+
+
+
+ +

CSS-style gradient string

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + maxColors + number + + + + +

+
+
+
+ + +
+

Maximum number of colors to render (0 = no limit)

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/ColorGradientFilterOptions.html b/docs/ColorGradientFilterOptions.html new file mode 100644 index 000000000..3d1172688 --- /dev/null +++ b/docs/ColorGradientFilterOptions.html @@ -0,0 +1,2808 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Interface: ColorGradientFilterOptions +

+ + + +
+ +
+
+

+ ColorGradientFilterOptions + + +

+ + +

Options for ColorGradientFilter constructor.

+ + +
+
+ +
+
+ + + +
+ + +
Properties:
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
alpha + + number + + + + 1 + + + +

Alpha value for the gradient.

+ +
angle + + number + + + + 90 + + + +

Angle for linear gradients, in degrees.

+ +
maxColors + + number + + + + 0 + + + +

Maximum number of colors to render (0 = no limit)

+ +
replace + + boolean + + + + false + + + +

If true, the gradient will replace the existing color, otherwise it will be multiplied with it

+ +
stops + + ColorStop[] + + + + +

Collection of stops, must be 2+

+ + +
type + + number + + + + ColorGradientFilter.LINEAR + + + +

Linear = 0, Radial = 1, Conic = 2

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + alpha + number + + + + +

+
+
+
+ + +
+

Alpha value for the gradient.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + angle + number + + + + +

+
+
+
+ + +
+

Angle for linear gradients, in degrees.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 90
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + maxColors + number + + + + +

+
+
+
+ + +
+

Maximum number of colors to render (0 = no limit)

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + replace + boolean + + + + +

+
+
+
+ + +
+

If true, the gradient will replace the existing color, otherwise it will be multiplied with it

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • false
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + stops + ColorStop[] + + + + +

+
+
+
+ +

Collection of stops, must be 2+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + type + number + + + + +

+
+
+
+ + +
+

Linear = 0, Radial = 1, Conic = 2

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • ColorGradientFilter.LINEAR
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/ColorMapFilter.html b/docs/ColorMapFilter.html new file mode 100644 index 000000000..be890441c --- /dev/null +++ b/docs/ColorMapFilter.html @@ -0,0 +1,2790 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Class: ColorMapFilter +

+ + + +
+ +
+
+

+ ColorMapFilter + + +

+ + + +

The ColorMapFilter applies a color-map effect to an object.
+originalfilter

+ +
+
+ +
+
+ + +
+
+

+ + + + new ColorMapFilter + + + (options) + + + + +

+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
options + + ColorMapFilterOptions + + +

Options for the ColorMapFilter constructor.

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + +

Extends

+ +
    + +
  • Filter
  • + +
+ + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + DEFAULT_OPTIONS + ColorMapFilterOptions + + staticreadonly + + +

+
+
+
+ +

Default values for options.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + colorMap + ColorMapTexture + + + + +

+
+
+
+ +

The colorMap texture.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + colorSize + number + + readonly + + +

+
+
+
+ + +
+

The size of one color slice.

+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + mix + number + + + + +

+
+
+
+ +

The mix from 0 to 1, where 0 is the original image and 1 is the color mapped image.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + nearest + boolean + + + + +

+
+
+
+ +

Whether use NEAREST for colorMap texture.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + +

Methods

+ + + +
+
+

+ + + + destroy + + + () void + + + + +

+ + +
+
+
+ + +
+

Destroys this filter

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • false
+ + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + + + updateColorMap + + + () void + + + + +

+ + +
+
+
+ + +
+

If the colorMap is based on canvas, +and the content of canvas has changed, then call updateColorMap for update texture.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/ColorMapFilterOptions.html b/docs/ColorMapFilterOptions.html new file mode 100644 index 000000000..82d6bcf33 --- /dev/null +++ b/docs/ColorMapFilterOptions.html @@ -0,0 +1,2544 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Interface: ColorMapFilterOptions +

+ + + +
+ +
+
+

+ ColorMapFilterOptions + + +

+ + +

Options for the ColorMapFilter constructor.

+ + +
+
+ +
+
+ + + +
+ + +
Properties:
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
colorMap + + ColorMapTexture + + + + +

The colorMap texture of the filter.

+ + +
mix + + number + + + + 1 + + + +

The mix from 0 to 1, where 0 is the original image and 1 is the color mapped image.

+ +
nearest + + boolean + + + + false + + + +

Whether use NEAREST scale mode for colorMap texture.

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + colorMap + ColorMapTexture + + + + +

+
+
+
+ +

The colorMap texture of the filter.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + mix + number + + + + +

+
+
+
+ + +
+

The mix from 0 to 1, where 0 is the original image and 1 is the color mapped image.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + nearest + boolean + + + + +

+
+
+
+ + +
+

Whether use NEAREST scale mode for colorMap texture.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • false
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/ColorOverlayFilter.html b/docs/ColorOverlayFilter.html new file mode 100644 index 000000000..294db80d5 --- /dev/null +++ b/docs/ColorOverlayFilter.html @@ -0,0 +1,2651 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Class: ColorOverlayFilter +

+ + + +
+ +
+
+

+ ColorOverlayFilter + + +

+ + +

Overlay a source graphic with a color.

+ + +
+
+ +
+
+ + +
+
+

+ + + + new ColorOverlayFilter + + + (options) + + + + +

+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + ColorOverlayFilterOptions + + + + <optional>
+ + + + + +
+

Options for the ColorOverlayFilter constructor.

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + +

Extends

+ +
    + +
  • Filter
  • + +
+ + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + DEFAULT_OPTIONS + ColorOverlayFilterOptions + + staticreadonly + + +

+
+
+
+ +

Default shockwave filter options

+ + + + +
+ + +
Properties:
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
alpha + + number + + + + 1 + + +

The alpha of the overlay

+ + +
color + + number + + + + 0 + + +

The color of the overlay

+ + +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + alpha + number + + + + +

+
+
+
+ + +
+

The alpha value of the color

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + color + number | number<Array> | Float32Array + + + + +

+
+
+
+ + +
+

The over color source

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0x000000
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/ColorOverlayFilterOptions.html b/docs/ColorOverlayFilterOptions.html new file mode 100644 index 000000000..7fb94da37 --- /dev/null +++ b/docs/ColorOverlayFilterOptions.html @@ -0,0 +1,2463 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Interface: ColorOverlayFilterOptions +

+ + + +
+ +
+
+

+ ColorOverlayFilterOptions + + +

+ + +

Options for the ColorOverlayFilter constructor.

+ + +
+
+ +
+
+ + + +
+ + +
Properties:
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
alpha + + number + + + + 1 + + + +

The alpha of the overlay

+ +
color + + ColorSource + + + + 0x000000 + + + +

The color of the overlay

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + alpha + number + + + + +

+
+
+
+ + +
+

The alpha of the overlay

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + color + ColorSource + + + + +

+
+
+
+ + +
+

The color of the overlay

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0x000000
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/ColorReplaceFilter.html b/docs/ColorReplaceFilter.html new file mode 100644 index 000000000..f46006db8 --- /dev/null +++ b/docs/ColorReplaceFilter.html @@ -0,0 +1,2772 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Class: ColorReplaceFilter +

+ + + +
+ +
+
+

+ ColorReplaceFilter + + +

+ + + +

ColorReplaceFilter, originally by mishaa, updated by timetocode +http://www.html5gamedevs.com/topic/10640-outline-a-sprite-change-certain-colors/?p=69966
+originalfilter

+ +
+
+ +
+
+ + +
+
+

+ + + + new ColorReplaceFilter + + + (options) + + + + +

+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + ColorReplaceFilterOptions + + + + <optional>
+ + + + + +
+

Options for the ColorReplaceFilter constructor.

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +

Example

+ +
// replaces true red with true blue
+someSprite.filters = [new ColorReplaceFilter({
+ originalColor: [1, 0, 0],
+ targetColor: [0, 0, 1],
+ tolerance: 0.001
+ })];
+// replaces the RGB color 220, 220, 220 with the RGB color 225, 200, 215
+someOtherSprite.filters = [new ColorReplaceFilter({
+ originalColor: [220/255.0, 220/255.0, 220/255.0],
+ targetColor: [225/255.0, 200/255.0, 215/255.0],
+ tolerance: 0.001
+ })];
+// replaces the RGB color 220, 220, 220 with the RGB color 225, 200, 215
+someOtherSprite.filters = [new ColorReplaceFilter({ originalColor: 0xdcdcdc, targetColor: 0xe1c8d7, tolerance: 0.001 })];
+ + +
+ + +

Extends

+ +
    + +
  • Filter
  • + +
+ + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + DEFAULT_OPTIONS + ColorReplaceFilterOptions + + staticreadonly + + +

+
+
+
+ +

Default values for options.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + epsilon + number + + Deprecated + : since 6.0.0 + + + + + + +

+
+
+
+ + +
+

Tolerance/sensitivity of the floating-point comparison between colors (lower = more exact, higher = more inclusive)

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0.4
+ + + + + +
See:
+
+ +
+ + + +
+ + + +
+ + + +
+
+

+ + newColor + number | number<Array> | Float32Array + + Deprecated + : since 6.0.0 + + + + + + +

+
+
+
+ + +
+

The resulting color, as a 3 component RGB e.g. [1.0, 0.5, 1.0]

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0x000000
+ + + + + +
See:
+
+ +
+ + + +
+ + + +
+ + + +
+
+

+ + originalColor + ColorSource + + + + +

+
+
+
+ + +
+

The color that will be changed.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0xff0000
+ + + + + + + +
+ + + +
Example
+ +
[1.0, 1.0, 1.0] = 0xffffff
+ + +
+ + + +
+
+

+ + targetColor + ColorSource + + + + +

+
+
+
+ + +
+

The resulting color.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0x000000
+ + + + + + + +
+ + + +
Example
+ +
[1.0, 1.0, 1.0] = 0xffffff
+ + +
+ + + +
+
+

+ + tolerance + number + + + + +

+
+
+
+ + +
+

Tolerance/sensitivity of the floating-point comparison between colors (lower = more exact, higher = more inclusive)

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0.4
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/ColorReplaceFilterOptions.html b/docs/ColorReplaceFilterOptions.html new file mode 100644 index 000000000..68caaa571 --- /dev/null +++ b/docs/ColorReplaceFilterOptions.html @@ -0,0 +1,2561 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Interface: ColorReplaceFilterOptions +

+ + + +
+ +
+
+

+ ColorReplaceFilterOptions + + +

+ + +

Options for the ColorReplaceFilter constructor.

+ + +
+
+ +
+
+ + + +
+ + +
Properties:
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
originalColor + + ColorSource + + + + 0xff0000 + + + +

The color that will be changed.

+ +
targetColor + + ColorSource + + + + 0x000000 + + + +

The resulting color.

+ +
tolerance + + number + + + + 0.4 + + + +

Tolerance/sensitivity of the floating-point comparison between colors (lower = more exact, higher = more inclusive)

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + originalColor + ColorSource + + + + +

+
+
+
+ + +
+

The color that will be changed.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0xff0000
+ + + + + + + +
+ + + +
Example
+ +
[1.0, 1.0, 1.0] = 0xffffff
+ + +
+ + + +
+
+

+ + targetColor + ColorSource + + + + +

+
+
+
+ + +
+

The resulting color.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0x000000
+ + + + + + + +
+ + + +
Example
+ +
[1.0, 1.0, 1.0] = 0xffffff
+ + +
+ + + +
+
+

+ + tolerance + number + + + + +

+
+
+
+ + +
+

Tolerance/sensitivity of the floating-point comparison between colors (lower = more exact, higher = more inclusive)

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0.4
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/ColorStop.html b/docs/ColorStop.html new file mode 100644 index 000000000..dec343aeb --- /dev/null +++ b/docs/ColorStop.html @@ -0,0 +1,2251 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Interface: ColorStop +

+ + + +
+ +
+
+

+ ColorStop + + +

+ + +

Color stop object.

+ + +
+
+ +
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/ConvolutionFilter.html b/docs/ConvolutionFilter.html new file mode 100644 index 000000000..0f8214454 --- /dev/null +++ b/docs/ConvolutionFilter.html @@ -0,0 +1,2619 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Class: ConvolutionFilter +

+ + + +
+ +
+
+

+ ConvolutionFilter + + +

+ + + +

The ConvolutionFilter class applies a matrix convolution filter effect. +A convolution combines pixels in the input image with neighboring pixels to produce a new image. +A wide variety of image effects can be achieved through convolutions, including blurring, edge +detection, sharpening, embossing, and beveling. The matrix should be specified as a 9 point Array. +See https://docs.gimp.org/2.10/en/gimp-filter-convolution-matrix.html for more info.
+originalfilter

+ +
+
+ +
+
+ + +
+
+

+ + + + new ConvolutionFilter + + + (options) + + + + +

+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + ConvolutionFilterOptions + + + + <optional>
+ + + + + +
+

Options for the ConvolutionFilter constructor.

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + +

Extends

+ +
    + +
  • Filter
  • + +
+ + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + DEFAULT_OPTIONS + ConvolutionFilterOptions + + staticreadonly + + +

+
+
+
+ +

Default values for options.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + height + number + + + + +

+
+
+
+ + +
+

Height of the object you are transforming

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 200
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + matrix + ConvolutionMatrix + + + + +

+
+
+
+ + +
+

An array of values used for matrix transformation, specified as a 9 point Array

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • [0,0,0,0,0,0,0,0,0]
+ + + + + + + +
+ + + +
Example
+ +
const matrix = new Float32Array(9); // 9 elements of value 0
+const matrix = [0,0.5,0,0.5,1,0.5,0,0.5,0];
+ + +
+ + + +
+
+

+ + width + number + + + + +

+
+
+
+ + +
+

Width of the object you are transforming

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 200
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/ConvolutionFilterOptions.html b/docs/ConvolutionFilterOptions.html new file mode 100644 index 000000000..748cb6505 --- /dev/null +++ b/docs/ConvolutionFilterOptions.html @@ -0,0 +1,2557 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Interface: ConvolutionFilterOptions +

+ + + +
+ +
+
+

+ ConvolutionFilterOptions + + +

+ + +

Options for the ConvolutionFilter constructor.

+ + +
+
+ +
+
+ + + +
+ + +
Properties:
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
height + + number + + + + 200 + + + +

Height of the object you are transforming

+ +
matrix + + ConvolutionMatrix + + + + [0,0,0,0,0,0,0,0,0] + + + +

An array of values used for matrix transformation, specified as a 9 point Array

+ +
width + + number + + + + 200 + + + +

Width of the object you are transforming

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + height + number + + + + +

+
+
+
+ + +
+

Height of the object you are transforming

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 200
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + matrix + ConvolutionMatrix + + + + +

+
+
+
+ + +
+

An array of values used for matrix transformation, specified as a 9 point Array

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • [0,0,0,0,0,0,0,0,0]
+ + + + + + + +
+ + + +
Example
+ +
const matrix = new Float32Array(9); // 9 elements of value 0
+const matrix = [0,0.5,0,0.5,1,0.5,0,0.5,0];
+ + +
+ + + +
+
+

+ + width + number + + + + +

+
+
+
+ + +
+

Width of the object you are transforming

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 200
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/CrossHatchFilter.html b/docs/CrossHatchFilter.html new file mode 100644 index 000000000..b497128ec --- /dev/null +++ b/docs/CrossHatchFilter.html @@ -0,0 +1,2261 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Class: CrossHatchFilter +

+ + + +
+ +
+
+

+ CrossHatchFilter + + +

+ + + +

A Cross Hatch effect filter.
+originalfilter

+ +
+
+ +
+
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + +

Extends

+ +
    + +
  • Filter
  • + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/DotFilter.html b/docs/DotFilter.html new file mode 100644 index 000000000..e1f5a8c07 --- /dev/null +++ b/docs/DotFilter.html @@ -0,0 +1,2611 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Class: DotFilter +

+ + + +
+ +
+
+

+ DotFilter + + +

+ + + +

This filter applies a dotscreen effect making display objects appear to be made out of +black and white halftone dots like an old printer.
+originalfilter

+

Original filter

+ +
+
+ +
+
+ + +
+
+

+ + + + new DotFilter + + + (options) + + + + +

+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + DotFilterOptions + + + + <optional>
+ + + + + +
+

Options for the DotFilter constructor.

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + +

Extends

+ +
    + +
  • Filter
  • + +
+ + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + DEFAULT_OPTIONS + DotFilterOptions + + staticreadonly + + +

+
+
+
+ +

Default values for options.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + angle + number + + + + +

+
+
+
+ + +
+

The radius of the effect.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 5
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + grayscale + boolean + + + + +

+
+
+
+ + +
+

Whether to rendering it in gray scale.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • true
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + scale + number + + + + +

+
+
+
+ + +
+

The scale of the effect.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/DotFilterOptions.html b/docs/DotFilterOptions.html new file mode 100644 index 000000000..fecb9d52e --- /dev/null +++ b/docs/DotFilterOptions.html @@ -0,0 +1,2551 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Interface: DotFilterOptions +

+ + + +
+ +
+
+

+ DotFilterOptions + + +

+ + +

Options for the DotFilter constructor.

+ + +
+
+ +
+
+ + + +
+ + +
Properties:
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
angle + + number + + + + 5 + + + +

The angle of the effect

+ +
grayscale + + boolean + + + + true + + + +

Whether to rendering it in gray scale

+ +
scale + + number + + + + 1 + + + +

The scale of the effect

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + angle + number + + + + +

+
+
+
+ + +
+

The angle of the effect

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 5
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + grayscale + boolean + + + + +

+
+
+
+ + +
+

Whether to rendering it in gray scale

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • true
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + scale + number + + + + +

+
+
+
+ + +
+

The scale of the effect

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/DropShadowFilter.html b/docs/DropShadowFilter.html new file mode 100644 index 000000000..58c05c4f4 --- /dev/null +++ b/docs/DropShadowFilter.html @@ -0,0 +1,3104 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Class: DropShadowFilter +

+ + + +
+ +
+
+

+ DropShadowFilter + + +

+ + + +

Drop shadow filter.
+originalfilter

+ +
+
+ +
+
+ + +
+
+

+ + + + new DropShadowFilter + + + (options) + + + + +

+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + DropShadowFilterOptions + + + + <optional>
+ + + + + +
+

Options for the DropShadowFilter constructor.

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + +

Extends

+ +
    + +
  • Filter
  • + +
+ + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + DEFAULT_OPTIONS + DropShadowFilterOptions + + staticreadonly + + +

+
+
+
+ +

Default values for options.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + alpha + number + + + + +

+
+
+
+ + +
+

Coefficient for alpha multiplication

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + blur + number + + + + +

+
+
+
+ + +
+

The strength of the shadow's blur.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 2
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + color + ColorSource + + + + +

+
+
+
+ + +
+

The color value of shadow.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0x000000
+ + + + + + + +
+ + + +
Example
+ +
[0.0, 0.0, 0.0] = 0x000000
+ + +
+ + + +
+
+

+ + kernels + number[] + + + + +

+
+
+
+ +

Sets the kernels of the Blur Filter

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + offset + PointData + + + + +

+
+
+
+ + +
+

Set the offset position of the drop-shadow relative to the original image.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • [4,4]
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + offsetX + number + + + + +

+
+
+
+ + +
+

Set the offset position of the drop-shadow relative to the original image on the x axis

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 4
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + offsetY + number + + + + +

+
+
+
+ + +
+

Set the offset position of the drop-shadow relative to the original image on the y axis

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 4
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + pixelSize + PointData + + + + +

+
+
+
+ + +
+

Sets the pixelSize of the Kawase Blur filter

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • [1,1]
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + pixelSizeX + number + + + + +

+
+
+
+ + +
+

Sets the pixelSize of the Kawase Blur filter on the x axis

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + pixelSizeY + number + + + + +

+
+
+
+ + +
+

Sets the pixelSize of the Kawase Blur filter on the y axis

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + quality + number + + + + +

+
+
+
+ + +
+

Sets the quality of the Blur Filter

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 4
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + shadowOnly + boolean + + + + +

+
+
+
+ + +
+

Hide the contents, only show the shadow.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • false
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/DropShadowFilterOptions.html b/docs/DropShadowFilterOptions.html new file mode 100644 index 000000000..645ef2dcd --- /dev/null +++ b/docs/DropShadowFilterOptions.html @@ -0,0 +1,3084 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Interface: DropShadowFilterOptions +

+ + + +
+ +
+
+

+ DropShadowFilterOptions + + +

+ + +

Options for the DropShadowFilter constructor.

+ + +
+
+ +
+
+ + + +
+ + +
Properties:
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
alpha + + number + + + + 1 + + + +

Coefficient for alpha multiplication.

+ +
blur + + number + + + + 2 + + + +

The strength of the shadow's blur.

+ +
color + + ColorSource + + + + 0x000000 + + + +

The color value of shadow.

+ +
kernels + + number[] + + + + null + + + +

The kernel size of the blur filter.

+ +
offset + + PointData + + + + {x:4,y:4} + + + +

The offset position of the drop-shadow relative to the original image.

+ +
pixelSize + + PointData | number[] | number + + + + {x:1,y:1} + + + +

The pixelSize of the Kawase Blur filter

+ +
quality + + number + + + + 4 + + + +

The quality of the Blur Filter.

+ +
resolution + + number + + + + 1 + + + +

The resolution of the Kawase Blur filter

+ +
shadowOnly + + boolean + + + + false + + + +

Hide the contents, only show the shadow.

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + alpha + number + + + + +

+
+
+
+ + +
+

Coefficient for alpha multiplication.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + blur + number + + + + +

+
+
+
+ + +
+

The strength of the shadow's blur.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 2
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + color + ColorSource + + + + +

+
+
+
+ + +
+

The color value of shadow.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0x000000
+ + + + + + + +
+ + + +
Example
+ +
[0.0, 0.0, 0.0] = 0x000000
+ + +
+ + + +
+
+

+ + kernels + number[] + + + + +

+
+
+
+ + +
+

The kernel size of the blur filter.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • null
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + offset + PointData + + + + +

+
+
+
+ + +
+

The offset position of the drop-shadow relative to the original image.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • {x:4,y:4}
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + pixelSize + PointData | number[] | number + + + + +

+
+
+
+ + +
+

The pixelSize of the Kawase Blur filter

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • {x:1,y:1}
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + quality + number + + + + +

+
+
+
+ + +
+

The quality of the Blur Filter.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 4
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + resolution + number + + + + +

+
+
+
+ + +
+

The resolution of the Kawase Blur filter

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + shadowOnly + boolean + + + + +

+
+
+
+ + +
+

Hide the contents, only show the shadow.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • false
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/EmbossFilter.html b/docs/EmbossFilter.html new file mode 100644 index 000000000..0f5696020 --- /dev/null +++ b/docs/EmbossFilter.html @@ -0,0 +1,2457 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Class: EmbossFilter +

+ + + +
+ +
+
+

+ EmbossFilter + + +

+ + + +

An RGB Split Filter.
+originalfilter

+ +
+
+ +
+
+ + +
+
+

+ + + + new EmbossFilter + + + (strength) + + + + +

+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
strength + + number + + + + <optional>
+ + + + + +
+ + 5 + + +

Strength of the emboss.

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + +

Extends

+ +
    + +
  • Filter
  • + +
+ + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + strength + number + + + + +

+
+
+
+ + +
+

Strength of the emboss

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 5
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/GlitchFilter.html b/docs/GlitchFilter.html new file mode 100644 index 000000000..f7f322adb --- /dev/null +++ b/docs/GlitchFilter.html @@ -0,0 +1,3495 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Class: GlitchFilter +

+ + + +
+ +
+
+

+ GlitchFilter + + +

+ + + +

The GlitchFilter applies a glitch effect to an object.
+originalfilter

+ +
+
+ +
+
+ + +
+
+

+ + + + new GlitchFilter + + + (options) + + + + +

+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + GlitchFilterOptions + + + + <optional>
+ + + + + +
+

Options for the GlitchFilter constructor.

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + +

Extends

+ +
    + +
  • Filter
  • + +
+ + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + defaults + GlitchFilterOptions + + staticreadonly + + +

+
+
+
+ +

Default constructor options.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + average + boolean + + + + +

+
+
+
+ + +
+

true will divide the bands roughly based on equal amounts +where as setting to false will vary the band sizes dramatically (more random looking).

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • false
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + blue + PointData + + + + +

+
+
+
+ + +
+

Blue offset.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • {x:0,y:0}
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + direction + number + + + + +

+
+
+
+ + +
+

The angle in degree of the offset of slices.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + fillMode + FILL_MODES + + + + +

+
+
+
+ + +
+

The fill mode of the space after the offset.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • FILL_MODES.TRANSPARENT
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + green + PointData + + + + +

+
+
+
+ + +
+

Green channel offset.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • {x:0,y:0}
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + minSize + number + + + + +

+
+
+
+ +

Minimum size of slices as a portion of the sampleSize

+ + + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 8
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + offset + number + + + + +

+
+
+
+ + +
+

The maximum offset amount of slices.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 100
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + offsets + Array<number> | Float32Array + + + + +

+
+
+
+ + +
+

Manually set custom slices offset of displacement bitmap, this is +a collection of values from -1 to 1. To change the max offset value +set offset.

+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + red + PointData + + + + +

+
+
+
+ + +
+

Red channel offset.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • {x:0,y:0}
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + sampleSize + number + + + + +

+
+
+
+ +

Height of the displacement map canvas.

+ + + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 512
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + seed + number + + + + +

+
+
+
+ + +
+

A seed value for randomizing glitch effect.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + sizes + Array<number> | Float32Array + + + + +

+
+
+
+ +

Manually custom slices size (height) of displacement bitmap

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + slices + number + + + + +

+
+
+
+ + +
+

The count of slices.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 5
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + texture + Texture + + readonly + + +

+
+
+
+ + +
+

The displacement map is used to generate the bands. +If using your own texture, slices will be ignored.

+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + +

Methods

+ + + +
+
+

+ + + + destroy + + + () void + + + + +

+ + +
+
+
+ +

Removes all references

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + + + redraw + + + () void + + + + +

+ + +
+
+
+ +

Redraw displacement bitmap texture, advanced usage.

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + + + refresh + + + () void + + + + +

+ + +
+
+
+ +

Regenerating random size, offsets for slices.

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+
+

+ + + + shuffle + + + () void + + + + +

+ + +
+
+
+ +

Shuffle the sizes of the slices, advanced usage.

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/GlitchFilterOptions.html b/docs/GlitchFilterOptions.html new file mode 100644 index 000000000..b087a66a8 --- /dev/null +++ b/docs/GlitchFilterOptions.html @@ -0,0 +1,3257 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Interface: GlitchFilterOptions +

+ + + +
+ +
+
+

+ GlitchFilterOptions + + +

+ + +

Options for the GlitchFilter constructor.

+ + +
+
+ +
+
+ + + +
+ + +
Properties:
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
average + + boolean + + + + false + + + +

true will divide the bands roughly based on equal amounts +where as setting to false will vary the band sizes dramatically (more random looking).

+ +
blue + + PointData | number[] + + + + {x:0,y:0} + + + +

Blue offset.

+ +
direction + + number + + + + 0 + + + +

The angle in degree of the offset of slices.

+ +
fillMode + + number + + + + FILL_MODES.TRANSPARENT + + + +

The fill mode of the space after the offset.

+ +
green + + PointData | number[] + + + + {x:0,y:0} + + + +

Green channel offset.

+ +
minSize + + number + + + + 8 + + + +

Minimum size of slices as a portion of the sampleSize

+ +
offset + + number + + + + 100 + + + +

The maximum offset amount of slices.

+ +
red + + PointData | number[] + + + + {x:0,y:0} + + + +

Red channel offset.

+ +
sampleSize + + number + + + + 512 + + + +

Height of the displacement map canvas.

+ +
seed + + number + + + + 0 + + + +

A seed value for randomizing glitch effect.

+ +
slices + + number + + + + 5 + + + +

The count of glitch slices.

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + average + boolean + + + + +

+
+
+
+ + +
+

true will divide the bands roughly based on equal amounts +where as setting to false will vary the band sizes dramatically (more random looking).

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • false
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + blue + PointData | number[] + + + + +

+
+
+
+ + +
+

Blue offset.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • {x:0,y:0}
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + direction + number + + + + +

+
+
+
+ + +
+

The angle in degree of the offset of slices.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + fillMode + number + + + + +

+
+
+
+ + +
+

The fill mode of the space after the offset.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • FILL_MODES.TRANSPARENT
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + green + PointData | number[] + + + + +

+
+
+
+ + +
+

Green channel offset.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • {x:0,y:0}
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + minSize + number + + + + +

+
+
+
+ + +
+

Minimum size of slices as a portion of the sampleSize

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 8
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + offset + number + + + + +

+
+
+
+ + +
+

The maximum offset amount of slices.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 100
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + red + PointData | number[] + + + + +

+
+
+
+ + +
+

Red channel offset.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • {x:0,y:0}
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + sampleSize + number + + + + +

+
+
+
+ + +
+

Height of the displacement map canvas.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 512
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + seed + number + + + + +

+
+
+
+ + +
+

A seed value for randomizing glitch effect.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + slices + number + + + + +

+
+
+
+ + +
+

The count of glitch slices.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 5
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/GlowFilter.html b/docs/GlowFilter.html new file mode 100644 index 000000000..94d30aca7 --- /dev/null +++ b/docs/GlowFilter.html @@ -0,0 +1,2837 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Class: GlowFilter +

+ + + +
+ +
+
+

+ GlowFilter + + +

+ + + +

GlowFilter, originally by mishaa +codepen.
+originalfilter

+ +
+
+ +
+
+ + +
+
+

+ + + + new GlowFilter + + + (options) + + + + +

+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + GlowFilterOptions + + + + <optional>
+ + + + + +
+

Options for the GlowFilter constructor.

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +

Example

+ +
someSprite.filters = [
+    new GlowFilter({ distance: 15, outerStrength: 2 })
+];
+ + +
+ + +

Extends

+ +
    + +
  • Filter
  • + +
+ + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + DEFAULT_OPTIONS + GlowFilterOptions + + staticreadonly + + +

+
+
+
+ +

Default values for options.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + alpha + number + + + + +

+
+
+
+ + +
+

The alpha of the glow

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + color + ColorSource + + + + +

+
+
+
+ + +
+

The color of the glow.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0xFFFFFF
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + distance + number + + + + +

+
+
+
+ + +
+

Only draw the glow, not the texture itself

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • false
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + innerStrength + number + + + + +

+
+
+
+ + +
+

The strength of the glow inward from the edge of the sprite.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + knockout + boolean + + + + +

+
+
+
+ + +
+

Only draw the glow, not the texture itself

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • false
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + outerStrength + number + + + + +

+
+
+
+ + +
+

The strength of the glow outward from the edge of the sprite.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 4
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + quality + number + + + + +

+
+
+
+ + +
+

A number between 0 and 1 that describes the quality of the glow. The higher the number the less performant

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0.1
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/GlowFilterOptions.html b/docs/GlowFilterOptions.html new file mode 100644 index 000000000..16123d565 --- /dev/null +++ b/docs/GlowFilterOptions.html @@ -0,0 +1,2903 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Interface: GlowFilterOptions +

+ + + +
+ +
+
+

+ GlowFilterOptions + + +

+ + +

Options for the GlowFilter constructor.

+ + +
+
+ +
+
+ + + +
+ + +
Properties:
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
alpha + + number + + + + 1 + + + +

The alpha of the glow

+ +
color + + ColorSource + + + + 0xffffff + + + +

The color of the glow

+ +
distance + + number + + + + 10 + + + +

The distance of the glow

+ +
innerStrength + + number + + + + 0 + + + +

The strength of the glow inward from the edge of the sprite

+ +
knockout + + boolean + + + + false + + + +

Toggle to hide the contents and only show glow

+ +
outerStrength + + number + + + + 4 + + + +

The strength of the glow outward from the edge of the sprite

+ +
quality + + number + + + + 0.1 + + + +

A number between 0 and 1 that describes the quality of the glow. The higher the number the less performant

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + alpha + number + + + + +

+
+
+
+ + +
+

The alpha of the glow

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + color + ColorSource + + + + +

+
+
+
+ + +
+

The color of the glow

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0xffffff
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + distance + number + + + + +

+
+
+
+ + +
+

The distance of the glow

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 10
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + innerStrength + number + + + + +

+
+
+
+ + +
+

The strength of the glow inward from the edge of the sprite

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + knockout + boolean + + + + +

+
+
+
+ + +
+

Toggle to hide the contents and only show glow

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • false
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + outerStrength + number + + + + +

+
+
+
+ + +
+

The strength of the glow outward from the edge of the sprite

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 4
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + quality + number + + + + +

+
+
+
+ + +
+

A number between 0 and 1 that describes the quality of the glow. The higher the number the less performant

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0.1
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/GodrayFilter.html b/docs/GodrayFilter.html new file mode 100644 index 000000000..4370c5a42 --- /dev/null +++ b/docs/GodrayFilter.html @@ -0,0 +1,2948 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Class: GodrayFilter +

+ + + +
+ +
+
+

+ GodrayFilter + + +

+ + +

GordayFilter, originally by Alain Galvan

+ + +

originalfilter

+ +
+
+ +
+
+ + +
+
+

+ + + + new GodrayFilter + + + (options) + + + + +

+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + GodrayFilterOptions + + + + <optional>
+ + + + + +
+

Options for the GodrayFilter constructor.

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +

Example

+ +
displayObject.filters = [new GodrayFilter()];
+ + +
+ + +

Extends

+ +
    + +
  • Filter
  • + +
+ + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + DEFAULT_OPTIONS + GodrayFilterOptions + + staticreadonly + + +

+
+
+
+ +

Default values for options.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + alpha + number + + + + +

+
+
+
+ + +
+

The alpha (opacity) of the rays. 0 is fully transparent, 1 is fully opaque.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + angle + number + + + + +

+
+
+
+ + +
+

The angle/light-source of the rays in degrees. For instance, +a value of 0 is vertical rays, values of 90 or -90 produce horizontal rays

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 30
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + center + PointData + + + + +

+
+
+
+ + +
+

Focal point for non-parallel rays, to use this parallel must be set to false.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • {x:0,y:0}
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + centerX + number + + + + +

+
+
+
+ + +
+

Focal point for non-parallel rays on the x axis, to use this parallel must be set to false.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + centerY + number + + + + +

+
+
+
+ + +
+

Focal point for non-parallel rays on the y axis, to use this parallel must be set to false.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + gain + number + + + + +

+
+
+
+ + +
+

General intensity of the effect. A value closer to 1 will produce a more intense effect, +where a value closer to 0 will produce a subtler effect

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0.5
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + lacunarity + number + + + + +

+
+
+
+ + +
+

The density of the fractal noise. +A higher amount produces more rays and a smaller amount produces fewer waves

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 2.5
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + parallel + boolean + + + + +

+
+
+
+ + +
+

true if light rays are parallel (uses angle), false to use the focal center point

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • true
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + time + number + + + + +

+
+
+
+ + +
+

The current time position

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/GodrayFilterOptions.html b/docs/GodrayFilterOptions.html new file mode 100644 index 000000000..6d8335f3f --- /dev/null +++ b/docs/GodrayFilterOptions.html @@ -0,0 +1,2911 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Interface: GodrayFilterOptions +

+ + + +
+ +
+
+

+ GodrayFilterOptions + + +

+ + +

Options for the GodrayFilter constructor.

+ + +
+
+ +
+
+ + + +
+ + +
Properties:
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
alpha + + number + + + + 1 + + + +

The alpha (opacity) of the rays. 0 is fully transparent, 1 is fully opaque.

+ +
angle + + number + + + + 30 + + + +

The angle/light-source of the rays in degrees. For instance, +a value of 0 is vertical rays, values of 90 or -90 produce horizontal rays.

+ +
center + + PointData | number[] + + + + {x:0,y:0} + + + +

Focal point for non-parallel rays, to use this parallel must be set to false. +This should be a size 2 array or an object containing x and y values, you cannot change types +once defined in the constructor

+ +
gain + + number + + + + 0.5 + + + +

General intensity of the effect. A value closer to 1 will produce a more intense effect, +where a value closer to 0 will produce a subtler effect.

+ +
lacunarity + + number + + + + 2.5 + + + +

The density of the fractal noise

+ +
parallel + + boolean + + + + true + + + +

true if light rays are parallel (uses angle), false to use the focal center point

+ +
time + + number + + + + 0 + + + +

The current time position

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + alpha + number + + + + +

+
+
+
+ + +
+

The alpha (opacity) of the rays. 0 is fully transparent, 1 is fully opaque.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + angle + number + + + + +

+
+
+
+ + +
+

The angle/light-source of the rays in degrees. For instance, +a value of 0 is vertical rays, values of 90 or -90 produce horizontal rays.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 30
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + center + PointData | number[] + + + + +

+
+
+
+ + +
+

Focal point for non-parallel rays, to use this parallel must be set to false. +This should be a size 2 array or an object containing x and y values, you cannot change types +once defined in the constructor

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • {x:0,y:0}
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + gain + number + + + + +

+
+
+
+ + +
+

General intensity of the effect. A value closer to 1 will produce a more intense effect, +where a value closer to 0 will produce a subtler effect.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0.5
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + lacunarity + number + + + + +

+
+
+
+ + +
+

The density of the fractal noise

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 2.5
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + parallel + boolean + + + + +

+
+
+
+ + +
+

true if light rays are parallel (uses angle), false to use the focal center point

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • true
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + time + number + + + + +

+
+
+
+ + +
+

The current time position

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/GrayscaleFilter.html b/docs/GrayscaleFilter.html new file mode 100644 index 000000000..81bec4c2b --- /dev/null +++ b/docs/GrayscaleFilter.html @@ -0,0 +1,2261 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Class: GrayscaleFilter +

+ + + +
+ +
+
+

+ GrayscaleFilter + + +

+ + + +

This filter applies a grayscale effect.
+originalfilter

+ +
+
+ +
+
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + +

Extends

+ +
    + +
  • Filter
  • + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/HslAdjustmentFilter.html b/docs/HslAdjustmentFilter.html new file mode 100644 index 000000000..fb1df5774 --- /dev/null +++ b/docs/HslAdjustmentFilter.html @@ -0,0 +1,2720 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Class: HslAdjustmentFilter +

+ + + +
+ +
+
+

+ HslAdjustmentFilter + + +

+ + +

originalfilter

+ + +

This WebGPU filter has been ported from the WebGL renderer that was originally created by Viktor Persson (@vikpe)

+ +
+
+ +
+
+ + +
+
+

+ + + + new HslAdjustmentFilter + + + (options) + + + + +

+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + HslAdjustmentFilterOptions + + + + <optional>
+ + + + + +
+

Options for the HslAdjustmentFilter constructor.

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + +

Extends

+ +
    + +
  • Filter
  • + +
+ + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + DEFAULT_OPTIONS + HslAdjustmentFilterOptions + + staticreadonly + + +

+
+
+
+ +

Default values for options.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + alpha + number + + + + +

+
+
+
+ + +
+

The amount of alpha (0 to 1)

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + colorize + boolean + + + + +

+
+
+
+ + +
+

Whether to colorize the image

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • false
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + hue + number + + + + +

+
+
+
+ + +
+

The amount of hue in degrees (-180 to 180)

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + lightness + number + + + + +

+
+
+
+ + +
+

The amount of lightness (-1 to 1)

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + saturation + number + + + + +

+
+
+
+ + +
+

The amount of lightness (-1 to 1)

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/HslAdjustmentFilterOptions.html b/docs/HslAdjustmentFilterOptions.html new file mode 100644 index 000000000..41c9c06ac --- /dev/null +++ b/docs/HslAdjustmentFilterOptions.html @@ -0,0 +1,2727 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Interface: HslAdjustmentFilterOptions +

+ + + +
+ +
+
+

+ HslAdjustmentFilterOptions + + +

+ + +

Options for the HslAdjustmentFilter constructor.

+ + +
+
+ +
+
+ + + +
+ + +
Properties:
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
alpha + + number + + + + 1 + + + +

The amount of alpha (0 to 1)

+ +
colorize + + boolean + + + + false + + + +

Whether to colorize the image

+ +
hue + + number + + + + 0 + + + +

The amount of hue in degrees (-180 to 180)

+ +
lightness + + number + + + + 0 + + + +

The amount of lightness (-1 to 1)

+ +
saturation + + number + + + + 0 + + + +

The amount of color saturation (-1 to 1)

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + alpha + number + + + + +

+
+
+
+ + +
+

The amount of alpha (0 to 1)

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + colorize + boolean + + + + +

+
+
+
+ + +
+

Whether to colorize the image

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • false
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + hue + number + + + + +

+
+
+
+ + +
+

The amount of hue in degrees (-180 to 180)

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + lightness + number + + + + +

+
+
+
+ + +
+

The amount of lightness (-1 to 1)

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + saturation + number + + + + +

+
+
+
+ + +
+

The amount of color saturation (-1 to 1)

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/KawaseBlurFilter.html b/docs/KawaseBlurFilter.html new file mode 100644 index 000000000..206604409 --- /dev/null +++ b/docs/KawaseBlurFilter.html @@ -0,0 +1,2836 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Class: KawaseBlurFilter +

+ + + +
+ +
+
+

+ KawaseBlurFilter + + +

+ + + +

A much faster blur than Gaussian blur, but more complicated to use.
+originalfilter

+ +
+
+ +
+
+ + +
+
+

+ + + + new KawaseBlurFilter + + + (options) + + + + +

+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + KawaseBlurFilterOptions + + + + <optional>
+ + + + + +
+

Options for the KawaseBlurFilter constructor.

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + +
See:
+
+ +
+ + + +
+ + + +
+ + +

Extends

+ +
    + +
  • Filter
  • + +
+ + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + DEFAULT_OPTIONS + KawaseBlurFilterOptions + + staticreadonly + + +

+
+
+
+ +

Default values for options.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + clamp + boolean + + + + +

+
+
+
+ + +
+

Get the if the filter is clamped

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • false
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + kernels + number[] + + + + +

+
+
+
+ + +
+

The kernel size of the blur filter, for advanced usage

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • [0]
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + pixelSize + PointData + + + + +

+
+
+
+ + +
+

The size of the pixels. Large size is blurrier. For advanced usage.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • {x:1,y:1}
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + pixelSizeX + number + + + + +

+
+
+
+ + +
+

The size of the pixels on the x axis. Large size is blurrier. For advanced usage.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + pixelSizeY + number + + + + +

+
+
+
+ + +
+

The size of the pixels on the y axis. Large size is blurrier. For advanced usage.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + quality + number + + + + +

+
+
+
+ + +
+

The quality of the filter, integer greater than 1.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 3
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + strength + number + + + + +

+
+
+
+ + +
+

The amount of blur, value greater than 0.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 4
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/KawaseBlurFilterOptions.html b/docs/KawaseBlurFilterOptions.html new file mode 100644 index 000000000..aff5a8373 --- /dev/null +++ b/docs/KawaseBlurFilterOptions.html @@ -0,0 +1,2641 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Interface: KawaseBlurFilterOptions +

+ + + +
+ +
+
+

+ KawaseBlurFilterOptions + + +

+ + +

Options for the KawaseBlurFilter constructor.

+ + +
+
+ +
+
+ + + +
+ + +
Properties:
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
clamp + + boolean + + + + false + + + +

Clamp edges, useful for removing dark edges from fullscreen filters or bleeding to the edge of filterArea.

+ +
pixelSize + + PointData | number[] | number + + + + {x:1,y:1} + + + +

Sets the pixel size of the filter. Large size is blurrier. For advanced usage.

+ +
quality + + number + + + + 3 + + + +

The quality of the filter. Should be an integer greater than 1

+ +
strength + + number | [number, number] + + + + 4 + + + +

The blur of the filter. Should be greater than 0. +If value is an Array, setting kernels.

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + clamp + boolean + + + + +

+
+
+
+ + +
+

Clamp edges, useful for removing dark edges from fullscreen filters or bleeding to the edge of filterArea.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • false
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + pixelSize + PointData | number[] | number + + + + +

+
+
+
+ + +
+

Sets the pixel size of the filter. Large size is blurrier. For advanced usage.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • {x:1,y:1}
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + quality + number + + + + +

+
+
+
+ + +
+

The quality of the filter. Should be an integer greater than 1

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 3
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + strength + number | [number, number] + + + + +

+
+
+
+ + +
+

The blur of the filter. Should be greater than 0. +If value is an Array, setting kernels.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 4
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/MotionBlurFilter.html b/docs/MotionBlurFilter.html new file mode 100644 index 000000000..e99c39c8a --- /dev/null +++ b/docs/MotionBlurFilter.html @@ -0,0 +1,2721 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Class: MotionBlurFilter +

+ + + +
+ +
+
+

+ MotionBlurFilter + + +

+ + + +

The MotionBlurFilter applies a Motion blur to an object.
+originalfilter

+ +
+
+ +
+
+ + +
+
+

+ + + + new MotionBlurFilter + + + (options) + + + + +

+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + MotionBlurFilterOptions + + + + <optional>
+ + + + + +
+

Options for the MotionBlurFilter constructor.

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + +

Extends

+ +
    + +
  • Filter
  • + +
+ + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + DEFAULT_OPTIONS + MotionBlurFilterOptions + + staticreadonly + + +

+
+
+
+ +

Default values for options.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + kernelSize + number + + + + +

+
+
+
+ + +
+

The kernelSize of the blur filter. Must be odd number >= 5

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 5
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + offset + number + + + + +

+
+
+
+ + +
+

The offset of the blur filter

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + velocity + PointData + + + + +

+
+
+
+ + +
+

Sets the velocity of the motion for blur effect +This should be a size 2 array or an object containing x and y values, you cannot change types +once defined in the constructor

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • {x:0,y:0}
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + velocityX + number + + + + +

+
+
+
+ + +
+

Sets the velocity of the motion for blur effect on the x axis

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + velocityY + number + + + + +

+
+
+
+ + +
+

Sets the velocity of the motion for blur effect on the x axis

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/MotionBlurFilterOptions.html b/docs/MotionBlurFilterOptions.html new file mode 100644 index 000000000..97c0981e5 --- /dev/null +++ b/docs/MotionBlurFilterOptions.html @@ -0,0 +1,2555 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Interface: MotionBlurFilterOptions +

+ + + +
+ +
+
+

+ MotionBlurFilterOptions + + +

+ + +

Options for the MotionBlurFilter constructor.

+ + +
+
+ +
+
+ + + +
+ + +
Properties:
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
kernelSize + + number + + + + 5 + + + +

The kernelSize of the blur filter. Must be odd number >= 5

+ +
offset + + number + + + + 0 + + + +

The offset of the blur filter

+ +
velocity + + PointData | number[] + + + + {x:0,y:0} + + + +

Sets the velocity of the motion for blur effect +This should be a size 2 array or an object containing x and y values, you cannot change types +once defined in the constructor

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + kernelSize + number + + + + +

+
+
+
+ + +
+

The kernelSize of the blur filter. Must be odd number >= 5

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 5
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + offset + number + + + + +

+
+
+
+ + +
+

The offset of the blur filter

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + velocity + PointData | number[] + + + + +

+
+
+
+ + +
+

Sets the velocity of the motion for blur effect +This should be a size 2 array or an object containing x and y values, you cannot change types +once defined in the constructor

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • {x:0,y:0}
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/MultiColorReplaceFilter.html b/docs/MultiColorReplaceFilter.html new file mode 100644 index 000000000..228422469 --- /dev/null +++ b/docs/MultiColorReplaceFilter.html @@ -0,0 +1,2773 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Class: MultiColorReplaceFilter +

+ + + +
+ +
+
+

+ MultiColorReplaceFilter + + +

+ + + +

Filter for replacing a color with another color. Similar to ColorReplaceFilter, but support multiple +colors.
+originalfilter

+ +
+
+ +
+
+ + +
+
+

+ + + + new MultiColorReplaceFilter + + + (options) + + + + +

+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + MultiColorReplaceFilterOptions + + + + <optional>
+ + + + + +
+

Options for the MultiColorReplaceFilter constructor.

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +

Example

+ +
  // replaces pure red with pure blue, and replaces pure green with pure white
+  someSprite.filters = [new MultiColorReplaceFilter({
+    replacements: [
+      [0xFF0000, 0x0000FF],
+      [0x00FF00, 0xFFFFFF]
+    ],
+    tolerance: 0.001
+  })];
+
+  You also could use [R, G, B] as the color
+  someOtherSprite.filters = [new MultiColorReplaceFilter({
+    replacements: [
+      [ [1,0,0], [0,0,1] ],
+      [ [0,1,0], [1,1,1] ]
+    ],
+    tolerance: 0.001
+  })];
+ + +
+ + +

Extends

+ +
    + +
  • Filter
  • + +
+ + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + DEFAULT_OPTIONS + MultiColorReplaceFilterOptions + + staticreadonly + + +

+
+
+
+ +

Default values for options.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + epsilon + number + + Deprecated + : since 6.0.0 + + + + + + +

+
+
+
+ + +
+

Tolerance of the floating-point comparison between colors (lower = more exact, higher = more inclusive)

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0.05
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + maxColors + number + + readonly + + +

+
+
+
+ + +
+

The maximum number of color replacements supported by this filter. Can be changed +only during construction.

+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + replacements + Array<[ColorSource, ColorSource]> + + + + +

+
+
+
+ + +
+

The collection of replacement items. Each item is color-pair +(an array length is 2). In the pair, the first value is original color , the second value is target color

+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + tolerance + number + + + + +

+
+
+
+ + +
+

Tolerance of the floating-point comparison between colors (lower = more exact, higher = more inclusive)

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0.05
+ + + + + + + +
+ + + +
+ + + + + + + + + +

Methods

+ + + +
+
+

+ + + + refresh + + + () void + + + + +

+ + +
+
+
+ + +
+

Should be called after changing any of the contents of the replacements. +This is a convenience method for resetting the replacements.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
TODO
+
+
    +
  • implement nested proxy to remove the need for this function
  • +
+
+ +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/MultiColorReplaceFilterOptions.html b/docs/MultiColorReplaceFilterOptions.html new file mode 100644 index 000000000..e8e7f578a --- /dev/null +++ b/docs/MultiColorReplaceFilterOptions.html @@ -0,0 +1,2551 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Interface: MultiColorReplaceFilterOptions +

+ + + +
+ +
+
+

+ MultiColorReplaceFilterOptions + + +

+ + +

Options for the MultiColorReplaceFilter constructor.

+ + +
+
+ +
+
+ + + +
+ + +
Properties:
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
maxColors + + number + + + + + +

The maximum number of replacements filter is able to use. +Because the fragment is only compiled once, this cannot be changed after construction. +If omitted, the default value is the length of replacements

+ +
replacements + + Array<[ColorSource, ColorSource]> + + + + + +

The collection of replacement items. Each item is color-pair +(an array length is 2). In the pair, the first value is original color , the second value is target color

+

If you wish to change individual elements on the replacement array after instantiation, +use the refresh function to update the uniforms once you've made the changes

+ +
tolerance + + number + + + + 0.05 + + + +

Tolerance/sensitivity of the floating-point comparison between colors (lower = more exact, higher = more inclusive)

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + maxColors + number + + + + +

+
+
+
+ + +
+

The maximum number of replacements filter is able to use. +Because the fragment is only compiled once, this cannot be changed after construction. +If omitted, the default value is the length of replacements

+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + replacements + Array<[ColorSource, ColorSource]> + + + + +

+
+
+
+ + +
+

The collection of replacement items. Each item is color-pair +(an array length is 2). In the pair, the first value is original color , the second value is target color

+

If you wish to change individual elements on the replacement array after instantiation, +use the refresh function to update the uniforms once you've made the changes

+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + tolerance + number + + + + +

+
+
+
+ + +
+

Tolerance/sensitivity of the floating-point comparison between colors (lower = more exact, higher = more inclusive)

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0.05
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/OldFilmFilter.html b/docs/OldFilmFilter.html new file mode 100644 index 000000000..5db4fac66 --- /dev/null +++ b/docs/OldFilmFilter.html @@ -0,0 +1,2995 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Class: OldFilmFilter +

+ + + +
+ +
+
+

+ OldFilmFilter + + +

+ + + +

The OldFilmFilter applies a Old film effect to an object.
+originalfilter

+ +
+
+ +
+
+ + +
+
+

+ + + + new OldFilmFilter + + + (options) + + + + +

+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + OldFilmFilterOptions + + + + <optional>
+ + + + + +
+

Options for the OldFilmFilter constructor.

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + +

Extends

+ +
    + +
  • Filter
  • + +
+ + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + DEFAULT_OPTIONS + OldFilmFilterOptions + + staticreadonly + + +

+
+
+
+ +

Default values for options.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + noise + number + + + + +

+
+
+
+ + +
+

Opacity/intensity of the noise effect between 0 and 1

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0.3
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + noiseSize + number + + + + +

+
+
+
+ + +
+

The size of the noise particles

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + scratch + number + + + + +

+
+
+
+ + +
+

How often scratches appear

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0.5
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + scratchDensity + number + + + + +

+
+
+
+ + +
+

The density of the number of scratches

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0.3
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + scratchWidth + number + + + + +

+
+
+
+ + +
+

The width of the scratches

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + seed + number + + + + +

+
+
+
+ + +
+

A seed value to apply to the random noise generation

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + sepia + number + + + + +

+
+
+
+ + +
+

The amount of saturation of sepia effect, +a value of 1 is more saturation and closer to 0 is less, and a value of 0 produces no sepia effect

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0.3
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + vignetting + number + + + + +

+
+
+
+ + +
+

The radius of the vignette effect, smaller values produces a smaller vignette

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0.3
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + vignettingAlpha + number + + + + +

+
+
+
+ + +
+

Amount of opacity on the vignette

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + vignettingBlur + number + + + + +

+
+
+
+ + +
+

Blur intensity of the vignette

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/OldFilmFilterOptions.html b/docs/OldFilmFilterOptions.html new file mode 100644 index 000000000..c0566033b --- /dev/null +++ b/docs/OldFilmFilterOptions.html @@ -0,0 +1,3169 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Interface: OldFilmFilterOptions +

+ + + +
+ +
+
+

+ OldFilmFilterOptions + + +

+ + +

Options for the OldFilmFilter constructor.

+ + +
+
+ +
+
+ + + +
+ + +
Properties:
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
noise + + number + + + + 0.3 + + + +

Opacity/intensity of the noise effect between 0 and 1

+ +
noiseSize + + number + + + + 1 + + + +

The size of the noise particles

+ +
scratch + + number + + + + 0.5 + + + +

How often scratches appear

+ +
scratchDensity + + number + + + + 0.3 + + + +

The density of the number of scratches

+ +
scratchWidth + + number + + + + 1 + + + +

The width of the scratches

+ +
seed + + number + + + + 0 + + + +

A seed value to apply to the random noise generation

+ +
sepia + + number + + + + 0.3 + + + +

The amount of saturation of sepia effect, +a value of 1 is more saturation and closer to 0 is less, and a value of 0 produces no sepia effect

+ +
vignetting + + number + + + + 0.3 + + + +

The radius of the vignette effect, smaller values produces a smaller vignette

+ +
vignettingAlpha + + number + + + + 1 + + + +

Amount of opacity on the vignette

+ +
vignettingBlur + + number + + + + 1 + + + +

Blur intensity of the vignette

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + noise + number + + + + +

+
+
+
+ + +
+

Opacity/intensity of the noise effect between 0 and 1

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0.3
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + noiseSize + number + + + + +

+
+
+
+ + +
+

The size of the noise particles

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + scratch + number + + + + +

+
+
+
+ + +
+

How often scratches appear

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0.5
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + scratchDensity + number + + + + +

+
+
+
+ + +
+

The density of the number of scratches

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0.3
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + scratchWidth + number + + + + +

+
+
+
+ + +
+

The width of the scratches

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + seed + number + + + + +

+
+
+
+ + +
+

A seed value to apply to the random noise generation

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + sepia + number + + + + +

+
+
+
+ + +
+

The amount of saturation of sepia effect, +a value of 1 is more saturation and closer to 0 is less, and a value of 0 produces no sepia effect

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0.3
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + vignetting + number + + + + +

+
+
+
+ + +
+

The radius of the vignette effect, smaller values produces a smaller vignette

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0.3
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + vignettingAlpha + number + + + + +

+
+
+
+ + +
+

Amount of opacity on the vignette

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + vignettingBlur + number + + + + +

+
+
+
+ + +
+

Blur intensity of the vignette

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/OutlineFilter.html b/docs/OutlineFilter.html new file mode 100644 index 000000000..117befe29 --- /dev/null +++ b/docs/OutlineFilter.html @@ -0,0 +1,2838 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Class: OutlineFilter +

+ + + +
+ +
+
+

+ OutlineFilter + + +

+ + + +

OutlineFilter, originally by mishaa +http://www.html5gamedevs.com/topic/10640-outline-a-sprite-change-certain-colors/?p=69966 +http://codepen.io/mishaa/pen/emGNRB
+originalfilter

+ +
+
+ +
+
+ + +
+
+

+ + + + new OutlineFilter + + + (options) + + + + +

+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + OutlineFilterOptions + + + + <optional>
+ + + + + +
+

Options for the OutlineFilter constructor.

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +

Example

+ +
someSprite.filters = [new OutlineFilter(2, 0x99ff99)];
+ + +
+ + +

Extends

+ +
    + +
  • Filter *
  • + +
+ + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + DEFAULT_OPTIONS + OutlineFilterOptions + + staticreadonly + + +

+
+
+
+ +

Default values for options.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + MAX_SAMPLES + number + + static + + +

+
+
+
+ +

The maximum number of samples for rendering outline.

+ + + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 100
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + MIN_SAMPLES + number + + static + + +

+
+
+
+ +

The minimum number of samples for rendering outline.

+ + + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + alpha + number + + + + +

+
+
+
+ + +
+

Coefficient for alpha multiplication

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + color + ColorSource + + + + +

+
+
+
+ + +
+

The color value of the ambient color

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0x000000
+ + + + + + + +
+ + + +
Example
+ +
[1.0, 1.0, 1.0] = 0xffffff
+ + +
+ + + +
+
+

+ + knockout + boolean + + + + +

+
+
+
+ + +
+

Whether to only render outline, not the contents.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • false
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + quality + number + + + + +

+
+
+
+ + +
+

The quality of the outline from 0 to 1. +Using a higher quality setting will result in more accuracy but slower performance

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0.1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + thickness + number + + + + +

+
+
+
+ + +
+

The thickness of the outline

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/OutlineFilterOptions.html b/docs/OutlineFilterOptions.html new file mode 100644 index 000000000..4f9c6de07 --- /dev/null +++ b/docs/OutlineFilterOptions.html @@ -0,0 +1,2734 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Interface: OutlineFilterOptions +

+ + + +
+ +
+
+

+ OutlineFilterOptions + + +

+ + +

Options for the OutlineFilter constructor.

+ + +
+
+ +
+
+ + + +
+ + +
Properties:
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
alpha + + number + + + + 1 + + + +

The alpha of the outline

+ +
color + + ColorSource + + + + 0x000000 + + + +

The color of the outline

+ +
knockout + + boolean + + + + false + + + +

Whether to only render outline, not the contents.

+ +
quality + + number + + + + 0.1 + + + +

The quality of the outline from 0 to 1. +Using a higher quality setting will result in more accuracy but slower performance

+ +
thickness + + number + + + + 1 + + + +

The thickness of the outline

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + alpha + number + + + + +

+
+
+
+ + +
+

The alpha of the outline

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + color + ColorSource + + + + +

+
+
+
+ + +
+

The color of the outline

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0x000000
+ + + + + + + +
+ + + +
Example
+ +
[1.0, 1.0, 1.0] = 0xffffff
+ + +
+ + + +
+
+

+ + knockout + boolean + + + + +

+
+
+
+ + +
+

Whether to only render outline, not the contents.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • false
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + quality + number + + + + +

+
+
+
+ + +
+

The quality of the outline from 0 to 1. +Using a higher quality setting will result in more accuracy but slower performance

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0.1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + thickness + number + + + + +

+
+
+
+ + +
+

The thickness of the outline

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/PixelateFilter.html b/docs/PixelateFilter.html new file mode 100644 index 000000000..33f3b7abc --- /dev/null +++ b/docs/PixelateFilter.html @@ -0,0 +1,2567 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Class: PixelateFilter +

+ + + +
+ +
+
+

+ PixelateFilter + + +

+ + + +

This filter applies a pixelate effect making display objects appear 'blocky'.
+originalfilter

+ +
+
+ +
+
+ + +
+
+

+ + + + new PixelateFilter + + + (size) + + + + +

+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
size + + Point | number<Array> | number + + + + <optional>
+ + + + + +
+ + 10 + + +

Either the width/height of the size of the pixels, or square size

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + +

Extends

+ +
    + +
  • Filter
  • + +
+ + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + size + Size + + + + +

+
+
+
+ + +
+

The size of the pixels

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • [10,10]
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + sizeX + number + + + + +

+
+
+
+ + +
+

The size of the pixels on the x axis

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 10
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + sizeY + number + + + + +

+
+
+
+ + +
+

The size of the pixels on the y axis

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 10
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/RGBSplitFilter.html b/docs/RGBSplitFilter.html new file mode 100644 index 000000000..9196a05a0 --- /dev/null +++ b/docs/RGBSplitFilter.html @@ -0,0 +1,2939 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Class: RGBSplitFilter +

+ + + +
+ +
+
+

+ RGBSplitFilter + + +

+ + + +

An RGB Split Filter.
+originalfilter

+ +
+
+ +
+
+ + +
+
+

+ + + + new RGBSplitFilter + + + (options) + + + + +

+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + RGBSplitFilterOptions + + + + <optional>
+ + + + + +
+

Options for the RGBSplitFilter constructor.

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + +

Extends

+ +
    + +
  • Filter
  • + +
+ + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + DEFAULT_OPTIONS + RGBSplitFilterOptions + + staticreadonly + + +

+
+
+
+ +

Default values for options.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + blue + PointData + + + + +

+
+
+
+ + +
+

Blue channel offset.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • {x:0,y:0}
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + blueX + number + + + + +

+
+
+
+ + +
+

Amount of x-axis offset for the blue channel.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + blueY + number + + + + +

+
+
+
+ + +
+

Amount of y-axis offset for the blue channel.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + green + PointData + + + + +

+
+
+
+ + +
+

Green channel offset.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • {x:0,y:10}
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + greenX + number + + + + +

+
+
+
+ + +
+

Amount of x-axis offset for the green channel.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + greenY + number + + + + +

+
+
+
+ + +
+

Amount of y-axis offset for the green channel.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 10
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + red + PointData + + + + +

+
+
+
+ + +
+

Red channel offset.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • {x:-10,y:0}
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + redX + number + + + + +

+
+
+
+ + +
+

Amount of x-axis offset for the red channel.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • -10
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + redY + number + + + + +

+
+
+
+ + +
+

Amount of y-axis offset for the red channel.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/RGBSplitFilterOptions.html b/docs/RGBSplitFilterOptions.html new file mode 100644 index 000000000..9cf47927d --- /dev/null +++ b/docs/RGBSplitFilterOptions.html @@ -0,0 +1,2551 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Interface: RGBSplitFilterOptions +

+ + + +
+ +
+
+

+ RGBSplitFilterOptions + + +

+ + +

Options for the RGBSplitFilter constructor.

+ + +
+
+ +
+
+ + + +
+ + +
Properties:
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
blue + + OffsetType + + + + {x:0,y:0} + + + +

The amount of offset for the blue channel.

+ +
green + + OffsetType + + + + {x:0,y:10} + + + +

The amount of offset for the green channel.

+ +
red + + OffsetType + + + + {x:-10,y:0} + + + +

The amount of offset for the red channel.

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + blue + OffsetType + + + + +

+
+
+
+ + +
+

The amount of offset for the blue channel.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • {x:0,y:0}
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + green + OffsetType + + + + +

+
+
+
+ + +
+

The amount of offset for the green channel.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • {x:0,y:10}
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + red + OffsetType + + + + +

+
+
+
+ + +
+

The amount of offset for the red channel.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • {x:-10,y:0}
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/RadialBlurFilter.html b/docs/RadialBlurFilter.html new file mode 100644 index 000000000..a61c44e7d --- /dev/null +++ b/docs/RadialBlurFilter.html @@ -0,0 +1,2776 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Class: RadialBlurFilter +

+ + + +
+ +
+
+

+ RadialBlurFilter + + +

+ + + +

The RadialBlurFilter applies a Motion blur to an object.
+originalfilter

+ +
+
+ +
+
+ + +
+
+

+ + + + new RadialBlurFilter + + + (options) + + + + +

+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + RadialBlurFilterOptions + + + + <optional>
+ + + + + +
+

Options for the RadialBlurFilter constructor.

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + +

Extends

+ +
    + +
  • Filter
  • + +
+ + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + DEFAULT_OPTIONS + RadialBlurFilterOptions + + staticreadonly + + +

+
+
+
+ +

Default values for options.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + angle + number + + + + +

+
+
+
+ + +
+

Sets the angle in degrees of the motion for blur effect.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + center + PointData + + + + +

+
+
+
+ + +
+

The x and y offset coordinates to change the position of the center of the circle of effect. +This should be a size 2 array or an object containing x and y values, you cannot change types +once defined in the constructor

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • {x:0,y:0}
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + centerX + number + + + + +

+
+
+
+ + +
+

Sets the velocity of the motion for blur effect on the x axis

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + centerY + number + + + + +

+
+
+
+ + +
+

Sets the velocity of the motion for blur effect on the x axis

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + kernelSize + number + + + + +

+
+
+
+ + +
+

The kernelSize of the blur filter. Must be odd number >= 3

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 5
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + radius + number + + + + +

+
+
+
+ + +
+

The maximum size of the blur radius, less than 0 equates to infinity

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • -1
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/RadialBlurFilterOptions.html b/docs/RadialBlurFilterOptions.html new file mode 100644 index 000000000..c6d3e70c6 --- /dev/null +++ b/docs/RadialBlurFilterOptions.html @@ -0,0 +1,2643 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Interface: RadialBlurFilterOptions +

+ + + +
+ +
+
+

+ RadialBlurFilterOptions + + +

+ + +

Options for the RadialBlurFilter constructor.

+ + +
+
+ +
+
+ + + +
+ + +
Properties:
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
angle + + number + + + + 0 + + + +

Sets the angle of the motion for blur effect

+ +
center + + PointData | number[] + + + + {x:0,y:0} + + + +

The x and y offset coordinates to change the position of the center of the circle of effect. +This should be a size 2 array or an object containing x and y values, you cannot change types +once defined in the constructor

+ +
kernelSize + + number + + + + 5 + + + +

The kernelSize of the blur filter. Must be odd number >= 3

+ +
radius + + number + + + + -1 + + + +

The maximum size of the blur radius, less than 0 equates to infinity

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + angle + number + + + + +

+
+
+
+ + +
+

Sets the angle of the motion for blur effect

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + center + PointData | number[] + + + + +

+
+
+
+ + +
+

The x and y offset coordinates to change the position of the center of the circle of effect. +This should be a size 2 array or an object containing x and y values, you cannot change types +once defined in the constructor

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • {x:0,y:0}
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + kernelSize + number + + + + +

+
+
+
+ + +
+

The kernelSize of the blur filter. Must be odd number >= 3

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 5
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + radius + number + + + + +

+
+
+
+ + +
+

The maximum size of the blur radius, less than 0 equates to infinity

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • -1
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/ReflectionFilter.html b/docs/ReflectionFilter.html new file mode 100644 index 000000000..672066833 --- /dev/null +++ b/docs/ReflectionFilter.html @@ -0,0 +1,3105 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Class: ReflectionFilter +

+ + + +
+ +
+
+

+ ReflectionFilter + + +

+ + + +

Applies a reflection effect to simulate the reflection on water with waves.
+originalfilter

+ +
+
+ +
+
+ + +
+
+

+ + + + new ReflectionFilter + + + (options) + + + + +

+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + ReflectionFilterOptions + + + + <optional>
+ + + + + +
+

Options for the ReflectionFilter constructor.

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + +

Extends

+ +
    + +
  • Filter
  • + +
+ + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + DEFAULT_OPTIONS + ReflectionFilterOptions + + staticreadonly + + +

+
+
+
+ +

Default values for options.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + alpha + Range + + + + +

+
+
+
+ + +
+

Starting and ending alpha values

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • [1,1]
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + alphaEnd + number + + + + +

+
+
+
+ + +
+

Starting wavelength of waves

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + alphaStart + number + + + + +

+
+
+
+ + +
+

Starting wavelength of waves

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + amplitude + Range + + + + +

+
+
+
+ + +
+

Starting and ending amplitude of waves

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • [0,20]
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + amplitudeEnd + number + + + + +

+
+
+
+ + +
+

Starting amplitude of waves

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 20
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + amplitudeStart + number + + + + +

+
+
+
+ + +
+

Starting amplitude of waves

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + boundary + number + + + + +

+
+
+
+ + +
+

Vertical position of the reflection point, default is 50% (middle) +smaller numbers produce a larger reflection, larger numbers produce a smaller reflection.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0.5
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + mirror + boolean + + + + +

+
+
+
+ + +
+

true to reflect the image, false for waves-only

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • true
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + time + number + + + + +

+
+
+
+ + +
+

Time for animating position of waves

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + waveLength + Range + + + + +

+
+
+
+ + +
+

Starting and ending length of waves

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • [30,100]
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + wavelengthEnd + number + + + + +

+
+
+
+ + +
+

Starting wavelength of waves

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 100
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + wavelengthStart + number + + + + +

+
+
+
+ + +
+

Starting wavelength of waves

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 30
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/ReflectionFilterOptions.html b/docs/ReflectionFilterOptions.html new file mode 100644 index 000000000..41784fce4 --- /dev/null +++ b/docs/ReflectionFilterOptions.html @@ -0,0 +1,2817 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Interface: ReflectionFilterOptions +

+ + + +
+ +
+
+

+ ReflectionFilterOptions + + +

+ + +

Options for the ReflectionFilter constructor.

+ + +
+
+ +
+
+ + + +
+ + +
Properties:
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
alpha + + Range + + + + [1,1] + + + +

Starting and ending alpha values

+ +
amplitude + + Range + + + + [0,20] + + + +

Starting and ending amplitude of waves

+ +
boundary + + number + + + + 0.5 + + + +

Vertical position of the reflection point, 0.5 equates to the middle +smaller numbers produce a larger reflection, larger numbers produce a smaller reflection

+ +
mirror + + boolean + + + + true + + + +

true to reflect the image, false for waves-only

+ +
time + + number + + + + 0 + + + +

Time for animating position of waves

+ +
waveLength + + Range + + + + [30,100] + + + +

Starting and ending length of waves

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + alpha + Range + + + + +

+
+
+
+ + +
+

Starting and ending alpha values

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • [1,1]
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + amplitude + Range + + + + +

+
+
+
+ + +
+

Starting and ending amplitude of waves

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • [0,20]
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + boundary + number + + + + +

+
+
+
+ + +
+

Vertical position of the reflection point, 0.5 equates to the middle +smaller numbers produce a larger reflection, larger numbers produce a smaller reflection

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0.5
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + mirror + boolean + + + + +

+
+
+
+ + +
+

true to reflect the image, false for waves-only

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • true
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + time + number + + + + +

+
+
+
+ + +
+

Time for animating position of waves

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + waveLength + Range + + + + +

+
+
+
+ + +
+

Starting and ending length of waves

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • [30,100]
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/ShockwaveFilter.html b/docs/ShockwaveFilter.html new file mode 100644 index 000000000..e1258596f --- /dev/null +++ b/docs/ShockwaveFilter.html @@ -0,0 +1,3161 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Class: ShockwaveFilter +

+ + + +
+ +
+
+

+ ShockwaveFilter + + +

+ + + +

Create a visual wrinkle effect by like a pond or blast wave.
+originalfilter

+

original filter

+ +
+
+ +
+
+ + +
+
+

+ + + + new ShockwaveFilter + + + (options) + + + + +

+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + ShockwaveFilterOptions + + + + <optional>
+ + + + + +
+

Options for the ShockwaveFilter constructor.

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + +

Extends

+ +
    + +
  • Filter
  • + +
+ + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + DEFAULT_OPTIONS + ShockwaveFilterOptions + + staticreadonly + + +

+
+
+
+ +

Default shockwave filter options

+ + + + +
+ + +
Properties:
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
amplitude + + number + + + + 30 + + +

The amplitude of the shockwave

+ + +
brightness + + number + + + + 1 + + +

The brightness of the shockwave

+ + +
center + + + + +

The x and y center coordinates to change the position of the center of the circle of effect.

+ + +
radius + + number + + + + -1 + + +

The maximum radius of shockwave. less than 0 means the max is an infinite distance

+ + +
speed + + number + + + + 500 + + +

The speed about the shockwave ripples out. The unit is pixel-per-second

+ + +
wavelength + + number + + + + 160 + + +

The wavelength of the shockwave

+ + +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + amplitude + number + + + + +

+
+
+
+ + +
+

The amplitude of the shockwave

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 30
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + brightness + number + + + + +

+
+
+
+ + +
+

The brightness of the shockwave

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + center + PointData + + + + +

+
+
+
+ + +
+

The x and y center coordinates to change the position of the center of the circle of effect.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • [0,0]
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + centerX + number + + + + +

+
+
+
+ + +
+

Sets the center of the effect in normalized screen coords on the x axis

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + centerY + number + + + + +

+
+
+
+ + +
+

Sets the center of the effect in normalized screen coords on the y axis

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + radius + number + + + + +

+
+
+
+ + +
+

The maximum radius of shockwave. less than 0 means the max is an infinite distance

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • -1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + speed + number + + + + +

+
+
+
+ + +
+

The speed about the shockwave ripples out. The unit is pixel-per-second

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 500
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + time + number + + + + +

+
+
+
+ +

Sets the elapsed time of the shockwave. It could control the current size of shockwave.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + wavelength + number + + + + +

+
+
+
+ + +
+

The wavelength of the shockwave

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 160
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/ShockwaveFilterOptions.html b/docs/ShockwaveFilterOptions.html new file mode 100644 index 000000000..abccd3cca --- /dev/null +++ b/docs/ShockwaveFilterOptions.html @@ -0,0 +1,2903 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Interface: ShockwaveFilterOptions +

+ + + +
+ +
+
+

+ ShockwaveFilterOptions + + +

+ + +

Options for the ShockwaveFilter constructor.

+ + +
+
+ +
+
+ + + +
+ + +
Properties:
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
amplitude + + number + + + + 30 + + + +

The amplitude of the shockwave

+ +
brightness + + number + + + + 1 + + + +

The brightness of the shockwave

+ +
center + + PointData + + + + {x:0,y:0} + + + +

The x and y center coordinates to change the position of the center of the circle of effect.

+ +
radius + + number + + + + -1 + + + +

The maximum radius of shockwave. less than 0 means the max is an infinite distance

+ +
speed + + number + + + + 500 + + + +

The speed about the shockwave ripples out. The unit is pixel-per-second

+ +
time + + number + + + + 0 + + + +

Sets the elapsed time of the shockwave.

+ +
wavelength + + number + + + + 160 + + + +

The wavelength of the shockwave

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + amplitude + number + + + + +

+
+
+
+ + +
+

The amplitude of the shockwave

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 30
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + brightness + number + + + + +

+
+
+
+ + +
+

The brightness of the shockwave

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + center + PointData + + + + +

+
+
+
+ + +
+

The x and y center coordinates to change the position of the center of the circle of effect.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • {x:0,y:0}
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + radius + number + + + + +

+
+
+
+ + +
+

The maximum radius of shockwave. less than 0 means the max is an infinite distance

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • -1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + speed + number + + + + +

+
+
+
+ + +
+

The speed about the shockwave ripples out. The unit is pixel-per-second

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 500
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + time + number + + + + +

+
+
+
+ + +
+

Sets the elapsed time of the shockwave.

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + wavelength + number + + + + +

+
+
+
+ + +
+

The wavelength of the shockwave

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 160
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/SimpleLightmapFilter.html b/docs/SimpleLightmapFilter.html new file mode 100644 index 000000000..2bf17d397 --- /dev/null +++ b/docs/SimpleLightmapFilter.html @@ -0,0 +1,2614 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Class: SimpleLightmapFilter +

+ + + +
+ +
+
+

+ SimpleLightmapFilter + + +

+ + + +

SimpleLightmap, originally by Oza94 +http://www.html5gamedevs.com/topic/20027-pixijs-simple-lightmapping/ +http://codepen.io/Oza94/pen/EPoRxj

+

You have to specify filterArea, or suffer consequences. +You may have to use it with filter.dontFit = true, +until we rewrite this using same approach as for DisplacementFilter.

+

originalfilter

+ +
+
+ +
+
+ + +
+
+

+ + + + new SimpleLightmapFilter + + + (options) + + + + +

+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
options + + SimpleLightmapFilterOptions + + +

Options for the SimpleLightmapFilter constructor.

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + +
See:
+
+ +
+ + + +
+ + + +

Example

+ +
displayObject.filters = [new SimpleLightmapFilter(texture, 0x666666)];
+ + +
+ + +

Extends

+ +
    + +
  • Filter
  • + +
+ + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + DEFAULT_OPTIONS + SimpleLightmapFilterOptions + + staticreadonly + + +

+
+
+
+ +

Default values for options.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + alpha + number + + + + +

+
+
+
+ + +
+

Coefficient for alpha multiplication

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + color + ColorSource + + + + +

+
+
+
+ + +
+

The color value of the ambient color

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0x000000
+ + + + + + + +
+ + + +
Example
+ +
[1.0, 1.0, 1.0] = 0xffffff
+ + +
+ + + +
+
+

+ + lightMap + Texture + + + + +

+
+
+
+ +

A sprite where your lightmap is rendered

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/SimpleLightmapFilterOptions.html b/docs/SimpleLightmapFilterOptions.html new file mode 100644 index 000000000..b60fc2908 --- /dev/null +++ b/docs/SimpleLightmapFilterOptions.html @@ -0,0 +1,2549 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Interface: SimpleLightmapFilterOptions +

+ + + +
+ +
+
+

+ SimpleLightmapFilterOptions + + +

+ + +

Options for the SimpleLightmapFilter constructor.

+ + +
+
+ +
+
+ + + +
+ + +
Properties:
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
alpha + + number + + + + 1 + + + +

Coefficient for alpha multiplication

+ +
color + + ColorSource + + + + 0x000000 + + + +

The color value of the ambient color

+ +
lightMap + + Texture + + + + +

A texture where your lightmap is rendered

+ + +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + alpha + number + + + + +

+
+
+
+ + +
+

Coefficient for alpha multiplication

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + color + ColorSource + + + + +

+
+
+
+ + +
+

The color value of the ambient color

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0x000000
+ + + + + + + +
+ + + +
Example
+ +
[1.0, 1.0, 1.0] = 0xffffff
+ + +
+ + + +
+
+

+ + lightMap + Texture + + + + +

+
+
+
+ +

A texture where your lightmap is rendered

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/TiltShiftAxisFilterOptions.html b/docs/TiltShiftAxisFilterOptions.html new file mode 100644 index 000000000..a42e4440e --- /dev/null +++ b/docs/TiltShiftAxisFilterOptions.html @@ -0,0 +1,2670 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Interface: TiltShiftAxisFilterOptions +

+ + + +
+ +
+
+

+ TiltShiftAxisFilterOptions + + +

+ + +

Options for creating filter.

+ + +
+
+ +
+
+ + + +
+ + +
Properties:
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
axis + + "vertical" | "horizontal" + + +

The axis that the filter is calculating for.

+ + +
blur + + number + + +

The strength of the blur.

+ + +
end + + PointData + + +

The position to end the effect at.

+ + +
gradientBlur + + number + + +

The strength of the blur gradient

+ + +
start + + PointData + + +

The position to start the effect at.

+ + +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + axis + "vertical" | "horizontal" + + + + +

+
+
+
+ +

The axis that the filter is calculating for.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + blur + number + + + + +

+
+
+
+ +

The strength of the blur.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + end + PointData + + + + +

+
+
+
+ +

The position to end the effect at.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + gradientBlur + number + + + + +

+
+
+
+ +

The strength of the blur gradient

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + start + PointData + + + + +

+
+
+
+ +

The position to start the effect at.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/TiltShiftFilter.html b/docs/TiltShiftFilter.html new file mode 100644 index 000000000..f7a002228 --- /dev/null +++ b/docs/TiltShiftFilter.html @@ -0,0 +1,2797 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Class: TiltShiftFilter +

+ + + +
+ +
+
+

+ TiltShiftFilter + + +

+ + + +

A TiltShift Filter. Manages the pass of both a TiltShiftXFilter and TiltShiftYFilter.
+originalfilter

+

author Vico @vicocotea +original filter +by Evan Wallace

+ +
+
+ +
+
+ + +
+
+

+ + + + new TiltShiftFilter + + + (options) + + + + +

+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + TiltShiftFilterOptions + + + + <optional>
+ + + + + +
+

Options for the TiltShiftFilter constructor.

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + +

Extends

+ +
    + +
  • Filter
  • + +
+ + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + blur + number + + + + +

+
+
+
+ +

The strength of the blur.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + end + PointData + + + + +

+
+
+
+ +

The position to end the effect at.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + endX + number + + + + +

+
+
+
+ +

The position to end the effect at on the x axis.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + endY + number + + + + +

+
+
+
+ +

The position to end the effect at on the y axis.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + gradientBlur + number + + + + +

+
+
+
+ +

The strength of the gradient blur.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + start + PointData + + + + +

+
+
+
+ +

The position to start the effect at.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + startX + number + + + + +

+
+
+
+ +

The position to start the effect at on the x axis.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + startY + number + + + + +

+
+
+
+ +

The position to start the effect at on the x axis.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/TiltShiftFilterOptions.html b/docs/TiltShiftFilterOptions.html new file mode 100644 index 000000000..e76464381 --- /dev/null +++ b/docs/TiltShiftFilterOptions.html @@ -0,0 +1,2593 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Interface: TiltShiftFilterOptions +

+ + + +
+ +
+
+

+ TiltShiftFilterOptions + + +

+ + +

Options for the TiltShiftFilter constructor.

+ + +
+
+ +
+
+ + + +
+ + +
Properties:
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
blur + + number + + +

The strength of the blur.

+ + +
end + + PointData + + +

The position to end the effect at.

+ + +
gradientBlur + + number + + +

The strength of the blur gradient

+ + +
start + + PointData + + +

The position to start the effect at.

+ + +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + blur + number + + + + +

+
+
+
+ +

The strength of the blur.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + end + PointData + + + + +

+
+
+
+ +

The position to end the effect at.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + gradientBlur + number + + + + +

+
+
+
+ +

The strength of the blur gradient

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + start + PointData + + + + +

+
+
+
+ +

The position to start the effect at.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/TwistFilter.html b/docs/TwistFilter.html new file mode 100644 index 000000000..091493d83 --- /dev/null +++ b/docs/TwistFilter.html @@ -0,0 +1,2719 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Class: TwistFilter +

+ + + +
+ +
+
+

+ TwistFilter + + +

+ + + +

This filter applies a twist effect making display objects appear twisted in the given direction.
+originalfilter

+ +
+
+ +
+
+ + +
+
+

+ + + + new TwistFilter + + + (options) + + + + +

+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + Partial<TwistFilterOptions> + + + + <optional>
+ + + + + +
+

Options for the TwistFilter constructor.

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + +

Extends

+ +
    + +
  • Filter
  • + +
+ + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + DEFAULT_OPTIONS + TwistFilterOptions + + staticreadonly + + +

+
+
+
+ +

Default values for options.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + angle + number + + + + +

+
+
+
+ + +
+

The angle of the twist

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 4
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + offset + PointData + + + + +

+
+
+
+ + +
+

The x offset coordinate to change the position of the center of the circle of effect

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + offsetX + number + + + + +

+
+
+
+ + +
+

The x offset coordinate to change the position of the center of the circle of effect

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + offsetY + number + + + + +

+
+
+
+ + +
+

The y offset coordinate to change the position of the center of the circle of effect

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + radius + number + + + + +

+
+
+
+ + +
+

The radius of the twist

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 200
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/TwistFilterOptions.html b/docs/TwistFilterOptions.html new file mode 100644 index 000000000..3bb8e106f --- /dev/null +++ b/docs/TwistFilterOptions.html @@ -0,0 +1,2643 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Interface: TwistFilterOptions +

+ + + +
+ +
+
+

+ TwistFilterOptions + + +

+ + +

Options for the TwistFilter constructor.

+ + +
+
+ +
+
+ + + +
+ + +
Properties:
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
angle + + number + + + + 4 + + + +

The angle of the twist

+ +
offset + + PointData + + + + {x:0,y:0} + + + +

The x and y offset coordinates to change the position of the center of the circle of effect. +This should be a size 2 array or an object containing x and y values, you cannot change types +once defined in the constructor

+ +
padding + + number + + + + 20 + + + +

Padding for the filter area

+ +
radius + + number + + + + 200 + + + +

The radius of the twist

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + angle + number + + + + +

+
+
+
+ + +
+

The angle of the twist

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 4
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + offset + PointData + + + + +

+
+
+
+ + +
+

The x and y offset coordinates to change the position of the center of the circle of effect. +This should be a size 2 array or an object containing x and y values, you cannot change types +once defined in the constructor

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • {x:0,y:0}
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + padding + number + + + + +

+
+
+
+ + +
+

Padding for the filter area

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 20
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + radius + number + + + + +

+
+
+
+ + +
+

The radius of the twist

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 200
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/ZoomBlurFilter.html b/docs/ZoomBlurFilter.html new file mode 100644 index 000000000..12bdc8ec9 --- /dev/null +++ b/docs/ZoomBlurFilter.html @@ -0,0 +1,2774 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Class: ZoomBlurFilter +

+ + + +
+ +
+
+

+ ZoomBlurFilter + + +

+ + + +

The ZoomFilter applies a Zoom blur to an object.
+originalfilter

+ +
+
+ +
+
+ + +
+
+

+ + + + new ZoomBlurFilter + + + (options) + + + + +

+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + ZoomBlurFilterOptions + + + + <optional>
+ + + + + +
+

Options for the ZoomBlurFilter constructor.

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + +

Extends

+ +
    + +
  • Filter
  • + +
+ + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + DEFAULT_OPTIONS + ZoomBlurFilterOptions + + staticreadonly + + +

+
+
+
+ +

Default values for options.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

+ + center + PointData + + + + +

+
+
+
+ + +
+

The center of the zoom

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • [0,0]
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + centerX + number + + + + +

+
+
+
+ + +
+

Sets the center of the effect in normalized screen coords on the x axis

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + centerY + number + + + + +

+
+
+
+ + +
+

Sets the center of the effect in normalized screen coords on the y axis

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + innerRadius + number + + + + +

+
+
+
+ + +
+

The inner radius of zoom. The part in inner circle won't apply zoom blur effect

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + radius + number + + + + +

+
+
+
+ + +
+

Outer radius of the effect. less than 0 equates to infinity

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • -1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + strength + number + + + + +

+
+
+
+ + +
+

Sets the strength of the zoom blur effect

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0.1
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/ZoomBlurFilterOptions.html b/docs/ZoomBlurFilterOptions.html new file mode 100644 index 000000000..c6641e367 --- /dev/null +++ b/docs/ZoomBlurFilterOptions.html @@ -0,0 +1,2733 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Interface: ZoomBlurFilterOptions +

+ + + +
+ +
+
+

+ ZoomBlurFilterOptions + + +

+ + +

Options for the ZoomBlurFilter constructor.

+ + +
+
+ +
+
+ + + +
+ + +
Properties:
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
center + + PointData | number[] + + + + {x:0,y:0} + + + +

The x and y offset coordinates to change the position of the center of the circle of effect. +This should be a size 2 array or an object containing x and y values, you cannot change types +once defined in the constructor

+ +
innerRadius + + number + + + + 0 + + + +

The inner radius of zoom. The part in inner circle won't apply zoom blur effect

+ +
maxKernelSize + + number + + + + 32 + + + +

On older iOS devices, it's better to not go above 13.0. +Decreasing this value will produce a lower-quality blur effect with more dithering

+ +
radius + + number + + + + -1 + + + +

Outer radius of the effect. less than 0 equates to infinity

+ +
strength + + number + + + + 0.1 + + + +

Sets the strength of the zoom blur effect

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + +

Members

+ + + +
+
+

+ + center + PointData | number[] + + + + +

+
+
+
+ + +
+

The x and y offset coordinates to change the position of the center of the circle of effect. +This should be a size 2 array or an object containing x and y values, you cannot change types +once defined in the constructor

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • {x:0,y:0}
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + innerRadius + number + + + + +

+
+
+
+ + +
+

The inner radius of zoom. The part in inner circle won't apply zoom blur effect

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + maxKernelSize + number + + + + +

+
+
+
+ + +
+

On older iOS devices, it's better to not go above 13.0. +Decreasing this value will produce a lower-quality blur effect with more dithering

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 32
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + radius + number + + + + +

+
+
+
+ + +
+

Outer radius of the effect. less than 0 equates to infinity

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • -1
+ + + + + + + +
+ + + +
+ + + +
+
+

+ + strength + number + + + + +

+
+
+
+ + +
+

Sets the strength of the zoom blur effect

+
+ + + +
+ + + + + + + + + + + + + + + +
Default Value:
+
  • 0.1
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/fonts/OpenSans-Bold.svg b/docs/fonts/OpenSans-Bold.svg new file mode 100644 index 000000000..464e98400 --- /dev/null +++ b/docs/fonts/OpenSans-Bold.svg @@ -0,0 +1,958 @@ + + + + +This is a custom SVG webfont generated by Font Squirrel. +Copyright : Digitized data copyright 20102011 Google Corporation +Foundry : Ascender Corporation +Foundry URL : httpwwwascendercorpcom + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/fonts/OpenSans-Bold.ttf b/docs/fonts/OpenSans-Bold.ttf new file mode 100644 index 000000000..cf53e6e46 Binary files /dev/null and b/docs/fonts/OpenSans-Bold.ttf differ diff --git a/docs/fonts/OpenSans-Bold.woff b/docs/fonts/OpenSans-Bold.woff new file mode 100644 index 000000000..c668e4537 Binary files /dev/null and b/docs/fonts/OpenSans-Bold.woff differ diff --git a/docs/fonts/OpenSans-Bold.woff2 b/docs/fonts/OpenSans-Bold.woff2 new file mode 100644 index 000000000..c80b2d2af Binary files /dev/null and b/docs/fonts/OpenSans-Bold.woff2 differ diff --git a/docs/fonts/OpenSans-BoldItalic.svg b/docs/fonts/OpenSans-BoldItalic.svg new file mode 100644 index 000000000..cc7332505 --- /dev/null +++ b/docs/fonts/OpenSans-BoldItalic.svg @@ -0,0 +1,958 @@ + + + + +This is a custom SVG webfont generated by Font Squirrel. +Copyright : Digitized data copyright 20102011 Google Corporation +Foundry : Ascender Corporation +Foundry URL : httpwwwascendercorpcom + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/fonts/OpenSans-BoldItalic.ttf b/docs/fonts/OpenSans-BoldItalic.ttf new file mode 100644 index 000000000..11d107ba5 Binary files /dev/null and b/docs/fonts/OpenSans-BoldItalic.ttf differ diff --git a/docs/fonts/OpenSans-BoldItalic.woff b/docs/fonts/OpenSans-BoldItalic.woff new file mode 100644 index 000000000..ced8f6971 Binary files /dev/null and b/docs/fonts/OpenSans-BoldItalic.woff differ diff --git a/docs/fonts/OpenSans-BoldItalic.woff2 b/docs/fonts/OpenSans-BoldItalic.woff2 new file mode 100644 index 000000000..60d8de4f6 Binary files /dev/null and b/docs/fonts/OpenSans-BoldItalic.woff2 differ diff --git a/docs/fonts/OpenSans-Italic.svg b/docs/fonts/OpenSans-Italic.svg new file mode 100644 index 000000000..f773016b7 --- /dev/null +++ b/docs/fonts/OpenSans-Italic.svg @@ -0,0 +1,958 @@ + + + + +This is a custom SVG webfont generated by Font Squirrel. +Copyright : Digitized data copyright 20102011 Google Corporation +Foundry : Ascender Corporation +Foundry URL : httpwwwascendercorpcom + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/fonts/OpenSans-Italic.ttf b/docs/fonts/OpenSans-Italic.ttf new file mode 100644 index 000000000..a30932742 Binary files /dev/null and b/docs/fonts/OpenSans-Italic.ttf differ diff --git a/docs/fonts/OpenSans-Italic.woff b/docs/fonts/OpenSans-Italic.woff new file mode 100644 index 000000000..1ed8ab956 Binary files /dev/null and b/docs/fonts/OpenSans-Italic.woff differ diff --git a/docs/fonts/OpenSans-Italic.woff2 b/docs/fonts/OpenSans-Italic.woff2 new file mode 100644 index 000000000..440b74c39 Binary files /dev/null and b/docs/fonts/OpenSans-Italic.woff2 differ diff --git a/docs/fonts/OpenSans-Light.svg b/docs/fonts/OpenSans-Light.svg new file mode 100644 index 000000000..e481f2c56 --- /dev/null +++ b/docs/fonts/OpenSans-Light.svg @@ -0,0 +1,958 @@ + + + + +This is a custom SVG webfont generated by Font Squirrel. +Copyright : Digitized data copyright 20102011 Google Corporation +Foundry : Ascender Corporation +Foundry URL : httpwwwascendercorpcom + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/fonts/OpenSans-Light.ttf b/docs/fonts/OpenSans-Light.ttf new file mode 100644 index 000000000..dddcc62a9 Binary files /dev/null and b/docs/fonts/OpenSans-Light.ttf differ diff --git a/docs/fonts/OpenSans-Light.woff b/docs/fonts/OpenSans-Light.woff new file mode 100644 index 000000000..937323df0 Binary files /dev/null and b/docs/fonts/OpenSans-Light.woff differ diff --git a/docs/fonts/OpenSans-Light.woff2 b/docs/fonts/OpenSans-Light.woff2 new file mode 100644 index 000000000..d0b43e0ad Binary files /dev/null and b/docs/fonts/OpenSans-Light.woff2 differ diff --git a/docs/fonts/OpenSans-LightItalic.svg b/docs/fonts/OpenSans-LightItalic.svg new file mode 100644 index 000000000..162f95c7a --- /dev/null +++ b/docs/fonts/OpenSans-LightItalic.svg @@ -0,0 +1,958 @@ + + + + +This is a custom SVG webfont generated by Font Squirrel. +Copyright : Digitized data copyright 20102011 Google Corporation +Foundry : Ascender Corporation +Foundry URL : httpwwwascendercorpcom + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/fonts/OpenSans-LightItalic.ttf b/docs/fonts/OpenSans-LightItalic.ttf new file mode 100644 index 000000000..9338bd99e Binary files /dev/null and b/docs/fonts/OpenSans-LightItalic.ttf differ diff --git a/docs/fonts/OpenSans-LightItalic.woff b/docs/fonts/OpenSans-LightItalic.woff new file mode 100644 index 000000000..bc83d1db5 Binary files /dev/null and b/docs/fonts/OpenSans-LightItalic.woff differ diff --git a/docs/fonts/OpenSans-LightItalic.woff2 b/docs/fonts/OpenSans-LightItalic.woff2 new file mode 100644 index 000000000..21a92a7e8 Binary files /dev/null and b/docs/fonts/OpenSans-LightItalic.woff2 differ diff --git a/docs/fonts/OpenSans-Regular.svg b/docs/fonts/OpenSans-Regular.svg new file mode 100644 index 000000000..067c09c1d --- /dev/null +++ b/docs/fonts/OpenSans-Regular.svg @@ -0,0 +1,958 @@ + + + + +This is a custom SVG webfont generated by Font Squirrel. +Copyright : Digitized data copyright 20102011 Google Corporation +Foundry : Ascender Corporation +Foundry URL : httpwwwascendercorpcom + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/fonts/OpenSans-Regular.ttf b/docs/fonts/OpenSans-Regular.ttf new file mode 100644 index 000000000..a135120e0 Binary files /dev/null and b/docs/fonts/OpenSans-Regular.ttf differ diff --git a/docs/fonts/OpenSans-Regular.woff b/docs/fonts/OpenSans-Regular.woff new file mode 100644 index 000000000..bd0f824b2 Binary files /dev/null and b/docs/fonts/OpenSans-Regular.woff differ diff --git a/docs/fonts/OpenSans-Regular.woff2 b/docs/fonts/OpenSans-Regular.woff2 new file mode 100644 index 000000000..f778f9c84 Binary files /dev/null and b/docs/fonts/OpenSans-Regular.woff2 differ diff --git a/docs/fonts/glyphicons-halflings-regular.eot b/docs/fonts/glyphicons-halflings-regular.eot new file mode 100644 index 000000000..b93a4953f Binary files /dev/null and b/docs/fonts/glyphicons-halflings-regular.eot differ diff --git a/docs/fonts/glyphicons-halflings-regular.svg b/docs/fonts/glyphicons-halflings-regular.svg new file mode 100644 index 000000000..94fb5490a --- /dev/null +++ b/docs/fonts/glyphicons-halflings-regular.svg @@ -0,0 +1,288 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/fonts/glyphicons-halflings-regular.ttf b/docs/fonts/glyphicons-halflings-regular.ttf new file mode 100644 index 000000000..1413fc609 Binary files /dev/null and b/docs/fonts/glyphicons-halflings-regular.ttf differ diff --git a/docs/fonts/glyphicons-halflings-regular.woff b/docs/fonts/glyphicons-halflings-regular.woff new file mode 100644 index 000000000..9e612858f Binary files /dev/null and b/docs/fonts/glyphicons-halflings-regular.woff differ diff --git a/docs/fonts/glyphicons-halflings-regular.woff2 b/docs/fonts/glyphicons-halflings-regular.woff2 new file mode 100644 index 000000000..64539b54c Binary files /dev/null and b/docs/fonts/glyphicons-halflings-regular.woff2 differ diff --git a/docs/icons/chevron-down.svg b/docs/icons/chevron-down.svg new file mode 100644 index 000000000..0ba78a537 --- /dev/null +++ b/docs/icons/chevron-down.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 000000000..635392e28 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,2444 @@ + + + + + + PixiJS Filters API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+

+ Home +

+ + + + + + + +
+

PixiJS Filters

+

Node.js CI npm version

+

Compatibility

+

Depending on your version of PixiJS, you'll need to figure out which major version of PixiJS Filters to use.

+ + + + + + + + + + + + + + + + + + + + + +
PixiJSPixiJS Filters
v5.xv4.x
v6.x - v7.xv5.x
v8.xv6.x
+

Installation

+

Installation is available using NPM:

+
npm install pixi-filters
+
+

Alternatively, you can use a CDN such as JSDelivr:

+
<script src="https://cdn.jsdelivr.net/npm/pixi-filters@latest/dist/browser/pixi-filters.min.js"></script>
+
+

If all else failes, you can manually download the bundled file from the releases section and include it in your project.

+

Demo

+

View the PixiJS Filters Demo to interactively play with filters to see how they work.

+

Filters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FilterPreview
AdjustmentFilter
pixi-filters/adjustment
View demo
adjustment
AdvancedBloomFilter
pixi-filters/advanced-bloom
View demo
advanced-bloom
AsciiFilter
pixi-filters/ascii
View demo
ascii
BackdropBlurFilter
pixi-filters/backdrop-blur
View demo
backdrop-blur
BevelFilter
pixi-filters/bevel
View demo
bevel
BloomFilter
pixi-filters/bloom
View demo
bloom
BulgePinchFilter
pixi-filters/bulge-pinch
View demo
bulge-pinch
ColorGradientFilter
pixi-filters/color-gradient
View demo
color-gradient
ColorMapFilter
pixi-filters/color-map
View demo
color-map
ColorOverlayFilter
pixi-filters/color-overlay
View demo
color-overlay
ColorReplaceFilter
pixi-filters/color-replace
View demo
color-replace
ConvolutionFilter
pixi-filters/convolution
View demo
convolution
CrossHatchFilter
pixi-filters/cross-hatch
View demo
cross-hatch
CRTFilter
pixi-filters/crt
View demo
crt
DotFilter
pixi-filters/dot
View demo
dot
DropShadowFilter
pixi-filters/drop-shadow
View demo
drop-shadow
EmbossFilter
pixi-filters/emboss
View demo
emboss
GlitchFilter
pixi-filters/glitch
View demo
glitch
GlowFilter
pixi-filters/glow
View demo
glow
GodrayFilter
pixi-filters/godray
View demo
godray
GrayscaleFilter
pixi-filters/grayscale
View demo
grayscale
HslAdjustmentFilter
pixi-filters/hsl-adjustment
View demo
hsl-adjustment
KawaseBlurFilter
pixi-filters/kawase-blur
View demo
kawase-blur
MotionBlurFilter
pixi-filters/motion-blur
View demo
motion-blur
MultiColorReplaceFilter
pixi-filters/multi-color-replace
View demo
multi-color-replace
OldFilmFilter
pixi-filters/old-film
View demo
old-film
OutlineFilter
pixi-filters/outline
View demo
outline
PixelateFilter
pixi-filters/pixelate
View demo
pixelate
RadialBlurFilter
pixi-filters/radial-blur
View demo
radial-blur
ReflectionFilter
pixi-filters/reflection
View demo
reflection
RGBSplitFilter
pixi-filters/rgb-split
View demo
rgb split
ShockwaveFilter
pixi-filters/shockwave
View demo
shockwave
SimpleLightmapFilter
pixi-filters/simple-lightmap
View demo
simple-lightmap
TiltShiftFilter
pixi-filters/tilt-shift
View demo
tilt-shift
TwistFilter
pixi-filters/twist
View demo
twist
ZoomBlurFilter
pixi-filters/zoom-blur
View demo
zoom-blur
+

Built-In Filters

+

PixiJS has a handful of core filters that are built-in to the PixiJS library.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FilterPreview
AlphaFilter
View demo
alpha
BlurFilter
View demo
blur
ColorMatrixFilter (contrast)
View demo
color-matrix-contrast
ColorMatrixFilter (desaturate)
View demo
color-matrix-desaturate
ColorMatrixFilter (kodachrome)
View demo
color-matrix-kodachrome
ColorMatrixFilter (lsd)
View demo
color-matrix-lsd
ColorMatrixFilter (negative)
View demo
color-matrix-negative
ColorMatrixFilter (polaroid)
View demo
color-matrix-polaroid
ColorMatrixFilter (predator)
View demo
color-matrix-predator
ColorMatrixFilter (saturate)
View demo
color-matrix-saturate
ColorMatrixFilter (sepia)
View demo
color-matrix-sepia
DisplacementFilter
View demo
displacement
NoiseFilter
View demo
noise
+

Building

+

PixiJS Filters uses Lerna under-the-hood to build all of the filters separately. Install all dependencies by simply running the following.

+
npm install
+
+

Build all filters, demo and screenshots by running the following:

+
npm run build
+
+

Watch all filters and demo (auto-rebuild upon src changes):

+
npm run watch
+
+

Documentation

+

API documention can be found here.

+ +
+
+ + + + + + + + + +
+ +
+
+
+ + + + + + + + diff --git a/docs/main.css b/docs/main.css new file mode 100644 index 000000000..532b7ddf3 --- /dev/null +++ b/docs/main.css @@ -0,0 +1 @@ +body,html{font-family:"Libre Franklin",sans-serif;background-color:#ecedf1;color:#333}ol,ul{margin:0;padding:0}li{list-style-type:none}#wrap{position:relative}.list::-webkit-scrollbar{width:8px;background-color:rgba(0,0,0,0)}.list::-webkit-scrollbar-thumb{background-color:#647086;border-radius:4px}.content-size{max-width:1000px;min-width:300px;margin-left:auto;margin-right:auto}.status-deprecated{text-decoration:line-through;opacity:.4}.status-deprecated a,.status-deprecated:hover{text-decoration:none}.hljs{background-color:#f5f5f5}pre{border-radius:0px !important}.pln{color:#4d4d4c}@media screen{.str{color:#718c00}.kwd{color:#8959a8}.com{color:#8e908c}.typ{color:#4271ae}.lit{color:#f5871f}.pun{color:#4d4d4c}.opn{color:#4d4d4c}.clo{color:#4d4d4c}.tag{color:#c82829}.atn{color:#f5871f}.atv{color:#3e999f}.dec{color:#f5871f}.var{color:#c82829}.fun{color:#4271ae}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}ol.linenums{margin-top:0;margin-bottom:0}.navigation{position:fixed;overflow:hidden;min-width:250px;width:25%;top:0;left:0;bottom:0;background-color:#272d37}.navigation .menu-toggle{display:none}.navigation .applicationName{margin:0;padding:20px;font-weight:700;white-space:nowrap;color:#fff}.navigation .applicationName a{color:#fff}.navigation .search{padding:0 20px}.navigation .search input{background-color:#14171d;color:#fff;border-color:#3d495a}.navigation .list{padding:20px;position:absolute;overflow:auto;-webkit-overflow-scrolling:touch;width:100%;top:100px;bottom:0}.navigation .list li.item{margin-bottom:8px;padding-bottom:8px;border-bottom:1px solid #3d495a;overflow:hidden}.navigation .list li.item a{color:#647086}.navigation .list li.item a.highlight span{color:#333;background-color:#ff0;border-radius:.4rem;padding:.15rem}.navigation .list li.item a:hover{color:#fff}.navigation .list li.item .title{display:block}.navigation .list li.item .title a{display:block;color:#cfd4db}.navigation .list li.item .title a:hover{color:#fff}.navigation .list li.item .title.namespace .namespaceTag{display:inline-block;border-radius:3px;background-color:#c2185b;color:#fff;font-size:70%;padding:2px 6px;float:left;margin-right:10px;pointer-events:none}.navigation .list li.item .title.namespace a{color:#fff}.navigation .list li.item .itemMembers .subtitle{margin:10px 0;font-weight:700;color:#c2185b;display:block;letter-spacing:.05em}.navigation .list li.item .itemMembers li.parent a{color:#a9b3c3}.navigation .list li.item ul>li{padding-left:10px;font-size:.9em}.navigation .children li.item{border-bottom:none;padding-bottom:0}.navigation .children li.notCurrent{font-weight:400}.navigation .children li.current{font-weight:700}.navigation .item,.navigation .itemMembers,.navigation .itemMembers li{display:none}.navigation.not-searching .item{display:block}.navigation.not-searching .item.current{display:block}.navigation.not-searching .item.current .itemMembers,.navigation.not-searching .item.current .itemMembers li{display:block}.navigation.searching .item.match{display:block}.navigation.searching .item.match .itemMembers.match,.navigation.searching .item.match .itemMembers li.match{display:block}@media screen and (max-width: 768px){.navigation{left:0;position:relative;width:100%;overflow:auto}.navigation .list,.navigation .search{display:none}.navigation .list.show,.navigation .search.show{display:block;position:static}.navigation .menu-toggle{display:block;position:absolute;top:10px;right:10px}}.main{left:25%;position:fixed;height:100%;right:0;overflow:auto;-webkit-overflow-scrolling:touch;word-break:break-word}.main .summary-list dt{width:100%;margin-bottom:4px;float:left;font-size:110%}.main img{max-width:100%}.main article{padding:20px;padding-top:10px}.main article ol,.main article ul{margin-left:25px}.main article ol>li{list-style-type:decimal;margin-bottom:5px}.main article ul>li{margin-bottom:5px;list-style-type:disc}.main header h3,.main header h4{font-weight:700}.main header .header{padding:20px;padding-bottom:0}.main header .header h2{font-weight:700;border-bottom:1px solid #c8c9cc;padding-bottom:10px;text-transform:capitalize}.main header .class-description{padding-top:10px}.main header ol,.main header ul{counter-reset:list-counter;display:block;margin-block-start:1em;margin-block-end:1em;margin-inline-start:0px;margin-inline-end:0px;padding-inline-start:40px;margin:0}.main header ol>li,.main header ul>li{position:relative;margin:0}.main header ol>li::before,.main header ul>li::before{position:absolute;color:#fff;background-color:#e91e63;width:18px;height:18px;border-radius:5px;top:2px;left:-25px;text-align:center;font-size:small}.main header ol li ul li::before,.main header ul li ul li::before{top:10px;width:5px;height:5px;border-radius:0%}.main header ol li ol li::before,.main header ul li ol li::before{content:counter(list-counter) ")";color:#e91e63;background-color:unset}.main header ol>li::before{content:counter(list-counter);counter-increment:list-counter}.main header ul>li::before{content:"";width:8px;height:8px;border-radius:100%;top:8px;left:-17px}.main header details{background-color:#fdfdfd;box-shadow:0 2px 4px rgba(0,0,0,.1);border-radius:5px;margin:15px 0;padding:20px 25px}.main header details>summary{font-size:19px;font-weight:700;color:#e91e63;cursor:pointer;user-select:none}.main header details>summary+*{margin-top:25px}.main header details>summary::before{content:"▶";display:inline-block;padding-right:10px}.main header details[open]>summary::before{content:"▼"}.main header aside{background:#c0c0d1;font-size:smaller;padding:7px 10px;border-radius:5px;margin:15px 0;color:#fff;border-left:10px solid #f3e1e7}.main header aside code{color:#d2a4b0;padding:1px 2px;font-size:smaller}.main .page-title{display:none}.main .access-signature{font-weight:400;display:inline-block;border-radius:3px;background-color:#79859a;color:#fff;font-size:.7em;padding:2px 6px;margin-left:6px}.main .access-signature.deprecated{display:block;background-color:#ee99b6;font-weight:700;margin-left:0;margin-top:5px;padding:6px}.main .access-signature.deprecated .deprecated-info{font-weight:400;margin-left:5px}.main .access-signature a{color:#fff}.main h4.name .type-signature{font-weight:400;font-size:.8em;color:#79859a}.main h4.name .type-signature:before{content:" : ";opacity:.6}.main h4.name .return-symbol{margin:0 6px;color:#79859a;font-size:80%}.main h4.name .share-icon{font-size:70%;color:#79859a}.main .subsection-title{color:#e91e63}.main .description{margin-top:10px}.main .description ol,.main .description ul{margin-bottom:15px}.main .description h2{font-weight:700;margin-top:30px;margin-bottom:10px;padding-bottom:10px;border-bottom:1px solid #efefef}.main .description pre{margin:10px 0}.main .tag-source{font-size:85%}.main dt.tag-source{margin-top:5px}.main dt.tag-default{color:#79859a}.main .nameContainer{position:relative}.main .nameContainer .tag-source{position:absolute;top:0;right:0;padding:2px 6px;border-bottom-left-radius:4px;border-bottom-right-radius:4px;background-color:#b3b7c3}.main .nameContainer .tag-source a{color:#fff;font-weight:400}.main .nameContainer h4{font-weight:700;padding:20px 0 0;border-top:1px solid #c8c9cc}.main .nameContainer h4 .signature{font-weight:400;font-size:.8em;padding-left:.4em}.main table{width:100%;margin-bottom:15px;margin-top:5px}.main table th{padding:3px 3px;color:#fff;font-weight:400;background:#79859a}.main table td{vertical-align:top;padding:5px 3px;word-break:normal}.main table tbody tr:nth-child(odd){background-color:#fff}.main table tbody tr:nth-child(even){background-color:#f5f5fb}.main table .type{color:#79859a}.main table .attributes{color:#79859a}.main table .description p{margin:0}.main table .optional{float:left;border-radius:3px;background-color:#b3b7c3;padding:2px 4px;margin-right:5px;color:#fff;font-size:80%}.main .readme p{margin-top:15px}.main .readme h1{font-weight:700}.main .readme h2{font-weight:700;margin-top:30px;margin-bottom:10px;padding-bottom:10px;border-bottom:1px solid #79859a}.main .readme h3{color:#e91e63}.main .readme li{margin-bottom:10px}@media screen and (min-width: 768px){.main .summary-list dt{width:50%}}@media screen and (min-width: 991px){.main .summary-list dt{width:33.33%}}@media screen and (min-width: 1200px){.main .summary-list dt{width:25%}}@media screen and (max-width: 1000px){.main{left:250px}}@media screen and (max-width: 768px){.main{left:0;position:static}}.footer{margin:0 20px 20px;padding-top:20px;text-align:right;font-size:.9em;color:#79859a;border-top:1px solid #c8c9cc}.collapsible-group-container{padding-top:8px;padding-bottom:8px;margin-bottom:8px}.collapsible-group-header>*{display:inline;vertical-align:bottom}.collapsible-group-header>a{vertical-align:bottom}.collapsible-group-body{margin-top:0px;padding-top:0px}.params .type,.properties .default{font-family:monospace !important;font-size:12px !important;color:#6e6eb5 !important}.properties .type a:hover,.params .type a:hover{text-decoration:underline !important}.properties .default{color:#96b59d !important}.hljs-built_in,.hljs-title.class_,.hljs-variable.constant_,.hljs-property{color:#6e6eb5 !important}.hljs-title.class_{color:#4444b9 !important}.hljs-attr{color:red !important}.hljs-title{font-weight:normal !important}.share-icon{padding-top:15px}.hljs-keyword{color:inherit !important} \ No newline at end of file diff --git a/docs/main.js b/docs/main.js new file mode 100644 index 000000000..b8f2d0c57 --- /dev/null +++ b/docs/main.js @@ -0,0 +1,11 @@ +"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var n,r={exports:{}}; +/*! + * jQuery JavaScript Library v3.7.1 + * https://jquery.com/ + * + * Copyright OpenJS Foundation and other contributors + * Released under the MIT license + * https://jquery.org/license + * + * Date: 2023-08-28T13:37Z + */n=r,function(e,t){n.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}}("undefined"!=typeof window?window:e,(function(e,t){var n=[],r=Object.getPrototypeOf,i=n.slice,o=n.flat?function(e){return n.flat.call(e)}:function(e){return n.concat.apply([],e)},a=n.push,s=n.indexOf,u={},l=u.toString,c=u.hasOwnProperty,f=c.toString,p=f.call(Object),d={},h=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},g=function(e){return null!=e&&e===e.window},v=e.document,m={type:!0,src:!0,nonce:!0,noModule:!0};function y(e,t,n){var r,i,o=(n=n||v).createElement("script");if(o.text=e,t)for(r in m)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?u[l.call(e)]||"object":typeof e}var b="3.7.1",w=/HTML$/i,T=function(e,t){return new T.fn.init(e,t)};function C(e){var t=!!e&&"length"in e&&e.length,n=x(e);return!h(e)&&!g(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}function E(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}T.fn=T.prototype={jquery:b,constructor:T,length:0,toArray:function(){return i.call(this)},get:function(e){return null==e?i.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=T.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return T.each(this,e)},map:function(e){return this.pushStack(T.map(this,(function(t,n){return e.call(t,n,t)})))},slice:function(){return this.pushStack(i.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(T.grep(this,(function(e,t){return(t+1)%2})))},odd:function(){return this.pushStack(T.grep(this,(function(e,t){return t%2})))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n+~]|"+A+")"+A+"*"),F=new RegExp(A+"|>"),B=new RegExp(R),_=new RegExp("^"+M+"$"),z={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+R),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+A+"*(even|odd|(([+-]|)(\\d*)n|)"+A+"*(?:([+-]|)"+A+"*(\\d+)|))"+A+"*\\)|)","i"),bool:new RegExp("^(?:"+O+")$","i"),needsContext:new RegExp("^"+A+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+A+"*((?:-\\d)?\\d*)"+A+"*\\)|)(?=[^-]|$)","i")},X=/^(?:input|select|textarea|button)$/i,U=/^h\d$/i,V=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,Y=/[+~]/,G=new RegExp("\\\\[\\da-fA-F]{1,6}"+A+"?|\\\\([^\\r\\n\\f])","g"),Q=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},J=function(){ue()},K=pe((function(e){return!0===e.disabled&&E(e,"fieldset")}),{dir:"parentNode",next:"legend"});try{v.apply(n=i.call(q.childNodes),q.childNodes),n[q.childNodes.length].nodeType}catch(e){v={apply:function(e,t){H.apply(e,i.call(t))},call:function(e){H.apply(e,i.call(arguments,1))}}}function Z(e,t,n,r){var i,o,a,s,u,c,f,g=t&&t.ownerDocument,y=t?t.nodeType:9;if(n=n||[],"string"!=typeof e||!e||1!==y&&9!==y&&11!==y)return n;if(!r&&(ue(t),t=t||l,p)){if(11!==y&&(u=V.exec(e)))if(i=u[1]){if(9===y){if(!(a=t.getElementById(i)))return n;if(a.id===i)return v.call(n,a),n}else if(g&&(a=g.getElementById(i))&&Z.contains(t,a)&&a.id===i)return v.call(n,a),n}else{if(u[2])return v.apply(n,t.getElementsByTagName(e)),n;if((i=u[3])&&t.getElementsByClassName)return v.apply(n,t.getElementsByClassName(i)),n}if(!(N[e+" "]||h&&h.test(e))){if(f=e,g=t,1===y&&(F.test(e)||W.test(e))){for((g=Y.test(e)&&se(t.parentNode)||t)==t&&d.scope||((s=t.getAttribute("id"))?s=T.escapeSelector(s):t.setAttribute("id",s=m)),o=(c=ce(e)).length;o--;)c[o]=(s?"#"+s:":scope")+" "+fe(c[o]);f=c.join(",")}try{return v.apply(n,g.querySelectorAll(f)),n}catch(t){N(e,!0)}finally{s===m&&t.removeAttribute("id")}}}return ye(e.replace(D,"$1"),t,n,r)}function ee(){var e=[];return function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}}function te(e){return e[m]=!0,e}function ne(e){var t=l.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function re(e){return function(t){return E(t,"input")&&t.type===e}}function ie(e){return function(t){return(E(t,"input")||E(t,"button"))&&t.type===e}}function oe(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&K(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function ae(e){return te((function(t){return t=+t,te((function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))}))}))}function se(e){return e&&void 0!==e.getElementsByTagName&&e}function ue(e){var t,n=e?e.ownerDocument||e:q;return n!=l&&9===n.nodeType&&n.documentElement?(f=(l=n).documentElement,p=!T.isXMLDoc(l),g=f.matches||f.webkitMatchesSelector||f.msMatchesSelector,f.msMatchesSelector&&q!=l&&(t=l.defaultView)&&t.top!==t&&t.addEventListener("unload",J),d.getById=ne((function(e){return f.appendChild(e).id=T.expando,!l.getElementsByName||!l.getElementsByName(T.expando).length})),d.disconnectedMatch=ne((function(e){return g.call(e,"*")})),d.scope=ne((function(){return l.querySelectorAll(":scope")})),d.cssHas=ne((function(){try{return l.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}})),d.getById?(r.filter.ID=function(e){var t=e.replace(G,Q);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&p){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(G,Q);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&p){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(i=t.getElementsByName(e),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),r.find.TAG=function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):t.querySelectorAll(e)},r.find.CLASS=function(e,t){if(void 0!==t.getElementsByClassName&&p)return t.getElementsByClassName(e)},h=[],ne((function(e){var t;f.appendChild(e).innerHTML="",e.querySelectorAll("[selected]").length||h.push("\\["+A+"*(?:value|"+O+")"),e.querySelectorAll("[id~="+m+"-]").length||h.push("~="),e.querySelectorAll("a#"+m+"+*").length||h.push(".#.+[+~]"),e.querySelectorAll(":checked").length||h.push(":checked"),(t=l.createElement("input")).setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),f.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&h.push(":enabled",":disabled"),(t=l.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||h.push("\\["+A+"*name"+A+"*="+A+"*(?:''|\"\")")})),d.cssHas||h.push(":has"),h=h.length&&new RegExp(h.join("|")),L=function(e,t){if(e===t)return u=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e===l||e.ownerDocument==q&&Z.contains(q,e)?-1:t===l||t.ownerDocument==q&&Z.contains(q,t)?1:a?s.call(a,e)-s.call(a,t):0:4&n?-1:1)},l):l}for(t in Z.matches=function(e,t){return Z(e,null,null,t)},Z.matchesSelector=function(e,t){if(ue(e),p&&!N[t+" "]&&(!h||!h.test(t)))try{var n=g.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return Z(t,l,null,[e]).length>0},Z.contains=function(e,t){return(e.ownerDocument||e)!=l&&ue(e),T.contains(e,t)},Z.attr=function(e,t){(e.ownerDocument||e)!=l&&ue(e);var n=r.attrHandle[t.toLowerCase()],i=n&&c.call(r.attrHandle,t.toLowerCase())?n(e,t,!p):void 0;return void 0!==i?i:e.getAttribute(t)},Z.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},T.uniqueSort=function(e){var t,n=[],r=0,o=0;if(u=!d.sortStable,a=!d.sortStable&&i.call(e,0),k.call(e,L),u){for(;t=e[o++];)t===e[o]&&(r=n.push(o));for(;r--;)j.call(e,n[r],1)}return a=null,e},T.fn.uniqueSort=function(){return this.pushStack(T.uniqueSort(i.apply(this)))},r=T.expr={cacheLength:50,createPseudo:te,match:z,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(G,Q),e[3]=(e[3]||e[4]||e[5]||"").replace(G,Q),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||Z.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&Z.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return z.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&B.test(n)&&(t=ce(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(G,Q).toLowerCase();return"*"===e?function(){return!0}:function(e){return E(e,t)}},CLASS:function(e){var t=b[e+" "];return t||(t=new RegExp("(^|"+A+")"+e+"("+A+"|$)"))&&b(e,(function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,t,n){return function(r){var i=Z.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace(I," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,p,d,h=o!==a?"nextSibling":"previousSibling",g=t.parentNode,v=s&&t.nodeName.toLowerCase(),x=!u&&!s,b=!1;if(g){if(o){for(;h;){for(f=t;f=f[h];)if(s?E(f,v):1===f.nodeType)return!1;d=h="only"===e&&!d&&"nextSibling"}return!0}if(d=[a?g.firstChild:g.lastChild],a&&x){for(b=(p=(l=(c=g[m]||(g[m]={}))[e]||[])[0]===y&&l[1])&&l[2],f=p&&g.childNodes[p];f=++p&&f&&f[h]||(b=p=0)||d.pop();)if(1===f.nodeType&&++b&&f===t){c[e]=[y,p,b];break}}else if(x&&(b=p=(l=(c=t[m]||(t[m]={}))[e]||[])[0]===y&&l[1]),!1===b)for(;(f=++p&&f&&f[h]||(b=p=0)||d.pop())&&(!(s?E(f,v):1===f.nodeType)||!++b||(x&&((c=f[m]||(f[m]={}))[e]=[y,b]),f!==t)););return(b-=i)===r||b%r==0&&b/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||Z.error("unsupported pseudo: "+e);return i[m]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?te((function(e,n){for(var r,o=i(e,t),a=o.length;a--;)e[r=s.call(e,o[a])]=!(n[r]=o[a])})):function(e){return i(e,0,n)}):i}},pseudos:{not:te((function(e){var t=[],n=[],r=me(e.replace(D,"$1"));return r[m]?te((function(e,t,n,i){for(var o,a=r(e,null,i,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))})):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}})),has:te((function(e){return function(t){return Z(e,t).length>0}})),contains:te((function(e){return e=e.replace(G,Q),function(t){return(t.textContent||T.text(t)).indexOf(e)>-1}})),lang:te((function(e){return _.test(e||"")||Z.error("unsupported lang: "+e),e=e.replace(G,Q).toLowerCase(),function(t){var n;do{if(n=p?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}})),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===f},focus:function(e){return e===function(){try{return l.activeElement}catch(e){}}()&&l.hasFocus()&&!!(e.type||e.href||~e.tabIndex)},enabled:oe(!1),disabled:oe(!0),checked:function(e){return E(e,"input")&&!!e.checked||E(e,"option")&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return U.test(e.nodeName)},input:function(e){return X.test(e.nodeName)},button:function(e){return E(e,"input")&&"button"===e.type||E(e,"button")},text:function(e){var t;return E(e,"input")&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ae((function(){return[0]})),last:ae((function(e,t){return[t-1]})),eq:ae((function(e,t,n){return[n<0?n+t:n]})),even:ae((function(e,t){for(var n=0;nt?t:n;--r>=0;)e.push(r);return e})),gt:ae((function(e,t,n){for(var r=n<0?n+t:n;++r1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function he(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s-1&&(o[c]=!(a[c]=p))}}else d=he(d===a?d.splice(m,d.length):d),i?i(null,a,d,l):v.apply(a,d)}))}function ve(e){for(var t,n,i,a=e.length,u=r.relative[e[0].type],l=u||r.relative[" "],c=u?1:0,f=pe((function(e){return e===t}),l,!0),p=pe((function(e){return s.call(t,e)>-1}),l,!0),d=[function(e,n,r){var i=!u&&(r||n!=o)||((t=n).nodeType?f(e,n,r):p(e,n,r));return t=null,i}];c1&&de(d),c>1&&fe(e.slice(0,c-1).concat({value:" "===e[c-2].type?"*":""})).replace(D,"$1"),n,c0,i=e.length>0,a=function(a,s,u,c,f){var d,h,g,m=0,x="0",b=a&&[],w=[],C=o,E=a||i&&r.find.TAG("*",f),k=y+=null==C?1:Math.random()||.1,j=E.length;for(f&&(o=s==l||s||f);x!==j&&null!=(d=E[x]);x++){if(i&&d){for(h=0,s||d.ownerDocument==l||(ue(d),u=!p);g=e[h++];)if(g(d,s||l,u)){v.call(c,d);break}f&&(y=k)}n&&((d=!g&&d)&&m--,a&&b.push(d))}if(m+=x,n&&x!==m){for(h=0;g=t[h++];)g(b,w,s,u);if(a){if(m>0)for(;x--;)b[x]||w[x]||(w[x]=S.call(c));w=he(w)}v.apply(c,w),f&&!a&&w.length>0&&m+t.length>1&&T.uniqueSort(c)}return f&&(y=k,o=C),b};return n?te(a):a}(a,i)),s.selector=e}return s}function ye(e,t,n,i){var o,a,s,u,l,c="function"==typeof e&&e,f=!i&&ce(e=c.selector||e);if(n=n||[],1===f.length){if((a=f[0]=f[0].slice(0)).length>2&&"ID"===(s=a[0]).type&&9===t.nodeType&&p&&r.relative[a[1].type]){if(!(t=(r.find.ID(s.matches[0].replace(G,Q),t)||[])[0]))return n;c&&(t=t.parentNode),e=e.slice(a.shift().value.length)}for(o=z.needsContext.test(e)?0:a.length;o--&&(s=a[o],!r.relative[u=s.type]);)if((l=r.find[u])&&(i=l(s.matches[0].replace(G,Q),Y.test(a[0].type)&&se(t.parentNode)||t))){if(a.splice(o,1),!(e=i.length&&fe(a)))return v.apply(n,i),n;break}}return(c||me(e,f))(i,t,!p,n,!t||Y.test(e)&&se(t.parentNode)||t),n}le.prototype=r.filters=r.pseudos,r.setFilters=new le,d.sortStable=m.split("").sort(L).join("")===m,ue(),d.sortDetached=ne((function(e){return 1&e.compareDocumentPosition(l.createElement("fieldset"))})),T.find=Z,T.expr[":"]=T.expr.pseudos,T.unique=T.uniqueSort,Z.compile=me,Z.select=ye,Z.setDocument=ue,Z.tokenize=ce,Z.escape=T.escapeSelector,Z.getText=T.text,Z.isXML=T.isXMLDoc,Z.selectors=T.expr,Z.support=T.support,Z.uniqueSort=T.uniqueSort}();var O=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&T(e).is(n))break;r.push(e)}return r},M=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},P=T.expr.match.needsContext,R=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function I(e,t,n){return h(t)?T.grep(e,(function(e,r){return!!t.call(e,r,e)!==n})):t.nodeType?T.grep(e,(function(e){return e===t!==n})):"string"!=typeof t?T.grep(e,(function(e){return s.call(t,e)>-1!==n})):T.filter(t,e,n)}T.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?T.find.matchesSelector(r,e)?[r]:[]:T.find.matches(e,T.grep(t,(function(e){return 1===e.nodeType})))},T.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(T(e).filter((function(){for(t=0;t1?T.uniqueSort(n):n},filter:function(e){return this.pushStack(I(this,e||[],!1))},not:function(e){return this.pushStack(I(this,e||[],!0))},is:function(e){return!!I(this,"string"==typeof e&&P.test(e)?T(e):e||[],!1).length}});var $,W=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(T.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||$,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:W.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof T?t[0]:t,T.merge(this,T.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:v,!0)),R.test(r[1])&&T.isPlainObject(t))for(r in t)h(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=v.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):h(e)?void 0!==n.ready?n.ready(e):e(T):T.makeArray(e,this)}).prototype=T.fn,$=T(v);var F=/^(?:parents|prev(?:Until|All))/,B={children:!0,contents:!0,next:!0,prev:!0};function _(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}T.fn.extend({has:function(e){var t=T(e,this),n=t.length;return this.filter((function(){for(var e=0;e-1:1===n.nodeType&&T.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?T.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?s.call(T(e),this[0]):s.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(T.uniqueSort(T.merge(this.get(),T(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),T.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return O(e,"parentNode")},parentsUntil:function(e,t,n){return O(e,"parentNode",n)},next:function(e){return _(e,"nextSibling")},prev:function(e){return _(e,"previousSibling")},nextAll:function(e){return O(e,"nextSibling")},prevAll:function(e){return O(e,"previousSibling")},nextUntil:function(e,t,n){return O(e,"nextSibling",n)},prevUntil:function(e,t,n){return O(e,"previousSibling",n)},siblings:function(e){return M((e.parentNode||{}).firstChild,e)},children:function(e){return M(e.firstChild)},contents:function(e){return null!=e.contentDocument&&r(e.contentDocument)?e.contentDocument:(E(e,"template")&&(e=e.content||e),T.merge([],e.childNodes))}},(function(e,t){T.fn[e]=function(n,r){var i=T.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=T.filter(r,i)),this.length>1&&(B[e]||T.uniqueSort(i),F.test(e)&&i.reverse()),this.pushStack(i)}}));var z=/[^\x20\t\r\n\f]+/g;function X(e){return e}function U(e){throw e}function V(e,t,n,r){var i;try{e&&h(i=e.promise)?i.call(e).done(t).fail(n):e&&h(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}T.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return T.each(e.match(z)||[],(function(e,n){t[n]=!0})),t}(e):T.extend({},e);var t,n,r,i,o=[],a=[],s=-1,u=function(){for(i=i||e.once,r=t=!0;a.length;s=-1)for(n=a.shift();++s-1;)o.splice(n,1),n<=s&&s--})),this},has:function(e){return e?T.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],a.push(n),t||u()),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!r}};return l},T.extend({Deferred:function(t){var n=[["notify","progress",T.Callbacks("memory"),T.Callbacks("memory"),2],["resolve","done",T.Callbacks("once memory"),T.Callbacks("once memory"),0,"resolved"],["reject","fail",T.Callbacks("once memory"),T.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},catch:function(e){return i.then(null,e)},pipe:function(){var e=arguments;return T.Deferred((function(t){T.each(n,(function(n,r){var i=h(e[r[4]])&&e[r[4]];o[r[1]]((function(){var e=i&&i.apply(this,arguments);e&&h(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[r[0]+"With"](this,i?[e]:arguments)}))})),e=null})).promise()},then:function(t,r,i){var o=0;function a(t,n,r,i){return function(){var s=this,u=arguments,l=function(){var e,l;if(!(t=o&&(r!==U&&(s=void 0,u=[e]),n.rejectWith(s,u))}};t?c():(T.Deferred.getErrorHook?c.error=T.Deferred.getErrorHook():T.Deferred.getStackHook&&(c.error=T.Deferred.getStackHook()),e.setTimeout(c))}}return T.Deferred((function(e){n[0][3].add(a(0,e,h(i)?i:X,e.notifyWith)),n[1][3].add(a(0,e,h(t)?t:X)),n[2][3].add(a(0,e,h(r)?r:U))})).promise()},promise:function(e){return null!=e?T.extend(e,i):i}},o={};return T.each(n,(function(e,t){var a=t[2],s=t[5];i[t[1]]=a.add,s&&a.add((function(){r=s}),n[3-e][2].disable,n[3-e][3].disable,n[0][2].lock,n[0][3].lock),a.add(t[3].fire),o[t[0]]=function(){return o[t[0]+"With"](this===o?void 0:this,arguments),this},o[t[0]+"With"]=a.fireWith})),i.promise(o),t&&t.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),o=i.call(arguments),a=T.Deferred(),s=function(e){return function(n){r[e]=this,o[e]=arguments.length>1?i.call(arguments):n,--t||a.resolveWith(r,o)}};if(t<=1&&(V(e,a.done(s(n)).resolve,a.reject,!t),"pending"===a.state()||h(o[n]&&o[n].then)))return a.then();for(;n--;)V(o[n],s(n),a.reject);return a.promise()}});var Y=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;T.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&Y.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},T.readyException=function(t){e.setTimeout((function(){throw t}))};var G=T.Deferred();function Q(){v.removeEventListener("DOMContentLoaded",Q),e.removeEventListener("load",Q),T.ready()}T.fn.ready=function(e){return G.then(e).catch((function(e){T.readyException(e)})),this},T.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--T.readyWait:T.isReady)||(T.isReady=!0,!0!==e&&--T.readyWait>0||G.resolveWith(v,[T]))}}),T.ready.then=G.then,"complete"===v.readyState||"loading"!==v.readyState&&!v.documentElement.doScroll?e.setTimeout(T.ready):(v.addEventListener("DOMContentLoaded",Q),e.addEventListener("load",Q));var J=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===x(n))for(s in i=!0,n)J(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,h(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(T(e),n)})),t))for(;s1,null,!0)},removeData:function(e){return this.each((function(){oe.remove(this,e)}))}}),T.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=ie.get(e,t),n&&(!r||Array.isArray(n)?r=ie.access(e,t,T.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=T.queue(e,t),r=n.length,i=n.shift(),o=T._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,(function(){T.dequeue(e,t)}),o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return ie.get(e,n)||ie.access(e,n,{empty:T.Callbacks("once memory").add((function(){ie.remove(e,[t+"queue",n])}))})}}),T.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length\x20\t\r\n\f]*)/i,Ee=/^$|^module$|\/(?:java|ecma)script/i;be=v.createDocumentFragment().appendChild(v.createElement("div")),(we=v.createElement("input")).setAttribute("type","radio"),we.setAttribute("checked","checked"),we.setAttribute("name","t"),be.appendChild(we),d.checkClone=be.cloneNode(!0).cloneNode(!0).lastChild.checked,be.innerHTML="",d.noCloneChecked=!!be.cloneNode(!0).lastChild.defaultValue,be.innerHTML="",d.option=!!be.lastChild;var Se={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ke(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&E(e,t)?T.merge([e],n):n}function je(e,t){for(var n=0,r=e.length;n",""]);var Ae=/<|&#?\w+;/;function De(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d-1)i&&i.push(o);else if(l=de(o),a=ke(f.appendChild(o),"script"),l&&je(a),n)for(c=0;o=a[c++];)Ee.test(o.type||"")&&n.push(o);return f}var Ne=/^([^.]*)(?:\.(.+)|)/;function Le(){return!0}function qe(){return!1}function He(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)He(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=qe;else if(!i)return e;return 1===o&&(a=i,i=function(e){return T().off(e),a.apply(this,arguments)},i.guid=a.guid||(a.guid=T.guid++)),e.each((function(){T.event.add(this,t,i,r,n)}))}function Oe(e,t,n){n?(ie.set(e,t,!1),T.event.add(e,t,{namespace:!1,handler:function(e){var n,r=ie.get(this,t);if(1&e.isTrigger&&this[t]){if(r)(T.event.special[t]||{}).delegateType&&e.stopPropagation();else if(r=i.call(arguments),ie.set(this,t,r),this[t](),n=ie.get(this,t),ie.set(this,t,!1),r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n}else r&&(ie.set(this,t,T.event.trigger(r[0],r.slice(1),this)),e.stopPropagation(),e.isImmediatePropagationStopped=Le)}})):void 0===ie.get(e,t)&&T.event.add(e,t,Le)}T.event={global:{},add:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=ie.get(e);if(ne(e))for(n.handler&&(n=(o=n).handler,i=o.selector),i&&T.find.matchesSelector(pe,i),n.guid||(n.guid=T.guid++),(u=v.events)||(u=v.events=Object.create(null)),(a=v.handle)||(a=v.handle=function(t){return void 0!==T&&T.event.triggered!==t.type?T.event.dispatch.apply(e,arguments):void 0}),l=(t=(t||"").match(z)||[""]).length;l--;)d=g=(s=Ne.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=T.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=T.event.special[d]||{},c=T.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&T.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(e,r,h,a)||e.addEventListener&&e.addEventListener(d,a)),f.add&&(f.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),T.event.global[d]=!0)},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=ie.hasData(e)&&ie.get(e);if(v&&(u=v.events)){for(l=(t=(t||"").match(z)||[""]).length;l--;)if(d=g=(s=Ne.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){for(f=T.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;o--;)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||T.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)T.event.remove(e,d+t[l],n,r,!0);T.isEmptyObject(u)&&ie.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=new Array(arguments.length),u=T.event.fix(e),l=(ie.get(this,"events")||Object.create(null))[u.type]||[],c=T.event.special[u.type]||{};for(s[0]=u,t=1;t=1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n-1:T.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u\s*$/g;function Ie(e,t){return E(e,"table")&&E(11!==t.nodeType?t:t.firstChild,"tr")&&T(e).children("tbody")[0]||e}function $e(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function We(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Fe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(ie.hasData(e)&&(s=ie.get(e).events))for(i in ie.remove(t,"handle events"),s)for(n=0,r=s[i].length;n1&&"string"==typeof v&&!d.checkClone&&Pe.test(v))return e.each((function(i){var o=e.eq(i);m&&(t[0]=v.call(this,i,o.html())),_e(o,t,n,r)}));if(p&&(a=(i=De(t,e[0].ownerDocument,!1,e,r)).firstChild,1===i.childNodes.length&&(i=a),a||r)){for(u=(s=T.map(ke(i,"script"),$e)).length;f0&&je(a,!u&&ke(e,"script")),s},cleanData:function(e){for(var t,n,r,i=T.event.special,o=0;void 0!==(n=e[o]);o++)if(ne(n)){if(t=n[ie.expando]){if(t.events)for(r in t.events)i[r]?T.event.remove(n,r):T.removeEvent(n,r,t.handle);n[ie.expando]=void 0}n[oe.expando]&&(n[oe.expando]=void 0)}}}),T.fn.extend({detach:function(e){return ze(this,e,!0)},remove:function(e){return ze(this,e)},text:function(e){return J(this,(function(e){return void 0===e?T.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)}))}),null,e,arguments.length)},append:function(){return _e(this,arguments,(function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Ie(this,e).appendChild(e)}))},prepend:function(){return _e(this,arguments,(function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Ie(this,e);t.insertBefore(e,t.firstChild)}}))},before:function(){return _e(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this)}))},after:function(){return _e(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)}))},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(T.cleanData(ke(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map((function(){return T.clone(this,e,t)}))},html:function(e){return J(this,(function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Me.test(e)&&!Se[(Ce.exec(e)||["",""])[1].toLowerCase()]){e=T.htmlPrefilter(e);try{for(;n=0&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))||0),u+l}function st(e,t,n){var r=Ve(e),i=(!d.boxSizingReliable()||n)&&"border-box"===T.css(e,"boxSizing",!1,r),o=i,a=Qe(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(Xe.test(a)){if(!n)return a;a="auto"}return(!d.boxSizingReliable()&&i||!d.reliableTrDimensions()&&E(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===T.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===T.css(e,"boxSizing",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+at(e,t,n||(i?"border":"content"),o,r,a)+"px"}function ut(e,t,n,r,i){return new ut.prototype.init(e,t,n,r,i)}T.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Qe(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=te(t),u=Ue.test(t),l=e.style;if(u||(t=tt(s)),a=T.cssHooks[t]||T.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"==(o=typeof n)&&(i=ce.exec(n))&&i[1]&&(n=ve(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(T.cssNumber[s]?"":"px")),d.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=te(t);return Ue.test(t)||(t=tt(s)),(a=T.cssHooks[t]||T.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Qe(e,t,r)),"normal"===i&&t in it&&(i=it[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),T.each(["height","width"],(function(e,t){T.cssHooks[t]={get:function(e,n,r){if(n)return!nt.test(T.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?st(e,t,r):Ye(e,rt,(function(){return st(e,t,r)}))},set:function(e,n,r){var i,o=Ve(e),a=!d.scrollboxSize()&&"absolute"===o.position,s=(a||r)&&"border-box"===T.css(e,"boxSizing",!1,o),u=r?at(e,t,r,s,o):0;return s&&a&&(u-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-at(e,t,"border",!1,o)-.5)),u&&(i=ce.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=T.css(e,t)),ot(0,n,u)}}})),T.cssHooks.marginLeft=Je(d.reliableMarginLeft,(function(e,t){if(t)return(parseFloat(Qe(e,"marginLeft"))||e.getBoundingClientRect().left-Ye(e,{marginLeft:0},(function(){return e.getBoundingClientRect().left})))+"px"})),T.each({margin:"",padding:"",border:"Width"},(function(e,t){T.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+fe[r]+t]=o[r]||o[r-2]||o[0];return i}},"margin"!==e&&(T.cssHooks[e+t].set=ot)})),T.fn.extend({css:function(e,t){return J(this,(function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Ve(e),i=t.length;a1)}}),T.Tween=ut,ut.prototype={constructor:ut,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||T.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(T.cssNumber[n]?"":"px")},cur:function(){var e=ut.propHooks[this.prop];return e&&e.get?e.get(this):ut.propHooks._default.get(this)},run:function(e){var t,n=ut.propHooks[this.prop];return this.options.duration?this.pos=t=T.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):ut.propHooks._default.set(this),this}},ut.prototype.init.prototype=ut.prototype,ut.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=T.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){T.fx.step[e.prop]?T.fx.step[e.prop](e):1!==e.elem.nodeType||!T.cssHooks[e.prop]&&null==e.elem.style[tt(e.prop)]?e.elem[e.prop]=e.now:T.style(e.elem,e.prop,e.now+e.unit)}}},ut.propHooks.scrollTop=ut.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},T.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},T.fx=ut.prototype.init,T.fx.step={};var lt,ct,ft=/^(?:toggle|show|hide)$/,pt=/queueHooks$/;function dt(){ct&&(!1===v.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(dt):e.setTimeout(dt,T.fx.interval),T.fx.tick())}function ht(){return e.setTimeout((function(){lt=void 0})),lt=Date.now()}function gt(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=fe[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function vt(e,t,n){for(var r,i=(mt.tweeners[t]||[]).concat(mt.tweeners["*"]),o=0,a=i.length;o1)},removeAttr:function(e){return this.each((function(){T.removeAttr(this,e)}))}}),T.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?T.prop(e,t,n):(1===o&&T.isXMLDoc(e)||(i=T.attrHooks[t.toLowerCase()]||(T.expr.match.bool.test(t)?yt:void 0)),void 0!==n?null===n?void T.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=T.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!d.radioValue&&"radio"===t&&E(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(z);if(i&&1===e.nodeType)for(;n=i[r++];)e.removeAttribute(n)}}),yt={set:function(e,t,n){return!1===t?T.removeAttr(e,n):e.setAttribute(n,n),n}},T.each(T.expr.match.bool.source.match(/\w+/g),(function(e,t){var n=xt[t]||T.find.attr;xt[t]=function(e,t,r){var i,o,a=t.toLowerCase();return r||(o=xt[a],xt[a]=i,i=null!=n(e,t,r)?a:null,xt[a]=o),i}}));var bt=/^(?:input|select|textarea|button)$/i,wt=/^(?:a|area)$/i;function Tt(e){return(e.match(z)||[]).join(" ")}function Ct(e){return e.getAttribute&&e.getAttribute("class")||""}function Et(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(z)||[]}T.fn.extend({prop:function(e,t){return J(this,T.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each((function(){delete this[T.propFix[e]||e]}))}}),T.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&T.isXMLDoc(e)||(t=T.propFix[t]||t,i=T.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=T.find.attr(e,"tabindex");return t?parseInt(t,10):bt.test(e.nodeName)||wt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),d.optSelected||(T.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),T.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){T.propFix[this.toLowerCase()]=this})),T.fn.extend({addClass:function(e){var t,n,r,i,o,a;return h(e)?this.each((function(t){T(this).addClass(e.call(this,t,Ct(this)))})):(t=Et(e)).length?this.each((function(){if(r=Ct(this),n=1===this.nodeType&&" "+Tt(r)+" "){for(o=0;o-1;)n=n.replace(" "+i+" "," ");a=Tt(n),r!==a&&this.setAttribute("class",a)}})):this:this.attr("class","")},toggleClass:function(e,t){var n,r,i,o,a=typeof e,s="string"===a||Array.isArray(e);return h(e)?this.each((function(n){T(this).toggleClass(e.call(this,n,Ct(this),t),t)})):"boolean"==typeof t&&s?t?this.addClass(e):this.removeClass(e):(n=Et(e),this.each((function(){if(s)for(o=T(this),i=0;i-1)return!0;return!1}});var St=/\r/g;T.fn.extend({val:function(e){var t,n,r,i=this[0];return arguments.length?(r=h(e),this.each((function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,T(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=T.map(i,(function(e){return null==e?"":e+""}))),(t=T.valHooks[this.type]||T.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))}))):i?(t=T.valHooks[i.type]||T.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(St,""):null==n?"":n:void 0}}),T.extend({valHooks:{option:{get:function(e){var t=T.find.attr(e,"value");return null!=t?t:Tt(T.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),T.each(["radio","checkbox"],(function(){T.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=T.inArray(T(e).val(),t)>-1}},d.checkOn||(T.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}));var kt=e.location,jt={guid:Date.now()},At=/\?/;T.parseXML=function(t){var n,r;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){}return r=n&&n.getElementsByTagName("parsererror")[0],n&&!r||T.error("Invalid XML: "+(r?T.map(r.childNodes,(function(e){return e.textContent})).join("\n"):t)),n};var Dt=/^(?:focusinfocus|focusoutblur)$/,Nt=function(e){e.stopPropagation()};T.extend(T.event,{trigger:function(t,n,r,i){var o,a,s,u,l,f,p,d,m=[r||v],y=c.call(t,"type")?t.type:t,x=c.call(t,"namespace")?t.namespace.split("."):[];if(a=d=s=r=r||v,3!==r.nodeType&&8!==r.nodeType&&!Dt.test(y+T.event.triggered)&&(y.indexOf(".")>-1&&(x=y.split("."),y=x.shift(),x.sort()),l=y.indexOf(":")<0&&"on"+y,(t=t[T.expando]?t:new T.Event(y,"object"==typeof t&&t)).isTrigger=i?2:3,t.namespace=x.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+x.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),n=null==n?[t]:T.makeArray(n,[t]),p=T.event.special[y]||{},i||!p.trigger||!1!==p.trigger.apply(r,n))){if(!i&&!p.noBubble&&!g(r)){for(u=p.delegateType||y,Dt.test(u+y)||(a=a.parentNode);a;a=a.parentNode)m.push(a),s=a;s===(r.ownerDocument||v)&&m.push(s.defaultView||s.parentWindow||e)}for(o=0;(a=m[o++])&&!t.isPropagationStopped();)d=a,t.type=o>1?u:p.bindType||y,(f=(ie.get(a,"events")||Object.create(null))[t.type]&&ie.get(a,"handle"))&&f.apply(a,n),(f=l&&a[l])&&f.apply&&ne(a)&&(t.result=f.apply(a,n),!1===t.result&&t.preventDefault());return t.type=y,i||t.isDefaultPrevented()||p._default&&!1!==p._default.apply(m.pop(),n)||!ne(r)||l&&h(r[y])&&!g(r)&&((s=r[l])&&(r[l]=null),T.event.triggered=y,t.isPropagationStopped()&&d.addEventListener(y,Nt),r[y](),t.isPropagationStopped()&&d.removeEventListener(y,Nt),T.event.triggered=void 0,s&&(r[l]=s)),t.result}},simulate:function(e,t,n){var r=T.extend(new T.Event,n,{type:e,isSimulated:!0});T.event.trigger(r,null,t)}}),T.fn.extend({trigger:function(e,t){return this.each((function(){T.event.trigger(e,t,this)}))},triggerHandler:function(e,t){var n=this[0];if(n)return T.event.trigger(e,t,n,!0)}});var Lt=/\[\]$/,qt=/\r?\n/g,Ht=/^(?:submit|button|image|reset|file)$/i,Ot=/^(?:input|select|textarea|keygen)/i;function Mt(e,t,n,r){var i;if(Array.isArray(t))T.each(t,(function(t,i){n||Lt.test(e)?r(e,i):Mt(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)}));else if(n||"object"!==x(t))r(e,t);else for(i in t)Mt(e+"["+i+"]",t[i],n,r)}T.param=function(e,t){var n,r=[],i=function(e,t){var n=h(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!T.isPlainObject(e))T.each(e,(function(){i(this.name,this.value)}));else for(n in e)Mt(n,e[n],t,i);return r.join("&")},T.fn.extend({serialize:function(){return T.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var e=T.prop(this,"elements");return e?T.makeArray(e):this})).filter((function(){var e=this.type;return this.name&&!T(this).is(":disabled")&&Ot.test(this.nodeName)&&!Ht.test(e)&&(this.checked||!Te.test(e))})).map((function(e,t){var n=T(this).val();return null==n?null:Array.isArray(n)?T.map(n,(function(e){return{name:t.name,value:e.replace(qt,"\r\n")}})):{name:t.name,value:n.replace(qt,"\r\n")}})).get()}});var Pt=/%20/g,Rt=/#.*$/,It=/([?&])_=[^&]*/,$t=/^(.*?):[ \t]*([^\r\n]*)$/gm,Wt=/^(?:GET|HEAD)$/,Ft=/^\/\//,Bt={},_t={},zt="*/".concat("*"),Xt=v.createElement("a");function Ut(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(z)||[];if(h(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function Vt(e,t,n,r){var i={},o=e===_t;function a(s){var u;return i[s]=!0,T.each(e[s]||[],(function(e,s){var l=s(t,n,r);return"string"!=typeof l||o||i[l]?o?!(u=l):void 0:(t.dataTypes.unshift(l),a(l),!1)})),u}return a(t.dataTypes[0])||!i["*"]&&a("*")}function Yt(e,t){var n,r,i=T.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&T.extend(!0,e,r),e}Xt.href=kt.href,T.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:kt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(kt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":zt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":T.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Yt(Yt(e,T.ajaxSettings),t):Yt(T.ajaxSettings,e)},ajaxPrefilter:Ut(Bt),ajaxTransport:Ut(_t),ajax:function(t,n){"object"==typeof t&&(n=t,t=void 0),n=n||{};var r,i,o,a,s,u,l,c,f,p,d=T.ajaxSetup({},n),h=d.context||d,g=d.context&&(h.nodeType||h.jquery)?T(h):T.event,m=T.Deferred(),y=T.Callbacks("once memory"),x=d.statusCode||{},b={},w={},C="canceled",E={readyState:0,getResponseHeader:function(e){var t;if(l){if(!a)for(a={};t=$t.exec(o);)a[t[1].toLowerCase()+" "]=(a[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=a[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return l?o:null},setRequestHeader:function(e,t){return null==l&&(e=w[e.toLowerCase()]=w[e.toLowerCase()]||e,b[e]=t),this},overrideMimeType:function(e){return null==l&&(d.mimeType=e),this},statusCode:function(e){var t;if(e)if(l)E.always(e[E.status]);else for(t in e)x[t]=[x[t],e[t]];return this},abort:function(e){var t=e||C;return r&&r.abort(t),S(0,t),this}};if(m.promise(E),d.url=((t||d.url||kt.href)+"").replace(Ft,kt.protocol+"//"),d.type=n.method||n.type||d.method||d.type,d.dataTypes=(d.dataType||"*").toLowerCase().match(z)||[""],null==d.crossDomain){u=v.createElement("a");try{u.href=d.url,u.href=u.href,d.crossDomain=Xt.protocol+"//"+Xt.host!=u.protocol+"//"+u.host}catch(e){d.crossDomain=!0}}if(d.data&&d.processData&&"string"!=typeof d.data&&(d.data=T.param(d.data,d.traditional)),Vt(Bt,d,n,E),l)return E;for(f in(c=T.event&&d.global)&&0==T.active++&&T.event.trigger("ajaxStart"),d.type=d.type.toUpperCase(),d.hasContent=!Wt.test(d.type),i=d.url.replace(Rt,""),d.hasContent?d.data&&d.processData&&0===(d.contentType||"").indexOf("application/x-www-form-urlencoded")&&(d.data=d.data.replace(Pt,"+")):(p=d.url.slice(i.length),d.data&&(d.processData||"string"==typeof d.data)&&(i+=(At.test(i)?"&":"?")+d.data,delete d.data),!1===d.cache&&(i=i.replace(It,"$1"),p=(At.test(i)?"&":"?")+"_="+jt.guid+++p),d.url=i+p),d.ifModified&&(T.lastModified[i]&&E.setRequestHeader("If-Modified-Since",T.lastModified[i]),T.etag[i]&&E.setRequestHeader("If-None-Match",T.etag[i])),(d.data&&d.hasContent&&!1!==d.contentType||n.contentType)&&E.setRequestHeader("Content-Type",d.contentType),E.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+("*"!==d.dataTypes[0]?", "+zt+"; q=0.01":""):d.accepts["*"]),d.headers)E.setRequestHeader(f,d.headers[f]);if(d.beforeSend&&(!1===d.beforeSend.call(h,E,d)||l))return E.abort();if(C="abort",y.add(d.complete),E.done(d.success),E.fail(d.error),r=Vt(_t,d,n,E)){if(E.readyState=1,c&&g.trigger("ajaxSend",[E,d]),l)return E;d.async&&d.timeout>0&&(s=e.setTimeout((function(){E.abort("timeout")}),d.timeout));try{l=!1,r.send(b,S)}catch(e){if(l)throw e;S(-1,e)}}else S(-1,"No Transport");function S(t,n,a,u){var f,p,v,b,w,C=n;l||(l=!0,s&&e.clearTimeout(s),r=void 0,o=u||"",E.readyState=t>0?4:0,f=t>=200&&t<300||304===t,a&&(b=function(e,t,n){for(var r,i,o,a,s=e.contents,u=e.dataTypes;"*"===u[0];)u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(d,E,a)),!f&&T.inArray("script",d.dataTypes)>-1&&T.inArray("json",d.dataTypes)<0&&(d.converters["text script"]=function(){}),b=function(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];for(o=c.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e.throws)t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(d,b,E,f),f?(d.ifModified&&((w=E.getResponseHeader("Last-Modified"))&&(T.lastModified[i]=w),(w=E.getResponseHeader("etag"))&&(T.etag[i]=w)),204===t||"HEAD"===d.type?C="nocontent":304===t?C="notmodified":(C=b.state,p=b.data,f=!(v=b.error))):(v=C,!t&&C||(C="error",t<0&&(t=0))),E.status=t,E.statusText=(n||C)+"",f?m.resolveWith(h,[p,C,E]):m.rejectWith(h,[E,C,v]),E.statusCode(x),x=void 0,c&&g.trigger(f?"ajaxSuccess":"ajaxError",[E,d,f?p:v]),y.fireWith(h,[E,C]),c&&(g.trigger("ajaxComplete",[E,d]),--T.active||T.event.trigger("ajaxStop")))}return E},getJSON:function(e,t,n){return T.get(e,t,n,"json")},getScript:function(e,t){return T.get(e,void 0,t,"script")}}),T.each(["get","post"],(function(e,t){T[t]=function(e,n,r,i){return h(n)&&(i=i||r,r=n,n=void 0),T.ajax(T.extend({url:e,type:t,dataType:i,data:n,success:r},T.isPlainObject(e)&&e))}})),T.ajaxPrefilter((function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")})),T._evalUrl=function(e,t,n){return T.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){T.globalEval(e,t,n)}})},T.fn.extend({wrapAll:function(e){var t;return this[0]&&(h(e)&&(e=e.call(this[0])),t=T(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map((function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e})).append(this)),this},wrapInner:function(e){return h(e)?this.each((function(t){T(this).wrapInner(e.call(this,t))})):this.each((function(){var t=T(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)}))},wrap:function(e){var t=h(e);return this.each((function(n){T(this).wrapAll(t?e.call(this,n):e)}))},unwrap:function(e){return this.parent(e).not("body").each((function(){T(this).replaceWith(this.childNodes)})),this}}),T.expr.pseudos.hidden=function(e){return!T.expr.pseudos.visible(e)},T.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},T.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Gt={0:200,1223:204},Qt=T.ajaxSettings.xhr();d.cors=!!Qt&&"withCredentials"in Qt,d.ajax=Qt=!!Qt,T.ajaxTransport((function(t){var n,r;if(d.cors||Qt&&!t.crossDomain)return{send:function(i,o){var a,s=t.xhr();if(s.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)s[a]=t.xhrFields[a];for(a in t.mimeType&&s.overrideMimeType&&s.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)s.setRequestHeader(a,i[a]);n=function(e){return function(){n&&(n=r=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(Gt[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=n(),r=s.onerror=s.ontimeout=n("error"),void 0!==s.onabort?s.onabort=r:s.onreadystatechange=function(){4===s.readyState&&e.setTimeout((function(){n&&r()}))},n=n("abort");try{s.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}})),T.ajaxPrefilter((function(e){e.crossDomain&&(e.contents.script=!1)})),T.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return T.globalEval(e),e}}}),T.ajaxPrefilter("script",(function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")})),T.ajaxTransport("script",(function(e){var t,n;if(e.crossDomain||e.scriptAttrs)return{send:function(r,i){t=T("} + *
  • define style rules. See the example page for examples. + *
  • mark the {@code
    } and {@code } tags in your source with
    + *    {@code class=prettyprint.}
    + *    You can also use the (html deprecated) {@code } tag, but the pretty
    + *    printer needs to do more substantial DOM manipulations to support that, so
    + *    some css styles may not be preserved.
    + * </ol>
    + * That's it.  I wanted to keep the API as simple as possible, so there's no
    + * need to specify which language the code is in, but if you wish, you can add
    + * another class to the {@code <pre>} or {@code <code>} element to specify the
    + * language, as in {@code <pre class="prettyprint lang-java">}.  Any class that
    + * starts with "lang-" followed by a file extension, specifies the file type.
    + * See the "lang-*.js" files in this directory for code that implements
    + * per-language file handlers.
    + * <p>
    + * Change log:<br>
    + * cbeust, 2006/08/22
    + * <blockquote>
    + *   Java annotations (start with "@") are now captured as literals ("lit")
    + * </blockquote>
    + * @requires console
    + */
    +
    +// JSLint declarations
    +/*global console, document, navigator, setTimeout, window, define */
    +
    +
    +/**
    +* @typedef {!Array.<number|string>}
    +* Alternating indices and the decorations that should be inserted there.
    +* The indices are monotonically increasing.
    +*/
    +var DecorationsT;
    +
    +/**
    +* @typedef {!{
    +*   sourceNode: !Element,
    +*   pre: !(number|boolean),
    +*   langExtension: ?string,
    +*   numberLines: ?(number|boolean),
    +*   sourceCode: ?string,
    +*   spans: ?(Array.<number|Node>),
    +*   basePos: ?number,
    +*   decorations: ?DecorationsT
    +* }}
    +* <dl>
    +*  <dt>sourceNode<dd>the element containing the source
    +*  <dt>sourceCode<dd>source as plain text
    +*  <dt>pre<dd>truthy if white-space in text nodes
    +*     should be considered significant.
    +*  <dt>spans<dd> alternating span start indices into source
    +*     and the text node or element (e.g. {@code <BR>}) corresponding to that
    +*     span.
    +*  <dt>decorations<dd>an array of style classes preceded
    +*     by the position at which they start in job.sourceCode in order
    +*  <dt>basePos<dd>integer position of this.sourceCode in the larger chunk of
    +*     source.
    +* </dl>
    +*/
    +var JobT;
    +
    +/**
    +* @typedef {!{
    +*   sourceCode: string,
    +*   spans: !(Array.<number|Node>)
    +* }}
    +* <dl>
    +*  <dt>sourceCode<dd>source as plain text
    +*  <dt>spans<dd> alternating span start indices into source
    +*     and the text node or element (e.g. {@code <BR>}) corresponding to that
    +*     span.
    +* </dl>
    +*/
    +var SourceSpansT;
    +
    +/** @define {boolean} */
    +var IN_GLOBAL_SCOPE = false;
    +
    +var HACK_TO_FIX_JS_INCLUDE_PL;
    +
    +/**
    + * {@type !{
    + *   'createSimpleLexer': function (Array, Array): (function (JobT)),
    + *   'registerLangHandler': function (function (JobT), Array.<string>),
    + *   'PR_ATTRIB_NAME': string,
    + *   'PR_ATTRIB_NAME': string,
    + *   'PR_ATTRIB_VALUE': string,
    + *   'PR_COMMENT': string,
    + *   'PR_DECLARATION': string,
    + *   'PR_KEYWORD': string,
    + *   'PR_LITERAL': string,
    + *   'PR_NOCODE': string,
    + *   'PR_PLAIN': string,
    + *   'PR_PUNCTUATION': string,
    + *   'PR_SOURCE': string,
    + *   'PR_STRING': string,
    + *   'PR_TAG': string,
    + *   'PR_TYPE': string,
    + *   'prettyPrintOne': function (string, string, number|boolean),
    + *   'prettyPrint': function (?function, ?(HTMLElement|HTMLDocument))
    + * }}
    + * @const
    + */
    +var PR;
    +
    +/**
    + * Split {@code prettyPrint} into multiple timeouts so as not to interfere with
    + * UI events.
    + * If set to {@code false}, {@code prettyPrint()} is synchronous.
    + */
    +window['PR_SHOULD_USE_CONTINUATION'] = true;
    +
    +/**
    + * Pretty print a chunk of code.
    + * @param {string} sourceCodeHtml The HTML to pretty print.
    + * @param {string} opt_langExtension The language name to use.
    + *     Typically, a filename extension like 'cpp' or 'java'.
    + * @param {number|boolean} opt_numberLines True to number lines,
    + *     or the 1-indexed number of the first line in sourceCodeHtml.
    + * @return {string} code as html, but prettier
    + */
    +var prettyPrintOne;
    +/**
    + * Find all the {@code <pre>} and {@code <code>} tags in the DOM with
    + * {@code class=prettyprint} and prettify them.
    + *
    + * @param {Function} opt_whenDone called when prettifying is done.
    + * @param {HTMLElement|HTMLDocument} opt_root an element or document
    + *   containing all the elements to pretty print.
    + *   Defaults to {@code document.body}.
    + */
    +var prettyPrint;
    +
    +
    +(function () {
    +  var win = window;
    +  // Keyword lists for various languages.
    +  // We use things that coerce to strings to make them compact when minified
    +  // and to defeat aggressive optimizers that fold large string constants.
    +  var FLOW_CONTROL_KEYWORDS = ["break,continue,do,else,for,if,return,while"];
    +  var C_KEYWORDS = [FLOW_CONTROL_KEYWORDS,"auto,case,char,const,default," +
    +      "double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed," +
    +      "sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];
    +  var COMMON_KEYWORDS = [C_KEYWORDS,"catch,class,delete,false,import," +
    +      "new,operator,private,protected,public,this,throw,true,try,typeof"];
    +  var CPP_KEYWORDS = [COMMON_KEYWORDS,"alignas,alignof,align_union,asm,axiom,bool," +
    +      "concept,concept_map,const_cast,constexpr,decltype,delegate," +
    +      "dynamic_cast,explicit,export,friend,generic,late_check," +
    +      "mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert," +
    +      "static_cast,template,typeid,typename,using,virtual,where"];
    +  var JAVA_KEYWORDS = [COMMON_KEYWORDS,
    +      "abstract,assert,boolean,byte,extends,finally,final,implements,import," +
    +      "instanceof,interface,null,native,package,strictfp,super,synchronized," +
    +      "throws,transient"];
    +  var CSHARP_KEYWORDS = [COMMON_KEYWORDS,
    +      "abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending," +
    +      "dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface," +
    +      "internal,into,is,join,let,lock,null,object,out,override,orderby,params," +
    +      "partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong," +
    +      "unchecked,unsafe,ushort,value,var,virtual,where,yield"];
    +  var COFFEE_KEYWORDS = "all,and,by,catch,class,else,extends,false,finally," +
    +      "for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then," +
    +      "throw,true,try,unless,until,when,while,yes";
    +  var JSCRIPT_KEYWORDS = [COMMON_KEYWORDS,
    +      "abstract,async,await,constructor,debugger,enum,eval,export,function," +
    +      "get,implements,instanceof,interface,let,null,set,undefined,var,with," +
    +      "yield,Infinity,NaN"];
    +  var PERL_KEYWORDS = "caller,delete,die,do,dump,elsif,eval,exit,foreach,for," +
    +      "goto,if,import,last,local,my,next,no,our,print,package,redo,require," +
    +      "sub,undef,unless,until,use,wantarray,while,BEGIN,END";
    +  var PYTHON_KEYWORDS = [FLOW_CONTROL_KEYWORDS, "and,as,assert,class,def,del," +
    +      "elif,except,exec,finally,from,global,import,in,is,lambda," +
    +      "nonlocal,not,or,pass,print,raise,try,with,yield," +
    +      "False,True,None"];
    +  var RUBY_KEYWORDS = [FLOW_CONTROL_KEYWORDS, "alias,and,begin,case,class," +
    +      "def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo," +
    +      "rescue,retry,self,super,then,true,undef,unless,until,when,yield," +
    +      "BEGIN,END"];
    +  var SH_KEYWORDS = [FLOW_CONTROL_KEYWORDS, "case,done,elif,esac,eval,fi," +
    +      "function,in,local,set,then,until"];
    +  var ALL_KEYWORDS = [
    +      CPP_KEYWORDS, CSHARP_KEYWORDS, JAVA_KEYWORDS, JSCRIPT_KEYWORDS,
    +      PERL_KEYWORDS, PYTHON_KEYWORDS, RUBY_KEYWORDS, SH_KEYWORDS];
    +  var C_TYPES = /^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;
    +
    +  // token style names.  correspond to css classes
    +  /**
    +   * token style for a string literal
    +   * @const
    +   */
    +  var PR_STRING = 'str';
    +  /**
    +   * token style for a keyword
    +   * @const
    +   */
    +  var PR_KEYWORD = 'kwd';
    +  /**
    +   * token style for a comment
    +   * @const
    +   */
    +  var PR_COMMENT = 'com';
    +  /**
    +   * token style for a type
    +   * @const
    +   */
    +  var PR_TYPE = 'typ';
    +  /**
    +   * token style for a literal value.  e.g. 1, null, true.
    +   * @const
    +   */
    +  var PR_LITERAL = 'lit';
    +  /**
    +   * token style for a punctuation string.
    +   * @const
    +   */
    +  var PR_PUNCTUATION = 'pun';
    +  /**
    +   * token style for plain text.
    +   * @const
    +   */
    +  var PR_PLAIN = 'pln';
    +
    +  /**
    +   * token style for an sgml tag.
    +   * @const
    +   */
    +  var PR_TAG = 'tag';
    +  /**
    +   * token style for a markup declaration such as a DOCTYPE.
    +   * @const
    +   */
    +  var PR_DECLARATION = 'dec';
    +  /**
    +   * token style for embedded source.
    +   * @const
    +   */
    +  var PR_SOURCE = 'src';
    +  /**
    +   * token style for an sgml attribute name.
    +   * @const
    +   */
    +  var PR_ATTRIB_NAME = 'atn';
    +  /**
    +   * token style for an sgml attribute value.
    +   * @const
    +   */
    +  var PR_ATTRIB_VALUE = 'atv';
    +
    +  /**
    +   * A class that indicates a section of markup that is not code, e.g. to allow
    +   * embedding of line numbers within code listings.
    +   * @const
    +   */
    +  var PR_NOCODE = 'nocode';
    +
    +  
    +  
    +  /**
    +   * A set of tokens that can precede a regular expression literal in
    +   * javascript
    +   * http://web.archive.org/web/20070717142515/http://www.mozilla.org/js/language/js20/rationale/syntax.html
    +   * has the full list, but I've removed ones that might be problematic when
    +   * seen in languages that don't support regular expression literals.
    +   *
    +   * <p>Specifically, I've removed any keywords that can't precede a regexp
    +   * literal in a syntactically legal javascript program, and I've removed the
    +   * "in" keyword since it's not a keyword in many languages, and might be used
    +   * as a count of inches.
    +   *
    +   * <p>The link above does not accurately describe EcmaScript rules since
    +   * it fails to distinguish between (a=++/b/i) and (a++/b/i) but it works
    +   * very well in practice.
    +   *
    +   * @private
    +   * @const
    +   */
    +  var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*';
    +  
    +  // CAVEAT: this does not properly handle the case where a regular
    +  // expression immediately follows another since a regular expression may
    +  // have flags for case-sensitivity and the like.  Having regexp tokens
    +  // adjacent is not valid in any language I'm aware of, so I'm punting.
    +  // TODO: maybe style special characters inside a regexp as punctuation.
    +
    +  /**
    +   * Given a group of {@link RegExp}s, returns a {@code RegExp} that globally
    +   * matches the union of the sets of strings matched by the input RegExp.
    +   * Since it matches globally, if the input strings have a start-of-input
    +   * anchor (/^.../), it is ignored for the purposes of unioning.
    +   * @param {Array.<RegExp>} regexs non multiline, non-global regexs.
    +   * @return {RegExp} a global regex.
    +   */
    +  function combinePrefixPatterns(regexs) {
    +    var capturedGroupIndex = 0;
    +  
    +    var needToFoldCase = false;
    +    var ignoreCase = false;
    +    for (var i = 0, n = regexs.length; i < n; ++i) {
    +      var regex = regexs[i];
    +      if (regex.ignoreCase) {
    +        ignoreCase = true;
    +      } else if (/[a-z]/i.test(regex.source.replace(
    +                     /\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi, ''))) {
    +        needToFoldCase = true;
    +        ignoreCase = false;
    +        break;
    +      }
    +    }
    +  
    +    var escapeCharToCodeUnit = {
    +      'b': 8,
    +      't': 9,
    +      'n': 0xa,
    +      'v': 0xb,
    +      'f': 0xc,
    +      'r': 0xd
    +    };
    +  
    +    function decodeEscape(charsetPart) {
    +      var cc0 = charsetPart.charCodeAt(0);
    +      if (cc0 !== 92 /* \\ */) {
    +        return cc0;
    +      }
    +      var c1 = charsetPart.charAt(1);
    +      cc0 = escapeCharToCodeUnit[c1];
    +      if (cc0) {
    +        return cc0;
    +      } else if ('0' <= c1 && c1 <= '7') {
    +        return parseInt(charsetPart.substring(1), 8);
    +      } else if (c1 === 'u' || c1 === 'x') {
    +        return parseInt(charsetPart.substring(2), 16);
    +      } else {
    +        return charsetPart.charCodeAt(1);
    +      }
    +    }
    +  
    +    function encodeEscape(charCode) {
    +      if (charCode < 0x20) {
    +        return (charCode < 0x10 ? '\\x0' : '\\x') + charCode.toString(16);
    +      }
    +      var ch = String.fromCharCode(charCode);
    +      return (ch === '\\' || ch === '-' || ch === ']' || ch === '^')
    +          ? "\\" + ch : ch;
    +    }
    +  
    +    function caseFoldCharset(charSet) {
    +      var charsetParts = charSet.substring(1, charSet.length - 1).match(
    +          new RegExp(
    +              '\\\\u[0-9A-Fa-f]{4}'
    +              + '|\\\\x[0-9A-Fa-f]{2}'
    +              + '|\\\\[0-3][0-7]{0,2}'
    +              + '|\\\\[0-7]{1,2}'
    +              + '|\\\\[\\s\\S]'
    +              + '|-'
    +              + '|[^-\\\\]',
    +              'g'));
    +      var ranges = [];
    +      var inverse = charsetParts[0] === '^';
    +  
    +      var out = ['['];
    +      if (inverse) { out.push('^'); }
    +  
    +      for (var i = inverse ? 1 : 0, n = charsetParts.length; i < n; ++i) {
    +        var p = charsetParts[i];
    +        if (/\\[bdsw]/i.test(p)) {  // Don't muck with named groups.
    +          out.push(p);
    +        } else {
    +          var start = decodeEscape(p);
    +          var end;
    +          if (i + 2 < n && '-' === charsetParts[i + 1]) {
    +            end = decodeEscape(charsetParts[i + 2]);
    +            i += 2;
    +          } else {
    +            end = start;
    +          }
    +          ranges.push([start, end]);
    +          // If the range might intersect letters, then expand it.
    +          // This case handling is too simplistic.
    +          // It does not deal with non-latin case folding.
    +          // It works for latin source code identifiers though.
    +          if (!(end < 65 || start > 122)) {
    +            if (!(end < 65 || start > 90)) {
    +              ranges.push([Math.max(65, start) | 32, Math.min(end, 90) | 32]);
    +            }
    +            if (!(end < 97 || start > 122)) {
    +              ranges.push([Math.max(97, start) & ~32, Math.min(end, 122) & ~32]);
    +            }
    +          }
    +        }
    +      }
    +  
    +      // [[1, 10], [3, 4], [8, 12], [14, 14], [16, 16], [17, 17]]
    +      // -> [[1, 12], [14, 14], [16, 17]]
    +      ranges.sort(function (a, b) { return (a[0] - b[0]) || (b[1]  - a[1]); });
    +      var consolidatedRanges = [];
    +      var lastRange = [];
    +      for (var i = 0; i < ranges.length; ++i) {
    +        var range = ranges[i];
    +        if (range[0] <= lastRange[1] + 1) {
    +          lastRange[1] = Math.max(lastRange[1], range[1]);
    +        } else {
    +          consolidatedRanges.push(lastRange = range);
    +        }
    +      }
    +  
    +      for (var i = 0; i < consolidatedRanges.length; ++i) {
    +        var range = consolidatedRanges[i];
    +        out.push(encodeEscape(range[0]));
    +        if (range[1] > range[0]) {
    +          if (range[1] + 1 > range[0]) { out.push('-'); }
    +          out.push(encodeEscape(range[1]));
    +        }
    +      }
    +      out.push(']');
    +      return out.join('');
    +    }
    +  
    +    function allowAnywhereFoldCaseAndRenumberGroups(regex) {
    +      // Split into character sets, escape sequences, punctuation strings
    +      // like ('(', '(?:', ')', '^'), and runs of characters that do not
    +      // include any of the above.
    +      var parts = regex.source.match(
    +          new RegExp(
    +              '(?:'
    +              + '\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]'  // a character set
    +              + '|\\\\u[A-Fa-f0-9]{4}'  // a unicode escape
    +              + '|\\\\x[A-Fa-f0-9]{2}'  // a hex escape
    +              + '|\\\\[0-9]+'  // a back-reference or octal escape
    +              + '|\\\\[^ux0-9]'  // other escape sequence
    +              + '|\\(\\?[:!=]'  // start of a non-capturing group
    +              + '|[\\(\\)\\^]'  // start/end of a group, or line start
    +              + '|[^\\x5B\\x5C\\(\\)\\^]+'  // run of other characters
    +              + ')',
    +              'g'));
    +      var n = parts.length;
    +  
    +      // Maps captured group numbers to the number they will occupy in
    +      // the output or to -1 if that has not been determined, or to
    +      // undefined if they need not be capturing in the output.
    +      var capturedGroups = [];
    +  
    +      // Walk over and identify back references to build the capturedGroups
    +      // mapping.
    +      for (var i = 0, groupIndex = 0; i < n; ++i) {
    +        var p = parts[i];
    +        if (p === '(') {
    +          // groups are 1-indexed, so max group index is count of '('
    +          ++groupIndex;
    +        } else if ('\\' === p.charAt(0)) {
    +          var decimalValue = +p.substring(1);
    +          if (decimalValue) {
    +            if (decimalValue <= groupIndex) {
    +              capturedGroups[decimalValue] = -1;
    +            } else {
    +              // Replace with an unambiguous escape sequence so that
    +              // an octal escape sequence does not turn into a backreference
    +              // to a capturing group from an earlier regex.
    +              parts[i] = encodeEscape(decimalValue);
    +            }
    +          }
    +        }
    +      }
    +  
    +      // Renumber groups and reduce capturing groups to non-capturing groups
    +      // where possible.
    +      for (var i = 1; i < capturedGroups.length; ++i) {
    +        if (-1 === capturedGroups[i]) {
    +          capturedGroups[i] = ++capturedGroupIndex;
    +        }
    +      }
    +      for (var i = 0, groupIndex = 0; i < n; ++i) {
    +        var p = parts[i];
    +        if (p === '(') {
    +          ++groupIndex;
    +          if (!capturedGroups[groupIndex]) {
    +            parts[i] = '(?:';
    +          }
    +        } else if ('\\' === p.charAt(0)) {
    +          var decimalValue = +p.substring(1);
    +          if (decimalValue && decimalValue <= groupIndex) {
    +            parts[i] = '\\' + capturedGroups[decimalValue];
    +          }
    +        }
    +      }
    +  
    +      // Remove any prefix anchors so that the output will match anywhere.
    +      // ^^ really does mean an anchored match though.
    +      for (var i = 0; i < n; ++i) {
    +        if ('^' === parts[i] && '^' !== parts[i + 1]) { parts[i] = ''; }
    +      }
    +  
    +      // Expand letters to groups to handle mixing of case-sensitive and
    +      // case-insensitive patterns if necessary.
    +      if (regex.ignoreCase && needToFoldCase) {
    +        for (var i = 0; i < n; ++i) {
    +          var p = parts[i];
    +          var ch0 = p.charAt(0);
    +          if (p.length >= 2 && ch0 === '[') {
    +            parts[i] = caseFoldCharset(p);
    +          } else if (ch0 !== '\\') {
    +            // TODO: handle letters in numeric escapes.
    +            parts[i] = p.replace(
    +                /[a-zA-Z]/g,
    +                function (ch) {
    +                  var cc = ch.charCodeAt(0);
    +                  return '[' + String.fromCharCode(cc & ~32, cc | 32) + ']';
    +                });
    +          }
    +        }
    +      }
    +  
    +      return parts.join('');
    +    }
    +  
    +    var rewritten = [];
    +    for (var i = 0, n = regexs.length; i < n; ++i) {
    +      var regex = regexs[i];
    +      if (regex.global || regex.multiline) { throw new Error('' + regex); }
    +      rewritten.push(
    +          '(?:' + allowAnywhereFoldCaseAndRenumberGroups(regex) + ')');
    +    }
    +  
    +    return new RegExp(rewritten.join('|'), ignoreCase ? 'gi' : 'g');
    +  }
    +
    +  /**
    +   * Split markup into a string of source code and an array mapping ranges in
    +   * that string to the text nodes in which they appear.
    +   *
    +   * <p>
    +   * The HTML DOM structure:</p>
    +   * <pre>
    +   * (Element   "p"
    +   *   (Element "b"
    +   *     (Text  "print "))       ; #1
    +   *   (Text    "'Hello '")      ; #2
    +   *   (Element "br")            ; #3
    +   *   (Text    "  + 'World';")) ; #4
    +   * </pre>
    +   * <p>
    +   * corresponds to the HTML
    +   * {@code <p><b>print </b>'Hello '<br>  + 'World';</p>}.</p>
    +   *
    +   * <p>
    +   * It will produce the output:</p>
    +   * <pre>
    +   * {
    +   *   sourceCode: "print 'Hello '\n  + 'World';",
    +   *   //                     1          2
    +   *   //           012345678901234 5678901234567
    +   *   spans: [0, #1, 6, #2, 14, #3, 15, #4]
    +   * }
    +   * </pre>
    +   * <p>
    +   * where #1 is a reference to the {@code "print "} text node above, and so
    +   * on for the other text nodes.
    +   * </p>
    +   *
    +   * <p>
    +   * The {@code} spans array is an array of pairs.  Even elements are the start
    +   * indices of substrings, and odd elements are the text nodes (or BR elements)
    +   * that contain the text for those substrings.
    +   * Substrings continue until the next index or the end of the source.
    +   * </p>
    +   *
    +   * @param {Node} node an HTML DOM subtree containing source-code.
    +   * @param {boolean|number} isPreformatted truthy if white-space in
    +   *    text nodes should be considered significant.
    +   * @return {SourceSpansT} source code and the nodes in which they occur.
    +   */
    +  function extractSourceSpans(node, isPreformatted) {
    +    var nocode = /(?:^|\s)nocode(?:\s|$)/;
    +  
    +    var chunks = [];
    +    var length = 0;
    +    var spans = [];
    +    var k = 0;
    +  
    +    function walk(node) {
    +      var type = node.nodeType;
    +      if (type == 1) {  // Element
    +        if (nocode.test(node.className)) { return; }
    +        for (var child = node.firstChild; child; child = child.nextSibling) {
    +          walk(child);
    +        }
    +        var nodeName = node.nodeName.toLowerCase();
    +        if ('br' === nodeName || 'li' === nodeName) {
    +          chunks[k] = '\n';
    +          spans[k << 1] = length++;
    +          spans[(k++ << 1) | 1] = node;
    +        }
    +      } else if (type == 3 || type == 4) {  // Text
    +        var text = node.nodeValue;
    +        if (text.length) {
    +          if (!isPreformatted) {
    +            text = text.replace(/[ \t\r\n]+/g, ' ');
    +          } else {
    +            text = text.replace(/\r\n?/g, '\n');  // Normalize newlines.
    +          }
    +          // TODO: handle tabs here?
    +          chunks[k] = text;
    +          spans[k << 1] = length;
    +          length += text.length;
    +          spans[(k++ << 1) | 1] = node;
    +        }
    +      }
    +    }
    +  
    +    walk(node);
    +  
    +    return {
    +      sourceCode: chunks.join('').replace(/\n$/, ''),
    +      spans: spans
    +    };
    +  }
    +
    +  /**
    +   * Apply the given language handler to sourceCode and add the resulting
    +   * decorations to out.
    +   * @param {!Element} sourceNode
    +   * @param {number} basePos the index of sourceCode within the chunk of source
    +   *    whose decorations are already present on out.
    +   * @param {string} sourceCode
    +   * @param {function(JobT)} langHandler
    +   * @param {DecorationsT} out
    +   */
    +  function appendDecorations(
    +      sourceNode, basePos, sourceCode, langHandler, out) {
    +    if (!sourceCode) { return; }
    +    /** @type {JobT} */
    +    var job = {
    +      sourceNode: sourceNode,
    +      pre: 1,
    +      langExtension: null,
    +      numberLines: null,
    +      sourceCode: sourceCode,
    +      spans: null,
    +      basePos: basePos,
    +      decorations: null
    +    };
    +    langHandler(job);
    +    out.push.apply(out, job.decorations);
    +  }
    +
    +  var notWs = /\S/;
    +
    +  /**
    +   * Given an element, if it contains only one child element and any text nodes
    +   * it contains contain only space characters, return the sole child element.
    +   * Otherwise returns undefined.
    +   * <p>
    +   * This is meant to return the CODE element in {@code <pre><code ...>} when
    +   * there is a single child element that contains all the non-space textual
    +   * content, but not to return anything where there are multiple child elements
    +   * as in {@code <pre><code>...</code><code>...</code></pre>} or when there
    +   * is textual content.
    +   */
    +  function childContentWrapper(element) {
    +    var wrapper = undefined;
    +    for (var c = element.firstChild; c; c = c.nextSibling) {
    +      var type = c.nodeType;
    +      wrapper = (type === 1)  // Element Node
    +          ? (wrapper ? element : c)
    +          : (type === 3)  // Text Node
    +          ? (notWs.test(c.nodeValue) ? element : wrapper)
    +          : wrapper;
    +    }
    +    return wrapper === element ? undefined : wrapper;
    +  }
    +
    +  /** Given triples of [style, pattern, context] returns a lexing function,
    +    * The lexing function interprets the patterns to find token boundaries and
    +    * returns a decoration list of the form
    +    * [index_0, style_0, index_1, style_1, ..., index_n, style_n]
    +    * where index_n is an index into the sourceCode, and style_n is a style
    +    * constant like PR_PLAIN.  index_n-1 <= index_n, and style_n-1 applies to
    +    * all characters in sourceCode[index_n-1:index_n].
    +    *
    +    * The stylePatterns is a list whose elements have the form
    +    * [style : string, pattern : RegExp, DEPRECATED, shortcut : string].
    +    *
    +    * Style is a style constant like PR_PLAIN, or can be a string of the
    +    * form 'lang-FOO', where FOO is a language extension describing the
    +    * language of the portion of the token in $1 after pattern executes.
    +    * E.g., if style is 'lang-lisp', and group 1 contains the text
    +    * '(hello (world))', then that portion of the token will be passed to the
    +    * registered lisp handler for formatting.
    +    * The text before and after group 1 will be restyled using this decorator
    +    * so decorators should take care that this doesn't result in infinite
    +    * recursion.  For example, the HTML lexer rule for SCRIPT elements looks
    +    * something like ['lang-js', /<[s]cript>(.+?)<\/script>/].  This may match
    +    * '<script>foo()<\/script>', which would cause the current decorator to
    +    * be called with '<script>' which would not match the same rule since
    +    * group 1 must not be empty, so it would be instead styled as PR_TAG by
    +    * the generic tag rule.  The handler registered for the 'js' extension would
    +    * then be called with 'foo()', and finally, the current decorator would
    +    * be called with '<\/script>' which would not match the original rule and
    +    * so the generic tag rule would identify it as a tag.
    +    *
    +    * Pattern must only match prefixes, and if it matches a prefix, then that
    +    * match is considered a token with the same style.
    +    *
    +    * Context is applied to the last non-whitespace, non-comment token
    +    * recognized.
    +    *
    +    * Shortcut is an optional string of characters, any of which, if the first
    +    * character, gurantee that this pattern and only this pattern matches.
    +    *
    +    * @param {Array} shortcutStylePatterns patterns that always start with
    +    *   a known character.  Must have a shortcut string.
    +    * @param {Array} fallthroughStylePatterns patterns that will be tried in
    +    *   order if the shortcut ones fail.  May have shortcuts.
    +    *
    +    * @return {function (JobT)} a function that takes an undecorated job and
    +    *   attaches a list of decorations.
    +    */
    +  function createSimpleLexer(shortcutStylePatterns, fallthroughStylePatterns) {
    +    var shortcuts = {};
    +    var tokenizer;
    +    (function () {
    +      var allPatterns = shortcutStylePatterns.concat(fallthroughStylePatterns);
    +      var allRegexs = [];
    +      var regexKeys = {};
    +      for (var i = 0, n = allPatterns.length; i < n; ++i) {
    +        var patternParts = allPatterns[i];
    +        var shortcutChars = patternParts[3];
    +        if (shortcutChars) {
    +          for (var c = shortcutChars.length; --c >= 0;) {
    +            shortcuts[shortcutChars.charAt(c)] = patternParts;
    +          }
    +        }
    +        var regex = patternParts[1];
    +        var k = '' + regex;
    +        if (!regexKeys.hasOwnProperty(k)) {
    +          allRegexs.push(regex);
    +          regexKeys[k] = null;
    +        }
    +      }
    +      allRegexs.push(/[\0-\uffff]/);
    +      tokenizer = combinePrefixPatterns(allRegexs);
    +    })();
    +
    +    var nPatterns = fallthroughStylePatterns.length;
    +
    +    /**
    +     * Lexes job.sourceCode and attaches an output array job.decorations of
    +     * style classes preceded by the position at which they start in
    +     * job.sourceCode in order.
    +     *
    +     * @type{function (JobT)}
    +     */
    +    var decorate = function (job) {
    +      var sourceCode = job.sourceCode, basePos = job.basePos;
    +      var sourceNode = job.sourceNode;
    +      /** Even entries are positions in source in ascending order.  Odd enties
    +        * are style markers (e.g., PR_COMMENT) that run from that position until
    +        * the end.
    +        * @type {DecorationsT}
    +        */
    +      var decorations = [basePos, PR_PLAIN];
    +      var pos = 0;  // index into sourceCode
    +      var tokens = sourceCode.match(tokenizer) || [];
    +      var styleCache = {};
    +
    +      for (var ti = 0, nTokens = tokens.length; ti < nTokens; ++ti) {
    +        var token = tokens[ti];
    +        var style = styleCache[token];
    +        var match = void 0;
    +
    +        var isEmbedded;
    +        if (typeof style === 'string') {
    +          isEmbedded = false;
    +        } else {
    +          var patternParts = shortcuts[token.charAt(0)];
    +          if (patternParts) {
    +            match = token.match(patternParts[1]);
    +            style = patternParts[0];
    +          } else {
    +            for (var i = 0; i < nPatterns; ++i) {
    +              patternParts = fallthroughStylePatterns[i];
    +              match = token.match(patternParts[1]);
    +              if (match) {
    +                style = patternParts[0];
    +                break;
    +              }
    +            }
    +
    +            if (!match) {  // make sure that we make progress
    +              style = PR_PLAIN;
    +            }
    +          }
    +
    +          isEmbedded = style.length >= 5 && 'lang-' === style.substring(0, 5);
    +          if (isEmbedded && !(match && typeof match[1] === 'string')) {
    +            isEmbedded = false;
    +            style = PR_SOURCE;
    +          }
    +
    +          if (!isEmbedded) { styleCache[token] = style; }
    +        }
    +
    +        var tokenStart = pos;
    +        pos += token.length;
    +
    +        if (!isEmbedded) {
    +          decorations.push(basePos + tokenStart, style);
    +        } else {  // Treat group 1 as an embedded block of source code.
    +          var embeddedSource = match[1];
    +          var embeddedSourceStart = token.indexOf(embeddedSource);
    +          var embeddedSourceEnd = embeddedSourceStart + embeddedSource.length;
    +          if (match[2]) {
    +            // If embeddedSource can be blank, then it would match at the
    +            // beginning which would cause us to infinitely recurse on the
    +            // entire token, so we catch the right context in match[2].
    +            embeddedSourceEnd = token.length - match[2].length;
    +            embeddedSourceStart = embeddedSourceEnd - embeddedSource.length;
    +          }
    +          var lang = style.substring(5);
    +          // Decorate the left of the embedded source
    +          appendDecorations(
    +              sourceNode,
    +              basePos + tokenStart,
    +              token.substring(0, embeddedSourceStart),
    +              decorate, decorations);
    +          // Decorate the embedded source
    +          appendDecorations(
    +              sourceNode,
    +              basePos + tokenStart + embeddedSourceStart,
    +              embeddedSource,
    +              langHandlerForExtension(lang, embeddedSource),
    +              decorations);
    +          // Decorate the right of the embedded section
    +          appendDecorations(
    +              sourceNode,
    +              basePos + tokenStart + embeddedSourceEnd,
    +              token.substring(embeddedSourceEnd),
    +              decorate, decorations);
    +        }
    +      }
    +      job.decorations = decorations;
    +    };
    +    return decorate;
    +  }
    +
    +  /** returns a function that produces a list of decorations from source text.
    +    *
    +    * This code treats ", ', and ` as string delimiters, and \ as a string
    +    * escape.  It does not recognize perl's qq() style strings.
    +    * It has no special handling for double delimiter escapes as in basic, or
    +    * the tripled delimiters used in python, but should work on those regardless
    +    * although in those cases a single string literal may be broken up into
    +    * multiple adjacent string literals.
    +    *
    +    * It recognizes C, C++, and shell style comments.
    +    *
    +    * @param {Object} options a set of optional parameters.
    +    * @return {function (JobT)} a function that examines the source code
    +    *     in the input job and builds a decoration list which it attaches to
    +    *     the job.
    +    */
    +  function sourceDecorator(options) {
    +    var shortcutStylePatterns = [], fallthroughStylePatterns = [];
    +    if (options['tripleQuotedStrings']) {
    +      // '''multi-line-string''', 'single-line-string', and double-quoted
    +      shortcutStylePatterns.push(
    +          [PR_STRING,  /^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,
    +           null, '\'"']);
    +    } else if (options['multiLineStrings']) {
    +      // 'multi-line-string', "multi-line-string"
    +      shortcutStylePatterns.push(
    +          [PR_STRING,  /^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,
    +           null, '\'"`']);
    +    } else {
    +      // 'single-line-string', "single-line-string"
    +      shortcutStylePatterns.push(
    +          [PR_STRING,
    +           /^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,
    +           null, '"\'']);
    +    }
    +    if (options['verbatimStrings']) {
    +      // verbatim-string-literal production from the C# grammar.  See issue 93.
    +      fallthroughStylePatterns.push(
    +          [PR_STRING, /^@\"(?:[^\"]|\"\")*(?:\"|$)/, null]);
    +    }
    +    var hc = options['hashComments'];
    +    if (hc) {
    +      if (options['cStyleComments']) {
    +        if (hc > 1) {  // multiline hash comments
    +          shortcutStylePatterns.push(
    +              [PR_COMMENT, /^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/, null, '#']);
    +        } else {
    +          // Stop C preprocessor declarations at an unclosed open comment
    +          shortcutStylePatterns.push(
    +              [PR_COMMENT, /^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,
    +               null, '#']);
    +        }
    +        // #include <stdio.h>
    +        fallthroughStylePatterns.push(
    +            [PR_STRING,
    +             /^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,
    +             null]);
    +      } else {
    +        shortcutStylePatterns.push([PR_COMMENT, /^#[^\r\n]*/, null, '#']);
    +      }
    +    }
    +    if (options['cStyleComments']) {
    +      fallthroughStylePatterns.push([PR_COMMENT, /^\/\/[^\r\n]*/, null]);
    +      fallthroughStylePatterns.push(
    +          [PR_COMMENT, /^\/\*[\s\S]*?(?:\*\/|$)/, null]);
    +    }
    +    var regexLiterals = options['regexLiterals'];
    +    if (regexLiterals) {
    +      /**
    +       * @const
    +       */
    +      var regexExcls = regexLiterals > 1
    +        ? ''  // Multiline regex literals
    +        : '\n\r';
    +      /**
    +       * @const
    +       */
    +      var regexAny = regexExcls ? '.' : '[\\S\\s]';
    +      /**
    +       * @const
    +       */
    +      var REGEX_LITERAL = (
    +          // A regular expression literal starts with a slash that is
    +          // not followed by * or / so that it is not confused with
    +          // comments.
    +          '/(?=[^/*' + regexExcls + '])'
    +          // and then contains any number of raw characters,
    +          + '(?:[^/\\x5B\\x5C' + regexExcls + ']'
    +          // escape sequences (\x5C),
    +          +    '|\\x5C' + regexAny
    +          // or non-nesting character sets (\x5B\x5D);
    +          +    '|\\x5B(?:[^\\x5C\\x5D' + regexExcls + ']'
    +          +             '|\\x5C' + regexAny + ')*(?:\\x5D|$))+'
    +          // finally closed by a /.
    +          + '/');
    +      fallthroughStylePatterns.push(
    +          ['lang-regex',
    +           RegExp('^' + REGEXP_PRECEDER_PATTERN + '(' + REGEX_LITERAL + ')')
    +           ]);
    +    }
    +
    +    var types = options['types'];
    +    if (types) {
    +      fallthroughStylePatterns.push([PR_TYPE, types]);
    +    }
    +
    +    var keywords = ("" + options['keywords']).replace(/^ | $/g, '');
    +    if (keywords.length) {
    +      fallthroughStylePatterns.push(
    +          [PR_KEYWORD,
    +           new RegExp('^(?:' + keywords.replace(/[\s,]+/g, '|') + ')\\b'),
    +           null]);
    +    }
    +
    +    shortcutStylePatterns.push([PR_PLAIN,       /^\s+/, null, ' \r\n\t\xA0']);
    +
    +    var punctuation =
    +      // The Bash man page says
    +
    +      // A word is a sequence of characters considered as a single
    +      // unit by GRUB. Words are separated by metacharacters,
    +      // which are the following plus space, tab, and newline: { }
    +      // | & $ ; < >
    +      // ...
    +
    +      // A word beginning with # causes that word and all remaining
    +      // characters on that line to be ignored.
    +
    +      // which means that only a '#' after /(?:^|[{}|&$;<>\s])/ starts a
    +      // comment but empirically
    +      // $ echo {#}
    +      // {#}
    +      // $ echo \$#
    +      // $#
    +      // $ echo }#
    +      // }#
    +
    +      // so /(?:^|[|&;<>\s])/ is more appropriate.
    +
    +      // http://gcc.gnu.org/onlinedocs/gcc-2.95.3/cpp_1.html#SEC3
    +      // suggests that this definition is compatible with a
    +      // default mode that tries to use a single token definition
    +      // to recognize both bash/python style comments and C
    +      // preprocessor directives.
    +
    +      // This definition of punctuation does not include # in the list of
    +      // follow-on exclusions, so # will not be broken before if preceeded
    +      // by a punctuation character.  We could try to exclude # after
    +      // [|&;<>] but that doesn't seem to cause many major problems.
    +      // If that does turn out to be a problem, we should change the below
    +      // when hc is truthy to include # in the run of punctuation characters
    +      // only when not followint [|&;<>].
    +      '^.[^\\s\\w.$@\'"`/\\\\]*';
    +    if (options['regexLiterals']) {
    +      punctuation += '(?!\s*\/)';
    +    }
    +
    +    fallthroughStylePatterns.push(
    +        // TODO(mikesamuel): recognize non-latin letters and numerals in idents
    +        [PR_LITERAL,     /^@[a-z_$][a-z_$@0-9]*/i, null],
    +        [PR_TYPE,        /^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/, null],
    +        [PR_PLAIN,       /^[a-z_$][a-z_$@0-9]*/i, null],
    +        [PR_LITERAL,
    +         new RegExp(
    +             '^(?:'
    +             // A hex number
    +             + '0x[a-f0-9]+'
    +             // or an octal or decimal number,
    +             + '|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)'
    +             // possibly in scientific notation
    +             + '(?:e[+\\-]?\\d+)?'
    +             + ')'
    +             // with an optional modifier like UL for unsigned long
    +             + '[a-z]*', 'i'),
    +         null, '0123456789'],
    +        // Don't treat escaped quotes in bash as starting strings.
    +        // See issue 144.
    +        [PR_PLAIN,       /^\\[\s\S]?/, null],
    +        [PR_PUNCTUATION, new RegExp(punctuation), null]);
    +
    +    return createSimpleLexer(shortcutStylePatterns, fallthroughStylePatterns);
    +  }
    +
    +  var decorateSource = sourceDecorator({
    +        'keywords': ALL_KEYWORDS,
    +        'hashComments': true,
    +        'cStyleComments': true,
    +        'multiLineStrings': true,
    +        'regexLiterals': true
    +      });
    +
    +  /**
    +   * Given a DOM subtree, wraps it in a list, and puts each line into its own
    +   * list item.
    +   *
    +   * @param {Node} node modified in place.  Its content is pulled into an
    +   *     HTMLOListElement, and each line is moved into a separate list item.
    +   *     This requires cloning elements, so the input might not have unique
    +   *     IDs after numbering.
    +   * @param {number|null|boolean} startLineNum
    +   *     If truthy, coerced to an integer which is the 1-indexed line number
    +   *     of the first line of code.  The number of the first line will be
    +   *     attached to the list.
    +   * @param {boolean} isPreformatted true iff white-space in text nodes should
    +   *     be treated as significant.
    +   */
    +  function numberLines(node, startLineNum, isPreformatted) {
    +    var nocode = /(?:^|\s)nocode(?:\s|$)/;
    +    var lineBreak = /\r\n?|\n/;
    +  
    +    var document = node.ownerDocument;
    +  
    +    var li = document.createElement('li');
    +    while (node.firstChild) {
    +      li.appendChild(node.firstChild);
    +    }
    +    // An array of lines.  We split below, so this is initialized to one
    +    // un-split line.
    +    var listItems = [li];
    +  
    +    function walk(node) {
    +      var type = node.nodeType;
    +      if (type == 1 && !nocode.test(node.className)) {  // Element
    +        if ('br' === node.nodeName) {
    +          breakAfter(node);
    +          // Discard the <BR> since it is now flush against a </LI>.
    +          if (node.parentNode) {
    +            node.parentNode.removeChild(node);
    +          }
    +        } else {
    +          for (var child = node.firstChild; child; child = child.nextSibling) {
    +            walk(child);
    +          }
    +        }
    +      } else if ((type == 3 || type == 4) && isPreformatted) {  // Text
    +        var text = node.nodeValue;
    +        var match = text.match(lineBreak);
    +        if (match) {
    +          var firstLine = text.substring(0, match.index);
    +          node.nodeValue = firstLine;
    +          var tail = text.substring(match.index + match[0].length);
    +          if (tail) {
    +            var parent = node.parentNode;
    +            parent.insertBefore(
    +              document.createTextNode(tail), node.nextSibling);
    +          }
    +          breakAfter(node);
    +          if (!firstLine) {
    +            // Don't leave blank text nodes in the DOM.
    +            node.parentNode.removeChild(node);
    +          }
    +        }
    +      }
    +    }
    +  
    +    // Split a line after the given node.
    +    function breakAfter(lineEndNode) {
    +      // If there's nothing to the right, then we can skip ending the line
    +      // here, and move root-wards since splitting just before an end-tag
    +      // would require us to create a bunch of empty copies.
    +      while (!lineEndNode.nextSibling) {
    +        lineEndNode = lineEndNode.parentNode;
    +        if (!lineEndNode) { return; }
    +      }
    +  
    +      function breakLeftOf(limit, copy) {
    +        // Clone shallowly if this node needs to be on both sides of the break.
    +        var rightSide = copy ? limit.cloneNode(false) : limit;
    +        var parent = limit.parentNode;
    +        if (parent) {
    +          // We clone the parent chain.
    +          // This helps us resurrect important styling elements that cross lines.
    +          // E.g. in <i>Foo<br>Bar</i>
    +          // should be rewritten to <li><i>Foo</i></li><li><i>Bar</i></li>.
    +          var parentClone = breakLeftOf(parent, 1);
    +          // Move the clone and everything to the right of the original
    +          // onto the cloned parent.
    +          var next = limit.nextSibling;
    +          parentClone.appendChild(rightSide);
    +          for (var sibling = next; sibling; sibling = next) {
    +            next = sibling.nextSibling;
    +            parentClone.appendChild(sibling);
    +          }
    +        }
    +        return rightSide;
    +      }
    +  
    +      var copiedListItem = breakLeftOf(lineEndNode.nextSibling, 0);
    +  
    +      // Walk the parent chain until we reach an unattached LI.
    +      for (var parent;
    +           // Check nodeType since IE invents document fragments.
    +           (parent = copiedListItem.parentNode) && parent.nodeType === 1;) {
    +        copiedListItem = parent;
    +      }
    +      // Put it on the list of lines for later processing.
    +      listItems.push(copiedListItem);
    +    }
    +  
    +    // Split lines while there are lines left to split.
    +    for (var i = 0;  // Number of lines that have been split so far.
    +         i < listItems.length;  // length updated by breakAfter calls.
    +         ++i) {
    +      walk(listItems[i]);
    +    }
    +  
    +    // Make sure numeric indices show correctly.
    +    if (startLineNum === (startLineNum|0)) {
    +      listItems[0].setAttribute('value', startLineNum);
    +    }
    +  
    +    var ol = document.createElement('ol');
    +    ol.className = 'linenums';
    +    var offset = Math.max(0, ((startLineNum - 1 /* zero index */)) | 0) || 0;
    +    for (var i = 0, n = listItems.length; i < n; ++i) {
    +      li = listItems[i];
    +      // Stick a class on the LIs so that stylesheets can
    +      // color odd/even rows, or any other row pattern that
    +      // is co-prime with 10.
    +      li.className = 'L' + ((i + offset) % 10);
    +      if (!li.firstChild) {
    +        li.appendChild(document.createTextNode('\xA0'));
    +      }
    +      ol.appendChild(li);
    +    }
    +  
    +    node.appendChild(ol);
    +  }
    +
    +  /**
    +   * Breaks {@code job.sourceCode} around style boundaries in
    +   * {@code job.decorations} and modifies {@code job.sourceNode} in place.
    +   * @param {JobT} job
    +   * @private
    +   */
    +  function recombineTagsAndDecorations(job) {
    +    var isIE8OrEarlier = /\bMSIE\s(\d+)/.exec(navigator.userAgent);
    +    isIE8OrEarlier = isIE8OrEarlier && +isIE8OrEarlier[1] <= 8;
    +    var newlineRe = /\n/g;
    +  
    +    var source = job.sourceCode;
    +    var sourceLength = source.length;
    +    // Index into source after the last code-unit recombined.
    +    var sourceIndex = 0;
    +  
    +    var spans = job.spans;
    +    var nSpans = spans.length;
    +    // Index into spans after the last span which ends at or before sourceIndex.
    +    var spanIndex = 0;
    +  
    +    var decorations = job.decorations;
    +    var nDecorations = decorations.length;
    +    // Index into decorations after the last decoration which ends at or before
    +    // sourceIndex.
    +    var decorationIndex = 0;
    +  
    +    // Remove all zero-length decorations.
    +    decorations[nDecorations] = sourceLength;
    +    var decPos, i;
    +    for (i = decPos = 0; i < nDecorations;) {
    +      if (decorations[i] !== decorations[i + 2]) {
    +        decorations[decPos++] = decorations[i++];
    +        decorations[decPos++] = decorations[i++];
    +      } else {
    +        i += 2;
    +      }
    +    }
    +    nDecorations = decPos;
    +  
    +    // Simplify decorations.
    +    for (i = decPos = 0; i < nDecorations;) {
    +      var startPos = decorations[i];
    +      // Conflate all adjacent decorations that use the same style.
    +      var startDec = decorations[i + 1];
    +      var end = i + 2;
    +      while (end + 2 <= nDecorations && decorations[end + 1] === startDec) {
    +        end += 2;
    +      }
    +      decorations[decPos++] = startPos;
    +      decorations[decPos++] = startDec;
    +      i = end;
    +    }
    +  
    +    nDecorations = decorations.length = decPos;
    +  
    +    var sourceNode = job.sourceNode;
    +    var oldDisplay = "";
    +    if (sourceNode) {
    +      oldDisplay = sourceNode.style.display;
    +      sourceNode.style.display = 'none';
    +    }
    +    try {
    +      var decoration = null;
    +      while (spanIndex < nSpans) {
    +        var spanStart = spans[spanIndex];
    +        var spanEnd = /** @type{number} */ (spans[spanIndex + 2])
    +            || sourceLength;
    +  
    +        var decEnd = decorations[decorationIndex + 2] || sourceLength;
    +  
    +        var end = Math.min(spanEnd, decEnd);
    +  
    +        var textNode = /** @type{Node} */ (spans[spanIndex + 1]);
    +        var styledText;
    +        if (textNode.nodeType !== 1  // Don't muck with <BR>s or <LI>s
    +            // Don't introduce spans around empty text nodes.
    +            && (styledText = source.substring(sourceIndex, end))) {
    +          // This may seem bizarre, and it is.  Emitting LF on IE causes the
    +          // code to display with spaces instead of line breaks.
    +          // Emitting Windows standard issue linebreaks (CRLF) causes a blank
    +          // space to appear at the beginning of every line but the first.
    +          // Emitting an old Mac OS 9 line separator makes everything spiffy.
    +          if (isIE8OrEarlier) {
    +            styledText = styledText.replace(newlineRe, '\r');
    +          }
    +          textNode.nodeValue = styledText;
    +          var document = textNode.ownerDocument;
    +          var span = document.createElement('span');
    +          span.className = decorations[decorationIndex + 1];
    +          var parentNode = textNode.parentNode;
    +          parentNode.replaceChild(span, textNode);
    +          span.appendChild(textNode);
    +          if (sourceIndex < spanEnd) {  // Split off a text node.
    +            spans[spanIndex + 1] = textNode
    +                // TODO: Possibly optimize by using '' if there's no flicker.
    +                = document.createTextNode(source.substring(end, spanEnd));
    +            parentNode.insertBefore(textNode, span.nextSibling);
    +          }
    +        }
    +  
    +        sourceIndex = end;
    +  
    +        if (sourceIndex >= spanEnd) {
    +          spanIndex += 2;
    +        }
    +        if (sourceIndex >= decEnd) {
    +          decorationIndex += 2;
    +        }
    +      }
    +    } finally {
    +      if (sourceNode) {
    +        sourceNode.style.display = oldDisplay;
    +      }
    +    }
    +  }
    +
    +  /** Maps language-specific file extensions to handlers. */
    +  var langHandlerRegistry = {};
    +  /** Register a language handler for the given file extensions.
    +    * @param {function (JobT)} handler a function from source code to a list
    +    *      of decorations.  Takes a single argument job which describes the
    +    *      state of the computation and attaches the decorations to it.
    +    * @param {Array.<string>} fileExtensions
    +    */
    +  function registerLangHandler(handler, fileExtensions) {
    +    for (var i = fileExtensions.length; --i >= 0;) {
    +      var ext = fileExtensions[i];
    +      if (!langHandlerRegistry.hasOwnProperty(ext)) {
    +        langHandlerRegistry[ext] = handler;
    +      } else if (win['console']) {
    +        console['warn']('cannot override language handler %s', ext);
    +      }
    +    }
    +  }
    +  function langHandlerForExtension(extension, source) {
    +    if (!(extension && langHandlerRegistry.hasOwnProperty(extension))) {
    +      // Treat it as markup if the first non whitespace character is a < and
    +      // the last non-whitespace character is a >.
    +      extension = /^\s*</.test(source)
    +          ? 'default-markup'
    +          : 'default-code';
    +    }
    +    return langHandlerRegistry[extension];
    +  }
    +  registerLangHandler(decorateSource, ['default-code']);
    +  registerLangHandler(
    +      createSimpleLexer(
    +          [],
    +          [
    +           [PR_PLAIN,       /^[^<?]+/],
    +           [PR_DECLARATION, /^<!\w[^>]*(?:>|$)/],
    +           [PR_COMMENT,     /^<\!--[\s\S]*?(?:-\->|$)/],
    +           // Unescaped content in an unknown language
    +           ['lang-',        /^<\?([\s\S]+?)(?:\?>|$)/],
    +           ['lang-',        /^<%([\s\S]+?)(?:%>|$)/],
    +           [PR_PUNCTUATION, /^(?:<[%?]|[%?]>)/],
    +           ['lang-',        /^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],
    +           // Unescaped content in javascript.  (Or possibly vbscript).
    +           ['lang-js',      /^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],
    +           // Contains unescaped stylesheet content
    +           ['lang-css',     /^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],
    +           ['lang-in.tag',  /^(<\/?[a-z][^<>]*>)/i]
    +          ]),
    +      ['default-markup', 'htm', 'html', 'mxml', 'xhtml', 'xml', 'xsl']);
    +  registerLangHandler(
    +      createSimpleLexer(
    +          [
    +           [PR_PLAIN,        /^[\s]+/, null, ' \t\r\n'],
    +           [PR_ATTRIB_VALUE, /^(?:\"[^\"]*\"?|\'[^\']*\'?)/, null, '\"\'']
    +           ],
    +          [
    +           [PR_TAG,          /^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],
    +           [PR_ATTRIB_NAME,  /^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],
    +           ['lang-uq.val',   /^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],
    +           [PR_PUNCTUATION,  /^[=<>\/]+/],
    +           ['lang-js',       /^on\w+\s*=\s*\"([^\"]+)\"/i],
    +           ['lang-js',       /^on\w+\s*=\s*\'([^\']+)\'/i],
    +           ['lang-js',       /^on\w+\s*=\s*([^\"\'>\s]+)/i],
    +           ['lang-css',      /^style\s*=\s*\"([^\"]+)\"/i],
    +           ['lang-css',      /^style\s*=\s*\'([^\']+)\'/i],
    +           ['lang-css',      /^style\s*=\s*([^\"\'>\s]+)/i]
    +           ]),
    +      ['in.tag']);
    +  registerLangHandler(
    +      createSimpleLexer([], [[PR_ATTRIB_VALUE, /^[\s\S]+/]]), ['uq.val']);
    +  registerLangHandler(sourceDecorator({
    +          'keywords': CPP_KEYWORDS,
    +          'hashComments': true,
    +          'cStyleComments': true,
    +          'types': C_TYPES
    +        }), ['c', 'cc', 'cpp', 'cxx', 'cyc', 'm']);
    +  registerLangHandler(sourceDecorator({
    +          'keywords': 'null,true,false'
    +        }), ['json']);
    +  registerLangHandler(sourceDecorator({
    +          'keywords': CSHARP_KEYWORDS,
    +          'hashComments': true,
    +          'cStyleComments': true,
    +          'verbatimStrings': true,
    +          'types': C_TYPES
    +        }), ['cs']);
    +  registerLangHandler(sourceDecorator({
    +          'keywords': JAVA_KEYWORDS,
    +          'cStyleComments': true
    +        }), ['java']);
    +  registerLangHandler(sourceDecorator({
    +          'keywords': SH_KEYWORDS,
    +          'hashComments': true,
    +          'multiLineStrings': true
    +        }), ['bash', 'bsh', 'csh', 'sh']);
    +  registerLangHandler(sourceDecorator({
    +          'keywords': PYTHON_KEYWORDS,
    +          'hashComments': true,
    +          'multiLineStrings': true,
    +          'tripleQuotedStrings': true
    +        }), ['cv', 'py', 'python']);
    +  registerLangHandler(sourceDecorator({
    +          'keywords': PERL_KEYWORDS,
    +          'hashComments': true,
    +          'multiLineStrings': true,
    +          'regexLiterals': 2  // multiline regex literals
    +        }), ['perl', 'pl', 'pm']);
    +  registerLangHandler(sourceDecorator({
    +          'keywords': RUBY_KEYWORDS,
    +          'hashComments': true,
    +          'multiLineStrings': true,
    +          'regexLiterals': true
    +        }), ['rb', 'ruby']);
    +  registerLangHandler(sourceDecorator({
    +          'keywords': JSCRIPT_KEYWORDS,
    +          'cStyleComments': true,
    +          'regexLiterals': true
    +        }), ['javascript', 'js', 'ts', 'typescript']);
    +  registerLangHandler(sourceDecorator({
    +          'keywords': COFFEE_KEYWORDS,
    +          'hashComments': 3,  // ### style block comments
    +          'cStyleComments': true,
    +          'multilineStrings': true,
    +          'tripleQuotedStrings': true,
    +          'regexLiterals': true
    +        }), ['coffee']);
    +  registerLangHandler(
    +      createSimpleLexer([], [[PR_STRING, /^[\s\S]+/]]), ['regex']);
    +
    +  /** @param {JobT} job */
    +  function applyDecorator(job) {
    +    var opt_langExtension = job.langExtension;
    +
    +    try {
    +      // Extract tags, and convert the source code to plain text.
    +      var sourceAndSpans = extractSourceSpans(job.sourceNode, job.pre);
    +      /** Plain text. @type {string} */
    +      var source = sourceAndSpans.sourceCode;
    +      job.sourceCode = source;
    +      job.spans = sourceAndSpans.spans;
    +      job.basePos = 0;
    +
    +      // Apply the appropriate language handler
    +      langHandlerForExtension(opt_langExtension, source)(job);
    +
    +      // Integrate the decorations and tags back into the source code,
    +      // modifying the sourceNode in place.
    +      recombineTagsAndDecorations(job);
    +    } catch (e) {
    +      if (win['console']) {
    +        console['log'](e && e['stack'] || e);
    +      }
    +    }
    +  }
    +
    +  /**
    +   * Pretty print a chunk of code.
    +   * @param sourceCodeHtml {string} The HTML to pretty print.
    +   * @param opt_langExtension {string} The language name to use.
    +   *     Typically, a filename extension like 'cpp' or 'java'.
    +   * @param opt_numberLines {number|boolean} True to number lines,
    +   *     or the 1-indexed number of the first line in sourceCodeHtml.
    +   */
    +  function $prettyPrintOne(sourceCodeHtml, opt_langExtension, opt_numberLines) {
    +    /** @type{number|boolean} */
    +    var nl = opt_numberLines || false;
    +    /** @type{string|null} */
    +    var langExtension = opt_langExtension || null;
    +    /** @type{!Element} */
    +    var container = document.createElement('div');
    +    // This could cause images to load and onload listeners to fire.
    +    // E.g. <img onerror="alert(1337)" src="nosuchimage.png">.
    +    // We assume that the inner HTML is from a trusted source.
    +    // The pre-tag is required for IE8 which strips newlines from innerHTML
    +    // when it is injected into a <pre> tag.
    +    // http://stackoverflow.com/questions/451486/pre-tag-loses-line-breaks-when-setting-innerhtml-in-ie
    +    // http://stackoverflow.com/questions/195363/inserting-a-newline-into-a-pre-tag-ie-javascript
    +    container.innerHTML = '<pre>' + sourceCodeHtml + '</pre>';
    +    container = /** @type{!Element} */(container.firstChild);
    +    if (nl) {
    +      numberLines(container, nl, true);
    +    }
    +
    +    /** @type{JobT} */
    +    var job = {
    +      langExtension: langExtension,
    +      numberLines: nl,
    +      sourceNode: container,
    +      pre: 1,
    +      sourceCode: null,
    +      basePos: null,
    +      spans: null,
    +      decorations: null
    +    };
    +    applyDecorator(job);
    +    return container.innerHTML;
    +  }
    +
    +   /**
    +    * Find all the {@code <pre>} and {@code <code>} tags in the DOM with
    +    * {@code class=prettyprint} and prettify them.
    +    *
    +    * @param {Function} opt_whenDone called when prettifying is done.
    +    * @param {HTMLElement|HTMLDocument} opt_root an element or document
    +    *   containing all the elements to pretty print.
    +    *   Defaults to {@code document.body}.
    +    */
    +  function $prettyPrint(opt_whenDone, opt_root) {
    +    var root = opt_root || document.body;
    +    var doc = root.ownerDocument || document;
    +    function byTagName(tn) { return root.getElementsByTagName(tn); }
    +    // fetch a list of nodes to rewrite
    +    var codeSegments = [byTagName('pre'), byTagName('code'), byTagName('xmp')];
    +    var elements = [];
    +    for (var i = 0; i < codeSegments.length; ++i) {
    +      for (var j = 0, n = codeSegments[i].length; j < n; ++j) {
    +        elements.push(codeSegments[i][j]);
    +      }
    +    }
    +    codeSegments = null;
    +
    +    var clock = Date;
    +    if (!clock['now']) {
    +      clock = { 'now': function () { return +(new Date); } };
    +    }
    +
    +    // The loop is broken into a series of continuations to make sure that we
    +    // don't make the browser unresponsive when rewriting a large page.
    +    var k = 0;
    +
    +    var langExtensionRe = /\blang(?:uage)?-([\w.]+)(?!\S)/;
    +    var prettyPrintRe = /\bprettyprint\b/;
    +    var prettyPrintedRe = /\bprettyprinted\b/;
    +    var preformattedTagNameRe = /pre|xmp/i;
    +    var codeRe = /^code$/i;
    +    var preCodeXmpRe = /^(?:pre|code|xmp)$/i;
    +    var EMPTY = {};
    +
    +    function doWork() {
    +      var endTime = (win['PR_SHOULD_USE_CONTINUATION'] ?
    +                     clock['now']() + 250 /* ms */ :
    +                     Infinity);
    +      for (; k < elements.length && clock['now']() < endTime; k++) {
    +        var cs = elements[k];
    +
    +        // Look for a preceding comment like
    +        // <?prettify lang="..." linenums="..."?>
    +        var attrs = EMPTY;
    +        {
    +          for (var preceder = cs; (preceder = preceder.previousSibling);) {
    +            var nt = preceder.nodeType;
    +            // <?foo?> is parsed by HTML 5 to a comment node (8)
    +            // like <!--?foo?-->, but in XML is a processing instruction
    +            var value = (nt === 7 || nt === 8) && preceder.nodeValue;
    +            if (value
    +                ? !/^\??prettify\b/.test(value)
    +                : (nt !== 3 || /\S/.test(preceder.nodeValue))) {
    +              // Skip over white-space text nodes but not others.
    +              break;
    +            }
    +            if (value) {
    +              attrs = {};
    +              value.replace(
    +                  /\b(\w+)=([\w:.%+-]+)/g,
    +                function (_, name, value) { attrs[name] = value; });
    +              break;
    +            }
    +          }
    +        }
    +
    +        var className = cs.className;
    +        if ((attrs !== EMPTY || prettyPrintRe.test(className))
    +            // Don't redo this if we've already done it.
    +            // This allows recalling pretty print to just prettyprint elements
    +            // that have been added to the page since last call.
    +            && !prettyPrintedRe.test(className)) {
    +
    +          // make sure this is not nested in an already prettified element
    +          var nested = false;
    +          for (var p = cs.parentNode; p; p = p.parentNode) {
    +            var tn = p.tagName;
    +            if (preCodeXmpRe.test(tn)
    +                && p.className && prettyPrintRe.test(p.className)) {
    +              nested = true;
    +              break;
    +            }
    +          }
    +          if (!nested) {
    +            // Mark done.  If we fail to prettyprint for whatever reason,
    +            // we shouldn't try again.
    +            cs.className += ' prettyprinted';
    +
    +            // If the classes includes a language extensions, use it.
    +            // Language extensions can be specified like
    +            //     <pre class="prettyprint lang-cpp">
    +            // the language extension "cpp" is used to find a language handler
    +            // as passed to PR.registerLangHandler.
    +            // HTML5 recommends that a language be specified using "language-"
    +            // as the prefix instead.  Google Code Prettify supports both.
    +            // http://dev.w3.org/html5/spec-author-view/the-code-element.html
    +            var langExtension = attrs['lang'];
    +            if (!langExtension) {
    +              langExtension = className.match(langExtensionRe);
    +              // Support <pre class="prettyprint"><code class="language-c">
    +              var wrapper;
    +              if (!langExtension && (wrapper = childContentWrapper(cs))
    +                  && codeRe.test(wrapper.tagName)) {
    +                langExtension = wrapper.className.match(langExtensionRe);
    +              }
    +
    +              if (langExtension) { langExtension = langExtension[1]; }
    +            }
    +
    +            var preformatted;
    +            if (preformattedTagNameRe.test(cs.tagName)) {
    +              preformatted = 1;
    +            } else {
    +              var currentStyle = cs['currentStyle'];
    +              var defaultView = doc.defaultView;
    +              var whitespace = (
    +                  currentStyle
    +                  ? currentStyle['whiteSpace']
    +                  : (defaultView
    +                     && defaultView.getComputedStyle)
    +                  ? defaultView.getComputedStyle(cs, null)
    +                  .getPropertyValue('white-space')
    +                  : 0);
    +              preformatted = whitespace
    +                  && 'pre' === whitespace.substring(0, 3);
    +            }
    +
    +            // Look for a class like linenums or linenums:<n> where <n> is the
    +            // 1-indexed number of the first line.
    +            var lineNums = attrs['linenums'];
    +            if (!(lineNums = lineNums === 'true' || +lineNums)) {
    +              lineNums = className.match(/\blinenums\b(?::(\d+))?/);
    +              lineNums =
    +                lineNums
    +                ? lineNums[1] && lineNums[1].length
    +                  ? +lineNums[1] : true
    +                : false;
    +            }
    +            if (lineNums) { numberLines(cs, lineNums, preformatted); }
    +
    +            // do the pretty printing
    +            var prettyPrintingJob = {
    +              langExtension: langExtension,
    +              sourceNode: cs,
    +              numberLines: lineNums,
    +              pre: preformatted,
    +              sourceCode: null,
    +              basePos: null,
    +              spans: null,
    +              decorations: null
    +            };
    +            applyDecorator(prettyPrintingJob);
    +          }
    +        }
    +      }
    +      if (k < elements.length) {
    +        // finish up in a continuation
    +        win.setTimeout(doWork, 250);
    +      } else if ('function' === typeof opt_whenDone) {
    +        opt_whenDone();
    +      }
    +    }
    +
    +    doWork();
    +  }
    +
    +  /**
    +   * Contains functions for creating and registering new language handlers.
    +   * @type {Object}
    +   */
    +  var PR = win['PR'] = {
    +        'createSimpleLexer': createSimpleLexer,
    +        'registerLangHandler': registerLangHandler,
    +        'sourceDecorator': sourceDecorator,
    +        'PR_ATTRIB_NAME': PR_ATTRIB_NAME,
    +        'PR_ATTRIB_VALUE': PR_ATTRIB_VALUE,
    +        'PR_COMMENT': PR_COMMENT,
    +        'PR_DECLARATION': PR_DECLARATION,
    +        'PR_KEYWORD': PR_KEYWORD,
    +        'PR_LITERAL': PR_LITERAL,
    +        'PR_NOCODE': PR_NOCODE,
    +        'PR_PLAIN': PR_PLAIN,
    +        'PR_PUNCTUATION': PR_PUNCTUATION,
    +        'PR_SOURCE': PR_SOURCE,
    +        'PR_STRING': PR_STRING,
    +        'PR_TAG': PR_TAG,
    +        'PR_TYPE': PR_TYPE,
    +        'prettyPrintOne':
    +           IN_GLOBAL_SCOPE
    +             ? (win['prettyPrintOne'] = $prettyPrintOne)
    +             : (prettyPrintOne = $prettyPrintOne),
    +        'prettyPrint': prettyPrint =
    +           IN_GLOBAL_SCOPE
    +             ? (win['prettyPrint'] = $prettyPrint)
    +             : (prettyPrint = $prettyPrint)
    +      };
    +
    +  // Make PR available via the Asynchronous Module Definition (AMD) API.
    +  // Per https://github.com/amdjs/amdjs-api/wiki/AMD:
    +  // The Asynchronous Module Definition (AMD) API specifies a
    +  // mechanism for defining modules such that the module and its
    +  // dependencies can be asynchronously loaded.
    +  // ...
    +  // To allow a clear indicator that a global define function (as
    +  // needed for script src browser loading) conforms to the AMD API,
    +  // any global define function SHOULD have a property called "amd"
    +  // whose value is an object. This helps avoid conflict with any
    +  // other existing JavaScript code that could have defined a define()
    +  // function that does not conform to the AMD API.
    +  var define = win['define'];
    +  if (typeof define === "function" && define['amd']) {
    +    define("google-code-prettify", [], function () {
    +      return PR;
    +    });
    +  }
    +})();
    diff --git a/docs/scripts/prettify/Apache-License-2.0.txt b/docs/scripts/prettify/Apache-License-2.0.txt
    new file mode 100644
    index 000000000..d64569567
    --- /dev/null
    +++ b/docs/scripts/prettify/Apache-License-2.0.txt
    @@ -0,0 +1,202 @@
    +
    +                                 Apache License
    +                           Version 2.0, January 2004
    +                        http://www.apache.org/licenses/
    +
    +   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
    +
    +   1. Definitions.
    +
    +      "License" shall mean the terms and conditions for use, reproduction,
    +      and distribution as defined by Sections 1 through 9 of this document.
    +
    +      "Licensor" shall mean the copyright owner or entity authorized by
    +      the copyright owner that is granting the License.
    +
    +      "Legal Entity" shall mean the union of the acting entity and all
    +      other entities that control, are controlled by, or are under common
    +      control with that entity. For the purposes of this definition,
    +      "control" means (i) the power, direct or indirect, to cause the
    +      direction or management of such entity, whether by contract or
    +      otherwise, or (ii) ownership of fifty percent (50%) or more of the
    +      outstanding shares, or (iii) beneficial ownership of such entity.
    +
    +      "You" (or "Your") shall mean an individual or Legal Entity
    +      exercising permissions granted by this License.
    +
    +      "Source" form shall mean the preferred form for making modifications,
    +      including but not limited to software source code, documentation
    +      source, and configuration files.
    +
    +      "Object" form shall mean any form resulting from mechanical
    +      transformation or translation of a Source form, including but
    +      not limited to compiled object code, generated documentation,
    +      and conversions to other media types.
    +
    +      "Work" shall mean the work of authorship, whether in Source or
    +      Object form, made available under the License, as indicated by a
    +      copyright notice that is included in or attached to the work
    +      (an example is provided in the Appendix below).
    +
    +      "Derivative Works" shall mean any work, whether in Source or Object
    +      form, that is based on (or derived from) the Work and for which the
    +      editorial revisions, annotations, elaborations, or other modifications
    +      represent, as a whole, an original work of authorship. For the purposes
    +      of this License, Derivative Works shall not include works that remain
    +      separable from, or merely link (or bind by name) to the interfaces of,
    +      the Work and Derivative Works thereof.
    +
    +      "Contribution" shall mean any work of authorship, including
    +      the original version of the Work and any modifications or additions
    +      to that Work or Derivative Works thereof, that is intentionally
    +      submitted to Licensor for inclusion in the Work by the copyright owner
    +      or by an individual or Legal Entity authorized to submit on behalf of
    +      the copyright owner. For the purposes of this definition, "submitted"
    +      means any form of electronic, verbal, or written communication sent
    +      to the Licensor or its representatives, including but not limited to
    +      communication on electronic mailing lists, source code control systems,
    +      and issue tracking systems that are managed by, or on behalf of, the
    +      Licensor for the purpose of discussing and improving the Work, but
    +      excluding communication that is conspicuously marked or otherwise
    +      designated in writing by the copyright owner as "Not a Contribution."
    +
    +      "Contributor" shall mean Licensor and any individual or Legal Entity
    +      on behalf of whom a Contribution has been received by Licensor and
    +      subsequently incorporated within the Work.
    +
    +   2. Grant of Copyright License. Subject to the terms and conditions of
    +      this License, each Contributor hereby grants to You a perpetual,
    +      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
    +      copyright license to reproduce, prepare Derivative Works of,
    +      publicly display, publicly perform, sublicense, and distribute the
    +      Work and such Derivative Works in Source or Object form.
    +
    +   3. Grant of Patent License. Subject to the terms and conditions of
    +      this License, each Contributor hereby grants to You a perpetual,
    +      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
    +      (except as stated in this section) patent license to make, have made,
    +      use, offer to sell, sell, import, and otherwise transfer the Work,
    +      where such license applies only to those patent claims licensable
    +      by such Contributor that are necessarily infringed by their
    +      Contribution(s) alone or by combination of their Contribution(s)
    +      with the Work to which such Contribution(s) was submitted. If You
    +      institute patent litigation against any entity (including a
    +      cross-claim or counterclaim in a lawsuit) alleging that the Work
    +      or a Contribution incorporated within the Work constitutes direct
    +      or contributory patent infringement, then any patent licenses
    +      granted to You under this License for that Work shall terminate
    +      as of the date such litigation is filed.
    +
    +   4. Redistribution. You may reproduce and distribute copies of the
    +      Work or Derivative Works thereof in any medium, with or without
    +      modifications, and in Source or Object form, provided that You
    +      meet the following conditions:
    +
    +      (a) You must give any other recipients of the Work or
    +          Derivative Works a copy of this License; and
    +
    +      (b) You must cause any modified files to carry prominent notices
    +          stating that You changed the files; and
    +
    +      (c) You must retain, in the Source form of any Derivative Works
    +          that You distribute, all copyright, patent, trademark, and
    +          attribution notices from the Source form of the Work,
    +          excluding those notices that do not pertain to any part of
    +          the Derivative Works; and
    +
    +      (d) If the Work includes a "NOTICE" text file as part of its
    +          distribution, then any Derivative Works that You distribute must
    +          include a readable copy of the attribution notices contained
    +          within such NOTICE file, excluding those notices that do not
    +          pertain to any part of the Derivative Works, in at least one
    +          of the following places: within a NOTICE text file distributed
    +          as part of the Derivative Works; within the Source form or
    +          documentation, if provided along with the Derivative Works; or,
    +          within a display generated by the Derivative Works, if and
    +          wherever such third-party notices normally appear. The contents
    +          of the NOTICE file are for informational purposes only and
    +          do not modify the License. You may add Your own attribution
    +          notices within Derivative Works that You distribute, alongside
    +          or as an addendum to the NOTICE text from the Work, provided
    +          that such additional attribution notices cannot be construed
    +          as modifying the License.
    +
    +      You may add Your own copyright statement to Your modifications and
    +      may provide additional or different license terms and conditions
    +      for use, reproduction, or distribution of Your modifications, or
    +      for any such Derivative Works as a whole, provided Your use,
    +      reproduction, and distribution of the Work otherwise complies with
    +      the conditions stated in this License.
    +
    +   5. Submission of Contributions. Unless You explicitly state otherwise,
    +      any Contribution intentionally submitted for inclusion in the Work
    +      by You to the Licensor shall be under the terms and conditions of
    +      this License, without any additional terms or conditions.
    +      Notwithstanding the above, nothing herein shall supersede or modify
    +      the terms of any separate license agreement you may have executed
    +      with Licensor regarding such Contributions.
    +
    +   6. Trademarks. This License does not grant permission to use the trade
    +      names, trademarks, service marks, or product names of the Licensor,
    +      except as required for reasonable and customary use in describing the
    +      origin of the Work and reproducing the content of the NOTICE file.
    +
    +   7. Disclaimer of Warranty. Unless required by applicable law or
    +      agreed to in writing, Licensor provides the Work (and each
    +      Contributor provides its Contributions) on an "AS IS" BASIS,
    +      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
    +      implied, including, without limitation, any warranties or conditions
    +      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
    +      PARTICULAR PURPOSE. You are solely responsible for determining the
    +      appropriateness of using or redistributing the Work and assume any
    +      risks associated with Your exercise of permissions under this License.
    +
    +   8. Limitation of Liability. In no event and under no legal theory,
    +      whether in tort (including negligence), contract, or otherwise,
    +      unless required by applicable law (such as deliberate and grossly
    +      negligent acts) or agreed to in writing, shall any Contributor be
    +      liable to You for damages, including any direct, indirect, special,
    +      incidental, or consequential damages of any character arising as a
    +      result of this License or out of the use or inability to use the
    +      Work (including but not limited to damages for loss of goodwill,
    +      work stoppage, computer failure or malfunction, or any and all
    +      other commercial damages or losses), even if such Contributor
    +      has been advised of the possibility of such damages.
    +
    +   9. Accepting Warranty or Additional Liability. While redistributing
    +      the Work or Derivative Works thereof, You may choose to offer,
    +      and charge a fee for, acceptance of support, warranty, indemnity,
    +      or other liability obligations and/or rights consistent with this
    +      License. However, in accepting such obligations, You may act only
    +      on Your own behalf and on Your sole responsibility, not on behalf
    +      of any other Contributor, and only if You agree to indemnify,
    +      defend, and hold each Contributor harmless for any liability
    +      incurred by, or claims asserted against, such Contributor by reason
    +      of your accepting any such warranty or additional liability.
    +
    +   END OF TERMS AND CONDITIONS
    +
    +   APPENDIX: How to apply the Apache License to your work.
    +
    +      To apply the Apache License to your work, attach the following
    +      boilerplate notice, with the fields enclosed by brackets "[]"
    +      replaced with your own identifying information. (Don't include
    +      the brackets!)  The text should be enclosed in the appropriate
    +      comment syntax for the file format. We also recommend that a
    +      file or class name and description of purpose be included on the
    +      same "printed page" as the copyright notice for easier
    +      identification within third-party archives.
    +
    +   Copyright [yyyy] [name of copyright owner]
    +
    +   Licensed under the Apache License, Version 2.0 (the "License");
    +   you may not use this file except in compliance with the License.
    +   You may obtain a copy of the License at
    +
    +       http://www.apache.org/licenses/LICENSE-2.0
    +
    +   Unless required by applicable law or agreed to in writing, software
    +   distributed under the License is distributed on an "AS IS" BASIS,
    +   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +   See the License for the specific language governing permissions and
    +   limitations under the License.
    diff --git a/docs/scripts/prettify/lang-css.js b/docs/scripts/prettify/lang-css.js
    new file mode 100644
    index 000000000..041e1f590
    --- /dev/null
    +++ b/docs/scripts/prettify/lang-css.js
    @@ -0,0 +1,2 @@
    +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\n"]],[["str",/^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/,null],["str",/^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/,null],["lang-css-str",/^url\(([^"')]*)\)/i],["kwd",/^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],["com",
    +/^(?:<\!--|--\>)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]);
    diff --git a/docs/scripts/prettify/prettify.js b/docs/scripts/prettify/prettify.js
    new file mode 100644
    index 000000000..eef5ad7e6
    --- /dev/null
    +++ b/docs/scripts/prettify/prettify.js
    @@ -0,0 +1,28 @@
    +var q=null;window.PR_SHOULD_USE_CONTINUATION=!0;
    +(function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a=
    +[],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c<i;++c){var j=f[c];if(/\\[bdsw]/i.test(j))a.push(j);else{var j=m(j),d;c+2<i&&"-"===f[c+1]?(d=m(f[c+2]),c+=2):d=j;b.push([j,d]);d<65||j>122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;c<b.length;++c)i=b[c],i[0]<=j[1]+1?j[1]=Math.max(j[1],i[1]):f.push(j=i);b=["["];o&&b.push("^");b.push.apply(b,a);for(c=0;c<
    +f.length;++c)i=f[c],b.push(e(i[0])),i[1]>i[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c<b;++c){var j=f[c];j==="("?++i:"\\"===j.charAt(0)&&(j=+j.substring(1))&&j<=i&&(d[j]=-1)}for(c=1;c<d.length;++c)-1===d[c]&&(d[c]=++t);for(i=c=0;c<b;++c)j=f[c],j==="("?(++i,d[i]===void 0&&(f[c]="(?:")):"\\"===j.charAt(0)&&
    +(j=+j.substring(1))&&j<=i&&(f[c]="\\"+d[i]);for(i=c=0;c<b;++c)"^"===f[c]&&"^"!==f[c+1]&&(f[c]="");if(a.ignoreCase&&s)for(c=0;c<b;++c)j=f[c],a=j.charAt(0),j.length>=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p<d;++p){var g=a[p];if(g.ignoreCase)l=!0;else if(/[a-z]/i.test(g.source.replace(/\\u[\da-f]{4}|\\x[\da-f]{2}|\\[^UXux]/gi,""))){s=!0;l=!1;break}}for(var r=
    +{b:8,t:9,n:10,v:11,f:12,r:13},n=[],p=0,d=a.length;p<d;++p){g=a[p];if(g.global||g.multiline)throw Error(""+g);n.push("(?:"+y(g)+")")}return RegExp(n.join("|"),l?"gi":"g")}function M(a){function m(a){switch(a.nodeType){case 1:if(e.test(a.className))break;for(var g=a.firstChild;g;g=g.nextSibling)m(g);g=a.nodeName;if("BR"===g||"LI"===g)h[s]="\n",t[s<<1]=y++,t[s++<<1|1]=a;break;case 3:case 4:g=a.nodeValue,g.length&&(g=p?g.replace(/\r\n?/g,"\n"):g.replace(/[\t\n\r ]+/g," "),h[s]=g,t[s<<1]=y,y+=g.length,
    +t[s++<<1|1]=a)}}var e=/(?:^|\s)nocode(?:\s|$)/,h=[],y=0,t=[],s=0,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=document.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);m(a);return{a:h.join("").replace(/\n$/,""),c:t}}function B(a,m,e,h){m&&(a={a:m,d:a},e(a),h.push.apply(h,a.e))}function x(a,m){function e(a){for(var l=a.d,p=[l,"pln"],d=0,g=a.a.match(y)||[],r={},n=0,z=g.length;n<z;++n){var f=g[n],b=r[f],o=void 0,c;if(typeof b===
    +"string")c=!1;else{var i=h[f.charAt(0)];if(i)o=f.match(i[1]),b=i[0];else{for(c=0;c<t;++c)if(i=m[c],o=f.match(i[1])){b=i[0];break}o||(b="pln")}if((c=b.length>=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m),
    +l=[],p={},d=0,g=e.length;d<g;++d){var r=e[d],n=r[3];if(n)for(var k=n.length;--k>=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/,
    +q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/,
    +q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g,
    +"");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a),
    +a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e}
    +for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g<d.length;++g)e(d[g]);m===(m|0)&&d[0].setAttribute("value",
    +m);var r=s.createElement("OL");r.className="linenums";for(var n=Math.max(0,m-1|0)||0,g=0,z=d.length;g<z;++g)l=d[g],l.className="L"+(g+n)%10,l.firstChild||l.appendChild(s.createTextNode("\xa0")),r.appendChild(l);a.appendChild(r)}function k(a,m){for(var e=m.length;--e>=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*</.test(m)?"default-markup":"default-code";return A[a]}function E(a){var m=
    +a.g;try{var e=M(a.h),h=e.a;a.a=h;a.c=e.c;a.d=0;C(m,h)(a);var k=/\bMSIE\b/.test(navigator.userAgent),m=/\n/g,t=a.a,s=t.length,e=0,l=a.c,p=l.length,h=0,d=a.e,g=d.length,a=0;d[g]=s;var r,n;for(n=r=0;n<g;)d[n]!==d[n+2]?(d[r++]=d[n++],d[r++]=d[n++]):n+=2;g=r;for(n=r=0;n<g;){for(var z=d[n],f=d[n+1],b=n+2;b+2<=g&&d[b+1]===f;)b+=2;d[r++]=z;d[r++]=f;n=b}for(d.length=r;h<p;){var o=l[h+2]||s,c=d[a+2]||s,b=Math.min(o,c),i=l[h+1],j;if(i.nodeType!==1&&(j=t.substring(e,b))){k&&(j=j.replace(m,"\r"));i.nodeValue=
    +j;var u=i.ownerDocument,v=u.createElement("SPAN");v.className=d[a+1];var x=i.parentNode;x.replaceChild(v,i);v.appendChild(i);e<o&&(l[h+1]=i=u.createTextNode(t.substring(b,o)),x.insertBefore(i,v.nextSibling))}e=b;e>=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],
    +"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"],
    +H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],
    +J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+
    +I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^<?]+/],["dec",/^<!\w[^>]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),
    +["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css",
    +/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),
    +["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes",
    +hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p<h.length&&l.now()<e;p++){var n=h[p],k=n.className;if(k.indexOf("prettyprint")>=0){var k=k.match(g),f,b;if(b=
    +!k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p<h.length?setTimeout(m,
    +250):a&&a()}for(var e=[document.getElementsByTagName("pre"),document.getElementsByTagName("code"),document.getElementsByTagName("xmp")],h=[],k=0;k<e.length;++k)for(var t=0,s=e[k].length;t<s;++t)h.push(e[k][t]);var e=q,l=Date;l.now||(l={now:function(){return+new Date}});var p=0,d,g=/\blang(?:uage)?-([\w.]+)(?!\S)/;m()};window.PR={createSimpleLexer:x,registerLangHandler:k,sourceDecorator:u,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",
    +PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ"}})();
    diff --git a/docs/styles/bootstrap.min.css b/docs/styles/bootstrap.min.css
    new file mode 100644
    index 000000000..ed3905e0e
    --- /dev/null
    +++ b/docs/styles/bootstrap.min.css
    @@ -0,0 +1,6 @@
    +/*!
    + * Bootstrap v3.3.7 (http://getbootstrap.com)
    + * Copyright 2011-2016 Twitter, Inc.
    + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
    + *//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{margin:.67em 0;font-size:2em}mark{color:#000;background:#ff0}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{height:0;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{margin:0;font:inherit;color:inherit}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}input{line-height:normal}input[type=checkbox],input[type=radio]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{padding:.35em .625em .75em;margin:0 2px;border:1px solid silver}legend{padding:0;border:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-spacing:0;border-collapse:collapse}td,th{padding:0}/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */@media print{*,:after,:before{color:#000!important;text-shadow:none!important;background:0 0!important;-webkit-box-shadow:none!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="javascript:"]:after,a[href^="#"]:after{content:""}blockquote,pre{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}img{max-width:100%!important}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}.navbar{display:none}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #ddd!important}}@font-face{font-family:'Glyphicons Halflings';src:url(../fonts/glyphicons-halflings-regular.eot);src:url(../fonts/glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'),url(../fonts/glyphicons-halflings-regular.woff2) format('woff2'),url(../fonts/glyphicons-halflings-regular.woff) format('woff'),url(../fonts/glyphicons-halflings-regular.ttf) format('truetype'),url(../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format('svg')}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:"\002a"}.glyphicon-plus:before{content:"\002b"}.glyphicon-eur:before,.glyphicon-euro:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-bookmark:before{content:"\e044"}.glyphicon-print:before{content:"\e045"}.glyphicon-camera:before{content:"\e046"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-fire:before{content:"\e104"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-calendar:before{content:"\e109"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-bell:before{content:"\e123"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-wrench:before{content:"\e136"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-briefcase:before{content:"\e139"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-paperclip:before{content:"\e142"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-pushpin:before{content:"\e146"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}.glyphicon-cd:before{content:"\e201"}.glyphicon-save-file:before{content:"\e202"}.glyphicon-open-file:before{content:"\e203"}.glyphicon-level-up:before{content:"\e204"}.glyphicon-copy:before{content:"\e205"}.glyphicon-paste:before{content:"\e206"}.glyphicon-alert:before{content:"\e209"}.glyphicon-equalizer:before{content:"\e210"}.glyphicon-king:before{content:"\e211"}.glyphicon-queen:before{content:"\e212"}.glyphicon-pawn:before{content:"\e213"}.glyphicon-bishop:before{content:"\e214"}.glyphicon-knight:before{content:"\e215"}.glyphicon-baby-formula:before{content:"\e216"}.glyphicon-tent:before{content:"\26fa"}.glyphicon-blackboard:before{content:"\e218"}.glyphicon-bed:before{content:"\e219"}.glyphicon-apple:before{content:"\f8ff"}.glyphicon-erase:before{content:"\e221"}.glyphicon-hourglass:before{content:"\231b"}.glyphicon-lamp:before{content:"\e223"}.glyphicon-duplicate:before{content:"\e224"}.glyphicon-piggy-bank:before{content:"\e225"}.glyphicon-scissors:before{content:"\e226"}.glyphicon-bitcoin:before{content:"\e227"}.glyphicon-btc:before{content:"\e227"}.glyphicon-xbt:before{content:"\e227"}.glyphicon-yen:before{content:"\00a5"}.glyphicon-jpy:before{content:"\00a5"}.glyphicon-ruble:before{content:"\20bd"}.glyphicon-rub:before{content:"\20bd"}.glyphicon-scale:before{content:"\e230"}.glyphicon-ice-lolly:before{content:"\e231"}.glyphicon-ice-lolly-tasted:before{content:"\e232"}.glyphicon-education:before{content:"\e233"}.glyphicon-option-horizontal:before{content:"\e234"}.glyphicon-option-vertical:before{content:"\e235"}.glyphicon-menu-hamburger:before{content:"\e236"}.glyphicon-modal-window:before{content:"\e237"}.glyphicon-oil:before{content:"\e238"}.glyphicon-grain:before{content:"\e239"}.glyphicon-sunglasses:before{content:"\e240"}.glyphicon-text-size:before{content:"\e241"}.glyphicon-text-color:before{content:"\e242"}.glyphicon-text-background:before{content:"\e243"}.glyphicon-object-align-top:before{content:"\e244"}.glyphicon-object-align-bottom:before{content:"\e245"}.glyphicon-object-align-horizontal:before{content:"\e246"}.glyphicon-object-align-left:before{content:"\e247"}.glyphicon-object-align-vertical:before{content:"\e248"}.glyphicon-object-align-right:before{content:"\e249"}.glyphicon-triangle-right:before{content:"\e250"}.glyphicon-triangle-left:before{content:"\e251"}.glyphicon-triangle-bottom:before{content:"\e252"}.glyphicon-triangle-top:before{content:"\e253"}.glyphicon-console:before{content:"\e254"}.glyphicon-superscript:before{content:"\e255"}.glyphicon-subscript:before{content:"\e256"}.glyphicon-menu-left:before{content:"\e257"}.glyphicon-menu-right:before{content:"\e258"}.glyphicon-menu-down:before{content:"\e259"}.glyphicon-menu-up:before{content:"\e260"}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857143;color:#333;background-color:#fff}button,input,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#337ab7;text-decoration:none}a:focus,a:hover{color:#23527c;text-decoration:underline}a:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.carousel-inner>.item>a>img,.carousel-inner>.item>img,.img-responsive,.thumbnail a>img,.thumbnail>img{display:block;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{display:inline-block;max-width:100%;height:auto;padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}[role=button]{cursor:pointer}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{font-family:inherit;font-weight:500;line-height:1.1;color:inherit}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-weight:400;line-height:1;color:#777}.h1,.h2,.h3,h1,h2,h3{margin-top:20px;margin-bottom:10px}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small{font-size:65%}.h4,.h5,.h6,h4,h5,h6{margin-top:10px;margin-bottom:10px}.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-size:75%}.h1,h1{font-size:36px}.h2,h2{font-size:30px}.h3,h3{font-size:24px}.h4,h4{font-size:18px}.h5,h5{font-size:14px}.h6,h6{font-size:12px}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16px;font-weight:300;line-height:1.4}@media (min-width:768px){.lead{font-size:21px}}.small,small{font-size:85%}.mark,mark{padding:.2em;background-color:#fcf8e3}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-nowrap{white-space:nowrap}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-muted{color:#777}.text-primary{color:#337ab7}a.text-primary:focus,a.text-primary:hover{color:#286090}.text-success{color:#3c763d}a.text-success:focus,a.text-success:hover{color:#2b542c}.text-info{color:#31708f}a.text-info:focus,a.text-info:hover{color:#245269}.text-warning{color:#8a6d3b}a.text-warning:focus,a.text-warning:hover{color:#66512c}.text-danger{color:#a94442}a.text-danger:focus,a.text-danger:hover{color:#843534}.bg-primary{color:#fff;background-color:#337ab7}a.bg-primary:focus,a.bg-primary:hover{background-color:#286090}.bg-success{background-color:#dff0d8}a.bg-success:focus,a.bg-success:hover{background-color:#c1e2b3}.bg-info{background-color:#d9edf7}a.bg-info:focus,a.bg-info:hover{background-color:#afd9ee}.bg-warning{background-color:#fcf8e3}a.bg-warning:focus,a.bg-warning:hover{background-color:#f7ecb5}.bg-danger{background-color:#f2dede}a.bg-danger:focus,a.bg-danger:hover{background-color:#e4b9b9}.page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}ol,ul{margin-top:0;margin-bottom:10px}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;margin-left:-5px;list-style:none}.list-inline>li{display:inline-block;padding-right:5px;padding-left:5px}dl{margin-top:0;margin-bottom:20px}dd,dt{line-height:1.42857143}dt{font-weight:700}dd{margin-left:0}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}abbr[data-original-title],abbr[title]{cursor:help;border-bottom:1px dotted #777}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}blockquote ol:last-child,blockquote p:last-child,blockquote ul:last-child{margin-bottom:0}blockquote .small,blockquote footer,blockquote small{display:block;font-size:80%;line-height:1.42857143;color:#777}blockquote .small:before,blockquote footer:before,blockquote small:before{content:'\2014 \00A0'}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;text-align:right;border-right:5px solid #eee;border-left:0}.blockquote-reverse .small:before,.blockquote-reverse footer:before,.blockquote-reverse small:before,blockquote.pull-right .small:before,blockquote.pull-right footer:before,blockquote.pull-right small:before{content:''}.blockquote-reverse .small:after,.blockquote-reverse footer:after,.blockquote-reverse small:after,blockquote.pull-right .small:after,blockquote.pull-right footer:after,blockquote.pull-right small:after{content:'\00A0 \2014'}address{margin-bottom:20px;font-style:normal;line-height:1.42857143}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;border-radius:4px}kbd{padding:2px 4px;font-size:90%;color:#fff;background-color:#333;border-radius:3px;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.25);box-shadow:inset 0 -1px 0 rgba(0,0,0,.25)}kbd kbd{padding:0;font-size:100%;font-weight:700;-webkit-box-shadow:none;box-shadow:none}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.42857143;color:#333;word-break:break-all;word-wrap:break-word;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.row{margin-right:-15px;margin-left:-15px}.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{position:relative;min-height:1px;padding-right:15px;padding-left:15px}.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:auto}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:auto}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0}@media (min-width:768px){.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:auto}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:auto}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0}}@media (min-width:992px){.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:auto}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:auto}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0}}@media (min-width:1200px){.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:auto}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:auto}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0}}table{background-color:transparent}caption{padding-top:8px;padding-bottom:8px;color:#777;text-align:left}th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:20px}.table>tbody>tr>td,.table>tbody>tr>th,.table>tfoot>tr>td,.table>tfoot>tr>th,.table>thead>tr>td,.table>thead>tr>th{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>caption+thead>tr:first-child>td,.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>td,.table>thead:first-child>tr:first-child>th{border-top:0}.table>tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed>tbody>tr>td,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>td,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>thead>tr>th{padding:5px}.table-bordered{border:1px solid #ddd}.table-bordered>tbody>tr>td,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>td,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border:1px solid #ddd}.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border-bottom-width:2px}.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9}.table-hover>tbody>tr:hover{background-color:#f5f5f5}table col[class*=col-]{position:static;display:table-column;float:none}table td[class*=col-],table th[class*=col-]{position:static;display:table-cell;float:none}.table>tbody>tr.active>td,.table>tbody>tr.active>th,.table>tbody>tr>td.active,.table>tbody>tr>th.active,.table>tfoot>tr.active>td,.table>tfoot>tr.active>th,.table>tfoot>tr>td.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>thead>tr.active>th,.table>thead>tr>td.active,.table>thead>tr>th.active{background-color:#f5f5f5}.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr.active:hover>th,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover{background-color:#e8e8e8}.table>tbody>tr.success>td,.table>tbody>tr.success>th,.table>tbody>tr>td.success,.table>tbody>tr>th.success,.table>tfoot>tr.success>td,.table>tfoot>tr.success>th,.table>tfoot>tr>td.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>thead>tr.success>th,.table>thead>tr>td.success,.table>thead>tr>th.success{background-color:#dff0d8}.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr.success:hover>th,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover{background-color:#d0e9c6}.table>tbody>tr.info>td,.table>tbody>tr.info>th,.table>tbody>tr>td.info,.table>tbody>tr>th.info,.table>tfoot>tr.info>td,.table>tfoot>tr.info>th,.table>tfoot>tr>td.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>thead>tr.info>th,.table>thead>tr>td.info,.table>thead>tr>th.info{background-color:#d9edf7}.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr.info:hover>th,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover{background-color:#c4e3f3}.table>tbody>tr.warning>td,.table>tbody>tr.warning>th,.table>tbody>tr>td.warning,.table>tbody>tr>th.warning,.table>tfoot>tr.warning>td,.table>tfoot>tr.warning>th,.table>tfoot>tr>td.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>thead>tr.warning>th,.table>thead>tr>td.warning,.table>thead>tr>th.warning{background-color:#fcf8e3}.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr.warning:hover>th,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover{background-color:#faf2cc}.table>tbody>tr.danger>td,.table>tbody>tr.danger>th,.table>tbody>tr>td.danger,.table>tbody>tr>th.danger,.table>tfoot>tr.danger>td,.table>tfoot>tr.danger>th,.table>tfoot>tr>td.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>thead>tr.danger>th,.table>thead>tr>td.danger,.table>thead>tr>th.danger{background-color:#f2dede}.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr.danger:hover>th,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover{background-color:#ebcccc}.table-responsive{min-height:.01%;overflow-x:auto}@media screen and (max-width:767px){.table-responsive{width:100%;margin-bottom:15px;overflow-y:hidden;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ddd}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>td,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>thead>tr>th{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:inherit;color:#333;border:0;border-bottom:1px solid #e5e5e5}label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:700}input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type=checkbox],input[type=radio]{margin:4px 0 0;margin-top:1px\9;line-height:normal}input[type=file]{display:block}input[type=range]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type=file]:focus,input[type=checkbox]:focus,input[type=radio]:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}output{display:block;padding-top:7px;font-size:14px;line-height:1.42857143;color:#555}.form-control{display:block;width:100%;height:34px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.form-control::-moz-placeholder{color:#999;opacity:1}.form-control:-ms-input-placeholder{color:#999}.form-control::-webkit-input-placeholder{color:#999}.form-control::-ms-expand{background-color:transparent;border:0}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{background-color:#eee;opacity:1}.form-control[disabled],fieldset[disabled] .form-control{cursor:not-allowed}textarea.form-control{height:auto}input[type=search]{-webkit-appearance:none}@media screen and (-webkit-min-device-pixel-ratio:0){input[type=date].form-control,input[type=time].form-control,input[type=datetime-local].form-control,input[type=month].form-control{line-height:34px}.input-group-sm input[type=date],.input-group-sm input[type=time],.input-group-sm input[type=datetime-local],.input-group-sm input[type=month],input[type=date].input-sm,input[type=time].input-sm,input[type=datetime-local].input-sm,input[type=month].input-sm{line-height:30px}.input-group-lg input[type=date],.input-group-lg input[type=time],.input-group-lg input[type=datetime-local],.input-group-lg input[type=month],input[type=date].input-lg,input[type=time].input-lg,input[type=datetime-local].input-lg,input[type=month].input-lg{line-height:46px}}.form-group{margin-bottom:15px}.checkbox,.radio{position:relative;display:block;margin-top:10px;margin-bottom:10px}.checkbox label,.radio label{min-height:20px;padding-left:20px;margin-bottom:0;font-weight:400;cursor:pointer}.checkbox input[type=checkbox],.checkbox-inline input[type=checkbox],.radio input[type=radio],.radio-inline input[type=radio]{position:absolute;margin-top:4px\9;margin-left:-20px}.checkbox+.checkbox,.radio+.radio{margin-top:-5px}.checkbox-inline,.radio-inline{position:relative;display:inline-block;padding-left:20px;margin-bottom:0;font-weight:400;vertical-align:middle;cursor:pointer}.checkbox-inline+.checkbox-inline,.radio-inline+.radio-inline{margin-top:0;margin-left:10px}fieldset[disabled] input[type=checkbox],fieldset[disabled] input[type=radio],input[type=checkbox].disabled,input[type=checkbox][disabled],input[type=radio].disabled,input[type=radio][disabled]{cursor:not-allowed}.checkbox-inline.disabled,.radio-inline.disabled,fieldset[disabled] .checkbox-inline,fieldset[disabled] .radio-inline{cursor:not-allowed}.checkbox.disabled label,.radio.disabled label,fieldset[disabled] .checkbox label,fieldset[disabled] .radio label{cursor:not-allowed}.form-control-static{min-height:34px;padding-top:7px;padding-bottom:7px;margin-bottom:0}.form-control-static.input-lg,.form-control-static.input-sm{padding-right:0;padding-left:0}.input-sm{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-sm{height:30px;line-height:30px}select[multiple].input-sm,textarea.input-sm{height:auto}.form-group-sm .form-control{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.form-group-sm select.form-control{height:30px;line-height:30px}.form-group-sm select[multiple].form-control,.form-group-sm textarea.form-control{height:auto}.form-group-sm .form-control-static{height:30px;min-height:32px;padding:6px 10px;font-size:12px;line-height:1.5}.input-lg{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-lg{height:46px;line-height:46px}select[multiple].input-lg,textarea.input-lg{height:auto}.form-group-lg .form-control{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.form-group-lg select.form-control{height:46px;line-height:46px}.form-group-lg select[multiple].form-control,.form-group-lg textarea.form-control{height:auto}.form-group-lg .form-control-static{height:46px;min-height:38px;padding:11px 16px;font-size:18px;line-height:1.3333333}.has-feedback{position:relative}.has-feedback .form-control{padding-right:42.5px}.form-control-feedback{position:absolute;top:0;right:0;z-index:2;display:block;width:34px;height:34px;line-height:34px;text-align:center;pointer-events:none}.form-group-lg .form-control+.form-control-feedback,.input-group-lg+.form-control-feedback,.input-lg+.form-control-feedback{width:46px;height:46px;line-height:46px}.form-group-sm .form-control+.form-control-feedback,.input-group-sm+.form-control-feedback,.input-sm+.form-control-feedback{width:30px;height:30px;line-height:30px}.has-success .checkbox,.has-success .checkbox-inline,.has-success .control-label,.has-success .help-block,.has-success .radio,.has-success .radio-inline,.has-success.checkbox label,.has-success.checkbox-inline label,.has-success.radio label,.has-success.radio-inline label{color:#3c763d}.has-success .form-control{border-color:#3c763d;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-success .form-control:focus{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168}.has-success .input-group-addon{color:#3c763d;background-color:#dff0d8;border-color:#3c763d}.has-success .form-control-feedback{color:#3c763d}.has-warning .checkbox,.has-warning .checkbox-inline,.has-warning .control-label,.has-warning .help-block,.has-warning .radio,.has-warning .radio-inline,.has-warning.checkbox label,.has-warning.checkbox-inline label,.has-warning.radio label,.has-warning.radio-inline label{color:#8a6d3b}.has-warning .form-control{border-color:#8a6d3b;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-warning .form-control:focus{border-color:#66512c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b}.has-warning .input-group-addon{color:#8a6d3b;background-color:#fcf8e3;border-color:#8a6d3b}.has-warning .form-control-feedback{color:#8a6d3b}.has-error .checkbox,.has-error .checkbox-inline,.has-error .control-label,.has-error .help-block,.has-error .radio,.has-error .radio-inline,.has-error.checkbox label,.has-error.checkbox-inline label,.has-error.radio label,.has-error.radio-inline label{color:#a94442}.has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483}.has-error .input-group-addon{color:#a94442;background-color:#f2dede;border-color:#a94442}.has-error .form-control-feedback{color:#a94442}.has-feedback label~.form-control-feedback{top:25px}.has-feedback label.sr-only~.form-control-feedback{top:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#737373}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-static{display:inline-block}.form-inline .input-group{display:inline-table;vertical-align:middle}.form-inline .input-group .form-control,.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .checkbox,.form-inline .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.form-inline .checkbox label,.form-inline .radio label{padding-left:0}.form-inline .checkbox input[type=checkbox],.form-inline .radio input[type=radio]{position:relative;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .checkbox,.form-horizontal .checkbox-inline,.form-horizontal .radio,.form-horizontal .radio-inline{padding-top:7px;margin-top:0;margin-bottom:0}.form-horizontal .checkbox,.form-horizontal .radio{min-height:27px}.form-horizontal .form-group{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.form-horizontal .control-label{padding-top:7px;margin-bottom:0;text-align:right}}.form-horizontal .has-feedback .form-control-feedback{right:15px}@media (min-width:768px){.form-horizontal .form-group-lg .control-label{padding-top:11px;font-size:18px}}@media (min-width:768px){.form-horizontal .form-group-sm .control-label{padding-top:6px;font-size:12px}}.btn{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:4px}.btn.active.focus,.btn.active:focus,.btn.focus,.btn:active.focus,.btn:active:focus,.btn:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn.focus,.btn:focus,.btn:hover{color:#333;text-decoration:none}.btn.active,.btn:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{cursor:not-allowed;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none;opacity:.65}a.btn.disabled,fieldset[disabled] a.btn{pointer-events:none}.btn-default{color:#333;background-color:#fff;border-color:#ccc}.btn-default.focus,.btn-default:focus{color:#333;background-color:#e6e6e6;border-color:#8c8c8c}.btn-default:hover{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default.active,.btn-default:active,.open>.dropdown-toggle.btn-default{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default.active.focus,.btn-default.active:focus,.btn-default.active:hover,.btn-default:active.focus,.btn-default:active:focus,.btn-default:active:hover,.open>.dropdown-toggle.btn-default.focus,.open>.dropdown-toggle.btn-default:focus,.open>.dropdown-toggle.btn-default:hover{color:#333;background-color:#d4d4d4;border-color:#8c8c8c}.btn-default.active,.btn-default:active,.open>.dropdown-toggle.btn-default{background-image:none}.btn-default.disabled.focus,.btn-default.disabled:focus,.btn-default.disabled:hover,.btn-default[disabled].focus,.btn-default[disabled]:focus,.btn-default[disabled]:hover,fieldset[disabled] .btn-default.focus,fieldset[disabled] .btn-default:focus,fieldset[disabled] .btn-default:hover{background-color:#fff;border-color:#ccc}.btn-default .badge{color:#fff;background-color:#333}.btn-primary{color:#fff;background-color:#337ab7;border-color:#2e6da4}.btn-primary.focus,.btn-primary:focus{color:#fff;background-color:#286090;border-color:#122b40}.btn-primary:hover{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary.active,.btn-primary:active,.open>.dropdown-toggle.btn-primary{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary.active.focus,.btn-primary.active:focus,.btn-primary.active:hover,.btn-primary:active.focus,.btn-primary:active:focus,.btn-primary:active:hover,.open>.dropdown-toggle.btn-primary.focus,.open>.dropdown-toggle.btn-primary:focus,.open>.dropdown-toggle.btn-primary:hover{color:#fff;background-color:#204d74;border-color:#122b40}.btn-primary.active,.btn-primary:active,.open>.dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled.focus,.btn-primary.disabled:focus,.btn-primary.disabled:hover,.btn-primary[disabled].focus,.btn-primary[disabled]:focus,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary.focus,fieldset[disabled] .btn-primary:focus,fieldset[disabled] .btn-primary:hover{background-color:#337ab7;border-color:#2e6da4}.btn-primary .badge{color:#337ab7;background-color:#fff}.btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.btn-success.focus,.btn-success:focus{color:#fff;background-color:#449d44;border-color:#255625}.btn-success:hover{color:#fff;background-color:#449d44;border-color:#398439}.btn-success.active,.btn-success:active,.open>.dropdown-toggle.btn-success{color:#fff;background-color:#449d44;border-color:#398439}.btn-success.active.focus,.btn-success.active:focus,.btn-success.active:hover,.btn-success:active.focus,.btn-success:active:focus,.btn-success:active:hover,.open>.dropdown-toggle.btn-success.focus,.open>.dropdown-toggle.btn-success:focus,.open>.dropdown-toggle.btn-success:hover{color:#fff;background-color:#398439;border-color:#255625}.btn-success.active,.btn-success:active,.open>.dropdown-toggle.btn-success{background-image:none}.btn-success.disabled.focus,.btn-success.disabled:focus,.btn-success.disabled:hover,.btn-success[disabled].focus,.btn-success[disabled]:focus,.btn-success[disabled]:hover,fieldset[disabled] .btn-success.focus,fieldset[disabled] .btn-success:focus,fieldset[disabled] .btn-success:hover{background-color:#5cb85c;border-color:#4cae4c}.btn-success .badge{color:#5cb85c;background-color:#fff}.btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.btn-info.focus,.btn-info:focus{color:#fff;background-color:#31b0d5;border-color:#1b6d85}.btn-info:hover{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info.active,.btn-info:active,.open>.dropdown-toggle.btn-info{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info.active.focus,.btn-info.active:focus,.btn-info.active:hover,.btn-info:active.focus,.btn-info:active:focus,.btn-info:active:hover,.open>.dropdown-toggle.btn-info.focus,.open>.dropdown-toggle.btn-info:focus,.open>.dropdown-toggle.btn-info:hover{color:#fff;background-color:#269abc;border-color:#1b6d85}.btn-info.active,.btn-info:active,.open>.dropdown-toggle.btn-info{background-image:none}.btn-info.disabled.focus,.btn-info.disabled:focus,.btn-info.disabled:hover,.btn-info[disabled].focus,.btn-info[disabled]:focus,.btn-info[disabled]:hover,fieldset[disabled] .btn-info.focus,fieldset[disabled] .btn-info:focus,fieldset[disabled] .btn-info:hover{background-color:#5bc0de;border-color:#46b8da}.btn-info .badge{color:#5bc0de;background-color:#fff}.btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.btn-warning.focus,.btn-warning:focus{color:#fff;background-color:#ec971f;border-color:#985f0d}.btn-warning:hover{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning.active,.btn-warning:active,.open>.dropdown-toggle.btn-warning{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning.active.focus,.btn-warning.active:focus,.btn-warning.active:hover,.btn-warning:active.focus,.btn-warning:active:focus,.btn-warning:active:hover,.open>.dropdown-toggle.btn-warning.focus,.open>.dropdown-toggle.btn-warning:focus,.open>.dropdown-toggle.btn-warning:hover{color:#fff;background-color:#d58512;border-color:#985f0d}.btn-warning.active,.btn-warning:active,.open>.dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled.focus,.btn-warning.disabled:focus,.btn-warning.disabled:hover,.btn-warning[disabled].focus,.btn-warning[disabled]:focus,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning.focus,fieldset[disabled] .btn-warning:focus,fieldset[disabled] .btn-warning:hover{background-color:#f0ad4e;border-color:#eea236}.btn-warning .badge{color:#f0ad4e;background-color:#fff}.btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.btn-danger.focus,.btn-danger:focus{color:#fff;background-color:#c9302c;border-color:#761c19}.btn-danger:hover{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger.active,.btn-danger:active,.open>.dropdown-toggle.btn-danger{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger.active.focus,.btn-danger.active:focus,.btn-danger.active:hover,.btn-danger:active.focus,.btn-danger:active:focus,.btn-danger:active:hover,.open>.dropdown-toggle.btn-danger.focus,.open>.dropdown-toggle.btn-danger:focus,.open>.dropdown-toggle.btn-danger:hover{color:#fff;background-color:#ac2925;border-color:#761c19}.btn-danger.active,.btn-danger:active,.open>.dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled.focus,.btn-danger.disabled:focus,.btn-danger.disabled:hover,.btn-danger[disabled].focus,.btn-danger[disabled]:focus,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger.focus,fieldset[disabled] .btn-danger:focus,fieldset[disabled] .btn-danger:hover{background-color:#d9534f;border-color:#d43f3a}.btn-danger .badge{color:#d9534f;background-color:#fff}.btn-link{font-weight:400;color:#337ab7;border-radius:0}.btn-link,.btn-link.active,.btn-link:active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:active,.btn-link:focus,.btn-link:hover{border-color:transparent}.btn-link:focus,.btn-link:hover{color:#23527c;text-decoration:underline;background-color:transparent}.btn-link[disabled]:focus,.btn-link[disabled]:hover,fieldset[disabled] .btn-link:focus,fieldset[disabled] .btn-link:hover{color:#777;text-decoration:none}.btn-group-lg>.btn,.btn-lg{padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.btn-group-sm>.btn,.btn-sm{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-group-xs>.btn,.btn-xs{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:5px}input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}tr.collapse.in{display:table-row}tbody.collapse.in{display:table-row-group}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition-timing-function:ease;-o-transition-timing-function:ease;transition-timing-function:ease;-webkit-transition-duration:.35s;-o-transition-duration:.35s;transition-duration:.35s;-webkit-transition-property:height,visibility;-o-transition-property:height,visibility;transition-property:height,visibility}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px dashed;border-top:4px solid\9;border-right:4px solid transparent;border-left:4px solid transparent}.dropdown,.dropup{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;font-size:14px;text-align:left;list-style:none;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175)}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}.dropdown-menu>li>a:focus,.dropdown-menu>li>a:hover{color:#262626;text-decoration:none;background-color:#f5f5f5}.dropdown-menu>.active>a,.dropdown-menu>.active>a:focus,.dropdown-menu>.active>a:hover{color:#fff;text-decoration:none;background-color:#337ab7;outline:0}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{color:#777}.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{text-decoration:none;cursor:not-allowed;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{right:0;left:auto}.dropdown-menu-left{right:auto;left:0}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#777;white-space:nowrap}.dropdown-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{content:"";border-top:0;border-bottom:4px dashed;border-bottom:4px solid\9}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:2px}@media (min-width:768px){.navbar-right .dropdown-menu{right:0;left:auto}.navbar-right .dropdown-menu-left{right:auto;left:0}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn{position:relative;float:left}.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group-vertical>.btn:hover,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus,.btn-group>.btn:hover{z-index:2}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-5px}.btn-toolbar .btn,.btn-toolbar .btn-group,.btn-toolbar .input-group{float:left}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-bottom-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-right:8px;padding-left:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-right:12px;padding-left:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-top-left-radius:0;border-top-right-radius:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-top-right-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{display:table-cell;float:none;width:1%}.btn-group-justified>.btn-group .btn{width:100%}.btn-group-justified>.btn-group .dropdown-menu{left:auto}[data-toggle=buttons]>.btn input[type=checkbox],[data-toggle=buttons]>.btn input[type=radio],[data-toggle=buttons]>.btn-group>.btn input[type=checkbox],[data-toggle=buttons]>.btn-group>.btn input[type=radio]{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*=col-]{float:none;padding-right:0;padding-left:0}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group .form-control:focus{z-index:3}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:46px;line-height:46px}select[multiple].input-group-lg>.form-control,select[multiple].input-group-lg>.input-group-addon,select[multiple].input-group-lg>.input-group-btn>.btn,textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:30px;line-height:30px}select[multiple].input-group-sm>.form-control,select[multiple].input-group-sm>.input-group-addon,select[multiple].input-group-sm>.input-group-btn>.btn,textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn{height:auto}.input-group .form-control,.input-group-addon,.input-group-btn{display:table-cell}.input-group .form-control:not(:first-child):not(:last-child),.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:6px 12px;font-size:14px;font-weight:400;line-height:1;color:#555;text-align:center;background-color:#eee;border:1px solid #ccc;border-radius:4px}.input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:3px}.input-group-addon.input-lg{padding:10px 16px;font-size:18px;border-radius:6px}.input-group-addon input[type=checkbox],.input-group-addon input[type=radio]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn-group:not(:last-child)>.btn,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:first-child>.btn-group:not(:first-child)>.btn,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;font-size:0;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:active,.input-group-btn>.btn:focus,.input-group-btn>.btn:hover{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-1px}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group{z-index:2;margin-left:-1px}.nav{padding-left:0;margin-bottom:0;list-style:none}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:focus,.nav>li>a:hover{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#777}.nav>li.disabled>a:focus,.nav>li.disabled>a:hover{color:#777;text-decoration:none;cursor:not-allowed;background-color:transparent}.nav .open>a,.nav .open>a:focus,.nav .open>a:hover{background-color:#eee;border-color:#337ab7}.nav .nav-divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.42857143;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:focus,.nav-tabs>li.active>a:hover{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border-bottom-color:#fff}}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:focus,.nav-pills>li.active>a:hover{color:#fff;background-color:#337ab7}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border-bottom-color:#fff}}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.navbar{position:relative;min-height:50px;margin-bottom:20px;border:1px solid transparent}@media (min-width:768px){.navbar{border-radius:4px}}@media (min-width:768px){.navbar-header{float:left}}.navbar-collapse{padding-right:15px;padding-left:15px;overflow-x:visible;-webkit-overflow-scrolling:touch;border-top:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1)}.navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar-collapse{width:auto;border-top:0;-webkit-box-shadow:none;box-shadow:none}.navbar-collapse.collapse{display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse{padding-right:0;padding-left:0}}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:340px}@media (max-device-width:480px) and (orientation:landscape){.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:200px}}.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media (min-width:768px){.navbar-static-top{border-radius:0}}.navbar-fixed-bottom,.navbar-fixed-top{position:fixed;right:0;left:0;z-index:1030}@media (min-width:768px){.navbar-fixed-bottom,.navbar-fixed-top{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.navbar-brand{float:left;height:50px;padding:15px 15px;font-size:18px;line-height:20px}.navbar-brand:focus,.navbar-brand:hover{text-decoration:none}.navbar-brand>img{display:block}@media (min-width:768px){.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;padding:9px 10px;margin-top:8px;margin-right:15px;margin-bottom:8px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media (min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:7.5px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:20px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-nav .open .dropdown-menu .dropdown-header,.navbar-nav .open .dropdown-menu>li>a{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:20px}.navbar-nav .open .dropdown-menu>li>a:focus,.navbar-nav .open .dropdown-menu>li>a:hover{background-image:none}}@media (min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:15px;padding-bottom:15px}}.navbar-form{padding:10px 15px;margin-top:8px;margin-right:-15px;margin-bottom:8px;margin-left:-15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1)}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .form-control-static{display:inline-block}.navbar-form .input-group{display:inline-table;vertical-align:middle}.navbar-form .input-group .form-control,.navbar-form .input-group .input-group-addon,.navbar-form .input-group .input-group-btn{width:auto}.navbar-form .input-group>.form-control{width:100%}.navbar-form .control-label{margin-bottom:0;vertical-align:middle}.navbar-form .checkbox,.navbar-form .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.navbar-form .checkbox label,.navbar-form .radio label{padding-left:0}.navbar-form .checkbox input[type=checkbox],.navbar-form .radio input[type=radio]{position:relative;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}.navbar-form .form-group:last-child{margin-bottom:0}}@media (min-width:768px){.navbar-form{width:auto;padding-top:0;padding-bottom:0;margin-right:0;margin-left:0;border:0;-webkit-box-shadow:none;box-shadow:none}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-left-radius:0;border-top-right-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{margin-bottom:0;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-btn{margin-top:8px;margin-bottom:8px}.navbar-btn.btn-sm{margin-top:10px;margin-bottom:10px}.navbar-btn.btn-xs{margin-top:14px;margin-bottom:14px}.navbar-text{margin-top:15px;margin-bottom:15px}@media (min-width:768px){.navbar-text{float:left;margin-right:15px;margin-left:15px}}@media (min-width:768px){.navbar-left{float:left!important}.navbar-right{float:right!important;margin-right:-15px}.navbar-right~.navbar-right{margin-right:0}}.navbar-default{background-color:#f8f8f8;border-color:#e7e7e7}.navbar-default .navbar-brand{color:#777}.navbar-default .navbar-brand:focus,.navbar-default .navbar-brand:hover{color:#5e5e5e;background-color:transparent}.navbar-default .navbar-text{color:#777}.navbar-default .navbar-nav>li>a{color:#777}.navbar-default .navbar-nav>li>a:focus,.navbar-default .navbar-nav>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:focus,.navbar-default .navbar-nav>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:focus,.navbar-default .navbar-nav>.disabled>a:hover{color:#ccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#ddd}.navbar-default .navbar-toggle:focus,.navbar-default .navbar-toggle:hover{background-color:#ddd}.navbar-default .navbar-toggle .icon-bar{background-color:#888}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#e7e7e7}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:focus,.navbar-default .navbar-nav>.open>a:hover{color:#555;background-color:#e7e7e7}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#ccc;background-color:transparent}}.navbar-default .navbar-link{color:#777}.navbar-default .navbar-link:hover{color:#333}.navbar-default .btn-link{color:#777}.navbar-default .btn-link:focus,.navbar-default .btn-link:hover{color:#333}.navbar-default .btn-link[disabled]:focus,.navbar-default .btn-link[disabled]:hover,fieldset[disabled] .navbar-default .btn-link:focus,fieldset[disabled] .navbar-default .btn-link:hover{color:#ccc}.navbar-inverse{background-color:#222;border-color:#080808}.navbar-inverse .navbar-brand{color:#9d9d9d}.navbar-inverse .navbar-brand:focus,.navbar-inverse .navbar-brand:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-text{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a:focus,.navbar-inverse .navbar-nav>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:focus,.navbar-inverse .navbar-nav>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:focus,.navbar-inverse .navbar-nav>.disabled>a:hover{color:#444;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#333}.navbar-inverse .navbar-toggle:focus,.navbar-inverse .navbar-toggle:hover{background-color:#333}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#101010}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:focus,.navbar-inverse .navbar-nav>.open>a:hover{color:#fff;background-color:#080808}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#444;background-color:transparent}}.navbar-inverse .navbar-link{color:#9d9d9d}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .btn-link{color:#9d9d9d}.navbar-inverse .btn-link:focus,.navbar-inverse .btn-link:hover{color:#fff}.navbar-inverse .btn-link[disabled]:focus,.navbar-inverse .btn-link[disabled]:hover,fieldset[disabled] .navbar-inverse .btn-link:focus,fieldset[disabled] .navbar-inverse .btn-link:hover{color:#444}.breadcrumb{padding:8px 15px;margin-bottom:20px;list-style:none;background-color:#f5f5f5;border-radius:4px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{padding:0 5px;color:#ccc;content:"/\00a0"}.breadcrumb>.active{color:#777}.pagination{display:inline-block;padding-left:0;margin:20px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;margin-left:-1px;line-height:1.42857143;color:#337ab7;text-decoration:none;background-color:#fff;border:1px solid #ddd}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-top-left-radius:4px;border-bottom-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-top-right-radius:4px;border-bottom-right-radius:4px}.pagination>li>a:focus,.pagination>li>a:hover,.pagination>li>span:focus,.pagination>li>span:hover{z-index:2;color:#23527c;background-color:#eee;border-color:#ddd}.pagination>.active>a,.pagination>.active>a:focus,.pagination>.active>a:hover,.pagination>.active>span,.pagination>.active>span:focus,.pagination>.active>span:hover{z-index:3;color:#fff;cursor:default;background-color:#337ab7;border-color:#337ab7}.pagination>.disabled>a,.pagination>.disabled>a:focus,.pagination>.disabled>a:hover,.pagination>.disabled>span,.pagination>.disabled>span:focus,.pagination>.disabled>span:hover{color:#777;cursor:not-allowed;background-color:#fff;border-color:#ddd}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:18px;line-height:1.3333333}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-top-left-radius:6px;border-bottom-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-top-right-radius:6px;border-bottom-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px;line-height:1.5}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-top-left-radius:3px;border-bottom-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-top-right-radius:3px;border-bottom-right-radius:3px}.pager{padding-left:0;margin:20px 0;text-align:center;list-style:none}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:15px}.pager li>a:focus,.pager li>a:hover{text-decoration:none;background-color:#eee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:focus,.pager .disabled>a:hover,.pager .disabled>span{color:#777;cursor:not-allowed;background-color:#fff}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}a.label:focus,a.label:hover{color:#fff;text-decoration:none;cursor:pointer}.label:empty{display:none}.btn .label{position:relative;top:-1px}.label-default{background-color:#777}.label-default[href]:focus,.label-default[href]:hover{background-color:#5e5e5e}.label-primary{background-color:#337ab7}.label-primary[href]:focus,.label-primary[href]:hover{background-color:#286090}.label-success{background-color:#5cb85c}.label-success[href]:focus,.label-success[href]:hover{background-color:#449d44}.label-info{background-color:#5bc0de}.label-info[href]:focus,.label-info[href]:hover{background-color:#31b0d5}.label-warning{background-color:#f0ad4e}.label-warning[href]:focus,.label-warning[href]:hover{background-color:#ec971f}.label-danger{background-color:#d9534f}.label-danger[href]:focus,.label-danger[href]:hover{background-color:#c9302c}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:middle;background-color:#777;border-radius:10px}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.btn-group-xs>.btn .badge,.btn-xs .badge{top:0;padding:1px 5px}a.badge:focus,a.badge:hover{color:#fff;text-decoration:none;cursor:pointer}.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#337ab7;background-color:#fff}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding-top:30px;padding-bottom:30px;margin-bottom:30px;color:inherit;background-color:#eee}.jumbotron .h1,.jumbotron h1{color:inherit}.jumbotron p{margin-bottom:15px;font-size:21px;font-weight:200}.jumbotron>hr{border-top-color:#d5d5d5}.container .jumbotron,.container-fluid .jumbotron{padding-right:15px;padding-left:15px;border-radius:6px}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding-top:48px;padding-bottom:48px}.container .jumbotron,.container-fluid .jumbotron{padding-right:60px;padding-left:60px}.jumbotron .h1,.jumbotron h1{font-size:63px}}.thumbnail{display:block;padding:4px;margin-bottom:20px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:border .2s ease-in-out;-o-transition:border .2s ease-in-out;transition:border .2s ease-in-out}.thumbnail a>img,.thumbnail>img{margin-right:auto;margin-left:auto}a.thumbnail.active,a.thumbnail:focus,a.thumbnail:hover{border-color:#337ab7}.thumbnail .caption{padding:9px;color:#333}.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:700}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable,.alert-dismissible{padding-right:35px}.alert-dismissable .close,.alert-dismissible .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#2b542c}.alert-info{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#245269}.alert-warning{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.alert-warning hr{border-top-color:#f7e1b5}.alert-warning .alert-link{color:#66512c}.alert-danger{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.alert-danger hr{border-top-color:#e4b9c0}.alert-danger .alert-link{color:#843534}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{height:20px;margin-bottom:20px;overflow:hidden;background-color:#f5f5f5;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1)}.progress-bar{float:left;width:0;height:100%;font-size:12px;line-height:20px;color:#fff;text-align:center;background-color:#337ab7;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);-webkit-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress-bar-striped,.progress-striped .progress-bar{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;background-size:40px 40px}.progress-bar.active,.progress.active .progress-bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-success{background-color:#5cb85c}.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-info{background-color:#5bc0de}.progress-striped .progress-bar-info{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-warning{background-color:#f0ad4e}.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-danger{background-color:#d9534f}.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.media{margin-top:15px}.media:first-child{margin-top:0}.media,.media-body{overflow:hidden;zoom:1}.media-body{width:10000px}.media-object{display:block}.media-object.img-thumbnail{max-width:none}.media-right,.media>.pull-right{padding-left:10px}.media-left,.media>.pull-left{padding-right:10px}.media-body,.media-left,.media-right{display:table-cell;vertical-align:top}.media-middle{vertical-align:middle}.media-bottom{vertical-align:bottom}.media-heading{margin-top:0;margin-bottom:5px}.media-list{padding-left:0;list-style:none}.list-group{padding-left:0;margin-bottom:20px}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.list-group-item:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}a.list-group-item,button.list-group-item{color:#555}a.list-group-item .list-group-item-heading,button.list-group-item .list-group-item-heading{color:#333}a.list-group-item:focus,a.list-group-item:hover,button.list-group-item:focus,button.list-group-item:hover{color:#555;text-decoration:none;background-color:#f5f5f5}button.list-group-item{width:100%;text-align:left}.list-group-item.disabled,.list-group-item.disabled:focus,.list-group-item.disabled:hover{color:#777;cursor:not-allowed;background-color:#eee}.list-group-item.disabled .list-group-item-heading,.list-group-item.disabled:focus .list-group-item-heading,.list-group-item.disabled:hover .list-group-item-heading{color:inherit}.list-group-item.disabled .list-group-item-text,.list-group-item.disabled:focus .list-group-item-text,.list-group-item.disabled:hover .list-group-item-text{color:#777}.list-group-item.active,.list-group-item.active:focus,.list-group-item.active:hover{z-index:2;color:#fff;background-color:#337ab7;border-color:#337ab7}.list-group-item.active .list-group-item-heading,.list-group-item.active .list-group-item-heading>.small,.list-group-item.active .list-group-item-heading>small,.list-group-item.active:focus .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading>.small,.list-group-item.active:focus .list-group-item-heading>small,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading>.small,.list-group-item.active:hover .list-group-item-heading>small{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:focus .list-group-item-text,.list-group-item.active:hover .list-group-item-text{color:#c7ddef}.list-group-item-success{color:#3c763d;background-color:#dff0d8}a.list-group-item-success,button.list-group-item-success{color:#3c763d}a.list-group-item-success .list-group-item-heading,button.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:focus,a.list-group-item-success:hover,button.list-group-item-success:focus,button.list-group-item-success:hover{color:#3c763d;background-color:#d0e9c6}a.list-group-item-success.active,a.list-group-item-success.active:focus,a.list-group-item-success.active:hover,button.list-group-item-success.active,button.list-group-item-success.active:focus,button.list-group-item-success.active:hover{color:#fff;background-color:#3c763d;border-color:#3c763d}.list-group-item-info{color:#31708f;background-color:#d9edf7}a.list-group-item-info,button.list-group-item-info{color:#31708f}a.list-group-item-info .list-group-item-heading,button.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:focus,a.list-group-item-info:hover,button.list-group-item-info:focus,button.list-group-item-info:hover{color:#31708f;background-color:#c4e3f3}a.list-group-item-info.active,a.list-group-item-info.active:focus,a.list-group-item-info.active:hover,button.list-group-item-info.active,button.list-group-item-info.active:focus,button.list-group-item-info.active:hover{color:#fff;background-color:#31708f;border-color:#31708f}.list-group-item-warning{color:#8a6d3b;background-color:#fcf8e3}a.list-group-item-warning,button.list-group-item-warning{color:#8a6d3b}a.list-group-item-warning .list-group-item-heading,button.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:focus,a.list-group-item-warning:hover,button.list-group-item-warning:focus,button.list-group-item-warning:hover{color:#8a6d3b;background-color:#faf2cc}a.list-group-item-warning.active,a.list-group-item-warning.active:focus,a.list-group-item-warning.active:hover,button.list-group-item-warning.active,button.list-group-item-warning.active:focus,button.list-group-item-warning.active:hover{color:#fff;background-color:#8a6d3b;border-color:#8a6d3b}.list-group-item-danger{color:#a94442;background-color:#f2dede}a.list-group-item-danger,button.list-group-item-danger{color:#a94442}a.list-group-item-danger .list-group-item-heading,button.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:focus,a.list-group-item-danger:hover,button.list-group-item-danger:focus,button.list-group-item-danger:hover{color:#a94442;background-color:#ebcccc}a.list-group-item-danger.active,a.list-group-item-danger.active:focus,a.list-group-item-danger.active:hover,button.list-group-item-danger.active,button.list-group-item-danger.active:focus,button.list-group-item-danger.active:hover{color:#fff;background-color:#a94442;border-color:#a94442}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:20px;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}.panel-body{padding:15px}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-left-radius:3px;border-top-right-radius:3px}.panel-heading>.dropdown .dropdown-toggle{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:16px;color:inherit}.panel-title>.small,.panel-title>.small>a,.panel-title>a,.panel-title>small,.panel-title>small>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.list-group,.panel>.panel-collapse>.list-group{margin-bottom:0}.panel>.list-group .list-group-item,.panel>.panel-collapse>.list-group .list-group-item{border-width:1px 0;border-radius:0}.panel>.list-group:first-child .list-group-item:first-child,.panel>.panel-collapse>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-left-radius:3px;border-top-right-radius:3px}.panel>.list-group:last-child .list-group-item:last-child,.panel>.panel-collapse>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.panel-heading+.panel-collapse>.list-group .list-group-item:first-child{border-top-left-radius:0;border-top-right-radius:0}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.list-group+.panel-footer{border-top-width:0}.panel>.panel-collapse>.table,.panel>.table,.panel>.table-responsive>.table{margin-bottom:0}.panel>.panel-collapse>.table caption,.panel>.table caption,.panel>.table-responsive>.table caption{padding-right:15px;padding-left:15px}.panel>.table-responsive:first-child>.table:first-child,.panel>.table:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child,.panel>.table:first-child>thead:first-child>tr:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child{border-top-left-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child{border-top-right-radius:3px}.panel>.table-responsive:last-child>.table:last-child,.panel>.table:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child{border-bottom-right-radius:3px}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive,.panel>.table+.panel-body,.panel>.table-responsive+.panel-body{border-top:1px solid #ddd}.panel>.table>tbody:first-child>tr:first-child td,.panel>.table>tbody:first-child>tr:first-child th{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th{border-bottom:0}.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}.panel>.table-responsive{margin-bottom:0;border:0}.panel-group{margin-bottom:20px}.panel-group .panel{margin-bottom:0;border-radius:4px}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse>.list-group,.panel-group .panel-heading+.panel-collapse>.panel-body{border-top:1px solid #ddd}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ddd}.panel-default{border-color:#ddd}.panel-default>.panel-heading{color:#333;background-color:#f5f5f5;border-color:#ddd}.panel-default>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ddd}.panel-default>.panel-heading .badge{color:#f5f5f5;background-color:#333}.panel-default>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ddd}.panel-primary{border-color:#337ab7}.panel-primary>.panel-heading{color:#fff;background-color:#337ab7;border-color:#337ab7}.panel-primary>.panel-heading+.panel-collapse>.panel-body{border-top-color:#337ab7}.panel-primary>.panel-heading .badge{color:#337ab7;background-color:#fff}.panel-primary>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#337ab7}.panel-success{border-color:#d6e9c6}.panel-success>.panel-heading{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.panel-success>.panel-heading+.panel-collapse>.panel-body{border-top-color:#d6e9c6}.panel-success>.panel-heading .badge{color:#dff0d8;background-color:#3c763d}.panel-success>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#d6e9c6}.panel-info{border-color:#bce8f1}.panel-info>.panel-heading{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.panel-info>.panel-heading+.panel-collapse>.panel-body{border-top-color:#bce8f1}.panel-info>.panel-heading .badge{color:#d9edf7;background-color:#31708f}.panel-info>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#bce8f1}.panel-warning{border-color:#faebcc}.panel-warning>.panel-heading{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.panel-warning>.panel-heading+.panel-collapse>.panel-body{border-top-color:#faebcc}.panel-warning>.panel-heading .badge{color:#fcf8e3;background-color:#8a6d3b}.panel-warning>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#faebcc}.panel-danger{border-color:#ebccd1}.panel-danger>.panel-heading{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.panel-danger>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ebccd1}.panel-danger>.panel-heading .badge{color:#f2dede;background-color:#a94442}.panel-danger>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ebccd1}.embed-responsive{position:relative;display:block;height:0;padding:0;overflow:hidden}.embed-responsive .embed-responsive-item,.embed-responsive embed,.embed-responsive iframe,.embed-responsive object,.embed-responsive video{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive-16by9{padding-bottom:56.25%}.embed-responsive-4by3{padding-bottom:75%}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.05);box-shadow:inset 0 1px 1px rgba(0,0,0,.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,.15)}.well-lg{padding:24px;border-radius:6px}.well-sm{padding:9px;border-radius:3px}.close{float:right;font-size:21px;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;filter:alpha(opacity=20);opacity:.2}.close:focus,.close:hover{color:#000;text-decoration:none;cursor:pointer;filter:alpha(opacity=50);opacity:.5}button.close{-webkit-appearance:none;padding:0;cursor:pointer;background:0 0;border:0}.modal-open{overflow:hidden}.modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;display:none;overflow:hidden;-webkit-overflow-scrolling:touch;outline:0}.modal.fade .modal-dialog{-webkit-transition:-webkit-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:transform .3s ease-out;-webkit-transform:translate(0,-25%);-ms-transform:translate(0,-25%);-o-transform:translate(0,-25%);transform:translate(0,-25%)}.modal.in .modal-dialog{-webkit-transform:translate(0,0);-ms-transform:translate(0,0);-o-transform:translate(0,0);transform:translate(0,0)}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #999;border:1px solid rgba(0,0,0,.2);border-radius:6px;outline:0;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5)}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{filter:alpha(opacity=0);opacity:0}.modal-backdrop.in{filter:alpha(opacity=50);opacity:.5}.modal-header{padding:15px;border-bottom:1px solid #e5e5e5}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.42857143}.modal-body{position:relative;padding:15px}.modal-footer{padding:15px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer .btn+.btn{margin-bottom:0;margin-left:5px}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,.5);box-shadow:0 5px 15px rgba(0,0,0,.5)}.modal-sm{width:300px}}@media (min-width:992px){.modal-lg{width:900px}}.tooltip{position:absolute;z-index:1070;display:block;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:12px;font-style:normal;font-weight:400;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;filter:alpha(opacity=0);opacity:0;line-break:auto}.tooltip.in{filter:alpha(opacity=90);opacity:.9}.tooltip.top{padding:5px 0;margin-top:-3px}.tooltip.right{padding:0 5px;margin-left:3px}.tooltip.bottom{padding:5px 0;margin-top:3px}.tooltip.left{padding:0 5px;margin-left:-3px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;background-color:#000;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-left .tooltip-arrow{right:5px;bottom:0;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-right .tooltip-arrow{bottom:0;left:5px;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-left .tooltip-arrow{top:0;right:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-right .tooltip-arrow{top:0;left:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.popover{position:absolute;top:0;left:0;z-index:1060;display:none;max-width:276px;padding:1px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2);line-break:auto}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{padding:8px 14px;margin:0;font-size:14px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover>.arrow,.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover>.arrow{border-width:11px}.popover>.arrow:after{content:"";border-width:10px}.popover.top>.arrow{bottom:-11px;left:50%;margin-left:-11px;border-top-color:#999;border-top-color:rgba(0,0,0,.25);border-bottom-width:0}.popover.top>.arrow:after{bottom:1px;margin-left:-10px;content:" ";border-top-color:#fff;border-bottom-width:0}.popover.right>.arrow{top:50%;left:-11px;margin-top:-11px;border-right-color:#999;border-right-color:rgba(0,0,0,.25);border-left-width:0}.popover.right>.arrow:after{bottom:-10px;left:1px;content:" ";border-right-color:#fff;border-left-width:0}.popover.bottom>.arrow{top:-11px;left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,.25)}.popover.bottom>.arrow:after{top:1px;margin-left:-10px;content:" ";border-top-width:0;border-bottom-color:#fff}.popover.left>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,.25)}.popover.left>.arrow:after{right:1px;bottom:-10px;content:" ";border-right-width:0;border-left-color:#fff}.carousel{position:relative}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner>.item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>a>img,.carousel-inner>.item>img{line-height:1}@media all and (transform-3d),(-webkit-transform-3d){.carousel-inner>.item{-webkit-transition:-webkit-transform .6s ease-in-out;-o-transition:-o-transform .6s ease-in-out;transition:transform .6s ease-in-out;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000px;perspective:1000px}.carousel-inner>.item.active.right,.carousel-inner>.item.next{left:0;-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}.carousel-inner>.item.active.left,.carousel-inner>.item.prev{left:0;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.carousel-inner>.item.active,.carousel-inner>.item.next.left,.carousel-inner>.item.prev.right{left:0;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;bottom:0;left:0;width:15%;font-size:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6);background-color:rgba(0,0,0,0);filter:alpha(opacity=50);opacity:.5}.carousel-control.left{background-image:-webkit-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,.0001)));background-image:linear-gradient(to right,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);background-repeat:repeat-x}.carousel-control.right{right:0;left:auto;background-image:-webkit-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.0001)),to(rgba(0,0,0,.5)));background-image:linear-gradient(to right,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);background-repeat:repeat-x}.carousel-control:focus,.carousel-control:hover{color:#fff;text-decoration:none;filter:alpha(opacity=90);outline:0;opacity:.9}.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{position:absolute;top:50%;z-index:5;display:inline-block;margin-top:-10px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{left:50%;margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{right:50%;margin-right:-10px}.carousel-control .icon-next,.carousel-control .icon-prev{width:20px;height:20px;font-family:serif;line-height:1}.carousel-control .icon-prev:before{content:'\2039'}.carousel-control .icon-next:before{content:'\203a'}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;padding-left:0;margin-left:-30%;text-align:center;list-style:none}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;cursor:pointer;background-color:#000\9;background-color:rgba(0,0,0,0);border:1px solid #fff;border-radius:10px}.carousel-indicators .active{width:12px;height:12px;margin:0;background-color:#fff}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{width:30px;height:30px;margin-top:-10px;font-size:30px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{margin-right:-10px}.carousel-caption{right:20%;left:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.btn-group-vertical>.btn-group:after,.btn-group-vertical>.btn-group:before,.btn-toolbar:after,.btn-toolbar:before,.clearfix:after,.clearfix:before,.container-fluid:after,.container-fluid:before,.container:after,.container:before,.dl-horizontal dd:after,.dl-horizontal dd:before,.form-horizontal .form-group:after,.form-horizontal .form-group:before,.modal-footer:after,.modal-footer:before,.modal-header:after,.modal-header:before,.nav:after,.nav:before,.navbar-collapse:after,.navbar-collapse:before,.navbar-header:after,.navbar-header:before,.navbar:after,.navbar:before,.pager:after,.pager:before,.panel-body:after,.panel-body:before,.row:after,.row:before{display:table;content:" "}.btn-group-vertical>.btn-group:after,.btn-toolbar:after,.clearfix:after,.container-fluid:after,.container:after,.dl-horizontal dd:after,.form-horizontal .form-group:after,.modal-footer:after,.modal-header:after,.nav:after,.navbar-collapse:after,.navbar-header:after,.navbar:after,.pager:after,.panel-body:after,.row:after{clear:both}.center-block{display:block;margin-right:auto;margin-left:auto}.pull-right{float:right!important}.pull-left{float:left!important}.hide{display:none!important}.show{display:block!important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none!important}.affix{position:fixed}@-ms-viewport{width:device-width}.visible-lg,.visible-md,.visible-sm,.visible-xs{display:none!important}.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block{display:none!important}@media (max-width:767px){.visible-xs{display:block!important}table.visible-xs{display:table!important}tr.visible-xs{display:table-row!important}td.visible-xs,th.visible-xs{display:table-cell!important}}@media (max-width:767px){.visible-xs-block{display:block!important}}@media (max-width:767px){.visible-xs-inline{display:inline!important}}@media (max-width:767px){.visible-xs-inline-block{display:inline-block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block!important}table.visible-sm{display:table!important}tr.visible-sm{display:table-row!important}td.visible-sm,th.visible-sm{display:table-cell!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-block{display:block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline{display:inline!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline-block{display:inline-block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block!important}table.visible-md{display:table!important}tr.visible-md{display:table-row!important}td.visible-md,th.visible-md{display:table-cell!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-block{display:block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline{display:inline!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline-block{display:inline-block!important}}@media (min-width:1200px){.visible-lg{display:block!important}table.visible-lg{display:table!important}tr.visible-lg{display:table-row!important}td.visible-lg,th.visible-lg{display:table-cell!important}}@media (min-width:1200px){.visible-lg-block{display:block!important}}@media (min-width:1200px){.visible-lg-inline{display:inline!important}}@media (min-width:1200px){.visible-lg-inline-block{display:inline-block!important}}@media (max-width:767px){.hidden-xs{display:none!important}}@media (min-width:768px) and (max-width:991px){.hidden-sm{display:none!important}}@media (min-width:992px) and (max-width:1199px){.hidden-md{display:none!important}}@media (min-width:1200px){.hidden-lg{display:none!important}}.visible-print{display:none!important}@media print{.visible-print{display:block!important}table.visible-print{display:table!important}tr.visible-print{display:table-row!important}td.visible-print,th.visible-print{display:table-cell!important}}.visible-print-block{display:none!important}@media print{.visible-print-block{display:block!important}}.visible-print-inline{display:none!important}@media print{.visible-print-inline{display:inline!important}}.visible-print-inline-block{display:none!important}@media print{.visible-print-inline-block{display:inline-block!important}}@media print{.hidden-print{display:none!important}}
    +/*# sourceMappingURL=bootstrap.min.css.map */
    \ No newline at end of file
    diff --git a/docs/styles/tomorrow.min.css b/docs/styles/tomorrow.min.css
    new file mode 100644
    index 000000000..3638ea978
    --- /dev/null
    +++ b/docs/styles/tomorrow.min.css
    @@ -0,0 +1,2 @@
    +/*! Color themes for Google Code Prettify | MIT License | github.com/jmblog/color-themes-for-google-code-prettify */
    +.prettyprint{background:#fff;font-family:Menlo,Bitstream Vera Sans Mono,DejaVu Sans Mono,Monaco,Consolas,monospace;border:0!important}.pln{color:#4d4d4c}ol.linenums{margin-top:0;margin-bottom:0;color:#8e908c}li.L0,li.L1,li.L2,li.L3,li.L4,li.L5,li.L6,li.L7,li.L8,li.L9{padding-left:1em;background-color:#fff;list-style-type:decimal}@media screen{.str{color:#718c00}.kwd{color:#8959a8}.com{color:#8e908c}.typ{color:#4271ae}.lit{color:#f5871f}.pun{color:#4d4d4c}.opn{color:#4d4d4c}.clo{color:#4d4d4c}.tag{color:#c82829}.atn{color:#f5871f}.atv{color:#3e999f}.dec{color:#f5871f}.var{color:#c82829}.fun{color:#4271ae}}
    \ No newline at end of file
    diff --git a/examples/images/colormap.png b/examples/images/colormap.png
    new file mode 100644
    index 000000000..122e07a52
    Binary files /dev/null and b/examples/images/colormap.png differ
    diff --git a/examples/images/displacement_BG.jpg b/examples/images/displacement_BG.jpg
    new file mode 100644
    index 000000000..7e666b203
    Binary files /dev/null and b/examples/images/displacement_BG.jpg differ
    diff --git a/examples/images/displacement_fish1.png b/examples/images/displacement_fish1.png
    new file mode 100644
    index 000000000..e7ddb254b
    Binary files /dev/null and b/examples/images/displacement_fish1.png differ
    diff --git a/examples/images/displacement_fish2.png b/examples/images/displacement_fish2.png
    new file mode 100644
    index 000000000..86f458be1
    Binary files /dev/null and b/examples/images/displacement_fish2.png differ
    diff --git a/examples/images/displacement_fish3.png b/examples/images/displacement_fish3.png
    new file mode 100644
    index 000000000..cdaf13523
    Binary files /dev/null and b/examples/images/displacement_fish3.png differ
    diff --git a/examples/images/displacement_fish4.png b/examples/images/displacement_fish4.png
    new file mode 100644
    index 000000000..fbba4af27
    Binary files /dev/null and b/examples/images/displacement_fish4.png differ
    diff --git a/examples/images/displacement_fish5.png b/examples/images/displacement_fish5.png
    new file mode 100644
    index 000000000..35e3f5860
    Binary files /dev/null and b/examples/images/displacement_fish5.png differ
    diff --git a/examples/images/displacement_map.png b/examples/images/displacement_map.png
    new file mode 100644
    index 000000000..efcc9490d
    Binary files /dev/null and b/examples/images/displacement_map.png differ
    diff --git a/examples/images/lightmap.png b/examples/images/lightmap.png
    new file mode 100644
    index 000000000..7cc852769
    Binary files /dev/null and b/examples/images/lightmap.png differ
    diff --git a/examples/images/overlay.png b/examples/images/overlay.png
    new file mode 100644
    index 000000000..0a3ed0f50
    Binary files /dev/null and b/examples/images/overlay.png differ
    diff --git a/examples/images/pixijs-logo.png b/examples/images/pixijs-logo.png
    new file mode 100644
    index 000000000..886cc017f
    Binary files /dev/null and b/examples/images/pixijs-logo.png differ
    diff --git a/examples/index.css b/examples/index.css
    new file mode 100644
    index 000000000..62588979b
    --- /dev/null
    +++ b/examples/index.css
    @@ -0,0 +1,47 @@
    +body {
    +    margin:0;
    +    padding:0;
    +    font-family: Helvetica, sans-serif;
    +    background:#333;
    +    overflow: hidden;
    +}
    +#container {
    +    top:0;
    +    left:0;
    +    width:100%;
    +    height:100%;
    +    position:absolute;
    +    overflow: hidden;
    +}
    +#stage {
    +    width:100%;
    +    height:100%;
    +    position:absolute;
    +    display:block;
    +    z-index: 0;
    +}
    +#logo {
    +    position: absolute;
    +    z-index:1;
    +    width:245px;
    +    height:69px;
    +    top:0;
    +    right:15px;
    +    background:#000;
    +    padding:10px 0;
    +}
    +.lil-gui.root {
    +    top:89px !important;
    +    max-height: calc(100% - 89px);
    +}
    +.lil-gui .title { 
    +    color: #999;
    +}
    +.lil-gui.enabled .title {
    +    color: #ea4080;
    +}
    +#logo img {
    +    display: block;
    +    margin:8px auto 0;
    +    width: 80%;
    +}
    \ No newline at end of file
    diff --git a/examples/index.html b/examples/index.html
    new file mode 100644
    index 000000000..71ef4d201
    --- /dev/null
    +++ b/examples/index.html
    @@ -0,0 +1,21 @@
    +<!DOCTYPE html>
    +<html>
    +    <head>
    +        <meta charset="utf-8">
    +        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    +        <title>PixiJS Filters Demo</title>
    +        <meta name='viewport' content='width=device-width, initial-scale=1.0'>
    +        <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" />
    +        <script src="https://cdn.jsdelivr.net/npm/lil-gui@0.12.0"></script>
    +        <script src="https://pixijs.download/next-v8/pixi.min.js"></script>
    +        <script src="../dist/pixi-filters.js"></script>
    +        <link rel="stylesheet" href="./index.css" />
    +    </head>
    +    <body>
    +        <div id="container">
    +            <canvas id="stage" width="300" height="300"></canvas>
    +            <a id="logo" href="http://www.pixijs.com"><img src="images/pixijs-logo.png"></a>
    +        </div>
    +        <script type="module" src="./src/index.mjs"></script>
    +    </body>
    +</html>
    diff --git a/examples/src/DemoApplication.mjs b/examples/src/DemoApplication.mjs
    new file mode 100644
    index 000000000..1c39eae76
    --- /dev/null
    +++ b/examples/src/DemoApplication.mjs
    @@ -0,0 +1,378 @@
    +/** Demo show a bunch of fish and a lil-gui controls */
    +export default class DemoApplication extends PIXI.Application
    +{
    +    constructor()
    +    {
    +        const gui = new lil.GUI();
    +
    +        gui.useLocalStorage = false;
    +
    +        // Get the initial dementions for the application
    +        const domElement = document.querySelector('#container');
    +        const initWidth = domElement.offsetWidth;
    +        const initHeight = domElement.offsetHeight;
    +
    +        super();
    +
    +        this.domElement = domElement;
    +        this.resources = null;
    +        this.initWidth = initWidth;
    +        this.initHeight = initHeight;
    +        this.animating = true;
    +        this.rendering = true;
    +        this.events = new PIXI.EventEmitter();
    +        this.animateTimer = 0;
    +        this.bg = null;
    +        this.pond = null;
    +        this.fishCount = 20;
    +        this.fishes = [];
    +        this.fishFilters = [];
    +        this.pondFilters = [];
    +
    +        this.filterArea = new PIXI.Rectangle();
    +        this.padding = 100;
    +        this.bounds = new PIXI.Rectangle(
    +            -this.padding,
    +            -this.padding,
    +            initWidth + (this.padding * 2),
    +            initHeight + (this.padding * 2),
    +        );
    +
    +        this.enabledFilters = [];
    +
    +        const app = this;
    +
    +        this.gui = gui;
    +        this.gui.add(this, 'rendering')
    +            .name('&bull; Rendering')
    +            .onChange((value) =>
    +            {
    +                if (!value)
    +                {
    +                    app.stop();
    +                }
    +                else
    +                {
    +                    app.start();
    +                }
    +            });
    +        this.gui.add(this, 'animating')
    +            .name('&bull; Animating');
    +    }
    +
    +    /** override init */
    +    init()
    +    {
    +        const preference = (new URLSearchParams(window.location.search)).get('preference') || 'webgpu';
    +
    +        return super.init({
    +            hello: true,
    +            width: this.initWidth,
    +            height: this.initHeight,
    +            autoStart: false,
    +            preference,
    +            useBackBuffer: true,
    +        });
    +    }
    +
    +    /**
    +     * Load resources
    +     * @param {object} manifest Collection of resources to load
    +     */
    +    async load(manifest)
    +    {
    +        PIXI.Assets.addBundle('bundle', manifest);
    +        this.resources = await PIXI.Assets.loadBundle('bundle');
    +        this.setup();
    +        this.start();
    +    }
    +
    +    setup()
    +    {
    +        document.body.appendChild(this.canvas);
    +
    +        const { resources } = this;
    +        const { bounds, initWidth, initHeight } = this;
    +
    +        // Setup the container
    +        this.pond = new PIXI.Container();
    +        this.pond.filterArea = this.filterArea;
    +        this.stage.addChild(this.pond);
    +
    +        // Setup the background image
    +        this.bg = new PIXI.Sprite(resources.background);
    +        this.pond.addChild(this.bg);
    +
    +        // Create and add the fish
    +        const fishVariations = 5;
    +
    +        for (let i = 0; i < this.fishCount; i++)
    +        {
    +            const id = `fish${(i % fishVariations) + 1}`;
    +            const fish = new PIXI.Sprite(resources[id]);
    +
    +            fish.anchor.set(0.5);
    +            fish.filters = this.fishFilters;
    +
    +            fish.direction = Math.random() * Math.PI * 2;
    +            fish.speed = 2 + (Math.random() * 2);
    +            fish.turnSpeed = Math.random() - 0.8;
    +
    +            fish.x = Math.random() * bounds.width;
    +            fish.y = Math.random() * bounds.height;
    +
    +            fish.scale.set(0.8 + (Math.random() * 0.3));
    +            this.pond.addChild(fish);
    +            this.fishes.push(fish);
    +        }
    +
    +        // Setup the tiling sprite
    +        this.overlay = new PIXI.TilingSprite({
    +            texture: resources.overlay,
    +            width: initWidth,
    +            height: initHeight,
    +        });
    +
    +        // Add the overlay
    +        this.pond.addChild(this.overlay);
    +
    +        // Handle window resize event
    +        window.addEventListener('resize', this.handleResize.bind(this));
    +        this.handleResize();
    +
    +        // Handle fish animation
    +        this.ticker.add(this.animate, this);
    +    }
    +
    +    /**
    +     * Resize the demo when the window resizes
    +     */
    +    handleResize()
    +    {
    +        const { padding, bg, overlay, filterArea, bounds } = this;
    +
    +        const width = this.domElement.offsetWidth;
    +        const height = this.domElement.offsetHeight;
    +        const filterAreaPadding = 0;
    +
    +        // Use equivalent of CSS's contain for the background
    +        // so that it scales proportionally
    +        const bgAspect = bg.texture.width / bg.texture.height;
    +        const winAspect = width / height;
    +
    +        if (winAspect > bgAspect)
    +        {
    +            bg.width = width;
    +            bg.height = width / bgAspect;
    +        }
    +        else
    +        {
    +            bg.height = height;
    +            bg.width = height * bgAspect;
    +        }
    +
    +        bg.x = (width - bg.width) / 2;
    +        bg.y = (height - bg.height) / 2;
    +
    +        overlay.width = width;
    +        overlay.height = height;
    +
    +        bounds.x = -padding;
    +        bounds.y = -padding;
    +        bounds.width = width + (padding * 2);
    +        bounds.height = height + (padding * 2);
    +
    +        filterArea.x = filterAreaPadding;
    +        filterArea.y = filterAreaPadding;
    +        filterArea.width = width - (filterAreaPadding * 2);
    +        filterArea.height = height - (filterAreaPadding * 2);
    +
    +        this.events.emit('resize', width, height);
    +
    +        this.renderer.resize(width, height);
    +
    +        this.render();
    +    }
    +
    +    /**
    +     * Animate the fish, overlay and filters (if applicable)
    +     * @param {number} delta - % difference in time from last frame render
    +     */
    +    animate(time)
    +    {
    +        const delta = time.deltaTime;
    +
    +        this.animateTimer += delta;
    +
    +        const { bounds, animateTimer, overlay } = this;
    +
    +        this.events.emit('animate', delta, animateTimer);
    +
    +        if (!this.animating)
    +        {
    +            return;
    +        }
    +
    +        // Animate the overlay
    +        overlay.tilePosition.x = animateTimer * -1;
    +        overlay.tilePosition.y = animateTimer * -1;
    +
    +        for (let i = 0; i < this.fishes.length; i++)
    +        {
    +            const fish = this.fishes[i];
    +
    +            fish.direction += fish.turnSpeed * 0.01;
    +            fish.x += Math.sin(fish.direction) * fish.speed;
    +            fish.y += Math.cos(fish.direction) * fish.speed;
    +
    +            fish.rotation = -fish.direction - (Math.PI / 2);
    +
    +            if (fish.x < bounds.x)
    +            {
    +                fish.x += bounds.width;
    +            }
    +            if (fish.x > bounds.x + bounds.width)
    +            {
    +                fish.x -= bounds.width;
    +            }
    +            if (fish.y < bounds.y)
    +            {
    +                fish.y += bounds.height;
    +            }
    +            if (fish.y > bounds.y + bounds.height)
    +            {
    +                fish.y -= bounds.height;
    +            }
    +        }
    +    }
    +
    +    /**
    +     * Add a new filter
    +     * @param {string} id Class name
    +     * @param {object|function} options The class name of filter or options
    +     * @param {string} [options.id] The name of the filter class
    +     * @param {boolean} [options.global] Filter is in pixi.js
    +     * @param {array} [options.args] Constructor arguments
    +     * @param {boolean} [options.fishOnly=false] Apply to fish only, not whole scene
    +     * @param {boolean} [options.enabled=false] Filter is enabled by default
    +     * @param {function} [oncreate] Function takes filter and gui folder as
    +     *        arguments and is scoped to the Demo application.
    +     * @return {Filter} Instance of new filter
    +     */
    +    addFilter(id, options)
    +    {
    +        if (typeof options === 'function')
    +        {
    +            options = { oncreate: options };
    +        }
    +
    +        options = Object.assign({
    +            name: id,
    +            enabled: false,
    +            opened: false,
    +            args: undefined,
    +            fishOnly: false,
    +            global: false,
    +            oncreate: null,
    +        }, options);
    +
    +        if (options.global)
    +        {
    +            options.name += ' (pixi.js)';
    +        }
    +
    +        const app = this;
    +        const folder = this.gui.addFolder(options.name).close();
    +        const ClassRef = PIXI.filters[id] || PIXI[id];
    +
    +        if (!ClassRef)
    +        {
    +            throw new Error(`Unable to find class name with "${id}"`);
    +        }
    +
    +        const filter = new ClassRef(options.args);
    +
    +        // Set enabled status
    +        filter.enabled = (options.enabled && this.enabledFilters.length === 0) || this.enabledFilters.includes(id);
    +
    +        // TODO: This is a hack for the issue with the 'enabled' toggling
    +        // https://github.com/orgs/pixijs/projects/2/views/4?pane=issue&itemId=48582986
    +        const toggleFilter = (enabled) =>
    +        {
    +            if (options.fishOnly)
    +            {
    +                const fishFilters = [...this.fishFilters];
    +
    +                if (enabled)
    +                {
    +                    fishFilters.push(filter);
    +                }
    +                else
    +                {
    +                    const index = fishFilters.indexOf(filter);
    +
    +                    if (index !== -1) fishFilters.splice(index, 1);
    +                }
    +                this.fishFilters = fishFilters;
    +                this.fishes.forEach((fish) =>
    +                {
    +                    fish.filters = fishFilters;
    +                });
    +            }
    +            else
    +            {
    +                const pondFilters = [...this.pondFilters];
    +
    +                if (enabled)
    +                {
    +                    pondFilters.push(filter);
    +                }
    +                else
    +                {
    +                    const index = pondFilters.indexOf(filter);
    +
    +                    if (index !== -1) pondFilters.splice(index, 1);
    +                }
    +
    +                this.pondFilters = pondFilters;
    +                // TODO: seems like a bug, requiring invalidation
    +                this.pond.filters = [];
    +                this.pond.filters = pondFilters;
    +            }
    +        };
    +
    +        // Track enabled change with analytics
    +        folder.add(filter, 'enabled').onChange((enabled) =>
    +        {
    +            ga('send', 'event', id, enabled ? 'enabled' : 'disabled');
    +
    +            toggleFilter(enabled);
    +            app.events.emit('enable', enabled);
    +
    +            this.render();
    +            if (enabled)
    +            {
    +                folder.domElement.className += ' enabled';
    +            }
    +            else
    +            {
    +                folder.domElement.className = folder.domElement.className.replace(' enabled', '');
    +            }
    +        });
    +
    +        if (filter.enabled)
    +        {
    +            folder.open();
    +            folder.domElement.className += ' enabled';
    +        }
    +
    +        if (options.oncreate)
    +        {
    +            options.oncreate.call(filter, folder);
    +        }
    +
    +        toggleFilter(filter.enabled);
    +
    +        return filter;
    +    }
    +}
    diff --git a/examples/src/filters/adjustment.mjs b/examples/src/filters/adjustment.mjs
    new file mode 100644
    index 000000000..2f0d31ea6
    --- /dev/null
    +++ b/examples/src/filters/adjustment.mjs
    @@ -0,0 +1,16 @@
    +export default function ()
    +{
    +    this.addFilter('AdjustmentFilter', {
    +        oncreate(folder)
    +        {
    +            folder.add(this, 'gamma', 0, 5);
    +            folder.add(this, 'saturation', 0, 5);
    +            folder.add(this, 'contrast', 0, 5);
    +            folder.add(this, 'brightness', 0, 5);
    +            folder.add(this, 'red', 0, 5);
    +            folder.add(this, 'green', 0, 5);
    +            folder.add(this, 'blue', 0, 5);
    +            folder.add(this, 'alpha', 0, 1);
    +        },
    +    });
    +}
    diff --git a/examples/src/filters/advanced-bloom.mjs b/examples/src/filters/advanced-bloom.mjs
    new file mode 100644
    index 000000000..b952e0703
    --- /dev/null
    +++ b/examples/src/filters/advanced-bloom.mjs
    @@ -0,0 +1,11 @@
    +export default function ()
    +{
    +    this.addFilter('AdvancedBloomFilter', function (folder)
    +    {
    +        folder.add(this, 'threshold', 0.1, 0.9);
    +        folder.add(this, 'bloomScale', 0.5, 1.5);
    +        folder.add(this, 'brightness', 0.5, 1.5);
    +        folder.add(this, 'blur', 0, 20);
    +        folder.add(this, 'quality', 0, 20);
    +    });
    +}
    diff --git a/examples/src/filters/alpha.mjs b/examples/src/filters/alpha.mjs
    new file mode 100644
    index 000000000..4a1698c6b
    --- /dev/null
    +++ b/examples/src/filters/alpha.mjs
    @@ -0,0 +1,10 @@
    +export default function ()
    +{
    +    this.addFilter('AlphaFilter', {
    +        global: true,
    +        oncreate(folder)
    +        {
    +            folder.add(this, 'alpha', 0, 1);
    +        },
    +    });
    +}
    diff --git a/examples/src/filters/ascii.mjs b/examples/src/filters/ascii.mjs
    new file mode 100644
    index 000000000..5238e64e7
    --- /dev/null
    +++ b/examples/src/filters/ascii.mjs
    @@ -0,0 +1,9 @@
    +export default function ()
    +{
    +    this.addFilter('AsciiFilter', function (folder)
    +    {
    +        folder.add(this, 'size', 2, 20);
    +        folder.addColor(this, 'color');
    +        folder.add(this, 'replaceColor');
    +    });
    +}
    diff --git a/examples/src/filters/backdropBlur.mjs b/examples/src/filters/backdropBlur.mjs
    new file mode 100644
    index 000000000..14f9ec6ad
    --- /dev/null
    +++ b/examples/src/filters/backdropBlur.mjs
    @@ -0,0 +1,11 @@
    +export default function ()
    +{
    +    this.addFilter('BackdropBlurFilter', {
    +        fishOnly: true,
    +        oncreate(folder)
    +        {
    +            folder.add(this, 'blur', 0, 100);
    +            folder.add(this, 'quality', 1, 10);
    +        },
    +    });
    +}
    diff --git a/examples/src/filters/bevel.mjs b/examples/src/filters/bevel.mjs
    new file mode 100644
    index 000000000..7a23a9c1d
    --- /dev/null
    +++ b/examples/src/filters/bevel.mjs
    @@ -0,0 +1,15 @@
    +export default function ()
    +{
    +    this.addFilter('BevelFilter', {
    +        fishOnly: true,
    +        oncreate(folder)
    +        {
    +            folder.add(this, 'rotation', 0, 360);
    +            folder.add(this, 'thickness', 0, 10);
    +            folder.addColor(this, 'lightColor');
    +            folder.add(this, 'lightAlpha', 0, 1);
    +            folder.addColor(this, 'shadowColor');
    +            folder.add(this, 'shadowAlpha', 0, 1);
    +        },
    +    });
    +}
    diff --git a/examples/src/filters/bloom.mjs b/examples/src/filters/bloom.mjs
    new file mode 100644
    index 000000000..e0ef0d1dc
    --- /dev/null
    +++ b/examples/src/filters/bloom.mjs
    @@ -0,0 +1,15 @@
    +export default function ()
    +{
    +    this.addFilter('BloomFilter', function (folder)
    +    {
    +        const strength = { value: this.strengthX };
    +
    +        folder.add(strength, 'value', 0, 20).onChange((value) =>
    +        {
    +            this.strengthX = value;
    +            this.strengthY = value;
    +        });
    +        folder.add(this, 'strengthX', 0, 20);
    +        folder.add(this, 'strengthY', 0, 20);
    +    });
    +}
    diff --git a/examples/src/filters/blur.mjs b/examples/src/filters/blur.mjs
    new file mode 100644
    index 000000000..fedbda367
    --- /dev/null
    +++ b/examples/src/filters/blur.mjs
    @@ -0,0 +1,11 @@
    +export default function ()
    +{
    +    this.addFilter('BlurFilter', {
    +        global: true,
    +        oncreate(folder)
    +        {
    +            folder.add(this, 'blur', 0, 100);
    +            folder.add(this, 'quality', 1, 10);
    +        },
    +    });
    +}
    diff --git a/examples/src/filters/bulge-pinch.mjs b/examples/src/filters/bulge-pinch.mjs
    new file mode 100644
    index 000000000..db6390d14
    --- /dev/null
    +++ b/examples/src/filters/bulge-pinch.mjs
    @@ -0,0 +1,10 @@
    +export default function ()
    +{
    +    this.addFilter('BulgePinchFilter', function (folder)
    +    {
    +        folder.add(this, 'radius', 0, 1000);
    +        folder.add(this, 'strength', -1, 1);
    +        folder.add(this, 'centerX', 0, 1).name('center.x');
    +        folder.add(this, 'centerY', 0, 1).name('center.y');
    +    });
    +}
    diff --git a/examples/src/filters/color-gradient.mjs b/examples/src/filters/color-gradient.mjs
    new file mode 100644
    index 000000000..9925d4102
    --- /dev/null
    +++ b/examples/src/filters/color-gradient.mjs
    @@ -0,0 +1,162 @@
    +const deepCopy = (value) => JSON.parse(JSON.stringify(value));
    +const { ColorGradientFilter } = PIXI.filters;
    +
    +export default function ()
    +{
    +    let stops = deepCopy(ColorGradientFilter.defaults.stops);
    +    const ctrlIndex = {
    +        enabled: 0,
    +        resetOptions: 1,
    +        cssGradient: 2,
    +        type: 3,
    +        alpha: 4,
    +        angle: 5,
    +        maxColors: 6,
    +    };
    +
    +    this.addFilter('ColorGradientFilter', {
    +        enabled: false,
    +        fishOnly: true,
    +        args: ctrlIndex,
    +        oncreate(folder)
    +        {
    +            let miscControls = {};
    +
    +            const removeColorStopControllers = () =>
    +            {
    +                for (let i = folder.controllers.length - 1; i > 0; i--)
    +                {
    +                    if (folder.controllers[i]._name.includes('stop'))
    +                    {
    +                        folder.controllers[i].destroy();
    +                    }
    +                }
    +            };
    +
    +            const onStopChange = () =>
    +            {
    +                this.stops = stops;
    +            };
    +
    +            const createColorStopControllers = (stops) =>
    +            {
    +                removeColorStopControllers();
    +
    +                for (let i = 0; i < stops.length; i++)
    +                {
    +                    folder.addColor(stops[i], 'color')
    +                        .name(`stops[${i}].color`)
    +                        .onChange(onStopChange);
    +                    folder.add(stops[i], 'offset', 0, 1)
    +                        .name(`stops[${i}].offset`)
    +                        .onChange(onStopChange);
    +                    folder.add(stops[i], 'alpha', 0, 1)
    +                        .name(`stops[${i}].alpha`)
    +                        .onChange(onStopChange);
    +                }
    +
    +                const canRemoveStops = (stops.length > 2);
    +
    +                folder.add(miscControls, 'remove color stop').disable(!canRemoveStops);
    +                folder.add(miscControls, 'add color stop');
    +            };
    +
    +            const setColorStops = (newStops, scaleOffsets = false) =>
    +            {
    +                if (scaleOffsets)
    +                {
    +                    const scaleFactor = (this.stops.length - 1) / (newStops.length - 1);
    +                    const lastIndexToScale = Math.min(newStops.length, this.stops.length);
    +
    +                    for (let i = 0; i < lastIndexToScale; i++)
    +                    {
    +                        newStops[i].offset *= scaleFactor;
    +                    }
    +                }
    +
    +                createColorStopControllers(newStops);
    +                stops = newStops;
    +                onStopChange();
    +            };
    +
    +            const onCssGradientChange = (css) =>
    +            {
    +                let filter;
    +
    +                const inputStyle = folder.controllers[ctrlIndex.cssGradient].domElement.style;
    +
    +                inputStyle.border = '';
    +
    +                if (css.trim().length === 0)
    +                {
    +                    return;
    +                }
    +
    +                try
    +                {
    +                    filter = new ColorGradientFilter({ css });
    +                }
    +                catch (e)
    +                {
    +                    inputStyle.border = '2px solid red';
    +
    +                    return;
    +                }
    +
    +                folder.controllers[ctrlIndex.type].setValue(filter.type);
    +                folder.controllers[ctrlIndex.alpha].setValue(1.0);
    +                folder.controllers[ctrlIndex.angle].setValue(filter.angle);
    +                folder.controllers[ctrlIndex.maxColors].setValue(0);
    +                setColorStops(filter.stops, false);
    +            };
    +
    +            const applyDefaultOptions = () =>
    +            {
    +                const defaults = deepCopy(ColorGradientFilter.defaults);
    +
    +                folder.controllers[ctrlIndex.type].setValue(defaults.type);
    +                folder.controllers[ctrlIndex.alpha].setValue(defaults.alpha);
    +                folder.controllers[ctrlIndex.angle].setValue(defaults.angle);
    +                folder.controllers[ctrlIndex.maxColors].setValue(defaults.maxColors);
    +                folder.controllers[ctrlIndex.cssGradient].setValue('');
    +                setColorStops(defaults.stops, false);
    +            };
    +
    +            const addColorStop = () =>
    +            {
    +                const getRandomColor = () => [0, 0, 0].map(Math.random);
    +
    +                const newColorStop = {
    +                    offset: 1.0,
    +                    alpha: 1.0,
    +                    color: getRandomColor(),
    +                };
    +
    +                setColorStops([...this.stops].concat([newColorStop]), true);
    +            };
    +
    +            const removeLastColorStop = () =>
    +            {
    +                const newStops = [...this.stops.slice(0, -1)];
    +
    +                setColorStops(newStops, true);
    +            };
    +
    +            miscControls = Object.assign(miscControls, {
    +                'reset options': applyDefaultOptions,
    +                'add color stop': addColorStop,
    +                'remove color stop': removeLastColorStop,
    +                cssGradient: '',
    +            });
    +
    +            folder.add(miscControls, 'reset options');
    +            folder.add(miscControls, 'cssGradient').name('from CSS gradient').onChange(onCssGradientChange);
    +            folder.add(this, 'type', { LINEAR: 0, RADIAL: 1, CONIC: 2 });
    +            folder.add(this, 'alpha', 0, 1);
    +            folder.add(this, 'angle', 0, 360, 1);
    +            folder.add(this, 'maxColors', 0, 24, 1);
    +            folder.add(this, 'replace', false);
    +            applyDefaultOptions(stops);
    +        },
    +    });
    +}
    diff --git a/examples/src/filters/color-map.mjs b/examples/src/filters/color-map.mjs
    new file mode 100644
    index 000000000..db2995590
    --- /dev/null
    +++ b/examples/src/filters/color-map.mjs
    @@ -0,0 +1,18 @@
    +export default function ()
    +{
    +    const colorMap = this.resources.colormap;
    +
    +    this.addFilter('ColorMapFilter', {
    +        enabled: false,
    +        args: { colorMap },
    +        oncreate(folder)
    +        {
    +            folder.add(this, 'mix', 0, 1);
    +            folder.add(this, 'nearest');
    +
    +            // eslint-disable-next-line no-empty-function
    +            this._noop = () => {};
    +            folder.add(this, '_noop').name('<img src="./images/colormap.png" width="220" height="13">');
    +        },
    +    });
    +}
    diff --git a/examples/src/filters/color-matrix.mjs b/examples/src/filters/color-matrix.mjs
    new file mode 100644
    index 000000000..0a17e8e77
    --- /dev/null
    +++ b/examples/src/filters/color-matrix.mjs
    @@ -0,0 +1,20 @@
    +export default function ()
    +{
    +    this.addFilter('ColorMatrixFilter', {
    +        global: true,
    +        oncreate(folder)
    +        {
    +            folder.add(this, 'reset');
    +            folder.add(this, 'sepia');
    +            folder.add(this, 'negative');
    +            folder.add({ kodachrome: this.kodachrome.bind(this, true) }, 'kodachrome');
    +            folder.add({ lsd: this.lsd.bind(this, true) }, 'lsd');
    +            folder.add(this, 'polaroid');
    +            folder.add(this, 'desaturate');
    +            folder.add({ contrast: this.contrast.bind(this, 1) }, 'contrast');
    +            folder.add({ grayscale: this.grayscale.bind(this, 1) }, 'grayscale');
    +            folder.add({ predator: this.predator.bind(this, 1) }, 'predator');
    +            folder.add({ saturate: this.saturate.bind(this, 1) }, 'saturate');
    +        },
    +    });
    +}
    diff --git a/examples/src/filters/color-overlay.mjs b/examples/src/filters/color-overlay.mjs
    new file mode 100644
    index 000000000..32486a19d
    --- /dev/null
    +++ b/examples/src/filters/color-overlay.mjs
    @@ -0,0 +1,12 @@
    +export default function ()
    +{
    +    this.addFilter('ColorOverlayFilter', {
    +        fishOnly: true,
    +        args: { color: 0xff0000, alpha: 1 },
    +        oncreate(folder)
    +        {
    +            folder.addColor(this, 'color');
    +            folder.add(this, 'alpha', 0, 1);
    +        },
    +    });
    +}
    diff --git a/examples/src/filters/color-replace.mjs b/examples/src/filters/color-replace.mjs
    new file mode 100644
    index 000000000..b3f9de608
    --- /dev/null
    +++ b/examples/src/filters/color-replace.mjs
    @@ -0,0 +1,9 @@
    +export default function ()
    +{
    +    this.addFilter('ColorReplaceFilter', function (folder)
    +    {
    +        folder.addColor(this, 'originalColor');
    +        folder.addColor(this, 'targetColor');
    +        folder.add(this, 'tolerance', 0, 1);
    +    });
    +}
    diff --git a/examples/src/filters/convolution.mjs b/examples/src/filters/convolution.mjs
    new file mode 100644
    index 000000000..74af992d9
    --- /dev/null
    +++ b/examples/src/filters/convolution.mjs
    @@ -0,0 +1,15 @@
    +export default function ()
    +{
    +    this.addFilter('ConvolutionFilter', {
    +        args: { matrix: [0, 0.5, 0, 0.5, 1, 0.5, 0, 0.5, 0], width: 300, height: 300 },
    +        oncreate(folder)
    +        {
    +            folder.add(this, 'width', 0, 500);
    +            folder.add(this, 'height', 0, 500);
    +            for (let i = 0; i < this.matrix.length; i++)
    +            {
    +                folder.add(this.matrix, i, 0, 1, 0.01).name(`matrix[${i}]`);
    +            }
    +        },
    +    });
    +}
    diff --git a/examples/src/filters/cross-hatch.mjs b/examples/src/filters/cross-hatch.mjs
    new file mode 100644
    index 000000000..ad2bbc5f9
    --- /dev/null
    +++ b/examples/src/filters/cross-hatch.mjs
    @@ -0,0 +1,4 @@
    +export default function ()
    +{
    +    this.addFilter('CrossHatchFilter');
    +}
    diff --git a/examples/src/filters/crt.mjs b/examples/src/filters/crt.mjs
    new file mode 100644
    index 000000000..1d190981f
    --- /dev/null
    +++ b/examples/src/filters/crt.mjs
    @@ -0,0 +1,50 @@
    +export default function ()
    +{
    +    const app = this;
    +
    +    app.addFilter('CRTFilter', {
    +        args: {
    +            lineWidth: 3,
    +            lineContrast: 0.3,
    +            noise: 0.2,
    +            time: 0.5,
    +        },
    +        oncreate(folder)
    +        {
    +            const filter = this;
    +
    +            filter.animating = true;
    +
    +            app.events.on('enable', function (enabled)
    +            {
    +                if (enabled && filter.animating)
    +                {
    +                    filter.time = 0;
    +                }
    +            });
    +
    +            app.events.on('animate', function ()
    +            {
    +                if (filter.animating)
    +                {
    +                    filter.seed = Math.random();
    +                    filter.time += 0.5;
    +                }
    +            });
    +
    +            folder.add(this, 'animating').name('(animating)');
    +            folder.add(this, 'curvature', 0, 10);
    +            folder.add(this, 'lineWidth', 0, 5);
    +            folder.add(this, 'lineContrast', 0, 1);
    +            folder.add(this, 'verticalLine');
    +
    +            folder.add(this, 'noise', 0, 1);
    +            folder.add(this, 'noiseSize', 1, 10);
    +            folder.add(this, 'vignetting', 0, 1);
    +            folder.add(this, 'vignettingAlpha', 0, 1);
    +            folder.add(this, 'vignettingBlur', 0, 1);
    +            folder.add(this, 'seed', 0, 1);
    +            folder.add(this, 'time', 0, 20);
    +        },
    +    });
    +}
    diff --git a/examples/src/filters/displacement.mjs b/examples/src/filters/displacement.mjs
    new file mode 100644
    index 000000000..47f5aaeb4
    --- /dev/null
    +++ b/examples/src/filters/displacement.mjs
    @@ -0,0 +1,27 @@
    +export default function ()
    +{
    +    const app = this;
    +
    +    this.resources.map.source.addressMode = 'repeat';
    +    const displacementSprite = new PIXI.Sprite(this.resources.map);
    +
    +    this.addFilter('DisplacementFilter', {
    +        enabled: true,
    +        global: true,
    +        args: { sprite: displacementSprite, scale: 1, width: this.initWidth, height: this.initHeight },
    +        oncreate(folder)
    +        {
    +            const { uScale } = this.resources.filterUniforms.uniforms;
    +
    +            uScale.x = 50;
    +            uScale.y = 50;
    +            folder.add(uScale, 'x', 1, 200).name('scale.x');
    +            folder.add(uScale, 'y', 1, 200).name('scale.y');
    +            app.events.on('resize', (width, height) =>
    +            {
    +                displacementSprite.width = width;
    +                displacementSprite.height = height;
    +            });
    +        },
    +    });
    +}
    diff --git a/examples/src/filters/dot.mjs b/examples/src/filters/dot.mjs
    new file mode 100644
    index 000000000..92923a1ab
    --- /dev/null
    +++ b/examples/src/filters/dot.mjs
    @@ -0,0 +1,9 @@
    +export default function ()
    +{
    +    this.addFilter('DotFilter', function (folder)
    +    {
    +        folder.add(this, 'scale', 0.3, 1);
    +        folder.add(this, 'angle', 0, 5);
    +        folder.add(this, 'grayscale');
    +    });
    +}
    diff --git a/examples/src/filters/drop-shadow.mjs b/examples/src/filters/drop-shadow.mjs
    new file mode 100644
    index 000000000..fef80a8bf
    --- /dev/null
    +++ b/examples/src/filters/drop-shadow.mjs
    @@ -0,0 +1,16 @@
    +export default function ()
    +{
    +    this.addFilter('DropShadowFilter', {
    +        fishOnly: true,
    +        oncreate(folder)
    +        {
    +            folder.add(this, 'blur', 0, 20);
    +            folder.add(this, 'quality', 0, 20);
    +            folder.add(this, 'alpha', 0, 1);
    +            folder.add(this, 'offsetX', -50, 50).name('offset.x');
    +            folder.add(this, 'offsetY', -50, 50).name('offset.y');
    +            folder.addColor(this, 'color');
    +            folder.add(this, 'shadowOnly');
    +        },
    +    });
    +}
    diff --git a/examples/src/filters/emboss.mjs b/examples/src/filters/emboss.mjs
    new file mode 100644
    index 000000000..3b883537c
    --- /dev/null
    +++ b/examples/src/filters/emboss.mjs
    @@ -0,0 +1,7 @@
    +export default function ()
    +{
    +    this.addFilter('EmbossFilter', function (folder)
    +    {
    +        folder.add(this, 'strength', 0, 20);
    +    });
    +}
    diff --git a/examples/src/filters/glitch.mjs b/examples/src/filters/glitch.mjs
    new file mode 100644
    index 000000000..c5d708ba2
    --- /dev/null
    +++ b/examples/src/filters/glitch.mjs
    @@ -0,0 +1,58 @@
    +export default function ()
    +{
    +    const app = this;
    +    const fillMode = 2; // LOOP
    +
    +    app.addFilter('GlitchFilter', {
    +        args: {
    +            slices: 10,
    +            offset: 100,
    +            direction: 0,
    +            fillMode,
    +            average: false,
    +            red: { x: 2, y: 2 },
    +            green: { x: -10, y: 4 },
    +            blue: { x: 10, y: -4 },
    +            seed: 0.5,
    +        },
    +        oncreate(folder)
    +        {
    +            this.animating = true;
    +
    +            app.events.on('animate', function ()
    +            {
    +                if (this.animating)
    +                {
    +                    this.seed = Math.random();
    +                }
    +            });
    +
    +            folder.add(this, 'animating').name('(animating)');
    +            folder.add(this, 'seed', 0, 1);
    +            folder.add(this, 'slices', 2, 20).onChange((value) =>
    +            {
    +                this.slices = value >> 0;
    +            });
    +            folder.add(this, 'offset', -400, 400);
    +            folder.add(this, 'direction', -180, 180);
    +
    +            const fillModeOptions = {
    +                TRANSPARENT: 0,
    +                ORIGINAL: 1,
    +                LOOP: 2,
    +                CLAMP: 3,
    +                MIRROR: 4,
    +            };
    +
    +            folder.add(this, 'fillMode', fillModeOptions);
    +
    +            folder.add(this.red, 'x', -50, 50).name('red.x');
    +            folder.add(this.red, 'y', -50, 50).name('red.y');
    +            folder.add(this.blue, 'x', -50, 50).name('blue.x');
    +            folder.add(this.blue, 'y', -50, 50).name('blue.y');
    +            folder.add(this.green, 'x', -50, 50).name('green.x');
    +            folder.add(this.green, 'y', -50, 50).name('green.y');
    +            folder.add(this, 'refresh');
    +        },
    +    });
    +}
    diff --git a/examples/src/filters/glow.mjs b/examples/src/filters/glow.mjs
    new file mode 100644
    index 000000000..8500a9cdb
    --- /dev/null
    +++ b/examples/src/filters/glow.mjs
    @@ -0,0 +1,24 @@
    +export default function ()
    +{
    +    this.addFilter('GlowFilter', {
    +        fishOnly: true,
    +        args: {
    +            distance: 15,
    +            outerStrength: 2,
    +            innerStrength: 0,
    +            color: 0xffffff,
    +            quality: 0.2,
    +            knockout: false,
    +        },
    +        oncreate(folder)
    +        {
    +            folder.add(this, 'distance', 0, 20);
    +            folder.add(this, 'innerStrength', 0, 20);
    +            folder.add(this, 'outerStrength', 0, 20);
    +            folder.addColor(this, 'color');
    +            folder.add(this, 'quality', 0, 1);
    +            folder.add(this, 'alpha', 0, 1);
    +            folder.add(this, 'knockout');
    +        },
    +    });
    +}
    diff --git a/examples/src/filters/godray.mjs b/examples/src/filters/godray.mjs
    new file mode 100644
    index 000000000..e54ed2d80
    --- /dev/null
    +++ b/examples/src/filters/godray.mjs
    @@ -0,0 +1,43 @@
    +export default function ()
    +{
    +    const app = this;
    +
    +    this.addFilter('GodrayFilter', {
    +        enabled: false,
    +        args: { center: { x: app.initWidth * 0.5, y: -100 } },
    +        oncreate(folder)
    +        {
    +            this.alpha = 1;
    +            this.light = 30;
    +            this.gain = 0.6;
    +            this.lacunarity = 2.75;
    +            this.animating = true;
    +
    +            app.events.on('enable', (enabled) =>
    +            {
    +                if (enabled && this.animating)
    +                {
    +                    this.time = 0;
    +                }
    +            });
    +
    +            app.events.on('animate', function ()
    +            {
    +                if (this.animating)
    +                {
    +                    this.time += app.ticker.elapsedMS / 1000;
    +                }
    +            });
    +
    +            folder.add(this, 'animating').name('(animating)');
    +            folder.add(this, 'time', 0, 1);
    +            folder.add(this, 'gain', 0, 1);
    +            folder.add(this, 'lacunarity', 0, 5);
    +            folder.add(this, 'alpha', 0, 1);
    +            folder.add(this, 'parallel');
    +            folder.add(this, 'angle', -60, 60);
    +            folder.add(this, 'centerX', -100, app.initWidth + 100).name('center.x');
    +            folder.add(this, 'centerY', -1000, -100).name('center.y');
    +        },
    +    });
    +}
    diff --git a/examples/src/filters/grayscale.mjs b/examples/src/filters/grayscale.mjs
    new file mode 100644
    index 000000000..b32785927
    --- /dev/null
    +++ b/examples/src/filters/grayscale.mjs
    @@ -0,0 +1,4 @@
    +export default function ()
    +{
    +    this.addFilter('GrayscaleFilter');
    +}
    diff --git a/examples/src/filters/hsl-adjustment.mjs b/examples/src/filters/hsl-adjustment.mjs
    new file mode 100644
    index 000000000..206d37312
    --- /dev/null
    +++ b/examples/src/filters/hsl-adjustment.mjs
    @@ -0,0 +1,15 @@
    +export default function ()
    +{
    +    this.addFilter('HslAdjustmentFilter', {
    +        enabled: false,
    +        fishOnly: false,
    +        oncreate(folder)
    +        {
    +            folder.add(this, 'hue', -180, 180);
    +            folder.add(this, 'saturation', -1, 1);
    +            folder.add(this, 'lightness', -1, 1);
    +            folder.add(this, 'colorize');
    +            folder.add(this, 'alpha', 0, 1);
    +        },
    +    });
    +}
    diff --git a/examples/src/filters/index.mjs b/examples/src/filters/index.mjs
    new file mode 100644
    index 000000000..e294af188
    --- /dev/null
    +++ b/examples/src/filters/index.mjs
    @@ -0,0 +1,43 @@
    +/* eslint-disable simple-import-sort/exports */
    +// Order here is the dat-gui order
    +export { default as adjustment } from './adjustment.mjs';
    +export { default as advancedBloom } from './advanced-bloom.mjs';
    +export { default as alpha } from './alpha.mjs';
    +export { default as ascii } from './ascii.mjs';
    +export { default as backdropBlur } from './backdropBlur.mjs';
    +export { default as bevel } from './bevel.mjs';
    +export { default as bloom } from './bloom.mjs';
    +export { default as blur } from './blur.mjs';
    +export { default as bulgePinch } from './bulge-pinch.mjs';
    +export { default as colorGradient } from './color-gradient.mjs';
    +export { default as colorMap } from './color-map.mjs';
    +export { default as colorMatrix } from './color-matrix.mjs';
    +export { default as colorOverlay } from './color-overlay.mjs';
    +export { default as colorReplace } from './color-replace.mjs';
    +export { default as convolution } from './convolution.mjs';
    +export { default as crossHatch } from './cross-hatch.mjs';
    +export { default as crt } from './crt.mjs';
    +export { default as displacement } from './displacement.mjs';
    +export { default as dot } from './dot.mjs';
    +export { default as dropShadow } from './drop-shadow.mjs';
    +export { default as emboss } from './emboss.mjs';
    +export { default as glitch } from './glitch.mjs';
    +export { default as glow } from './glow.mjs';
    +export { default as godray } from './godray.mjs';
    +export { default as grayscale } from './grayscale.mjs';
    +export { default as hslAdjustment } from './hsl-adjustment.mjs';
    +export { default as kawaseBlur } from './kawase-blur.mjs';
    +export { default as motionBlur } from './motion-blur.mjs';
    +export { default as multiColorReplace } from './multi-color-replace.mjs';
    +export { default as noise } from './noise.mjs';
    +export { default as oldFilm } from './old-film.mjs';
    +export { default as outline } from './outline.mjs';
    +export { default as pixelate } from './pixelate.mjs';
    +export { default as radialBlur } from './radial-blur.mjs';
    +export { default as reflection } from './reflection.mjs';
    +export { default as rgb } from './rgb.mjs';
    +export { default as shockwave } from './shockwave.mjs';
    +export { default as simpleLightmap } from './lightmap.mjs';
    +export { default as tiltShift } from './tilt-shift.mjs';
    +export { default as twist } from './twist.mjs';
    +export { default as zoomBlur } from './zoom-blur.mjs';
    diff --git a/examples/src/filters/kawase-blur.mjs b/examples/src/filters/kawase-blur.mjs
    new file mode 100644
    index 000000000..f3212dc83
    --- /dev/null
    +++ b/examples/src/filters/kawase-blur.mjs
    @@ -0,0 +1,15 @@
    +export default function ()
    +{
    +    const app = this;
    +
    +    app.addFilter('KawaseBlurFilter', {
    +        args: { strength: 4, quality: 3, clamp: true },
    +        oncreate(folder)
    +        {
    +            folder.add(this, 'strength', 0, 20);
    +            folder.add(this, 'quality', 1, 20);
    +            folder.add(this, 'pixelSizeX', 0, 10).name('pixelSize.x');
    +            folder.add(this, 'pixelSizeY', 0, 10).name('pixelSize.y');
    +        },
    +    });
    +}
    diff --git a/examples/src/filters/lightmap.mjs b/examples/src/filters/lightmap.mjs
    new file mode 100644
    index 000000000..2bbceb497
    --- /dev/null
    +++ b/examples/src/filters/lightmap.mjs
    @@ -0,0 +1,15 @@
    +export default function ()
    +{
    +    this.addFilter('SimpleLightmapFilter', {
    +        args: { lightMap: this.resources.lightmap, color: 0x666666 },
    +        oncreate(folder)
    +        {
    +            folder.addColor(this, 'color');
    +            folder.add(this, 'alpha', 0, 1);
    +
    +            // eslint-disable-next-line no-empty-function
    +            this._noop = function () {};
    +            folder.add(this, '_noop').name('<img src="./images/lightmap.png" width="220" height="13">');
    +        },
    +    });
    +}
    diff --git a/examples/src/filters/motion-blur.mjs b/examples/src/filters/motion-blur.mjs
    new file mode 100644
    index 000000000..11e5b7ae5
    --- /dev/null
    +++ b/examples/src/filters/motion-blur.mjs
    @@ -0,0 +1,18 @@
    +export default function ()
    +{
    +    const app = this;
    +
    +    app.addFilter('MotionBlurFilter', {
    +        enabled: false,
    +        args: { velocity: { x: 40, y: 40 }, kernelSize: 15 },
    +        oncreate(folder)
    +        {
    +            const filter = this;
    +
    +            folder.add(filter, 'velocityX', -90, 90).name('velocity.x');
    +            folder.add(filter, 'velocityY', -90, 90).name('velocity.y');
    +            folder.add(filter, 'kernelSize', [3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25]).name('kernelSize');
    +            folder.add(filter, 'offset', -150, 150).name('offset');
    +        },
    +    });
    +}
    diff --git a/examples/src/filters/multi-color-replace.mjs b/examples/src/filters/multi-color-replace.mjs
    new file mode 100644
    index 000000000..2cb2c87b8
    --- /dev/null
    +++ b/examples/src/filters/multi-color-replace.mjs
    @@ -0,0 +1,24 @@
    +export default function ()
    +{
    +    const replacements = [
    +        [3238359, 16711680],
    +        [938417, 65280],
    +        [1464209, 16776960],
    +    ];
    +
    +    this.addFilter('MultiColorReplaceFilter', {
    +        args: { replacements, tolerance: 0.2 },
    +        oncreate(folder)
    +        {
    +            const refresh = this.refresh.bind(this);
    +
    +            folder.addColor(replacements[0], '0').name('original 0').onChange(refresh);
    +            folder.addColor(replacements[0], '1').name('target 0').onChange(refresh);
    +            folder.addColor(replacements[1], '0').name('original 1').onChange(refresh);
    +            folder.addColor(replacements[1], '1').name('target 1').onChange(refresh);
    +            folder.addColor(replacements[2], '0').name('original 2').onChange(refresh);
    +            folder.addColor(replacements[2], '1').name('target 2').onChange(refresh);
    +            folder.add(this, 'tolerance', 0, 1);
    +        },
    +    });
    +}
    diff --git a/examples/src/filters/noise.mjs b/examples/src/filters/noise.mjs
    new file mode 100644
    index 000000000..bf0c66c6b
    --- /dev/null
    +++ b/examples/src/filters/noise.mjs
    @@ -0,0 +1,11 @@
    +export default function ()
    +{
    +    this.addFilter('NoiseFilter', {
    +        global: true,
    +        oncreate(folder)
    +        {
    +            folder.add(this, 'noise', 0, 1);
    +            folder.add(this, 'seed', 0.01, 0.99);
    +        },
    +    });
    +}
    diff --git a/examples/src/filters/old-film.mjs b/examples/src/filters/old-film.mjs
    new file mode 100644
    index 000000000..42fc3b138
    --- /dev/null
    +++ b/examples/src/filters/old-film.mjs
    @@ -0,0 +1,29 @@
    +export default function ()
    +{
    +    const app = this;
    +
    +    app.addFilter('OldFilmFilter', {
    +        enabled: false,
    +        global: false,
    +        args: [[app.initWidth / 2, app.initHeight / 2]],
    +        oncreate(folder)
    +        {
    +            const filter = this;
    +
    +            app.events.on('animate', function ()
    +            {
    +                filter.seed = Math.random();
    +            });
    +
    +            folder.add(this, 'sepia', 0, 1);
    +            folder.add(this, 'noise', 0, 1);
    +            folder.add(this, 'noiseSize', 1, 10);
    +            folder.add(this, 'scratch', -1, 1);
    +            folder.add(this, 'scratchDensity', 0, 1);
    +            folder.add(this, 'scratchWidth', 1, 20);
    +            folder.add(this, 'vignetting', 0, 1);
    +            folder.add(this, 'vignettingAlpha', 0, 1);
    +            folder.add(this, 'vignettingBlur', 0, 1);
    +        },
    +    });
    +}
    diff --git a/examples/src/filters/outline.mjs b/examples/src/filters/outline.mjs
    new file mode 100644
    index 000000000..7c51110e2
    --- /dev/null
    +++ b/examples/src/filters/outline.mjs
    @@ -0,0 +1,15 @@
    +export default function ()
    +{
    +    this.addFilter('OutlineFilter', {
    +        enabled: false,
    +        fishOnly: true,
    +        args: { thickness: 4, color: 0x0, quality: 0.25, alpha: 1.0, knockout: false },
    +        oncreate(folder)
    +        {
    +            folder.add(this, 'thickness', 0, 10);
    +            folder.addColor(this, 'color');
    +            folder.add(this, 'alpha', 0, 1);
    +            folder.add(this, 'knockout');
    +        },
    +    });
    +}
    diff --git a/examples/src/filters/pixelate.mjs b/examples/src/filters/pixelate.mjs
    new file mode 100644
    index 000000000..2a361656d
    --- /dev/null
    +++ b/examples/src/filters/pixelate.mjs
    @@ -0,0 +1,8 @@
    +export default function ()
    +{
    +    this.addFilter('PixelateFilter', function (folder)
    +    {
    +        folder.add(this, 'sizeX', 4, 40).name('size.x');
    +        folder.add(this, 'sizeY', 4, 40).name('size.y');
    +    });
    +}
    diff --git a/examples/src/filters/radial-blur.mjs b/examples/src/filters/radial-blur.mjs
    new file mode 100644
    index 000000000..ab9e14f65
    --- /dev/null
    +++ b/examples/src/filters/radial-blur.mjs
    @@ -0,0 +1,17 @@
    +export default function ()
    +{
    +    const app = this;
    +
    +    app.addFilter('RadialBlurFilter', {
    +        args: { angle: 20, center: { x: app.initWidth / 2, y: app.initHeight / 2 }, kernelSize: 15, radius: 300 },
    +        enabled: false,
    +        oncreate(folder)
    +        {
    +            folder.add(this, 'angle', -180, 180);
    +            folder.add(this, 'centerX', 0, app.initWidth).name('center.x');
    +            folder.add(this, 'centerY', 0, app.initHeight).name('center.y');
    +            folder.add(this, 'radius', -1, Math.max(app.initWidth, app.initHeight));
    +            folder.add(this, 'kernelSize', [3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25]).name('kernelSize');
    +        },
    +    });
    +}
    diff --git a/examples/src/filters/reflection.mjs b/examples/src/filters/reflection.mjs
    new file mode 100644
    index 000000000..bf1a28d32
    --- /dev/null
    +++ b/examples/src/filters/reflection.mjs
    @@ -0,0 +1,41 @@
    +export default function ()
    +{
    +    const app = this;
    +
    +    app.addFilter('ReflectionFilter', {
    +        oncreate(folder)
    +        {
    +            const filter = this;
    +
    +            filter.animating = true;
    +
    +            app.events.on('enable', function (enabled)
    +            {
    +                if (enabled && filter.animating)
    +                {
    +                    filter.time = 0;
    +                }
    +            });
    +
    +            app.events.on('animate', function ()
    +            {
    +                if (filter.animating)
    +                {
    +                    filter.time += 0.1;
    +                }
    +            });
    +
    +            folder.add(this, 'animating').name('(animating)');
    +
    +            folder.add(this, 'mirror');
    +            folder.add(this, 'boundary', 0, 1);
    +            folder.add(this, 'amplitudeStart', 0, 50).name('amplitude.start');
    +            folder.add(this, 'amplitudeEnd', 0, 50).name('amplitude.end');
    +            folder.add(this, 'wavelengthStart', 10, 200).name('waveLength.start');
    +            folder.add(this, 'wavelengthEnd', 10, 200).name('waveLength.end');
    +            folder.add(this, 'alphaStart', 0, 1).name('alpha.start');
    +            folder.add(this, 'alphaEnd', 0, 1).name('alpha.end');
    +            folder.add(this, 'time', 0, 20);
    +        },
    +    });
    +}
    diff --git a/examples/src/filters/rgb.mjs b/examples/src/filters/rgb.mjs
    new file mode 100644
    index 000000000..8b1233c6a
    --- /dev/null
    +++ b/examples/src/filters/rgb.mjs
    @@ -0,0 +1,12 @@
    +export default function ()
    +{
    +    this.addFilter('RGBSplitFilter', function (folder)
    +    {
    +        folder.add(this, 'redX', -20, 20).name('red.x');
    +        folder.add(this, 'redY', -20, 20).name('red.y');
    +        folder.add(this, 'blueX', -20, 20).name('blue.x');
    +        folder.add(this, 'blueY', -20, 20).name('blue.y');
    +        folder.add(this, 'greenX', -20, 20).name('green.x');
    +        folder.add(this, 'greenY', -20, 20).name('green.y');
    +    });
    +}
    diff --git a/examples/src/filters/shockwave.mjs b/examples/src/filters/shockwave.mjs
    new file mode 100644
    index 000000000..42ff44f3f
    --- /dev/null
    +++ b/examples/src/filters/shockwave.mjs
    @@ -0,0 +1,42 @@
    +export default function ()
    +{
    +    const app = this;
    +
    +    this.addFilter('ShockwaveFilter', {
    +        enabled: false,
    +        args: { center: { x: app.initWidth / 2, y: app.initHeight / 2 } },
    +        oncreate(folder)
    +        {
    +            const filter = this;
    +            const maxTime = 2.5;
    +
    +            filter.animating = true;
    +
    +            app.events.on('enable', function (enabled)
    +            {
    +                if (enabled && filter.animating)
    +                {
    +                    filter.time = 0;
    +                }
    +            });
    +
    +            app.events.on('animate', function ()
    +            {
    +                if (filter.animating)
    +                {
    +                    filter.time += app.ticker.elapsedMS / 1000;
    +                    filter.time %= maxTime;
    +                }
    +            });
    +
    +            folder.add(this, 'animating').name('(animating)');
    +            folder.add(this, 'speed', 500, 2000);
    +            folder.add(this, 'amplitude', 1, 100);
    +            folder.add(this, 'wavelength', 2, 400);
    +            folder.add(this, 'brightness', 0.2, 2.0);
    +            folder.add(this, 'radius', 100, 2000);
    +            folder.add(this, 'centerX', 0, app.initWidth).name('center.x');
    +            folder.add(this, 'centerY', 0, app.initHeight).name('center.y');
    +        },
    +    });
    +}
    diff --git a/examples/src/filters/tilt-shift.mjs b/examples/src/filters/tilt-shift.mjs
    new file mode 100644
    index 000000000..d08db48c3
    --- /dev/null
    +++ b/examples/src/filters/tilt-shift.mjs
    @@ -0,0 +1,8 @@
    +export default function ()
    +{
    +    this.addFilter('TiltShiftFilter', function (folder)
    +    {
    +        folder.add(this, 'blur', 0, 200);
    +        folder.add(this, 'gradientBlur', 0, 1000);
    +    });
    +}
    diff --git a/examples/src/filters/twist.mjs b/examples/src/filters/twist.mjs
    new file mode 100644
    index 000000000..d4efada34
    --- /dev/null
    +++ b/examples/src/filters/twist.mjs
    @@ -0,0 +1,14 @@
    +export default function ()
    +{
    +    const app = this;
    +
    +    this.addFilter('TwistFilter', function (folder)
    +    {
    +        this.offsetX = app.initWidth / 2;
    +        this.offsetY = app.initHeight / 2;
    +        folder.add(this, 'angle', -10, 10);
    +        folder.add(this, 'radius', 0, app.initWidth);
    +        folder.add(this, 'offsetX', 0, app.initWidth);
    +        folder.add(this, 'offsetY', 0, app.initHeight);
    +    });
    +}
    diff --git a/examples/src/filters/zoom-blur.mjs b/examples/src/filters/zoom-blur.mjs
    new file mode 100644
    index 000000000..14ad910eb
    --- /dev/null
    +++ b/examples/src/filters/zoom-blur.mjs
    @@ -0,0 +1,20 @@
    +export default function ()
    +{
    +    const app = this;
    +
    +    this.addFilter('ZoomBlurFilter', {
    +        args: {
    +            strength: 0.1,
    +            center: { x: app.initWidth / 2, y: app.initHeight / 2 },
    +            innerRadius: 80,
    +        },
    +        oncreate(folder)
    +        {
    +            folder.add(this, 'strength', 0.01, 0.5);
    +            folder.add(this, 'centerX', 0, app.initWidth).name('center.x');
    +            folder.add(this, 'centerY', 0, app.initHeight).name('center.y');
    +            folder.add(this, 'innerRadius', 0, app.initWidth / 2);
    +            folder.add(this, 'radius', 0, app.initWidth / 2);
    +        },
    +    });
    +}
    diff --git a/examples/src/ga.mjs b/examples/src/ga.mjs
    new file mode 100644
    index 000000000..4987209dd
    --- /dev/null
    +++ b/examples/src/ga.mjs
    @@ -0,0 +1,12 @@
    +/* eslint-disable */
    +(function (i, s, o, g, r, a, m)
    +{
    +    i.GoogleAnalyticsObject = r; i[r] = i[r] || function ()
    +    {
    +        (i[r].q = i[r].q || []).push(arguments);
    +    }, i[r].l = Number(new Date()); a = s.createElement(o),
    +    m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m);
    +})(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga');
    +ga('create', 'UA-103772589-3', 'auto');
    +ga('send', 'pageview');
    +/* eslint-enable */
    diff --git a/examples/src/index.mjs b/examples/src/index.mjs
    new file mode 100644
    index 000000000..ab1e334cc
    --- /dev/null
    +++ b/examples/src/index.mjs
    @@ -0,0 +1,32 @@
    +import DemoApplication from './DemoApplication.mjs';
    +import * as filters from './filters/index.mjs';
    +import { getEnabledFiltersFromQueryString } from './utils.mjs';
    +import './ga.mjs';
    +
    +const main = async () =>
    +{
    +    const app = new DemoApplication();
    +
    +    app.enabledFilters = getEnabledFiltersFromQueryString();
    +
    +    await app.init();
    +    await app.load([
    +        { alias: 'background', src: 'images/displacement_BG.jpg' },
    +        { alias: 'overlay', src: 'images/overlay.png' },
    +        { alias: 'map', src: 'images/displacement_map.png' },
    +        { alias: 'fish1', src: 'images/displacement_fish1.png' },
    +        { alias: 'fish2', src: 'images/displacement_fish2.png' },
    +        { alias: 'fish3', src: 'images/displacement_fish3.png' },
    +        { alias: 'fish4', src: 'images/displacement_fish4.png' },
    +        { alias: 'fish5', src: 'images/displacement_fish5.png' },
    +        { alias: 'lightmap', src: 'images/lightmap.png' },
    +        { alias: 'colormap', src: 'images/colormap.png' },
    +    ]);
    +
    +    for (const i in filters)
    +    {
    +        filters[i].call(app);
    +    }
    +};
    +
    +main();
    diff --git a/examples/src/utils.mjs b/examples/src/utils.mjs
    new file mode 100644
    index 000000000..fb0a38f3e
    --- /dev/null
    +++ b/examples/src/utils.mjs
    @@ -0,0 +1,11 @@
    +export function getEnabledFiltersFromQueryString()
    +{
    +    const params = new URLSearchParams(window.location.search);
    +
    +    if (!params.has('enabled'))
    +    {
    +        return [];
    +    }
    +
    +    return params.get('enabled').split(',');
    +}
    diff --git a/screenshots/adjustment.png b/screenshots/adjustment.png
    new file mode 100644
    index 000000000..079f159a4
    Binary files /dev/null and b/screenshots/adjustment.png differ
    diff --git a/screenshots/advanced-bloom.png b/screenshots/advanced-bloom.png
    new file mode 100644
    index 000000000..2ce9f8017
    Binary files /dev/null and b/screenshots/advanced-bloom.png differ
    diff --git a/screenshots/alpha.png b/screenshots/alpha.png
    new file mode 100644
    index 000000000..cdbb821a2
    Binary files /dev/null and b/screenshots/alpha.png differ
    diff --git a/screenshots/ascii.png b/screenshots/ascii.png
    new file mode 100644
    index 000000000..3b9173ef2
    Binary files /dev/null and b/screenshots/ascii.png differ
    diff --git a/screenshots/backdrop-blur.png b/screenshots/backdrop-blur.png
    new file mode 100644
    index 000000000..543f81044
    Binary files /dev/null and b/screenshots/backdrop-blur.png differ
    diff --git a/screenshots/bevel.png b/screenshots/bevel.png
    new file mode 100644
    index 000000000..6449f9780
    Binary files /dev/null and b/screenshots/bevel.png differ
    diff --git a/screenshots/bloom.png b/screenshots/bloom.png
    new file mode 100644
    index 000000000..f54c0889c
    Binary files /dev/null and b/screenshots/bloom.png differ
    diff --git a/screenshots/blur.png b/screenshots/blur.png
    new file mode 100644
    index 000000000..827b796ab
    Binary files /dev/null and b/screenshots/blur.png differ
    diff --git a/screenshots/bulge-pinch.gif b/screenshots/bulge-pinch.gif
    new file mode 100644
    index 000000000..80f6f444f
    Binary files /dev/null and b/screenshots/bulge-pinch.gif differ
    diff --git a/screenshots/color-gradient.png b/screenshots/color-gradient.png
    new file mode 100644
    index 000000000..7f3c00a2f
    Binary files /dev/null and b/screenshots/color-gradient.png differ
    diff --git a/screenshots/color-map.png b/screenshots/color-map.png
    new file mode 100644
    index 000000000..1eeeeb8b3
    Binary files /dev/null and b/screenshots/color-map.png differ
    diff --git a/screenshots/color-matrix-contrast.png b/screenshots/color-matrix-contrast.png
    new file mode 100644
    index 000000000..9a236b0fe
    Binary files /dev/null and b/screenshots/color-matrix-contrast.png differ
    diff --git a/screenshots/color-matrix-desaturate.png b/screenshots/color-matrix-desaturate.png
    new file mode 100644
    index 000000000..b5d73f564
    Binary files /dev/null and b/screenshots/color-matrix-desaturate.png differ
    diff --git a/screenshots/color-matrix-kodachrome.png b/screenshots/color-matrix-kodachrome.png
    new file mode 100644
    index 000000000..917cda30b
    Binary files /dev/null and b/screenshots/color-matrix-kodachrome.png differ
    diff --git a/screenshots/color-matrix-lsd.png b/screenshots/color-matrix-lsd.png
    new file mode 100644
    index 000000000..7288aa82d
    Binary files /dev/null and b/screenshots/color-matrix-lsd.png differ
    diff --git a/screenshots/color-matrix-negative.png b/screenshots/color-matrix-negative.png
    new file mode 100644
    index 000000000..2ac1e68c9
    Binary files /dev/null and b/screenshots/color-matrix-negative.png differ
    diff --git a/screenshots/color-matrix-polaroid.png b/screenshots/color-matrix-polaroid.png
    new file mode 100644
    index 000000000..92a79fdec
    Binary files /dev/null and b/screenshots/color-matrix-polaroid.png differ
    diff --git a/screenshots/color-matrix-predator.png b/screenshots/color-matrix-predator.png
    new file mode 100644
    index 000000000..cc95441d9
    Binary files /dev/null and b/screenshots/color-matrix-predator.png differ
    diff --git a/screenshots/color-matrix-saturate.png b/screenshots/color-matrix-saturate.png
    new file mode 100644
    index 000000000..bc6c40d64
    Binary files /dev/null and b/screenshots/color-matrix-saturate.png differ
    diff --git a/screenshots/color-matrix-sepia.png b/screenshots/color-matrix-sepia.png
    new file mode 100644
    index 000000000..1e88fe1cc
    Binary files /dev/null and b/screenshots/color-matrix-sepia.png differ
    diff --git a/screenshots/color-overlay.png b/screenshots/color-overlay.png
    new file mode 100644
    index 000000000..439f9190b
    Binary files /dev/null and b/screenshots/color-overlay.png differ
    diff --git a/screenshots/color-replace.png b/screenshots/color-replace.png
    new file mode 100644
    index 000000000..48e5e8bbd
    Binary files /dev/null and b/screenshots/color-replace.png differ
    diff --git a/screenshots/convolution.png b/screenshots/convolution.png
    new file mode 100644
    index 000000000..ff54f1828
    Binary files /dev/null and b/screenshots/convolution.png differ
    diff --git a/screenshots/cross-hatch.png b/screenshots/cross-hatch.png
    new file mode 100644
    index 000000000..daefdf247
    Binary files /dev/null and b/screenshots/cross-hatch.png differ
    diff --git a/screenshots/crt.png b/screenshots/crt.png
    new file mode 100644
    index 000000000..5492f3d36
    Binary files /dev/null and b/screenshots/crt.png differ
    diff --git a/screenshots/displacement.png b/screenshots/displacement.png
    new file mode 100644
    index 000000000..877777905
    Binary files /dev/null and b/screenshots/displacement.png differ
    diff --git a/screenshots/dot.png b/screenshots/dot.png
    new file mode 100644
    index 000000000..d192b6b0d
    Binary files /dev/null and b/screenshots/dot.png differ
    diff --git a/screenshots/drop-shadow.png b/screenshots/drop-shadow.png
    new file mode 100644
    index 000000000..bd6a62e56
    Binary files /dev/null and b/screenshots/drop-shadow.png differ
    diff --git a/screenshots/emboss.png b/screenshots/emboss.png
    new file mode 100644
    index 000000000..ccc12b37e
    Binary files /dev/null and b/screenshots/emboss.png differ
    diff --git a/screenshots/glitch.png b/screenshots/glitch.png
    new file mode 100644
    index 000000000..3e2369030
    Binary files /dev/null and b/screenshots/glitch.png differ
    diff --git a/screenshots/glow.png b/screenshots/glow.png
    new file mode 100644
    index 000000000..1b4c0de84
    Binary files /dev/null and b/screenshots/glow.png differ
    diff --git a/screenshots/godray.gif b/screenshots/godray.gif
    new file mode 100644
    index 000000000..a7e43411e
    Binary files /dev/null and b/screenshots/godray.gif differ
    diff --git a/screenshots/grayscale.png b/screenshots/grayscale.png
    new file mode 100644
    index 000000000..5bcfea75d
    Binary files /dev/null and b/screenshots/grayscale.png differ
    diff --git a/screenshots/hsl-adjustment.png b/screenshots/hsl-adjustment.png
    new file mode 100644
    index 000000000..c852a146f
    Binary files /dev/null and b/screenshots/hsl-adjustment.png differ
    diff --git a/screenshots/kawase-blur.png b/screenshots/kawase-blur.png
    new file mode 100644
    index 000000000..92f4f0da1
    Binary files /dev/null and b/screenshots/kawase-blur.png differ
    diff --git a/screenshots/motion-blur.png b/screenshots/motion-blur.png
    new file mode 100644
    index 000000000..668abb2a2
    Binary files /dev/null and b/screenshots/motion-blur.png differ
    diff --git a/screenshots/multi-color-replace.png b/screenshots/multi-color-replace.png
    new file mode 100644
    index 000000000..f03f31a9d
    Binary files /dev/null and b/screenshots/multi-color-replace.png differ
    diff --git a/screenshots/noise.png b/screenshots/noise.png
    new file mode 100644
    index 000000000..6c26238f9
    Binary files /dev/null and b/screenshots/noise.png differ
    diff --git a/screenshots/old-film.gif b/screenshots/old-film.gif
    new file mode 100644
    index 000000000..46fbf5fe4
    Binary files /dev/null and b/screenshots/old-film.gif differ
    diff --git a/screenshots/original.png b/screenshots/original.png
    new file mode 100644
    index 000000000..a0a24c977
    Binary files /dev/null and b/screenshots/original.png differ
    diff --git a/screenshots/outline.png b/screenshots/outline.png
    new file mode 100644
    index 000000000..53ffa98fc
    Binary files /dev/null and b/screenshots/outline.png differ
    diff --git a/screenshots/pixelate.png b/screenshots/pixelate.png
    new file mode 100644
    index 000000000..138b3a21d
    Binary files /dev/null and b/screenshots/pixelate.png differ
    diff --git a/screenshots/radial-blur.png b/screenshots/radial-blur.png
    new file mode 100644
    index 000000000..4be165bb2
    Binary files /dev/null and b/screenshots/radial-blur.png differ
    diff --git a/screenshots/reflection.png b/screenshots/reflection.png
    new file mode 100644
    index 000000000..3885622e4
    Binary files /dev/null and b/screenshots/reflection.png differ
    diff --git a/screenshots/rgb.png b/screenshots/rgb.png
    new file mode 100644
    index 000000000..f1d745313
    Binary files /dev/null and b/screenshots/rgb.png differ
    diff --git a/screenshots/shockwave.gif b/screenshots/shockwave.gif
    new file mode 100644
    index 000000000..c72aed6e8
    Binary files /dev/null and b/screenshots/shockwave.gif differ
    diff --git a/screenshots/simple-lightmap.png b/screenshots/simple-lightmap.png
    new file mode 100644
    index 000000000..30b456581
    Binary files /dev/null and b/screenshots/simple-lightmap.png differ
    diff --git a/screenshots/tilt-shift.png b/screenshots/tilt-shift.png
    new file mode 100644
    index 000000000..01e79aaf3
    Binary files /dev/null and b/screenshots/tilt-shift.png differ
    diff --git a/screenshots/twist.png b/screenshots/twist.png
    new file mode 100644
    index 000000000..22e2f9467
    Binary files /dev/null and b/screenshots/twist.png differ
    diff --git a/screenshots/zoom-blur.png b/screenshots/zoom-blur.png
    new file mode 100644
    index 000000000..e3fa12b81
    Binary files /dev/null and b/screenshots/zoom-blur.png differ