/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import{__decorate as t,__param as e}from"tslib";import{GraphShaderModule as r,FragmentOutput as o,location as s,uniform as i,texture as a,input as n,VertexInput as p,UniformGroup as u,FragmentInput as d}from"../../GraphShaderModule.js";import{Vec4 as l,IVec2 as m,Int as f,texelFetch as x,Vec2 as g,Sampler2D as h}from"../../graph/glsl.js";import{uvToClip as w,sum4 as c}from"./utils.js";class y extends p{}t([s(0,g)],y.prototype,"position",void 0);class v extends d{}class T extends u{}t([i(f)],T.prototype,"width",void 0),t([i(f)],T.prototype,"height",void 0);class D extends r{constructor(){super(...arguments),this.type="TextureStatisticsSumOfSquaredDiffShader"}vertex(t){const e=t.position;return{uv:e,glPosition:new l(w(e),0,1)}}fragment(t){const e=new o,r=t.glFragCoord.xy,s=new m(r.multiply(2)),i=new f(0),a=x(this.sumTexture,s,i),n=x(this.sumTexture,s.add(new m(-1,0)),i),p=x(this.sumTexture,s.add(new m(0,-1)),i),u=x(this.sumTexture,s.add(new m(-1,-1)),i),d=c(a,n,p,u);return e.fragData0=d,e.fragData1=new l(0),e.fragData2=new l(0),e.fragData3=new l(0),e}}t([i(T)],D.prototype,"config",void 0),t([a(h)],D.prototype,"sumTexture",void 0),t([e(0,n(y))],D.prototype,"vertex",null),t([e(0,n(v))],D.prototype,"fragment",null);export{D as TextureStatisticsSumOfSquaredDiffShader};
