@arcgis/core 5.0.0-next.42 → 5.0.0-next.44

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 (384) hide show
  1. package/applications/Components/imageryUtils.js +1 -1
  2. package/arcade/featureset/sources/FeatureLayerOGC.js +1 -1
  3. package/assets/esri/core/workers/RemoteClient.js +1 -1
  4. package/assets/esri/core/workers/chunks/{f97a7cb367634353177d.js → 001a7a4cf6fe74432ed6.js} +1 -1
  5. package/assets/esri/core/workers/chunks/00ff4ca88c9d291d82c3.js +1 -0
  6. package/assets/esri/core/workers/chunks/04a0685ee53ef74883aa.js +1 -0
  7. package/assets/esri/core/workers/chunks/{c320a29df40e85fb4a8e.js → 15a0750c10b510564a42.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{9d95f38da21f97214f83.js → 1e0e7cef7ef947894bbe.js} +10 -10
  9. package/assets/esri/core/workers/chunks/20ad34f9d45c64392022.js +1 -0
  10. package/assets/esri/core/workers/chunks/23396a6318edf9264c1f.js +1 -0
  11. package/assets/esri/core/workers/chunks/{816227de5bd42b437df4.js → 233f9eb617f3d72995b5.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{fb9643b74cf35221ff98.js → 249504f7d356be80d214.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{ad891ac388fa6c1c9b94.js → 2b34a010f76e5f289868.js} +1 -1
  14. package/assets/esri/core/workers/chunks/2ef4c0092c59a98a5532.js +1 -0
  15. package/assets/esri/core/workers/chunks/35272810c2ed04eb403d.js +1 -0
  16. package/assets/esri/core/workers/chunks/{4f4d51181ae7db9fbe6d.js → 4404b6f931f681cca342.js} +1 -1
  17. package/assets/esri/core/workers/chunks/555a0ea44ba77819d493.js +1 -0
  18. package/assets/esri/core/workers/chunks/6e8925412fb90f88d688.js +1 -0
  19. package/assets/esri/core/workers/chunks/{d1f4152b2b8d47cbf586.js → 72fbee59d5d909615408.js} +1 -1
  20. package/assets/esri/core/workers/chunks/75c66e38bdc1c786c599.js +1 -0
  21. package/assets/esri/core/workers/chunks/7d3c2a063598bdd015e2.js +1 -0
  22. package/assets/esri/core/workers/chunks/83da9ee6544ee9d3c124.js +1 -0
  23. package/assets/esri/core/workers/chunks/897ce6fc9cefb1e14a64.js +1 -0
  24. package/assets/esri/core/workers/chunks/{da517b4b07d4d27ce94c.js → 8e26831f71634288f834.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{c367c7e553be3682f2db.js → 93c5f097bb7b380bb175.js} +1 -1
  26. package/assets/esri/core/workers/chunks/992e9bbdf9d3787ddb0e.js +1 -0
  27. package/assets/esri/core/workers/chunks/9c7682b300b877f60095.js +1 -0
  28. package/assets/esri/core/workers/chunks/a2442549c5daf3653eb4.js +1 -0
  29. package/assets/esri/core/workers/chunks/a7cd795042ebb8585906.js +1 -0
  30. package/assets/esri/core/workers/chunks/{f3b3b193959db809c8c6.js → ab520fd1ae917daf07d8.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{2c9865e34f32fb5683e5.js → af8d6e6949930d0e6c7b.js} +1 -1
  32. package/assets/esri/core/workers/chunks/c9942ca57f542582ab4d.js +1 -0
  33. package/assets/esri/core/workers/chunks/ca1c65eb7f5900c60170.js +1 -0
  34. package/assets/esri/core/workers/chunks/cddce67919e13e2f365e.js +1 -0
  35. package/assets/esri/core/workers/chunks/da2ba40bc017bff0fe49.js +1 -0
  36. package/assets/esri/core/workers/chunks/e5a6a646f27715152714.js +1 -0
  37. package/assets/esri/core/workers/chunks/e6784251bbb8b71ead93.js +1 -0
  38. package/assets/esri/core/workers/chunks/e8a9971c8354569cb81d.js +1 -0
  39. package/assets/esri/core/workers/chunks/{96f798ee286b59396131.js → ea3cba01c60d9bc72719.js} +1 -1
  40. package/assets/esri/core/workers/chunks/ed550bf27f2bbf8d30fa.js +1 -0
  41. package/assets/esri/core/workers/chunks/ee186ddbb1eb5144a790.js +1 -0
  42. package/assets/esri/core/workers/chunks/{1357cc637524cd254974.js → ffcdc7ae03b0570e0db8.js} +1 -1
  43. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  44. package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
  45. package/assets/esri/themes/base/widgets/_Attribution.scss +1 -1
  46. package/assets/esri/themes/dark/main.css +1 -1
  47. package/assets/esri/themes/light/main.css +1 -1
  48. package/assets/esri/themes/light/view.css +1 -1
  49. package/config.js +1 -1
  50. package/core/PooledArray.js +1 -1
  51. package/geometry/FlatGeometry.js +1 -1
  52. package/geometry/support/MeshMaterialMetallicRoughness.js +1 -1
  53. package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
  54. package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
  55. package/interfaces.d.ts +109 -37
  56. package/kernel.js +1 -1
  57. package/layers/ImageryTileLayer.js +1 -1
  58. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  59. package/layers/WCSLayer.js +1 -1
  60. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  61. package/layers/graphics/sources/support/clientSideDefaults.js +1 -1
  62. package/layers/mixins/ArcGISImageService.js +1 -1
  63. package/layers/mixins/ImageryTileMixin.js +1 -1
  64. package/layers/mixins/RasterJobHandlerMixin.js +1 -1
  65. package/layers/ogc/wcsUtils.js +1 -1
  66. package/layers/raster/datasets/BaseRaster.js +5 -0
  67. package/layers/raster/datasets/CovJSONRaster.js +5 -0
  68. package/layers/raster/datasets/FunctionRaster.js +5 -0
  69. package/layers/raster/datasets/ImageAuxRaster.js +5 -0
  70. package/layers/raster/datasets/ImageServerRaster.js +5 -0
  71. package/layers/raster/datasets/InMemoryRaster.js +5 -0
  72. package/layers/raster/datasets/MRFRaster.js +5 -0
  73. package/layers/raster/datasets/RawBlockCache.js +5 -0
  74. package/layers/raster/datasets/TIFFRaster.js +5 -0
  75. package/layers/raster/datasets/WCSRaster.js +5 -0
  76. package/layers/raster/datasets/covJSONParser.js +5 -0
  77. package/layers/raster/datasets/multidimensionalUtils.js +5 -0
  78. package/layers/raster/datasets/pamParser.js +5 -0
  79. package/layers/raster/datasets/pixelReader.js +5 -0
  80. package/layers/raster/datasets/wcsCoverageParser.js +5 -0
  81. package/layers/raster/formats/Lerc.js +5 -0
  82. package/layers/raster/formats/Qb3.js +5 -0
  83. package/layers/raster/formats/RasterCodec.js +5 -0
  84. package/layers/raster/formats/TiffDecoder.js +5 -0
  85. package/layers/raster/functions/ArithmeticFunction.js +5 -0
  86. package/layers/{support/rasterFunctions → raster/functions}/ArithmeticFunctionArguments.js +1 -1
  87. package/layers/{support/rasterFunctions → raster/functions}/AspectFunction.js +1 -1
  88. package/layers/{support/rasterFunctions → raster/functions}/AspectFunctionArguments.js +1 -1
  89. package/layers/raster/functions/BandArithmeticFunction.js +5 -0
  90. package/layers/{support/rasterFunctions → raster/functions}/BandArithmeticFunctionArguments.js +1 -1
  91. package/layers/{support/rasterFunctions → raster/functions}/BaseFunctionArguments.js +1 -1
  92. package/layers/raster/functions/BaseRasterFunction.js +5 -0
  93. package/layers/{support/rasterFunctions → raster/functions}/ClipFunction.js +1 -1
  94. package/layers/{support/rasterFunctions → raster/functions}/ClipFunctionArguments.js +1 -1
  95. package/layers/raster/functions/ColormapFunction.js +5 -0
  96. package/layers/{support/rasterFunctions → raster/functions}/ColormapFunctionArguments.js +1 -1
  97. package/layers/raster/functions/ColormapToRGBFunction.js +5 -0
  98. package/layers/{support/rasterFunctions → raster/functions}/ColormapToRGBFunctionArguments.js +1 -1
  99. package/layers/raster/functions/CompositeBandFunction.js +5 -0
  100. package/layers/raster/functions/CompositeBandFunctionArguments.js +5 -0
  101. package/layers/raster/functions/ComputeChangeFunction.js +5 -0
  102. package/layers/{support/rasterFunctions → raster/functions}/ComputeChangeFunctionArguments.js +1 -1
  103. package/layers/{support/rasterFunctions → raster/functions}/ContrastBrightnessFunction.js +1 -1
  104. package/layers/{support/rasterFunctions → raster/functions}/ContrastBrightnessFunctionArguments.js +1 -1
  105. package/layers/raster/functions/ConvolutionFunction.js +5 -0
  106. package/layers/raster/functions/ConvolutionFunctionArguments.js +5 -0
  107. package/layers/{support/rasterFunctions → raster/functions}/CurvatureFunction.js +1 -1
  108. package/layers/{support/rasterFunctions → raster/functions}/CurvatureFunctionArguments.js +1 -1
  109. package/layers/{support/rasterFunctions → raster/functions}/ExtractBandFunction.js +1 -1
  110. package/layers/{support/rasterFunctions → raster/functions}/ExtractBandFunctionArguments.js +1 -1
  111. package/layers/{support/rasterFunctions → raster/functions}/GrayscaleFunction.js +1 -1
  112. package/layers/{support/rasterFunctions → raster/functions}/GrayscaleFunctionArguments.js +1 -1
  113. package/layers/raster/functions/HillshadeFunction.js +5 -0
  114. package/layers/{support/rasterFunctions → raster/functions}/HillshadeFunctionArguments.js +1 -1
  115. package/layers/raster/functions/LocalFunction.js +5 -0
  116. package/layers/{support/rasterFunctions → raster/functions}/LocalFunctionArguments.js +1 -1
  117. package/layers/{support/rasterFunctions → raster/functions}/MaskFunction.js +1 -1
  118. package/layers/{support/rasterFunctions → raster/functions}/MaskFunctionArguments.js +1 -1
  119. package/layers/{support/rasterFunctions → raster/functions}/NDVIFunction.js +1 -1
  120. package/layers/{support/rasterFunctions → raster/functions}/NDVIFunctionArguments.js +1 -1
  121. package/layers/raster/functions/RemapFunction.js +5 -0
  122. package/layers/{support/rasterFunctions → raster/functions}/RemapFunctionArguments.js +1 -1
  123. package/layers/raster/functions/ShadedReliefFunction.js +5 -0
  124. package/layers/{support/rasterFunctions → raster/functions}/ShadedReliefFunctionArguments.js +1 -1
  125. package/layers/raster/functions/SlopeFunction.js +5 -0
  126. package/layers/{support/rasterFunctions → raster/functions}/SlopeFunctionArguments.js +1 -1
  127. package/layers/raster/functions/StatisticsFunction.js +5 -0
  128. package/layers/{support/rasterFunctions → raster/functions}/StatisticsFunctionArguments.js +1 -1
  129. package/layers/{support/rasterFunctions → raster/functions}/StatisticsHistogramFunction.js +1 -1
  130. package/layers/{support/rasterFunctions → raster/functions}/StatisticsHistogramFunctionArguments.js +1 -1
  131. package/layers/raster/functions/StretchFunction.js +5 -0
  132. package/layers/{support/rasterFunctions → raster/functions}/StretchFunctionArguments.js +1 -1
  133. package/layers/{support/rasterFunctions → raster/functions}/TableFunction.js +1 -1
  134. package/layers/{support/rasterFunctions → raster/functions}/TableFunctionArguments.js +1 -1
  135. package/layers/raster/functions/bandIndexUtils.js +5 -0
  136. package/layers/raster/functions/changeDetectionUtils.js +5 -0
  137. package/layers/raster/functions/clipUtils.js +5 -0
  138. package/layers/raster/functions/conversionUtils.js +5 -0
  139. package/layers/raster/functions/convolutionUtils.js +5 -0
  140. package/layers/raster/functions/creators/createDataManagementFunctions.js +5 -0
  141. package/layers/raster/functions/creators/utils.js +5 -0
  142. package/layers/raster/functions/focalStatUtils.js +5 -0
  143. package/layers/raster/functions/localUtils.js +5 -0
  144. package/layers/raster/functions/pixelTransformUtils.js +5 -0
  145. package/layers/raster/functions/pixelUtils.js +5 -0
  146. package/layers/raster/functions/stretchUtils.js +5 -0
  147. package/layers/raster/functions/surfaceUtils.js +5 -0
  148. package/layers/raster/functions/vectorFieldUtils.js +5 -0
  149. package/layers/raster/transforms/BaseRasterTransform.js +5 -0
  150. package/layers/{support/rasterTransforms → raster/transforms}/GCSShiftTransform.js +1 -1
  151. package/layers/{support/rasterTransforms → raster/transforms}/IdentityTransform.js +1 -1
  152. package/layers/{support/rasterTransforms → raster/transforms}/PolynomialTransform.js +1 -1
  153. package/layers/save/imageryUtils.js +1 -1
  154. package/layers/support/PixelBlock.js +1 -1
  155. package/layers/support/RasterWorker.js +1 -1
  156. package/layers/support/imageryRendererUtils.js +1 -1
  157. package/layers/support/rasterFunctionUtils.js +1 -1
  158. package/package.json +1 -1
  159. package/renderers/VectorFieldRenderer.js +1 -1
  160. package/renderers/support/RasterSymbolizer.js +1 -1
  161. package/renderers/support/rasterRendererHelper.js +1 -1
  162. package/rest/locator/addressToLocations.js +1 -1
  163. package/rest/locator/addressesToLocations.js +1 -1
  164. package/rest/locator/suggestLocations.js +1 -1
  165. package/rest/networks/support/Association.js +1 -1
  166. package/smartMapping/raster/support/adapters/ImageryLayerAdapter.js +1 -1
  167. package/smartMapping/raster/support/adapters/ImageryTileLayerAdapter.js +1 -1
  168. package/support/revision.js +1 -1
  169. package/views/2d/engine/imagery/RasterVFDisplayObject.js +1 -1
  170. package/views/2d/engine/webgl/cpuMapped/MappedMesh.js +1 -1
  171. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/RasterRangeHighlightShader.js +1 -1
  172. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/MaskShader.js +1 -1
  173. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/RemapShader.js +1 -1
  174. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/math.js +1 -1
  175. package/views/2d/engine/webgl/shaderGraph/typed/TypedShaderProgram.js +1 -1
  176. package/views/2d/engine/webgl/textureUtils.js +1 -1
  177. package/views/2d/layers/ImageryLayerView2D.js +1 -1
  178. package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
  179. package/views/2d/layers/MediaLayerView2D.js +1 -1
  180. package/views/2d/layers/TileLayerView2D.js +1 -1
  181. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  182. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  183. package/views/2d/layers/imagery/ImageryView2D.js +1 -1
  184. package/views/2d/layers/imagery/VectorFieldTileView2D.js +1 -1
  185. package/views/2d/layers/imagery/VectorFieldView2D.js +1 -1
  186. package/views/3d/glTF/LoaderResult.js +1 -1
  187. package/views/3d/glTF/internal/Resource.js +1 -1
  188. package/views/3d/glTF/loader.js +1 -1
  189. package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
  190. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  191. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  192. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  193. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  194. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  195. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  196. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  197. package/views/3d/layers/i3s/I3SGraphicsMap.js +1 -1
  198. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  199. package/views/3d/support/buffer/glUtil.js +1 -1
  200. package/views/3d/support/gaussianSplatting/GaussianSplatFadeTexture.js +1 -1
  201. package/views/3d/support/gaussianSplatting/GaussianSplatOrderTexture.js +1 -1
  202. package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +1 -1
  203. package/views/3d/webgl-engine/collections/Component/Material/ComponentData.glsl.js +1 -1
  204. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  205. package/views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js +1 -1
  206. package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBuffer.glsl.js +10 -10
  207. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferLayout.js +1 -1
  208. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBufferView.js +1 -1
  209. package/views/3d/webgl-engine/lib/edgeRendering/bufferLayouts.js +1 -1
  210. package/views/3d/webgl-engine/lib/edgeRendering/edgeProcessing.js +1 -1
  211. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  212. package/views/3d/webgl-engine/materials/DefaultLayouts.js +1 -1
  213. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  214. package/views/3d/webgl-engine/materials/DrawParameters.js +1 -1
  215. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  216. package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
  217. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  218. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  219. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  220. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  221. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  222. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  223. package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
  224. package/views/3d/webgl-engine/materials/renderers/Instance.js +1 -1
  225. package/views/3d/webgl-engine/materials/renderers/MergedBuffer.js +1 -1
  226. package/views/3d/webgl-engine/materials/renderers/PerBufferData.js +1 -1
  227. package/views/3d/webgl-engine/materials/renderers/PerOriginData.js +1 -1
  228. package/views/3d/webgl-engine/materials/renderers/VaoRenderer.js +1 -1
  229. package/views/3d/webgl-engine/materials/renderers/VaoWriter.js +1 -1
  230. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  231. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl.js +9 -9
  232. package/views/DOMContainer.js +1 -1
  233. package/views/GroundView.js +1 -1
  234. package/views/VideoView.js +1 -1
  235. package/views/layers/ImageryLayerViewMixin.js +1 -1
  236. package/views/layers/ImageryTileLayerViewMixin.js +1 -1
  237. package/views/support/imageReprojection.js +1 -1
  238. package/views/webgl/ShaderBuilder.js +1 -1
  239. package/views/webgl/Util.js +1 -1
  240. package/views/webgl/VertexElementDescriptor.js +1 -1
  241. package/widgets/BatchAttributeForm.js +1 -1
  242. package/widgets/BuildingExplorer/BuildingExplorerViewModel.js +1 -1
  243. package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
  244. package/widgets/CoordinateConversion.js +1 -1
  245. package/widgets/DirectLineMeasurement3D.js +1 -1
  246. package/widgets/DistanceMeasurement2D.js +1 -1
  247. package/widgets/Editor/EditorViewModel.js +1 -1
  248. package/widgets/Editor.js +1 -1
  249. package/widgets/ElevationProfile.js +1 -1
  250. package/widgets/Feature.js +1 -1
  251. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  252. package/widgets/FeatureForm.js +1 -1
  253. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  254. package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
  255. package/widgets/FeatureTable/support/GroupColumnTemplate.js +1 -1
  256. package/widgets/FeatureTable/support/TableTemplate.js +1 -1
  257. package/widgets/FeatureTable.js +1 -1
  258. package/widgets/FeatureTemplates.js +1 -1
  259. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  260. package/widgets/Legend.js +1 -1
  261. package/widgets/LineOfSight.js +1 -1
  262. package/widgets/Locate.js +1 -1
  263. package/widgets/OrientedImageryViewer/galleryUtils.js +1 -1
  264. package/widgets/OrientedImageryViewer/services/DepthImageService.js +1 -1
  265. package/widgets/PanoramicViewer/support/importUtils.js +1 -1
  266. package/widgets/Print.js +1 -1
  267. package/widgets/ScaleBar.js +1 -1
  268. package/widgets/ScaleRangeSlider.js +1 -1
  269. package/widgets/Search/SearchResultRenderer.js +1 -1
  270. package/widgets/Search/SearchViewModel.js +1 -1
  271. package/widgets/Search/types.js +1 -1
  272. package/widgets/Search.js +1 -1
  273. package/widgets/ShadowCast.js +1 -1
  274. package/widgets/Sketch/SketchViewModel.js +1 -1
  275. package/widgets/Sketch.js +1 -1
  276. package/widgets/VersionManagement/VersionManagementViewModel.js +1 -1
  277. package/assets/esri/core/workers/chunks/0a5427127634738aa239.js +0 -1
  278. package/assets/esri/core/workers/chunks/110429583b28c28c36ee.js +0 -1
  279. package/assets/esri/core/workers/chunks/145c6a7cdcc9893efb27.js +0 -1
  280. package/assets/esri/core/workers/chunks/1bacdd17e199e22b5cd1.js +0 -1
  281. package/assets/esri/core/workers/chunks/1d566539ff6fb6ac798c.js +0 -1
  282. package/assets/esri/core/workers/chunks/1f6ead46b723630db897.js +0 -1
  283. package/assets/esri/core/workers/chunks/3a16347e17312556e02c.js +0 -1
  284. package/assets/esri/core/workers/chunks/478def691ae6763686f3.js +0 -1
  285. package/assets/esri/core/workers/chunks/4c4a55be41ba105c091c.js +0 -1
  286. package/assets/esri/core/workers/chunks/4cbf5a97b2b3c6553f6f.js +0 -1
  287. package/assets/esri/core/workers/chunks/5dc0d853c21ccb6054c7.js +0 -1
  288. package/assets/esri/core/workers/chunks/613cbac9cb925cd20b48.js +0 -1
  289. package/assets/esri/core/workers/chunks/646f58b69d2354f1ef27.js +0 -1
  290. package/assets/esri/core/workers/chunks/800c91302eaad7f00877.js +0 -1
  291. package/assets/esri/core/workers/chunks/93d11075f65a5b6625ea.js +0 -1
  292. package/assets/esri/core/workers/chunks/9f2a8445a5848502c7e7.js +0 -1
  293. package/assets/esri/core/workers/chunks/a1b08aab73747f4e7e25.js +0 -1
  294. package/assets/esri/core/workers/chunks/ba59568e748f0ba53b78.js +0 -1
  295. package/assets/esri/core/workers/chunks/c4de24582c29fda5a033.js +0 -1
  296. package/assets/esri/core/workers/chunks/d786b17cc9062b1450ac.js +0 -1
  297. package/assets/esri/core/workers/chunks/d9958654c6438f28237b.js +0 -1
  298. package/assets/esri/core/workers/chunks/e6fa6f9c278589c8a713.js +0 -1
  299. package/assets/esri/core/workers/chunks/e7f4d135ef9665de1468.js +0 -1
  300. package/assets/esri/core/workers/chunks/f21cb5b34d4d1e3af1a9.js +0 -1
  301. package/assets/esri/core/workers/chunks/f93f0586ce10cb5d98b3.js +0 -1
  302. package/layers/support/rasterDatasets/BaseRaster.js +0 -5
  303. package/layers/support/rasterDatasets/CovJSONRaster.js +0 -5
  304. package/layers/support/rasterDatasets/FunctionRaster.js +0 -5
  305. package/layers/support/rasterDatasets/ImageAuxRaster.js +0 -5
  306. package/layers/support/rasterDatasets/ImageServerRaster.js +0 -5
  307. package/layers/support/rasterDatasets/InMemoryRaster.js +0 -5
  308. package/layers/support/rasterDatasets/MRFRaster.js +0 -5
  309. package/layers/support/rasterDatasets/RawBlockCache.js +0 -5
  310. package/layers/support/rasterDatasets/TIFFRaster.js +0 -5
  311. package/layers/support/rasterDatasets/WCSRaster.js +0 -5
  312. package/layers/support/rasterDatasets/covJSONParser.js +0 -5
  313. package/layers/support/rasterDatasets/multidimensionalUtils.js +0 -5
  314. package/layers/support/rasterDatasets/pamParser.js +0 -5
  315. package/layers/support/rasterDatasets/pixelReader.js +0 -5
  316. package/layers/support/rasterDatasets/wcsCoverageParser.js +0 -5
  317. package/layers/support/rasterFormats/Lerc.js +0 -5
  318. package/layers/support/rasterFormats/Qb3.js +0 -5
  319. package/layers/support/rasterFormats/RasterCodec.js +0 -5
  320. package/layers/support/rasterFormats/TiffDecoder.js +0 -5
  321. package/layers/support/rasterFunctions/ArithmeticFunction.js +0 -5
  322. package/layers/support/rasterFunctions/BandArithmeticFunction.js +0 -5
  323. package/layers/support/rasterFunctions/BaseRasterFunction.js +0 -5
  324. package/layers/support/rasterFunctions/ColormapFunction.js +0 -5
  325. package/layers/support/rasterFunctions/ColormapToRGBFunction.js +0 -5
  326. package/layers/support/rasterFunctions/CompositeBandFunction.js +0 -5
  327. package/layers/support/rasterFunctions/CompositeBandFunctionArguments.js +0 -5
  328. package/layers/support/rasterFunctions/ComputeChangeFunction.js +0 -5
  329. package/layers/support/rasterFunctions/ConvolutionFunction.js +0 -5
  330. package/layers/support/rasterFunctions/ConvolutionFunctionArguments.js +0 -5
  331. package/layers/support/rasterFunctions/HillshadeFunction.js +0 -5
  332. package/layers/support/rasterFunctions/LocalFunction.js +0 -5
  333. package/layers/support/rasterFunctions/RemapFunction.js +0 -5
  334. package/layers/support/rasterFunctions/ShadedReliefFunction.js +0 -5
  335. package/layers/support/rasterFunctions/SlopeFunction.js +0 -5
  336. package/layers/support/rasterFunctions/StatisticsFunction.js +0 -5
  337. package/layers/support/rasterFunctions/StretchFunction.js +0 -5
  338. package/layers/support/rasterFunctions/bandIndexUtils.js +0 -5
  339. package/layers/support/rasterFunctions/changeDetectionUtils.js +0 -5
  340. package/layers/support/rasterFunctions/clipUtils.js +0 -5
  341. package/layers/support/rasterFunctions/conversionUtils.js +0 -5
  342. package/layers/support/rasterFunctions/convolutionUtils.js +0 -5
  343. package/layers/support/rasterFunctions/creators/createDataManagementFunctions.js +0 -5
  344. package/layers/support/rasterFunctions/creators/utils.js +0 -5
  345. package/layers/support/rasterFunctions/focalStatUtils.js +0 -5
  346. package/layers/support/rasterFunctions/localUtils.js +0 -5
  347. package/layers/support/rasterFunctions/pixelTransformUtils.js +0 -5
  348. package/layers/support/rasterFunctions/pixelUtils.js +0 -5
  349. package/layers/support/rasterFunctions/stretchUtils.js +0 -5
  350. package/layers/support/rasterFunctions/surfaceUtils.js +0 -5
  351. package/layers/support/rasterFunctions/vectorFieldUtils.js +0 -5
  352. package/layers/support/rasterTransforms/BaseRasterTransform.js +0 -5
  353. /package/assets/esri/layers/{support/rasterFormats → raster/formats}/lerc-wasm.wasm +0 -0
  354. /package/assets/esri/layers/{support/rasterFormats → raster/formats}/qb3-wasm.wasm +0 -0
  355. /package/layers/{support/rasterDatasets → raster/datasets}/DBFParser.js +0 -0
  356. /package/layers/{support/rasterDatasets → raster/datasets}/EphemeralBlockCache.js +0 -0
  357. /package/layers/{support/rasterDatasets → raster/datasets}/RasterFactory.js +0 -0
  358. /package/layers/{support/rasterDatasets → raster/datasets}/byteStreamUtils.js +0 -0
  359. /package/layers/{support/rasterDatasets → raster/datasets}/datasetUtils.js +0 -0
  360. /package/layers/{support/rasterDatasets → raster/datasets}/multipartParser.js +0 -0
  361. /package/layers/{support/rasterDatasets → raster/datasets}/wcsCapabilitiesParser.js +0 -0
  362. /package/layers/{support/rasterDatasets → raster/datasets}/xmlUtilities.js +0 -0
  363. /package/layers/{support/rasterFormats → raster/formats}/ImageCanvasDecoder.js +0 -0
  364. /package/layers/{support/rasterFormats → raster/formats}/JpgPlus.js +0 -0
  365. /package/layers/{support/rasterFormats → raster/formats}/Lzw.js +0 -0
  366. /package/layers/{support/rasterFormats → raster/formats}/Raw.js +0 -0
  367. /package/layers/{support/rasterFormats → raster/formats}/pixelRangeUtils.js +0 -0
  368. /package/layers/{support/rasterFormats → raster/formats}/tiffTag.js +0 -0
  369. /package/layers/{support/rasterFormats → raster/formats}/utils.js +0 -0
  370. /package/layers/{support/rasterFunctions → raster/functions}/colormaps.js +0 -0
  371. /package/layers/{support/rasterFunctions → raster/functions}/creators/createAppearenceFunctions.js +0 -0
  372. /package/layers/{support/rasterFunctions → raster/functions}/creators/createBandIndexFunctions.js +0 -0
  373. /package/layers/{support/rasterFunctions → raster/functions}/creators/createChangeFunctions.js +0 -0
  374. /package/layers/{support/rasterFunctions → raster/functions}/creators/createConversionFunctions.js +0 -0
  375. /package/layers/{support/rasterFunctions → raster/functions}/creators/createLocalFunctions.js +0 -0
  376. /package/layers/{support/rasterFunctions → raster/functions}/creators/createMultiRasterAnalysisFunctions.js +0 -0
  377. /package/layers/{support/rasterFunctions → raster/functions}/creators/createStatisticsFunctions.js +0 -0
  378. /package/layers/{support/rasterFunctions → raster/functions}/creators/createSurfaceFunctions.js +0 -0
  379. /package/layers/{support/rasterFunctions → raster/functions}/customBandIndexUtils.js +0 -0
  380. /package/layers/{support/rasterFunctions → raster/functions}/mirror.js +0 -0
  381. /package/layers/{support/rasterFunctions → raster/functions}/rasterFunctionHelper.js +0 -0
  382. /package/layers/{support/rasterFunctions → raster/functions}/rasterFunctionSchema.js +0 -0
  383. /package/layers/{support/rasterFunctions → raster/functions}/rasterProjectionHelper.js +0 -0
  384. /package/layers/{support/rasterTransforms → raster/transforms}/utils.js +0 -0
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ import{__decorate as t}from"tslib";import{numberMaxFloat32 as e}from"../../../core/mathUtils.js";import{property as s,subclass as n}from"../../../core/accessorSupport/decorators.js";import{getPixelValueRange as u}from"../formats/pixelRangeUtils.js";import a from"./BaseRasterFunction.js";import{createRemapLUT as o,maxMapSizeGpu as i,lookupPixels as l,lookupBandValues as r,remap as p,createRangeMaps as m}from"./pixelUtils.js";import c from"./RemapFunctionArguments.js";let f=class extends a{constructor(){super(...arguments),this.functionName="Remap",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone(),{pixelType:e}=t;t.bandCount=1;const{statistics:s}=t;this._removeStatsHistColormapVAT(t);const{allowUnmatched:n,replacementValue:a,outputValues:l,inputRanges:r,noDataRanges:p,isLastInputRangeInclusive:m}=this.functionArguments,c="unknown"===this.outputPixelType||null==this.outputPixelType;if(this.outputPixelType=this._getOutputPixelType(e),l?.length){const o=s?.[0];if(n&&null==a){let e=o?.min??l[0],s=o?.max??l[0];e=Math.min.apply(null,[...l,e]),s=Math.max.apply(null,[...l,s]),t.statistics=[{min:e,max:s,avg:o?.avg??0,stddev:o?.stddev??-1}]}else{let e=l[0],s=e;for(let t=0;t<l.length;t++)e=e>l[t]?l[t]:e,s=s>l[t]?s:l[t];n&&null!=a&&(e=Math.min(e,a),s=Math.max(s,a)),t.statistics=[{min:e,max:s,avg:o?.avg??0,stddev:o?.stddev??-1}]}if(c){const{min:s,max:o}=t.statistics[0],i=["u8","s8","u16","s16","u32","s32","f32"],r=i.find(t=>{const[e,n]=u(t);return s>=e&&o<=n})??"f64";l.some(t=>Math.floor(t)!==t)?this.outputPixelType="f64"===r?"f64":"f32":this.outputPixelType=n&&null==a&&i.indexOf(e)>i.indexOf(r)?e:r}}t.pixelType=this.outputPixelType,this.rasterInfo=t,this.lookup=n?null:o({srcPixelType:e,inputRanges:r,outputValues:l,noDataRanges:p,allowUnmatched:n,isLastInputRangeInclusive:m,outputPixelType:this.outputPixelType});return{success:!0,supportsGPU:(!l||l.length<=i)&&(!p||p.length<=i)}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return null;const{lookup:s,outputPixelType:n}=this;if(s){const t=l(e,{lut:[s.lut],offset:s.offset,outputPixelType:n});return null!=t&&s.mask&&(t.mask=r(e.pixels[0],e.mask,s.mask,s.offset,"u8")),t}const{inputRanges:u,outputValues:a,noDataRanges:o,allowUnmatched:i,isLastInputRangeInclusive:m,replacementValue:c}=this.functionArguments;return p(e,{inputRanges:u,outputValues:a,noDataRanges:o,outputPixelType:n,allowUnmatched:i,isLastInputRangeInclusive:m,replacementValue:c})}_getWebGLParameters(){const{allowUnmatched:t,noDataRanges:s,isLastInputRangeInclusive:n}=this.functionArguments,a=this.functionArguments.inputRanges??[],o=this.functionArguments.outputValues??[],l=m(a,o,n),r=new Float32Array(2*i);r.fill(e),s?.length&&r.set(s);return{allowUnmatched:t,rangeMaps:l,noDataRanges:r,clampRange:u(this.outputPixelType),replacementValue:this.functionArguments.replacementValue}}};t([s({json:{write:!0,name:"rasterFunction"}})],f.prototype,"functionName",void 0),t([s({type:c,json:{write:!0,name:"rasterFunctionArguments"}})],f.prototype,"functionArguments",void 0),t([s()],f.prototype,"rasterArgumentNames",void 0),t([s({json:{write:!0}})],f.prototype,"lookup",void 0),f=t([n("esri.layers.raster.functions.RemapFunction")],f);const g=f;export{g as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import{property as s,subclass as e}from"../../../core/accessorSupport/decorators.js";import n from"./BaseFunctionArguments.js";var o;let a=o=class extends n{constructor(){super(...arguments),this.inputRanges=null,this.outputValues=null,this.noDataRanges=null,this.allowUnmatched=!1,this.isLastInputRangeInclusive=!1}clone(){return new o({inputRanges:[...this.inputRanges],outputValues:[...this.outputValues],noDataRanges:[...this.noDataRanges],allowUnmatched:this.allowUnmatched,isLastInputRangeInclusive:this.isLastInputRangeInclusive})}};t([s({json:{write:!0}})],a.prototype,"inputRanges",void 0),t([s({json:{write:!0}})],a.prototype,"outputValues",void 0),t([s({json:{write:!0}})],a.prototype,"noDataRanges",void 0),t([s({json:{write:!0}})],a.prototype,"allowUnmatched",void 0),t([s({json:{write:!0}})],a.prototype,"replacementValue",void 0),t([s({json:{write:!0}})],a.prototype,"isLastInputRangeInclusive",void 0),a=o=t([e("esri.layers.support.rasterFunctions.RemapFunctionArguments")],a);const i=a;export{i as default};
5
+ import{__decorate as t}from"tslib";import{property as s,subclass as e}from"../../../core/accessorSupport/decorators.js";import n from"./BaseFunctionArguments.js";var o;let a=o=class extends n{constructor(){super(...arguments),this.inputRanges=null,this.outputValues=null,this.noDataRanges=null,this.allowUnmatched=!1,this.isLastInputRangeInclusive=!1}clone(){return new o({inputRanges:[...this.inputRanges],outputValues:[...this.outputValues],noDataRanges:[...this.noDataRanges],allowUnmatched:this.allowUnmatched,isLastInputRangeInclusive:this.isLastInputRangeInclusive})}};t([s({json:{write:!0}})],a.prototype,"inputRanges",void 0),t([s({json:{write:!0}})],a.prototype,"outputValues",void 0),t([s({json:{write:!0}})],a.prototype,"noDataRanges",void 0),t([s({json:{write:!0}})],a.prototype,"allowUnmatched",void 0),t([s({json:{write:!0}})],a.prototype,"replacementValue",void 0),t([s({json:{write:!0}})],a.prototype,"isLastInputRangeInclusive",void 0),a=o=t([e("esri.layers.raster.functions.RemapFunctionArguments")],a);const i=a;export{i as default};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ import{__decorate as e}from"tslib";import{property as t,subclass as s}from"../../../core/accessorSupport/decorators.js";import{isIntegerPixelType as r}from"../formats/pixelRangeUtils.js";import o from"./BaseRasterFunction.js";import{createColormapLUT as i}from"./pixelUtils.js";import n from"./ShadedReliefFunctionArguments.js";import{getHillshadeOptions as a,hillshade as p,tintHillshade as u,calculateHillshadeParams as c,gcsFactor as l}from"./surfaceUtils.js";import{convertColorRampToColormap as m,createHsvMap as d}from"../../../renderers/support/colorRampUtils.js";import{isColormapSupportedByWebGL as f}from"../../../renderers/support/rasterRendererChecks.js";let h=class extends o{constructor(){super(...arguments),this.functionName="ShadedRelief",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){const e=this.sourceRasterInfos[0];if(e.bandCount>1)return{success:!1,supportsGPU:!1,error:"shadedrelief-function: source data must be single band"};let{colorRamp:t,colormap:s}=this.functionArguments;if(!t&&!s?.length)return{success:!1,supportsGPU:!1,error:"shadedrelief-function: a color ramp argument must be specified"};this.outputPixelType=this._getOutputPixelType("u8");const r=e.clone();this._removeStatsHistColormapVAT(r),r.pixelType=this.outputPixelType,r.bandCount=3,r.statistics=[{min:0,max:255,avg:60,stddev:10},{min:0,max:255,avg:60,stddev:10},{min:0,max:255,avg:60,stddev:10}],this.rasterInfo=r,this.isGCS=r.spatialReference?.isGeographic??!1,s?.length||(s=m(t,{interpolateAlpha:!0}));const{indexedColormap:o,offset:n}=i({colormap:s});if(!o?.length)return{success:!1,supportsGPU:!1,error:"shadedrelief-function: a valid colorramp is required"};const a=d(o);return this.lookup={indexedColormap:o,offset:n,hsvMap:a},{success:!0,supportsGPU:f(o)}}_processPixels(e){const t=e.pixelBlocks?.[0];if(!t||!this.lookup)return null;let s=e.primaryPixelSizes?.[0];if(null==s){const{extent:r}=e;s=r?{x:r.width/t.width,y:r.height/t.height}:{x:1,y:1}}const r=a(this.functionArguments,s,this.isGCS),o=p(t,r),i=this.sourceRasterInfos[0].statistics?.[0]??{min:0,max:8e3};return u(o,t,this.lookup.hsvMap,i),o.pixelType=this.outputPixelType,o}_getWebGLParameters(){const e=a(this.functionArguments,{x:1,y:1},this.isGCS),t=c(e),{slopeType:s,zFactor:o,pixelSizeFactor:i,pixelSizePower:n}=this.functionArguments,p="scaled"===s,{indexedColormap:u,offset:m}=this.lookup,d=this.sourceRasterInfos[0].statistics?.[0],f=r(this.outputPixelType);return{...t,indexedColormap:u,offset:m,zFactor:o,gcsFactor:this.isGCS?l:1,pixelSizeFactor:p?i:0,pixelSizePower:p?n:0,minValue:d?.min??0,maxValue:d?.max??8e3,isOutputRounded:f}}};e([t({json:{write:!0,name:"rasterFunction"}})],h.prototype,"functionName",void 0),e([t({type:n,json:{write:!0,name:"rasterFunctionArguments"}})],h.prototype,"functionArguments",void 0),e([t()],h.prototype,"rasterArgumentNames",void 0),e([t({json:{write:!0}})],h.prototype,"isGCS",void 0),e([t({json:{write:!0}})],h.prototype,"lookup",void 0),h=e([s("esri.layers.raster.functions.ShadedReliefFunction")],h);const x=h;export{x as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as o}from"tslib";import{property as e,subclass as r}from"../../../core/accessorSupport/decorators.js";import t from"./HillshadeFunctionArguments.js";import{colorRampDict as s,getColorRampJSON as i}from"../../../renderers/support/colorRampUtils.js";import{reader as p}from"../../../core/accessorSupport/decorators/reader.js";var a;let l=a=class extends t{readColorRamp(o){if("string"==typeof o){const e=s.jsonValues.find(e=>e.toLowerCase()===o.toLowerCase());return e?i(s.fromJSON(e)):null}return"toJSON"in o?o.toJSON():o}clone(){return new a({hillshadeType:this.hillshadeType,altitude:this.altitude,azimuth:this.azimuth,zFactor:this.zFactor,slopeType:this.slopeType,pixelSizeFactor:this.pixelSizeFactor,pixelSizePower:this.pixelSizePower,removeEdgeEffect:this.removeEdgeEffect,colorRamp:this.colorRamp,colormap:this.colormap,raster:this.raster})}};o([e({json:{write:!0}})],l.prototype,"colorRamp",void 0),o([p("colorRamp")],l.prototype,"readColorRamp",null),o([e({type:[[Number]],json:{write:!0}})],l.prototype,"colormap",void 0),l=a=o([r("esri.layers.support.rasterFunctions.ShadedReliefFunctionArguments")],l);const c=l;export{c as default};
5
+ import{__decorate as o}from"tslib";import{property as e,subclass as r}from"../../../core/accessorSupport/decorators.js";import t from"./HillshadeFunctionArguments.js";import{colorRampDict as s,getColorRampJSON as i}from"../../../renderers/support/colorRampUtils.js";import{reader as a}from"../../../core/accessorSupport/decorators/reader.js";var p;let l=p=class extends t{readColorRamp(o){if("string"==typeof o){const e=s.jsonValues.find(e=>e.toLowerCase()===o.toLowerCase());return e?i(s.fromJSON(e)):null}return"toJSON"in o?o.toJSON():o}clone(){return new p({hillshadeType:this.hillshadeType,altitude:this.altitude,azimuth:this.azimuth,zFactor:this.zFactor,slopeType:this.slopeType,pixelSizeFactor:this.pixelSizeFactor,pixelSizePower:this.pixelSizePower,removeEdgeEffect:this.removeEdgeEffect,colorRamp:this.colorRamp,colormap:this.colormap,raster:this.raster})}};o([e({json:{write:!0}})],l.prototype,"colorRamp",void 0),o([a("colorRamp")],l.prototype,"readColorRamp",null),o([e({type:[[Number]],json:{write:!0}})],l.prototype,"colormap",void 0),l=p=o([r("esri.layers.raster.functions.ShadedReliefFunctionArguments")],l);const c=l;export{c as default};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ import{__decorate as t}from"tslib";import{property as e,subclass as s}from"../../../core/accessorSupport/decorators.js";import{isIntegerPixelType as i}from"../formats/pixelRangeUtils.js";import o from"./BaseRasterFunction.js";import r from"./SlopeFunctionArguments.js";import{slope as n,gcsFactor as p}from"./surfaceUtils.js";let u=class extends o{constructor(){super(...arguments),this.functionName="Slope",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){this.outputPixelType=this._getOutputPixelType("f32");const t=this.sourceRasterInfos[0].clone();return t.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(t),t.statistics="percent-rise"!==this.functionArguments.slopeType?[{min:0,max:90,avg:1,stddev:1}]:null,t.bandCount=1,this.rasterInfo=t,this.isGCS=t.spatialReference?.isGeographic??!1,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return null;const{zFactor:s,slopeType:i,pixelSizePower:o,pixelSizeFactor:r}=this.functionArguments,{isGCS:p}=this,{extent:u,primaryPixelSizes:a}=t,c=a?.[0],l=c??(u?{x:u.width/e.width,y:u.height/e.height}:{x:1,y:1});return n(e,{zFactor:s,slopeType:i,pixelSizePower:o,pixelSizeFactor:r,isGCS:p,resolution:l})}_getWebGLParameters(){const{zFactor:t,slopeType:e,pixelSizeFactor:s,pixelSizePower:o}=this.functionArguments;return{zFactor:this.isGCS&&t>=1?t*p:t,slopeType:e,pixelSizeFactor:s??0,pixelSizePower:o??0,isOutputRounded:i(this.outputPixelType)}}};t([e({json:{write:!0,name:"rasterFunction"}})],u.prototype,"functionName",void 0),t([e({type:r,json:{write:!0,name:"rasterFunctionArguments"}})],u.prototype,"functionArguments",void 0),t([e()],u.prototype,"rasterArgumentNames",void 0),t([e({json:{write:!0}})],u.prototype,"isGCS",void 0),u=t([s("esri.layers.raster.functions.SlopeFunction")],u);const a=u;export{a as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{JSONMap as o}from"../../../core/jsonMap.js";import{property as r,subclass as t}from"../../../core/accessorSupport/decorators.js";import s from"./BaseFunctionArguments.js";import{enumeration as i}from"../../../core/accessorSupport/decorators/enumeration.js";var p;const c=new o({1:"degree",2:"percent-rise",3:"adjusted"},{useNumericKeys:!0});let a=p=class extends s{constructor(){super(...arguments),this.slopeType="degree",this.zFactor=1,this.pixelSizePower=.664,this.pixelSizeFactor=.024,this.removeEdgeEffect=!1}clone(){return new p({slopeType:this.slopeType,zFactor:this.zFactor,pixelSizePower:this.pixelSizePower,pixelSizeFactor:this.pixelSizeFactor,removeEdgeEffect:this.removeEdgeEffect,raster:this.raster})}};e([i(c)],a.prototype,"slopeType",void 0),e([r({type:Number,json:{write:!0}})],a.prototype,"zFactor",void 0),e([r({type:Number,json:{name:"psPower",write:!0}})],a.prototype,"pixelSizePower",void 0),e([r({type:Number,json:{name:"psZFactor",write:!0}})],a.prototype,"pixelSizeFactor",void 0),e([r({type:Boolean,json:{write:!0}})],a.prototype,"removeEdgeEffect",void 0),a=p=e([t("esri.layers.support.rasterFunctions.SlopeFunctionArguments")],a);const n=a;export{n as default};
5
+ import{__decorate as e}from"tslib";import{JSONMap as o}from"../../../core/jsonMap.js";import{property as r,subclass as t}from"../../../core/accessorSupport/decorators.js";import s from"./BaseFunctionArguments.js";import{enumeration as i}from"../../../core/accessorSupport/decorators/enumeration.js";var p;const c=new o({1:"degree",2:"percent-rise",3:"adjusted"},{useNumericKeys:!0});let a=p=class extends s{constructor(){super(...arguments),this.slopeType="degree",this.zFactor=1,this.pixelSizePower=.664,this.pixelSizeFactor=.024,this.removeEdgeEffect=!1}clone(){return new p({slopeType:this.slopeType,zFactor:this.zFactor,pixelSizePower:this.pixelSizePower,pixelSizeFactor:this.pixelSizeFactor,removeEdgeEffect:this.removeEdgeEffect,raster:this.raster})}};e([i(c)],a.prototype,"slopeType",void 0),e([r({type:Number,json:{write:!0}})],a.prototype,"zFactor",void 0),e([r({type:Number,json:{name:"psPower",write:!0}})],a.prototype,"pixelSizePower",void 0),e([r({type:Number,json:{name:"psZFactor",write:!0}})],a.prototype,"pixelSizeFactor",void 0),e([r({type:Boolean,json:{write:!0}})],a.prototype,"removeEdgeEffect",void 0),a=p=e([t("esri.layers.raster.functions.SlopeFunctionArguments")],a);const n=a;export{n as default};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ import{__decorate as t}from"tslib";import{property as s,subclass as e}from"../../../core/accessorSupport/decorators.js";import{getPixelValueRange as o}from"../formats/pixelRangeUtils.js";import r from"./BaseRasterFunction.js";import{computeFocalStatistics as i}from"./focalStatUtils.js";import n from"./StatisticsFunctionArguments.js";let u=class extends r{constructor(){super(...arguments),this.functionName="Statistics",this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{type:t}=this.functionArguments.toJSON();if(t<1||t>7)return{success:!1,supportsGPU:!1,error:`statistics-function: the given statistics type is not supported ${t}`};const s=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType(s.pixelType);const e=s.clone();e.pixelType=this.outputPixelType;const{statisticsType:o}=this.functionArguments;"stddev"===o&&this._removeStatsHistColormapVAT(e),this.rasterInfo=e;return{success:!0,supportsGPU:e.bandCount<=3&&t<5}}_processPixels(t){const s=t.pixelBlocks?.[0];if(null==s)return s;const{statisticsType:e,rows:o,cols:r,fillNoDataOnly:n}=this.functionArguments;return i(s,{kernelRows:o,kernelCols:r,fillNoDataOnly:n,outputPixelType:this.outputPixelType,statisticsType:e,mirrorEdges:!0})}_getWebGLParameters(){const{rows:t,cols:s,statisticsType:e,fillNoDataOnly:r}=this.functionArguments;return{fillNoDataOnly:r,kernelRows:t,kernelCols:s,statisticsType:e,clampRange:o(this.outputPixelType)}}};t([s({json:{write:!0,name:"rasterFunction"}})],u.prototype,"functionName",void 0),t([s({type:n,json:{write:!0,name:"rasterFunctionArguments"}})],u.prototype,"functionArguments",void 0),t([s()],u.prototype,"rasterArgumentNames",void 0),u=t([e("esri.layers.raster.functions.StatisticsFunction")],u);const a=u;export{a as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import{clone as s}from"../../../core/lang.js";import{property as r,subclass as o}from"../../../core/accessorSupport/decorators.js";import e from"./BaseFunctionArguments.js";import{statisticsTypeMap as i}from"./focalStatUtils.js";import{enumeration as a}from"../../../core/accessorSupport/decorators/enumeration.js";var c;let l=c=class extends e{constructor(){super(...arguments),this.rows=3,this.cols=3,this.fillNoDataOnly=!1,this.statisticsType="min"}clone(){return new c({rows:this.rows,cols:this.cols,fillNoDataOnly:this.fillNoDataOnly,statisticsType:this.statisticsType,raster:s(this.raster)})}};t([r({json:{write:!0,read:{source:["kernelRows","rows"],reader:(t,s)=>Number(t??s?.kernelRows??3)}}})],l.prototype,"rows",void 0),t([r({json:{write:!0,read:{source:["kernelCols","cols"],reader:(t,s)=>Number(t??s?.kernelCols??3)}}})],l.prototype,"cols",void 0),t([r({json:{write:!0}})],l.prototype,"fillNoDataOnly",void 0),t([r({json:{read:{source:["statisticsType","type"],reader:(t,s)=>i.fromJSON(s?.statisticsType??s?.type)??"min"},write:{target:"type"}}}),a(i)],l.prototype,"statisticsType",void 0),l=c=t([o("esri.layers.support.rasterFunctions.StatisticsFunctionArguments")],l);const n=l;export{n as default};
5
+ import{__decorate as t}from"tslib";import{clone as s}from"../../../core/lang.js";import{property as r,subclass as o}from"../../../core/accessorSupport/decorators.js";import e from"./BaseFunctionArguments.js";import{statisticsTypeMap as i}from"./focalStatUtils.js";import{enumeration as a}from"../../../core/accessorSupport/decorators/enumeration.js";var c;let l=c=class extends e{constructor(){super(...arguments),this.rows=3,this.cols=3,this.fillNoDataOnly=!1,this.statisticsType="min"}clone(){return new c({rows:this.rows,cols:this.cols,fillNoDataOnly:this.fillNoDataOnly,statisticsType:this.statisticsType,raster:s(this.raster)})}};t([r({json:{write:!0,read:{source:["kernelRows","rows"],reader:(t,s)=>Number(t??s?.kernelRows??3)}}})],l.prototype,"rows",void 0),t([r({json:{write:!0,read:{source:["kernelCols","cols"],reader:(t,s)=>Number(t??s?.kernelCols??3)}}})],l.prototype,"cols",void 0),t([r({json:{write:!0}})],l.prototype,"fillNoDataOnly",void 0),t([r({json:{read:{source:["statisticsType","type"],reader:(t,s)=>i.fromJSON(s?.statisticsType??s?.type)??"min"},write:{target:"type"}}}),a(i)],l.prototype,"statisticsType",void 0),l=c=t([o("esri.layers.raster.functions.StatisticsFunctionArguments")],l);const n=l;export{n as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import{property as s,subclass as o}from"../../../core/accessorSupport/decorators.js";import r from"./BaseRasterFunction.js";import e from"./StatisticsHistogramFunctionArguments.js";let i=class extends r{constructor(){super(...arguments),this.functionName="StatisticsHistogram",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const t=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType("u8");const s=t.clone(),{statistics:o,histograms:r}=this.functionArguments;return r&&(s.histograms=r),o&&(s.statistics=o),this.rasterInfo=s,{success:!0,supportsGPU:!0}}_processPixels(t){return t.pixelBlocks?.[0]}};t([s({json:{write:!0,name:"rasterFunction"}})],i.prototype,"functionName",void 0),t([s({type:e,json:{write:!0,name:"rasterFunctionArguments"}})],i.prototype,"functionArguments",void 0),t([s()],i.prototype,"rasterArgumentNames",void 0),t([s({json:{write:!0}})],i.prototype,"indexedColormap",void 0),t([s()],i.prototype,"isNoopProcess",void 0),i=t([o("esri.layers.support.rasterFunctions.StatisticsHistogramFunction")],i);const n=i;export{n as default};
5
+ import{__decorate as t}from"tslib";import{property as s,subclass as o}from"../../../core/accessorSupport/decorators.js";import r from"./BaseRasterFunction.js";import e from"./StatisticsHistogramFunctionArguments.js";let i=class extends r{constructor(){super(...arguments),this.functionName="StatisticsHistogram",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const t=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType("u8");const s=t.clone(),{statistics:o,histograms:r}=this.functionArguments;return r&&(s.histograms=r),o&&(s.statistics=o),this.rasterInfo=s,{success:!0,supportsGPU:!0}}_processPixels(t){return t.pixelBlocks?.[0]}};t([s({json:{write:!0,name:"rasterFunction"}})],i.prototype,"functionName",void 0),t([s({type:e,json:{write:!0,name:"rasterFunctionArguments"}})],i.prototype,"functionArguments",void 0),t([s()],i.prototype,"rasterArgumentNames",void 0),t([s({json:{write:!0}})],i.prototype,"indexedColormap",void 0),t([s()],i.prototype,"isNoopProcess",void 0),i=t([o("esri.layers.raster.functions.StatisticsHistogramFunction")],i);const n=i;export{n as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import{clone as s}from"../../../core/lang.js";import{property as r,subclass as o}from"../../../core/accessorSupport/decorators.js";import e from"./BaseFunctionArguments.js";import{reader as i}from"../../../core/accessorSupport/decorators/reader.js";import{writer as a}from"../../../core/accessorSupport/decorators/writer.js";var n;let c=n=class extends e{constructor(){super(...arguments),this.statistics=null,this.histograms=null}readStatistics(t,s){if(!t?.length)return null;const r=[];return t.forEach(t=>{const s={min:t.min,max:t.max,avg:t.avg??t.mean,stddev:t.stddev??t.standardDeviation};r.push(s)}),r}writeStatistics(t,s,r){if(!t?.length)return;const o=[];t.forEach(t=>{const s={...t,mean:t.avg,standardDeviation:t.stddev};delete s.avg,delete s.stddev,o.push(s)}),s[r]=o}clone(){return new n({statistics:s(this.statistics),histograms:s(this.histograms)})}};t([r({json:{write:!0}})],c.prototype,"statistics",void 0),t([i("statistics")],c.prototype,"readStatistics",null),t([a("statistics")],c.prototype,"writeStatistics",null),t([r({json:{write:!0}})],c.prototype,"histograms",void 0),c=n=t([o("esri.layers.support.rasterFunctions.StatisticsHistogramFunctionArguments")],c);const p=c;export{p as default};
5
+ import{__decorate as t}from"tslib";import{clone as s}from"../../../core/lang.js";import{property as r,subclass as o}from"../../../core/accessorSupport/decorators.js";import e from"./BaseFunctionArguments.js";import{reader as i}from"../../../core/accessorSupport/decorators/reader.js";import{writer as a}from"../../../core/accessorSupport/decorators/writer.js";var n;let c=n=class extends e{constructor(){super(...arguments),this.statistics=null,this.histograms=null}readStatistics(t,s){if(!t?.length)return null;const r=[];return t.forEach(t=>{const s={min:t.min,max:t.max,avg:t.avg??t.mean,stddev:t.stddev??t.standardDeviation};r.push(s)}),r}writeStatistics(t,s,r){if(!t?.length)return;const o=[];t.forEach(t=>{const s={...t,mean:t.avg,standardDeviation:t.stddev};delete s.avg,delete s.stddev,o.push(s)}),s[r]=o}clone(){return new n({statistics:s(this.statistics),histograms:s(this.histograms)})}};t([r({json:{write:!0}})],c.prototype,"statistics",void 0),t([i("statistics")],c.prototype,"readStatistics",null),t([a("statistics")],c.prototype,"writeStatistics",null),t([r({json:{write:!0}})],c.prototype,"histograms",void 0),c=n=t([o("esri.layers.raster.functions.StatisticsHistogramFunctionArguments")],c);const m=c;export{m as default};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ import{__decorate as t}from"tslib";import{property as s,subclass as e}from"../../../core/accessorSupport/decorators.js";import{isIntegerPixelType as o}from"../formats/pixelRangeUtils.js";import u from"./BaseRasterFunction.js";import{lookupPixels as r}from"./pixelUtils.js";import i from"./StretchFunctionArguments.js";import{getStretchCutoff as n,createStretchLUT as a,stretch as p,computeGammaCorrection as m}from"./stretchUtils.js";let c=class extends u{constructor(){super(...arguments),this.functionName="Stretch",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null,this.cutOffs=null}_bindSourceRasters(){this.lookup=null,this.cutOffs=null;const t=this.sourceRasterInfos[0],{pixelType:s}=t,{functionArguments:e}=this,{dynamicRangeAdjustment:u,gamma:r,useGamma:i}=e;if(!u&&["u8","u16","s8","s16"].includes(s)){const u=n(e.toJSON(),{rasterInfo:t}),p=o(this.outputPixelType)?"round":"float";this.lookup=a({pixelType:s,...u,gamma:i?r:null,rounding:p}),this.cutOffs=u}else u||(this.cutOffs=n(e.toJSON(),{rasterInfo:t}));this.outputPixelType=this._getOutputPixelType(s);const p=t.clone();p.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(p),"u8"===this.outputPixelType&&(p.keyProperties.DataType="processed");const{outputMin:m=0,outputMax:c=255}=this.functionArguments;p.statistics=[];for(let o=0;o<p.bandCount;o++)p.statistics[o]={min:m,max:c};this.rasterInfo=p;return{success:!0,supportsGPU:!u}}_processPixels(t){const s=t.pixelBlocks?.[0];if(null==s)return s;const{lookup:e}=this;if(e)return r(s,{...e,outputPixelType:this.rasterInfo.pixelType});const{functionArguments:o}=this,u=this.cutOffs||n(o.toJSON(),{rasterInfo:this.sourceRasterInfos[0],pixelBlock:s}),i=o.useGamma?o.gamma:null;return p(s,{...u,gamma:i,outputPixelType:this.outputPixelType})}_getWebGLParameters(){const{outputMin:t=0,outputMax:s=255,gamma:e,useGamma:u}=this.functionArguments,r=this.rasterInfo.bandCount>=2?3:1,i=u&&e?.length?m(r,e):[1,1,1],{minCutOff:n,maxCutOff:a}=this.cutOffs??{minCutOff:[0,0,0],maxCutOff:[255,255,255]};1===n.length&&(n[1]=n[2]=n[0],a[1]=a[2]=a[0]);const p=a.map((e,o)=>(s-t)/(a[o]-n[o])),c=o(this.outputPixelType),f=u&&e?[e[0],e[1]??e[0],e[2]??e[0]]:[1,1,1],l=u?[i[0],i[1]??i[0],i[2]??i[0]]:[1,1,1];return{bandCount:r,minOutput:t,maxOutput:s,minCutOff:n,maxCutOff:a,factor:p,useGamma:u,gamma:f,gammaCorrection:l,stretchType:this.functionArguments.stretchType,isOutputRounded:c,type:"stretch"}}};t([s({json:{write:!0,name:"rasterFunction"}})],c.prototype,"functionName",void 0),t([s({type:i,json:{write:!0,name:"rasterFunctionArguments"}})],c.prototype,"functionArguments",void 0),t([s()],c.prototype,"rasterArgumentNames",void 0),t([s({json:{write:!0}})],c.prototype,"lookup",void 0),t([s({json:{write:!0}})],c.prototype,"cutOffs",void 0),c=t([e("esri.layers.raster.functions.StretchFunction")],c);const f=c;export{f as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import{JSONMap as e}from"../../../core/jsonMap.js";import{clone as o}from"../../../core/lang.js";import{property as r,subclass as s}from"../../../core/accessorSupport/decorators.js";import i from"./BaseFunctionArguments.js";import{writer as a}from"../../../core/accessorSupport/decorators/writer.js";import{enumeration as m}from"../../../core/accessorSupport/decorators/enumeration.js";var n;const p=new e({0:"none",3:"standard-deviation",4:"histogram-equalization",5:"min-max",6:"percent-clip",9:"sigmoid"},{useNumericKeys:!0});let u=n=class extends i{constructor(){super(...arguments),this.computeGamma=!1,this.dynamicRangeAdjustment=!1,this.gamma=[],this.histograms=null,this.statistics=null,this.stretchType="none",this.useGamma=!1}writeStatistics(t,e,o){t?.length&&(Array.isArray(t[0])||(t=t.map(t=>[t.min,t.max,t.avg,t.stddev])),e[o]=t)}clone(){return new n({stretchType:this.stretchType,outputMin:this.outputMin,outputMax:this.outputMax,useGamma:this.useGamma,computeGamma:this.computeGamma,statistics:o(this.statistics),gamma:o(this.gamma),sigmoidStrengthLevel:this.sigmoidStrengthLevel,numberOfStandardDeviations:this.numberOfStandardDeviations,minPercent:this.minPercent,maxPercent:this.maxPercent,histograms:o(this.histograms),dynamicRangeAdjustment:this.dynamicRangeAdjustment,raster:this.raster})}};t([r({type:Boolean,json:{write:!0}})],u.prototype,"computeGamma",void 0),t([r({type:Boolean,json:{name:"dra",write:!0}})],u.prototype,"dynamicRangeAdjustment",void 0),t([r({type:[Number],json:{write:!0}})],u.prototype,"gamma",void 0),t([r()],u.prototype,"histograms",void 0),t([r({type:Number,json:{write:!0}})],u.prototype,"maxPercent",void 0),t([r({type:Number,json:{write:!0}})],u.prototype,"minPercent",void 0),t([r({type:Number,json:{write:!0}})],u.prototype,"numberOfStandardDeviations",void 0),t([r({type:Number,json:{name:"max",write:!0}})],u.prototype,"outputMax",void 0),t([r({type:Number,json:{name:"min",write:!0}})],u.prototype,"outputMin",void 0),t([r({type:Number,json:{write:!0}})],u.prototype,"sigmoidStrengthLevel",void 0),t([r({json:{type:[[Number]],write:!0}})],u.prototype,"statistics",void 0),t([a("statistics")],u.prototype,"writeStatistics",null),t([m(p)],u.prototype,"stretchType",void 0),t([r({type:Boolean,json:{write:!0}})],u.prototype,"useGamma",void 0),u=n=t([s("esri.layers.support.rasterFunctions.StretchFunctionArguments")],u);const c=u;export{c as default};
5
+ import{__decorate as t}from"tslib";import{JSONMap as e}from"../../../core/jsonMap.js";import{clone as o}from"../../../core/lang.js";import{property as r,subclass as s}from"../../../core/accessorSupport/decorators.js";import i from"./BaseFunctionArguments.js";import{writer as a}from"../../../core/accessorSupport/decorators/writer.js";import{enumeration as m}from"../../../core/accessorSupport/decorators/enumeration.js";var n;const p=new e({0:"none",3:"standard-deviation",4:"histogram-equalization",5:"min-max",6:"percent-clip",9:"sigmoid"},{useNumericKeys:!0});let u=n=class extends i{constructor(){super(...arguments),this.computeGamma=!1,this.dynamicRangeAdjustment=!1,this.gamma=[],this.histograms=null,this.statistics=null,this.stretchType="none",this.useGamma=!1}writeStatistics(t,e,o){t?.length&&(Array.isArray(t[0])||(t=t.map(t=>[t.min,t.max,t.avg,t.stddev])),e[o]=t)}clone(){return new n({stretchType:this.stretchType,outputMin:this.outputMin,outputMax:this.outputMax,useGamma:this.useGamma,computeGamma:this.computeGamma,statistics:o(this.statistics),gamma:o(this.gamma),sigmoidStrengthLevel:this.sigmoidStrengthLevel,numberOfStandardDeviations:this.numberOfStandardDeviations,minPercent:this.minPercent,maxPercent:this.maxPercent,histograms:o(this.histograms),dynamicRangeAdjustment:this.dynamicRangeAdjustment,raster:this.raster})}};t([r({type:Boolean,json:{write:!0}})],u.prototype,"computeGamma",void 0),t([r({type:Boolean,json:{name:"dra",write:!0}})],u.prototype,"dynamicRangeAdjustment",void 0),t([r({type:[Number],json:{write:!0}})],u.prototype,"gamma",void 0),t([r()],u.prototype,"histograms",void 0),t([r({type:Number,json:{write:!0}})],u.prototype,"maxPercent",void 0),t([r({type:Number,json:{write:!0}})],u.prototype,"minPercent",void 0),t([r({type:Number,json:{write:!0}})],u.prototype,"numberOfStandardDeviations",void 0),t([r({type:Number,json:{name:"max",write:!0}})],u.prototype,"outputMax",void 0),t([r({type:Number,json:{name:"min",write:!0}})],u.prototype,"outputMin",void 0),t([r({type:Number,json:{write:!0}})],u.prototype,"sigmoidStrengthLevel",void 0),t([r({json:{type:[[Number]],write:!0}})],u.prototype,"statistics",void 0),t([a("statistics")],u.prototype,"writeStatistics",null),t([m(p)],u.prototype,"stretchType",void 0),t([r({type:Boolean,json:{write:!0}})],u.prototype,"useGamma",void 0),u=n=t([s("esri.layers.raster.functions.StretchFunctionArguments")],u);const c=u;export{c as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import{property as e,subclass as s}from"../../../core/accessorSupport/decorators.js";import r from"./BaseRasterFunction.js";import o from"./TableFunctionArguments.js";let i=class extends r{constructor(){super(...arguments),this.functionName="Table",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1||t.pixelType.startsWith("f"))return{success:!1,supportsGPU:!1,error:"table-function: Source data must be single band and integer pixel type."};const{attributeTableAsRecordSet:e}=this.functionArguments;if(!e)return{success:!1,supportsGPU:!1,error:"table-function: Missing attributeTableAsRecordSet argument."};this.outputPixelType=this._getOutputPixelType(t.pixelType);const s=t.clone();return s.pixelType=this.outputPixelType,s.bandCount=1,"thematic"!==s.dataType&&(s.keyProperties=s.keyProperties?{...s.keyProperties,DataType:"thematic"}:{DataType:"thematic"}),this.rasterInfo=s,{success:!0,supportsGPU:!0}}_processPixels(t){return t.pixelBlocks?.[0]}};t([e({json:{write:!0,name:"rasterFunction"}})],i.prototype,"functionName",void 0),t([e({type:o,json:{write:!0,name:"rasterFunctionArguments"}})],i.prototype,"functionArguments",void 0),t([e()],i.prototype,"rasterArgumentNames",void 0),t([e()],i.prototype,"isNoopProcess",void 0),i=t([s("esri.layers.support.rasterFunctions.TableFunction")],i);const n=i;export{n as default};
5
+ import{__decorate as t}from"tslib";import{property as e,subclass as s}from"../../../core/accessorSupport/decorators.js";import r from"./BaseRasterFunction.js";import o from"./TableFunctionArguments.js";let i=class extends r{constructor(){super(...arguments),this.functionName="Table",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1||t.pixelType.startsWith("f"))return{success:!1,supportsGPU:!1,error:"table-function: Source data must be single band and integer pixel type."};const{attributeTableAsRecordSet:e}=this.functionArguments;if(!e)return{success:!1,supportsGPU:!1,error:"table-function: Missing attributeTableAsRecordSet argument."};this.outputPixelType=this._getOutputPixelType(t.pixelType);const s=t.clone();return s.pixelType=this.outputPixelType,s.bandCount=1,"thematic"!==s.dataType&&(s.keyProperties=s.keyProperties?{...s.keyProperties,DataType:"thematic"}:{DataType:"thematic"}),this.rasterInfo=s,{success:!0,supportsGPU:!0}}_processPixels(t){return t.pixelBlocks?.[0]}};t([e({json:{write:!0,name:"rasterFunction"}})],i.prototype,"functionName",void 0),t([e({type:o,json:{write:!0,name:"rasterFunctionArguments"}})],i.prototype,"functionArguments",void 0),t([e()],i.prototype,"rasterArgumentNames",void 0),t([e()],i.prototype,"isNoopProcess",void 0),i=t([s("esri.layers.raster.functions.TableFunction")],i);const n=i;export{n as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import{clone as e}from"../../../core/lang.js";import{property as r,subclass as o}from"../../../core/accessorSupport/decorators.js";import s from"./BaseFunctionArguments.js";var a;let c=a=class extends s{constructor(){super(...arguments),this.attributeTableAsRecordSet=null}clone(){return new a({attributeTableAsRecordSet:e(this.attributeTableAsRecordSet)})}};t([r({json:{write:!0}})],c.prototype,"attributeTableAsRecordSet",void 0),c=a=t([o("esri.layers.support.rasterFunctions.TableFunctionArguments")],c);const i=c;export{i as default};
5
+ import{__decorate as t}from"tslib";import{clone as e}from"../../../core/lang.js";import{property as r,subclass as o}from"../../../core/accessorSupport/decorators.js";import s from"./BaseFunctionArguments.js";var a;let c=a=class extends s{constructor(){super(...arguments),this.attributeTableAsRecordSet=null}clone(){return new a({attributeTableAsRecordSet:e(this.attributeTableAsRecordSet)})}};t([r({json:{write:!0}})],c.prototype,"attributeTableAsRecordSet",void 0),c=a=t([o("esri.layers.raster.functions.TableFunctionArguments")],c);const i=c;export{i as default};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ import{JSONMap as t}from"../../../core/jsonMap.js";import{isIntegerPixelType as n,clipBandToPixelTypeRange as e}from"../formats/pixelRangeUtils.js";import{calculateCustomBandIndex as r}from"./customBandIndexUtils.js";import{isValidPixelBlock as o}from"./pixelUtils.js";import a from"../../support/PixelBlock.js";const i=new t({0:"custom",1:"ndvi",2:"savi",3:"tsavi",4:"msavi",5:"gemi",6:"pvi",7:"gvitm",8:"sultan",9:"vari",10:"gndvi",11:"sr",12:"ndvi-re",13:"sr-re",14:"mtvi2",15:"rtvi-core",16:"ci-re",17:"ci-g",18:"ndwi",19:"evi",20:"iron-oxide",21:"ferrous-minerals",22:"clay-minerals",23:"wndwi",24:"bai",25:"nbr",26:"ndbi",27:"ndmi",28:"ndsi",29:"mndwi"},{useNumericKeys:!0});function s(t,i){if(!o(t))return t;const{equation:s,method:l}=i,c=i.bandIndexes.map(t=>t-1),{pixels:U,mask:q}=t;let M;switch(l){case"gndvi":case"nbr":case"ndbi":case"ndvi":case"ndvi-re":case"ndsi":case"ndmi":case"mndwi":M=u(q,U[c[0]],U[c[1]]);break;case"ndwi":M=u(q,U[c[1]],U[c[0]]);break;case"sr":case"sr-re":case"iron-oxide":case"ferrous-minerals":case"clay-minerals":M=f(q,U[c[0]],U[c[1]]);break;case"ci-g":case"ci-re":M=h(q,U[c[0]],U[c[1]]);break;case"savi":M=w(q,U[c[0]],U[c[1]],c[2]+1);break;case"tsavi":M=m(q,U[c[0]],U[c[1]],c[2]+1,c[3]+1,c[4]+1);break;case"msavi":M=d(q,U[c[0]],U[c[1]]);break;case"gemi":M=g(q,U[c[0]],U[c[1]]);break;case"pvi":M=y(q,U[c[0]],U[c[1]],c[2]+1,c[3]+1);break;case"gvitm":M=p(q,[U[c[0]],U[c[1]],U[c[2]],U[c[3]],U[c[4]],U[c[5]]]);break;case"sultan":M=b(q,[U[c[0]],U[c[1]],U[c[2]],U[c[3]],U[c[4]]]);break;case"vari":M=v(q,[U[c[0]],U[c[1]],U[c[2]]]);break;case"mtvi2":M=k(q,[U[c[0]],U[c[1]],U[c[2]]]);break;case"rtvi-core":M=A(q,[U[c[0]],U[c[1]],U[c[2]]]);break;case"evi":M=F(q,[U[c[0]],U[c[1]],U[c[2]]]);break;case"wndwi":M=x(q,[U[c[0]],U[c[1]],U[c[2]]],c[3]?c[3]+1:.5);break;case"bai":M=j(q,U[c[0]],U[c[1]]);break;case"custom":M=r(q,U,s);break;default:return t}const{outputPixelType:B="f32"}=i,T=null!=B&&n(B);let I;q?(I=new Uint8Array(t.width*t.height),I.set(q)):T&&(I=new Uint8Array(t.width*t.height).fill(255)),T&&(M=M.map(t=>{const n=a.createEmptyBand(B,t.length);return e(t,I,B,n),n}));const P=new a({width:t.width,height:t.height,pixelType:B,pixels:M,mask:I});return P.updateStatistics(),P}function l(t,n,e,r){const{mask:o,pixels:i,width:s,height:l}=t,c=i[e],u=i[n],f=u.length,h=r?new Uint8Array(f):new Float32Array(f),w=r?100:1,m=r?100.5:0;for(let a=0;a<f;a++)if(null==o||o[a]){const t=c[a],n=u[a],e=t+n;e&&(h[a]=(t-n)/e*w+m)}const d=new a({width:s,height:l,mask:o,pixelType:r?"u8":"f32",pixels:[h]});return d.updateStatistics(),d}function c(t){const n=new Float32Array(9);return n[3*t[0]]=1,n[3*t[1]+1]=1,n[3*t[2]+2]=1,n}function u(t,n,e){const r=e.length,o=new Float32Array(r);for(let a=0;a<r;a++)if(null==t||t[a]){const t=n[a],r=e[a],i=t+r;i&&(o[a]=(t-r)/i)}return[o]}function f(t,n,e){const r=e.length,o=new Float32Array(r);for(let a=0;a<r;a++)if(null==t||t[a]){const t=n[a],r=e[a];r&&(o[a]=t/r)}return[o]}function h(t,n,e){const r=n.length,o=new Float32Array(r);for(let a=0;a<r;a++)if(null==t||t[a]){const t=n[a],r=e[a];r&&(o[a]=t/r-1)}return[o]}function w(t,n,e,r){const o=e.length,a=new Float32Array(o);for(let i=0;i<o;i++)if(null==t||t[i]){const t=e[i],o=n[i],s=o+t+r;s&&(a[i]=(o-t)/s*(1+r))}return[a]}function m(t,n,e,r,o,a){const i=e.length,s=new Float32Array(i),l=-o*r+a*(1+r*r);for(let c=0;c<i;c++)if(null==t||t[c]){const t=e[c],a=n[c],i=o*a+t+l;i&&(s[c]=r*(a-r*t-o)/i)}return[s]}function d(t,n,e){const r=e.length,o=new Float32Array(r);for(let a=0;a<r;a++)if(null==t||t[a]){const t=e[a],r=n[a],i=2*r+1;o[a]=.5*(i-Math.sqrt(i*i-8*(r-t)))}return[o]}function g(t,n,e){const r=e.length,o=new Float32Array(r);for(let a=0;a<r;a++)if(null==t||t[a]){const t=e[a],r=n[a];if(1!==t&&r+t+.5!==0){const n=(2*(r*r-t*t)+1.5*r+.5*t)/(r+t+.5);o[a]=n*(1-.25*n)-(t-.125)/(1-t)}}return[o]}function y(t,n,e,r,o){const a=e.length,i=new Float32Array(a),s=1/Math.sqrt(1+r*r);for(let l=0;l<a;l++)if(null==t||t[l]){const t=e[l],a=n[l];i[l]=(a-r*t-o)*s}return[i]}function p(t,n){const[e,r,o,a,i,s]=n,l=e.length,c=new Float32Array(l);for(let u=0;u<l;u++)(null==t||t[u])&&(c[u]=-.2848*e[u]-.2435*r[u]-.5436*o[u]+.7243*a[u]+.084*i[u]-.18*s[u]);return[c]}function b(t,n){const[e,r,o,a,i]=n,s=e.length,l=new Float32Array(s),c=new Float32Array(s),u=new Float32Array(s);for(let f=0;f<s;f++)(null==t||t[f])&&(l[f]=i[f]?a[f]/i[f]*100:0,c[f]=e[f]?a[f]/e[f]*100:0,u[f]=o[f]?r[f]/o[f]*(a[f]/o[f])*100:0);return[l,c,u]}function v(t,n){const[e,r,o]=n,a=e.length,i=new Float32Array(a);for(let s=0;s<a;s++)if(null==t||t[s])for(s=0;s<a;s++){const t=e[s],n=r[s],a=n+t-o[s];a&&(i[s]=(n-t)/a)}return[i]}function k(t,n){const[e,r,o]=n,a=e.length,i=new Float32Array(a);for(let s=0;s<a;s++)if(null==t||t[s])for(s=0;s<a;s++){const t=e[s],n=r[s],a=o[s],l=Math.sqrt((2*t+1)**2-(6*t-5*Math.sqrt(n))-.5);if(l){const e=1.5*(1.2*(t-a)-2.5*(n-a));i[s]=e/l}}return[i]}function A(t,n){const[e,r,o]=n,a=e.length,i=new Float32Array(a);for(let s=0;s<a;s++)if(null==t||t[s])for(s=0;s<a;s++){const t=e[s],n=r[s],a=o[s];i[s]=100*(t-n)-10*(t-a)}return[i]}function F(t,n){const[e,r,o]=n,a=e.length,i=new Float32Array(a);for(let s=0;s<a;s++)if(null==t||t[s])for(s=0;s<a;s++){const t=e[s],n=r[s],a=t+6*n-7.5*o[s]+1;a&&(i[s]=2.5*(t-n)/a)}return[i]}function x(t,n,e=.5){const[r,o,a]=n,i=o.length,s=new Float32Array(i);for(let l=0;l<i;l++)if(null==t||t[l])for(l=0;l<i;l++){const t=r[l],n=o[l],i=a[l],c=t+e*n+(1-e)*i;c&&(s[l]=(t-e*n-(1-e)*i)/c)}return[s]}function j(t,n,e){const r=e.length,o=new Float32Array(r);for(let a=0;a<r;a++)if(null==t||t[a])for(a=0;a<r;a++){const t=(.1-n[a])**2+(.06-e[a])**2;t&&(o[a]=1/t)}return[o]}export{i as bandIndexMethodMap,s as calculateBandIndex,l as calculateNDVI,c as getBandMatrix3};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ import"../../../core/has.js";import{JSONMap as e}from"../../../core/jsonMap.js";import{isIntegerPixelType as t}from"../formats/pixelRangeUtils.js";import a from"../../support/PixelBlock.js";const n=new e({0:"difference",1:"relative-difference",2:"categorical",3:"euclidean-distance",4:"angle-difference",5:"band-with-most-change"},{useNumericKeys:!0}),s=new e({0:"all",1:"changed",2:"unchanged"},{useNumericKeys:!0});function i(e,n,s,i){const[f,h]=e,p=t(s)&&!t(f.pixelType)&&!t(h.pixelType),m=[f.mask,h.mask].filter(e=>e),u=a.combineBandMasks(m),g=e.map(e=>e.pixels[0]),{width:k,height:x}=f,b=a.createEmptyBand(s,k*x);switch(n){case"difference":case"relative-difference":o({bands:g,mask:u,outBand:b,isRoundingNeeded:p,isRelative:"relative-difference"===n});break;case"categorical":c({bands:g,mask:u,outBand:b,...i});break;case"euclidean-distance":l({pixels:e.map(e=>e.pixels),mask:u,outBand:b});break;case"angle-difference":r({pixels:e.map(e=>e.pixels),mask:u,outBand:b});break;case"band-with-most-change":d({pixels:e.map(e=>e.pixels),mask:u,outBand:b})}const B=new a({width:k,height:x,pixels:[b],pixelType:s,mask:u});return B.updateStatistics(),B}function o(e){const{bands:[t,a],mask:n,isRelative:s,isRoundingNeeded:i,outBand:o}=e,c=t.length;for(let l=0;l<c;l++)if(!n||n[l]){let e=t[l]-a[l];if(s){const n=Math.max(Math.abs(t[l])-Math.abs(a[l]));e=n>0?e/n:0}o[l]=i?Math.round(e):e}}function c(e){const{bands:[t,a],categoryIndexLookups:[n,s],classNames:[i,o],mask:c,keepMethod:l,outBand:r}=e,d=t.length,f=i.length,h=o.length,p=f*h,m=p+1,u=p+2;for(let g=0;g<d;g++)if(!c||c[g]){const e=t[g],c=a[g],d=n[e],f=s[c],k=i[d],x=o[f];r[g]=null==d||null==f?p:"changed"===l&&k===x?m:"unchanged"===l&&k!==x?u:d*h+f}}function l(e){const{pixels:[t,a],mask:n,outBand:s}=e,i=t[0].length,o=t.length;for(let c=0;c<i;c++)if(!n||n[c]){let e=0;for(let n=0;n<o;n++){const s=t[n][c]-a[n][c];e+=s*s}s[c]=Math.sqrt(e)}}function r(e){const{pixels:[t,a],mask:n,outBand:s}=e,i=t[0].length,o=t.length;for(let c=0;c<i;c++)if(!n||n[c]){let e=0,n=0,i=0;for(let s=0;s<o;s++){const o=t[s][c],l=a[s][c];e+=o*l,n+=o*o,i+=l*l}const l=Math.sqrt(n*i);s[c]=l?Math.acos(e/l):1.5707963267948966}}function d(e){const{pixels:[t,a],mask:n,outBand:s}=e,i=t[0].length,o=t.length;for(let c=0;c<i;c++)if(!n||n[c]){let e=0,n=0;for(let s=0;s<o;s++){const i=Math.abs(t[s][c]-a[s][c]);i>e&&(e=i,n=s)}s[c]=n}}export{n as changeMethodMap,i as computeChange,s as keepMethodMap};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ import{getMetersPerUnitForSR as t}from"../../../core/units.js";import e from"../../../geometry/Extent.js";import n from"../../../geometry/Point.js";import i from"../../support/PixelBlock.js";function a(e,n){if(e.spatialReference.equals(n))return e;const i=t(e.spatialReference),a=t(n);if(i===a)return e;const r=i/a;return{x:e.x*r,y:e.y*r}}async function r(t,e,n){if("extent"===n.type)return m(t,e,n);const{width:a,height:r}=t,h=new Uint8Array(a*r);if(!(await import("../../../geometry/operators/intersectsOperator.js")).execute(e,n))return new i({pixelType:t.pixelType,width:a,height:r,mask:h,maskIsAlpha:!1,pixels:[...t.pixels]});if("polyline"===n.type)return s(t,e,n);return(await import("../../../geometry/operators/containsOperator.js")).execute(n,e)?t:o(t,e,n)}function o(t,e,n){if(!t)return t;const{width:a,height:r}=t,o=h({geometry:n,size:[a,r],srcExtent:e,srcMask:t.mask});return new i({pixelType:t.pixelType,width:a,height:r,mask:o,maskIsAlpha:!1,pixels:[...t.pixels]})}function h(t){const{geometry:e,size:n,srcExtent:i,srcMask:a}=t,[r,o]=n;let h;const m=i.width/r,s=i.height/o,{xmin:l,ymax:p}=i;if("extent"===e.type){const t=(e.xmin-l)/m,n=(e.xmax-l)/m,i=(p-e.ymax)/s,a=(p-e.ymin)/s;h=[[[t,i],[t,a],[n,a],[n,i],[t,i]]]}else h=e.rings.map(t=>t.map(([t,e])=>[(t-l)/m,(p-e)/s]));return x(h,n,a)}function x(t,e,n){const[i,a]=e,r=new OffscreenCanvas(i,a).getContext("2d");r.fillStyle="#f00",r.beginPath(),t.forEach(t=>{r.moveTo(t[0][0],t[0][1]);for(let e=0;e<t.length;e++)r.lineTo(t[e][0],t[e][1]);r.closePath()}),r.fill();const o=r.getImageData(0,0,i,a).data,h=i*a,x=new Uint8Array(h);let m=!1;for(let s=0;s<h;s++)n&&!n[s]||(o[4*s+3]>127?x[s]=255:m=!0);return m||n?x:void 0}function m(t,e,n){const{width:a,height:r}=t,o=new Uint8Array(a*r),h=e.width/a,x=e.height/r;if(n.width/h<.5||n.height/x<.5)return new i({pixelType:t.pixelType,width:a,height:r,mask:o,pixels:[...t.pixels]});const{xmin:m,xmax:s,ymin:l,ymax:p}=e,{xmin:f,xmax:c,ymin:y,ymax:u}=n,M=Math.max(m,f),w=Math.min(s,c),d=Math.max(l,y),g=Math.min(p,u),T=.5*h,k=.5*x;if(w-M<T||g-d<k||w<m+T||M>s-T||d>p-k||g<l+k)return new i({pixelType:t.pixelType,width:a,height:r,mask:o,pixels:[...t.pixels]});const R=Math.max(0,(M-m)/h),j=Math.min(a,Math.max(0,(w-m)/h)),A=Math.max(0,(p-g)/x),z=Math.min(r,Math.max(0,(p-d)/x)),E=Math.round(R),P=Math.round(j)-1,S=Math.round(A),U=Math.round(z)-1;if(E===P&&R%1>.5&&j%1<.5||S===U&&A%1>.5&&z%1<.5)return new i({pixelType:t.pixelType,width:a,height:r,mask:o,pixels:[...t.pixels]});if(0===E&&0===S&&P===a&&U===r)return t;const v=t.mask;for(let i=S;i<=U;i++)for(let t=E;t<=P;t++){const e=i*a+t;o[e]=v?v[e]:255}return new i({pixelType:t.pixelType,width:a,height:r,mask:o,pixels:[...t.pixels]})}function s(t,e,n){const{width:a,height:r}=t,o=new Uint8Array(a*r),h=e.width/a,x=e.height/r,{xmin:m,ymax:s}=e,{paths:l}=n,p=t.mask;for(let i=0;i<l.length;i++){const t=l[i];for(let e=0;e<t.length-1;e++){const[n,i]=t[e],[l,f]=t[e+1],c=Math.min(i,f),y=Math.max(i,f),u=Math.max(0,Math.floor((s-y)/x)),M=Math.min(r-1,Math.floor((s-c)/x));if(!(M<u))if(u===M){const t=Math.min(n,l),e=Math.max(n,l),i=Math.max(0,Math.floor((t-m)/h)),r=Math.min(a-1,Math.floor((e-m)/h));if(r<i)continue;const x=u*a;for(let n=x+i;n<=x+r;n++)o[n]=p?p[n]:255}else{const t=(n-m)/h,e=(l-n)/(f-i)/h,r=x*e;for(let n=u;n<=M;n++){const h=e*(s-n*x-i)+t,m=Math.max(0,Math.floor(r>0?h-r:h)),l=Math.min(a-1,Math.floor(r>0?h:h-r));if(l<m)continue;const f=n*a;for(let t=f+m;t<=f+l;t++)o[t]=p?p[t]:255}}}}return new i({pixelType:t.pixelType,width:a,height:r,mask:o,pixels:[...t.pixels]})}function l(t,e){const{extent:i}=p(t,e,new n({x:t.pixelSize.x,y:t.pixelSize.y,spatialReference:t.spatialReference})),{extent:a}=t.extent;if(i.xmax=Math.min(i.xmax,a.xmax),i.ymax=Math.min(i.ymax,a.ymax),i.xmin<i.xmax&&i.ymin<i.ymax){const{x:e,y:n}=t.pixelSize,a=Math.round(i.width/e),r=Math.round(i.height/n);t.extent=i,t.width=a,t.height=r}}function p(t,n,i,r=!0){const{spatialReference:o}=t,{x:h,y:x}=a(i,o);let m,s,l;const p="extent"===n.type?n:n.extent;let{xmin:f,xmax:c,ymax:y,ymin:u}=p;const{xmin:M,ymax:w}=t.extent;return r?(f=M+(f>M?h*Math.round((f-M)/h):0),y=w-(y<w?x*Math.round((w-y)/x):0),c=M+(c>M?h*Math.round((c-M)/h):0),u=w-(u<w?x*Math.round((w-u)/x):0),m=new e({xmin:f,ymax:y,xmax:c,ymin:u,spatialReference:o}),s=Math.round(m.width/h),l=Math.round(m.height/x)):(s=Math.floor((c-f)/h+.8),l=Math.floor((y-u)/x+.8),f=M+(f>M?h*Math.floor((f-M)/h+.1):0),y=w-(y<w?x*Math.floor((w-y)/x+.1):0),c=f+s*h,u=y-l*x,m=new e({xmin:f,ymax:y,xmax:c,ymin:u,spatialReference:o})),{extent:m,width:s,height:l}}export{r as clip,l as clipRasterInfo,h as convertGeometryToMask,p as snapToRaster};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ import{getPixelValueRange as t}from"../formats/pixelRangeUtils.js";import e from"../../support/PixelBlock.js";function i(i,s,l){const{pixels:n,width:o,height:a,mask:r,bandMasks:p}=i,h=o*a,m=p?.length?e.combineBandMasks(p):r,f=Math.min(s.length,n.length),c=l.startsWith("f"),d=!c&&l!==i.pixelType,[x,g]=t(l),k=e.createEmptyBand(l,h);for(let t=0;t<a;t++){let e=t*o;for(let t=0;t<o;t++,e++)if(!m||m[e]){let t=0;for(let i=0;i<f;i++)t+=s[i]*n[i][e];c||(t=Math.round(t),d&&(t=t>g?g:t<x?x:t)),k[e]=t}}const u=new e({width:o,height:a,pixels:[k],pixelType:l,mask:m});return u.updateStatistics(),u}export{i as grayscale};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ import{mirror as e}from"./mirror.js";import t from"../../support/PixelBlock.js";import{convolutionKernel as n}from"../../support/rasterFunctionConstants.js";const o=new Map;function l(e){const t=Math.sqrt(e.length),n=e.slice(0,t),o=[1];for(let l=1;l<t;l++){let n=null;for(let o=0;o<t;o++){const r=e[o+l*t],s=e[o];if(null==n)if(0===s){if(r)return{separable:!1,row:null,col:null}}else n=r/s;else if(r/s!==n)return{separable:!1,row:null,col:null}}if(null==n)return{separable:!1,row:null,col:null};o.push(n)}return{separable:!0,row:n,col:o}}function r(e,t,n,o,l,r,s){const i=new Float32Array(t*n),a=r.length,p=s?0:o,h=s?o:0,c=s?1:t;for(let u=p;u<n-p;u++){const n=u*t;for(let s=h;s<t-h;s++){if(l&&!l[n+s])continue;let t=0;for(let l=0;l<a;l++)t+=e[n+s+(l-o)*c]*r[l];i[n+s]=t}}return i}function s(e,t,n,o,l,r,s){const i=new Float32Array(t*n),a=Math.floor(o/2),p=Math.floor(l/2);for(let h=a;h<n-a;h++){const n=h*t;for(let h=p;h<t-p;h++){if(r&&!r[n+h])continue;let c=0;for(let r=0;r<o;r++)for(let o=0;o<l;o++)c+=e[n+h+(r-a)*t+o-p]*s[r*l+o];i[n+h]=c}}return i}function i(n,o,l=!0){const{pixels:r,width:i,height:a,pixelType:p,mask:h}=n,c=r.length,u=[],{kernel:f,rows:g,cols:m}=o;for(let t=0;t<c;t++){const n=s(r[t],i,a,g,m,h,f);l&&e(n,i,a,g,m),u.push(n)}return new t({width:i,height:a,pixelType:p,pixels:u,mask:h})}function a(n,o,l,s=!0){const{pixels:i,width:a,height:p,pixelType:h,mask:c}=n,u=i.length,f=[],g=o.length,m=l.length,x=Math.floor(g/2),w=Math.floor(m/2);for(let t=0;t<u;t++){let n=r(i[t],a,p,x,c,o,!0);n=r(n,a,p,w,c,l,!1),s&&e(n,a,p,g,m),f.push(n)}return new t({width:a,height:p,pixelType:h,pixels:f,mask:c})}function p(e,t){const n=l(t.kernel),o=!1!==t.mirrorEdges,r=n.separable?a(e,n.row,n.col,o):i(e,t,o),{outputPixelType:s}=t;return s&&r.clamp(s),r}o.set(n.none,[0,0,0,0,1,0,0,0,0]),o.set(n.lineDetectionHorizontal,[-1,-1,-1,2,2,2,-1,-1,-1]),o.set(n.lineDetectionVertical,[-1,2,-1,-1,2,-1,-1,2,-1]),o.set(n.lineDetectionLeftDiagonal,[2,-1,-1,-1,2,-1,-1,-1,2]),o.set(n.lineDetectionRightDiagonal,[-1,-1,2,-1,2,-1,2,-1,-1]),o.set(n.gradientNorth,[-1,-2,-1,0,0,0,1,2,1]),o.set(n.gradientWest,[-1,0,1,-2,0,2,-1,0,1]),o.set(n.gradientEast,[1,0,-1,2,0,-2,1,0,-1]),o.set(n.gradientSouth,[1,2,1,0,0,0,-1,-2,-1]),o.set(n.gradientNorthEast,[0,-1,-2,1,0,-1,2,1,0]),o.set(n.gradientNorthWest,[-2,-1,0,-1,0,1,0,1,2]),o.set(n.smoothArithmeticMean,[.111111111111,.111111111111,.111111111111,.111111111111,.111111111111,.111111111111,.111111111111,.111111111111,.111111111111]),o.set(n.smoothing3x3,[.0625,.125,.0625,.125,.25,.125,.0625,.125,.0625]),o.set(n.smoothing5x5,[1,1,1,1,1,1,4,4,4,1,1,4,12,4,1,1,4,4,4,1,1,1,1,1,1]),o.set(n.sharpening3x3,[-1,-1,-1,-1,9,-1,-1,-1,-1]),o.set(n.sharpening5x5,[-1,-3,-4,-3,-1,-3,0,6,0,-3,-4,6,21,6,-4,-3,0,6,0,-3,-1,-3,-4,-3,-1]),o.set(n.laplacian3x3,[0,-1,0,-1,4,-1,0,-1,0]),o.set(n.laplacian5x5,[0,0,-1,0,0,0,-1,-2,-1,0,-1,-2,17,-2,-1,0,-1,-2,-1,0,0,0,-1,0,0]),o.set(n.sobelHorizontal,[-1,-2,-1,0,0,0,1,2,1]),o.set(n.sobelVertical,[-1,0,1,-2,0,2,-1,0,1]),o.set(n.sharpen,[0,-.25,0,-.25,2,-.25,0,-.25,0]),o.set(n.sharpen2,[-.25,-.25,-.25,-.25,3,-.25,-.25,-.25,-.25]),o.set(n.pointSpread,[-.627,.352,-.627,.352,2.923,.352,-.627,.352,-.627]);export{p as convolute,a as convoluteSeparable,o as convolutionKernels,l as separateKernels};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ import{getNamedColor as t,hexToRgba as e}from"../../../../colorUtils.js";import{createRasterFunction as n}from"./utils.js";import{colormapName as o}from"../../../support/rasterFunctionConstants.js";import{colorRampDict as r}from"../../../../renderers/support/colorRampUtils.js";function a(t){return"colormap"in t?s(t):"colorRamp"in t?i(t):u(t)}function s(o){const r=o.colormap.map(n=>{if("value"in n){const o="string"==typeof n.color?t(n.color)??e(n.color):n.color;(n=[n.value,...o])[4]&&n[4]<=1&&(n[4]=Math.round(255*n[4]))}return n}),{raster:a,outputPixelType:s}=o;return n("Colormap",{colormap:r,raster:a},s)}function i(t){const{raster:e,colorRamp:o,outputPixelType:r}=t,a={colorRamp:"toJSON"in o?o.toJSON():o,raster:e};return n("Colormap",a,r)}function u(t){const{colorRampName:e}=t,a=Object.values(o).find(t=>t.toLowerCase()===e?.toLowerCase()),s=r.toJSON(e),{raster:i,outputPixelType:u="unknown"}=t;return n("Colormap",a?{colormapName:a,raster:i}:{colorRampName:s,raster:i},u)}function l(t){const{raster:e,outputPixelType:o="u8"}=t;return n("ColormapToRGB",{raster:e},o)}function p(t){const{raster:e,histograms:o,outputPixelType:r}=t,a=t.statistics?.map(t=>({min:t.min,max:t.max,mean:t.avg,standardDeviation:t.stddev}));return n("StatisticsHistograms",{raster:e,statistics:a,histograms:o},r)}function c(t){const{raster:e,attributeTable:o,outputPixelType:r="unknown"}=t,a="toJSON"in o?o.toJSON():o;return n("Table",{raster:e,attributeTableAsRecordSet:a},r)}function m(t){const{raster:e,outputPixelType:o="unknown"}=t,r={raster:e,missingBandAction:"fail"===t.missingBandAction?1:0};return"bandIds"in t?r.bandIds=t.bandIds:"bandNames"in t?r.bandNames=t.bandNames:"bandWavelengths"in t&&(r.bandWavelengths=t.bandWavelengths),n("ExtractBand",r,o)}function d(t){const{redBand:e,greenBand:o,blueBand:r,raster:a,outputPixelType:s}=t,i="name"===t.method?0:2;return n("CreateColorComposite",{raster:a,method:i,bandIndexesR:e,bandIndexesG:o,bandIndexesB:r},s)}function f(t){const{rasters:e,outputPixelType:o}=t;return n("CompositeBand",{rasters:e},o)}function g(t){const{allowUnmatched:e,raster:o,rangeMaps:r,outputPixelType:a,replacementValue:s}=t,i=r?.filter(({output:t})=>null!=t),u=i?.flatMap(({range:t})=>t),l=i?.map(({output:t})=>t),p=r?.filter(t=>null==t.output)?.flatMap(({range:t})=>t);return n("Remap",{allowUnmatched:e,raster:o,inputRanges:u,outputValues:l,noDataRanges:p,replacementValue:s},a)}function b(t){const{inputBitPositions:e,raster:o,fillRaster:r,outputBitPositions:a,outputPixelType:s}=t,i={inputBitPositions:e,outputBitPositions:a,raster:o};return null!=r&&("number"==typeof r?(i.constantFillCheck=!0,i.constantFillValue=r):i.fillRaster=r),n("TransposeBits",i,s)}function x(t){const{raster:e,outputPixelType:o="unknown"}=t,r=t.includedRanges?.flat(),a=t.noDataValues?.map(t=>t.join(" ")),s="match-all"===t.noDataInterpretation?1:0;return n("Mask",{raster:e,includedRanges:r,noDataInterpretation:s,noDataValues:a},o)}function T(t){const{geometry:e,keepOutside:o,outputPixelType:r="unknown",raster:a}=t,s="declaredClass"in e?e.toJSON():e;return n("Clip",{clippingGeometry:s,clippingType:o?2:1,raster:a},r)}export{T as clip,a as colormap,l as colormapToRGB,f as compositeBand,d as createColorComposite,m as extractBand,x as mask,g as remap,p as statisticsHistogram,c as table,b as transposeBits};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ import n from"../../../support/RasterFunction.js";function t(t,e,o){return Object.keys(e).forEach(n=>{null==e[n]&&delete e[n]}),o||(o="unknown"),new n({functionName:t,functionArguments:e,outputPixelType:o})}export{t as createRasterFunction};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ import"../../../core/has.js";import{JSONMap as t}from"../../../core/jsonMap.js";import{mirror as e}from"./mirror.js";import o from"../../support/PixelBlock.js";const n=new t({1:"min",2:"max",3:"mean",4:"stddev",5:"median",6:"majority",7:"minority"},{useNumericKeys:!0});function s(t,e){const{fillNoDataOnly:o}=e,{band:n,width:s,height:r,mask:i,outBand:l}=t;if(o&&!i)return void l.set(n);const{statisticsType:a,kernelRows:c,kernelCols:f}=e,h="stddev"===a,u=s*r,m=new Float64Array(u),d=new Float64Array(u),y=new Uint32Array(u);for(let A=0;A<r;A++){const t=A*s;let e=0,o=0,r=0;for(let s=0;s<f;s++)i&&!i[t+s]||(e+=n[t+s],h&&(o+=n[t+s]**2),r++);m[t]=e,d[t]=o,y[t]=r;for(let l=1;l<=s-f;l++){const s=t+l-1,a=s+f;i?(i[s]&&(r--,e-=n[s],h&&(o-=n[s]**2)),i[a]&&(r++,e+=n[a],h&&(o+=n[a]**2))):(e-=n[s],e+=n[a],h&&(o-=n[s]**2,o+=n[a]**2)),m[t+l]=e,y[t+l]=r,h&&(d[t+l]=o)}}const p=new Float64Array(u),k=new Float64Array(u),w=new Uint32Array(u),M=c*s;for(let A=0;A<=s-f;A++){let t=0,e=0,o=0;for(let n=0;n<c;n++){const r=n*s+A;t+=m[r],o+=y[r],h&&(e+=d[r])}p[A]=t,k[A]=e,w[A]=o;for(let n=1;n<=r-c;n++){const r=(n-1)*s+A,i=r+M;t-=m[r],t+=m[i],o-=y[r],o+=y[i],h&&(e-=d[r],e+=d[i]),p[n*s+A]=t,k[n*s+A]=e,w[n*s+A]=o}}const g=Math.floor(c/2),b=Math.floor(f/2);for(let A=g;A<r-g;A++){const t=A*s;for(let e=b;e<s-b;e++){const n=(A-g)*s+e-b,r=w[n];if(0===r||o&&(!i||i[t+e]))continue;const a=p[n]/r,c=h?Math.sqrt((k[n]-p[n]*a)/r):a;l[t+e]=c,i&&(i[t+e]=255)}}}function r(t,e){const{fillNoDataOnly:o}=e,{band:n,width:s,height:r,mask:i,outBand:l}=t;if(o&&!i)return void l.set(n);const{kernelRows:a,kernelCols:c,statisticsType:f}=e,h=Math.floor(a/2),u=Math.floor(c/2),m="min"===f,d=l.slice(),y=new Uint32Array(s*r);for(let p=h;p<r-h;p++){const t=p*s;for(let e=u;e<s-u;e++){let o=m?Number.MAX_VALUE:-Number.MAX_VALUE,r=0;for(let l=0;l<a;l++)for(let a=0;a<c;a++){const c=t+e+(l-h)*s+a-u;i&&!i[c]||(o=m?Math.min(o,n[c]):Math.max(o,n[c]),r++)}i?(d[t+e]=0===r?0:o,y[t+e]=r):l[t+e]=0===r?0:o}}if(i)for(let p=h;p<r-h;p++){const t=p*s;for(let e=u;e<s-u;e++)if(y[t+e]){if(o&&i[t+e])continue;l[t+e]=d[t+e],i[t+e]=255}}}function i(t,e){const{fillNoDataOnly:o}=e,{band:n,width:s,height:r,mask:i,outBand:l}=t;if(o&&!i)return void l.set(n);const{kernelRows:a,kernelCols:c}=e,f=Math.floor(a/2),h=Math.floor(c/2),u=l.slice(),m=new Uint32Array(s*r);for(let d=f;d<r-f;d++){const t=d*s;for(let e=h;e<s-h;e++){if(o&&i?.[t+e])continue;const r=[];for(let o=0;o<a;o++)for(let l=0;l<c;l++){const a=t+e+(o-f)*s+l-h;i&&!i[a]||r.push(n[a])}r.length&&(r.sort((t,e)=>t-e),i?(u[t+e]=r[Math.floor((r.length-1)/2)],m[t+e]=r.length):l[t+e]=r[Math.floor((r.length-1)/2)])}}if(i)for(let d=f;d<r-f;d++){const t=d*s;for(let e=h;e<s-h;e++)if(m[t+e]){if(o&&i[t+e])continue;l[t+e]=u[t+e],i[t+e]=255}}}function l(t,e){const{fillNoDataOnly:o}=e,{band:n,width:s,height:r,mask:i,outBand:l}=t;if(o&&!i)return void l.set(n);const{kernelRows:a,kernelCols:c}=e,f=Math.floor(a/2),h=Math.floor(c/2),u="majority"===e.statisticsType,m=a*c,d=l.slice(),y=new Uint32Array(s*r);for(let p=f;p<r-f;p++){const t=p*s;for(let e=h;e<s-h;e++){if(o&&i?.[t+e])continue;const r=new Map;for(let o=0;o<a;o++)for(let l=0;l<c;l++){const a=t+e+(o-f)*s+l-h;if(i&&!i[a])continue;const c=n[a];r.set(c,r.has(c)?r.get(c)+1:1)}if(0===r.size)continue;let p=0,k=0,w=u?0:m+1;for(const t of r.keys())k=r.get(t),u===k>w&&(w=k,p=t);i?(d[t+e]=p,y[t+e]=r.size):l[t+e]=p}}if(i)for(let p=f;p<r-f;p++){const t=p*s;for(let e=h;e<s-h;e++)if(y[t+e]){if(o&&i[t+e])continue;l[t+e]=d[t+e],i[t+e]=255}}}function a(t,n){const{mask:a}=t,{fillNoDataOnly:c}=n;if(c&&!a)return t;const{pixels:f,width:h,height:u,bandMasks:m,pixelType:d}=t,y=f.length,p=h*u,k=[],{kernelRows:w,kernelCols:M,statisticsType:g,mirrorEdges:b}=n;if(c&&!a)return t;const A=n.outputPixelType??d,x=[];for(let N=0;N<y;N++){const t=f[N],d=o.createEmptyBand(A,p);c&&d.set(t);const y=m?.[N]??a,j=y?.slice()??null,B={band:t,width:h,height:u,mask:j,outBand:d};switch(g){case"min":case"max":r(B,n);break;case"mean":case"stddev":s(B,n);break;case"median":i(B,n);break;case"majority":case"minority":l(B,n)}b&&!c&&e(d,h,u,w,M),k.push(d),j&&x.push(j)}let j=x[0]??a;x.length!==y&&(x.length=0),y>1&&m?.length&&(j=o.combineBandMasks(m));const B=new o({pixelType:A,width:h,height:u,pixels:k,bandMasks:m&&x.length?x:null,mask:j});return B.updateStatistics(),B}export{a as computeFocalStatistics,n as statisticsTypeMap};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ import{fixNaN as t,clipBandToPixelTypeRange as e}from"../formats/pixelRangeUtils.js";import n from"../../support/PixelBlock.js";import{localConditionalOperation as r,localTrigonometricOperation as o,localLogicalOperation as s}from"../../support/rasterFunctionConstants.js";const a=new Map([[o.acos,{domain:[0,Math.PI],isInteger:!1}],[o.asin,{domain:[-Math.PI/2,Math.PI/2],isInteger:!1}],[o.atan,{domain:[-Math.PI/2,Math.PI/2],isInteger:!1}],[o.cos,{domain:[-1,1],isInteger:!1}],[o.sin,{domain:[-1,1],isInteger:!1}],[s.booleanAnd,{domain:[0,1],isInteger:!0}],[s.booleanNot,{domain:[0,1],isInteger:!0}],[s.booleanOr,{domain:[0,1],isInteger:!0}],[s.booleanXOr,{domain:[0,1],isInteger:!0}],[s.equalTo,{domain:[0,1],isInteger:!0}],[s.notEqual,{domain:[0,1],isInteger:!0}],[s.greaterThan,{domain:[0,1],isInteger:!0}],[s.greaterThanEqual,{domain:[0,1],isInteger:!0}],[s.lessThan,{domain:[0,1],isInteger:!0}],[s.lessThanEqual,{domain:[0,1],isInteger:!0}],[s.isNull,{domain:[0,1],isInteger:!0}]]);function l(t){return a.get(t)}const c=[0,2,2,2,1,2,1,1,1,1,1,2,2,1,2,2,2,2,1,2,2,1,1,2,2,1,1,1,2,2,1,1,1,2,2,1,1,1,999,999,999,999,999,999,2,1,2,999,1,1,2,1,1,1,999,999,1,1,999,1,1,2,999,999,2,2,999,999,999,999,999,999,999,999,999,999,3,999,3];function f(t,e=!1){const n=t.map(t=>t.mask),r=n.filter(t=>null!=t),o=t[0].pixels[0].length;if(0===r.length||e&&r.length!==n.length)return new Uint8Array(o).fill(255);const s=r[0],a=new Uint8Array(s);if(1===r.length)return a;if(!e){for(let t=1;t<r.length;t++){const e=r[t];for(let t=0;t<a.length;t++)a[t]&&(a[t]=e[t]?255:0)}return a}for(let l=1;l<r.length;l++){const t=r[l];for(let e=0;e<a.length;e++)0===a[e]&&(a[e]=t[e]?255:0)}return a}function i(t,e,r){const[o,s]=t,a=o.length,l=n.createEmptyBand(r,a);for(let n=0;n<a;n++)e&&!e[n]||(l[n]=o[n]+s[n]);return l}function u(t,e,r){const[o]=t,s=o.length,a=n.createEmptyBand("f32",s);return a.set(o),a}function h(t,e,r){const[o]=t,s=o.length,a=n.createEmptyBand(r,s);for(let n=0;n<s;n++)e&&!e[n]||(a[n]=o[n]*o[n]);return a}function g(t,e,r){const[o,s]=t,a=o.length,l=n.createEmptyBand(r,a);for(let n=0;n<a;n++)e&&!e[n]||(l[n]=o[n]-s[n]);return l}function p(t,e,r){const[o,s]=t,a=o.length,l=n.createEmptyBand(r,a);for(let n=0;n<a;n++)e&&!e[n]||(l[n]=o[n]*s[n]);return l}function m(t,e,r){const[o]=t,s=o.length,a=n.createEmptyBand(r,s);for(let n=0;n<s;n++)e&&!e[n]||(a[n]=Math.sign(o[n])*Math.floor(Math.abs(o[n])));return a}function d(t,e,r){const[o,s]=t,a=o.length,l=n.createEmptyBand(r,a);for(let n=0;n<a;n++)e&&!e[n]||(l[n]=o[n]/s[n]);return l}function y(t,e,n){return d(t,e,"f32")}function E(t,e,r){const[o,s]=t,a=o.length,l=n.createEmptyBand(r,a);for(let n=0;n<a;n++)e&&!e[n]||(l[n]=Math.floor(o[n]/s[n]));return l}function M(t,e,r,s){const a=t[0],l=a.length,c=n.createEmptyBand(r,l);if(s===o.atanh){for(let t=0;t<l;t++)if(e[t]){const n=a[t];Math.abs(n)>=1?e[t]=0:c[t]=Math.atanh(n)}return c}const f=s===o.asin?Math.asin:Math.acos;for(let n=0;n<l;n++)if(e[n]){const t=a[n];Math.abs(t)>1?e[n]=0:c[n]=f(t)}return c}function B(t,e,r,o){const[s]=t,a=s.length,l=n.createEmptyBand(r,a);for(let n=0;n<a;n++)e&&!e[n]||(l[n]=o(s[n]));return l}function I(t,e,r,o){const[s,a]=t,l=s.length,c=n.createEmptyBand(r,l);for(let n=0;n<l;n++)e&&!e[n]||(c[n]=o(s[n],a[n]));return c}function w(t,e,r){const[o,s]=t,a=o.length,l=n.createEmptyBand(r,a);for(let n=0;n<a;n++)e&&!e[n]||(l[n]=o[n]&s[n]);return l}function x(t,e,r){const[o,s]=t,a=o.length,l=n.createEmptyBand(r,a);for(let n=0;n<a;n++)e&&!e[n]||(l[n]=o[n]<<s[n]);return l}function b(t,e,r){const[o]=t,s=o.length,a=n.createEmptyBand(r,s);for(let n=0;n<s;n++)e&&!e[n]||(a[n]=~o[n]);return a}function A(t,e,r){const[o,s]=t,a=o.length,l=n.createEmptyBand(r,a);for(let n=0;n<a;n++)e&&!e[n]||(l[n]=o[n]|s[n]);return l}function P(t,e,r){const[o,s]=t,a=o.length,l=n.createEmptyBand(r,a);for(let n=0;n<a;n++)e&&!e[n]||(l[n]=o[n]>>s[n]);return l}function T(t,e,r){const[o,s]=t,a=o.length,l=n.createEmptyBand(r,a);for(let n=0;n<a;n++)e&&!e[n]||(l[n]=o[n]^s[n]);return l}function k(t,e,r){const[o,s]=t,a=o.length,l=n.createEmptyBand(r,a);for(let n=0;n<a;n++)e&&!e[n]||(l[n]=o[n]&&s[n]?1:0);return l}function q(t,e,r){const[o]=t,s=o.length,a=n.createEmptyBand(r,s);for(let n=0;n<s;n++)e&&!e[n]||(a[n]=o[n]?0:1);return a}function N(t,e,r){const[o,s]=t,a=o.length,l=n.createEmptyBand(r,a);for(let n=0;n<a;n++)e&&!e[n]||(l[n]=o[n]||s[n]?1:0);return l}function U(t,e,r){const[o,s]=t,a=o.length,l=n.createEmptyBand(r,a);for(let n=0;n<a;n++)e&&!e[n]||(l[n]=(o[n]?1:0)^(s[n]?1:0));return l}function j(t,e,r){const[o,s]=t,a=o.length,l=n.createEmptyBand(r,a);for(let n=0;n<a;n++)e&&!e[n]||(l[n]=o[n]===s[n]?1:0);return l}function F(t,e,r,o){const[s]=t,a=s.length,l=n.createEmptyBand(r,a),c=o===Math.E;for(let n=0;n<a;n++)e&&!e[n]||(l[n]=c?Math.exp(s[n]):o**s[n]);return l}function z(t,e,n){return F(t,e,n,10)}function O(t,e,n){return F(t,e,n,2)}function C(t,e,n){return F(t,e,n,Math.E)}function R(t,e,r,o){const[s]=t,a=s.length,l=n.createEmptyBand(r,a);for(let n=0;n<a;n++)e&&!e[n]||(s[n]<=0?e[n]=0:l[n]=o(s[n]));return l}function S(t,e,n){return R(t,e,n,Math.log10)}function X(t,e,n){return R(t,e,n,Math.log2)}function v(t,e,n){return R(t,e,n,Math.log)}function D(t,e,r){const[o,s]=t,a=o.length,l=n.createEmptyBand(r,a);for(let n=0;n<a;n++)e&&!e[n]||(l[n]=o[n]>s[n]?1:0);return l}function G(t,e,r){const[o,s]=t,a=o.length,l=n.createEmptyBand(r,a);for(let n=0;n<a;n++)e&&!e[n]||(l[n]=o[n]>=s[n]?1:0);return l}function H(t,e,r){const[o,s]=t,a=o.length,l=n.createEmptyBand(r,a);for(let n=0;n<a;n++)e&&!e[n]||(l[n]=o[n]<s[n]?1:0);return l}function J(t,e,r){const[o,s]=t,a=o.length,l=n.createEmptyBand(r,a);for(let n=0;n<a;n++)e&&!e[n]||(l[n]=o[n]<=s[n]?1:0);return l}function K(t,e,r){const[o]=t,s=o.length,a=n.createEmptyBand(r,s);if(!e)return a;for(let n=0;n<s;n++)a[n]=e[n]?0:1;return a}function L(t,e,r){const[o,s]=t,a=o.length,l=n.createEmptyBand(r,a);for(let n=0;n<a;n++)e&&!e[n]||(l[n]=o[n]%s[n]);return l}function Q(t,e,r){const[o]=t,s=o.length,a=n.createEmptyBand(r,s);for(let n=0;n<s;n++)e&&!e[n]||(a[n]=-o[n]);return a}function V(t,e,r){const[o,s]=t,a=o.length,l=n.createEmptyBand(r,a);for(let n=0;n<a;n++)e&&!e[n]||(l[n]=o[n]===s[n]?0:1);return l}function W(t,e,r){const[o,s]=t,a=o.length,l=n.createEmptyBand(r,a),c=new Uint8Array(a);for(let n=0;n<a;n++)null!=e&&!e[n]||0!==o[n]||(l[n]=s[n],c[n]=255);return{band:l,mask:c}}function Y(t,e,r){const[o,s,a]=t,l=o.length,c=n.createEmptyBand(r,l);for(let n=0;n<l;n++)e&&!e[n]||(c[n]=o[n]?s[n]:a[n]);return c}function Z(t,e,r){const o=t.length;if(o<2)return t[0];const[s]=t,a=s.length,l=n.createEmptyBand(r,a);for(let n=0;n<a;n++)if(!e||e[n]){let e=s[n];for(let r=1;r<o;r++){const o=t[r][n];e<o&&(e=o)}l[n]=e}return l}function $(t,e,r){const o=t.length;if(o<2)return t[0];const[s]=t,a=s.length,l=n.createEmptyBand(r,a);for(let n=0;n<a;n++)if(!e||e[n]){let e=s[n];for(let r=1;r<o;r++){const o=t[r][n];e>o&&(e=o)}l[n]=e}return l}function _(t,e,r){const o=t.length;if(o<2)return t[0];const[s]=t,a=s.length,l=n.createEmptyBand(r,a);for(let n=0;n<a;n++)if(!e||e[n]){let e=s[n],r=e;for(let s=1;s<o;s++){const o=t[s][n];r<o?r=o:e>o&&(e=o)}l[n]=r-e}return l}function tt(t,e,r){const o=t.length;if(o<2)return t[0];const[s]=t,a=s.length,l=n.createEmptyBand(r,a);for(let n=0;n<a;n++)if(!e||e[n]){let e=0;for(let r=0;r<o;r++)e+=t[r][n];l[n]=e/o}return l}function et(t,e,r){const o=t.length;if(o<2)return t[0];const[s]=t,a=s.length,l=n.createEmptyBand(r,a);for(let n=0;n<a;n++)if(!e||e[n])for(let e=0;e<o;e++){const r=t[e];l[n]+=r[n]}return l}function nt(t,e,r){const o=t.length;if(o<2)return t[0];const[s]=t,a=s.length,l=n.createEmptyBand(r,a);for(let n=0;n<a;n++)if(!e||e[n]){const e=new Float32Array(o);let r=0;for(let a=0;a<o;a++){const o=t[a];r+=o[n],e[a]=o[n]}r/=o;let s=0;for(let t=0;t<o;t++)s+=(e[t]-r)**2;l[n]=Math.sqrt(s/o)}return l}function rt(t,e,r){const o=t.length;if(o<2)return t[0];const s=Math.floor(o/2),[a]=t,l=a.length,c=n.createEmptyBand(r,l),f=new Float32Array(o),i=o%2==1;for(let n=0;n<l;n++)if(!e||e[n]){for(let e=0;e<o;e++)f[e]=t[e][n];f.sort(),c[n]=i?f[s]:(f[s]+f[s-1])/2}return c}function ot(t,e,r){const[o,s]=t;if(null==s)return o;const a=o.length,l=n.createEmptyBand(r,a);for(let n=0;n<a;n++)e&&!e[n]||(l[n]=o[n]<s[n]?o[n]:s[n]);return l}function st(t,e,r){const o=t.length;if(o<=2)return ot(t,e,r);const s=t[0].length,a=n.createEmptyBand(r,s),l=new Map;for(let n=0;n<s;n++)if(!e||e[n]){l.clear();for(let a=0;a<o;a++){const e=t[a][n];l.set(e,l.has(e)?l.get(e)+1:1)}let e=0,r=0;const s=[];for(const t of l.keys())e=l.get(t),e>r?(r=e,s.length=0,s.push(t)):e===r&&s.push(t);s.length>1&&s.sort((t,e)=>t-e),a[n]=s[0]}return a}function at(t,e,r){const o=t.length;if(o<=2)return ot(t,e,r);const s=t[0].length,a=n.createEmptyBand(r,s),l=new Map;for(let n=0;n<s;n++)if(!e||e[n]){l.clear();for(let a=0;a<o;a++){const e=t[a][n];l.set(e,l.has(e)?l.get(e)+1:1)}let e=0,r=t.length;const s=[];for(const t of l.keys())e=l.get(t),e<r?(r=e,s.length=0,s.push(t)):e===r&&s.push(t);s.length>1&&s.sort((t,e)=>t-e),a[n]=s[0]}return a}function lt(t,e,r){const o=t.length;if(o<2)return t[0];const[s]=t,a=s.length,l=n.createEmptyBand(r,a),c=new Set;for(let n=0;n<a;n++)if(!e||e[n]){let e;c.clear();for(let r=0;r<o;r++)e=t[r][n],c.add(e);l[n]=c.size}return l}const ct=new Map,ft=new Map,it=new Map,ut=new Map;function ht(){ct.size||(ct.set(4,Math.sqrt),ct.set(6,Math.acos),ct.set(7,Math.asin),ct.set(8,Math.atan),ct.set(9,Math.atanh),ct.set(10,Math.abs),ct.set(21,Math.cos),ct.set(22,Math.cosh),ct.set(48,Math.floor),ct.set(49,Math.ceil),ct.set(51,Math.sin),ct.set(52,Math.sinh),ct.set(56,Math.tan),ct.set(57,Math.tanh),ct.set(59,Math.acosh),ct.set(60,Math.asinh),ct.set(65,Math.floor),ft.set(5,Math.pow),ft.set(61,Math.atan2),it.set(1,i),it.set(2,g),it.set(3,p),it.set(11,w),it.set(12,x),it.set(13,b),it.set(14,A),it.set(15,P),it.set(16,T),it.set(17,k),it.set(18,q),it.set(19,N),it.set(20,U),it.set(23,d),it.set(24,j),it.set(25,C),it.set(26,z),it.set(27,O),it.set(28,D),it.set(29,G),it.set(30,m),it.set(31,K),it.set(32,u),it.set(33,H),it.set(34,J),it.set(35,v),it.set(36,S),it.set(37,X),it.set(44,L),it.set(45,Q),it.set(46,V),it.set(53,h),it.set(64,y),it.set(65,E),it.set(76,Y),it.set(78,Y),ut.set(38,st),ut.set(39,Z),ut.set(40,tt),ut.set(41,rt),ut.set(42,$),ut.set(43,at),ut.set(47,_),ut.set(54,nt),ut.set(55,et),ut.set(58,lt),ut.set(66,st),ut.set(67,Z),ut.set(68,tt),ut.set(69,rt),ut.set(70,$),ut.set(71,at),ut.set(72,_),ut.set(73,nt),ut.set(74,et),ut.set(75,lt))}function gt(l,c,i={}){ht();let u=f(l,c>=66&&c<=75);const{outputPixelType:h="f32"}=i,g=!ut.has(c)||i.processAsMultiband,p=g?l[0].pixels.length:1,m=[];for(let f=0;f<p;f++){const i=ut.has(c)&&!g?l.flatMap(t=>t.pixels):l.map(t=>t.pixels[f]);let p,d=!0;if(c===r.setNull){const t=W(i,u,h);p=t.band,u=t.mask,d=!1}else if(it.has(c)){p=it.get(c)(i,u,"f64")}else if(ct.has(c))p=c===o.asin||c===o.acos||c===o.atanh?M(i,u,"f64",c):B(i,u,"f64",ct.get(c));else if(ft.has(c))p=I(i,u,"f64",ft.get(c));else if(ut.has(c)){p=ut.get(c)(i,u,"f64")}else p=i[0],d=!1;if(d&&c!==s.isNull&&!a.has(c)){const r=n.createEmptyBand(h,p.length);u||(u=new Uint8Array(p.length).fill(255)),t(p,u),e(p,u,h,r),p=r}m.push(p)}const d=l[0];return new n({width:d.width,height:d.height,pixelType:h,mask:c===s.isNull?null:u,pixels:m})}function pt(t,e,n){return gt(t,e=[null,1,2,3,23,5,44][e]??1,{outputPixelType:n})}export{pt as arithmetic,l as getOutputDomain,gt as local,c as operandsCount};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ import"../../../core/has.js";import{getPixelValueRange as t}from"../formats/pixelRangeUtils.js";import{matchAnyMask as e}from"./pixelUtils.js";import n from"../../support/PixelBlock.js";function r(t,e,r){const s=t.length,a=n.createEmptyBand(r,s);for(let n=0;n<s;n++)if(e[n]){const r=t[n];r<=0?e[n]=0:a[n]=Math.log(r)}return a}function s(e,r,s,a){const i=e.length,o=n.createEmptyBand(s,i),[l,c]=t(s),m=a?.lambda??0,f=a?.shift??0,h=0===m;for(let t=0;t<i;t++)if(r[t]){const n=e[t];if(n<=0)r[t]=0;else if(h)o[t]=Math.log(n+f);else{const e=((n+f)**m-1)/m;o[t]=Math.max(l,Math.min(e,c))}}return o}function a(t,e,r){const s=t.length,a=n.createEmptyBand(r,s);for(let n=0;n<s;n++)if(e[n]){const r=t[n];r<0?e[n]=0:a[n]=Math.sqrt(r)}return a}function i(e,r,s){const a=e.length,i=n.createEmptyBand(s,a),[o,l]=t(s);for(let t=0;t<a;t++)if(!r||r[t]){const n=1/e[t];i[t]=i[t]=Math.max(o,Math.min(n,l))}return i}function o(t,o,l){const{width:c,height:m,pixels:f}=t;let h=[];h=t.bandMasks?t.bandMasks.map(t=>new Uint8Array(t)):f.map(()=>t.mask?new Uint8Array(t.mask):new Uint8Array(c*m).fill(255));const p="f32",u=f.map((t,e)=>{switch(o){case"log":return r(t,h[e],p);case"sqrt":return a(t,h[e],p);case"inverse":return i(t,h[e],p);case"box-cox":return s(t,h[e],p,l);default:return t}}),d="inverse"===o,g=d?t.mask:1===h.length?h[0]:e(h),x=d?t.bandMasks:1===h.length?void 0:h;return new n({width:c,height:m,pixelType:p,bandMasks:x,mask:g,pixels:u})}export{o as transformPixels};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ import{numberMaxFloat32 as t}from"../../../core/mathUtils.js";import{getPixelValueRange as e}from"../formats/pixelRangeUtils.js";import n from"../../support/PixelBlock.js";const l=9,i="PixelID";function o(t){return null!=t&&t.pixels?.length>0}function r(t,e){return e?.length&&o(t)?t.extractBands(e):t}function s(t){if(!t?.length||t.some(t=>!o(t)))return null;if(1===t.length)return t[0]?.clone()??null;const e=t,{width:l,height:i,pixelType:r}=e[0];if(e.some(t=>t.width!==l||t.height!==i))return null;const s=e.map(({mask:t})=>t).filter(t=>null!=t);let a=null;s.length&&(a=new Uint8Array(l*i),a.set(s[0]),s.length>1&&k(s.slice(1),a));const f=[];e.forEach(({pixels:t})=>f.push(...t));const h=null!=a&&f.length===e.length?e.map(({width:t,height:e,mask:n})=>n??new Uint8Array(t*e).fill(255)):null,c=e.map(({statistics:t})=>t).filter(t=>t?.length),u=[];return c.forEach(t=>u.push(...t)),new n({pixelType:r,width:l,height:i,mask:a,bandMasks:h,pixels:f,statistics:u.length?u:null})}function a(t){if(!t)return;const e=t.colormap;if(!e||0===e.length)return;const n=e.sort((t,e)=>t[0]-e[0]),l=n[0][0]<0?n[0][0]:0,i=Math.max(256,n[n.length-1][0]-l+1),o=new Uint8Array(4*i),r=[],s=5===n[0].length;if(i>65536)return n.forEach(t=>{r[t[0]-l]=s?t.slice(1):t.slice(1).concat([255])}),{indexed2DColormap:r,offset:l,alphaSpecified:s};if(t.fillUnspecified){let t=n[0];for(let e=t[0]-l,r=0;e<i;e++)o[4*e]=t[1],o[4*e+1]=t[2],o[4*e+2]=t[3],o[4*e+3]=s?t[4]:255,e===t[0]-l&&(t=r===n.length-1?t:n[++r])}else for(let a=0;a<n.length;a++){const t=n[a],e=4*(t[0]-l);o[e]=t[1],o[e+1]=t[2],o[e+2]=t[3],o[e+3]=s?t[4]:255}return{indexedColormap:o,offset:l,alphaSpecified:s}}function f(t,e){if(!o(t))return t;if(!e||!e.indexedColormap&&!e.indexed2DColormap)return t;const n=t.clone(),l=n.pixels;let i=n.mask;const r=n.width*n.height;if(1!==l.length)return t;const{indexedColormap:s,indexed2DColormap:a,offset:f,alphaSpecified:h}=e,c=l[0],u=new Uint8Array(c.length),p=new Uint8Array(c.length),d=new Uint8Array(c.length);let x,g=0;if(s){const t=s.length-1;if(null!=i)for(let e=0;e<r;e++)i[e]&&(g=4*(c[e]-f),g<f||g>t?i[e]=0:(u[e]=s[g],p[e]=s[g+1],d[e]=s[g+2],i[e]=s[g+3]));else{i=new Uint8Array(r);for(let e=0;e<r;e++)g=4*(c[e]-f),g<f||g>t?i[e]=0:(u[e]=s[g],p[e]=s[g+1],d[e]=s[g+2],i[e]=s[g+3]);n.mask=i}}else if(a)if(null!=i)for(let o=0;o<r;o++)i[o]&&(x=a[c[o]],u[o]=x[0],p[o]=x[1],d[o]=x[2],i[o]=x[3]);else{i=new Uint8Array(r);for(let t=0;t<r;t++)x=a[c[t]],u[t]=x[0],p[t]=x[1],d[t]=x[2],i[t]=x[3];n.mask=i}return n.pixels=[u,p,d],n.statistics=null,n.pixelType="u8",n.maskIsAlpha=h,n}function h(t,e){if(!o(t))return null;const{pixels:l,mask:i}=t,r=l.length;let s=e.lut;const{offset:a}=e;s&&1===s[0].length&&(s=l.map(()=>s));const f=[],h=e.outputPixelType||"u8";for(let n=0;n<r;n++){const t=c(l[n],i,s[n],a||0,h);f.push(t)}const u=new n({width:t.width,height:t.height,pixels:f,mask:i,pixelType:h});return u.updateStatistics(),u}function c(t,e,l,i,o){const r=t.length,s=n.createEmptyBand(o,r);if(e)for(let n=0;n<r;n++)e[n]&&(s[n]=l[t[n]-i]);else for(let n=0;n<r;n++)s[n]=l[t[n]-i];return s}function u(t,e,n,l){const{width:i,height:o,pixels:r,mask:s}=t,a=i*o,{bandId:f,ranges:h}=n,c=r[f];if(!c)return;const u=1===h.length,[p,d]=h[0];for(let x=0;x<a;x++)if(!s||s[x]){const t=c[x];if(u)t>=p&&t<=d&&(e[x]=l);else for(let n=0;n<h.length;n++){const[i,o]=h[n];if(t>=i&&t<=o){e[x]=l;break}}}}function p(t,e,n,l){const{width:i,height:o,xyMask:r,xBandId:s,yBandId:a,xBandRange:f,yBandRange:h}=n,{pixels:c,mask:u}=t,p=c[s],d=c[a],[x,g]=f,[m,y]=h,w=(g-x)/i,k=(y-m)/o;for(let M=0;M<p.length;M++)if(!u||u[M]){let t=p[M],n=d[M];if(t<x||t>g||n<m||n>y)continue;r?(t=(t-x)*w,t=t>i-1?i-1:t<0?0:255&t,n=(y-n)*k,n=n>o-1?o-1:n<0?0:255&n,r[n*i+t]&&(e[M]=l)):e[M]=l}}function d(t){const{pixelBlock:e,renderedPixelBlock:n,highlightOptions:l}=t;if(!o(e))return;const{width:i,height:r}=e,s=i*r,a=new Uint8Array(s);for(let o=1;o<=l.length;o++){const t=l[o-1];"bandId"in t?u(e,a,t,o):p(e,a,t,o)}const{pixels:f}=n;1===f.length&&(f[1]=f[0].slice(),f[2]=f[0].slice());const h=l.map(t=>t.color),[c,d,x]=f;if(n.mask){const t=n.mask;for(let e=0;e<s;e++)if(t[e]){t[e]=255;const n=a[e];if(n){const l=h[n-1];c[e]=l[0],d[e]=l[1],x[e]=l[2],t[e]=l[3]}}}else{const t=new Uint8Array(s).fill(255);for(let e=0;e<s;e++){const n=a[e];if(n){const l=h[n-1];c[e]=l[0],d[e]=l[1],x[e]=l[2],t[e]=l[3]}}n.mask=t}n.maskIsAlpha=!0}function x(t,e){if(!o(t))return null;const n=t.clone(),{pixels:l}=n,i=n.width*n.height,r=e.length,s=Math.floor(r/2),a=e[Math.floor(s)],f=l[0],h=new Uint8Array(i),c=new Uint8Array(i),u=new Uint8Array(i);let p=n.mask;const d=4===e[0].mappedColor.length;p||(p=new Uint8Array(i),p.fill(d?255:1),n.mask=p);for(let o=0;o<i;o++)if(p[o]){const t=f[o];let n=!1,l=s,i=a,d=0,x=r-1;for(;x-d>1;){if(t===i.value){n=!0;break}t>i.value?d=l:x=l,l=Math.floor((d+x)/2),i=e[Math.floor(l)]}n||(t===e[d].value?(i=e[d],n=!0):t===e[x].value?(i=e[x],n=!0):t<e[d].value?n=!1:t>e[d].value&&(t<e[x].value?(i=e[d],n=!0):x===r-1?n=!1:(i=e[x],n=!0))),n?(h[o]=i.mappedColor[0],c[o]=i.mappedColor[1],u[o]=i.mappedColor[2],p[o]=i.mappedColor[3]):h[o]=c[o]=u[o]=p[o]=0}return n.pixels=[h,c,u],n.mask=p,n.pixelType="u8",n.maskIsAlpha=d,n}function g(e,n,i=!1){const o=1e-5,r=new Float32Array(3*l),s=n.length;for(let a=0;a<l;a++)r[3*a]=e[2*a]??t-1,r[3*a+1]=e[2*a+1]??t,r[3*a+2]=n[a]??0,a<s&&(a>0&&(r[3*a]-=o),e[2*a+1]!==e[2*a]&&(a<s-1||!i)&&(r[3*a+1]-=o));return r}function m(t,l){if(!o(t))return null;const{width:i,height:r}=t,{inputRanges:s,outputValues:a,outputPixelType:f,noDataRanges:h,allowUnmatched:c,replacementValue:u,isLastInputRangeInclusive:p}=l,d=t.pixels[0],x=n.createEmptyBand(f,d.length),g=t.mask,m=new Uint8Array(i*r);g?m.set(g):m.fill(255);const y=t.pixelType.startsWith("f")?1e-6:0,w=s.map(t=>t-y);w[0]=s[0],w[w.length-1]=s[s.length-1]+(p?1e-6:0);const k=s.length/2,[M,A]=e(f);for(let e=0;e<r;e++)for(let t=0;t<i;t++){const n=e*i+t;if(m[n]){const t=d[n];let e=!1;for(let l=k-1;l>=0;l--)if(t===s[2*l]||t>w[2*l]&&t<w[2*l+1]){x[n]=a[l],e=!0;break}e||(c?x[n]=t>A?A:t<M?M:u??t:m[n]=0)}}const U=h?.length;if(U)for(let e=0;e<r;e++)for(let t=0;t<i;t++){const n=e*i+t;if(!g||g[n]){const t=d[n];for(let e=0;e<U;e+=2)if(t>=h[e]&&t<=h[e+1]){x[n]=0,m[n]=0;break}}}return new n({width:i,height:r,pixelType:f,pixels:[x],mask:m})}function y(t,e,n,l){const i=null!=n&&n.length>=2?new Set(n):null,o=1===n?.length?n[0]:null,r=!!e?.length;for(let s=0;s<t.length;s++)if(l[s]){const n=t[s];if(r){let t=!1;for(let l=0;l<e.length;l+=2)if(n>=e[l]&&n<=e[l+1]){t=!0;break}t||(l[s]=0)}l[s]&&(n===o||i?.has(n))&&(l[s]=0)}}function w(t,e){const n=t[0].length;e??=new Uint8Array(n).fill(255);for(let l=0;l<n;l++)if(e[l]){let n=!1;for(let e=0;e<t.length;e++)if(t[e][l]){n=!0;break}n||(e[l]=0)}return e}function k(t,e){const n=t[0].length;e??=new Uint8Array(n).fill(255);for(let l=0;l<n;l++)if(e[l]){let n=!1;for(let e=0;e<t.length;e++)if(0===t[e][l]){n=!0;break}n&&(e[l]=0)}return e}function M(t,e){if(!o(t))return null;const{width:l,height:i,pixels:r}=t,s=l*i,a=new Uint8Array(s);t.mask?a.set(t.mask):a.fill(255);const f=r.length,{includedRanges:h,noDataValues:u,outputPixelType:p,matchAll:d,lookups:x}=e;if(x){const t=[];for(let e=0;e<f;e++){const n=x[e],l=c(r[e],a,n.lut,n.offset||0,"u8");t.push(l)}1===t.length?a.set(t[0]):d?w(t,a):k(t,a)}else if(d){const t=[];for(let e=0;e<f;e++){const n=new Uint8Array(s);n.set(a),y(r[e],h?.slice(2*e,2*e+2),u?.[e],n),t.push(n)}1===t.length?a.set(t[0]):w(t,a)}else for(let n=0;n<f;n++)y(r[n],h?.slice(2*n,2*n+2),u?.[n],a);return new n({width:l,height:i,pixelType:p,pixels:r,mask:a})}function A(t){const{srcPixelType:l,inputRanges:i,outputValues:o,allowUnmatched:r,noDataRanges:s,isLastInputRangeInclusive:a,outputPixelType:f}=t;if("u8"!==l&&"s8"!==l&&"u16"!==l&&"s16"!==l)return null;const h=l.includes("16")?65536:256,c=l.includes("s")?-h/2:0,u=n.createEmptyBand(f,h),p=new Uint8Array(h);r&&p.fill(255);const[d,x]=e(f);if(i?.length&&o?.length){const t=1e-6,e=i.map(e=>e-t);e[0]=i[0],a&&(e[e.length-1]=i[i.length-1]);for(let n=0;n<e.length;n++){const t=o[n]>x?x:o[n]<d?d:o[n],l=Math.ceil(e[2*n]-c),r=i[2*n+1]===i[2*n]?l:Math.floor(e[2*n+1]-c);for(let e=l;e<=r;e++)u[e]=t,p[e]=255}}if(s?.length)for(let e=0;e<s.length;e++){const t=Math.ceil(s[2*e]-c),n=Math.floor(s[2*e+1]-c);for(let e=t;e<=n;e++)p[e]=0}return{lut:u,offset:c,mask:p}}function U(t,e,n){if("u8"!==t&&"s8"!==t&&"u16"!==t&&"s16"!==t)return null;const l=t.includes("16")?65536:256,i=t.includes("s")?-l/2:0,o=new Uint8Array(l);if(e)for(let r=0;r<e.length;r++){const t=Math.ceil(e[2*r]-i),n=Math.floor(e[2*r+1]-i);for(let e=t;e<=n;e++)o[e]=255}else o.fill(255);if(n)for(let r=0;r<n.length;r++)o[n[r]-i]=0;return{lut:o,offset:i}}function b(t,e,n,l,i,o,r,s){return{xmin:i<=n*t?0:i<n*t+t?i-n*t:t,ymin:o<=l*e?0:o<l*e+e?o-l*e:e,xmax:i+r<=n*t?0:i+r<n*t+t?i+r-n*t:t,ymax:o+s<=l*e?0:o+s<l*e+e?o+s-l*e:e}}function T(t,e){if(!t||0===t.length)return null;const n=t.find(t=>t.pixelBlock);if(null==n?.pixelBlock)return null;const l=(n.extent.xmax-n.extent.xmin)/n.pixelBlock.width,i=(n.extent.ymax-n.extent.ymin)/n.pixelBlock.height,o=.01*Math.min(l,i),r=t.sort((t,e)=>Math.abs(t.extent.ymax-e.extent.ymax)>o?e.extent.ymax-t.extent.ymax:Math.abs(t.extent.xmin-e.extent.xmin)>o?t.extent.xmin-e.extent.xmin:0),s=Math.min.apply(null,r.map(t=>t.extent.xmin)),a=Math.min.apply(null,r.map(t=>t.extent.ymin)),f=Math.max.apply(null,r.map(t=>t.extent.xmax)),h=Math.max.apply(null,r.map(t=>t.extent.ymax)),c={x:Math.round((e.xmin-s)/l),y:Math.round((h-e.ymax)/i)},u={width:Math.round((f-s)/l),height:Math.round((h-a)/i)},p={width:Math.round((e.xmax-e.xmin)/l),height:Math.round((e.ymax-e.ymin)/i)};if(Math.round(u.width/n.pixelBlock.width)*Math.round(u.height/n.pixelBlock.height)!==r.length||c.x<0||c.y<0||u.width<p.width||u.height<p.height)return null;return{extent:e,pixelBlock:S(r.map(t=>t.pixelBlock),u,{clipOffset:c,clipSize:p})}}function B(t,e,n,l,i,o){const{width:r,height:s}=n.block,{x:a,y:f}=n.offset,{width:h,height:c}=n.mosaic,u=b(r,s,l,i,a,f,h,c);let p=0,d=0;if(o){const t=o.hasGCSSShiftTransform?360:o.halfWorldWidth??0,e=r*o.resolutionX,n=o.startX+l*e;n<t&&n+e>t?d=o.rightPadding:n>=t&&(p=o.leftMargin-o.rightPadding,d=0)}if(u.xmax-=d,"number"!=typeof e)for(let x=u.ymin;x<u.ymax;x++){const n=(i*s+x-f)*h+(l*r-a)+p,o=x*r;for(let l=u.xmin;l<u.xmax;l++)t[n+l]=e[o+l]}else for(let x=u.ymin;x<u.ymax;x++){const n=(i*s+x-f)*h+(l*r-a)+p;for(let l=u.xmin;l<u.xmax;l++)t[n+l]=e}}function S(t,e,l={}){const{clipOffset:i,clipSize:r,alignmentInfo:s,blockWidths:a}=l;if(a)return v(t,e,{blockWidths:a});const f=t.find(t=>o(t));if(null==f)return null;const h=r?r.width:e.width,c=r?r.height:e.height,u=f.width,p=f.height,d=e.width/u,x=e.height/p,g={offset:i||{x:0,y:0},mosaic:r||e,block:{width:u,height:p}},m=f.pixelType,y=n.getPixelArrayConstructor(m),w=f.pixels.length,k=[];let M,A;for(let n=0;n<w;n++){A=new y(h*c);for(let e=0;e<x;e++)for(let l=0;l<d;l++){const i=t[e*d+l];o(i)&&(M=i.pixels[n],B(A,M,g,l,e,s))}k.push(A)}const U=t.some(t=>null==t||null!=t.mask&&t.mask.length>0),b=t.some(t=>t?.bandMasks&&t.bandMasks.length>1),T=U?new Uint8Array(h*c):void 0,S=b?[]:void 0;if(T){for(let e=0;e<x;e++)for(let n=0;n<d;n++){const l=t[e*d+n],i=null!=l?l.mask:null;B(T,null!=i?i:l?255:0,g,n,e,s)}if(S)for(let e=0;e<w;e++){const n=new Uint8Array(h*c);for(let l=0;l<x;l++)for(let i=0;i<d;i++){const o=t[l*d+i],r=o?.bandMasks?.[e]??o?.mask;B(n,null!=r?r:o?255:0,g,i,l,s)}S.push(n)}}const C=new n({width:h,height:c,pixels:k,pixelType:m,bandMasks:S,mask:T});return C.updateStatistics(),C}function v(t,e,l){const i=t.find(t=>null!=t);if(null==i)return null;const r=t.some(t=>null==t||!!t.mask),{width:s,height:a}=e,f=r?new Uint8Array(s*a):null,{blockWidths:h}=l,c=[],u=i.getPlaneCount(),p=n.getPixelArrayConstructor(i.pixelType);if(r)for(let n=0,y=0;n<t.length;y+=h[n],n++){const e=t[n];if(!o(e))continue;const l=e.mask;for(let t=0;t<a;t++)for(let i=0;i<h[n];i++)f[t*s+i+y]=null==l?255:l[t*e.width+i]}const d=t.some(t=>t?.bandMasks&&t.bandMasks.length>1),x=d?[]:void 0,g=s*a;for(let n=0;n<u;n++){const e=new p(g),l=d?new Uint8Array(g):void 0;for(let i=0,r=0;i<t.length;r+=h[i],i++){const f=t[i];if(!o(f))continue;const c=f.pixels[n];if(null!=c){for(let t=0;t<a;t++)for(let n=0;n<h[i];n++)e[t*s+n+r]=c[t*f.width+n];if(l){const t=f.bandMasks?.[n]??f.mask;for(let e=0;e<a;e++)for(let n=0;n<h[i];n++)l[e*s+n+r]=t?t[e*f.width+n]:255}}}c.push(e),x&&l&&x.push(l)}const m=new n({width:s,height:a,mask:f,bandMasks:x,pixels:c,pixelType:i.pixelType});return m.updateStatistics(),m}function C(t,e,n){if(!o(t))return null;const{width:l,height:i}=t,r=e.x,s=e.y,a=n.width+r,f=n.height+s;if(r<0||s<0||a>l||f>i)return t;if(0===r&&0===s&&a===l&&f===i)return t;t.mask||(t.mask=new Uint8Array(l*i));const h=t.mask;for(let o=0;o<i;o++){const t=o*l;for(let e=0;e<l;e++)h[t+e]=o<s||o>=f||e<r||e>=a?0:1}return t.updateStatistics(),t}function I(t){if(!o(t))return null;const e=t.clone(),{width:n,height:l,pixels:i}=t,r=i[0],s=e.pixels[0],a=t.mask;for(let o=2;o<l-1;o++){const t=new Map;for(let l=o-2;l<o+2;l++)for(let e=0;e<4;e++){const i=l*n+e;_(t,r[i],a?a[i]:1)}s[o*n]=R(t),s[o*n+1]=s[o*n+2]=s[o*n];let e=3;for(;e<n-1;e++){let l=(o-2)*n+e+1;_(t,r[l],a?a[l]:1),l=(o-1)*n+e+1,_(t,r[l],a?a[l]:1),l=o*n+e+1,_(t,r[l],a?a[l]:1),l=(o+1)*n+e+1,_(t,r[l],a?a[l]:1),l=(o-2)*n+e-3,P(t,r[l],a?a[l]:1),l=(o-1)*n+e-3,P(t,r[l],a?a[l]:1),l=o*n+e-3,P(t,r[l],a?a[l]:1),l=(o+1)*n+e-3,P(t,r[l],a?a[l]:1),s[o*n+e]=R(t)}s[o*n+e+1]=s[o*n+e]}for(let o=0;o<n;o++)s[o]=s[n+o]=s[2*n+o],s[(l-1)*n+o]=s[(l-2)*n+o];return e.updateStatistics(),e}function R(t){if(0===t.size)return 0;let e=0,n=-1,l=0;const i=t.keys();let o=i.next();for(;!o.done;)l=t.get(o.value),l>e&&(n=o.value,e=l),o=i.next();return n}function P(t,e,n){if(0===n)return;const l=t.get(e);1===l?t.delete(e):t.set(e,l-1)}function _(t,e,n){0!==n&&t.set(e,t.has(e)?t.get(e)+1:1)}function F(t,e,l){let{x:i,y:r}=e;const{width:s,height:a}=l;if(0===i&&0===r&&a===t.height&&s===t.width)return t;const{width:f,height:h}=t,c=Math.max(0,r),u=Math.max(0,i),p=Math.min(i+s,f),d=Math.min(r+a,h);if(p<0||d<0||!o(t))return null;i=Math.max(0,-i),r=Math.max(0,-r);const{pixels:x}=t,g=s*a,m=x.length,y=[];for(let o=0;o<m;o++){const e=x[o],l=n.createEmptyBand(t.pixelType,g);for(let t=c;t<d;t++){const n=t*f;let o=(t+r-c)*s+i;for(let t=u;t<p;t++)l[o++]=e[n+t]}y.push(l)}const w=new Uint8Array(g),k=t.mask;for(let n=c;n<d;n++){const t=n*f;let e=(n+r-c)*s+i;for(let n=u;n<p;n++)w[e++]=k?k[t+n]:1}const M=new n({width:l.width,height:l.height,pixelType:t.pixelType,pixels:y,mask:w});return M.updateStatistics(),M}function W(t,e=!0){if(!o(t))return null;const{pixels:l,width:i,height:r,mask:s,pixelType:a}=t,f=[],h=Math.round(i/2),c=Math.round(r/2),u=r-1,p=i-1;for(let o=0;o<l.length;o++){const t=l[o],s=n.createEmptyBand(a,h*c);let d=0;for(let n=0;n<r;n+=2)for(let l=0;l<i;l+=2){const o=t[n*i+l];if(e){const e=l===p?o:t[n*i+l+1],r=n===u?o:t[n*i+l+i],a=l===p?r:n===u?e:t[n*i+l+i+1];s[d++]=(o+e+r+a)/4}else s[d++]=o}f.push(s)}let d=null;if(null!=s){d=new Uint8Array(h*c);let t=0;for(let n=0;n<r;n+=2)for(let l=0;l<i;l+=2){const o=s[n*i+l];if(e){const e=l===p?o:s[n*i+l+1],r=n===u?o:s[n*i+l+i],a=l===p?r:n===u?e:s[n*i+l+i+1];d[t++]=o*e*r*a?1:0}else d[t++]=o}}return new n({width:h,height:c,pixelType:a,pixels:f,mask:d})}function E(t,e,n=0,l=!0){if(!o(t))return null;const{width:i,height:r}=e;let{width:s,height:a}=t;const f=new Map,h={x:0,y:0},c=1+n;let u=t;for(let o=0;o<c;o++){const t=Math.ceil(s/i),n=Math.ceil(a/r);for(let l=0;l<n;l++){h.y=l*r;for(let n=0;n<t;n++){h.x=n*i;const t=F(u,h,e);f.set(`${o}/${l}/${n}`,t)}}o<c-1&&(u=W(u,l)),s=Math.round(s/2),a=Math.round(a/2)}return f}function D(t){const{pixelBlock:e,tileSize:n,level:l,row:i,col:r,useBilinear:s}=t;if(!o(e))return null;const{width:a,height:f}=n,h=2**l,c=h*a,u=h*f;let p=F(e,{y:i*u,x:r*c},{width:c,height:u});if(!p)return null;for(let o=l;o>0;o--)p=W(p,s);return p}function N(t,e,n,l,i=0){const{width:o,height:r}=t,{width:s,height:a}=e,f=l.cols,h=l.rows,c=Math.ceil(s/f-.1/f),u=Math.ceil(a/h-.1/h);let p,d,x,g,m,y,w;const k=c*f,M=k*u*h,A=new Float32Array(M),U=new Float32Array(M),b=new Uint32Array(M),T=new Uint32Array(M);let B,S,v=0;for(let C=0;C<u;C++)for(let t=0;t<c;t++){p=12*(C*c+t),d=n[p],x=n[p+1],g=n[p+2],m=n[p+3],y=n[p+4],w=n[p+5];for(let e=0;e<h;e++){v=(C*h+e)*k+t*f,S=(e+.5)/h;for(let t=0;t<e;t++)B=(t+.5)/f,A[v+t]=(d*B+x*S+g)*o+i,U[v+t]=(m*B+y*S+w)*r+i,b[v+t]=Math.floor(A[v+t]),T[v+t]=Math.floor(U[v+t])}p+=6,d=n[p],x=n[p+1],g=n[p+2],m=n[p+3],y=n[p+4],w=n[p+5];for(let e=0;e<h;e++){v=(C*h+e)*k+t*f,S=(e+.5)/h;for(let t=e;t<f;t++)B=(t+.5)/f,A[v+t]=(d*B+x*S+g)*o+i,U[v+t]=(m*B+y*S+w)*r+i,b[v+t]=Math.floor(A[v+t]),T[v+t]=Math.floor(U[v+t])}}return{offsets_x:A,offsets_y:U,offsets_xi:b,offsets_yi:T,gridWidth:k}}function j(t,e){const{coefficients:n,spacing:l}=e,{offsets_x:i,offsets_y:o,gridWidth:r}=N(t,t,n,{rows:l[0],cols:l[1]}),{width:s,height:a}=t,f=new Float32Array(s*a),h=180/Math.PI;for(let c=0;c<a;c++)for(let t=0;t<s;t++){const e=c*r+t,n=0===c?e:e-r,l=c===a-1?e:e+r,u=i[n]-i[l],p=o[l]-o[n];if(isNaN(u)||isNaN(p))f[c*s+t]=90;else{let e=Math.atan2(p,u)*h;e=(360+e)%360,f[c*s+t]=e}}return f}function O(t,e,l,i,r="nearest"){if(!o(t))return null;"majority"===r&&(t=I(t));const{pixels:s,mask:a,bandMasks:f,pixelType:h}=t,c=t.width,u=t.height,p=n.getPixelArrayConstructor(h),d=s.length,{width:x,height:g}=e;let m=!1;for(let n=0;n<l.length;n+=3)-1===l[n]&&-1===l[n+1]&&-1===l[n+2]&&(m=!0);const{offsets_x:y,offsets_y:w,offsets_xi:k,offsets_yi:M,gridWidth:A}=N({width:c,height:u},e,l,i,"majority"===r?.5:0);let U;const b=(t,e,n,l)=>{const i=t instanceof Float32Array||t instanceof Float64Array?0:.5;for(let o=0;o<g;o++){U=o*A;for(let r=0;r<x;r++){if(y[U]<0||w[U]<0)t[o*x+r]=0;else if(l)t[o*x+r]=e[k[U]+M[U]*c];else{const l=Math.floor(y[U]),s=Math.floor(w[U]),a=Math.ceil(y[U]),f=Math.ceil(w[U]),h=y[U]-l,u=w[U]-s;if(!n||n[l+s*c]&&n[a+s*c]&&n[l+f*c]&&n[a+f*c]){const n=(1-h)*e[l+s*c]+h*e[a+s*c],p=(1-h)*e[l+f*c]+h*e[a+f*c];t[o*x+r]=(1-u)*n+u*p+i}else t[o*x+r]=e[k[U]+M[U]*c]}U++}}},T=[];let B;const S=f?.length===d,v=[];for(let n=0;n<d;n++){if(S){const t=new Uint8Array(x*g);b(t,f[n],f[n],!0),v.push(t)}B=new p(x*g),b(B,s[n],S?f[n]:a,"nearest"===r||"majority"===r),T.push(B)}const C=new n({width:x,height:g,pixelType:h,pixels:T,bandMasks:S?v:void 0});if(null!=a)C.mask=new Uint8Array(x*g),b(C.mask,a,a,!0);else if(m){C.mask=new Uint8Array(x*g);for(let t=0;t<x*g;t++)C.mask[t]=y[t]<0||w[t]<0?0:1}return C.updateStatistics(),C}function z(t){const{pixelBlock:e,extent:n,fieldNames:l,skipFactor:o,skipSpatialReference:r=!1,pixelIdOffset:s=0}=t,a=[],{width:f,height:h,pixels:c,mask:u}=e,p=t.imageRowSize??f,d=n.width/f,x=n.height/h,g=c.length,m=Math.floor(o/2),{xmin:y,ymax:w}=n,k=r?void 0:n.spatialReference.toJSON();for(let M=m;M<h;M+=o)for(let t=m;t<f;t+=o){const e=M*f+t;if(!u||u[e]){const n={x:y+(t+.5)*d,y:w-(M+.5)*x,spatialReference:k},o={[i]:s+M*p+t};for(let t=0;t<g;t++)o[l[t+1]]=c[t][e];a.push({geometry:n,attributes:o})}}return a}function L(t,e){const{width:n,height:l,pixels:i,mask:o}=t,r=i[0];let s=0;for(let a=0;a<l;a++){let t=a*n;for(let l=0;l<n;l++,t++)o&&!o[t]||(e[r[t]]++,s++)}return s}function V(t,e){const{width:n,height:l,pixels:i,mask:o}=t,r=e.width/n,s=e.height/l,{xmin:a,ymax:f}=e,h=e.spatialReference.toJSON(),c=[];for(let u=0;u<l;u++)for(let t=0;t<n;t++){const e=u*n+t;if(!o||o[e]){const n={x:a+(t+.5)*r,y:f-(u+.5)*s,spatialReference:h},l=i.map(t=>t[e]);c.push({location:n,value:l})}}return c}function $(t,e,l){const{attributeTable:i}=e;if(!i)return t;const o=i.fields.find(t=>t.name.toLowerCase()===l.toLowerCase()),r=i.fields.find(t=>"value"===t.name.toLowerCase());if(!o||!r)return t;const[s]=t.pixels,a="single"===o.type?"f32":"double"===o.type||"big-integer"===o.type?"f64":"small-integer"===o.type?"s16":"s32",f=s.length,h=new("f32"===a?Float32Array:"f64"===a?Float64Array:"s16"===a?Int16Array:Int32Array)(f),c=new Map;for(const n of i.features){const t=n.attributes[r.name],e=n.attributes[o.name];c.set(t,e)}const u=t.mask??new Uint8Array(f).fill(255);for(let n=0;n<f;n++)if(u[n]){const t=c.get(s[n]);null==t?u[n]=0:h[n]=t}return new n({width:t.width,height:t.height,pixels:[h],mask:u,pixelType:a})}export{O as approximateTransform,F as clip,D as clipTile,f as colorize,s as compositeBands,z as convertPixelBlockToFeatures,L as countCategoricalPixels,a as createColormapLUT,U as createMaskLUT,g as createRangeMaps,A as createRemapLUT,r as extractBands,b as getClipBounds,j as getLocalArithmeticNorthRotations,V as getValidPixels,d as highlightPixels,N as interpolateOffsets,o as isValidPixelBlock,c as lookupBandValues,h as lookupPixels,$ as mapPixelValueToAttribute,M as mask,k as matchAnyMask,l as maxMapSizeGpu,S as mosaic,T as mosaicPixelData,i as pixelIdFieldName,m as remap,x as remapColor,I as resampleByMajority,u as selectBySingleBandRange,p as selectByXYMask,C as setValidBoundary,E as split};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ import{assertIsSome as t}from"../../../core/maybe.js";import{getPixelValueRange as n}from"../formats/pixelRangeUtils.js";import e from"../../support/PixelBlock.js";import{stretchTypeFunctionEnum as s}from"../../../renderers/support/stretchRendererUtils.js";const i=1,o=[.299,.587,.114];function a(t){if(null==t)return!1;const{max:n,min:e,size:s}=t;return(n-e)/s===1&&e>=-.5&&.5===Math.abs(e%1)&&n<=255.5}function r(t,n=256){const e=255;n=Math.min(n,e+1);const{size:s,counts:i}=t,o=new Float64Array(s);o[0]=i[0]/n;for(let a=1;a<s;a++)o[a]=o[a-1]+i[a]/n;const r=new Uint8Array(n),l=n/o[o.length-1];if(s<=n){const i=a(t)?Math.max(0,Math.round(t.min+.5)):0;for(let t=i;t<n;t++)r[t]=t>=s+i?e:Math.min(e,Math.trunc(o[t-i]*l))}else{const t=o.map(t=>Math.min(255,Math.trunc(t*l)));for(let e=0;e<n;e++)r[e]=t[Math.round(s/n)];r[n-1]=255}return r}function l(t){const{minCutOff:n,maxCutOff:e,gamma:s,pixelType:i,rounding:o}=t;if(!["u8","u16","s8","s16"].includes(i))return null;const a=n.length,r="s8"===i?-127:"s16"===i?-32767:0,l=["u16","s16"].includes(i)?65536:256,c=[],m=[],{minOutput:f=0,maxOutput:h=255}=t,d=h-f;for(let u=0;u<a;u++)m[u]=e[u]-n[u],c[u]=0===m[u]?0:d/m[u];const g=[];if(s&&s.length>=a){const t=w(a,s);for(let i=0;i<a;i++){const a=[];for(let u=0;u<l;u++){if(0===m[i]){a[u]=f;continue}const l=u+r,c=(l-n[i])/m[i];let g=1;if(s[i]>1&&(g-=(1/d)**(c*t[i])),l<e[i]&&l>n[i]){const t=g*d*c**(1/s[i])+f;a[u]="floor"===o?Math.floor(t):"round"===o?Math.round(t):t}else l>=e[i]?a[u]=h:a[u]=f}g[i]=a}}else for(let u=0;u<a;u++){const t=[];for(let s=0;s<l;s++){const i=s+r;if(i<=n[u])t[s]=f;else if(i>=e[u])t[s]=h;else{const e=(i-n[u])*c[u]+f;t[s]="floor"===o?Math.floor(e):"round"===o?Math.round(e):e}}g[u]=t}if(null!=t.contrastOffset){const n=u(t.contrastOffset,t.brightnessOffset);for(let t=0;t<a;t++){const e=g[t];for(let t=0;t<l;t++)e[t]=n[e[t]]}}return{lut:g,offset:r}}function u(t,n){const e=Math.min(Math.max(t,-100),100),s=Math.min(Math.max(n??0,-100),100),i=255,o=128,a=new Uint8Array(256);for(let r=0;r<256;r++){let t=0;e>0&&e<100?t=(200*r-100*i+2*i*s)/(2*(100-e))+o:e<=0&&e>-100?t=(200*r-100*i+2*i*s)*(100+e)/2e4+o:100===e?(t=200*r-100*i+(i+1)*(100-e)+2*i*s,t=t>0?i:0):-100===e&&(t=o),a[r]=t>i?i:t<0?0:t}return a}function c(t,n,e){const s=[];for(let i=0;i<n.length;i++){let a=0,r=0,l=0;"min"in n[i]?({min:a,max:r,avg:l}=n[i]):[a,r,l]=n[i];let u=l??0;"u8"!==t&&(u=255*(u-a)/(r-a)),e&&(u*=o[i]),s.push(m(u))}return s}function m(t){if(t<=0||t>=255)return i;const n=255,e=t+(150===t?0:t<150?45*Math.cos(.01047*t):17*Math.sin(.021*t)),s=Math.log(t/n),o=Math.log(e/n);if(0===o)return i;const a=s/o;return isNaN(a)?i:Math.min(9.9,Math.max(.01,a))}function f(t,n,e){let{min:s,max:i,count:o,avg:a,mode:r,median:l}=d(t,n,!0);if(0===o)return{statistics:{min:0,max:0,avg:0,stddev:0,count:o,mode:0,median:0},histogram:null};const u={min:s,max:i,avg:a,mode:r,count:o,median:l},c=M(t,n,a,!e.includeSkewnessKurtosis);c&&(u.stddev=c.stddev,e.includeSkewnessKurtosis&&(u.skewness=c.skewness,u.kurtosis=c.kurtosis));const m=e?.histogramSize??256,f=!!e?.pixelType&&["u8","s8","u4","u2","u1"].includes(e.pixelType),g=!e?.skipHistograms;if(null==l){const e=h({band:t,mask:n,min:s,max:i,size:1e4,use8BitHistogram:f});if(l=x(t,n,e,50),g&&f&&256===m)return{statistics:u,histogram:e}}if(!g)return{statistics:u,histogram:null};return{statistics:u,histogram:h({band:t,mask:n,min:s,max:i,size:m,use8BitHistogram:f&&256===m})}}function h(t){const{band:n,mask:e,min:s,max:i,use8BitHistogram:o}=t;if(o){const t=i-s+1,o=new Uint32Array(t);for(let i=0;i<n.length;i++)e&&!e[i]||o[n[i]-s]++;return{min:s-.5,max:i+.5,size:t,counts:o}}const a=t.size??256,r=new Uint32Array(a),l=(i-s)/a;if(0===l){const t=e?e.reduce((t,n)=>t+(n?1:0),0):n.length;return{min:s,max:i,size:1,counts:new Uint32Array(1).fill(t)}}const u=new Uint32Array(a+1),c=1/l;for(let m=0;m<n.length;m++)e&&!e[m]||u[Math.floor((n[m]-s)*c)]++;for(let m=0;m<a-1;m++)r[m]=u[m];return r[a-1]=u[a-1]+u[a],{min:s,max:i,size:a,counts:r}}function d(t,n,e=!1,s=!1){let i=1/0,o=-1/0,a=0,r=0,l=0,u=0;const c=t.length,m=new Map;for(let p=0;p<c;p++){const e=t[p];if(!n||n[p]){const t=(m.get(e)??0)+1;m.set(e,t),t>u&&(u=t,l=e),i=e<i?e:i,o=e>o?e:o,a+=e,r++}}const f=r>0?a/r:0;let h=i===o?i:void 0,d=i===o?i:void 0,g=i===o?i:void 0;if(e&&r>0&&r<2**24){let e=t.slice();if(n){let s=0;for(let i=0;i<c;i++){const o=t[i];n[i]&&(e[s++]=o)}}e=e.slice(0,r),e.sort((t,n)=>t-n);const i=r>>>1;h=r%2?e[Math.floor(i)]:(e[i-1]+e[i])/2,s&&(d=e[Math.floor(.25*r)],g=e[Math.floor(.75*r)])}return{min:i,max:o,count:r,avg:f,mode:l,median:h,quartile1:d,quartile3:g}}function g(t,n,e){let{min:s,max:i,avg:o,median:a,quartile1:r,quartile3:l}=d(t,n,!0,!0);if(null==a||null==r||null==l){const o=h({band:t,mask:n,min:s,max:i,size:1e4,use8BitHistogram:["u8","s8","u4","u2","u1"].includes(e)});a=x(t,n,o,50),r=x(t,n,o,25),l=x(t,n,o,75)}return{min:s,max:i,avg:o,median:a,quartile1:r,quartile3:l}}function p(t){const{pixels:n,mask:e,bandMasks:s,pixelType:i}=t;return n.map((t,n)=>g(t,s?.[n]??e,i))}function x(t,n,e,s=50){const{counts:i,min:o,max:a,size:r}=e,l=i.reduce((t,n)=>t+n)*(s/=100);let u=0,c=0;for(;c<i.length&&(u+=i[c],!(u>=l+1));c++);const m=(a-o)/r,f=o+m*c,h=o+m*(c+1);if(1===m&&.5===Math.abs(o%1))return f+.5;const d=t.slice(0,i[c]).fill(0);for(let p=0,x=0;p<t.length;p++)if(!n||n[p]){const n=t[p];n>=f&&n<h&&(d[x++]=n)}d.sort((t,n)=>t-n);const g=u-Math.floor(l)-1;return d[Math.max(0,d.length-1-g)]}function M(t,n,e,s=!1,i=!1){let o=0,a=0,r=0,l=0;for(let c=0;c<t.length;c++)if(!n||n[c]){const n=t[c]-e,i=n*n;if(o+=i,!s){const t=i*n;a+=t;r+=t*n}l++}if(l<2)return null;o/=l-1;const u=Math.sqrt(o);if(s)return{stddev:u};r/=l;return{stddev:u,skewness:i?a*(l/((l-1)*(l-2)))/o**1.5:a/l/o**1.5,kurtosis:r/(o*o)}}function k(t,n){const{pixels:e,mask:s,pixelType:i,bandMasks:o}=t,a=e.map((t,e)=>f(t,o?.[e]??s,{pixelType:i,...n}));return{statistics:a.map(({statistics:t})=>t),histograms:a.map(({histogram:t})=>t)}}function y(t){if(!t?.pixels?.length)return null;const{pixels:n,mask:e,bandMasks:s,pixelType:i}=t,o=t.width*t.height,a=n.length,r=[],l=[],u=256;let c,m;for(let f=0;f<a;f++){let a=new Uint32Array(u);const h=n[f],d=s?.[f]??e;if("u8"===i){if(c=255,m=0,d){for(let t=0;t<o;t++)if(d[t]){const n=h[t];c=n<c?n:c,m=n>m?n:m,a[n]++}}else for(let t=0;t<o;t++){const n=h[t];c=n<c?n:c,m=n>m?n:m,a[n]++}a=a.slice(c,m+1)}else{let n=!1;t.statistics||(t.updateStatistics(),n=!0);const e=t.statistics;c=e[f].minValue,m=e[f].maxValue;const s=(m-c)/u;if(0===s){!e||t.validPixelCount||n||t.updateStatistics();const s=(t.validPixelCount||t.width*t.height)/u;for(let t=0;t<u;t++)a[t]=Math.round(s*(t+1))-Math.round(s*t)}else{const t=new Uint32Array(u+1);for(let n=0;n<o;n++)d&&!d[n]||t[Math.floor((h[n]-c)/s)]++;for(let n=0;n<u-1;n++)a[n]=t[n];a[u-1]=t[u-1]+t[u]}}const g="u8"===i?c-.5:c,p="u8"===i?m+.5:m;r.push({min:g,max:p,size:a.length,counts:a});let x=0,M=0,k=0;for(let t=0;t<a.length;t++)x+=a[t],M+=t*a[t];const y=M/x;for(let t=0;t<a.length;t++)k+=a[t]*(t-y)**2;const v=Math.sqrt(k/(x-1)),b=(p-g)/a.length,O=(y+("u8"===i?0:.5))*b+c,w=v*b;l.push({min:c,max:m,avg:O,stddev:w})}return{statistics:l,histograms:r}}function v(t){const n=[];for(let e=0;e<t.length;e++){const{min:s,max:i,size:o,counts:a}=t[e];let r=0,l=0;for(let t=0;t<o;t++)r+=a[t],l+=t*a[t];const u=l/r;let c=0;for(let t=0;t<o;t++)c+=a[t]*(t-u)**2;const m=(i-s)/o,f=(u+.5)*m+s,h=Math.sqrt(c/(r-1))*m;n.push({min:s,max:i,avg:f,stddev:h})}return n}function b(e,i){const{pixelBlock:o,bandIds:a,returnHistogramLut:l,rasterInfo:u}=i;let c=null,m=null,f=e.stretchType;if("number"==typeof f&&(f=s[f]),e.dra)if("minMax"===f&&o?.statistics)c=o.statistics.map(t=>[t.minValue,t.maxValue,0,0]);else{const t=y(o);c=null!=t?t.statistics:null,m=null!=t?t.histograms:null}else c=e.statistics?.length?e.statistics:u.statistics,m="histograms"in e?e.histograms:void 0,m||(m=u.histograms);"percentClip"!==f&&"histogramEqualization"!==f||m?.length||(f="minMax");const h=c?.length||m?.length||u.bandCount,d=[],g=[];c&&!Array.isArray(c[0])&&(c=c.map(t=>[t.min,t.max,t.avg,t.stddev]));const[p,x]=n(u.pixelType);if(!c?.length){c=[];for(let t=0;t<h;t++)c.push([p,x,1,1]);"standardDeviation"===f&&(f="minMax")}switch(f){case"none":for(let t=0;t<h;t++)d[t]=p,g[t]=x;break;case"minMax":for(let t=0;t<h;t++){const n=c[t];d[t]=n[0],g[t]=n[1]}break;case"standardDeviation":{const{numberOfStandardDeviations:t=2}=e;for(let n=0;n<h;n++){const e=c[n];d[n]=e[2]-t*e[3],g[n]=e[2]+t*e[3],d[n]<e[0]&&(d[n]=e[0]),g[n]>e[1]&&(g[n]=e[1])}}break;case"histogramEqualization":t(m);for(let t=0;t<h;t++)d[t]=m[t].min,g[t]=m[t].max;break;case"percentClip":t(m);for(let t=0;t<m.length;t++){const n=m[t],s=new Uint32Array(n.size),i=[...n.counts];i.length>=20&&(i[0]=i[1]=i[2]=i[i.length-1]=i[i.length-2]=0);let o=0;const a=(n.max-n.min)/n.size,r=-.5===n.min&&1===a?.5:0;for(let t=0;t<n.size;t++)o+=i[t],s[t]=o;let l=(e.minPercent||0)*o/100;d[t]=n.min+r;for(let e=0;e<n.size;e++)if(s[e]>l){d[t]=n.min+a*(e+r);break}l=(1-(e.maxPercent||0)/100)*o,g[t]=n.max+r;for(let e=n.size-2;e>=0;e--)if(s[e]<l){g[t]=n.min+a*(e+2-r);break}if(g[t]<d[t]){const n=d[t];d[t]=g[t],g[t]=n}}break;default:for(let t=0;t<h;t++){const n=c[t];d[t]=n[0],g[t]=n[1]}}let M,k,v;"histogramEqualization"===f?(t(m),k=m[0].size||256,M=0,l&&(v=m.map(t=>r(t)))):(k=e.max||255,M=e.min||0);return O({minCutOff:d,maxCutOff:g,maxOutput:k,minOutput:M,histogramLut:v},a)}function O(t,n){if(null==n||0===n.length)return t;const e=Math.max.apply(null,n),{minCutOff:s,maxCutOff:i,minOutput:o,maxOutput:a,histogramLut:r}=t;return s.length===n.length||s.length<=e?t:{minCutOff:n.map(t=>s[t]),maxCutOff:n.map(t=>i[t]),histogramLut:r?n.map(t=>r[t]):null,minOutput:o,maxOutput:a}}function w(t,n){const e=new Float32Array(t);for(let s=0;s<t;s++)n[s]>1?n[s]>2?e[s]=6.5+(n[s]-2)**2.5:e[s]=6.5+100*(2-n[s])**4:e[s]=1;return e}function z(t,n){if(!t?.pixels?.length)return t;const{mask:s,bandMasks:i,width:o,height:a,pixels:r}=t,{minCutOff:l,maxCutOff:u,minOutput:c,maxOutput:m,gamma:f}=n,h=o*a,d=n.outputPixelType||"u8",g=t.pixels.map(()=>e.createEmptyBand(d,h)),p=g.length,x=m-c,M=[],k=[];for(let e=0;e<p;e++)k[e]=u[e]-l[e],M[e]=0===k[e]?0:x/k[e];const y=d.startsWith("u")||d.startsWith("s"),v=f&&f.length>=p,b=!!n.isRenderer;if(v){const t=w(p,f);for(let n=0;n<p;n++){const e=i?.[n]??s;for(let s=0;s<h;s++)if(null==e||e[s]){if(0===k[n]){g[n][s]=c;continue}const e=r[n][s],i=(e-l[n])/k[n];let o=1;if(f[n]>1&&(o-=(1/x)**(i*t[n])),e<u[n]&&e>l[n]){const t=o*x*i**(1/f[n])+c;g[n][s]=b?Math.floor(t):y?Math.round(t):t}else e>=u[n]?g[n][s]=m:g[n][s]=c}}}else for(let e=0;e<p;e++){const t=i?.[e]??s;for(let n=0;n<h;n++)if(null==t||t[n]){const t=r[e][n];if(t<u[e]&&t>l[e]){const s=(t-l[e])*M[e]+c;g[e][n]=b?Math.floor(s):y?Math.round(s):s}else t>=u[e]?g[e][n]=m:g[e][n]=c}}const O=new e({width:o,height:a,mask:s,bandMasks:i,pixels:g,pixelType:d});return O.updateStatistics(),O}export{p as computeBoxStatistics,w as computeGammaCorrection,c as computeGammaValues,k as computeStatisticsHistograms,u as createContrastBrightnessLUT,r as createHistogramEqualizationLUT,l as createStretchLUT,v as estimateStatisticsFromHistograms,y as estimateStatisticsHistograms,b as getStretchCutoff,a as isStandardU8Histogram,z as stretch};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ import{isValidPixelBlock as t}from"./pixelUtils.js";import e from"../../support/PixelBlock.js";import{SimpleBandStatistics as i}from"../../support/SimpleBandStatistics.js";const s=1,n=1/111e3;function o(t){let{altitude:e,azimuth:i}=t;const{hillshadeType:s,pixelSizePower:o=1,pixelSizeFactor:a=1,scalingType:l,isGCS:r,resolution:c}=t,h="multi-directional"===s?2*t.zFactor:t.zFactor,{x:u,y:f}=c;let d=h/(8*u),p=h/(8*f);if(r&&h>.001&&(d/=n,p/=n),"adjusted"===l)if(r){const t=u*n,e=f*n;d=(h+t**o*a)/(8*t),p=(h+e**o*a)/(8*e)}else d=(h+u**o*a)/(8*u),p=(h+f**o*a)/(8*f);let x=(90-e)*Math.PI/180,w=Math.cos(x),y=(360-i+90)*Math.PI/180,m=Math.sin(x)*Math.cos(y),M=Math.sin(x)*Math.sin(y);const z=[315,270,225,360,180,0],A=[60,60,60,60,60,90],g=new Float32Array([3,5,3,2,1,4]),F=g.reduce((t,e)=>t+e),k=g.map(t=>t/F),P="multi-directional"===s?z.length:1,S=new Float32Array(6),C=new Float32Array(6),T=new Float32Array(6);if("multi-directional"===s)for(let n=0;n<P;n++)e=A[n],i=z[n],x=(90-e)*Math.PI/180,w=Math.cos(x),y=(360-i+90)*Math.PI/180,m=Math.sin(x)*Math.cos(y),M=Math.sin(x)*Math.sin(y),S[n]=w,C[n]=m,T[n]=M;else S.fill(w),C.fill(m),T.fill(M);return{resolution:c,factor:[d,p],sinZcosA:m,sinZsinA:M,cosZ:w,sinZcosAs:[...C],sinZsinAs:[...T],cosZs:[...S],weights:[...k],hillshadeType:["traditional","multi-directional"].indexOf(s)}}function a(t,e){const{width:i,height:n}=t,o=i*n,a=new Uint8Array(o),l=null!=t.mask;let r;if(l){r=new Uint8Array(t.mask);for(let t=0;t<r.length;t++)r[t]&&(a[t]=1,r[t]=1)}const c=t.pixels[0],h=new Float32Array(o),u=new Float32Array(o);let f,d=0;if(e){const{resolution:t}=e,i=t?(t.x+t.y)/2:1;d=200*e.zFactor/(i*i),f=new Float32Array(o)}const p=e?.curvatureType;let x,w,y,m,M,z,A,g;for(let F=s;F<n-s;F++){const t=F*i;for(let e=s;e<i-s;e++){const s=t+e;if(0!==r?.[s]){if(r){if(r[s-i-1]+r[s-i]+r[s-i+1]+r[s-1]+r[s+1]+r[s+i-1]+r[s+i]+r[s+i+1]<7){a[s]=0;continue}x=r[s-i-1]?c[s-i-1]:c[s],w=r[s-i]?c[s-i]:c[s],y=r[s-i+1]?c[s-i+1]:c[s],m=r[s-1]?c[s-1]:c[s],M=r[s+1]?c[s+1]:c[s],z=r[s+i-1]?c[s+i-1]:c[s],A=r[s+i]?c[s+i]:c[s],g=r[s+i+1]?c[s+i+1]:c[s]}else x=c[s-i-1],w=c[s-i],y=c[s-i+1],m=c[s-1],M=c[s+1],z=c[s+i-1],A=c[s+i],g=c[s+i+1];if(h[s]=y+M+M+g-(x+m+m+z),u[s]=z+A+A+g-(x+w+w+y),null!=f){const t=c[s],e=.5*(m+M)-t,i=.5*(w+A)-t;if("standard"===p)f[s]=-d*(e+i);else{const t=(-x+y+z-g)/4,n=(-m+M)/2,o=(w-A)/2,a=n*n,l=o*o,r=a+l;r&&(f[s]="profile"===p?d*(e*a+i*l+t*n*o)/r:-d*(e*l+i*a-t*n*o)/r)}}}}}return{outMask:l?a:null,dzxs:h,dzys:u,curvatures:f}}function l(t,e,i){for(let s=0;s<i;s++)t[s*e]=t[s*e+1],t[(s+1)*e-1]=t[(s+1)*e-2];for(let s=1;s<e-1;s++)t[s]=t[s+e],t[s+(i-1)*e]=t[s+(i-2)*e]}function r(n,r){if(!t(n))return n;const{factor:c,sinZcosA:h,sinZsinA:u,cosZ:f,sinZcosAs:d,sinZsinAs:p,cosZs:x,weights:w}=o(r),[y,m]=c,M="traditional"===r.hillshadeType,{width:z,height:A}=n,g=new Uint8Array(z*A),{dzxs:F,dzys:k,outMask:P}=a(n);for(let t=s;t<A-s;t++){const e=t*z;for(let t=s;t<z-s;t++){const i=e+t;if(!P||P[i]){const t=F[i]*y,e=k[i]*m,s=Math.sqrt(1+t*t+e*e);let n=0;if(M){let i=255*(f+u*e-h*t)/s;i<0&&(i=0),n=i}else{const i=p.length;for(let o=0;o<i;o++){let i=255*(x[o]+p[o]*e-d[o]*t)/s;i<0&&(i=0),n+=i*w[o]}}g[i]=255&n}}}l(g,z,A);return new e({width:z,height:A,pixels:[g],mask:P,pixelType:"u8",validPixelCount:n.validPixelCount,statistics:[new i(0,255)]})}function c(e,i,s,n){if(!t(e)||!t(i))return;const{min:o,max:a}=n,l=e.pixels[0],{pixels:r,mask:c}=i,h=r[0],u=255.00001/(a-o),f=new Uint8ClampedArray(h.length),d=new Uint8ClampedArray(h.length),p=new Uint8ClampedArray(h.length),x=s.length-1;for(let t=0;t<h.length;t++){if(0===c?.[t])continue;const e=Math.floor((h[t]-o)*u),[i,n]=s[e<0?0:e>x?x:e],a=l[t],r=a*n,w=r*(1-Math.abs(i%2-1)),y=a-r;switch(Math.floor(i)){case 0:f[t]=r+y,d[t]=w+y,p[t]=y;break;case 1:f[t]=w+y,d[t]=r+y,p[t]=y;break;case 2:f[t]=y,d[t]=r+y,p[t]=w+y;break;case 3:f[t]=y,d[t]=w+y,p[t]=r+y;break;case 4:f[t]=w+y,d[t]=y,p[t]=r+y;break;case 5:case 6:f[t]=r+y,d[t]=y,p[t]=w+y}}e.pixels=[f,d,p],e.updateStatistics()}function h(i,o){if(!t(i))return i;const r=o.zFactor,c=o.pixelSizePower??1,h=o.pixelSizeFactor??1,u=o.slopeType,f=o.isGCS,{x:d,y:p}=o.resolution;let x=r/(8*d),w=r/(8*p);f&&Math.abs(r-1)<1e-4&&(x/=n,w/=n),"adjusted"===u&&(x=(r+d**c*h)/(8*d),w=(r+p**c*h)/(8*p));const{dzxs:y,dzys:m,outMask:M}=a(i),{width:z,height:A}=i,g=new Float32Array(z*A);for(let t=s;t<A-s;t++){const e=t*z;for(let t=s;t<z-s;t++){const i=e+t;if(!M||M[i]){const s=y[i]*x,n=m[i]*w,o=Math.sqrt(s*s+n*n);g[e+t]="percent-rise"===u?100*o:57.2957795*Math.atan(o)}}}l(g,z,A);const F=new e({width:z,height:A,pixels:[g],mask:M,pixelType:"f32",validPixelCount:i.validPixelCount});return F.updateStatistics(),F}function u(n,o={}){if(!t(n))return n;const{resolution:r}=o,c=r?1/r.x:1,h=r?1/r.y:1,{dzxs:u,dzys:f,outMask:d}=a(n),{width:p,height:x}=n,w=new Float32Array(p*x);for(let t=s;t<x-s;t++){const e=t*p;for(let t=s;t<p-s;t++){const i=e+t;if(!d||d[i]){const s=u[i]*c,n=f[i]*h;let o=-1;0===s&&0===n||(o=90-57.29578*Math.atan2(n,-s),o<0&&(o+=360),360===o?o=0:o>360&&(o%=360)),w[e+t]=o}}}l(w,p,x);return new e({width:p,height:x,pixels:[w],mask:d,pixelType:"f32",validPixelCount:n.validPixelCount,statistics:[new i(-1,360)]})}function f(i,s){if(!t(i))return i;const{curvatures:n,outMask:o}=a(i,s),{width:r,height:c}=i;l(n,r,c);const h=new e({width:r,height:c,pixels:[n],mask:o,pixelType:"f32",validPixelCount:i.validPixelCount});return h.updateStatistics(),h}function d(t,e,i){const{hillshadeType:s,altitude:n,azimuth:o,zFactor:a,pixelSizeFactor:l,pixelSizePower:r,slopeType:c}=t;return{hillshadeType:s,altitude:n,azimuth:o,zFactor:a,pixelSizePower:r,pixelSizeFactor:l,scalingType:"scaled"===c?"adjusted":"none",resolution:e,isGCS:i}}export{u as aspect,o as calculateHillshadeParams,f as curvature,n as gcsFactor,d as getHillshadeOptions,r as hillshade,h as slope,c as tintHillshade};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ import{JSONMap as t}from"../../../core/jsonMap.js";import{isValidPixelBlock as e}from"./pixelUtils.js";import n from"../../support/PixelBlock.js";const r=new Map;r.set("meter-per-second",1),r.set("kilometer-per-hour",.277778),r.set("knots",.514444),r.set("feet-per-second",.3048),r.set("mile-per-hour",.44704);const o=180/Math.PI,i=5,s=new t({esriMetersPerSecond:"meter-per-second",esriKilometersPerHour:"kilometer-per-hour",esriKnots:"knots",esriFeetPerSecond:"feet-per-second",esriMilesPerHour:"mile-per-hour"});function a(t,e){return r.get(t)/r.get(e)||1}function h(t){return(450-t)%360}function l(t,e="geographic"){const[n,r]=t,i=Math.sqrt(n*n+r*r);let s=Math.atan2(r,n)*o;return s=(360+s)%360,"geographic"===e&&(s=h(s)),[i,s]}function c(t,e="geographic"){let n=t[1];"geographic"===e&&(n=h(n)),n%=360;const r=t[0];return[r*Math.cos(n/o),r*Math.sin(n/o)]}function u(t,n,r,o="geographic"){if(!e(t)||null==r)return t;const i="vector-magdir"===n?t.clone():f(t,n),s=i.pixels[1];for(let e=0;e<s.length;e++)s[e]="geographic"===o?(s[e]+r[e]+270)%360:(s[e]+360-r[e])%360;return"vector-magdir"===n?i:f(i,"vector-magdir")}function f(t,r,o="geographic",i=1){if(!e(t))return t;const{pixels:s,width:a,height:h}=t,u=a*h,f=s[0],p=s[1],m=t.pixelType.startsWith("f")?t.pixelType:"f32",d=n.createEmptyBand(m,u),g=n.createEmptyBand(m,u);let x=0;for(let e=0;e<h;e++)for(let t=0;t<a;t++)"vector-uv"===r?([d[x],g[x]]=l([f[x],p[x]],o),d[x]*=i):([d[x],g[x]]=c([f[x],p[x]],o),d[x]*=i,g[x]*=i),x++;const M=new n({pixelType:m,width:t.width,height:t.height,mask:t.mask,validPixelCount:t.validPixelCount,maskIsAlpha:t.maskIsAlpha,pixels:[d,g]});return M.updateStatistics(),M}function p(t,n,r=1){if(1===r||!e(t))return t;const o=t.clone(),{pixels:i,width:s,height:a}=o,h=i[0],l=i[1];let c=0;for(let e=0;e<a;e++)for(let t=0;t<s;t++)"vector-uv"===n?(h[c]*=r,l[c]*=r):h[c]*=r,c++;return o.updateStatistics(),o}function m(t,e,n,r,o){if(null==o||!o.spatialReference.equals(t.spatialReference))return{extent:t,width:Math.round(e/r),height:Math.round(n/r),resolution:t.width/e};const i=o.xmin,s=o.ymax,a=(t.xmax-t.xmin)/e*r,h=(t.ymax-t.ymin)/n*r,l=(a+h)/2;return t.xmin=i+Math.floor((t.xmin-i)/a)*a,t.xmax=i+Math.ceil((t.xmax-i)/a)*a,t.ymin=s+Math.floor((t.ymin-s)/h)*h,t.ymax=s+Math.ceil((t.ymax-s)/h)*h,{extent:t,width:Math.round(t.width/a),height:Math.round(t.height/h),resolution:l}}const d=g(0,0,0);function g(t=0,e=0,n=Math.PI,r=!0){r&&(n=(2*Math.PI-n)%(2*Math.PI));const o=r?-1:1,i=13*o,s=-7*o,a=-2*o,h=-16*o,l=21.75,[c,u]=M(0,e+i,n,l),[f,p]=M(t-5.5,e+s,n,l),[m,d]=M(t+5.5,e+s,n,l),[g,x]=M(t-1.5,e+a,n,l),[k,w]=M(t+1.5,e+a,n,l),[y,P]=M(t-1.5,e+h,n,l),[b,v]=M(t+1.5,e+h,n,l);return[c,u,f,p,g,x,k,w,m,d,y,P,b,v]}function x(t=0,e=Math.PI,n=!0){n&&(e=(2*Math.PI-e)%(2*Math.PI));const r=10,o=n?-1:1,s=5*o,a=20*o,h=25*o,l=45,c=0,u=0,f=2,p=0,m=f*o,d=n?1:-1,g=r/2*d;let[x,k]=[c+g,u-a],[w,y]=[x+f*d,k],[P,b]=[w-p*d,y+m],[v,I]=[c-g,u-h],[A,_]=[v+p*d,I-m],U=Math.ceil(t/i),S=Math.floor(U/10);U-=8*S;const D=[],F=[];for(let i=0;i<U/2;i++,S--){S<=0&&U%2==1&&i===(U-1)/2&&(v=c,A=v+p*d,I=(I+k)/2,_=I-m);const[t,n]=M(v,I,e,l);if(S>0){const[r,o]=M(w,I,e,l),[i,s]=M(x,k,e,l);D.push(r),D.push(o),D.push(t),D.push(n),D.push(i),D.push(s)}else{const[r,o]=M(w,y,e,l),[i,s]=M(P,b,e,l),[a,h]=M(A,_,e,l);F.push(t),F.push(n),F.push(a),F.push(h),F.push(i),F.push(s),F.push(r),F.push(o)}I+=s,k+=s,y+=s,b+=s,_+=s}const[N,j]=M(c+g,u+a,e,l),J=(r/2+f)*d,[O,q]=M(c+J,u+a,e,l),[B,E]=M(c+g,u-h,e,l),[T,C]=M(c+J,u-h,e,l);return{pennants:D,barbs:F,shaft:[N,j,O,q,B,E,T,C]}}function M(t,e,n,r=1){const o=Math.sqrt(t*t+e*e)/r,i=(2*Math.PI+Math.atan2(e,t))%(2*Math.PI);return[o,(2*Math.PI+i-n)%(2*Math.PI)]}const k=[0,1,3,6,10,16,21,27,33,40,47,55,63],w=[0,.5,1,1.5,2],y=[0,.25,.5,1,1.5,2,2.5,3,3.5,4];function P(t,e,n,r){const o=a(r||"knots",n);let i;for(i=1;i<e.length;i++)if(i===e.length-1){if(t<e[i]*o)break}else if(t<=e[i]*o)break;return Math.min(i-1,e.length-2)}function b(t,e,n,r,o){let i=0;switch(e){case"beaufort_kn":i=P(t,k,"knots",n);break;case"beaufort_km":i=P(t,k,"kilometer-per-hour",n);break;case"beaufort_ft":i=P(t,k,"feet-per-second",n);break;case"beaufort_m":i=P(t,k,"meter-per-second",n);break;case"classified_arrow":i=P(t,o??[],r,n);break;case"ocean_current_m":i=P(t,w,"meter-per-second",n);break;case"ocean_current_kn":i=P(t,y,"knots",n)}return i}function v(t,e){const{style:n,inputUnit:r,outputUnit:o,breakValues:i}=e,a=s.fromJSON(r),h=s.fromJSON(o),l=7*6,c=15;let u=0,f=0;const{width:p,height:m,mask:x}=t,M=t.pixels[0],k=t.pixels[1],w=null!=x?x.filter(t=>t>0).length:p*m,y=new Float32Array(w*l),P=new Uint32Array(c*w),v=e.invertDirection?g(0,0,0,!1):d;for(let s=0;s<m;s++)for(let t=0;t<p;t++){const e=s*p+t;if(!x||x[s*p+t]){const r=(k[e]+360)%360/180*Math.PI,o=b(M[e],n,a,h,i);for(let n=0;n<v.length;n+=2)y[u++]=(t+.5)/p,y[u++]=(s+.5)/m,y[u++]=v[n],y[u++]=v[n+1]+r,y[u++]=o,y[u++]=M[e];const c=7*(u/l-1);P[f++]=c,P[f++]=c+1,P[f++]=c+2,P[f++]=c+0,P[f++]=c+4,P[f++]=c+3,P[f++]=c+0,P[f++]=c+2,P[f++]=c+3,P[f++]=c+2,P[f++]=c+5,P[f++]=c+3,P[f++]=c+5,P[f++]=c+6,P[f++]=c+3}}return{vertexData:y,indexData:P}}const I=[];function A(t,e){if(0===I.length)for(let i=0;i<30;i++)I.push(x(5*i,0,!e.invertDirection));const n=a(s.fromJSON(e.inputUnit),"knots"),{width:r,height:o,mask:h}=t,l=t.pixels[0],c=t.pixels[1],u=6,f=[],p=[];let m=0,d=0;for(let s=0;s<o;s++)for(let t=0;t<r;t++){const e=s*r+t,a=l[e]*n;if((!h||h[s*r+t])&&a>=i){const n=(c[e]+360)%360/180*Math.PI,{pennants:i,barbs:h,shaft:l}=I[Math.min(Math.floor(a/5),29)];if(i.length+h.length===0)continue;let g=f.length/u;const x=(t+.5)/r,M=(s+.5)/o;for(let t=0;t<i.length;t+=2)f[m++]=x,f[m++]=M,f[m++]=i[t],f[m++]=i[t+1]+n,f[m++]=0,f[m++]=a;for(let t=0;t<h.length;t+=2)f[m++]=x,f[m++]=M,f[m++]=h[t],f[m++]=h[t+1]+n,f[m++]=0,f[m++]=a;for(let t=0;t<l.length;t+=2)f[m++]=x,f[m++]=M,f[m++]=l[t],f[m++]=l[t+1]+n,f[m++]=0,f[m++]=a;for(let t=0;t<i.length/6;t++)p[d++]=g,p[d++]=g+1,p[d++]=g+2,g+=3;for(let t=0;t<h.length/8;t++)p[d++]=g,p[d++]=g+1,p[d++]=g+2,p[d++]=g+1,p[d++]=g+2,p[d++]=g+3,g+=4;p[d++]=g+0,p[d++]=g+1,p[d++]=g+2,p[d++]=g+1,p[d++]=g+3,p[d++]=g+2,g+=4}}return{vertexData:new Float32Array(f),indexData:new Uint32Array(p)}}function _(t,e){const n=4*6;let r=0,o=0;const{width:h,height:l,mask:c}=t,u=t.pixels[0],f=[],p=[],m=a(s.fromJSON(e.inputUnit),"knots"),d="wind_speed"===e.style?i:Number.MAX_VALUE;for(let i=0;i<l;i++)for(let t=0;t<h;t++){const e=u[i*h+t]*m;if((!c||c[i*h+t])&&e<d){for(let n=0;n<4;n++)f[r++]=(t+.5)/h,f[r++]=(i+.5)/l,f[r++]=n<2?-.5:.5,f[r++]=n%2==0?-.5:.5,f[r++]=0,f[r++]=e;const s=4*(r/n-1);p[o++]=s,p[o++]=s+1,p[o++]=s+2,p[o++]=s+1,p[o++]=s+2,p[o++]=s+3}}return{vertexData:new Float32Array(f),indexData:new Uint32Array(p)}}function U(t,e){return"simple_scalar"===e.style?_(t,e):"wind_speed"===e.style?A(t,e):v(t,e)}function S(t,e,r,o=[0,0],i=.5){const{width:s,height:a,mask:h}=t,[u,f]=t.pixels,[p,m]=o,d=Math.round((s-p)/r),g=Math.round((a-m)/r),x=d*g,M=new Float32Array(x),k=new Float32Array(x),w=new Uint8Array(x),y="vector-uv"===e;for(let n=0;n<g;n++)for(let t=0;t<d;t++){let e=0;const o=n*d+t,g=Math.max(0,n*r+m),x=Math.max(0,t*r+p),P=Math.min(a,g+r),b=Math.min(s,x+r);for(let t=g;t<P;t++)for(let n=x;n<b;n++){const r=t*s+n;if(!h||h[r]){e++;const t=y?[u[r],f[r]]:[u[r],(360+f[r])%360],[n,i]=y?t:c(t);M[o]+=n,k[o]+=i}}if(e>=(P-g)*(b-x)*(1-i)){w[o]=1;const[t,n]=l([M[o]/e,k[o]/e]);M[o]=t,k[o]=n}else w[o]=0,M[o]=0,k[o]=0}const P=new n({width:d,height:g,pixels:[M,k],mask:w});return P.updateStatistics(),P}export{u as convertToLocalDirections,f as convertVectorFieldData,p as convertVectorFieldUnit,U as createVFMesh,_ as createVFMeshScalar,a as getUnitConversionFactor,S as sampleVectorField,m as snapImageToSymbolTile,s as unitKebabDict,l as uvComponentToVector};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ import{__decorate as r}from"tslib";import{JSONSupport as e}from"../../../core/JSONSupport.js";import{property as t,subclass as o}from"../../../core/accessorSupport/decorators.js";let s=class extends e{get affectsPixelSize(){return!1}forwardTransform(r){return r}inverseTransform(r){return r}};r([t()],s.prototype,"affectsPixelSize",null),r([t({json:{write:!0}})],s.prototype,"spatialReference",void 0),s=r([o("esri.layers.raster.transforms.BaseRasterTransform")],s);export{s as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as r}from"tslib";import{property as e,subclass as t}from"../../../core/accessorSupport/decorators.js";import o from"./BaseRasterTransform.js";import{enumeration as s}from"../../../core/accessorSupport/decorators/enumeration.js";var n;let a=n=class extends o{constructor(){super(...arguments),this.type="gcs-shift",this.tolerance=1e-8}forwardTransform(r){return"point"===(r=r.clone()).type?(r.x>180+this.tolerance&&(r.x-=360),r):(r.xmin>=180-this.tolerance?(r.xmax-=360,r.xmin-=360):r.xmax>180+this.tolerance&&(r.xmin=-180,r.xmax=180),r)}inverseTransform(r){return"point"===(r=r.clone()).type?(r.x<-this.tolerance&&(r.x+=360),r):(r.xmin<-this.tolerance&&(r.xmin+=360,r.xmax+=360),r)}clone(){return new n({tolerance:this.tolerance})}};r([s({GCSShiftXform:"gcs-shift"})],a.prototype,"type",void 0),r([e()],a.prototype,"tolerance",void 0),a=n=r([t("esri.layers.support.rasterTransforms.GCSShiftTransform")],a);export{a as default};
5
+ import{__decorate as r}from"tslib";import{property as e,subclass as t}from"../../../core/accessorSupport/decorators.js";import o from"./BaseRasterTransform.js";import{enumeration as s}from"../../../core/accessorSupport/decorators/enumeration.js";var n;let a=n=class extends o{constructor(){super(...arguments),this.type="gcs-shift",this.tolerance=1e-8}forwardTransform(r){return"point"===(r=r.clone()).type?(r.x>180+this.tolerance&&(r.x-=360),r):(r.xmin>=180-this.tolerance?(r.xmax-=360,r.xmin-=360):r.xmax>180+this.tolerance&&(r.xmin=-180,r.xmax=180),r)}inverseTransform(r){return"point"===(r=r.clone()).type?(r.x<-this.tolerance&&(r.x+=360),r):(r.xmin<-this.tolerance&&(r.xmin+=360,r.xmax+=360),r)}clone(){return new n({tolerance:this.tolerance})}};r([s({GCSShiftXform:"gcs-shift"})],a.prototype,"type",void 0),r([e()],a.prototype,"tolerance",void 0),a=n=r([t("esri.layers.raster.transforms.GCSShiftTransform")],a);export{a as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as r}from"tslib";import{subclass as t}from"../../../core/accessorSupport/decorators.js";import o from"./BaseRasterTransform.js";import{enumeration as e}from"../../../core/accessorSupport/decorators/enumeration.js";var s;let a=s=class extends o{constructor(){super(...arguments),this.type="identity"}clone(){return new s}};r([e({IdentityXform:"identity"})],a.prototype,"type",void 0),a=s=r([t("esri.layers.support.rasterTransforms.IdentityTransform")],a);export{a as default};
5
+ import{__decorate as r}from"tslib";import{subclass as t}from"../../../core/accessorSupport/decorators.js";import o from"./BaseRasterTransform.js";import{enumeration as e}from"../../../core/accessorSupport/decorators/enumeration.js";var s;let a=s=class extends o{constructor(){super(...arguments),this.type="identity"}clone(){return new s}};r([e({IdentityXform:"identity"})],a.prototype,"type",void 0),a=s=r([t("esri.layers.raster.transforms.IdentityTransform")],a);export{a as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{property as r,subclass as t}from"../../../core/accessorSupport/decorators.js";import o from"../../../geometry/Extent.js";import i from"../../../geometry/Point.js";import n from"./BaseRasterTransform.js";import{reader as s}from"../../../core/accessorSupport/decorators/reader.js";import{writer as f}from"../../../core/accessorSupport/decorators/writer.js";import{enumeration as l}from"../../../core/accessorSupport/decorators/enumeration.js";var p;function a(e,r,t){const{x:o,y:i}=r;if(t<2){return{x:e[0]+o*e[2]+i*e[4],y:e[1]+o*e[3]+i*e[5]}}if(2===t){const r=o*o,t=i*i,n=o*i;return{x:e[0]+o*e[2]+i*e[4]+r*e[6]+n*e[8]+t*e[10],y:e[1]+o*e[3]+i*e[5]+r*e[7]+n*e[9]+t*e[11]}}const n=o*o,s=i*i,f=o*i,l=n*o,p=n*i,a=o*s,c=i*s;return{x:e[0]+o*e[2]+i*e[4]+n*e[6]+f*e[8]+s*e[10]+l*e[12]+p*e[14]+a*e[16]+c*e[18],y:e[1]+o*e[3]+i*e[5]+n*e[7]+f*e[9]+s*e[11]+l*e[13]+p*e[15]+a*e[17]+c*e[19]}}function c(e,r,t){const{xmin:i,ymin:n,xmax:s,ymax:f,spatialReference:l}=r;let p=[];if(t<2)p.push({x:i,y:f}),p.push({x:s,y:f}),p.push({x:i,y:n}),p.push({x:s,y:n});else{let e=10;for(let r=0;r<e;r++)p.push({x:i,y:n+(f-n)*r/(e-1)}),p.push({x:s,y:n+(f-n)*r/(e-1)});e=8;for(let r=1;r<=e;r++)p.push({x:i+(s-i)*r/e,y:n}),p.push({x:i+(s-i)*r/e,y:f})}p=p.map(r=>a(e,r,t));const c=p.map(e=>e.x),u=p.map(e=>e.y);return new o({xmin:Math.min.apply(null,c),xmax:Math.max.apply(null,c),ymin:Math.min.apply(null,u),ymax:Math.max.apply(null,u),spatialReference:l})}function u(e){const[r,t,o,i,n,s]=e,f=o*s-n*i,l=n*i-o*s;return[(n*t-r*s)/f,(o*t-r*i)/l,s/f,i/l,-n/f,-o/l]}let y=p=class extends n{constructor(){super(...arguments),this.polynomialOrder=1,this.type="polynomial"}readForwardCoefficients(e,r){const{coeffX:t,coeffY:o}=r;if(!t?.length||!o?.length||t.length!==o.length)return null;const i=[];for(let n=0;n<t.length;n++)i.push(t[n]),i.push(o[n]);return i}writeForwardCoefficients(e,r,t){const o=[],i=[];for(let n=0;n<e?.length;n++)n%2==0?o.push(e[n]):i.push(e[n]);r.coeffX=o,r.coeffY=i}get inverseCoefficients(){let e=this._get("inverseCoefficients");const r=this._get("forwardCoefficients");return!e&&r&&this.polynomialOrder<2&&(e=u(r)),e}set inverseCoefficients(e){this._set("inverseCoefficients",e)}readInverseCoefficients(e,r){const{inverseCoeffX:t,inverseCoeffY:o}=r;if(!t?.length||!o?.length||t.length!==o.length)return null;const i=[];for(let n=0;n<t.length;n++)i.push(t[n]),i.push(o[n]);return i}writeInverseCoefficients(e,r,t){const o=[],i=[];for(let n=0;n<e?.length;n++)n%2==0?o.push(e[n]):i.push(e[n]);r.inverseCoeffX=o,r.inverseCoeffY=i}get affectsPixelSize(){return this.polynomialOrder>0}forwardTransform(e){if("point"===e.type){const r=a(this.forwardCoefficients,e,this.polynomialOrder);return new i({x:r.x,y:r.y,spatialReference:e.spatialReference})}return c(this.forwardCoefficients,e,this.polynomialOrder)}inverseTransform(e){if("point"===e.type){const r=a(this.inverseCoefficients,e,this.polynomialOrder);return new i({x:r.x,y:r.y,spatialReference:e.spatialReference})}return c(this.inverseCoefficients,e,this.polynomialOrder)}clone(){return new p({polynomialOrder:this.polynomialOrder,forwardCoefficients:this.forwardCoefficients?[...this.forwardCoefficients]:null,inverseCoefficients:this.inverseCoefficients?[...this.inverseCoefficients]:null})}};e([r({json:{write:!0}})],y.prototype,"polynomialOrder",void 0),e([r()],y.prototype,"forwardCoefficients",void 0),e([s("forwardCoefficients",["coeffX","coeffY"])],y.prototype,"readForwardCoefficients",null),e([f("forwardCoefficients")],y.prototype,"writeForwardCoefficients",null),e([r({json:{write:!0}})],y.prototype,"inverseCoefficients",null),e([s("inverseCoefficients",["inverseCoeffX","inverseCoeffY"])],y.prototype,"readInverseCoefficients",null),e([f("inverseCoefficients")],y.prototype,"writeInverseCoefficients",null),e([r()],y.prototype,"affectsPixelSize",null),e([l({PolynomialXform:"polynomial"})],y.prototype,"type",void 0),y=p=e([t("esri.layers.support.rasterTransforms.PolynomialTransform")],y);export{y as default};
5
+ import{__decorate as e}from"tslib";import{property as r,subclass as t}from"../../../core/accessorSupport/decorators.js";import o from"../../../geometry/Extent.js";import i from"../../../geometry/Point.js";import n from"./BaseRasterTransform.js";import{reader as s}from"../../../core/accessorSupport/decorators/reader.js";import{writer as f}from"../../../core/accessorSupport/decorators/writer.js";import{enumeration as l}from"../../../core/accessorSupport/decorators/enumeration.js";var p;function a(e,r,t){const{x:o,y:i}=r;if(t<2){return{x:e[0]+o*e[2]+i*e[4],y:e[1]+o*e[3]+i*e[5]}}if(2===t){const r=o*o,t=i*i,n=o*i;return{x:e[0]+o*e[2]+i*e[4]+r*e[6]+n*e[8]+t*e[10],y:e[1]+o*e[3]+i*e[5]+r*e[7]+n*e[9]+t*e[11]}}const n=o*o,s=i*i,f=o*i,l=n*o,p=n*i,a=o*s,c=i*s;return{x:e[0]+o*e[2]+i*e[4]+n*e[6]+f*e[8]+s*e[10]+l*e[12]+p*e[14]+a*e[16]+c*e[18],y:e[1]+o*e[3]+i*e[5]+n*e[7]+f*e[9]+s*e[11]+l*e[13]+p*e[15]+a*e[17]+c*e[19]}}function c(e,r,t){const{xmin:i,ymin:n,xmax:s,ymax:f,spatialReference:l}=r;let p=[];if(t<2)p.push({x:i,y:f}),p.push({x:s,y:f}),p.push({x:i,y:n}),p.push({x:s,y:n});else{let e=10;for(let r=0;r<e;r++)p.push({x:i,y:n+(f-n)*r/(e-1)}),p.push({x:s,y:n+(f-n)*r/(e-1)});e=8;for(let r=1;r<=e;r++)p.push({x:i+(s-i)*r/e,y:n}),p.push({x:i+(s-i)*r/e,y:f})}p=p.map(r=>a(e,r,t));const c=p.map(e=>e.x),u=p.map(e=>e.y);return new o({xmin:Math.min.apply(null,c),xmax:Math.max.apply(null,c),ymin:Math.min.apply(null,u),ymax:Math.max.apply(null,u),spatialReference:l})}function u(e){const[r,t,o,i,n,s]=e,f=o*s-n*i,l=n*i-o*s;return[(n*t-r*s)/f,(o*t-r*i)/l,s/f,i/l,-n/f,-o/l]}let y=p=class extends n{constructor(){super(...arguments),this.polynomialOrder=1,this.type="polynomial"}readForwardCoefficients(e,r){const{coeffX:t,coeffY:o}=r;if(!t?.length||!o?.length||t.length!==o.length)return null;const i=[];for(let n=0;n<t.length;n++)i.push(t[n]),i.push(o[n]);return i}writeForwardCoefficients(e,r,t){const o=[],i=[];for(let n=0;n<e?.length;n++)n%2==0?o.push(e[n]):i.push(e[n]);r.coeffX=o,r.coeffY=i}get inverseCoefficients(){let e=this._get("inverseCoefficients");const r=this._get("forwardCoefficients");return!e&&r&&this.polynomialOrder<2&&(e=u(r)),e}set inverseCoefficients(e){this._set("inverseCoefficients",e)}readInverseCoefficients(e,r){const{inverseCoeffX:t,inverseCoeffY:o}=r;if(!t?.length||!o?.length||t.length!==o.length)return null;const i=[];for(let n=0;n<t.length;n++)i.push(t[n]),i.push(o[n]);return i}writeInverseCoefficients(e,r,t){const o=[],i=[];for(let n=0;n<e?.length;n++)n%2==0?o.push(e[n]):i.push(e[n]);r.inverseCoeffX=o,r.inverseCoeffY=i}get affectsPixelSize(){return this.polynomialOrder>0}forwardTransform(e){if("point"===e.type){const r=a(this.forwardCoefficients,e,this.polynomialOrder);return new i({x:r.x,y:r.y,spatialReference:e.spatialReference})}return c(this.forwardCoefficients,e,this.polynomialOrder)}inverseTransform(e){if("point"===e.type){const r=a(this.inverseCoefficients,e,this.polynomialOrder);return new i({x:r.x,y:r.y,spatialReference:e.spatialReference})}return c(this.inverseCoefficients,e,this.polynomialOrder)}clone(){return new p({polynomialOrder:this.polynomialOrder,forwardCoefficients:this.forwardCoefficients?[...this.forwardCoefficients]:null,inverseCoefficients:this.inverseCoefficients?[...this.inverseCoefficients]:null})}};e([r({json:{write:!0}})],y.prototype,"polynomialOrder",void 0),e([r()],y.prototype,"forwardCoefficients",void 0),e([s("forwardCoefficients",["coeffX","coeffY"])],y.prototype,"readForwardCoefficients",null),e([f("forwardCoefficients")],y.prototype,"writeForwardCoefficients",null),e([r({json:{write:!0}})],y.prototype,"inverseCoefficients",null),e([s("inverseCoefficients",["inverseCoeffX","inverseCoeffY"])],y.prototype,"readInverseCoefficients",null),e([f("inverseCoefficients")],y.prototype,"writeInverseCoefficients",null),e([r()],y.prototype,"affectsPixelSize",null),e([l({PolynomialXform:"polynomial"})],y.prototype,"type",void 0),y=p=e([t("esri.layers.raster.transforms.PolynomialTransform")],y);export{y as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{save as e,saveAs as t}from"./utils.js";import{getPrimaryRasters as r}from"../support/rasterDatasets/datasetUtils.js";import{getWGS84ExtentForItem as a,removeTypeKeyword as s,toggleTypeKeyword as i,typeKeyword as y}from"../../portal/support/portalItemUtils.js";const l="Image Service",o="imagery-layer-save",m="imagery-layer-save-as",n="imagery-tile-layer-save",c="imagery-tile-layer-save-as",p="WCS",u="wcs-layer-save",g="wcs-layer-save-as";function v(e){if("imagery"===e.type||"wcs"===e.type)return{isValid:!0};const{raster:t}=e,a=r(t)[0];return{isValid:"RasterTileServer"===a?.datasetFormat&&("Raster"===a.tileType||"Map"===a.tileType),errorMessage:"imagery tile layer should be created from a tiled image service."}}function f(e){const t=e.layerJSON;return Promise.resolve(t&&Object.keys(t).length?t:null)}async function d(e,t){const{parsedUrl:r,title:l,fullExtent:o}=e;t.url=r.path,t.title||=l;try{t.extent=await a(o)}catch{t.extent=void 0}s(t,y.METADATA),i(t,y.TILED_IMAGERY,"imagery-tile"===e.type)}async function I(t,r){const a="imagery"===t.type?o:"imagery-tile"===t.type?n:u,s="wcs"===t.type?p:l;return e({layer:t,itemType:s,validateLayer:v,createItemData:f,errorNamePrefix:a},r)}async function T(e,r,a){const s="imagery"===e.type?m:"imagery-tile"===e.type?c:g,i="wcs"===e.type?p:l;return t({layer:e,itemType:i,validateLayer:v,createItemData:f,errorNamePrefix:s,newItem:r,setItemProperties:d},a)}export{I as save,T as saveAs};
5
+ import{getPrimaryRasters as e}from"../raster/datasets/datasetUtils.js";import{save as t,saveAs as a}from"./utils.js";import{getWGS84ExtentForItem as r,removeTypeKeyword as s,toggleTypeKeyword as i,typeKeyword as y}from"../../portal/support/portalItemUtils.js";const l="Image Service",m="imagery-layer-save",o="imagery-layer-save-as",n="imagery-tile-layer-save",c="imagery-tile-layer-save-as",p="WCS",u="wcs-layer-save",g="wcs-layer-save-as";function v(t){if("imagery"===t.type||"wcs"===t.type)return{isValid:!0};const{raster:a}=t,r=e(a)[0];return{isValid:"RasterTileServer"===r?.datasetFormat&&("Raster"===r.tileType||"Map"===r.tileType),errorMessage:"imagery tile layer should be created from a tiled image service."}}function f(e){const t=e.layerJSON;return Promise.resolve(t&&Object.keys(t).length?t:null)}async function d(e,t){const{parsedUrl:a,title:l,fullExtent:m}=e;t.url=a.path,t.title||=l;try{t.extent=await r(m)}catch{t.extent=void 0}s(t,y.METADATA),i(t,y.TILED_IMAGERY,"imagery-tile"===e.type)}async function I(e,a){const r="imagery"===e.type?m:"imagery-tile"===e.type?n:u,s="wcs"===e.type?p:l;return t({layer:e,itemType:s,validateLayer:v,createItemData:f,errorNamePrefix:r},a)}async function T(e,t,r){const s="imagery"===e.type?o:"imagery-tile"===e.type?c:g,i="wcs"===e.type?p:l;return a({layer:e,itemType:i,validateLayer:v,createItemData:f,errorNamePrefix:s,newItem:t,setItemProperties:d},r)}export{I as save,T as saveAs};