@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.
Files changed (129) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/321dbc60f44819c2b4de.js +1 -0
  3. package/assets/esri/core/workers/chunks/399e23d777a043efa9f1.js +1 -0
  4. package/assets/esri/core/workers/chunks/5133083222588799493f.js +1 -0
  5. package/assets/esri/core/workers/chunks/{2b8909a488cf3b231eec.js → 590e977f8eeb379b86c8.js} +8 -8
  6. package/assets/esri/core/workers/chunks/{7ea65aa6d3e684e12082.js → 67468c50ecb1fbedda87.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{b45a013039bbd2614525.js → 7684f0c771d312e05bb4.js} +7 -7
  8. package/assets/esri/core/workers/chunks/{dd65c32ae55fcf1282fe.js → 934044f2ef6ce199b399.js} +1 -1
  9. package/assets/esri/core/workers/chunks/c1845682cc9a5aac8703.js +261 -0
  10. package/assets/esri/core/workers/chunks/{4056659d5c7698265129.js → d66d58ed5d66520ab1bf.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{aa0fb77c62a2d4eb20a5.js → e6b5c015205d38abe037.js} +1 -1
  12. package/assets/esri/core/workers/chunks/f4eda59ec1e816ecc827.js +1 -0
  13. package/assets/esri/core/workers/chunks/f8f0de841be17cd05c8f.js +1 -0
  14. package/assets/esri/themes/base/_core.scss +0 -6
  15. package/assets/esri/themes/dark/main.css +1 -1
  16. package/assets/esri/themes/light/main.css +1 -1
  17. package/assets/esri/themes/light/view.css +1 -1
  18. package/chunks/CutFillMinMaxDepth.glsl.js +2 -0
  19. package/chunks/CutFillTotalDepth.glsl.js +2 -0
  20. package/chunks/EdgeShader.glsl.js +9 -9
  21. package/chunks/GaussianSplat.glsl.js +1 -1
  22. package/chunks/cameraUtilsSpherical.js +1 -1
  23. package/config.js +1 -1
  24. package/editing/geometry/coordUtils.js +1 -1
  25. package/geohash/geohashUtils.js +1 -1
  26. package/geometry/support/aaBoundingRect.js +1 -1
  27. package/geometry/support/quantizationUtils.js +1 -1
  28. package/intl/date.js +1 -1
  29. package/kernel.js +1 -1
  30. package/layers/graphics/featureConversionUtils.js +1 -1
  31. package/layers/graphics/sources/support/sourceUtils.js +1 -1
  32. package/layers/raster/formats/Lerc.js +1 -1
  33. package/layers/support/fieldUtils.js +1 -1
  34. package/package.json +1 -1
  35. package/support/revision.js +1 -1
  36. package/views/2d/engine/vectorTiles/GeometryUtils.js +1 -1
  37. package/views/2d/engine/webgl/Painter.js +1 -1
  38. package/views/2d/engine/webgl/effects/FeatureEffect.js +1 -1
  39. package/views/2d/engine/webgl/effects/HighlightEffect.js +1 -1
  40. package/views/2d/engine/webgl/effects/highlight/HighlightGradient.js +1 -1
  41. package/views/2d/engine/webgl/mesh/templates/segmentUtils.js +1 -1
  42. package/views/2d/engine/webgl/shaderGraph/techniques/TextureStatisticsTechnique.js +1 -1
  43. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BitBlitShader.js +2 -0
  44. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/DebugOverlayShader.js +2 -0
  45. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/HighlightShader.js +2 -0
  46. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/WorldExtentStencilShader.js +2 -0
  47. package/views/2d/engine/webgl/shaderGraph/techniques/utility/BitBlitTechnique.js +2 -0
  48. package/views/2d/engine/webgl/shaderGraph/techniques/utility/DebugOverlayTechnique.js +2 -0
  49. package/views/2d/engine/webgl/shaderGraph/techniques/utility/HighlightTechnique.js +2 -0
  50. package/views/2d/engine/webgl/shaderGraph/techniques/utility/WorldExtentClipTechnique.js +2 -0
  51. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  52. package/views/2d/layers/support/DebugOverlay.js +1 -1
  53. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  54. package/views/3d/layers/i3s/I3SNode.js +1 -1
  55. package/views/3d/layers/i3s/SphereCone.js +1 -1
  56. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  57. package/views/3d/support/cameraUtilsSpherical.js +1 -1
  58. package/views/3d/terrain/OverlayRenderer.js +1 -1
  59. package/views/3d/webgl/RenderCamera.js +1 -1
  60. package/views/3d/webgl-engine/core/shaderLibrary/Laserline.glsl.js +2 -2
  61. package/views/3d/webgl-engine/core/shaderLibrary/util/emissionFilter.glsl.js +1 -1
  62. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
  63. package/views/3d/webgl-engine/effects/glow/Glow.js +1 -1
  64. package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
  65. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  66. package/views/3d/webgl-engine/lib/CutFillComputation.js +1 -1
  67. package/views/3d/webgl-engine/lib/GaussianSplatShadows.js +1 -1
  68. package/views/3d/webgl-engine/lib/IntersectorInterfaces.js +1 -1
  69. package/views/3d/webgl-engine/lib/PolygonIntersections2D.js +2 -0
  70. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  71. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  72. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  73. package/views/3d/webgl-engine/{shaders/sources/edgeRenderer → lib/edgeRendering}/AdjustProjectedPosition.glsl.js +1 -1
  74. package/views/3d/webgl-engine/{shaders/sources/edgeRenderer → lib/edgeRendering}/DiscardNonSilhouetteEdges.glsl.js +1 -1
  75. package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
  76. package/views/3d/webgl-engine/lib/edgeRendering/EdgeShader.glsl.js +1 -1
  77. package/views/3d/webgl-engine/{shaders/sources/edgeRenderer → lib/edgeRendering}/EdgeUtil.glsl.js +1 -1
  78. package/views/3d/webgl-engine/{shaders/sources/edgeRenderer → lib/edgeRendering}/LineAmplitude.glsl.js +1 -1
  79. package/views/3d/webgl-engine/{shaders/sources/edgeRenderer → lib/edgeRendering}/LineOffset.glsl.js +1 -1
  80. package/views/3d/webgl-engine/{shaders/sources/edgeRenderer → lib/edgeRendering}/UnpackAttributes.glsl.js +1 -1
  81. package/views/3d/webgl-engine/lib/screenPolygonTriangleIntersections.js +1 -1
  82. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  83. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  84. package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
  85. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  86. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  87. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  88. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  89. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  90. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  91. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  92. package/views/3d/webgl-engine/materials/TriangleMaterial.js +1 -1
  93. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  94. package/views/3d/webgl-engine/shaders/CutFillMinMaxDepth.glsl.js +2 -0
  95. package/views/3d/webgl-engine/shaders/CutFillMinMaxDepthTechnique.js +2 -0
  96. package/views/3d/webgl-engine/shaders/{CutFillDepth.glsl.js → CutFillTotalDepth.glsl.js} +1 -1
  97. package/views/3d/webgl-engine/shaders/CutFillTotalDepthTechnique.js +2 -0
  98. package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +1 -1
  99. package/views/input/BrowserEventSource.js +1 -1
  100. package/views/input/InputManager.js +1 -1
  101. package/views/interactive/snapping/snappingUtils.js +1 -1
  102. package/views/support/euclideanLengthMeasurementUtils.js +1 -1
  103. package/views/webgl/VertexAttributeLayouts.js +1 -1
  104. package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
  105. package/widgets/BatchAttributeForm/inputs/support/multipleChoiceInputUtils.js +1 -1
  106. package/widgets/Legend/support/relationshipRampUtils.js +1 -1
  107. package/widgets/OrientedImageryViewer/utils.js +1 -1
  108. package/assets/esri/core/workers/chunks/002356e675769d20e5c0.js +0 -1
  109. package/assets/esri/core/workers/chunks/06e71d52773eb656a4bf.js +0 -261
  110. package/assets/esri/core/workers/chunks/352d144d7651da8a29c9.js +0 -1
  111. package/assets/esri/core/workers/chunks/4f2a61dfae6ca8ed1ec8.js +0 -1
  112. package/assets/esri/core/workers/chunks/ea8f224da4c5c95a3547.js +0 -1
  113. package/assets/esri/core/workers/chunks/f30578843f4faefd53b4.js +0 -1
  114. package/assets/esri/themes/base/_colorVariables.scss +0 -1
  115. package/assets/esri/themes/base/widgets/_DatePicker.scss +0 -170
  116. package/assets/esri/themes/base/widgets/_FeatureUtilityNetworkAssociationList.scss +0 -13
  117. package/assets/esri/themes/base/widgets/_TimePicker.scss +0 -15
  118. package/chunks/CutFillDepth.glsl.js +0 -2
  119. package/core/PLRUCache.js +0 -2
  120. package/views/2d/engine/webgl/BitBlitRenderer.js +0 -2
  121. package/views/2d/engine/webgl/WorldExtentClipRenderer.js +0 -2
  122. package/views/2d/engine/webgl/effects/highlight/HighlightRenderer.js +0 -2
  123. package/views/2d/engine/webgl/shaders/BitBlitPrograms.js +0 -2
  124. package/views/2d/engine/webgl/shaders/HighlightPrograms.js +0 -2
  125. package/views/2d/engine/webgl/shaders/StencilPrograms.js +0 -2
  126. package/views/3d/webgl-engine/shaders/CutFillDepthTechnique.js +0 -2
  127. package/views/3d/webgl-engine/shaders/CutFillDepthTechniqueConfiguration.js +0 -2
  128. package/views/support/euclideanAreaMeasurementUtils.js +0 -2
  129. 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,u=256/360,s=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*u,256)}function h(t){return Math.log(t)*c}function m(t){return t*t}function p(t,n,r){return t*(1-r)+n*r}function g(t,n,r){return t>=n&&t<=r||t>=r&&t<=n}const x=8,y=14,M=16;function d(t){return x+Math.max((t-y)*M,0)}function I(t,n,r){let o,e,i,u=0;for(const s of r){o=s.length;for(let r=1;r<o;++r){if(e=s[r-1],i=s[r],e.y>n==i.y>n)continue;(i.x-e.x)*(n-e.y)-(i.y-e.y)*(t-e.x)>0?u++:u--}}return 0!==u}function N(n,r,o,e){let i,u,s,c;const a=e*e;for(const f of o){const o=f.length;if(!(o<2)){i=f[0].x,u=f[0].y;for(let e=1;e<o;++e){if(s=f[e].x,c=f[e].y,t(n,r,i,u,s,c)<a)return!0;i=s,u=c}}}return!1}function w(t,n,r,o,e,i,u){const s=Math.max(o,Math.min(n,i))-n,c=Math.max(e,Math.min(r,u))-r;return s*s+c*c<=t*t}function P(t,r){if(0===r||Number.isNaN(r))return t;const o=[],e=new n(0,0),i=new n(0,0),u=new n(0,0);for(let s=0;s<t.length;s++){const c=t[s],a=[];for(let t=0;t<c.length;t++){const o=c[t-1],s=c[t],f=c[t+1];0===t?e.setCoords(0,0):e.assignSub(s,o).normalize().rightPerpendicular(),t===c.length-1?i.setCoords(0,0):i.assignSub(f,s).normalize().rightPerpendicular(),u.assignAdd(e,i).normalize();const l=u.x*i.x+u.y*i.y;0!==l&&u.scale(1/l),a.push(n.add(s,u.scale(r)))}o.push(a)}return o}function b(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{g as between,e as c2pi,u as cDegTo256,s as cDegToRad,r as cInfinity,o as cPi,i as cRadTo256,l as degToByte,N as distanceFromToPolylineWithinThreshold,d as getTileMargins,p as interpolate,w as isCircleOverlapingRect,h as log2,P as offsetLine,I as pointInPolygon,a as positiveMod,f as radToByte,m as sqr,b as translateAnchor};
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{disposeMaybe as e,destroyMaybe as t}from"../../../../core/maybe.js";import{BitBlitRenderer as s}from"./BitBlitRenderer.js";import{backbufferStencilVisible as r}from"./definitions.js";import i from"./MaterialManager.js";import{RenderingDevice as n}from"./RenderingDevice.js";import o from"./TextureManager.js";import{TextureUploadManager as a}from"./TextureUploadManager.js";import{WorldExtentRenderer as f}from"./WorldExtentClipRenderer.js";import{BlendEffect as h}from"./effects/BlendEffect.js";import{FeatureEffect as l}from"./effects/FeatureEffect.js";import c from"./effects/HighlightEffect.js";import{HittestEffect as d}from"./effects/HittestEffect.js";import{EffectManager as u}from"./effects/post-processing/EffectManager.js";import{SimpleMesh as p}from"./meshing/SimpleMesh.js";import{SizedDepthStencilFormat as b}from"../../../webgl/enums.js";import{DisposableFramebufferObject as g}from"../../../webgl/FramebufferObject.js";import{Renderbuffer as _}from"../../../webgl/Renderbuffer.js";import{RenderbufferDescriptor as m}from"../../../webgl/RenderbufferDescriptor.js";import{TextureDescriptor as w}from"../../../webgl/TextureDescriptor.js";class M{constructor(e,t){this.context=e,this._blitRenderer=new s,this._worldExtentRenderer=new f,this._lastWidth=null,this._lastHeight=null,this._blendEffect=new h,this._stencilBuf=null,this._prevBeforeLayerFBOStack=[],this._fboPool=[],this.effects={highlight:new c,hittest:new d,insideEffect:new l("inside"),outsideEffect:new l("outside")},this.materialManager=new i(e),this.textureManager=new o(t),this.textureUploadManager=new a(t),this._effectsManager=new u,this._quadMesh=p.fromVertexStream(e,[0,0,1,0,0,1,1,1]),this._renderingDevice=new n}dispose(){if(this.materialManager.dispose(),this.textureManager.dispose(),this.textureUploadManager.destroy(),this._blitRenderer=e(this._blitRenderer),this._worldExtentRenderer=e(this._worldExtentRenderer),this._quadMesh=t(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 blitRenderer(){return this._blitRenderer}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 r=new w(e,t);r.samplingMode=9728,r.wrapMode=33071,s=new g(this.context,r,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:r}=e;this._worldExtentRenderer.render(e,t,s);const{width:i,height:n}=r.getViewport();if(this.updateFBOs(i,n),this._prevFBO=r.boundFramebuffer,r.bindFramebuffer(this.getFbos().output),r.setColorMask(!0,!0,!0,!0),null!=t){const{r:e,g:s,b:i,a:n}=t;r.setClearColor(n*e/255,n*s/255,n*i/255,n)}else r.setClearColor(0,0,0,0);r.setDepthWriteEnabled(!0),r.setClearDepth(1),r.clear(16640),r.setDepthWriteEnabled(!1)}afterRenderPhases(e){const{context:t}=e;t.bindFramebuffer(this._prevFBO),t.setStencilFunction(514,r,255),t.setStencilTestEnabled(!0),t.setDepthTestEnabled(!1),this.blitTexture(t,this.getFbos().output.colorTexture,9728)}beforeRenderLayer(e,t,s){const{context:r,blendMode:i,effects:n,drawPhase:o,requireFBO:a}=e;if(r.setClearColor(0,0,0,0),a||E(o,i,n,s)){const e=r.boundFramebuffer;this._prevBeforeLayerFBOStack.push(e);const{width:t,height:s}=r.getViewport(),i=this.acquireFbo(t,s);r.bindFramebuffer(i),r.setColorMask(!0,!0,!0,!0),r.setClearColor(0,0,0,0),r.setDepthWriteEnabled(!0),r.setClearDepth(1),r.clear(16640),r.setDepthWriteEnabled(!1)}r.setDepthWriteEnabled(!1),r.setDepthTestEnabled(!1),r.setStencilTestEnabled(!0),r.setClearStencil(t),r.setStencilWriteMask(255),r.clear(1024)}afterRenderLayer(e,t){const{context:s,blendMode:r,effects:i,requireFBO:n,drawPhase:o}=e;if(n||E(o,r,i,t)){const n=s.boundFramebuffer;if(null==n)return;null!=i&&i.length>0&&1===o&&(s.setColorMask(!0,!0,!0,!0),this._applyEffects(e,i,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==r||16===o||2===o||128===o?"normal":r;this._blendEffect.draw(e,n.colorTexture,9728,a,t),this.releaseFbo(n)}}blitTexture(e,t,s,r=1){e.setBlendingEnabled(!0),e.setBlendFunctionSeparate(1,771,1,771),e.setColorMask(!0,!0,!0,!0),this._blitRenderer.render(e,t,s,r),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 w(e,t);s.samplingMode=9728,s.wrapMode=33071;const r=new m(b.DEPTH24_STENCIL8,e,t);this._stencilBuf=new _(this.context,r),this._fbos={output:new g(this.context,s,this._stencilBuf),effect0:new g(this.context,s,this._stencilBuf)}}}_applyEffects(e,t,s){const{context:r}=e,i=this._effectsManager.getPostProcessingEffects(t);for(const{postProcessingTechnique:n,effect:o}of i)r.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,r){this._renderingDevice.submitDrawMesh(e,t,s,r)}submitDrawMeshUntyped(e,t,s,r){this._renderingDevice.submitDrawMeshUntyped(e,t,s,r)}updatePipelineState(e){return this._renderingDevice.updatePipelineState(e)}setStencilRef(e,t){return this._renderingDevice.setStencilRef(e,t)}}function E(e,t,s,r){return 4!==e&&2!==e&&16!==e&&128!==e&&(1!==r||null!=t&&"normal"!==t||null!=s&&s.length>0)}export{M as default};
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(r,o.colorTexture,9728),r.setStencilTestEnabled(!0)}}}export{t as FeatureEffect};
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"../../../../../core/has.js";import{BitBlitRenderer as e}from"../BitBlitRenderer.js";import{Effect as t}from"./Effect.js";import s from"./highlight/HighlightRenderer.js";import r from"./highlight/HighlightSurfaces.js";const i=4,h=4/i;class d extends t{constructor(){super(...arguments),this.defines=["highlight"],this._hlRenderer=new s,this._width=void 0,this._height=void 0,this._hlSurfaces=new r,this._adjustedWidth=void 0,this._adjustedHeight=void 0,this._blitRenderer=new e}dispose(){this._hlSurfaces?.dispose(),this._hlRenderer?.dispose(),this._boundFBO=null}bind(e){const{context:t,painter:s}=e,{width:r,height:i}=t.getViewport(),h=s.getFbos().effect0;this.setup(e,r,i),t.bindFramebuffer(h),t.setColorMask(!0,!0,!0,!0),t.setClearColor(0,0,0,0),t.clear(16384)}unbind(){}setup({context:e},t,s){this._width=t,this._height=s;const r=t%i,d=s%i;t+=r<i/2?-r:i-r,s+=d<i/2?-d:i-d,this._adjustedWidth=t,this._adjustedHeight=s,this._boundFBO=e.boundFramebuffer;const l=Math.round(t*h),o=Math.round(s*h);this._hlRenderer.setup(e,l,o),this._hlSurfaces.setup(e,l,o)}draw(e){const{context:t,passOptions:s}=e,r=s.activeGradient,i=t.boundFramebuffer;t.setViewport(0,0,this._adjustedWidth*h,this._adjustedHeight*h),t.bindFramebuffer(this._hlSurfaces.sharedBlur1Fbo),t.setStencilTestEnabled(!1),t.setClearColor(0,0,0,0),t.clear(16384),this._blitRenderer.render(t,i?.colorTexture,9728,1),t.setStencilTestEnabled(!1),t.setBlendingEnabled(!1),t.setColorMask(!1,!1,!1,!0),t.bindFramebuffer(this._hlSurfaces.sharedBlur2Fbo),t.setClearColor(0,0,0,0),t.clear(16384),this._hlRenderer.preBlur(t,this._hlSurfaces.sharedBlur1Tex),t.bindFramebuffer(this._hlSurfaces.sharedBlur1Fbo),t.setClearColor(0,0,0,0),t.clear(16384),this._hlRenderer.finalBlur(t,this._hlSurfaces.sharedBlur2Tex),t.bindFramebuffer(this._boundFBO),t.setBlendingEnabled(!0),t.setColorMask(!0,!0,!0,!0),t.setViewport(0,0,this._width,this._height),this._hlRenderer.renderHighlight(t,this._hlSurfaces.sharedBlur1Tex,r),this._boundFBO=null}}export{d as default};
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{textureBindingHighlight1 as i,maxHighlightReasons as t}from"../../definitions.js";import{shadeTextureSize as e,sigma as l}from"./parameters.js";import r from"../../../../../support/HighlightOptions.js";import h from"../../../../../webgl/Texture.js";import{TextureDescriptor as n}from"../../../../../webgl/TextureDescriptor.js";const s=()=>o.getLogger("esri.views.2d.engine.webgl.painter.highlight.HighlightGradient");function a(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 u=[0,0,0,0];class d{constructor(){this.type="single",this._highlightOptions=new r,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*e),this._minMaxDistance=[0,0]}setHighlightOptions(o){this._highlightOptions=o}applyHighlightOptions(o,t){this._updateGradientTexture(o),o.bindTexture(this._shadeTex,i),t.setUniform2fv("u_minMaxDistance",this._minMaxDistance)}destroy(){this._shadeTex?.dispose(),this._shadeTex=null}getReasonsWithGradients(){return[{activeReasons:(1<<t)-1,activeGradient:this}]}_updateGradientTexture(o){const i=g(this._highlightOptions);if(i===this._optionsShadeTexKey)return;this._optionsShadeTexKey=i,a(this._highlightOptions,this._convertedHighlightOptions);const t=this._convertedHighlightOptions,r=t.outlinePosition-t.outlineWidth/2-t.outerHaloWidth,d=t.outlinePosition-t.outlineWidth/2,f=t.outlinePosition+t.outlineWidth/2,p=t.outlinePosition+t.outlineWidth/2+t.innerHaloWidth,C=Math.sqrt(Math.PI/2)*l,c=Math.abs(r)>C?Math.round(10*(Math.abs(r)-C))/10:0,m=Math.abs(p)>C?Math.round(10*(Math.abs(p)-C))/10:0;let x;c&&!m?s().error("The outer rim of the highlight is "+c+"px away from the edge of the feature; consider reducing some width values or shifting the outline position towards positive values (inwards)."):!c&&m?s().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)."):c&&m&&s().error("The highlight is "+Math.max(c,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 l=0;l<e;++l)x=r+l/(e-1)*(p-r),x<r?(_[0]=0,_[1]=0,_[2]=0,_[3]=0):x<d?w(u,t.outlineColor,(x-r)/(d-r)):x<f?[_[0],_[1],_[2],_[3]]=t.outlineColor:x<p?w(t.outlineColor,t.fillColor,(x-f)/(p-f)):[_[0],_[1],_[2],_[3]]=t.fillColor,v[4*l]=255*_[0],v[4*l+1]=255*_[1],v[4*l+2]=255*_[2],v[4*l+3]=255*_[3];if(this._minMaxDistance[0]=r,this._minMaxDistance[1]=p,!this._shadeTex){const i=new n(e,1);i.wrapMode=33071,this._shadeTex=new h(o,i)}this._shadeTex.updateData(0,0,0,e,1,this._texelData)}}function g(o){return`${o.color};${o.haloColor};${o.haloOpacity};${o.fillOpacity};${o.haloWidth};${o.haloBlur}`}export{d as default};
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 u{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 u(t,0,0,t[0][0],t[0][1])}clone(){return new u(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 d(t,e,n,s=!0){const i=h(t),r=u.create(t),a=i/2;if(!s)return r.seek(a),void n(r.clone(),0,a+0*e,i);const d=Math.max((i-e)/2,0),c=Math.floor(d/e),o=a-c*e;r.seek(o);for(let h=-c;h<=c;h++)n(r.clone(),h,a+h*e,i),r.seek(e)}function c(t,e,n){o(n,e,h(t),u.create(t),0)}function o(t,e,n,s,i){if(n<e)return;const r=s.clone().seek(n/2);if(null==r)return;t(r.clone(),n,i),n=(n-e)/2;const h=r.seek(e/2);o(t,e,n,s,i+1),o(t,e,n,h,i+1)}function _(t,e){const n=e;for(let s=0;s<t.length;s++){let e=t[s];l(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,u=h-s;i.push([a,u])}t[s]=i,e=i}return t}function l(e,i){const r=1e-6;if(i<=0)return;const h=e.length;if(h<3)return;const a=[];let u=0;a.push(0);for(let t=1;t<h;t++)u+=s(e[t],e[t-1]),a.push(u);i=Math.min(i,.2*u);const d=[];d.push(e[0][0]),d.push(e[0][1]);const c=e[h-1][0],o=e[h-1][1],_=t([0,0],e[0],e[1]);n(_),e[0][0]+=i*_[0],e[0][1]+=i*_[1],t(_,e[h-1],e[h-2]),n(_),e[h-1][0]+=i*_[0],e[h-1][1]+=i*_[1];for(let t=1;t<h;t++)a[t]+=i;a[h-1]+=i;const l=.5*i;for(let t=1;t<h-1;t++){let n=0,s=0,u=0;for(let h=t-1;h>=0&&!(a[h+1]<a[t]-l);h--){const d=l+a[h+1]-a[t],c=a[h+1]-a[h],o=a[t]-a[h]<l?1:d/c;if(Math.abs(o)<r)break;const _=o*o,g=o*d-.5*_*c,x=o*c/i,f=e[h+1],y=e[h][0]-f[0],k=e[h][1]-f[1];n+=x/g*(f[0]*o*d+.5*_*(d*y-c*f[0])-_*o*c*y/3),s+=x/g*(f[1]*o*d+.5*_*(d*k-c*f[1])-_*o*c*k/3),u+=x}for(let d=t+1;d<h&&!(a[d-1]>a[t]+l);d++){const h=l-a[d-1]+a[t],c=a[d]-a[d-1],o=a[d]-a[t]<l?1:h/c;if(Math.abs(o)<r)break;const _=o*o,g=o*h-.5*_*c,x=o*c/i,f=e[d-1],y=e[d][0]-f[0],k=e[d][1]-f[1];n+=x/g*(f[0]*o*h+.5*_*(h*y-c*f[0])-_*o*c*y/3),s+=x/g*(f[1]*o*h+.5*_*(h*k-c*f[1])-_*o*c*k/3),u+=x}d.push(n/u),d.push(s/u)}d.push(c),d.push(o);for(let t=0,n=0;t<h;t++)e[t][0]=d[n++],e[t][1]=d[n++]}export{u as SegmentCursor,d as pathDivide,h as pathLength,c as pathSubdivide,i as segmentAt,r as segmentCount,a as segmentLength,_ as smoothPaths};
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 t=i/a;if(i*a>_){const e=Math.max(Math.floor(Math.sqrt(_/t)),1);i=Math.max(Math.floor(t*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(u,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};
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};