UNPKG

@arcgis/core

Version:

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

6 lines (5 loc) 1.91 kB
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.33/esri/copyright.txt for details. */ import{_ as o,a as t}from"../../../../../../../chunks/tslib.es6.js";import{uniform as e,location as r,option as s,define as p,input as l,UniformGroup as i,VertexInput as d,GraphShaderModule as n,FragmentOutput as a,FragmentInput as c}from"../../GraphShaderModule.js";import{Float as v,Vec4 as y,FixedArray as f,Vec2 as u,Vec3 as h,equal as x,ifElse as m,Int as w,and as g,lessThan as C,greaterThan as b}from"../../graph/glsl.js";class j extends i{}o([e(v)],j.prototype,"zoomLevel",void 0);class k extends i{getColor(o){const t=this.validValues.findIndex((t=>x(t,o)));return m(x(t,new w(-1)),this.colorFallback,this.color)}}o([e(y)],k.prototype,"color",void 0),o([e(y)],k.prototype,"colorFallback",void 0),o([e(f.ofType(v,4))],k.prototype,"validValues",void 0);class z extends d{}o([r(0,u)],z.prototype,"pos",void 0),o([r(1,h)],z.prototype,"id",void 0),o([r(2,v)],z.prototype,"bitset",void 0),o([r(3,u)],z.prototype,"offset",void 0),o([r(4,v)],z.prototype,"size",void 0),o([r(5,y)],z.prototype,"color",void 0);class D extends c{}class F extends n{constructor(){super(...arguments),this.type="TestShader"}vertex(o){const{size:t,offset:e,pos:r}=o;let s=o.color;this.dataDrivenColor&&(s=this.dataDrivenColor.getColor(new v(1)));const p=e.multiply(t);return{glPosition:new y(r.add(p),0,1),color:s,offset:e}}fragment(o){const t=new a,{offset:e}=o;return t.discard=g(b(e.x,new v(-.5)),b(e.y,new v(-.5)),C(e.x,new v(.5)),C(e.y,new v(.5))),this.returnRed?t.fragColor=new y(1,0,0,1):t.fragColor=o.color,t}}o([s(k)],F.prototype,"dataDrivenColor",void 0),o([e(j)],F.prototype,"view",void 0),o([p],F.prototype,"returnRed",void 0),o([t(0,l(z))],F.prototype,"vertex",null),o([t(0,l(D))],F.prototype,"fragment",null);export{k as DataDrivenColorByValueMatch,F as TestShader};