/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import{__decorate as t}from"tslib";import{uniform as r,define as e,UniformGroup as i}from"../../../../GraphShaderModule.js";import{negate as s,dot as o,Vec3 as a,Vec4 as u,Float as d}from"../../../../graph/glsl.js";import{getSurfaceValues as p}from"../surface.js";import{BaseRasterProcessorShader as l}from"./BaseRasterProcessorShader.js";class c extends i{}t([r(d)],c.prototype,"zlFactor",void 0);class m extends l{constructor(){super(...arguments),this.type="CurvatureShader"}_process(t){const{texture:r}=this.config,e=p(r,t,this.config.srcImageSize),i=e[3].add(e[5]).multiply(.5).subtract(e[4]),d=e[1].add(e[7]).multiply(.5).subtract(e[4]),{zlFactor:l}=this.curvatureConfig,{curvatureType:c}=this;let m;if("standard"===c)m=s(l).multiply(i.add(d));else{const t=e[2].subtract(e[0]).add(e[6]).subtract(e[8]).divide(4),r=e[5].subtract(e[3]).divide(2),u=e[1].subtract(e[7]).divide(2),p=r.multiply(r),n=u.multiply(u),y=r.multiply(u),f=l.divide(p.add(n));m="profile"===c?o(new a(i,d,t),new a(p,n,y)).multiply(f):o(new a(i,d,s(t)),new a(n,p,y)).multiply(s(f))}return new u(m,m,m,e[9])}}t([e],m.prototype,"curvatureType",void 0),t([r(c)],m.prototype,"curvatureConfig",void 0);export{m as CurvatureShader};
