@arcgis/core 5.2.0-next.41 → 5.2.0-next.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/321dbc60f44819c2b4de.js +1 -0
- package/assets/esri/core/workers/chunks/399e23d777a043efa9f1.js +1 -0
- package/assets/esri/core/workers/chunks/5133083222588799493f.js +1 -0
- package/assets/esri/core/workers/chunks/{2b8909a488cf3b231eec.js → 590e977f8eeb379b86c8.js} +8 -8
- package/assets/esri/core/workers/chunks/{7ea65aa6d3e684e12082.js → 67468c50ecb1fbedda87.js} +1 -1
- package/assets/esri/core/workers/chunks/{b45a013039bbd2614525.js → 7684f0c771d312e05bb4.js} +7 -7
- package/assets/esri/core/workers/chunks/{dd65c32ae55fcf1282fe.js → 934044f2ef6ce199b399.js} +1 -1
- package/assets/esri/core/workers/chunks/c1845682cc9a5aac8703.js +261 -0
- package/assets/esri/core/workers/chunks/{4056659d5c7698265129.js → d66d58ed5d66520ab1bf.js} +1 -1
- package/assets/esri/core/workers/chunks/{aa0fb77c62a2d4eb20a5.js → e6b5c015205d38abe037.js} +1 -1
- package/assets/esri/core/workers/chunks/f4eda59ec1e816ecc827.js +1 -0
- package/assets/esri/core/workers/chunks/f8f0de841be17cd05c8f.js +1 -0
- package/assets/esri/themes/base/_core.scss +0 -6
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/CutFillMinMaxDepth.glsl.js +2 -0
- package/chunks/CutFillTotalDepth.glsl.js +2 -0
- package/chunks/EdgeShader.glsl.js +9 -9
- package/chunks/GaussianSplat.glsl.js +1 -1
- package/chunks/cameraUtilsSpherical.js +1 -1
- package/config.js +1 -1
- package/editing/geometry/coordUtils.js +1 -1
- package/geohash/geohashUtils.js +1 -1
- package/geometry/support/aaBoundingRect.js +1 -1
- package/geometry/support/quantizationUtils.js +1 -1
- package/intl/date.js +1 -1
- package/kernel.js +1 -1
- package/layers/graphics/featureConversionUtils.js +1 -1
- package/layers/graphics/sources/support/sourceUtils.js +1 -1
- package/layers/raster/formats/Lerc.js +1 -1
- package/layers/support/fieldUtils.js +1 -1
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/views/2d/engine/vectorTiles/GeometryUtils.js +1 -1
- package/views/2d/engine/webgl/Painter.js +1 -1
- package/views/2d/engine/webgl/effects/FeatureEffect.js +1 -1
- package/views/2d/engine/webgl/effects/HighlightEffect.js +1 -1
- package/views/2d/engine/webgl/effects/highlight/HighlightGradient.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/segmentUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/TextureStatisticsTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BitBlitShader.js +2 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/DebugOverlayShader.js +2 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/HighlightShader.js +2 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/WorldExtentStencilShader.js +2 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/utility/BitBlitTechnique.js +2 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/utility/DebugOverlayTechnique.js +2 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/utility/HighlightTechnique.js +2 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/utility/WorldExtentClipTechnique.js +2 -0
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/support/DebugOverlay.js +1 -1
- package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
- package/views/3d/layers/i3s/I3SNode.js +1 -1
- package/views/3d/layers/i3s/SphereCone.js +1 -1
- package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
- package/views/3d/support/cameraUtilsSpherical.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/webgl/RenderCamera.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/Laserline.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/util/emissionFilter.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
- package/views/3d/webgl-engine/effects/glow/Glow.js +1 -1
- package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
- package/views/3d/webgl-engine/lib/CutFillComputation.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatShadows.js +1 -1
- package/views/3d/webgl-engine/lib/IntersectorInterfaces.js +1 -1
- package/views/3d/webgl-engine/lib/PolygonIntersections2D.js +2 -0
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
- package/views/3d/webgl-engine/{shaders/sources/edgeRenderer → lib/edgeRendering}/AdjustProjectedPosition.glsl.js +1 -1
- package/views/3d/webgl-engine/{shaders/sources/edgeRenderer → lib/edgeRendering}/DiscardNonSilhouetteEdges.glsl.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeShader.glsl.js +1 -1
- package/views/3d/webgl-engine/{shaders/sources/edgeRenderer → lib/edgeRendering}/EdgeUtil.glsl.js +1 -1
- package/views/3d/webgl-engine/{shaders/sources/edgeRenderer → lib/edgeRendering}/LineAmplitude.glsl.js +1 -1
- package/views/3d/webgl-engine/{shaders/sources/edgeRenderer → lib/edgeRendering}/LineOffset.glsl.js +1 -1
- package/views/3d/webgl-engine/{shaders/sources/edgeRenderer → lib/edgeRendering}/UnpackAttributes.glsl.js +1 -1
- package/views/3d/webgl-engine/lib/screenPolygonTriangleIntersections.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/TriangleMaterial.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/shaders/CutFillMinMaxDepth.glsl.js +2 -0
- package/views/3d/webgl-engine/shaders/CutFillMinMaxDepthTechnique.js +2 -0
- package/views/3d/webgl-engine/shaders/{CutFillDepth.glsl.js → CutFillTotalDepth.glsl.js} +1 -1
- package/views/3d/webgl-engine/shaders/CutFillTotalDepthTechnique.js +2 -0
- package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +1 -1
- package/views/input/BrowserEventSource.js +1 -1
- package/views/input/InputManager.js +1 -1
- package/views/interactive/snapping/snappingUtils.js +1 -1
- package/views/support/euclideanLengthMeasurementUtils.js +1 -1
- package/views/webgl/VertexAttributeLayouts.js +1 -1
- package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/multipleChoiceInputUtils.js +1 -1
- package/widgets/Legend/support/relationshipRampUtils.js +1 -1
- package/widgets/OrientedImageryViewer/utils.js +1 -1
- package/assets/esri/core/workers/chunks/002356e675769d20e5c0.js +0 -1
- package/assets/esri/core/workers/chunks/06e71d52773eb656a4bf.js +0 -261
- package/assets/esri/core/workers/chunks/352d144d7651da8a29c9.js +0 -1
- package/assets/esri/core/workers/chunks/4f2a61dfae6ca8ed1ec8.js +0 -1
- package/assets/esri/core/workers/chunks/ea8f224da4c5c95a3547.js +0 -1
- package/assets/esri/core/workers/chunks/f30578843f4faefd53b4.js +0 -1
- package/assets/esri/themes/base/_colorVariables.scss +0 -1
- package/assets/esri/themes/base/widgets/_DatePicker.scss +0 -170
- package/assets/esri/themes/base/widgets/_FeatureUtilityNetworkAssociationList.scss +0 -13
- package/assets/esri/themes/base/widgets/_TimePicker.scss +0 -15
- package/chunks/CutFillDepth.glsl.js +0 -2
- package/core/PLRUCache.js +0 -2
- package/views/2d/engine/webgl/BitBlitRenderer.js +0 -2
- package/views/2d/engine/webgl/WorldExtentClipRenderer.js +0 -2
- package/views/2d/engine/webgl/effects/highlight/HighlightRenderer.js +0 -2
- package/views/2d/engine/webgl/shaders/BitBlitPrograms.js +0 -2
- package/views/2d/engine/webgl/shaders/HighlightPrograms.js +0 -2
- package/views/2d/engine/webgl/shaders/StencilPrograms.js +0 -2
- package/views/3d/webgl-engine/shaders/CutFillDepthTechnique.js +0 -2
- package/views/3d/webgl-engine/shaders/CutFillDepthTechniqueConfiguration.js +0 -2
- package/views/support/euclideanAreaMeasurementUtils.js +0 -2
- package/widgets/ShadowCast/ShadowVisualizationType.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{distanceToSegmentSquared as t}from"../../../../geometry/support/coordsUtils.js";import{Point as n}from"../../../../geometry/support/TileClipper.js";const r=Number.POSITIVE_INFINITY,o=Math.PI,e=2*o,i=128/o,
|
|
2
|
+
import{distanceToSegmentSquared as t}from"../../../../geometry/support/coordsUtils.js";import{Point as n}from"../../../../geometry/support/TileClipper.js";const r=Number.POSITIVE_INFINITY,o=Math.PI,e=2*o,i=128/o,s=256/360,u=o/180,c=1/Math.LN2;function a(t,n){return(t%=n)>=0?t:t+n}function f(t){return a(t*i,256)}function l(t){return a(t*s,256)}function h(t){return Math.log(t)*c}function m(t,n,r){return t*(1-r)+n*r}const p=8,g=14,x=16;function y(t){return p+Math.max((t-g)*x,0)}function M(t,n,r){let o,e,i,s=0;for(const u of r){o=u.length;for(let r=1;r<o;++r){if(e=u[r-1],i=u[r],e.y>n==i.y>n)continue;(i.x-e.x)*(n-e.y)-(i.y-e.y)*(t-e.x)>0?s++:s--}}return 0!==s}function d(n,r,o,e){let i,s,u,c;const a=e*e;for(const f of o){const o=f.length;if(!(o<2)){i=f[0].x,s=f[0].y;for(let e=1;e<o;++e){if(u=f[e].x,c=f[e].y,t(n,r,i,s,u,c)<a)return!0;i=u,s=c}}}return!1}function I(t,n,r,o,e,i,s){const u=Math.max(o,Math.min(n,i))-n,c=Math.max(e,Math.min(r,s))-r;return u*u+c*c<=t*t}function N(t,r){if(0===r||Number.isNaN(r))return t;const o=[],e=new n(0,0),i=new n(0,0),s=new n(0,0);for(let u=0;u<t.length;u++){const c=t[u],a=[];for(let t=0;t<c.length;t++){const o=c[t-1],u=c[t],f=c[t+1];0===t?e.setCoords(0,0):e.assignSub(u,o).normalize().rightPerpendicular(),t===c.length-1?i.setCoords(0,0):i.assignSub(f,u).normalize().rightPerpendicular(),s.assignAdd(e,i).normalize();const l=s.x*i.x+s.y*i.y;0!==l&&s.scale(1/l),a.push(n.add(u,s.scale(r)))}o.push(a)}return o}function w(t,r,o,e){const i=new n(t[0],t[1]);if(i.scale(e),"viewport"===r){const t=-o*(Math.PI/180),n=Math.cos(t),r=Math.sin(t);i.rotate(n,r)}return i}export{e as c2pi,s as cDegTo256,u as cDegToRad,r as cInfinity,o as cPi,i as cRadTo256,l as degToByte,d as distanceFromToPolylineWithinThreshold,y as getTileMargins,m as interpolate,I as isCircleOverlapingRect,h as log2,N as offsetLine,M as pointInPolygon,a as positiveMod,f as radToByte,w as translateAnchor};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import"../../../../core/has.js";import{
|
|
2
|
+
import"../../../../core/has.js";import{destroyMaybe as e}from"../../../../core/maybe.js";import t from"./MaterialManager.js";import{RenderingDevice as s}from"./RenderingDevice.js";import i from"./TextureManager.js";import{TextureUploadManager as r}from"./TextureUploadManager.js";import{BlendEffect as n}from"./effects/BlendEffect.js";import{FeatureEffect as o}from"./effects/FeatureEffect.js";import a from"./effects/HighlightEffect.js";import{HittestEffect as h}from"./effects/HittestEffect.js";import{EffectManager as f}from"./effects/post-processing/EffectManager.js";import{SimpleMesh as l}from"./meshing/SimpleMesh.js";import{BitBlitTechnique as c}from"./shaderGraph/techniques/utility/BitBlitTechnique.js";import{WorldExtentClipTechnique as d}from"./shaderGraph/techniques/utility/WorldExtentClipTechnique.js";import{SizedDepthStencilFormat as u}from"../../../webgl/enums.js";import{DisposableFramebufferObject as p}from"../../../webgl/FramebufferObject.js";import{Renderbuffer as g}from"../../../webgl/Renderbuffer.js";import{RenderbufferDescriptor as b}from"../../../webgl/RenderbufferDescriptor.js";import{TextureDescriptor as _}from"../../../webgl/TextureDescriptor.js";class m{constructor(e,u){this.context=e,this._blitTechnique=new c,this._worldExtentClipTechnique=new d,this._lastWidth=null,this._lastHeight=null,this._blendEffect=new n,this._stencilBuf=null,this._prevBeforeLayerFBOStack=[],this._fboPool=[],this.effects={highlight:new a,hittest:new h,insideEffect:new o("inside"),outsideEffect:new o("outside")},this.materialManager=new t(e),this.textureManager=new i(u),this.textureUploadManager=new r(u),this._effectsManager=new f,this._quadMesh=l.fromVertexStream(e,[0,0,1,0,0,1,1,1]),this._renderingDevice=new s}dispose(){if(this.materialManager.dispose(),this.textureManager.dispose(),this.textureUploadManager.destroy(),this._blitTechnique.shutdown(),this._worldExtentClipTechnique.shutdown(),this._quadMesh=e(this._quadMesh),this._fbos){let e;for(e in this._fbos)this._fbos[e]&&this._fbos[e].dispose()}for(const e of this._fboPool)e.dispose();if(this._fboPool.length=0,this.effects){let e;for(e in this.effects)this.effects[e]&&this.effects[e].dispose()}this._effectsManager.dispose(),this._blendEffect.dispose(this.context),this._renderingDevice.dispose()}get quadMesh(){return this._quadMesh}getFbos(){if(!this._fbos)throw new Error("InternalError: Painter FBOs not initialized");return this._fbos}acquireFbo(e,t){let s;if(this._fboPool.length>0)s=this._fboPool.pop();else{const i=new _(e,t);i.samplingMode=9728,i.wrapMode=33071,s=new p(this.context,i,this._stencilBuf)}return s.width===e&&s.height===t||s.resize(e,t),s}releaseFbo(e){this._fboPool.push(e)}getSharedStencilBuffer(){return this._stencilBuf}beforeRenderPhases(e,t,s){const{context:i}=e;this._worldExtentClipTechnique.render(e,{backgroundColor:t,padding:s});const{width:r,height:n}=i.getViewport();if(this.updateFBOs(r,n),this._prevFBO=i.boundFramebuffer,i.bindFramebuffer(this.getFbos().output),i.setColorMask(!0,!0,!0,!0),null!=t){const{r:e,g:s,b:r,a:n}=t;i.setClearColor(n*e/255,n*s/255,n*r/255,n)}else i.setClearColor(0,0,0,0);i.setDepthWriteEnabled(!0),i.setClearDepth(1),i.clear(16640),i.setDepthWriteEnabled(!1)}afterRenderPhases(e){const{context:t}=e;t.bindFramebuffer(this._prevFBO),this._blitTechnique.render(e,{texture:this.getFbos().output.colorTexture,samplingMode:9728,opacity:1,clipToVisibleRegion:!0}),this._renderingDevice.setPipelineStateNeedsUpdate(!0)}beforeRenderLayer(e,t,s){const{context:i,blendMode:r,effects:n,drawPhase:o,requireFBO:a}=e;if(i.setClearColor(0,0,0,0),a||w(o,r,n,s)){const e=i.boundFramebuffer;this._prevBeforeLayerFBOStack.push(e);const{width:t,height:s}=i.getViewport(),r=this.acquireFbo(t,s);i.bindFramebuffer(r),i.setColorMask(!0,!0,!0,!0),i.setClearColor(0,0,0,0),i.setDepthWriteEnabled(!0),i.setClearDepth(1),i.clear(16640),i.setDepthWriteEnabled(!1)}i.setDepthWriteEnabled(!1),i.setDepthTestEnabled(!1),i.setStencilTestEnabled(!0),i.setClearStencil(t),i.setStencilWriteMask(255),i.clear(1024)}afterRenderLayer(e,t){const{context:s,blendMode:i,effects:r,requireFBO:n,drawPhase:o}=e;if(n||w(o,i,r,t)){const n=s.boundFramebuffer;if(null==n)return;null!=r&&r.length>0&&1===o&&(s.setColorMask(!0,!0,!0,!0),this._applyEffects(e,r,n)),s.bindFramebuffer(this._prevBeforeLayerFBOStack.pop()),s.setStencilTestEnabled(!1),s.setStencilWriteMask(0),s.setBlendingEnabled(!0),s.setBlendFunctionSeparate(1,771,1,771),s.setColorMask(!0,!0,!0,!0);const a=null==i||16===o||2===o||128===o?"normal":i;this._blendEffect.draw(e,n.colorTexture,9728,a,t),this.releaseFbo(n)}}blitTexture(e,t,s,i=1){this._blitTechnique.render(e,{texture:t,samplingMode:s,opacity:i}),this._renderingDevice.setPipelineStateNeedsUpdate(!0)}getPostProcessingEffects(e){return this._effectsManager.getPostProcessingEffects(e)}updateFBOs(e,t){if(e!==this._lastWidth||t!==this._lastHeight){if(this._lastWidth=e,this._lastHeight=t,this._fbos){let s;for(s in this._fbos)this._fbos[s].resize(e,t);return}const s=new _(e,t);s.samplingMode=9728,s.wrapMode=33071;const i=new b(u.DEPTH24_STENCIL8,e,t);this._stencilBuf=new g(this.context,i),this._fbos={output:new p(this.context,s,this._stencilBuf),effect0:new p(this.context,s,this._stencilBuf)}}}_applyEffects(e,t,s){const{context:i}=e,r=this._effectsManager.getPostProcessingEffects(t);for(const{postProcessingTechnique:n,effect:o}of r)i.bindFramebuffer(s),n.render(e,{layerFBO:s,effect:o});this._renderingDevice.setPipelineStateNeedsUpdate(!0)}setShader(e){return this._renderingDevice.setShader(e)}clearShaderCache(){this._renderingDevice.clearShaderCache()}getProgramCache(){return this._renderingDevice.getProgramCache()}setPipelineState(e){return this._renderingDevice.setPipelineState(e)}getPipelineState(){return this._renderingDevice.getPipelineState()}submitDraw(e,t,s){return this._renderingDevice.submitDraw(e,t,s)}submitDrawMesh(e,t,s,i){this._renderingDevice.submitDrawMesh(e,t,s,i)}submitDrawMeshUntyped(e,t,s,i){this._renderingDevice.submitDrawMeshUntyped(e,t,s,i)}updatePipelineState(e){return this._renderingDevice.updatePipelineState(e)}setStencilRef(e,t){return this._renderingDevice.setStencilRef(e,t)}}function w(e,t,s,i){return 4!==e&&2!==e&&16!==e&&128!==e&&(1!==i||null!=t&&"normal"!==t||null!=s&&s.length>0)}export{m as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{Effect as e}from"./Effect.js";class t extends e{constructor(e){super(),this.name=this.constructor.name,this.defines=[e]}dispose(){}bind({context:e,painter:t}){this._prev=e.boundFramebuffer;const r=t.getFbos().effect0;e.bindFramebuffer(r),e.setColorMask(!0,!0,!0,!0),e.setClearColor(0,0,0,0),e.clear(16384)}unbind(){}draw(e,t){const{context:r,painter:s}=e,n=s.getPostProcessingEffects(t),o=r.boundFramebuffer;if(o){for(const{postProcessingTechnique:t,effect:r}of n)t.render(e,{layerFBO:o,effect:r});r.bindFramebuffer(this._prev),r.setStencilTestEnabled(!1),s.blitTexture(
|
|
2
|
+
import{Effect as e}from"./Effect.js";class t extends e{constructor(e){super(),this.name=this.constructor.name,this.defines=[e]}dispose(){}bind({context:e,painter:t}){this._prev=e.boundFramebuffer;const r=t.getFbos().effect0;e.bindFramebuffer(r),e.setColorMask(!0,!0,!0,!0),e.setClearColor(0,0,0,0),e.clear(16384)}unbind(){}draw(e,t){const{context:r,painter:s}=e,n=s.getPostProcessingEffects(t),o=r.boundFramebuffer;if(o){for(const{postProcessingTechnique:t,effect:r}of n)t.render(e,{layerFBO:o,effect:r});r.bindFramebuffer(this._prev),r.setStencilTestEnabled(!1),s.blitTexture(e,o.colorTexture,9728),r.setStencilTestEnabled(!0)}}}export{t as FeatureEffect};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import
|
|
2
|
+
import{Effect as t}from"./Effect.js";import h from"./highlight/HighlightSurfaces.js";import{HighlightTechnique as i}from"../shaderGraph/techniques/utility/HighlightTechnique.js";const e=4,s=4/e;class r extends t{constructor(){super(...arguments),this.defines=["highlight"],this._hlTechnique=new i,this._width=void 0,this._height=void 0,this._hlSurfaces=new h,this._adjustedWidth=void 0,this._adjustedHeight=void 0,this._highlightWidth=void 0,this._highlightHeight=void 0}dispose(){this._hlSurfaces?.dispose(),this._hlTechnique.shutdown(),this._boundFBO=null}bind(t){const{context:h,painter:i}=t,{width:e,height:s}=h.getViewport(),r=i.getFbos().effect0;this.setup(t,e,s),h.bindFramebuffer(r),h.setColorMask(!0,!0,!0,!0),h.setClearColor(0,0,0,0),h.clear(16384)}unbind(){}setup({context:t},h,i){this._width=h,this._height=i;const r=h%e,o=i%e;h+=r<e/2?-r:e-r,i+=o<e/2?-o:e-o,this._adjustedWidth=h,this._adjustedHeight=i,this._boundFBO=t.boundFramebuffer;const u=Math.round(h*s),d=Math.round(i*s);this._highlightWidth=u,this._highlightHeight=d,this._hlSurfaces.setup(t,u,d)}draw(t){const{context:h,passOptions:i}=t,e=i.activeGradient,r=h.boundFramebuffer,o=[0,0,this._adjustedWidth*s,this._adjustedHeight*s];if(null==r?.colorTexture)throw new Error("InternalError: Highlight source framebuffer is missing a color texture");h.bindFramebuffer(this._hlSurfaces.sharedBlur1Fbo),h.setViewport(...o),h.setColorMask(!0,!0,!0,!0),h.setClearColor(0,0,0,0),h.clear(16384),this._hlTechnique.render(t,{sourceTexture:r.colorTexture,maskFbo:this._hlSurfaces.sharedBlur1Fbo,maskTexture:this._hlSurfaces.sharedBlur1Tex,partialMapFbo:this._hlSurfaces.sharedBlur2Fbo,partialMapTexture:this._hlSurfaces.sharedBlur2Tex,highlightWidth:this._highlightWidth,highlightHeight:this._highlightHeight,highlightViewport:o,outputTarget:this._boundFBO,outputViewport:[0,0,this._width,this._height],gradient:e}),this._boundFBO=null}}export{r as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import o from"../../../../../../core/Logger.js";import{
|
|
2
|
+
import o from"../../../../../../core/Logger.js";import{maxHighlightReasons as i}from"../../definitions.js";import{shadeTextureSize as t,sigma as e}from"./parameters.js";import l from"../../../../../support/HighlightOptions.js";import r from"../../../../../webgl/Texture.js";import{TextureDescriptor as h}from"../../../../../webgl/TextureDescriptor.js";const n=()=>o.getLogger("esri.views.2d.engine.webgl.painter.highlight.HighlightGradient");function s(o,i){i.fillColor[0]=o.color.r/255,i.fillColor[1]=o.color.g/255,i.fillColor[2]=o.color.b/255,i.fillColor[3]=o.color.a,o.haloColor?(i.outlineColor[0]=o.haloColor.r/255,i.outlineColor[1]=o.haloColor.g/255,i.outlineColor[2]=o.haloColor.b/255,i.outlineColor[3]=o.haloColor.a):(i.outlineColor[0]=i.fillColor[0],i.outlineColor[1]=i.fillColor[1],i.outlineColor[2]=i.fillColor[2],i.outlineColor[3]=i.fillColor[3]),i.fillColor[3]*=o.fillOpacity,i.outlineColor[3]*=o.haloOpacity,i.fillColor[0]*=i.fillColor[3],i.fillColor[1]*=i.fillColor[3],i.fillColor[2]*=i.fillColor[3],i.outlineColor[0]*=i.outlineColor[3],i.outlineColor[1]*=i.outlineColor[3],i.outlineColor[2]*=i.outlineColor[3],i.outlineWidth=(1-o.haloBlur)*o.haloWidth,i.outerHaloWidth=o.haloBlur*o.haloWidth/2,i.innerHaloWidth=o.haloBlur*o.haloWidth/2,i.outlinePosition=0}const a=[0,0,0,0];class u{constructor(){this.type="single",this._highlightOptions=new l,this._convertedHighlightOptions={fillColor:[0,0,0,0],outlineColor:[0,0,0,0],outlinePosition:0,outlineWidth:0,innerHaloWidth:0,outerHaloWidth:0},this._optionsShadeTexKey="",this._texelData=new Uint8Array(4*t),this._minMaxDistance=[0,0]}setHighlightOptions(o){this._highlightOptions=o}getProgramState(o){return this._updateGradientTexture(o),{minMaxDistance:this._minMaxDistance,shadeTexture:this._shadeTex}}destroy(){this._shadeTex?.dispose(),this._shadeTex=null}getReasonsWithGradients(){return[{activeReasons:(1<<i)-1,activeGradient:this}]}_updateGradientTexture(o){const i=d(this._highlightOptions);if(i===this._optionsShadeTexKey)return;this._optionsShadeTexKey=i,s(this._highlightOptions,this._convertedHighlightOptions);const l=this._convertedHighlightOptions,u=l.outlinePosition-l.outlineWidth/2-l.outerHaloWidth,g=l.outlinePosition-l.outlineWidth/2,f=l.outlinePosition+l.outlineWidth/2,C=l.outlinePosition+l.outlineWidth/2+l.innerHaloWidth,c=Math.sqrt(Math.PI/2)*e,p=Math.abs(u)>c?Math.round(10*(Math.abs(u)-c))/10:0,m=Math.abs(C)>c?Math.round(10*(Math.abs(C)-c))/10:0;let x;p&&!m?n().error("The outer rim of the highlight is "+p+"px away from the edge of the feature; consider reducing some width values or shifting the outline position towards positive values (inwards)."):!p&&m?n().error("The inner rim of the highlight is "+m+"px away from the edge of the feature; consider reducing some width values or shifting the outline position towards negative values (outwards)."):p&&m&&n().error("The highlight is "+Math.max(p,m)+"px away from the edge of the feature; consider reducing some width values.");const _=[void 0,void 0,void 0,void 0];function w(o,i,t){_[0]=(1-t)*o[0]+t*i[0],_[1]=(1-t)*o[1]+t*i[1],_[2]=(1-t)*o[2]+t*i[2],_[3]=(1-t)*o[3]+t*i[3]}const{_texelData:v}=this;for(let e=0;e<t;++e)x=u+e/(t-1)*(C-u),x<u?(_[0]=0,_[1]=0,_[2]=0,_[3]=0):x<g?w(a,l.outlineColor,(x-u)/(g-u)):x<f?[_[0],_[1],_[2],_[3]]=l.outlineColor:x<C?w(l.outlineColor,l.fillColor,(x-f)/(C-f)):[_[0],_[1],_[2],_[3]]=l.fillColor,v[4*e]=255*_[0],v[4*e+1]=255*_[1],v[4*e+2]=255*_[2],v[4*e+3]=255*_[3];if(this._minMaxDistance[0]=u,this._minMaxDistance[1]=C,!this._shadeTex){const i=new h(t,1);i.wrapMode=33071,this._shadeTex=new r(o,i)}this._shadeTex.updateData(0,0,0,t,1,this._texelData)}}function d(o){return`${o.color};${o.haloColor};${o.haloOpacity};${o.fillOpacity};${o.haloWidth};${o.haloBlur}`}export{u as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
function t(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}function e(t,e){return Math.sqrt(t*t+e*e)}function n(t){const n=e(t[0],t[1]);t[0]/=n,t[1]/=n}function s(t,n){return e(t[0]-n[0],t[1]-n[1])}function i(t,e){return t[e+1]}function r(t){return t.length-1}function h(t){let e=0;for(let n=0;n<r(t);n++)e+=a(t,n);return e}function a(t,e,n=1){let[s,r]=i(t,e);return[s,r]=[Math.round(s),Math.round(r)],Math.sqrt(s*s+r*r)*n}class
|
|
2
|
+
function t(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}function e(t,e){return Math.sqrt(t*t+e*e)}function n(t){const n=e(t[0],t[1]);t[0]/=n,t[1]/=n}function s(t,n){return e(t[0]-n[0],t[1]-n[1])}function i(t,e){return t[e+1]}function r(t){return t.length-1}function h(t){let e=0;for(let n=0;n<r(t);n++)e+=a(t,n);return e}function a(t,e,n=1){let[s,r]=i(t,e);return[s,r]=[Math.round(s),Math.round(r)],Math.sqrt(s*s+r*r)*n}class d{constructor(t,e,n,s,i){this._segments=t,this._index=e,this._distance=n,this._xStart=s,this._yStart=i,this._done=!1}static create(t){return new d(t,0,0,t[0][0],t[0][1])}clone(){return new d(this._segments,this._index,this._distance,this.xStart,this.yStart)}equals(t){return this._index===t._index||t._index===this._index-1&&(0===this._distance||1===t._distance)||t._index===this._index+1&&(1===this._distance||0===t._distance)}leq(t){return this._index<t._index||this._index===t._index&&this._distance<=t._distance}geq(t){return this._index>t._index||this._index===t._index&&this._distance>=t._distance}get _segment(){return this._segments[this._index+1]}get angle(){const t=this.dy,e=(0*t+-1*-this.dx)/(1*this.length);let n=Math.acos(e);return t>0&&(n=2*Math.PI-n),n}get xStart(){return this._xStart}get yStart(){return this._yStart}get x(){return this.xStart+this.distance*this.dx}get y(){return this.yStart+this.distance*this.dy}get dx(){return this._segment[0]}get dy(){return this._segment[1]}get xMidpoint(){return this.xStart+.5*this.dx}get yMidpoint(){return this.yStart+.5*this.dy}get xEnd(){return this.xStart+this.dx}get yEnd(){return this.yStart+this.dy}get length(){const{dx:t,dy:e}=this;return Math.sqrt(t*t+e*e)}get remainingLength(){return this.length*(1-this._distance)}get backwardLength(){return this.length*this._distance}get distance(){return this._distance}get done(){return this._done}hasPrev(){return this._index-1>=0}hasNext(){return this._index+1<r(this._segments)}next(){return this.hasNext()?(this._xStart+=this.dx,this._yStart+=this.dy,this._distance=0,this._index+=1,this):null}prev(){return this.hasPrev()?(this._index-=1,this._xStart-=this.dx,this._yStart-=this.dy,this._distance=1,this):(this._done=!0,null)}_seekBackwards(t,e){const n=this.backwardLength;if(t<=n)return this._distance=(n-t)/this.length,this;let s=this.backwardLength;for(;this.prev();){if(s+this.length>t)return this._seekBackwards(t-s);s+=this.length}return this._distance=0,e?this:null}seek(t,e=!1){if(t<0)return this._seekBackwards(Math.abs(t),e);if(t<=this.remainingLength)return this._distance=(this.backwardLength+t)/this.length,this;let n=this.remainingLength;for(;this.next();){if(n+this.length>t)return this.seek(t-n,e);n+=this.length}return this._distance=1,e?this:null}}function u(t,e,n,s=!0){const i=h(t),r=d.create(t),a=i/2;if(!s)return r.seek(a),void n(r.clone(),0,a+0*e,i);const u=Math.max((i-e)/2,0),c=Math.floor(u/e),_=a-c*e;r.seek(_);for(let h=-c;h<=c;h++)n(r.clone(),h,a+h*e,i),r.seek(e)}function c(t,e){const n=e;for(let s=0;s<t.length;s++){let e=t[s];_(e,n);const i=[];i.push(e[0]);for(let t=1;t<e.length;t++){const[n,s]=e[t-1],[r,h]=e[t],a=r-n,d=h-s;i.push([a,d])}t[s]=i,e=i}return t}function _(e,i){const r=1e-6;if(i<=0)return;const h=e.length;if(h<3)return;const a=[];let d=0;a.push(0);for(let t=1;t<h;t++)d+=s(e[t],e[t-1]),a.push(d);i=Math.min(i,.2*d);const u=[];u.push(e[0][0]),u.push(e[0][1]);const c=e[h-1][0],_=e[h-1][1],o=t([0,0],e[0],e[1]);n(o),e[0][0]+=i*o[0],e[0][1]+=i*o[1],t(o,e[h-1],e[h-2]),n(o),e[h-1][0]+=i*o[0],e[h-1][1]+=i*o[1];for(let t=1;t<h;t++)a[t]+=i;a[h-1]+=i;const g=.5*i;for(let t=1;t<h-1;t++){let n=0,s=0,d=0;for(let h=t-1;h>=0&&!(a[h+1]<a[t]-g);h--){const u=g+a[h+1]-a[t],c=a[h+1]-a[h],_=a[t]-a[h]<g?1:u/c;if(Math.abs(_)<r)break;const o=_*_,l=_*u-.5*o*c,x=_*c/i,f=e[h+1],y=e[h][0]-f[0],S=e[h][1]-f[1];n+=x/l*(f[0]*_*u+.5*o*(u*y-c*f[0])-o*_*c*y/3),s+=x/l*(f[1]*_*u+.5*o*(u*S-c*f[1])-o*_*c*S/3),d+=x}for(let u=t+1;u<h&&!(a[u-1]>a[t]+g);u++){const h=g-a[u-1]+a[t],c=a[u]-a[u-1],_=a[u]-a[t]<g?1:h/c;if(Math.abs(_)<r)break;const o=_*_,l=_*h-.5*o*c,x=_*c/i,f=e[u-1],y=e[u][0]-f[0],S=e[u][1]-f[1];n+=x/l*(f[0]*_*h+.5*o*(h*y-c*f[0])-o*_*c*y/3),s+=x/l*(f[1]*_*h+.5*o*(h*S-c*f[1])-o*_*c*S/3),d+=x}u.push(n/d),u.push(s/d)}u.push(c),u.push(_);for(let t=0,n=0;t<h;t++)e[t][0]=u[n++],e[t][1]=u[n++]}export{d as SegmentCursor,u as pathDivide,h as pathLength,i as segmentAt,r as segmentCount,a as segmentLength,c as smoothPaths};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import"../../../../../../core/has.js";import{isPowerOfTwo as e,nextPowerOfTwo as t}from"../../../../../../core/mathUtils.js";import{disposeMaybe as r}from"../../../../../../core/maybe.js";import{simplePipelineState as s}from"../utils.js";import{Technique as u}from"./Technique.js";import{TextureStatisticsDiffShader as o}from"./shaders/TextureStatisticsDiffShader.js";import{TextureStatisticsMinMaxSumShader as i}from"./shaders/TextureStatisticsMinMaxSumShader.js";import{TextureStatisticsStdDevShader as a}from"./shaders/TextureStatisticsStdDevShader.js";import{TextureStatisticsSumOfSquaredDiffShader as n}from"./shaders/TextureStatisticsSumOfSquaredDiffShader.js";import{getWebGLCapabilities as f}from"../../../../../webgl/capabilities.js";import{ColorAttachment2 as l,ColorAttachment3 as h,ColorAttachment0 as m,ColorAttachment1 as x,SizedPixelFormat as c,PixelType as T}from"../../../../../webgl/enums.js";import{DisposableFramebufferObject as d}from"../../../../../webgl/FramebufferObject.js";import p from"../../../../../webgl/Texture.js";import{TextureDescriptor as b}from"../../../../../webgl/TextureDescriptor.js";const _=1048576;class F extends u{constructor(){super(...arguments),this.type=36,this._width=0,this._height=0,this._framebuffers=null,this._minTexture=null,this._maxTexture=null,this._sumTexture=null,this._numOfNoDataTexture=null,this._resultsFramebuffer=null,this._startFramebuffer=null,this._diffFramebuffer=null,this._scaleFbo=null,this.shaders={textureStatisticsMinMaxSum:new i,textureStatisticsSum:new n,textureStatisticsDiff:new o,textureStatisticsStdDev:new a}}dispose(){this.shaders.textureStatisticsMinMaxSum=null,this._framebuffers&&(this._framebuffers.forEach(e=>r(e)),this._framebuffers=null),r(this._resultsFramebuffer),r(this._startFramebuffer),r(this._diffFramebuffer),r(this._scaleFbo),r(this._minTexture),r(this._maxTexture),r(this._sumTexture),r(this._numOfNoDataTexture)}get minValuesTexture(){return this._minTexture||null}get maxValuesTexture(){return this._maxTexture||null}get meanValuesTexture(){return this._resultsFramebuffer?.getColorTexture(l)||null}get stdDevValuesTexture(){return this._resultsFramebuffer?.getColorTexture(h)||null}get statsFbo(){return this._resultsFramebuffer}render(t,r){const{context:u,painter:o}=t;let i=r.fbo.width,a=r.fbo.height,n=r.fbo;const f=u.gl,l=u.boundFramebuffer;if(i*a>_||!e(i)||!e(a)){const
|
|
2
|
+
import"../../../../../../core/has.js";import{isPowerOfTwo as e,nextPowerOfTwo as t}from"../../../../../../core/mathUtils.js";import{disposeMaybe as r}from"../../../../../../core/maybe.js";import{simplePipelineState as s}from"../utils.js";import{Technique as u}from"./Technique.js";import{TextureStatisticsDiffShader as o}from"./shaders/TextureStatisticsDiffShader.js";import{TextureStatisticsMinMaxSumShader as i}from"./shaders/TextureStatisticsMinMaxSumShader.js";import{TextureStatisticsStdDevShader as a}from"./shaders/TextureStatisticsStdDevShader.js";import{TextureStatisticsSumOfSquaredDiffShader as n}from"./shaders/TextureStatisticsSumOfSquaredDiffShader.js";import{getWebGLCapabilities as f}from"../../../../../webgl/capabilities.js";import{ColorAttachment2 as l,ColorAttachment3 as h,ColorAttachment0 as m,ColorAttachment1 as x,SizedPixelFormat as c,PixelType as T}from"../../../../../webgl/enums.js";import{DisposableFramebufferObject as d}from"../../../../../webgl/FramebufferObject.js";import p from"../../../../../webgl/Texture.js";import{TextureDescriptor as b}from"../../../../../webgl/TextureDescriptor.js";const _=1048576;class F extends u{constructor(){super(...arguments),this.type=36,this._width=0,this._height=0,this._framebuffers=null,this._minTexture=null,this._maxTexture=null,this._sumTexture=null,this._numOfNoDataTexture=null,this._resultsFramebuffer=null,this._startFramebuffer=null,this._diffFramebuffer=null,this._scaleFbo=null,this.shaders={textureStatisticsMinMaxSum:new i,textureStatisticsSum:new n,textureStatisticsDiff:new o,textureStatisticsStdDev:new a}}dispose(){this.shaders.textureStatisticsMinMaxSum=null,this._framebuffers&&(this._framebuffers.forEach(e=>r(e)),this._framebuffers=null),r(this._resultsFramebuffer),r(this._startFramebuffer),r(this._diffFramebuffer),r(this._scaleFbo),r(this._minTexture),r(this._maxTexture),r(this._sumTexture),r(this._numOfNoDataTexture)}get minValuesTexture(){return this._minTexture||null}get maxValuesTexture(){return this._maxTexture||null}get meanValuesTexture(){return this._resultsFramebuffer?.getColorTexture(l)||null}get stdDevValuesTexture(){return this._resultsFramebuffer?.getColorTexture(h)||null}get statsFbo(){return this._resultsFramebuffer}render(t,r){const{context:u,painter:o}=t;let i=r.fbo.width,a=r.fbo.height,n=r.fbo;const f=u.gl,l=u.boundFramebuffer;if(i*a>_||!e(i)||!e(a)){const s=i/a;if(i*a>_){const e=Math.max(Math.floor(Math.sqrt(_/s)),1);i=Math.max(Math.floor(s*e),1),a=e}if(e(i)||(i=S(i)),e(a)||(a=S(a)),this._scaleFbo)this._scaleFbo.resize(i,a);else{const{dataType:e,internalFormat:t}=r.fbo.getColorTexture(m).descriptor,s=t??c.RGBA8;this._scaleFbo=w(u,i,a,e,s)}u.bindFramebuffer(this._scaleFbo),u.setViewport(0,0,i,a),o.blitTexture(t,n.getColorTexture(m),9728),n=this._scaleFbo}this._updateResources(t,n),o.setPipelineState({...s,color:{write:[!0,!0,!0,!0],blendMode:"none"}});const h=this._applyReductionPass(t);f.readBuffer(f.COLOR_ATTACHMENT3),h.copyToTexture(0,0,1,1,0,0,this._numOfNoDataTexture),f.readBuffer(f.COLOR_ATTACHMENT2),h.copyToTexture(0,0,1,1,0,0,this._sumTexture),f.readBuffer(f.COLOR_ATTACHMENT1),h.copyToTexture(0,0,1,1,0,0,this._maxTexture),f.readBuffer(f.COLOR_ATTACHMENT0),h.copyToTexture(0,0,1,1,0,0,this._minTexture);const x=r.fbo.getColorTexture(m);if(!x)throw new Error("Start buffer color texture is not available, cannot compute diff.");this._computeDiff(t,x,this._sumTexture,this._numOfNoDataTexture,i,a);const T=this._applySecondReductionPass(t,i,a).getColorTexture(m);this._computeSdtDev(t,this._minTexture,this._maxTexture,this._sumTexture,this._numOfNoDataTexture,T,i,a),u.bindFramebuffer(l),u.setViewport(0,0,r.fbo.width,r.fbo.height),o.setPipelineState(s)}_applyReductionPass(e){const{context:t,painter:r}=e,s=this.shaders.textureStatisticsMinMaxSum,u=this._framebuffers;if(null===u)throw new Error("Framebuffers are not initialized, cannot apply reduction pass.");const o=this._startFramebuffer;let i=o.getColorTexture(m),a=o.getColorTexture(x),n=o.getColorTexture(l),f=o.getColorTexture(h);const c=u;let T=0;for(const d of c){t.setViewport(0,0,d.width,d.height),t.bindFramebuffer(d),t.setClearColor(0,0,0,0),t.clear(16384);const e={shader:s,uniforms:{config:{width:d.width,height:d.height,isFirstPass:0===T?1:0}},textures:{minTexture:{texture:i,unit:1},maxTexture:{texture:a,unit:2},sumTexture:{texture:n,unit:3},numOfNoDataTexture:{texture:f,unit:4}},defines:null,optionalAttributes:null,useComputeBuffer:!1};r.submitDrawMesh(t,e,r.quadMesh),i=d.getColorTexture(m),a=d.getColorTexture(x),n=d.getColorTexture(l),f=d.getColorTexture(h),T++}return u.at(-1)}_applySecondReductionPass(e,t,r){const{context:s,painter:u}=e,o=this.shaders.textureStatisticsSum,i=this._framebuffers;if(null===i||null==this._diffFramebuffer)throw new Error("Framebuffers are not initialized, cannot apply reduction pass.");let a=this._diffFramebuffer.getColorTexture(m);const n=i;for(const f of n){s.setViewport(0,0,f.width,f.height),s.bindFramebuffer(f),s.setClearColor(0,0,0,0),s.clear(16384);const e={shader:o,uniforms:{config:{width:f.width,height:f.height}},textures:{sumTexture:{texture:a,unit:2}},defines:null,optionalAttributes:null,useComputeBuffer:!1};u.submitDrawMesh(s,e,u.quadMesh),a=f.getColorTexture(m)}return i.at(-1)}_updateResources(e,t){const{context:r}=e,s=t.width,u=t.height;if(null===this._startFramebuffer){if(!f().supportsColorBufferFloat)throw new Error("WebGL does not support color buffer float, cannot compute texture statistics.");const e=t.getColorTexture(m);if(!e)throw new Error("Input FBO does not have a color attachment 0, cannot compute texture statistics.");const o=e.descriptor,{dataType:i,internalFormat:a}=o,n=w(r,s,u,i,a??c.RGBA8,4),d=n.getColorTexture(m),p=n.getColorTexture(x),b=n.getColorTexture(l),_=n.getColorTexture(h);t.copyToTexture(0,0,s,u,0,0,d),t.copyToTexture(0,0,s,u,0,0,p),t.copyToTexture(0,0,s,u,0,0,b),t.copyToTexture(0,0,s,u,0,0,_),this._startFramebuffer=n,this._diffFramebuffer=w(r,s,u,T.FLOAT,c.RGBA32F),this._resultsFramebuffer=w(r,1,1,T.FLOAT,c.RGBA32F,4),this._minTexture=C(r,1,1,T.FLOAT,c.RGBA32F),this._maxTexture=C(r,1,1,T.FLOAT,c.RGBA32F),this._sumTexture=C(r,1,1,T.FLOAT,c.RGBA32F),this._numOfNoDataTexture=C(r,1,1,T.FLOAT,c.R32F)}else{const e=this._startFramebuffer;e.resize(s,u);const r=e.getColorTexture(m),o=e.getColorTexture(x),i=e.getColorTexture(l),a=e.getColorTexture(h);t.copyToTexture(0,0,s,u,0,0,r),t.copyToTexture(0,0,s,u,0,0,o),t.copyToTexture(0,0,s,u,0,0,i),t.copyToTexture(0,0,s,u,0,0,a),this._diffFramebuffer.resize(s,u)}if(this._width===s&&this._height===u&&null!==this._framebuffers)return;const o=(this._framebuffers||[]).reverse();this._framebuffers=null,this._width=s,this._height=u,this._framebuffers=this._updateFramebuffers(r,s,u,o,4)}_updateFramebuffers(e,t,s,u,o=1){const i=[];let a=t,n=s;for(;a>1||n>1;){const t=Math.max(1,Math.floor(a/2)),r=Math.max(1,Math.floor(n/2)),s=g(e,t,r,u,o);i.push(s),a=t,n=r}return i.at(-1),u.forEach(e=>r(e)),u.length=0,i}_computeDiff(e,t,r,s,u,o){const{context:i,painter:a}=e;i.bindFramebuffer(this._diffFramebuffer),i.setViewport(0,0,u,o),i.setClearColor(0,0,0,0),i.clear(16384);const n={shader:this.shaders.textureStatisticsDiff,uniforms:{config:{numTexels:u*o}},textures:{inputTexture:{texture:t,unit:1},sumTexture:{texture:r,unit:2},numOfNoDataTexture:{texture:s,unit:3}},defines:null,optionalAttributes:null,useComputeBuffer:!1};a.submitDrawMesh(i,n,a.quadMesh)}_computeSdtDev(e,t,r,s,u,o,i,a){const{context:n,painter:f}=e;n.bindFramebuffer(this._resultsFramebuffer),n.setViewport(0,0,1,1),n.setClearColor(0,0,0,0),n.clear(16384);const l={shader:this.shaders.textureStatisticsStdDev,uniforms:{config:{numTexels:i*a}},textures:{minTexture:{texture:t,unit:1},maxTexture:{texture:r,unit:2},sumTexture:{texture:s,unit:3},numOfNoDataTexture:{texture:u,unit:4},diffSqTexture:{texture:o,unit:5}},defines:null,optionalAttributes:null,useComputeBuffer:!1};f.submitDrawMesh(n,l,f.quadMesh)}}function g(e,t,r,s,u=1){let o=s.pop();return void 0!==o?o.resize(t,r):o=w(e,t,r,T.FLOAT,c.RGBA32F,u),o}function w(e,t,r,s,u,o=1){if(o<1||o>4)throw new Error("Number of color attachments must be between 1 and 4.");const i=new d(e,C(e,t,r,s,u));for(let a=1;a<o;a++){const o=C(e,t,r,s,u);i.attachColorTexture(o,m+a)}return i}function C(e,t,r,s,u){const o=new b(t,r);return o.samplingMode=9728,o.wrapMode=33071,o.pixelFormat=6408,o.dataType=s,o.internalFormat=u,new p(e,o)}function S(e){const r=t(e),s=r/2;return Math.abs(r-e)<Math.abs(s-e)?r:s}export{F as TextureStatisticsTechnique};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{__decorate as t,__param as o}from"tslib";import{location as e,uniform as r,texture as p,input as s,VertexInput as i,UniformGroup as l,GraphShaderModule as n,FragmentOutput as a,FragmentInput as d}from"../../GraphShaderModule.js";import{Vec2 as u,Float as c,Sampler2D as x,Vec4 as y,texture2D as m}from"../../graph/glsl.js";class v extends i{}t([e(0,u)],v.prototype,"pos",void 0),t([e(1,u)],v.prototype,"tex",void 0);class f extends d{}class g extends l{}t([r(c)],g.prototype,"opacity",void 0);class h extends n{constructor(){super(...arguments),this.type="BitBlitShader"}vertex(t){return{glPosition:new y(t.pos,0,1),uv:t.tex}}fragment(t){const o=new a;return o.fragColor=m(this.texture,t.uv).multiply(this.config.opacity),o}}t([r(g)],h.prototype,"config",void 0),t([p(x)],h.prototype,"texture",void 0),t([o(0,s(v))],h.prototype,"vertex",null),t([o(0,s(f))],h.prototype,"fragment",null);export{h as BitBlitShader};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{__decorate as o,__param as t}from"tslib";import{location as e,uniform as s,input as r,VertexInput as i,UniformGroup as n,GraphShaderModule as p,FragmentOutput as l,FragmentInput as a}from"../../GraphShaderModule.js";import{Vec3 as d,Mat3 as c,FixedArray as g,Vec4 as y,Float as f,Int as v,mod as m,floor as u}from"../../graph/glsl.js";class x extends i{}o([e(0,d)],x.prototype,"positionAndFlags",void 0);class h extends a{}class w extends n{}o([s(c)],w.prototype,"dvsMat3",void 0),o([s(g.ofType(y,4))],w.prototype,"colors",void 0),o([s(g.ofType(f,4))],w.prototype,"opacities",void 0);class A extends p{constructor(){super(...arguments),this.type="DebugOverlayShader"}vertex(o){const t=o.positionAndFlags.z,e=new v(m(t,new f(4))),s=new v(m(u(t.divide(4)),new f(4))),r=this.config.colors.get(e).multiply(this.config.opacities.get(s)),i=this.config.dvsMat3.multiply(new d(o.positionAndFlags.xy,1));return{glPosition:new y(i.xy,0,1),color:r}}fragment(o){const t=new l;return t.fragColor=o.color,t}}o([s(w)],A.prototype,"config",void 0),o([t(0,r(x))],A.prototype,"vertex",null),o([t(0,r(h))],A.prototype,"fragment",null);export{A as DebugOverlayShader};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{__decorate as t,__param as i}from"tslib";import{uniform as e,texture as o,input as r,UniformGroup as s,FragmentOutput as n}from"../../GraphShaderModule.js";import{Vec4 as a,Mat4 as p,Float as d,Sampler2D as l,Vec2 as c,texture2D as u,exp as g,sqrt as m,clamp as h}from"../../graph/glsl.js";import{PostProcessingFragmentInput as y,PostProcessingShader as f}from"./PostProcessingShader.js";class v extends s{}t([e(a)],v.prototype,"direction",void 0),t([e(p)],v.prototype,"channelSelector",void 0),t([e(d)],v.prototype,"sigma",void 0);class x extends f{constructor(){super(...arguments),this.type="HighlightBlurShader"}fragment(t){let i=new d(0),e=new d(0);for(let r=-5;r<=5;r++){const o=new d(r),s=this._gauss(o.multiply(this.config.direction.xy)),n=this.config.channelSelector.multiply(u(this.texture,t.uv.add(o.multiply(this.config.direction.zw))));i=i.add(n.a.multiply(s)),e=e.add(s)}const o=new n;return o.fragColor=new a(0,0,0,i.divide(e)),o}_gauss(t){return g(t.multiply(t).x.add(t.multiply(t).y).multiply(-1).divide(this.config.sigma.multiply(this.config.sigma).multiply(2)))}}t([e(v)],x.prototype,"config",void 0),t([o(l)],x.prototype,"texture",void 0),t([i(0,r(y))],x.prototype,"fragment",null);class w extends s{}t([e(d)],w.prototype,"sigma",void 0),t([e(c)],w.prototype,"minMaxDistance",void 0);class S extends f{constructor(){super(...arguments),this.type="HighlightShadeShader"}fragment(t){const i=u(this.texture,t.uv).a,e=new d(1).divide(m(new d(6.283)).multiply(this.config.sigma)),o=i.subtract(.5).divide(e),r=h(o.subtract(this.config.minMaxDistance.x).divide(this.config.minMaxDistance.y.subtract(this.config.minMaxDistance.x)),new d(0),new d(1)),s=new n;return s.fragColor=u(this.shade,new c(r,.5)),s}}t([o(l)],S.prototype,"texture",void 0),t([o(l)],S.prototype,"shade",void 0),t([e(w)],S.prototype,"config",void 0),t([i(0,r(y))],S.prototype,"fragment",null);export{x as HighlightBlurShader,S as HighlightShadeShader};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{__decorate as t,__param as o}from"tslib";import{location as e,uniform as r,input as n,FragmentInput as s,VertexInput as p,UniformGroup as i,GraphShaderModule as l,FragmentOutput as d}from"../../GraphShaderModule.js";import{Vec2 as a,Mat3 as c,Vec3 as m,Vec4 as x}from"../../graph/glsl.js";class f extends p{}t([e(0,a)],f.prototype,"position",void 0);class g extends i{}t([r(c)],g.prototype,"worldExtent",void 0);class u extends l{constructor(){super(...arguments),this.type="WorldExtentStencilShader"}vertex(t){const o=this.config.worldExtent.multiply(new m(t.position,1));return{glPosition:new x(o,1)}}fragment(t){const o=new d;return o.fragColor=new x(1,1,1,1),o}}t([r(g)],u.prototype,"config",void 0),t([o(0,n(f))],u.prototype,"vertex",null),t([o(0,n(s))],u.prototype,"fragment",null);export{u as WorldExtentStencilShader};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{destroyMaybe as e}from"../../../../../../../core/maybe.js";import{backbufferStencilVisible as t}from"../../../definitions.js";import{SimpleMesh as s}from"../../../meshing/SimpleMesh.js";import{Technique as i}from"../Technique.js";import{BitBlitShader as r}from"../shaders/BitBlitShader.js";import{DataType as o,PrimitiveType as n}from"../../../../../../webgl/enums.js";const m={write:!1,test:{compare:514,op:{fail:7680,zFail:7680,zPass:7680},mask:255}};class h extends i{constructor(){super(...arguments),this.type=5,this.shaders={bitBlit:new r},this._mesh=null}shutdown(){this._mesh=e(this._mesh)}render(e,s){const{context:i,painter:r}=e,o=s.opacity??1,n=!0===s.clipToVisibleRegion;s.texture.setSamplingMode(s.samplingMode);const h={color:{write:[!0,!0,!0,!0],blendMode:"custom",blendParameters:{srcRGB:1,dstRGB:771,srcAlpha:1,dstAlpha:771}},depth:!1,stencil:!!n&&m};r.setPipelineState(h);const a=n?{stencilRef:t}:void 0;r.submitDrawMesh(i,{shader:this.shaders.bitBlit,uniforms:{config:{opacity:o}},textures:{texture:{texture:s.texture,unit:0}},defines:null,optionalAttributes:null,useComputeBuffer:!1},this._getMesh(e),a)}_getMesh(e){return this._mesh??=s.createForShader(e.context,{primitive:n.TRIANGLE_STRIP,vertex:new Int8Array([-1,-1,0,0,1,-1,1,0,-1,1,0,1,1,1,1,1]),layout:{pos:{type:o.BYTE,count:2},tex:{type:o.BYTE,count:2}}}),this._mesh}}export{h as BitBlitTechnique};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{destroyMaybe as e}from"../../../../../../../core/maybe.js";import{Mesh as t}from"../../../meshing/Mesh.js";import{Technique as s}from"../Technique.js";import{DebugOverlayShader as i}from"../shaders/DebugOverlayShader.js";import{PrimitiveType as r,DataType as o}from"../../../../../../webgl/enums.js";import{VertexElementDescriptor as n}from"../../../../../../webgl/VertexElementDescriptor.js";class a extends s{constructor(){super(...arguments),this.type=27,this.shaders={debugOverlay:new i},this._mesh=null}shutdown(){this._mesh=e(this._mesh)}render(e,t){const{context:s,painter:i}=e,r=this._getMesh(e,t.mesh);i.setPipelineState({color:{write:[!0,!0,!0,!0],blendMode:"composite"},depth:!1,stencil:!1}),i.submitDrawMeshUntyped(s,{shader:this.shaders.debugOverlay,uniforms:{config:{dvsMat3:t.dvsMat3,colors:h(t.colors),opacities:t.opacities}},textures:void 0,defines:void 0,optionalAttributes:void 0,useComputeBuffer:!1},r)}_getMesh(e,s){return this._mesh?(this._mesh.vertexBuffers.get("vertices")?.setData(s.vertexData),this._mesh.indexBuffers.get("indices")?.setData(s.indexData),this._mesh.parts[0].count=s.indexData.length):this._mesh=new t(e.context,{vertex:{vertices:{data:s.vertexData,layout:[new n("positionAndFlags",3,o.SHORT,0,6)]}},index:{indices:{data:s.indexData}},groups:[{index:"indices",primitive:r.TRIANGLES}],parts:[{group:0,start:0,count:s.indexData.length}]}),this._mesh}}function h(e){return[[e[0],e[1],e[2],e[3]],[e[4],e[5],e[6],e[7]],[e[8],e[9],e[10],e[11]],[e[12],e[13],e[14],e[15]]]}export{a as DebugOverlayTechnique};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import"../../../../../../../core/has.js";import{textureBindingHighlight0 as e,textureBindingHighlight1 as t}from"../../../definitions.js";import{alphaToRgbaChannelSelectorMatrix as r,rgbaToRgbaChannelSelectorMatrix as i,sigma as s}from"../../../effects/highlight/parameters.js";import{Technique as o}from"../Technique.js";import{HighlightShadeShader as n,HighlightBlurShader as a}from"../shaders/HighlightShader.js";import{BitBlitTechnique as h}from"./BitBlitTechnique.js";const u=[!1,!1,!1,!0];class l extends o{constructor(){super(...arguments),this.type=7,this.shaders={blur:new a,shade:new n},this._bitBlitTechnique=new h}shutdown(){this._bitBlitTechnique.shutdown()}render(e,t){this._prepareTarget(e,{target:t.maskFbo,viewport:t.highlightViewport}),this._bitBlitTechnique.render(e,{texture:t.sourceTexture,samplingMode:9728}),this._preBlur(e,{texture:t.maskTexture,size:t.highlightWidth,target:t.partialMapFbo,viewport:t.highlightViewport}),this._finalBlur(e,{texture:t.partialMapTexture,size:t.highlightHeight,target:t.maskFbo,viewport:t.highlightViewport}),this._shade(e,{texture:t.maskTexture,gradient:t.gradient,target:t.outputTarget,viewport:t.outputViewport})}_preBlur(e,t){this._renderBlur(e,{...t,direction:[1,0,1/t.size,0],channelSelector:r,colorWrite:t.colorWrite??u})}_finalBlur(e,t){this._renderBlur(e,{...t,direction:[0,1,0,1/t.size],channelSelector:i,colorWrite:t.colorWrite??u})}_shade(e,t){this._renderShade(e,t)}_renderBlur(t,r){const{context:i,painter:o}=t,n={color:{write:r.colorWrite,blendMode:"none"},depth:!1,stencil:!1};o.setPipelineState(n),this._prepareTarget(t,r),o.submitDrawMesh(i,{shader:this.shaders.blur,uniforms:{config:{direction:r.direction,channelSelector:r.channelSelector,sigma:s}},textures:{texture:{unit:e,texture:r.texture}},defines:null,optionalAttributes:null,useComputeBuffer:!1},o.quadMesh)}_renderShade(r,i){const{context:o,painter:n}=r,a=i.gradient.getProgramState(o),h={color:{write:[!0,!0,!0,!0],blendMode:"custom",blendParameters:{srcRGB:1,dstRGB:771,srcAlpha:1,dstAlpha:771}},depth:!1,stencil:!1};n.setPipelineState(h),this._prepareTarget(r,i),n.submitDrawMesh(o,{shader:this.shaders.shade,uniforms:{config:{sigma:s,minMaxDistance:a.minMaxDistance}},textures:{texture:{unit:e,texture:i.texture},shade:{unit:t,texture:a.shadeTexture}},defines:null,optionalAttributes:null,useComputeBuffer:!1},n.quadMesh)}_prepareTarget(e,t){const{context:r}=e;null!=t.viewport&&r.setViewport(...t.viewport),r.bindFramebuffer(t.target)}}export{l as HighlightTechnique};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{toRadian as t}from"../../../../../../../core/libs/gl-matrix-2/math/common.js";import{fromTranslation as e,scale as r,rotate as s,translate as i}from"../../../../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as o}from"../../../../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{fromValues as a}from"../../../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as n}from"../../../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as c}from"../../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{backbufferStencilClipped as l,backbufferStencilVisible as m}from"../../../definitions.js";import{Technique as d}from"../Technique.js";import{WorldExtentStencilShader as h}from"../shaders/WorldExtentStencilShader.js";const f=a(-.5,-.5);class p extends d{constructor(){super(...arguments),this.type=35,this.shaders={stencil:new h},this._centerNdc=c(),this._pxToNdc=c(),this._worldDimensionsPx=c(),this._mat3=o()}render(t,e){const{context:r}=t,s=this._updateGeometry(t,e.padding);this._clearBackbuffer(r,e.backgroundColor,s),s&&this._renderWorldExtent(t)}_clearBackbuffer(t,e,r){if(null!=e){const{r,g:s,b:i,a:o}=e;t.setClearColor(o*r/255,o*s/255,o*i/255,o)}else t.setClearColor(0,0,0,0);t.setStencilFunction(519,0,255),t.setStencilWriteMask(255),t.setClearStencil(r?l:m),t.clear(17408)}_renderWorldExtent(t){const{context:e,painter:r}=t;r.setPipelineState({color:!1,depth:!1,stencil:{write:{mask:255},test:{compare:519,op:{fail:7680,zFail:7680,zPass:7681},mask:255}}}),r.submitDrawMesh(e,{shader:this.shaders.stencil,uniforms:{config:{worldExtent:this._mat3}},textures:void 0,defines:void 0,optionalAttributes:void 0,useComputeBuffer:!1},r.quadMesh,{stencilRef:m})}_updateGeometry(o,a){const{state:c,pixelRatio:l}=o,{size:m,rotation:d}=c,h=Math.round(m[0]*l),p=Math.round(m[1]*l);if(!c.spatialReference.isWrappable)return!1;const u=t(d),x=Math.abs(Math.cos(u)),_=Math.abs(Math.sin(u)),b=Math.round(h*x+p*_),g=Math.round(l*c.worldScreenWidth);if(b<=g)return!1;const M=h*_+p*x,j=(a.left-a.right)*l/h,w=(a.bottom-a.top)*l/p;n(this._worldDimensionsPx,g,M,1),n(this._pxToNdc,2/h,-2/p,1),n(this._centerNdc,j,w,1);const C=this._mat3;return e(C,this._centerNdc),r(C,C,this._pxToNdc),0!==d&&s(C,C,u),r(C,C,this._worldDimensionsPx),i(C,C,f),!0}}export{p as WorldExtentClipTechnique};
|