UNPKG

@arcgis/core

Version:

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

6 lines (5 loc) 2.58 kB
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.32/esri/copyright.txt for details. */ import r from"./aspectProcessor.js";import e from"./bandArithmeticProcessor.js";import o from"./colormapToRGBProcessor.js";import t from"./compositeBandProcessor.js";import s from"./computeChangeProcessor.js";import c from"./contrastProcessor.js";import i from"./convolutionProcessor.js";import n from"./curvatureProcessor.js";import m from"./extractBandProcessor.js";import a from"./focalStatisticsProcessor.js";import p from"./grayscaleProcessor.js";import l from"./hillshadeProcessor.js";import u from"./localProcessor.js";import f from"./maskProcessor.js";import j from"./ndviProcessor.js";import d from"./remapProcessor.js";import P from"./reprojectProcessor.js";import h from"./slopeProcessor.js";import g from"./stretchProcessor.js";import{SizedPixelFormat as w,TextureSamplingMode as T,PixelType as b,TextureWrapMode as x}from"../../../../webgl/enums.js";import{Texture as v}from"../../../../webgl/Texture.js";import{TextureDescriptor as A}from"../../../../webgl/TextureDescriptor.js";const F=new Map;function R(r,e){const o=new A;return o.width=r,o.height=e,o.internalFormat=w.RGBA32F,o.samplingMode=T.NEAREST,o.dataType=b.FLOAT,o.isImmutable=!0,o.wrapMode=x.CLAMP_TO_EDGE,o}function y(r,e,o,t){const{context:s,requestRender:c,allowDelayedRender:i}=r,n=t.createProgram(r,o);return i&&null!=c&&!n.compiled?(c(),null):(s.bindFramebuffer(e),s.setViewport(0,0,e.width,e.height),s.useProgram(n),n)}function B(r){return F.get(r.toLowerCase())}function C(r,e,o,t){const s=r.rasterFunction.name.toLowerCase(),c="reproject"===s?P:B(s);if(null==c)return;const i=y(r,o,t,c);if(!i)return;c.bindTextureAndUniforms(r,i,t);const{interpolation:n}=t;"reproject"===s&&(t.interpolation="nearest"),e.draw();const[m,a]=t.getRasterTextureSize("reproject"===s),p=R(m,a),l=new v(r.context,p);if(o.copyToTexture(0,0,m,a,0,0,l),"reproject"===s)t.rasterTexture=l,t.projected=!0,t.interpolation=n;else{const e=r.hasBranches?r.rasterFunction.id:0;t.functionTextures[e]=l}}F.set("arithmetic",u),F.set("aspect",r),F.set("bandarithmetic",e),F.set("colormaptorgb",o),F.set("computechange",s),F.set("compositeband",t),F.set("convolution",i),F.set("contrastbrightness",c),F.set("curvature",n),F.set("extractband",m),F.set("statistics",a),F.set("grayscale",p),F.set("hillshade",l),F.set("shadedrelief",l),F.set("local",u),F.set("mask",f),F.set("ndvi",j),F.set("remap",d),F.set("slope",h),F.set("stretch",g);export{R as createTextureDescriptor,C as process};