/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import{__decorate as t,__param as o}from"tslib";import{GraphShaderModule as i,FragmentOutput as e,location as r,uniform as p,texture as s,define as c,input as l,VertexInput as n,UniformGroup as a,FragmentInput as d}from"../../GraphShaderModule.js";import{Vec3 as y,Vec4 as m,texture2D as u,Vec2 as f,Mat3 as g,Float as h,Sampler2D as x}from"../../graph/glsl.js";import{sampleBicubicBSpline as v}from"./bitmapUtils.js";class b extends n{}t([r(0,f)],b.prototype,"position",void 0);class S extends d{}class w extends a{}t([p(g)],w.prototype,"dvsMat3",void 0),t([p(f)],w.prototype,"coordScale",void 0),t([p(h)],w.prototype,"opacity",void 0);class j extends i{constructor(){super(...arguments),this.type="BitmapShader"}vertex(t){const o=this.config.dvsMat3.multiply(new y(t.position.multiply(this.config.coordScale),1));return{glPosition:new m(o,1),texcoord:t.position}}fragment(t){const o=new e;let i;return i=this.bicubic?v(this.texture,t.texcoord,this.config.coordScale):u(this.texture,t.texcoord),o.fragColor=new m(i.rgb.multiply(this.config.opacity),i.a.multiply(this.config.opacity)),o}}t([p(w)],j.prototype,"config",void 0),t([s(x)],j.prototype,"texture",void 0),t([c],j.prototype,"bicubic",void 0),t([o(0,l(b))],j.prototype,"vertex",null),t([o(0,l(S))],j.prototype,"fragment",null);export{j as BitmapShader};
