/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import{__decorate as t}from"tslib";import{define as e,option as o,texture as a,UniformGroup as r,TextureGroup as s,uniform as i}from"../../../../GraphShaderModule.js";import{texture2D as n,Vec3 as p,Float as u,Mat3 as h,Sampler2D as l}from"../../../../graph/glsl.js";class m extends r{}t([i(u)],m.prototype,"image1Const",void 0),t([i(h)],m.prototype,"imageSwap",void 0);class g extends r{}t([i(u)],g.prototype,"image1Const",void 0),t([i(u)],g.prototype,"image2Const",void 0),t([i(h)],g.prototype,"imageSwap",void 0);class c extends s{}t([a(l)],c.prototype,"image1",void 0);class y extends s{}t([a(l)],y.prototype,"image1",void 0),t([a(l)],y.prototype,"image2",void 0);const d=r=>{const s=r;class i extends s{constructor(){super(...arguments),this.constantCount=0,this.imageCount=1}_getRasterValues(t){const{imageCount:e}=this;if(1===e){const e=n(this.texture,t);return{a:e.r,b:e.g,c:e.b,alpha:e.a}}if(2===e){const e=this._getTwoValues(t);return{a:e.a,b:e.b,c:e.b,alpha:e.alpha}}return this._getThreeValues(t)}_getTwoValues(t){const e=n(this.texture,t);if(1===this.constantCount){const{imageSwap:t,image1Const:o}=this.twoRasterConfig,a=t.multiply(new p(e.r,o,0));return{a:a.x,b:a.y,alpha:e.a}}const o=n(this.twoRasterTextures.image1,t);return{a:e.r,b:o.r,alpha:e.a.multiply(o.a)}}_getThreeValues(t){const e=n(this.texture,t),{imageSwap:o,image1Const:a,image2Const:r}=this.threeRasterConfig;if(2===this.constantCount){const t=o.multiply(new p(e.r,a,r));return{a:t.x,b:t.y,c:t.z,alpha:e.a}}if(1===this.constantCount){const r=n(this.threeRasterTextures.image1,t),s=o.multiply(new p(e.r,r.r,a));return{a:s.x,b:s.y,c:s.z,alpha:e.a.multiply(r.a)}}const s=n(this.threeRasterTextures.image1,t),i=n(this.threeRasterTextures.image2,t);return{a:e.r,b:s.r,c:i.r,alpha:e.a.multiply(s.a).multiply(i.a)}}}return t([e],i.prototype,"constantCount",void 0),t([e],i.prototype,"imageCount",void 0),t([o(m)],i.prototype,"twoRasterConfig",void 0),t([o(g)],i.prototype,"threeRasterConfig",void 0),t([a(c)],i.prototype,"twoRasterTextures",void 0),t([a(y)],i.prototype,"threeRasterTextures",void 0),i};export{d as MultiRasterMixin,y as ThreeRasterTextures,c as TwoRasterTextures};
