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