UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

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